Teach loading of settings inside of patron window
authorThomas Berezansky <tsbere@mvlc.org>
Thu, 22 Mar 2012 18:26:32 +0000 (14:26 -0400)
committerThomas Berezansky <tsbere@mvlc.org>
Fri, 30 Mar 2012 17:53:22 +0000 (13:53 -0400)
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 <tsbere@mvlc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>

Open-ILS/web/js/ui/default/opac/staff.js
Open-ILS/xul/staff_client/server/patron/display.js
Open-ILS/xul/staff_client/server/patron/holds.js

index e72f77c..09d4e06 100644 (file)
@@ -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) {
index 7100484..a383082 100644 (file)
@@ -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) {
index 28f2cf7..cb45955 100644 (file)
@@ -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,