}
);
-
this.chain.push(
function() {
var f = gen_fm_retrieval_func(
this.chain.push(
function() {
var f = gen_fm_retrieval_func(
+ 'acnp',
+ [
+ api.FM_ACNP_RETRIEVE_VIA_PCRUD.app,
+ api.FM_ACNP_RETRIEVE_VIA_PCRUD.method,
+ [ obj.session.key, {"owning_lib":{"=":obj.list.au[0].ws_ou()}}, {"order_by":{"acnp":"label_sortkey"}} ],
+ false
+ ]
+ );
+ try {
+ f();
+ obj.list['acnp_for_lib_'+obj.list.au[0].ws_ou()] = obj.list.acnp;
+ } catch(E) {
+ var error = 'Error: ' + js2JSON(E);
+ obj.error.sdump('D_ERROR',error);
+ throw(E);
+ }
+ }
+ );
+
+ this.chain.push(
+ function() {
+ var f = gen_fm_retrieval_func(
+ 'acns',
+ [
+ api.FM_ACNS_RETRIEVE_VIA_PCRUD.app,
+ api.FM_ACNS_RETRIEVE_VIA_PCRUD.method,
+ [ obj.session.key, {"owning_lib":{"=":obj.list.au[0].ws_ou()}}, {"order_by":{"acns":"label_sortkey"}} ],
+ false
+ ]
+ );
+ try {
+ f();
+ obj.list['acns_for_lib_'+obj.list.au[0].ws_ou()] = obj.list.acns;
+ } catch(E) {
+ var error = 'Error: ' + js2JSON(E);
+ obj.error.sdump('D_ERROR',error);
+ throw(E);
+ }
+ }
+ );
+
+ this.chain.push(
+ function() {
+ var f = gen_fm_retrieval_func(
'cbt',
[
api.FM_CBT_RETRIEVE.app,
classification_column_box.appendChild(classification_column_menulist);
/**** PREFIX COLUMN revisited ****/
- var prefix_column_menulist = document.createElement('menulist');
+ var prefix_column_menulist = g.render_prefix_menu(call_number_column_textbox);
+ prefix_column_menulist.addEventListener( 'change', g.gather_copies_soon, false);
prefix_column_box.appendChild(prefix_column_menulist);
/**** SUFFIX COLUMN ****/
if ( nl[i].getAttribute('rel_vert_pos') == rel_vert_pos_call_number ) {
var ou_id = nl[i].getAttribute('ou_id');
var acnc_id = nl[i].getAttribute('acnc_id');
+ var acnp_id = nl[i].getAttribute('acnp_id');
var callnumber = nl[i].value;
if (typeof volumes_hash[ou_id] == 'undefined') {
volumes_hash[ou_id] = {}
if (typeof volumes_hash[ou_id][callnumber] == 'undefined') {
volumes_hash[ou_id][callnumber] = {
'call_number_data' : {
- 'acnc_id' : acnc_id
+ 'acnc_id' : acnc_id,
+ 'acnp_id' : acnp_id
},
'barcode_data' : []
}
return ml;
}
+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]);
+ }
+
+ menulist.addEventListener(
+ 'command',
+ function() {
+ call_number_tb.setAttribute('acnp_id',menulist.value);
+ },
+ false
+ );
+ 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.menuentry_label',
+ [
+ my_acnp.label(),
+ g.data.hash.aou[ ou_id ].shortname()
+ ]
+ )
+ );
+ menuitem.setAttribute('value',my_acnp.id());
+ }
+}
+
g.list_callnumbers = function(doc_id, label_class) {
var cn_blob;
try {