TPAC - add "patron barcode not found" message to hold placement page
authorBen Shum <bshum@biblio.org>
Wed, 13 Feb 2013 15:30:47 +0000 (10:30 -0500)
committerBen Shum <bshum@biblio.org>
Wed, 13 Feb 2013 18:23:52 +0000 (13:23 -0500)
Add "Patron barcode not found" as an error text next to the barcode entry
when the lookup fails. This message helps warn staff that the barcode they
are attempting to use is not valid.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Michael Peters <mrpeters@library.in.gov>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Open-ILS/src/templates/opac/parts/place_hold.tt2
Open-ILS/web/js/ui/default/opac/staff.js

index c22dee4..5b6171b 100644 (file)
@@ -22,7 +22,7 @@
             <label for="hold_usr_is_requestor_not">
                 [% l("Place hold for patron by barcode:") %]
             </label>
             <label for="hold_usr_is_requestor_not">
                 [% l("Place hold for patron by barcode:") %]
             </label>
-            <input type="text" name="hold_usr" id="hold_usr_input" onchange="staff_hold_usr_barcode_changed();" onkeypress="return no_hold_submit(event)" /> <span id="patron_name"></span><br />
+            <input type="text" name="hold_usr" id="hold_usr_input" onchange="staff_hold_usr_barcode_changed();" onkeypress="return no_hold_submit(event)" /> <span id="patron_name"></span><span id="patron_usr_barcode_not_found" style="display: none">[% l('Patron barcode was not found') %]</span><br />
             <input type="hidden" id="staff_barcode" value="[% ctx.staff_recipient.card.barcode | html %]"/>
             <span>
                 <input type="radio" id="hold_usr_is_requestor"
             <input type="hidden" id="staff_barcode" value="[% ctx.staff_recipient.card.barcode | html %]"/>
             <span>
                 <input type="radio" id="hold_usr_is_requestor"
index 0de11fb..ce26e03 100644 (file)
@@ -52,6 +52,7 @@ function staff_hold_usr_barcode_changed(isload) {
         var load_info = xulG.get_barcode_and_settings(window, barcode, only_settings);
         if(load_info == false || load_info == undefined) {
             document.getElementById('patron_name').innerHTML = '';
         var load_info = xulG.get_barcode_and_settings(window, barcode, only_settings);
         if(load_info == false || load_info == undefined) {
             document.getElementById('patron_name').innerHTML = '';
+            document.getElementById("patron_usr_barcode_not_found").style.display = '';
             cur_hold_barcode = null;
             return;
         }
             cur_hold_barcode = null;
             return;
         }
@@ -88,6 +89,7 @@ function staff_hold_usr_barcode_changed(isload) {
         for(var i in update_elements) update_elements[i].textContent = load_info.user_email;
         if(!document.getElementById('hold_usr_is_requestor').checked && document.getElementById('hold_usr_input').value) {
             document.getElementById('patron_name').innerHTML = load_info.patron_name;
         for(var i in update_elements) update_elements[i].textContent = load_info.user_email;
         if(!document.getElementById('hold_usr_is_requestor').checked && document.getElementById('hold_usr_input').value) {
             document.getElementById('patron_name').innerHTML = load_info.patron_name;
+            document.getElementById("patron_usr_barcode_not_found").style.display = 'none';
         }
         // Ok, now we can allow submitting again, unless this is a "true" load, in which case we likely have a blank barcode box active
         if (isload !== true)
         }
         // Ok, now we can allow submitting again, unless this is a "true" load, in which case we likely have a blank barcode box active
         if (isload !== true)