library selector for staged patron list
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 17 Nov 2009 07:10:49 +0000 (07:10 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 17 Nov 2009 07:10:49 +0000 (07:10 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@14936 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
Open-ILS/xul/staff_client/server/patron/staged.js
Open-ILS/xul/staff_client/server/patron/staged.xul

index 8a436bc..eaf7ad2 100644 (file)
@@ -319,6 +319,7 @@ staff.patron.summary.expires_on=Expires on
 staff.patron.summary.standing_penalty.remove=Remove
 staff.patron.summary.standing_penalty.none=No Blocks/Penalties
 staff.patron.staged.register_patron=Registering Staged Patron: %1$s
+staff.patron.staged.lib_menus.missing_library_list=Missing library list.
 staff.patron.standing_penalty.apply_error=Error applying %1$s block/standing penalty.
 staff.patron.standing_penalty.remove_error=Error removing %1$s block/standing penalty.
 staff.patron.standing_penalty.update_error=Error updating block/standing penalty.
index 37b42b6..dd8f0f2 100644 (file)
@@ -1,9 +1,9 @@
-var list; var error; var net; var rows;
+var list; var error; var net; var rows; var menu_lib;
 
 function $(id) { return document.getElementById(id); }
 
 //// parent interfaces often call these
-function default_focus() { $('stgu_list').focus(); }
+function default_focus() { $('lib_menu').focus(); }
 function refresh() { populate_list(); }
 ////
 
@@ -35,6 +35,7 @@ function staged_init() {
 
         dojo.require('openils.Util');
 
+        populate_lib_menu();
         init_list();
         $('list_actions').appendChild( list.render_list_actions() );
         list.set_list_actions();
@@ -49,6 +50,36 @@ function staged_init() {
     }
 }
 
+function populate_lib_menu() {
+    try {
+        JSAN.use('util.widgets');
+        var x = document.getElementById('lib_menu_placeholder');
+        if (!x) { return; }
+        util.widgets.remove_children( x );
+
+        JSAN.use('util.file');
+        var file = new util.file('offline_ou_list');
+        if (file._file.exists()) {
+            var list_data = file.get_object(); file.close();
+            var ml = util.widgets.make_menulist( list_data[0], ses('ws_ou') );
+            ml.setAttribute('id','lib_menu');
+            x.appendChild( ml );
+            ml.addEventListener(
+                'command',
+                function(ev) {
+                    menu_lib = ev.target.value;
+                    populate_list();
+                },
+                false
+            );
+        } else {
+            alert($("patronStrings").getString('staff.patron.staged.lib_menus.missing_library_list'));
+        }
+    } catch(E) {
+        alert('Error in staged.js, populate_lib_menu(): ' + E);
+    }
+}
+
 function gen_event_handler(method) { // cancel or load?
     return function(ev) {
         try {
@@ -222,7 +253,7 @@ function populate_list() {
         fieldmapper.standardRequest(
             [api['FM_STGU_RETRIEVE'].app, api['FM_STGU_RETRIEVE'].method ],
             {   async: true,
-                params: [ses(), ses('ws_ou')],
+                params: [ses(), menu_lib || ses('ws_ou')],
                 onresponse : onResponse,
                 onerror : onError,
                 oncomplete : function() {
index 0745c99..462dd97 100644 (file)
@@ -41,6 +41,7 @@
         <caption id="staged_caption" label="&staff.patron_display.staged.caption;"/>
         <vbox flex="0">
             <hbox flex="1">
+                <hbox id="lib_menu_placeholder" />
                 <spacer flex="1" />
                 <progressmeter id="progress" flex="1" hidden="true" mode="undetermined"/>
                 <menubar>