From c62e9c93777e91b4533da1c84621a28cb7d62a02 Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 27 Oct 2009 03:11:23 +0000 Subject: [PATCH] backporting changeset 14613: Tweak the Record In-House Use interface so that it has sound, a larger textbox for the '# of uses' field, and org unit settings that control the warning threshold and max allowed value for '# of uses'. Exceeding the cap no longer sets the value to the cap. git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_4@14617 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/locale/en-US/lang.dtd | 7 ++++--- .../server/admin/org_unit_settings.xhtml | 10 ++++++++++ .../xul/staff_client/server/circ/in_house_use.js | 21 ++++++++++++++++----- .../xul/staff_client/server/circ/in_house_use.xul | 2 +- 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index e265f0375e..65805fc7b0 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1512,9 +1512,10 @@ - - - + + + + diff --git a/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml b/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml index ca0f3450d1..0f4a113019 100644 --- a/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml +++ b/Open-ILS/xul/staff_client/server/admin/org_unit_settings.xhtml @@ -117,6 +117,16 @@ label : '&staff.server.admin.org_settings.cat.bib.alert_on_empty;', desc : '&staff.server.admin.org_settings.cat.bib.alert_on_empty.desc;', type : 'bool' + }, + 'ui.circ.in_house_use.entry_cap' : { + label : '&ui.circ.in_house_use.entry_cap;', + desc : '&ui.circ.in_house_use.entry_cap.desc;', + type : 'integer' + }, + 'ui.circ.in_house_use.entry_warn' : { + label : '&ui.circ.in_house_use.entry_warn;', + desc : '&ui.circ.in_house_use.entry_warn.desc;', + type : 'integer' } }; diff --git a/Open-ILS/xul/staff_client/server/circ/in_house_use.js b/Open-ILS/xul/staff_client/server/circ/in_house_use.js index 919c105607..d1f825000b 100644 --- a/Open-ILS/xul/staff_client/server/circ/in_house_use.js +++ b/Open-ILS/xul/staff_client/server/circ/in_house_use.js @@ -9,6 +9,7 @@ circ.in_house_use = function (params) { JSAN.use('util.barcode'); JSAN.use('util.date'); JSAN.use('OpenILS.data'); this.data = new OpenILS.data(); this.data.init({'via':'stash'}); + JSAN.use('util.sound'); this.sound = new util.sound(); } circ.in_house_use.prototype = { @@ -17,6 +18,9 @@ circ.in_house_use.prototype = { var obj = this; + obj.entry_cap = Number( obj.data.hash.aous['ui.circ.in_house_use.entry_cap'] ) || 99; + obj.entry_warn = Number( obj.data.hash.aous['ui.circ.in_house_use.entry_warn'] ) || 20; + JSAN.use('circ.util'); var columns = circ.util.columns( { @@ -135,13 +139,19 @@ circ.in_house_use.prototype = { try { var value = Number(ev.target.value); if (value > 0) { - if (value > 99) ev.target.value = 99; + if (value > 99) { throw(value); } } else { - ev.target.value = 1; + throw(value); } } catch(E) { dump('in_house_use:multiplier: ' + E + '\n'); - ev.target.value = 1; + obj.sound.circ_bad(); + setTimeout( + function() { + obj.controller.view.in_house_use_multiplier_textbox.focus(); + obj.controller.view.in_house_use_multiplier_textbox.select(); + }, 0 + ); } } } @@ -230,13 +240,13 @@ circ.in_house_use.prototype = { return; } - if (multiplier == 0 || multiplier > 99) { + if (multiplier == 0 || multiplier > obj.entry_cap) { obj.controller.view.in_house_use_multiplier_textbox.focus(); obj.controller.view.in_house_use_multiplier_textbox.select(); return; } - if (multiplier > 20) { + if (multiplier > obj.entry_warn) { var r = obj.error.yns_alert( document.getElementById('circStrings').getFormattedString('staff.circ.in_house_use.confirm_multiple', [barcode, multiplier]), document.getElementById('circStrings').getString('staff.circ.in_house_use.confirm_multiple.title'), @@ -308,6 +318,7 @@ circ.in_house_use.prototype = { //I could override map_row_to_column here } ); + obj.sound.circ_good(); if (typeof obj.on_in_house_use == 'function') { obj.on_in_house_use(result); diff --git a/Open-ILS/xul/staff_client/server/circ/in_house_use.xul b/Open-ILS/xul/staff_client/server/circ/in_house_use.xul index e14f148c0f..04667ffc96 100644 --- a/Open-ILS/xul/staff_client/server/circ/in_house_use.xul +++ b/Open-ILS/xul/staff_client/server/circ/in_house_use.xul @@ -93,7 +93,7 @@