home library selector for Patrons with Negative Balances interface
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 30 Dec 2009 21:41:24 +0000 (21:41 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 30 Dec 2009 21:41:24 +0000 (21:41 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15255 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/admin/patrons_due_refunds.js
Open-ILS/xul/staff_client/server/admin/patrons_due_refunds.xul

index 03e88d7..10f1033 100644 (file)
@@ -1,4 +1,4 @@
-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); }
 
@@ -34,6 +34,7 @@ function patrons_due_refunds_init() {
         dojo.require('dojo.date.locale');
         dojo.require('dojo.date.stamp');
 
+        render_lib_menu();
         init_list();
         $('list_actions').appendChild( list.render_list_actions() );
         list.set_list_actions();
@@ -158,7 +159,7 @@ function populate_list() {
         fieldmapper.standardRequest(
             [api['FM_AU_BLOBS_WITH_NEGATIVE_BALANCE'].app, api['FM_AU_BLOBS_WITH_NEGATIVE_BALANCE'].method ],
             {   async: true,
-                params: [ses()],
+                params: [ses(),menu_lib],
                 onresponse : onResponse,
                 onerror : onError,
                 oncomplete : function() {
@@ -171,3 +172,35 @@ function populate_list() {
         alert('Error in patrons_due_refunds.js, populate_list(): ' + E);
     }
 }
+
+function render_lib_menu() {
+    try {
+        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();
+            menu_lib = x.getAttribute('value') || ses('ws_ou');
+            var ml = util.widgets.make_menulist( list_data[0], menu_lib );
+            ml.setAttribute('id','lib_menu');
+            x.appendChild( ml );
+            ml.addEventListener(
+                'command',
+                function(ev) {
+                    menu_lib = ev.target.value;
+                    x.setAttribute('value',ev.target.value); oils_persist(x);
+                    populate_list();
+                },
+                false
+            );
+        } else {
+            throw('Missing offline org unit list.');
+        }
+
+    } catch(E) {
+        alert('Error in patrons_due_refunds.js, render_lib_menu(): ' + E);
+    }
+}
index 94f7bab..f92af6f 100644 (file)
@@ -40,6 +40,7 @@
         <caption id="patrons_due_refunds_caption" label="&staff.admin.patrons_due_refunds.caption;"/>
         <vbox flex="0">
             <hbox flex="1">
+                <hbox id="lib_menu_placeholder" oils_persist="value" /> 
                 <spacer flex="1" />
                 <progressmeter id="progress" flex="1" hidden="true" mode="undetermined"/>
                 <menubar>