From 1f7a604a54b06e6fb3295c2b55b650498cdf7e0a Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Thu, 26 Sep 2013 13:52:25 -0400 Subject: [PATCH] Bug 10240: warn when patron's card is expired This patch improves the alert messages to be slightly better English and warns the librarian if a patron's card has expired. Like all alerts, this is non-fatal since in the case of network failure there is no particular reason to expect that the offline database is current. To test this particular patch you can try checking something out to an expired patron, otherwise test plan remains the same as above. --- .../intranet-tmpl/prog/en/modules/circ/offline.tt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt index df8b62b..d43fd6a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt @@ -23,10 +23,10 @@ var ALERT_ITEM_WITHDRAWN = _("Item has been withdrawn (transaction recorded anyw var ALERT_ITEM_RESTRICTED = _("Item is restricted (transaction recorded anyway)"); var ALERT_ITEM_LOST = _("Item has been lost (transaction recorded anyway)"); var ALERT_NO_MATCHING_PATRON = _("No patron cardnumber in offline database (proceeding anyway): "); -var ALERT_PATRON_GONE_NO_ADDRESS = _("Patron's address is in doubt (transaction recorded anyway)"); +var ALERT_PATRON_GONE_NO_ADDRESS = _("Patron's address is in doubt (proceeding anyway)"); var ALERT_PATRON_CARD_LOST = _("Patron's card is lost"); var ALERT_PATRON_EXPIRED = _("Patron's card is expired"); -var ALERT_PATRON_BLOCKED_TEMPORARY = _("Patron has had overdue items and is restricted for: "); +var ALERT_PATRON_BLOCKED_TEMPORARY = _("Patron has had overdue items and is restricted until: "); var ALERT_PATRON_RESTRICTED = _("Patron is restricted"); var ALERT_PATRON_FINE = _("Patron has outstanding fines: "); var ALERT_PATRON_FINE_OVER_LIMIT = _("Patron fines are over limit: "); @@ -328,11 +328,14 @@ function checkPatronAlerts(cardnumber, patron) { } if (patron.debarred !== null) { if (patron.debarred != '9999-12-31') { - alerts.push(ALERT_PATRON_BLOCKED_TEMPORARY + $.datepicker.formatDate(dateformat, patron.debarred)); + alerts.push(ALERT_PATRON_BLOCKED_TEMPORARY + $.datepicker.formatDate(dateformat, new Date(patron.debarred))); } else { alerts.push(ALERT_PATRON_RESTRICTED); } } + if (new Date(patron.dateexpiry) < new Date()) { + alerts.push(ALERT_PATRON_EXPIRED + ' (' + $.datepicker.formatDate(dateformat, new Date(patron.dateexpiry)) + ')'); + } if (parseInt(patron.fine) > [% maxoutstanding %]) { alerts.push(ALERT_PATRON_FINE_OVER_LIMIT + patron.fine); } else if (parseInt(patron.fine) > 0) { -- 1.7.9.5