From 538ec20bdf4d7888ba58c067846241fb24863436 Mon Sep 17 00:00:00 2001 From: phasefx Date: Wed, 27 Oct 2010 21:13:55 +0000 Subject: [PATCH] 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) 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 | 1 + Open-ILS/xul/staff_client/server/circ/checkin.js | 53 +++++++++++++++------- .../staff_client/server/circ/checkin_overlay.xul | 1 + 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index c40c7c932..d2610cbe8 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -2096,6 +2096,7 @@ + diff --git a/Open-ILS/xul/staff_client/server/circ/checkin.js b/Open-ILS/xul/staff_client/server/circ/checkin.js index 72d11632d..38c03eb11 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin.js +++ b/Open-ILS/xul/staff_client/server/circ/checkin.js @@ -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() { diff --git a/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul b/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul index 1561a684b..e208d5b60 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul +++ b/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul @@ -156,6 +156,7 @@ command="cmd_checkin_print" accesskey="&staff.checkin.print_receipt.accesskey;"/> +