From b1ee3884de6ff1e2a048c856de9424aaead07f1f Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 31 Jul 2008 15:53:44 +0000 Subject: [PATCH] Upped the default patron timeout to 10 minutes When an item barcode is scanned but the Enter key is not sent, the system waits a configured amount of time (default 800 milliseconds) then selects the text so the next scan will replace the existing text. Automatically print at logout time Replace Logout and Print links with "Done" links since printing is assumed git-svn-id: svn://svn.open-ils.org/ILS/trunk@10219 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../web/opac/extras/selfcheck/selfcheck.css | 9 +++ .../web/opac/extras/selfcheck/selfcheck.js | 49 ++++++++++--- .../web/opac/extras/selfcheck/selfcheck.xml | 73 +++++++++---------- Open-ILS/web/opac/locale/en-US/opac.dtd | 5 +- 4 files changed, 86 insertions(+), 50 deletions(-) diff --git a/Open-ILS/web/opac/extras/selfcheck/selfcheck.css b/Open-ILS/web/opac/extras/selfcheck/selfcheck.css index b7aa88267c..30645742a2 100644 --- a/Open-ILS/web/opac/extras/selfcheck/selfcheck.css +++ b/Open-ILS/web/opac/extras/selfcheck/selfcheck.css @@ -81,6 +81,15 @@ body { font-size: 12pt; } display: block; visibility: visible; } +#selfck-items-out-done-div { + width: 100%; + text-align: center; + margin-top: 20px; +} +.selfck-done-link { + font-size: 12pt; + font-weight: bold; +} diff --git a/Open-ILS/web/opac/extras/selfcheck/selfcheck.js b/Open-ILS/web/opac/extras/selfcheck/selfcheck.js index 3ac63e0fb8..61140b335c 100644 --- a/Open-ILS/web/opac/extras/selfcheck/selfcheck.js +++ b/Open-ILS/web/opac/extras/selfcheck/selfcheck.js @@ -24,11 +24,13 @@ var itemBarcode = null; var itemsOutTemplate = null; var isRenewal = false; var pendingXact = false; -var patronTimeout = 120000; +var patronTimeout = 600000; /* 10 minutes */ var timerId = null; var printWrapper; var printTemplate; var successfulItems = {}; +var scanTimeout = 800; +var scanTimeoutId; function selfckInit() { @@ -54,10 +56,7 @@ function selfckInit() { selfckPatronLogin(); }; - $('selfck-item-barcode-input').onkeypress = function(evt) { - if(userPressedEnter(evt)) - selfckCheckout(); - }; + $('selfck-item-barcode-input').onkeypress = selfckItemBarcodeKeypress; // for debugging, allow passing the user barcode via param var urlbc = new CGI().param('patron'); @@ -73,6 +72,28 @@ function selfckInit() { // selfckMkDummyCirc(); // testing only } + +function selfckItemBarcodeKeypress(evt) { + if(userPressedEnter(evt)) { + clearTimeout(scanTimeoutId); + selfckCheckout(); + } else { + /* If scanTimeout milliseconds have passed and there is + still data in the input box, it's a likely indication + of a partial scan. Select the text so the next scan + will replace the value */ + clearTimeout(scanTimeoutId); + scanTimeoutId = setTimeout( + function() { + if($('selfck-item-barcode-input').value) { + $('selfck-item-barcode-input').select(); + } + }, + scanTimeout + ); + } +} + /* * Start the logout timer */ @@ -100,8 +121,13 @@ function selfckResetTimer() { function selfckLogoutPatron() { $('selfck-item-barcode-input').value = ''; // prevent browser caching $('selfck-patron-login-input').value = ''; - if(patron) // page reload resets everything - location.href = location.href; + if(patron) { + selfckPrint(); + setTimeout( + function() { location.href = location.href; }, + 800 + ); + } } /* @@ -210,7 +236,7 @@ function selfckShowMsgNode(evt) { * Renders a row in the checkouts table for the current circulation */ function selfckDislplayCheckout(evt) { - unHideMe($('selfck-items-out-table')); + unHideMe($('selfck-items-out-table-wrapper')); var template = itemsOutTemplate.cloneNode(true); var copy = evt.payload.copy; @@ -279,8 +305,11 @@ function selfckRenew() { * Sets the print date and prints the page */ function selfckPrint() { - appendClear($('selfck-print-date'), text(new Date().toLocaleString())); - window.print(); + for(var x in successfulItems) { // make sure we've checked out at least one item + appendClear($('selfck-print-date'), text(new Date().toLocaleString())); + window.print(); + return; + } } diff --git a/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml b/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml index b2a98dc282..4337899087 100644 --- a/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml +++ b/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml @@ -73,16 +73,8 @@ @@ -113,6 +105,7 @@
+
@@ -120,33 +113,39 @@ - - - - - - - - - - - - - - - - - - - - - - - -
&selfck.barcode;&selfck.title;&selfck.author;&selfck.due_date;&selfck.remaining;&selfck.cotype;
- &selfck.cotype_co; - &selfck.cotype_rn; -
+
+ + + + + + + + + + + + + + + + + + + + + + + +
&selfck.barcode;&selfck.title;&selfck.author;&selfck.due_date;&selfck.remaining;&selfck.cotype;
+ &selfck.cotype_co; + &selfck.cotype_rn; +
+ +
diff --git a/Open-ILS/web/opac/locale/en-US/opac.dtd b/Open-ILS/web/opac/locale/en-US/opac.dtd index c493fbbb05..0ef11d91b6 100644 --- a/Open-ILS/web/opac/locale/en-US/opac.dtd +++ b/Open-ILS/web/opac/locale/en-US/opac.dtd @@ -645,6 +645,7 @@ Ensure Caps-Lock is off and try again or contact your local library."> + @@ -655,8 +656,7 @@ Ensure Caps-Lock is off and try again or contact your local library."> - - + @@ -666,5 +666,4 @@ Ensure Caps-Lock is off and try again or contact your local library."> - -- 2.43.2