From bf07b80b7d7ccb89e5e4cd79506097d9e0f74fdd Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Thu, 22 Mar 2012 14:26:32 -0400 Subject: [PATCH] Teach loading of settings inside of patron window By passing through get_barcode_and_settings (and get_barcode, why not). Once there we can, on load of place hold screens, load the target user's preferences instead of having to teach TPac to do so in the background. Signed-off-by: Thomas Berezansky Signed-off-by: Ben Shum --- Open-ILS/web/js/ui/default/opac/staff.js | 8 ++++++-- Open-ILS/xul/staff_client/server/patron/display.js | 4 +++- Open-ILS/xul/staff_client/server/patron/holds.js | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Open-ILS/web/js/ui/default/opac/staff.js b/Open-ILS/web/js/ui/default/opac/staff.js index e72f77ca1d..09d4e06ef8 100644 --- a/Open-ILS/web/js/ui/default/opac/staff.js +++ b/Open-ILS/web/js/ui/default/opac/staff.js @@ -20,13 +20,14 @@ function staff_hold_usr_input_disabler(input) { staff_hold_usr_barcode_changed(); } var cur_hold_barcode = undefined; -function staff_hold_usr_barcode_changed() { +function staff_hold_usr_barcode_changed(isload) { if(typeof xulG != 'undefined' && xulG.get_barcode_and_settings) { var barcode = document.getElementById('staff_barcode').value; var only_settings = true; if(!document.getElementById('hold_usr_is_requestor').checked) { barcode = document.getElementById('hold_usr_input').value; - only_settings = false; + if(!isload) + only_settings = false; if(barcode && barcode != '' && !document.getElementById('hold_usr_is_requestor_not').checked) document.getElementById('hold_usr_is_requestor_not').checked = 'checked'; } @@ -68,6 +69,9 @@ window.onload = function() { runEvt('rdetail', 'recordRetrieved', rec[1]); runEvt('rdetail', 'MFHDDrawn'); } + if(location.href.match(/place_hold/)) { + staff_hold_usr_barcode_changed(true); + } } function rdetail_next_prev_actions(index, count, prev, next, start, end, results) { diff --git a/Open-ILS/xul/staff_client/server/patron/display.js b/Open-ILS/xul/staff_client/server/patron/display.js index 7100484614..a383082dcc 100644 --- a/Open-ILS/xul/staff_client/server/patron/display.js +++ b/Open-ILS/xul/staff_client/server/patron/display.js @@ -496,7 +496,9 @@ patron.display.prototype = { 'url_prefix' : function(url,secure) { return xulG.url_prefix(url,secure); }, 'get_new_session' : function(a) { return xulG.get_new_session(a); }, 'new_tab' : function(a,b,c) { return xulG.new_tab(a,b,c); }, - 'new_patron_tab' : function(a,b) { return xulG.new_patron_tab(a,b); } + 'new_patron_tab' : function(a,b) { return xulG.new_patron_tab(a,b); }, + 'get_barcode' : function(a,b,c) { return xulG.get_barcode(a,b,c); }, + 'get_barcode_and_settings' : function(a,b,c) { return xulG.get_barcode_and_settings(a,b,c); } } ); } catch(E) { diff --git a/Open-ILS/xul/staff_client/server/patron/holds.js b/Open-ILS/xul/staff_client/server/patron/holds.js index 28f2cf7cc5..cb45955da9 100644 --- a/Open-ILS/xul/staff_client/server/patron/holds.js +++ b/Open-ILS/xul/staff_client/server/patron/holds.js @@ -1461,6 +1461,8 @@ patron.holds.prototype = { obj.error.standard_unexpected_error_alert('holds.js, opac_hold_placed(): ',E); } }, + 'get_barcode' : xulG.get_barcode, + 'get_barcode_and_settings' : xulG.get_barcode_and_settings, 'patron_barcode' : obj.patron_barcode }, 'url_prefix' : xulG.url_prefix, -- 2.11.0