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);
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');
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);
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);
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);
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'
+ );
+ }
+
]]>
</script>