From 31bf75676372f59998d99c047c4a5afe965f2dc1 Mon Sep 17 00:00:00 2001 From: phasefx Date: Wed, 22 Feb 2006 22:56:19 +0000 Subject: [PATCH 1/1] changing legacy code.. ack :( put buckets and volume transfer support in copy browser git-svn-id: svn://svn.open-ils.org/ILS/trunk@3171 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../content/evergreen/cat/browse_list.js | 23 +++++++-- .../chrome/content/legacy/_browse.xul | 51 +++++++++++++++++++ 2 files changed, 71 insertions(+), 3 deletions(-) diff --git a/Evergreen/staff_client/chrome/content/evergreen/cat/browse_list.js b/Evergreen/staff_client/chrome/content/evergreen/cat/browse_list.js index a067cada65..4a49d74fb7 100644 --- a/Evergreen/staff_client/chrome/content/evergreen/cat/browse_list.js +++ b/Evergreen/staff_client/chrome/content/evergreen/cat/browse_list.js @@ -508,6 +508,13 @@ function build_CopyBrowser_Context(ev) { menuitem.setAttribute('command','cmd_volume_add'); popup.appendChild( document.createElement( 'menuseparator' ) ); } + if (volume_flag == 1) { + var menuitem = document.createElement('menuitem'); + popup.appendChild(menuitem); + menuitem.setAttribute('label','Mark Volume as Copy Transfer Destination'); + menuitem.setAttribute('oncommand','mark_volume("browse_list_tree");'); + popup.appendChild( document.createElement( 'menuseparator' ) ); + } if (volume_flag > 0) { var menuitem = document.createElement('menuitem'); popup.appendChild(menuitem); @@ -526,6 +533,16 @@ function build_CopyBrowser_Context(ev) { popup.appendChild( document.createElement( 'menuseparator' ) ); } if (copy_flag > 0) { + var menuitem = document.createElement('menuitem'); + popup.appendChild(menuitem); + if (copy_flag > 1) { + menuitem.setAttribute('label','Add Copies to Bucket'); + } else { + menuitem.setAttribute('label','Add Copy to Bucket'); + } + menuitem.setAttribute('oncommand','add_to_bucket("browse_list_tree");'); + popup.appendChild( document.createElement( 'menuseparator' ) ); + var menuitem = document.createElement('menuitem'); popup.appendChild(menuitem); if (copy_flag > 1) { @@ -578,7 +595,7 @@ function volume_add(tab,params) { return obj.getAttribute('object_type') == 'org_unit'; } ); - var chrome = 'chrome://evergreen/content/cat/volume_copy_add_wizard.xul'; + var chrome = 'chrome://open_ils_staff_client/content/cat/volume_copy_add_wizard.xul'; if (tab) { parentWindow.new_tab('main_tabbox'); w = parentWindow.replace_tab('main_tabbox','Add Volume',chrome); @@ -603,7 +620,7 @@ function copy_add(tab,params) { return obj.getAttribute('object_type') == 'volume'; } ); - var chrome = 'chrome://evergreen/content/cat/copy_add_wizard.xul'; + var chrome = 'chrome://open_ils_staff_client/content/cat/copy_add_wizard.xul'; if (tab) { parentWindow.new_tab('main_tabbox'); w = parentWindow.replace_tab('main_tabbox','Add Copy',chrome); @@ -628,7 +645,7 @@ function volume_edit(tab,params) { return obj.getAttribute('object_type') == 'volume'; } ); - var chrome = 'chrome://evergreen/content/cat/volume_edit_wizard.xul'; + var chrome = 'chrome://open_ils_staff_client/content/cat/volume_edit_wizard.xul'; if (tab) { parentWindow.new_tab('main_tabbox'); w = parentWindow.replace_tab('main_tabbox','Edit Volumes',chrome); diff --git a/Open-ILS/xul/staff_client/chrome/content/legacy/_browse.xul b/Open-ILS/xul/staff_client/chrome/content/legacy/_browse.xul index 1465b46afc..78252a1418 100644 --- a/Open-ILS/xul/staff_client/chrome/content/legacy/_browse.xul +++ b/Open-ILS/xul/staff_client/chrome/content/legacy/_browse.xul @@ -546,6 +546,57 @@ alert('spawn copy add wizard with volume_ids = ' + js2JSON(list)); } + + function mark_volume() { + JSAN.use('util.widgets'); JSAN.use('util.functional'); + var list = util.widgets.get_list_from_tree_selection('browse_list_tree'); + list = util.functional.filter_list( + list, + function (obj) { + return obj.getAttribute('object_type') == 'volume'; + } + ); + list = util.functional.map_list( + list, + function (obj) { + return obj.getAttribute('volume_id'); + } + ); + + g.data.marked_volume = list[0]; + g.data.stash('marked_volume'); + alert('Volume marked as Copy Transfer Destination'); + } + + function add_to_bucket() { + + JSAN.use('util.widgets'); JSAN.use('util.functional'); + + var list = util.widgets.get_list_from_tree_selection('browse_list_tree'); + list = util.functional.filter_list( + list, + function (obj) { + return obj.getAttribute('object_type') == 'copy'; + } + ); + + list = util.functional.map_list( + list, + function (obj) { + return obj.getAttribute('copy_id'); + } + ); + + JSAN.use('util.window'); var win = new util.window(); + win.open( + xulG.url_prefix(urls.XUL_COPY_BUCKETS) + + '?session=' + window.escape(g.session) + + '©_ids=' + js2JSON( list ), + 'sel_bucket_win' + win.window_name_increment(), + 'chrome,resizable,modal,center' + ); + } + ]]> -- 2.43.2