[open-ils-commits] r18513 - in trunk/Open-ILS: web/opac/locale/en-US xul/staff_client/server/circ (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Oct 27 17:14:01 EDT 2010


Author: phasefx
Date: 2010-10-27 17:13:55 -0400 (Wed, 27 Oct 2010)
New Revision: 18513

Modified:
   trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
   trunk/Open-ILS/xul/staff_client/server/circ/checkin.js
   trunk/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul
Log:
experiment: asynchronous check-in via checkbox toggle.  also removes call number from column list for the time being (since it makes a synchronous network call)


Modified: trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-10-27 20:21:16 UTC (rev 18512)
+++ trunk/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-10-27 21:13:55 UTC (rev 18513)
@@ -2096,6 +2096,7 @@
 <!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">

Modified: trunk/Open-ILS/xul/staff_client/server/circ/checkin.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/checkin.js	2010-10-27 20:21:16 UTC (rev 18512)
+++ trunk/Open-ILS/xul/staff_client/server/circ/checkin.js	2010-10-27 21:13:55 UTC (rev 18513)
@@ -26,14 +26,13 @@
                 '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 @@
     '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 @@
             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 @@
                 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 @@
     },
 
     '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() {

Modified: trunk/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul	2010-10-27 20:21:16 UTC (rev 18512)
+++ trunk/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul	2010-10-27 21:13:55 UTC (rev 18513)
@@ -156,6 +156,7 @@
         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();"



More information about the open-ils-commits mailing list