[open-ils-commits] r10219 - in trunk/Open-ILS/web/opac: extras/selfcheck locale/en-US

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Jul 31 11:53:51 EDT 2008


Author: erickson
Date: 2008-07-31 11:53:44 -0400 (Thu, 31 Jul 2008)
New Revision: 10219

Modified:
   trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.css
   trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.js
   trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml
   trunk/Open-ILS/web/opac/locale/en-US/opac.dtd
Log:

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



Modified: trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.css
===================================================================
--- trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.css	2008-07-31 15:45:25 UTC (rev 10218)
+++ trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.css	2008-07-31 15:53:44 UTC (rev 10219)
@@ -81,6 +81,15 @@
     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;
+}
 
 

Modified: trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.js
===================================================================
--- trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.js	2008-07-31 15:45:25 UTC (rev 10218)
+++ trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.js	2008-07-31 15:53:44 UTC (rev 10219)
@@ -24,11 +24,13 @@
 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 @@
             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 @@
 //    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 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 @@
   * 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 @@
   * 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;
+    }
 }
 
 

Modified: trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml
===================================================================
--- trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml	2008-07-31 15:45:25 UTC (rev 10218)
+++ trunk/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml	2008-07-31 15:53:44 UTC (rev 10219)
@@ -73,17 +73,9 @@
                     </div>
                     <div id='selfck-logout-link-div'>
                         <span class='selfck-link-span'>
-                            <a href='javascript:void(0);' id='selfck-print-co-button' 
-                                onclick='selfckPrint();'>&selfck.print_checkouts;</a>
+                            <a href='javascript:void(0);' class='selfck-done-link' 
+                                onclick='selfckLogoutPatron();'>&selfck.done;</a>
                         </span>
-                        <span class='selfck-link-span'>
-                            <a href='javascript:void(0);' id='selfck-logout-button' 
-                                onclick='selfckLogoutPatron();'>&selfck.logout;</a>
-                        </span>
-                        <span class='selfck-link-span'>
-                            <a href='javascript:void(0);' id='selfck-logout-print-button' 
-                                onclick='selfckPrint(); selfckLogoutPatron();'>&selfck.print_logout;</a>
-                        </span>
                     </div>
                 </div>
 
@@ -113,6 +105,7 @@
                         <div id='selfck-item-barcode-form'>
                             <span><input type='text' id='selfck-item-barcode-input'> </input></span>
                             <span><button onclick='selfckCheckout();'>&selfck.submit;</button></span>
+                            <span><button onclick='$("selfck-item-barcode-input").value = "";'>&selfck.clear;</button></span>
                         </div>
                     </div>
                 </div>
@@ -120,33 +113,39 @@
                 <!--***********************************************************************
                     This is where patrons scan in the item barcodes
                     *********************************************************************** -->
-                <table id='selfck-items-out-table' class='hide_me'>
-                    <thead>
-                        <tr>
-                            <td id='selfck-pic-cell'></td>
-                            <td>&selfck.barcode;</td>
-                            <td>&selfck.title;</td>
-                            <td>&selfck.author;</td>
-                            <td>&selfck.due_date;</td>
-                            <td>&selfck.remaining;</td>
-                            <td>&selfck.cotype;</td>
-                        </tr>
-                    </thead>
-                    <tbody id='selfck-items-out-tbody'>
-                        <tr id='selfck-items-out-row'>
-                            <td><img class='jacket' name='selfck.jacket'></img></td>
-                            <td name='selfck.barcode'></td>
-                            <td name='selfck.title'></td>
-                            <td name='selfck.author'></td>
-                            <td name='selfck.due_date'></td>
-                            <td name='selfck.remaining'></td>
-                            <td>
-                                <span name='selfck.cotype_co'>&selfck.cotype_co;</span>
-                                <span name='selfck.cotype_rn' class='hide_me'>&selfck.cotype_rn;</span>
-                            </td>
-                        </tr>
-                    </tbody>
-                </table>
+                <div id='selfck-items-out-table-wrapper' class='hide_me'>
+                    <table id='selfck-items-out-table'>
+                        <thead>
+                            <tr>
+                                <td id='selfck-pic-cell'></td>
+                                <td>&selfck.barcode;</td>
+                                <td>&selfck.title;</td>
+                                <td>&selfck.author;</td>
+                                <td>&selfck.due_date;</td>
+                                <td>&selfck.remaining;</td>
+                                <td>&selfck.cotype;</td>
+                            </tr>
+                        </thead>
+                        <tbody id='selfck-items-out-tbody'>
+                            <tr id='selfck-items-out-row'>
+                                <td><img class='jacket' name='selfck.jacket'></img></td>
+                                <td name='selfck.barcode'></td>
+                                <td name='selfck.title'></td>
+                                <td name='selfck.author'></td>
+                                <td name='selfck.due_date'></td>
+                                <td name='selfck.remaining'></td>
+                                <td>
+                                    <span name='selfck.cotype_co'>&selfck.cotype_co;</span>
+                                    <span name='selfck.cotype_rn' class='hide_me'>&selfck.cotype_rn;</span>
+                                </td>
+                            </tr>
+                        </tbody>
+                    </table>
+                    <div id='selfck-items-out-done-div'>
+                        <a href='javascript:void(0);' id='selfck-print-co-button' 
+                            class='selfck-done-link' onclick='selfckLogoutPatron();'>&selfck.done;</a>
+                    </div>
+                </div>
             </div>
         </div>
 

Modified: trunk/Open-ILS/web/opac/locale/en-US/opac.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/opac.dtd	2008-07-31 15:45:25 UTC (rev 10218)
+++ trunk/Open-ILS/web/opac/locale/en-US/opac.dtd	2008-07-31 15:53:44 UTC (rev 10219)
@@ -645,6 +645,7 @@
 <!ENTITY selfck.staff_login "Library barcode or username">
 <!ENTITY selfck.staff_pw "Password">
 <!ENTITY selfck.submit "Submit">
+<!ENTITY selfck.clear "Clear">
 <!ENTITY selfck.patron_barcode_label "Please scan your library barcode">
 <!ENTITY selfck.item_barcode_label "Please scan an item to checkout or renew:">
 <!ENTITY selfck.barcode "Barcode">
@@ -655,8 +656,7 @@
 <!ENTITY selfck.cotype "Type">
 <!ENTITY selfck.cotype_co "Checkout">
 <!ENTITY selfck.cotype_rn "Renewal">
-<!ENTITY selfck.logout "Logout">
-<!ENTITY selfck.print_logout "Print &amp; Logout">
+<!ENTITY selfck.done "Done">
 <!ENTITY selfck.welcome "Welcome">
 
 <!-- event messages -->
@@ -666,5 +666,4 @@
 <!ENTITY selfck.event.patron_not_found "The patron barcode was not found">
 <!ENTITY selfck.event.item_noncat "The requested item is not in the catalog">
 <!ENTITY selfck.event.item_nocirc "The requested item is not allowed to circulate">
-<!ENTITY selfck.print_checkouts "Print Receipt">
 



More information about the open-ils-commits mailing list