From 6875b7a4af7340c5e0decc402319f5c4cdb08eff Mon Sep 17 00:00:00 2001 From: phasefx Date: Thu, 3 Aug 2006 19:18:17 +0000 Subject: [PATCH] new composite alert message for inactive/barred patrons, and retrieval of patron with an inactive card git-svn-id: svn://svn.open-ils.org/ILS/trunk@5256 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/server/patron/display.js | 28 +++++++++++++++++-- .../server/skin/patron_display.css | 2 +- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/patron/display.js b/Open-ILS/xul/staff_client/server/patron/display.js index 3e2d18b89f..96b1f3e4ff 100644 --- a/Open-ILS/xul/staff_client/server/patron/display.js +++ b/Open-ILS/xul/staff_client/server/patron/display.js @@ -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); diff --git a/Open-ILS/xul/staff_client/server/skin/patron_display.css b/Open-ILS/xul/staff_client/server/skin/patron_display.css index cc3a453c25..72696f8376 100755 --- a/Open-ILS/xul/staff_client/server/skin/patron_display.css +++ b/Open-ILS/xul/staff_client/server/skin/patron_display.css @@ -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; } -- 2.43.2