changing legacy code.. ack :( put buckets and volume transfer support in copy browser
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 22 Feb 2006 22:56:19 +0000 (22:56 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 22 Feb 2006 22:56:19 +0000 (22:56 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3171 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/cat/browse_list.js
Open-ILS/xul/staff_client/chrome/content/legacy/_browse.xul

index a067cad..4a49d74 100644 (file)
@@ -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);
@@ -529,6 +536,16 @@ function build_CopyBrowser_Context(ev) {
                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) {
                                menuitem.setAttribute('label','Edit Copies');
                        } else {
                                menuitem.setAttribute('label','Edit Copy');
@@ -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);
index 1465b46..78252a1 100644 (file)
 
                        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)
+                               + '&copy_ids=' + js2JSON( list ),
+                               'sel_bucket_win' + win.window_name_increment(),
+                               'chrome,resizable,modal,center'
+                       );
+               }
+
        ]]>
        </script>