From 38bddc0020e9d01b24e00008f40b5f1b5744421c Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 9 Dec 2014 06:30:36 -0500 Subject: [PATCH] Bug 13415 - Prevent librarians from scanning multiple items into a single barcode field It appears that some librarians will attempt to scan items as fast as they can without checking to make sure the checkout was submitted and the page reloaded properly. This can cause multiple barcodes to be scanned into the barcode field if the person is fast enough. This causes the checkout of both ( or more! ) items to fail. Test Plan: 1) Apply this patch 2) Attempt to scan two or more items into the barcode field You can emulate this with a keybaord by hitting a few keys, then enter, then a few more keys, then enter again. The barcodes don't need to be valid for this test. 3) Note the dialog stating the barcode has been submitted and to please wait. Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../prog/en/modules/circ/circulation.tt | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index b938724bcd..04b9d619b9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -60,6 +60,17 @@ function toggle_onsite_checkout(){ } $(document).ready(function() { + [% IF !NEEDSCONFIRMATION %] + $('#barcode').prop('disabled', false).focus(); + [% END %] + $('#mainform').bind('submit',function() { + $('#barcode').on('keypress',function(event) { + $('#barcodeSubmittedModal').modal(); + event.preventDefault(); } + ); + }); + + [% IF !( CircAutoPrintQuickSlip == 'clear' ) %] // listen submit to trigger qslip on empty checkout $('#mainform').bind('submit',function() { @@ -528,11 +539,7 @@ No patron matched [% message %]
Enter item barcode:
- [% IF NEEDSCONFIRMATION %] - - [% ELSE %] - - [% END %] +
@@ -871,4 +878,14 @@ No patron matched [% message %] [% INCLUDE 'circ-menu.inc' %]
[% END %][% END %] + + [% INCLUDE 'intranet-bottom.inc' %] -- 2.39.5