Patch to improve the warning on double checkout attempt
authoredoceo <code@edoceo.com>
Wed, 25 Jul 2012 09:00:55 +0000 (02:00 -0700)
committerJason Stephenson <jstephenson@mvlc.org>
Fri, 14 Dec 2012 15:19:12 +0000 (10:19 -0500)
Code modifications by David Busby of Edoceo for KCLS
Released without restriction to Evergreen community
Signed-off-by: edoceo <code@edoceo.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/xul/staff_client/server/circ/checkout.js
Open-ILS/xul/staff_client/server/locale/en-US/circ.properties

index 08455c3..30dcec2 100644 (file)
@@ -924,6 +924,8 @@ circ.checkout.prototype = {
                                 }
 
                                 if (foreign_circ) { // OFFER CANCEL, NORMAL CHECKIN, AND POSSIBLY FORGIVING-BACKDATED CHECKIN
+                                    if (msg.length) msg += ' / ';
+                                    msg+= document.getElementById('circStrings').getFormattedString('staff.circ.checkout.failed_to_patron_other', [ util.date.formatted_date( my_circ.create_time(), '%{localized_date}' ) ]);
                                     var r = obj.error.yns_alert(
                                         msg,
                                         document.getElementById('circStrings').getString('staff.circ.checkout.barcode.check_out_failed'),
@@ -954,6 +956,17 @@ circ.checkout.prototype = {
                                             }
                                         } );
                                     } else {
+
+                                        // Include info about date of previous checkout in warning
+                                        if (msg.length) msg += ' / ';
+                                        var cko_d = util.date.formatted_date( my_circ.create_time(), '%{localized_date}' );
+                                        var cur_d = util.date.formatted_date( new Date(), '%{localized_date}');
+                                        if (cko_d == cur_d) {
+                                            msg+= document.getElementById('circStrings').getString('staff.circ.checkout.failed_to_patron_today');
+                                        } else {
+                                            msg+= document.getElementById('circStrings').getString('staff.circ.checkout.failed_to_patron_renew');
+                                        }
+
                                         var r = obj.error.yns_alert(
                                             msg,
                                             document.getElementById('circStrings').getString('staff.circ.checkout.barcode.check_out_failed'),
index 3f34a0f..2acaf70 100644 (file)
@@ -70,6 +70,9 @@ staff.circ.checkout.permission_denied=Permission Denied = %1$s
 # "Offline Interface" - check &staff.main.menu.circ.offline.label; in lang.dtd
 staff.circ.checkout.suggest_offline=Check Out Failed.  If you wish to use the offline interface, in the top menubar select Circulation -> Offline Interface
 staff.circ.checkout.barcode=Barcode:
+staff.circ.checkout.failed_to_patron_other=This copy was checked out by another patron on %1$s.
+staff.circ.checkout.failed_to_patron_renew=This copy is already checked out to this patron.
+staff.circ.checkout.failed_to_patron_today=This copy was already checked out to this patron today.
 staff.circ.circ_brief.staff_out_id=Check Out Staff ID = %1$s
 staff.circ.circ_brief.staff_in_id=Check In Staff ID = %1$s
 staff.circ.circ_brief.failure=Failure rendering circulation.