experiment: asynchronous check-in via checkbox toggle. also removes call number...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Oct 2010 21:13:55 +0000 (21:13 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Oct 2010 21:13:55 +0000 (21:13 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@18513 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/server/circ/checkin.js
Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul

index c40c7c9..d2610cb 100644 (file)
 <!ENTITY staff.circ.checkin_overlay.actions.accesskey "S">
 <!ENTITY staff.circ.checkin_overlay.checkin_export.label "Export">
 <!ENTITY staff.circ.checkin_overlay.trim_list.label "Trim List (20 rows)">
+<!ENTITY staff.circ.checkin_overlay.async_checkin.label "Fast Entry (Asynchronous)">
 <!ENTITY staff.circ.checkin_overlay.strict_barcode.label "Strict Barcode">
 <!ENTITY staff.circ.checkin_overlay.do_not_alert_on_precat.label "Ignore Pre-cataloged Items">
 <!ENTITY staff.circ.checkin_overlay.do_not_alert_on_precat.accesskey "I">
index 72d1163..38c03eb 100644 (file)
@@ -26,14 +26,13 @@ circ.checkin.prototype = {
                 'barcode' : { 'hidden' : false },
                 'title' : { 'hidden' : false },
                 'location' : { 'hidden' : false },
-                'call_number' : { 'hidden' : false },
                 'status' : { 'hidden' : false },
                 'route_to' : { 'hidden' : false },
                 'alert_message' : { 'hidden' : false },
                 'checkin_time' : { 'hidden' : false }
             },
             {
-                'except_these' : [ 'uses', 'checkin_time_full' ]
+                'except_these' : [ 'uses', 'checkin_time_full', 'call_number' ]
             }
         ).concat(
             patron.util.columns( { 'family_name' : { 'hidden' : 'false' } } )
@@ -447,7 +446,14 @@ circ.checkin.prototype = {
     'checkin' : function() {
         var obj = this;
         try {
-            var barcode = obj.controller.view.checkin_barcode_entry_textbox.value;
+            var textbox = obj.controller.view.checkin_barcode_entry_textbox;
+            var async = false;
+            var async_checkbox = document.getElementById('async_checkin');
+            if (async_checkbox) { async = async_checkbox.getAttribute('checked') == 'true'; }
+            var barcode = textbox.value;
+            if (async) {
+                textbox.value = ''; textbox.focus();
+            }
             if (!barcode) return;
             if (barcode) {
                 if ( obj.test_barcode(barcode) ) { /* good */ } else { /* bad */ return; }
@@ -459,16 +465,18 @@ circ.checkin.prototype = {
             var params = { 
                 'barcode' : barcode,
                 'disable_textbox' : function() { 
-                    obj.controller.view.checkin_barcode_entry_textbox.disabled = true; 
-                    obj.controller.view.cmd_checkin_submit_barcode.setAttribute('disabled', 'true'); 
+                    if (!async) {
+                        textbox.disabled = true; 
+                        textbox.setAttribute('disabled', 'true'); 
+                    }
                 },
                 'enable_textbox' : function() { 
-                    obj.controller.view.checkin_barcode_entry_textbox.disabled = false; 
-                    obj.controller.view.cmd_checkin_submit_barcode.setAttribute('disabled', 'false'); 
+                    textbox.disabled = false; 
+                    textbox.setAttribute('disabled', 'false'); 
                 },
                 'checkin_result' : function(checkin) {
-                    obj.controller.view.checkin_barcode_entry_textbox.disabled = false;
-                    obj.controller.view.cmd_checkin_submit_barcode.setAttribute('disabled', 'false'); 
+                    textbox.disabled = false;
+                    //obj.controller.view.cmd_checkin_submit_barcode.setAttribute('disabled', 'false'); 
                     obj.checkin2(checkin,backdate);
                 }
             }; 
@@ -482,7 +490,8 @@ circ.checkin.prototype = {
                 ses(), 
                 params,
                 backdate, 
-                auto_print
+                auto_print,
+                async
             );
         } catch(E) {
             obj.error.standard_unexpected_error_alert(document.getElementById('circStrings').getFormattedString('staff.circ.checkin.exception', [E]), E);
@@ -569,16 +578,26 @@ circ.checkin.prototype = {
     },
 
     'on_checkin' : function() {
-        this.controller.view.checkin_barcode_entry_textbox.disabled = false;
-        this.controller.view.checkin_barcode_entry_textbox.select();
-        this.controller.view.checkin_barcode_entry_textbox.value = '';
-        this.controller.view.checkin_barcode_entry_textbox.focus();
+        var async = false;
+        var async_checkbox = document.getElementById('async_checkin');
+        if (async_checkbox) { async = async_checkbox.getAttribute('checked') == 'true'; }
+        if (!async) {
+            this.controller.view.checkin_barcode_entry_textbox.disabled = false;
+            this.controller.view.checkin_barcode_entry_textbox.select();
+            this.controller.view.checkin_barcode_entry_textbox.value = '';
+            this.controller.view.checkin_barcode_entry_textbox.focus();
+        }
     },
 
     'on_failure' : function() {
-        this.controller.view.checkin_barcode_entry_textbox.disabled = false;
-        this.controller.view.checkin_barcode_entry_textbox.select();
-        this.controller.view.checkin_barcode_entry_textbox.focus();
+        var async = false;
+        var async_checkbox = document.getElementById('async_checkin');
+        if (async_checkbox) { async = async_checkbox.getAttribute('checked') == 'true'; }
+        if (!async) {
+            this.controller.view.checkin_barcode_entry_textbox.disabled = false;
+            this.controller.view.checkin_barcode_entry_textbox.select();
+            this.controller.view.checkin_barcode_entry_textbox.focus();
+        }
     },
     
     'spawn_copy_editor' : function() {
index 1561a68..e208d5b 100644 (file)
         command="cmd_checkin_print"
         accesskey="&staff.checkin.print_receipt.accesskey;"/>
     <checkbox id="trim_list" label="&staff.circ.checkin_overlay.trim_list.label;" checked="true" oils_persist="checked"/> 
+    <checkbox id="async_checkin" label="&staff.circ.checkin_overlay.async_checkin.label;" checked="false" oils_persist="checked"/> 
     <checkbox id="strict_barcode" label="&staff.circ.checkin_overlay.strict_barcode.label;" checked="false" oils_persist="checked"/> 
     <spacer id="pcii3s" flex="1"/>
     <button id="checkin_modifiers" oncommand="this.firstChild.showPopup();"