From: phasefx Date: Tue, 17 Nov 2009 07:10:49 +0000 (+0000) Subject: library selector for staged patron list X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f4c845d4c3dfe6f7757984c3984cf6c367ed1525;p=evergreen%2Ftadl.git library selector for staged patron list git-svn-id: svn://svn.open-ils.org/ILS/trunk@14936 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties b/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties index 8a436bc957..eaf7ad2f13 100644 --- a/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties +++ b/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties @@ -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. diff --git a/Open-ILS/xul/staff_client/server/patron/staged.js b/Open-ILS/xul/staff_client/server/patron/staged.js index 37b42b6187..dd8f0f2257 100644 --- a/Open-ILS/xul/staff_client/server/patron/staged.js +++ b/Open-ILS/xul/staff_client/server/patron/staged.js @@ -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() { diff --git a/Open-ILS/xul/staff_client/server/patron/staged.xul b/Open-ILS/xul/staff_client/server/patron/staged.xul index 0745c99709..462dd970bf 100644 --- a/Open-ILS/xul/staff_client/server/patron/staged.xul +++ b/Open-ILS/xul/staff_client/server/patron/staged.xul @@ -41,6 +41,7 @@ +