From: phasefx Date: Wed, 30 Dec 2009 21:41:24 +0000 (+0000) Subject: home library selector for Patrons with Negative Balances interface X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=da16394edcea53e9fc12db674a172a2422cc93b3;p=evergreen%2Fpines.git home library selector for Patrons with Negative Balances interface git-svn-id: svn://svn.open-ils.org/ILS/trunk@15255 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/server/admin/patrons_due_refunds.js b/Open-ILS/xul/staff_client/server/admin/patrons_due_refunds.js index 03e88d71cc..10f1033f75 100644 --- a/Open-ILS/xul/staff_client/server/admin/patrons_due_refunds.js +++ b/Open-ILS/xul/staff_client/server/admin/patrons_due_refunds.js @@ -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); + } +} diff --git a/Open-ILS/xul/staff_client/server/admin/patrons_due_refunds.xul b/Open-ILS/xul/staff_client/server/admin/patrons_due_refunds.xul index 94f7bab752..f92af6f74b 100644 --- a/Open-ILS/xul/staff_client/server/admin/patrons_due_refunds.xul +++ b/Open-ILS/xul/staff_client/server/admin/patrons_due_refunds.xul @@ -40,6 +40,7 @@ +