new composite alert message for inactive/barred patrons, and retrieval of patron...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 3 Aug 2006 19:18:17 +0000 (19:18 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 3 Aug 2006 19:18:17 +0000 (19:18 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5256 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/display.js
Open-ILS/xul/staff_client/server/skin/patron_display.css

index 3e2d18b..96b1f3e 100644 (file)
@@ -325,11 +325,35 @@ patron.display.prototype = {
                                                        function(req) {
                                                                try {
                                                                        var msg = '';
-                                                                       if (patron.alert_message()) msg += patron.alert_message() + '\n';
+                                                                       if (patron.alert_message()) msg += '"' + patron.alert_message() + '"\n';
+                                                                       //alert('obj.barcode = ' + obj.barcode);
+                                                                       if (obj.barcode) {
+                                                                               if (patron.cards()) for (var i = 0; i < patron.cards().length; i++) {
+                                                                                       //alert('card #'+i+' == ' + js2JSON(patron.cards()[i]));
+                                                                                       if ( (patron.cards()[i].barcode()==obj.barcode) && ( ! get_bool(patron.cards()[i].active()) ) ) {
+                                                                                               msg += 'Patron retrieved with an INACTIVE barcode.\n';
+                                                                                       }
+                                                                               }
+                                                                       }
+                                                                       if (get_bool(patron.barred())) msg += 'Patron is BARRED.\n';
+                                                                       if (!get_bool(patron.active())) msg += 'Patron is INACTIVE.\n';
+                                                                       if (patron.expire_date()) {
+                                                                               var now = new Date();
+                                                                               now = now.getTime()/1000;
+
+                                                                               var expire_parts = patron.expire_date().split('-');
+                                                                               expire_parts[1] = expire_parts[1] - 1;
+
+                                                                               var expire = new Date();
+                                                                               expire.setFullYear(expire_parts[0], expire_parts[1], expire_parts[2]);
+                                                                               expire = expire.getTime()/1000
+
+                                                                               if (expire < now) msg += 'Patron is EXPIRED.\n';
+                                                                       }
                                                                        var holds = req.getResultObject();
                                                                        if (holds.ready && holds.ready > 0) msg += 'Holds available: ' + holds.ready;
                                                                        if (msg) {
-                                                                               obj.error.yns_alert('"' + msg + '"','Alert Message','OK',null,null,'Check here to confirm this message.');
+                                                                               obj.error.yns_alert(msg,'Alert Message','OK',null,null,'Check here to confirm this message.');
                                                                        }
                                                                } catch(E) {
                                                                        obj.error.standard_unexpected_error_alert('Error showing patron alert and holds availability.',E);
index cc3a453..72696f8 100755 (executable)
@@ -50,7 +50,7 @@ deck#patron_deck { border-left: solid thin black; }
 
 .PATRON_HAS_NOTES label.note_indicator { display: inline; color: olive }
 
-.PATRON_INACTIVE .patronNameLarge { background-color: #333333; }
+.PATRON_INACTIVE .patronNameLarge { background-color: #333333; color: white; }
 .PATRON_INACTIVE label.inactive_indicator { display: inline; color: gray; }
 
 .PATRON_EXPIRED .patronNameLarge { background-color: #666666; }