From 339fa551c5a23e46483b713928e6395e6967dd86 Mon Sep 17 00:00:00 2001 From: pines Date: Thu, 28 Sep 2006 17:47:46 +0000 Subject: [PATCH] auto-expand options for volumes and copies in copy browser git-svn-id: svn://svn.open-ils.org/ILS/trunk@6251 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/server/cat/copy_browser.js | 39 +++++++++++++++++++++- .../xul/staff_client/server/cat/copy_browser.xul | 4 +++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/Open-ILS/xul/staff_client/server/cat/copy_browser.js b/Open-ILS/xul/staff_client/server/cat/copy_browser.js index b5442340f6..535b2fb43e 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_browser.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.js @@ -870,6 +870,8 @@ cat.copy_browser.prototype = { 'command', function(ev) { //obj.show_my_libs(ev.target.value); + JSAN.use('util.file'); var file = new util.file('copy_browser_prefs'); + util.widgets.save_attributes(file, { 'lib_menu' : [ 'value' ], 'show_acns' : [ 'checked' ], 'show_acps' : [ 'checked' ] }); obj.refresh_list(); }, false @@ -878,7 +880,31 @@ cat.copy_browser.prototype = { throw('Missing library list.\n'); } - obj.show_my_libs( list_data[1] ); + JSAN.use('util.widgets'); + + file = new util.file('copy_browser_prefs'); + util.widgets.load_attributes(file); + ml.value = ml.getAttribute('value'); + + document.getElementById('show_acns').addEventListener( + 'command', + function(ev) { + JSAN.use('util.file'); var file = new util.file('copy_browser_prefs'); + util.widgets.save_attributes(file, { 'lib_menu' : [ 'value' ], 'show_acns' : [ 'checked' ], 'show_acps' : [ 'checked' ] }); + }, + false + ); + + document.getElementById('show_acps').addEventListener( + 'command', + function(ev) { + JSAN.use('util.file'); var file = new util.file('copy_browser_prefs'); + util.widgets.save_attributes(file, { 'lib_menu' : [ 'value' ], 'show_acns' : [ 'checked' ], 'show_acps' : [ 'checked' ] }); + }, + false + ); + + obj.show_my_libs( ml.value ); } catch(E) { this.error.sdump('D_ERROR','cat.copy_browser.init: ' + E + '\n'); @@ -1224,6 +1250,13 @@ cat.copy_browser.prototype = { node.setAttribute('container','true'); } + if (document.getElementById('show_acns').checked) { + if ( obj.data.hash.aout[ org.ou_type() ].depth() != 0 ) { + node.setAttribute('open','true'); + setTimeout( function() { obj.on_select_org( org.id() ); }, 0 ); + } + } + } catch(E) { dump(E+'\n'); alert(E); @@ -1268,6 +1301,10 @@ cat.copy_browser.prototype = { obj.map_acp[ 'acn_' + acn_tree.id() ] = acn_tree; node.setAttribute('container','true'); } + if (document.getElementById('show_acps').checked) { + node.setAttribute('open','true'); + setTimeout( function() { obj.on_select_acn( acn_tree.id() ); }, 0 ); + } } catch(E) { dump(E+'\n'); diff --git a/Open-ILS/xul/staff_client/server/cat/copy_browser.xul b/Open-ILS/xul/staff_client/server/cat/copy_browser.xul index 0b24bbeca0..44ca05c432 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_browser.xul +++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.xul @@ -165,6 +165,10 @@ + + + + -- 2.11.0