TPac: Disable "Enter places hold" for staff
authorThomas Berezansky <tsbere@mvlc.org>
Thu, 20 Sep 2012 19:45:05 +0000 (15:45 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 3 Oct 2012 14:54:26 +0000 (10:54 -0400)
This should prevent barcode scanners from auto-submitting on scan.

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

index 730bc6f..2066616 100644 (file)
@@ -22,7 +22,7 @@
             <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();" /><br />
+            <input type="text" name="hold_usr" id="hold_usr_input" onchange="staff_hold_usr_barcode_changed();" onkeypress="return no_hold_submit(event)" /><br />
             <input type="hidden" id="staff_barcode" value="[% ctx.staff_recipient.card.barcode | html %]"/>
             <span>
                 <input type="radio" id="hold_usr_is_requestor"
index 1cb52f3..6e2cbda 100644 (file)
@@ -19,6 +19,13 @@ function staff_hold_usr_input_disabler(input) {
         Boolean(Number(input.value));
     staff_hold_usr_barcode_changed();
 }
+function no_hold_submit(event) {
+    if (event.which == 13) {
+        staff_hold_usr_barcode_changed();
+        return false;
+    }
+    return true;
+}
 var cur_hold_barcode = undefined;
 function staff_hold_usr_barcode_changed(isload) {
     if(typeof xulG != 'undefined' && xulG.get_barcode_and_settings) {