<!ENTITY staff.cat.volume_editor.cancel.accesskey "C">
<!ENTITY staff.cat.volume_editor.automerge.label "Auto-Merge on Volume Collision">
<!ENTITY staff.cat.volume_editor.automerge.accesskey "A">
+<!ENTITY staff.cat.volume_editor.automerge.description "If two or more volumes for the same bib record and library are given the same call number label (and prefix/suffix), then merge them (including items they contain) into a single volume if checked. Otherwise, report an error.">
<!ENTITY staff.cat.volume_editor.owning_lib "Owning lib">
<!ENTITY staff.cat.volume_editor.classification "Classification">
<!ENTITY staff.cat.volume_editor.prefix "Prefix">
'spawn_copy_editor', 'add_copies_to_bucket', 'show_in_opac', 'spawn_spine_editor', 'transfer_copies',
'transfer_title_holds', 'mark_item_missing', 'mark_item_damaged', 'replace_barcode', 'fast_item_add',
'make_bookable', 'edit_new_brsrc', 'edit_new_bresv', 'batch_edit_volumes', 'render_fine_level',
- 'render_loan_duration', 'mark_item_as_missing_pieces', 'transfer_specific_title_holds'
+ 'render_loan_duration', 'mark_item_as_missing_pieces', 'render_callnumbers_for_bib_menu',
+ 'render_cn_prefix_menuitems', 'render_cn_suffix_menuitems', 'render_cn_class_menu',
+ 'render_cn_prefix_menu', 'render_cn_suffix_menu', 'transfer_specific_title_holds'
];
cat.util.EXPORT_TAGS = { ':all' : cat.util.EXPORT_OK };
}
}
+cat.util.render_callnumbers_for_bib_menu = function(node, doc_id, label_class) {
+ try {
+ var cn_blob;
+ try {
+ cn_blob = g.network.simple_request('BLOB_MARC_CALLNUMBERS_RETRIEVE',[doc_id, label_class]);
+ } catch(E) {
+ cn_blob = [];
+ }
+ var hbox = typeof node == 'string' ? document.getElementById(node) : node;
+ JSAN.use('util.widgets');
+ JSAN.use('util.functional');
+ var ml = util.widgets.make_menulist(
+ [
+ [ '', '' ]
+ ].concat(
+ util.functional.map_list(
+ cn_blob,
+ function(o) {
+ for (var i in o) {
+ return [ o[i], i ];
+ }
+ }
+ )
+ )
+ ); hbox.appendChild(ml);
+ ml.setAttribute('editable','true');
+ ml.setAttribute('width', '200');
+ ml.setAttribute('id', hbox.id + '_menulist');
+ } catch(E) {
+ alert('Error in cat.util.render_callnumbers_for_bib_menu: ' + E);
+ }
+}
+
+cat.util.render_cn_prefix_menuitems = function(menupopup,ou_id) {
+ try {
+ JSAN.use('OpenILS.data');
+ var data = new OpenILS.data(); data.stash_retrieve();
+ JSAN.use('util.network');
+ var network = new util.network();
+
+ if (typeof data.list['acnp_for_lib_'+ou_id] == 'undefined') {
+ data.list['acnp_for_lib_'+ou_id] = network.simple_request(
+ 'FM_ACNP_RETRIEVE_VIA_PCRUD',
+ [ ses(), {"owning_lib":{"=":ou_id}}, {"order_by":{"acnp":"label_sortkey"}} ]
+ );
+ data.stash('list');
+ }
+ for (var i = 0; i < data.list['acnp_for_lib_'+ou_id].length; i++) {
+ var my_acnp = data.list['acnp_for_lib_'+ou_id][i];
+ var menuitem = document.createElement('menuitem');
+ menupopup.appendChild(menuitem);
+ menuitem.setAttribute(
+ 'label',
+ my_acnp.id() == -1 ? '' :
+ $('catStrings').getFormattedString(
+ 'staff.cat.volume_copy_creator.call_number_prefix.menuitem_label',
+ [
+ my_acnp.label(),
+ data.hash.aou[ ou_id ].shortname()
+ ]
+ )
+ );
+ menuitem.setAttribute('value',my_acnp.id());
+ }
+ } catch(E) {
+ alert('Error in cat.util.render_cn_prefix_menuitems: ' + E);
+ }
+}
+
+cat.util.render_cn_suffix_menuitems = function(menupopup,ou_id) {
+ try {
+ JSAN.use('OpenILS.data');
+ var data = new OpenILS.data(); data.stash_retrieve();
+ JSAN.use('util.network');
+ var network = new util.network();
+
+ if (typeof data.list['acns_for_lib_'+ou_id] == 'undefined') {
+ data.list['acns_for_lib_'+ou_id] = network.simple_request(
+ 'FM_ACNS_RETRIEVE_VIA_PCRUD',
+ [ ses(), {"owning_lib":{"=":ou_id}}, {"order_by":{"acns":"label_sortkey"}} ]
+ );
+ data.stash('list');
+ }
+ for (var i = 0; i < data.list['acns_for_lib_'+ou_id].length; i++) {
+ var my_acns = data.list['acns_for_lib_'+ou_id][i];
+ var menuitem = document.createElement('menuitem');
+ menupopup.appendChild(menuitem);
+ menuitem.setAttribute(
+ 'label',
+ my_acns.id() == -1 ? '' :
+ $('catStrings').getFormattedString(
+ 'staff.cat.volume_copy_creator.call_number_suffix.menuitem_label',
+ [
+ my_acns.label(),
+ data.hash.aou[ ou_id ].shortname()
+ ]
+ )
+ );
+ menuitem.setAttribute('value',my_acns.id());
+ }
+ } catch(E) {
+ alert('Error in cat.util.render_cn_suffix_menuitems: ' + E);
+ }
+}
+
+cat.util.render_cn_class_menu = function(extra_menuitems,menu_default) {
+ try {
+ JSAN.use('util.widgets');
+ JSAN.use('OpenILS.data');
+ var data = new OpenILS.data(); data.stash_retrieve();
+
+ var menulist = util.widgets.make_menulist(
+ (extra_menuitems || []).concat(
+ util.functional.map_list(
+ data.list.acnc,
+ function(o) {
+ return [ o.name(), o.id() ];
+ }
+ )
+ )
+ );
+
+ if (typeof menu_default != 'undefined') {
+ menulist.setAttribute('value',menu_default);
+ }
+ return menulist;
+
+ } catch(E) {
+ alert('Error in cat.util.render_cn_class_menu: ' + E);
+ }
+}
+
+cat.util.render_cn_prefix_menu = function(ou_ids,extra_menuitems,menu_default) {
+ try {
+ JSAN.use('util.widgets');
+ var menulist = util.widgets.make_menulist(extra_menuitems||[],menu_default);
+ var menupopup = menulist.firstChild;
+ var org_list;
+ if (ou_ids.length == 1) {
+ JSAN.use('OpenILS.data');
+ var data = new OpenILS.data(); data.stash_retrieve();
+ var org = data.hash.aou[ ou_ids[0] ];
+ org_list = []; // order from top of consortium to owning lib
+ while(org) {
+ org_list.unshift(org.id());
+ org = org.parent_ou();
+ if (org && typeof org != 'object') {
+ org = data.hash.aou[ org ];
+ }
+ }
+ } else {
+ org_list = ou_ids;
+ }
+ for (var i = 0; i < org_list.length; i++) {
+ cat.util.render_cn_prefix_menuitems(menupopup,org_list[i]);
+ }
+ if (typeof menu_default != 'undefined') {
+ menulist.setAttribute('value',menu_default);
+ }
+ return menulist;
+ } catch(E) {
+ alert('Error in cat.util.render_cn_prefix_menu('+ou_id+'): ' + E);
+ }
+}
+
+cat.util.render_cn_suffix_menu = function(ou_ids,extra_menuitems,menu_default) {
+ try {
+ JSAN.use('util.widgets');
+ var menulist = util.widgets.make_menulist(extra_menuitems||[],menu_default);
+ var menupopup = menulist.firstChild;
+ var org_list;
+ if (ou_ids.length == 1) {
+ JSAN.use('OpenILS.data');
+ var data = new OpenILS.data(); data.stash_retrieve();
+ var org = data.hash.aou[ ou_ids[0] ];
+ org_list = []; // order from top of consortium to owning lib
+ while(org) {
+ org_list.unshift(org.id());
+ org = org.parent_ou();
+ if (org && typeof org != 'object') {
+ org = data.hash.aou[ org ];
+ }
+ }
+ } else {
+ org_list = ou_ids;
+ }
+ for (var i = 0; i < org_list.length; i++) {
+ cat.util.render_cn_suffix_menuitems(menupopup,org_list[i]);
+ }
+ if (typeof menu_default != 'undefined') {
+ menulist.setAttribute('value',menu_default);
+ }
+ return menulist;
+ } catch(E) {
+ alert('Error in cat.util.render_cn_suffix_menu('+ou_id+'): ' + E);
+ }
+}
+
dump('exiting cat/util.js\n');
/* For the batch drop downs */
g.list_classes();
- g.list_callnumbers(g.doc_id, g.label_class);
+ JSAN.use('cat.util');
+ cat.util.render_callnumbers_for_bib_menu('marc_cn',g.doc_id, g.label_class);
g.render_batch_button();
/***********************************************************************************************************/
}
g.render_class_menu = function(call_number_tb) {
- var ml = util.widgets.make_menulist(
- util.functional.map_list(
- g.data.list.acnc,
- function(o) {
- return [ o.name(), o.id() ];
- }
- )
- );
+ var ml = cat.util.render_cn_class_menu();
ml.setAttribute('rel_vert_pos',rel_vert_pos_call_number_classification);
ml.addEventListener(
'command',
g.render_prefix_menu = function(call_number_tb) {
var ou_id = call_number_tb.getAttribute('ou_id');
- var org = g.data.hash.aou[ ou_id ];
- var menulist = document.createElement('menulist');
- var menupopup = document.createElement('menupopup');
- menulist.appendChild(menupopup);
- var org_list = []; // order from top of consortium to owning lib
- while(org) {
- org_list.unshift(org.id());
- org = org.parent_ou();
- if (org && typeof org != 'object') {
- org = g.data.hash.aou[ org ];
- }
- }
- for (var i = 0; i < org_list.length; i++) {
- g.render_prefix_menu_items(menupopup,org_list[i]);
- }
-
+ var menulist = cat.util.render_cn_prefix_menu([ou_id]);
menulist.setAttribute('rel_vert_pos',rel_vert_pos_call_number_prefix);
menulist.addEventListener(
'command',
return menulist;
}
-g.render_prefix_menu_items = function(menupopup,ou_id) {
- if (typeof g.data.list['acnp_for_lib_'+ou_id] == 'undefined') {
- g.data.list['acnp_for_lib_'+ou_id] = g.network.simple_request(
- 'FM_ACNP_RETRIEVE_VIA_PCRUD',
- [ ses(), {"owning_lib":{"=":ou_id}}, {"order_by":{"acnp":"label_sortkey"}} ]
- );
- g.data.stash('list');
- }
- for (var i = 0; i < g.data.list['acnp_for_lib_'+ou_id].length; i++) {
- var my_acnp = g.data.list['acnp_for_lib_'+ou_id][i];
- var menuitem = document.createElement('menuitem');
- menupopup.appendChild(menuitem);
- menuitem.setAttribute(
- 'label',
- my_acnp.id() == -1 ? '' :
- $('catStrings').getFormattedString(
- 'staff.cat.volume_copy_creator.call_number_prefix.menuitem_label',
- [
- my_acnp.label(),
- g.data.hash.aou[ ou_id ].shortname()
- ]
- )
- );
- menuitem.setAttribute('value',my_acnp.id());
- }
-}
-
g.render_suffix_menu = function(call_number_tb) {
var ou_id = call_number_tb.getAttribute('ou_id');
- var org = g.data.hash.aou[ ou_id ];
- var menulist = document.createElement('menulist');
- var menupopup = document.createElement('menupopup');
- menulist.appendChild(menupopup);
- var org_list = []; // order from top of consortium to owning lib
- while(org) {
- org_list.unshift(org.id());
- org = org.parent_ou();
- if (org && typeof org != 'object') {
- org = g.data.hash.aou[ org ];
- }
- }
- for (var i = 0; i < org_list.length; i++) {
- g.render_suffix_menu_items(menupopup,org_list[i]);
- }
-
+ var menulist = cat.util.render_cn_suffix_menu([ou_id]);
menulist.setAttribute('rel_vert_pos',rel_vert_pos_call_number_suffix);
menulist.addEventListener(
'command',
return menulist;
}
-g.render_suffix_menu_items = function(menupopup,ou_id) {
- if (typeof g.data.list['acns_for_lib_'+ou_id] == 'undefined') {
- g.data.list['acns_for_lib_'+ou_id] = g.network.simple_request(
- 'FM_ACNS_RETRIEVE_VIA_PCRUD',
- [ ses(), {"owning_lib":{"=":ou_id}}, {"order_by":{"acns":"label_sortkey"}} ]
- );
- g.data.stash('list');
- }
- for (var i = 0; i < g.data.list['acns_for_lib_'+ou_id].length; i++) {
- var my_acns = g.data.list['acns_for_lib_'+ou_id][i];
- var menuitem = document.createElement('menuitem');
- menupopup.appendChild(menuitem);
- menuitem.setAttribute(
- 'label',
- my_acns.id() == -1 ? '' :
- $('catStrings').getFormattedString(
- 'staff.cat.volume_copy_creator.call_number_suffix.menuitem_label',
- [
- my_acns.label(),
- g.data.hash.aou[ ou_id ].shortname()
- ]
- )
- );
- menuitem.setAttribute('value',my_acns.id());
- }
-}
-
-
-g.list_callnumbers = function(doc_id, label_class) {
- var cn_blob;
- try {
- cn_blob = g.network.simple_request('BLOB_MARC_CALLNUMBERS_RETRIEVE',[g.doc_id, label_class]);
- } catch(E) {
- cn_blob = [];
- }
- var hbox = document.getElementById('marc_cn');
- var ml = util.widgets.make_menulist(
- [
- [ '', '' ]
- ].concat(
- util.functional.map_list(
- cn_blob,
- function(o) {
- for (var i in o) {
- return [ o[i], i ];
- }
- }
- )
- )
- ); hbox.appendChild(ml);
- ml.setAttribute('editable','true');
- ml.setAttribute('width', '200');
- ml.setAttribute('id', 'marc_cn_menulist');
-}
-
g.list_classes = function() {
var hbox = $('batch_class');
- var ml = util.widgets.make_menulist(
+ var ml = cat.util.render_cn_class_menu(
[
[ '<No Change>', false ]
- ].concat(
- util.functional.map_list(
- g.data.list.acnc,
- function(o) {
- return [ o.name(), o.id() ];
- }
- )
- )
+ ]
); hbox.appendChild(ml);
ml.setAttribute('id','batch_class_menulist');
ml.addEventListener(
g.list_prefixes = function() {
var hbox = $('batch_prefix');
- var ml = util.widgets.make_menulist(
+ var ml = cat.util.render_cn_prefix_menu(
+ g.common_ancestor_ou_ids,
[
[ '<No Change>', false ]
]
- ); hbox.appendChild(ml);
- for (var i = 0; i < g.common_ancestor_ou_ids.length; i++) {
- g.render_prefix_menu_items(ml.firstChild,g.common_ancestor_ou_ids[i]);
- }
+ );
ml.setAttribute('id','batch_prefix_menulist');
+ hbox.appendChild(ml);
ml.addEventListener(
'command',
function() {
g.list_suffixes = function() {
var hbox = $('batch_suffix');
- var ml = util.widgets.make_menulist(
+ var ml = cat.util.render_cn_suffix_menu(
+ g.common_ancestor_ou_ids,
[
[ '<No Change>', false ]
]
- ); hbox.appendChild(ml);
- for (var i = 0; i < g.common_ancestor_ou_ids.length; i++) {
- g.render_suffix_menu_items(ml.firstChild,g.common_ancestor_ou_ids[i]);
- }
+ );
ml.setAttribute('id','batch_suffix_menulist');
+ hbox.appendChild(ml);
ml.addEventListener(
'command',
function() {
+const rel_vert_pos_call_number_classification = 1;
+const rel_vert_pos_call_number_prefix = 2;
+const rel_vert_pos_call_number = 3;
+const rel_vert_pos_call_number_suffix = 4;
+
var xulG = {};
function my_init() {
JSAN.use('util.functional');
+ JSAN.use('cat.util');
+
g.volumes = xul_param('volumes',{'stash_name':'volumes_temp','clear_xpcom':true,'modal_xulG':true}); //JSON2js( g.data.volumes_temp );
//g.data.volumes_temp = ''; g.data.stash('volumes_temp');
var first_tb;
for (var i = 0; i < g.volumes.length; i++) {
- var row = document.createElement('row'); rows.appendChild(row);
- var lib_label = document.createElement('label'); row.appendChild(lib_label);
+ var row = document.createElement('row');
+ rows.appendChild(row);
+ var lib_label = document.createElement('label');
+ row.appendChild(lib_label);
var class_ml = g.render_class_menu(i);
class_ml.setAttribute('class','cn_class');
+ class_ml.setAttribute('rel_vert_pos', rel_vert_pos_call_number_classification);
row.appendChild(class_ml);
var prefix_ml = g.render_prefix_menu(i);
prefix_ml.setAttribute('class','cn_prefix');
+ prefix_ml.setAttribute('rel_vert_pos', rel_vert_pos_call_number_prefix);
row.appendChild(prefix_ml);
- var label_tb = document.createElement('textbox'); row.appendChild(label_tb);
+ var label_tb = document.createElement('textbox');
+ label_tb.setAttribute('rel_vert_pos', rel_vert_pos_call_number);
+ row.appendChild(label_tb);
var suffix_ml = g.render_suffix_menu(i);
suffix_ml.setAttribute('class','cn_suffix');
+ suffix_ml.setAttribute('rel_vert_pos', rel_vert_pos_call_number_suffix);
row.appendChild(suffix_ml);
if (!first_tb) { first_tb = label_tb; }
first_tb.select(); first_tb.focus();
+ // The batch menus
+ if (g.volumes.length > 0) {
+ JSAN.use('cat.util');
+ JSAN.use('util.fm_utils');
+
+ // Get the default callnumber classification scheme from OU settings
+ g.label_class = g.data.hash.aous['cat.default_classification_scheme'];
+
+ // Assign a default value if none was returned
+ if (!g.label_class) {
+ g.label_class = g.data.list.acnc[0].id();
+ }
+
+ // Find the pertinent orgs
+ var ou_ids = [];
+ var seen_ou = {};
+ for (var i = 0; i < g.volumes.length; i++) {
+ seen_ou[ g.volumes[i].owning_lib() ] = 1;
+ }
+ for (var i in seen_ou) {
+ ou_ids.push(i);
+ }
+ g.ou_ids = [];
+ for (var i = 0; i < ou_ids.length; i++) {
+ try {
+ var org = g.data.hash.aou[ ou_ids[i] ];
+ if ( get_bool( g.data.hash.aout[ org.ou_type() ].can_have_vols() ) ) {
+ g.ou_ids.push( ou_ids[i] );
+ }
+ } catch(E) {
+ g.error.sdump('D_ERROR',E);
+ }
+ }
+ g.common_ancestor_ou_ids = util.fm_utils.find_common_aou_ancestors( g.ou_ids ).reverse();
+
+ // render the menus
+ g.list_classes();
+ g.list_prefixes();
+ cat.util.render_callnumbers_for_bib_menu('marc_cn',g.volumes[0].record(), g.label_class);
+ g.list_suffixes();
+
+ // render the button
+ g.render_batch_button();
+ }
+
} catch(E) {
var err_msg = $("commonStrings").getFormattedString('common.exception', ['cat/volume_editor.xul', E]);
try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); dump(js2JSON(E)); }
}
g.render_class_menu = function(vol_idx) {
- var ml = util.widgets.make_menulist(
- util.functional.map_list(
- g.data.list.acnc,
- function(o) {
- return [ o.name(), o.id() ];
- }
- ),
+ var ml = cat.util.render_cn_class_menu(
+ [],
typeof g.volumes[vol_idx].label_class() == 'object'
? g.volumes[vol_idx].label_class().id()
: g.volumes[vol_idx].label_class()
}
g.render_prefix_menu = function(vol_idx) {
+
var org = typeof g.volumes[vol_idx].owning_lib() == 'object'
? g.volumes[vol_idx].owning_lib()
: g.data.hash.aou[ g.volumes[vol_idx].owning_lib() ];
- var menulist = document.createElement('menulist');
- var menupopup = document.createElement('menupopup');
- menulist.appendChild(menupopup);
- var org_list = []; // order from top of consortium to owning lib
- while(org) {
- org_list.unshift(org.id());
- org = org.parent_ou();
- if (org && typeof org != 'object') {
- org = g.data.hash.aou[ org ];
- }
- }
- for (var i = 0; i < org_list.length; i++) {
- g.render_prefix_menu_items(menupopup,org_list[i]);
- }
- menulist.setAttribute('value',
- typeof g.volumes[vol_idx].prefix() == 'object'
- ? g.volumes[vol_idx].prefix().id()
- : g.volumes[vol_idx].prefix()
- );
+
+ var menulist = cat.util.render_cn_prefix_menu(
+ [ org.id() ],
+ [],
+ typeof g.volumes[vol_idx].prefix() == 'object'
+ ? g.volumes[vol_idx].prefix().id()
+ : g.volumes[vol_idx].prefix()
+ );
menulist.addEventListener(
'command',
return menulist;
}
-g.render_prefix_menu_items = function(menupopup,ou_id) {
- if (typeof g.data.list['acnp_for_lib_'+ou_id] == 'undefined') {
- g.data.list['acnp_for_lib_'+ou_id] = g.network.simple_request(
- 'FM_ACNP_RETRIEVE_VIA_PCRUD',
- [ ses(), {"owning_lib":{"=":ou_id}}, {"order_by":{"acnp":"label_sortkey"}} ]
- );
- g.data.stash('list');
- }
- for (var i = 0; i < g.data.list['acnp_for_lib_'+ou_id].length; i++) {
- var my_acnp = g.data.list['acnp_for_lib_'+ou_id][i];
- var menuitem = document.createElement('menuitem');
- menupopup.appendChild(menuitem);
- menuitem.setAttribute(
- 'label',
- my_acnp.id() == -1 ? '' :
- $('catStrings').getFormattedString(
- 'staff.cat.volume_copy_creator.call_number_prefix.menuitem_label',
- [
- my_acnp.label(),
- g.data.hash.aou[ ou_id ].shortname()
- ]
- )
- );
- menuitem.setAttribute('value',my_acnp.id());
- }
-}
-
-
g.render_suffix_menu = function(vol_idx) {
+
var org = typeof g.volumes[vol_idx].owning_lib() == 'object'
? g.volumes[vol_idx].owning_lib()
: g.data.hash.aou[ g.volumes[vol_idx].owning_lib() ];
- var menulist = document.createElement('menulist');
- var menupopup = document.createElement('menupopup');
- menulist.appendChild(menupopup);
- var org_list = []; // order from top of consortium to owning lib
- while(org) {
- org_list.unshift(org.id());
- org = org.parent_ou();
- if (org && typeof org != 'object') {
- org = g.data.hash.aou[ org ];
- }
- }
- for (var i = 0; i < org_list.length; i++) {
- g.render_suffix_menu_items(menupopup,org_list[i]);
- }
- menulist.setAttribute('value',
- typeof g.volumes[vol_idx].suffix() == 'object'
- ? g.volumes[vol_idx].suffix().id()
- : g.volumes[vol_idx].suffix()
- );
+
+ var menulist = cat.util.render_cn_suffix_menu(
+ [ org.id() ],
+ [],
+ typeof g.volumes[vol_idx].suffix() == 'object'
+ ? g.volumes[vol_idx].suffix().id()
+ : g.volumes[vol_idx].suffix()
+ );
menulist.addEventListener(
'command',
return menulist;
}
-g.render_suffix_menu_items = function(menupopup,ou_id) {
- if (typeof g.data.list['acns_for_lib_'+ou_id] == 'undefined') {
- g.data.list['acns_for_lib_'+ou_id] = g.network.simple_request(
- 'FM_ACNS_RETRIEVE_VIA_PCRUD',
- [ ses(), {"owning_lib":{"=":ou_id}}, {"order_by":{"acns":"label_sortkey"}} ]
- );
- g.data.stash('list');
- }
- for (var i = 0; i < g.data.list['acns_for_lib_'+ou_id].length; i++) {
- var my_acns = g.data.list['acns_for_lib_'+ou_id][i];
- var menuitem = document.createElement('menuitem');
- menupopup.appendChild(menuitem);
- menuitem.setAttribute(
- 'label',
- my_acns.id() == -1 ? '' :
- $('catStrings').getFormattedString(
- 'staff.cat.volume_copy_creator.call_number_suffix.menuitem_label',
- [
- my_acns.label(),
- g.data.hash.aou[ ou_id ].shortname()
- ]
- )
- );
- menuitem.setAttribute('value',my_acns.id());
- }
+g.list_classes = function() {
+ var hbox = $('batch_class');
+ var ml = cat.util.render_cn_class_menu(
+ [
+ [ '<No Change>', false ]
+ ]
+ );
+ ml.setAttribute('id','batch_class_menulist');
+ hbox.appendChild(ml);
}
+g.list_prefixes = function() {
+ var hbox = $('batch_prefix');
+ var ml = cat.util.render_cn_prefix_menu(
+ g.common_ancestor_ou_ids,
+ [
+ [ '<No Change>', false ]
+ ]
+ );
+ ml.setAttribute('id','batch_prefix_menulist');
+ hbox.appendChild(ml);
+}
+g.list_suffixes = function() {
+ var hbox = $('batch_suffix');
+ var ml = cat.util.render_cn_suffix_menu(
+ g.common_ancestor_ou_ids,
+ [
+ [ '<No Change>', false ]
+ ]
+ );
+ ml.setAttribute('id','batch_suffix_menulist');
+ hbox.appendChild(ml);
+}
+
+g.render_batch_button = function() {
+ var hbox = $('batch_button_box');
+ var btn = document.createElement('button');
+ btn.setAttribute('id','batch_button');
+ btn.setAttribute('label',$('catStrings').getString('staff.cat.volume_copy_creator.my_init.btn.label'));
+ btn.setAttribute('accesskey',$('catStrings').getString('staff.cat.volume_copy_creator.my_init.btn.accesskey'));
+ btn.setAttribute('image','/xul/server/skin/media/images/down_arrow.gif');
+ hbox.appendChild(btn);
+ btn.addEventListener(
+ 'command',
+ function() {
+ var nl = document.getElementsByTagName('textbox');
+ for (var i = 0; i < nl.length; i++) {
+ /* label */
+ if (nl[i].getAttribute('rel_vert_pos')==rel_vert_pos_call_number && !nl[i].disabled) {
+ var label = $('marc_cn').firstChild.value;
+ if (label != '') {
+ nl[i].value = label;
+ util.widgets.dispatch('change',nl[i]);
+ }
+ }
+ }
+ nl = document.getElementsByTagName('menulist');
+ for (var i = 0; i < nl.length; i++) {
+ /* classification */
+ if (nl[i].getAttribute('rel_vert_pos')==rel_vert_pos_call_number_classification && !nl[i].disabled) {
+ var value = $('batch_class_menulist').value;
+ if (!isNaN( Number(value) )) {
+ nl[i].value = value;
+ util.widgets.dispatch('command',nl[i]);
+ }
+ }
+ /* prefix */
+ if (nl[i].getAttribute('rel_vert_pos')==rel_vert_pos_call_number_prefix && !nl[i].disabled) {
+ var value = $('batch_prefix_menulist').value;
+ if (!isNaN( Number(value) )) {
+ nl[i].value = value;
+ util.widgets.dispatch('command',nl[i]);
+ }
+ }
+ /* suffix */
+ if (nl[i].getAttribute('rel_vert_pos')==rel_vert_pos_call_number_suffix && !nl[i].disabled) {
+ var value = $('batch_suffix_menulist').value;
+ if (!isNaN( Number(value) )) {
+ nl[i].value = value;
+ util.widgets.dispatch('command',nl[i]);
+ }
+ }
+ }
+ },
+ false
+ );
+}
</hbox>
<hbox>
<spacer flex="1" />
- <checkbox id="auto_merge" label="&staff.cat.volume_editor.automerge.label;" accesskey="&staff.cat.volume_editor.automerge.accesskey;" oils_persist="checked"/>
+ <checkbox id="auto_merge" label="&staff.cat.volume_editor.automerge.label;" accesskey="&staff.cat.volume_editor.automerge.accesskey;" tooltiptext="&staff.cat.volume_editor.automerge.description;" oils_persist="checked"/>
</hbox>
<grid flex="1">
<columns>
<column />
<column class="cn_class"/>
<column class="cn_prefix"/>
- <column flex="1"/>
+ <column />
<column class="cn_suffix"/>
</columns>
<rows id="rows">
+ <row id="batch_bar">
+ <spacer />
+ <vbox class="cn_class">
+ <label value="&staff.cat.volume_copy_creator.batch_bar.call_number.classification;"
+ class="header"/>
+ <hbox id="batch_class"/>
+ </vbox>
+ <vbox class="cn_prefix">
+ <label value="&staff.cat.volume_copy_creator.batch_bar.call_number.prefix;"
+ class="header"/>
+ <hbox id="batch_prefix"/>
+ </vbox>
+ <vbox>
+ <label
+ value="&staff.cat.volume_copy_creator.batch_bar.call_number.label.label;"
+ accesskey="&staff.cat.volume_copy_creator.batch_bar.call_number.label.accesskey;"
+ control="marc_cn_menulist" class="header"/>
+ <hbox id="marc_cn"/>
+ </vbox>
+ <vbox class="cn_suffix">
+ <label value="&staff.cat.volume_copy_creator.batch_bar.call_number.suffix;"
+ class="header"/>
+ <hbox id="batch_suffix"/>
+ </vbox>
+ <vbox>
+ <label class="header" value="&staff.cat.volume_copy_creator.batch_bar;"/>
+ <hbox id="batch_button_box"/>
+ </vbox>
+ </row>
<row>
<label value="&staff.cat.volume_editor.owning_lib;" class="header"/>
<label value="&staff.cat.volume_editor.classification;" class="header cn_class"/>