1 dump('entering serial/manage_subs.js\n');
4 if (typeof serial == 'undefined') serial = {};
5 serial.manage_subs = function (params) {
7 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
8 JSAN.use('util.error'); this.error = new util.error();
10 dump('serial/manage_subs: ' + E + '\n');
14 serial.manage_subs.prototype = {
23 'editor_indexes' : { 'ssub' : 1, 'sdist' : 2, 'siss' : 3, 'scap' : 4 },
25 'ids_from_sel_list' : function(type) {
27 JSAN.use('util.functional');
29 var list = util.functional.map_list(
30 util.functional.filter_list(
33 return o.split(/_/)[0] == type;
37 return o.split(/_/)[1];
44 'editor_init' : function(type, mode, params) {
47 $('serial_manage_subs_editor_deck').selectedIndex = obj.editor_indexes[type];
49 if (type == "siss") { // begin transition from xul to dojo editors
50 var iframe = dojo.byId('alt_siss_editor');
53 src = '/eg/serial/edit_siss/new/' + params.sisses[0].subscription();
54 iframe.refresh_command = function () {obj.refresh_list();};
56 src = '/eg/serial/edit_siss/' + params.siss_ids[0];
57 iframe.refresh_command = function () { /* TODO: redraw tree node */ };
59 iframe.setAttribute("src", src);
61 var editor_type = type + '_editor';
62 if (typeof obj[editor_type] == 'undefined') {
63 JSAN.use('serial.' + editor_type);
64 obj[editor_type] = new serial[editor_type]();
67 params.do_edit = true;
68 params.handle_update = true;
69 params.trigger_refresh = true;
71 params.refresh_command = function () {obj.refresh_list();};
73 params.refresh_command = function () {obj.remap_node(type, this);};
76 obj[editor_type].init(params);
79 obj.error.standard_unexpected_error_alert('editor_init() error',E);
83 // while not a true tree node repace, this should at least prevent
84 // non-display side-effects. True node replace is TODO
85 'remap_node' : function(type, editor_obj) {
88 for (i = 0; i < editor_obj[editor_obj.fm_type_plural].length; i++) {
89 var new_obj = editor_obj[editor_obj.fm_type_plural][i];
90 var old_obj = obj['map_' + type][type + '_' + new_obj.id()];
91 if (type == 'ssub') { // add children back on
92 new_obj.distributions(old_obj.distributions());
93 new_obj.issuances(old_obj.issuances());
94 new_obj.scaps(old_obj.scaps());
96 obj['map_' + type][type + '_' + new_obj.id()] = new_obj;
100 obj.error.standard_unexpected_error_alert('remap_node() error',E);
104 'do_delete' : function(type, method, overridable_events) {
107 JSAN.use('util.functional');
109 var list = util.functional.filter_list(
112 return o.split(/_/)[0] == type;
116 list = util.functional.map_list(
119 return JSON2js( js2JSON( obj['map_' + type][ type + '_' + o.split(/_/)[1] ] ) );
123 //TODO: proper messages
125 if (list.length != 1) {
126 delete_msg = document.getElementById('serialStrings').getFormattedString('staff.serial.manage_subs.delete_' + type + '.confirm.plural', [list.length]);
128 delete_msg = document.getElementById('serialStrings').getString('staff.serial.manage_subs.delete_' + type + '.confirm');
130 var r = obj.error.yns_alert(
132 document.getElementById('serialStrings').getString('staff.serial.manage_subs.delete_' + type + '.title'),
133 document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_items.delete'),
134 document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_items.cancel'),
136 document.getElementById('commonStrings').getString('common.confirm')
140 for (var i = 0; i < list.length; i++) {
141 list[i].isdeleted('1');
143 var robj = obj.network.request(
146 [ ses(), list, true ],
149 'title' : document.getElementById('serialStrings').getString('staff.serial.manage_subs.delete_' + type + '.override'),
150 'overridable_events' : overridable_events
153 if (robj == null) throw(robj);
154 if (typeof robj.ilsevent != 'undefined') {
155 if (robj.ilsevent != 0) {
156 var overridable = false;
157 for (i = 0; i < overridable_events.length; i++) {
158 if (overridable_events[i] == robj.ilsevent) {
163 if (!overridable) throw(robj);
169 obj.error.standard_unexpected_error_alert(document.getElementById('serialStrings').getString('staff.serial.manage_subs.delete.error'),E);
174 'init' : function( params ) {
177 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
180 obj.docid = params.docid;
182 JSAN.use('util.network'); obj.network = new util.network();
183 JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.init({'via':'stash'});
184 JSAN.use('util.controller'); obj.controller = new util.controller();
188 'save_columns' : [ [ 'command' ], function() { obj.list.save_columns(); } ],
191 function() { obj.list.clipboard(); }
196 alert(document.getElementById('commonStrings').getString('common.unimplemented'));
199 'cmd_show_my_libs' : [
205 'cmd_show_all_libs' : [
211 'cmd_show_libs_with_distributions' : [
214 obj.show_libs_with_distributions();
228 var list = obj.ids_from_sel_list('ssub');
229 if (list.length == 0) list = obj.ids_from_sel_list('scap-group');
230 if (list.length == 0) return;
232 /*TODO: permission check?
233 //populate 'list' with owning_libs of subs, TODO
236 edit = obj.network.request(
237 api.PERM_MULTI_ORG_CHECK.app,
238 api.PERM_MULTI_ORG_CHECK.method,
241 obj.data.list.au[0].id(),
245 ).length == 0 ? 1 : 0;
247 obj.error.sdump('D_ERROR','batch permission check: ' + E);
250 if (edit==0) return; // no read-only view for this interface */
251 var new_scap = new scap();
252 new_scap.subscription(list[0]);//TODO: add multiple at once support?
255 params.scaps = [new_scap];
256 obj.editor_init('scap', 'add', params);
258 obj.error.standard_unexpected_error_alert(document.getElementById('serialStrings').getString('staff.serial.manage_subs.add.error'),E);
266 var list = obj.ids_from_sel_list('ssub');
267 if (list.length == 0) list = obj.ids_from_sel_list('siss-group');
268 if (list.length == 0) return;
270 /*TODO: permission check?
271 //populate 'list' with owning_libs of subs, TODO
274 edit = obj.network.request(
275 api.PERM_MULTI_ORG_CHECK.app,
276 api.PERM_MULTI_ORG_CHECK.method,
279 obj.data.list.au[0].id(),
283 ).length == 0 ? 1 : 0;
285 obj.error.sdump('D_ERROR','batch permission check: ' + E);
288 if (edit==0) return; // no read-only view for this interface */
289 var new_siss = new siss();
290 new_siss.subscription(list[0]);//TODO: add multiple at once support?
293 params.sisses = [new_siss];
294 obj.editor_init('siss', 'add', params);
296 obj.error.standard_unexpected_error_alert(document.getElementById('serialStrings').getString('staff.serial.manage_subs.add.error'),E);
304 var list = obj.ids_from_sel_list('ssub');
305 if (list.length == 0) list = obj.ids_from_sel_list('sdist-group');
306 if (list.length == 0) return;
308 /*TODO: permission check?
309 //populate 'list' with owning_libs of subs, TODO
312 edit = obj.network.request(
313 api.PERM_MULTI_ORG_CHECK.app,
314 api.PERM_MULTI_ORG_CHECK.method,
317 obj.data.list.au[0].id(),
321 ).length == 0 ? 1 : 0;
323 obj.error.sdump('D_ERROR','batch permission check: ' + E);
326 if (edit==0) return; // no read-only view for this interface */
327 var new_sdist = new sdist();
328 new_sdist.subscription(list[0]);//TODO: add multiple at once support?
329 new_sdist.holding_lib(obj.map_ssub['ssub_' + list[0]].owning_lib());//default to sub owning lib
330 new_sdist.label($('serialStrings').getString('serial.common.default'));
333 params.sdists = [new_sdist];
334 obj.editor_init('sdist', 'add', params);
336 obj.error.standard_unexpected_error_alert(document.getElementById('serialStrings').getString('staff.serial.manage_subs.add.error'),E);
340 'cmd_delete_scap' : [
343 var overridable_events = [
344 11001 // SERIAL_CAPTION_AND_PATTERN_HAS_ISSUANCES
346 obj.do_delete('scap', 'open-ils.serial.caption_and_pattern.batch.update', overridable_events);
349 'cmd_delete_sdist' : [
352 var overridable_events = [ //TODO: proper overrides
354 obj.do_delete('sdist', 'open-ils.serial.distribution.fleshed.batch.update', overridable_events);
357 'cmd_delete_siss' : [
360 var overridable_events = [ //TODO: proper overrides
362 obj.do_delete('siss', 'open-ils.serial.issuance.fleshed.batch.update', overridable_events);
365 'cmd_delete_ssub' : [
368 var overridable_events = [
369 11000 // SERIAL_SUBSCRIPTION_NOT_EMPTY
371 obj.do_delete('ssub', 'open-ils.serial.subscription.fleshed.batch.update', overridable_events);
374 /*dbw2 'cmd_delete_ssub' : [
378 JSAN.use('util.functional');
380 var list = util.functional.filter_list(
383 return o.split(/_/)[0] == 'ssub';
387 list = util.functional.map_list(
390 return JSON2js( js2JSON( obj.map_ssub[ 'ssub_' + o.split(/_/)[1] ] ) );
395 if (list.length == 1) {
396 //TODO: correct prompts
397 del_prompt = document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.prompt');
399 del_prompt = document.getElementById('catStrings').getFormattedString('staff.cat.copy_browser.delete_volume.prompt.plural', [list.length]);
402 var r = obj.error.yns_alert(
404 document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.title'),
405 document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.delete'),
406 document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.cancel'),
408 document.getElementById('commonStrings').getString('common.confirm')
412 for (var i = 0; i < list.length; i++) {
413 list[i].isdeleted('1');
415 var robj = obj.network.simple_request(
416 'FM_ACN_TREE_UPDATE',
417 [ ses(), list, true ],
420 'title' : document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.override'),
421 'overridable_events' : [
425 if (robj == null) throw(robj);
426 if (typeof robj.ilsevent != 'undefined') {
427 if (robj.ilsevent == 1206 ) { // VOLUME_NOT_EMPTY
428 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.copies_remain'));
431 if (robj.ilsevent != 0) throw(robj);
433 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.success'));
437 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.exception'),E);
443 'cmd_mark_library' : [
447 var list = obj.ids_from_sel_list('aou');
448 if (list.length == 1) {
449 obj.data.marked_library = { 'lib' : list[0], 'docid' : obj.docid };
450 obj.data.stash('marked_library');
451 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.mark_library.alert'));
454 document.getElementById('catStrings').getString('staff.cat.copy_browser.mark_library.prompt'),
455 document.getElementById('catStrings').getString('staff.cat.copy_browser.mark_library.title'),
456 document.getElementById('commonStrings').getString('common.ok'),
459 document.getElementById('commonStrings').getString('common.confirm')
463 obj.error.standard_unexpected_error_alert('manage_subs.js -> mark library',E);
468 'cmd_mark_subscription' : [
472 var list = obj.ids_from_sel_list('ssub');
473 if (list.length == 1) {
474 obj.data.marked_subscription = list[0];
475 obj.data.stash('marked_subscription');
476 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.mark_volume.alert'));
479 document.getElementById('catStrings').getString('staff.cat.copy_browser.mark_volume.prompt'),
480 document.getElementById('catStrings').getString('staff.cat.copy_browser.mark_volume.title'),
481 document.getElementById('commonStrings').getString('common.ok'),
484 document.getElementById('commonStrings').getString('common.confirm')
488 obj.error.standard_unexpected_error_alert('manage_subs.js -> mark subscription',E);
492 'cmd_add_subscriptions' : [
496 var list = obj.ids_from_sel_list('aou');
497 if (list.length == 0) return;
498 //TODO: permission check?
501 edit = obj.network.request(
502 api.PERM_MULTI_ORG_CHECK.app,
503 api.PERM_MULTI_ORG_CHECK.method,
506 obj.data.list.au[0].id(),
508 [ 'CREATE_VOLUME', 'CREATE_COPY' ]
510 ).length == 0 ? 1 : 0;
512 obj.error.sdump('D_ERROR','batch permission check: ' + E);
516 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.add_volume.permission_error'));
517 return; // no read-only view for this interface
519 var new_ssub = new ssub();
520 new_ssub.owning_lib(list[0]);//TODO: add multiple at once support?
522 new_ssub.record_entry(obj.docid);
524 params.ssubs = [new_ssub];
525 obj.editor_init('ssub', 'add', params);
527 obj.error.standard_unexpected_error_alert(document.getElementById('serialStrings').getString('staff.serial.manage_subs.add.error'),E);
531 'cmd_transfer_subscription' : [
535 obj.data.stash_retrieve();
536 if (!obj.data.marked_library) {
537 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer_volume.alert'));
541 var list = obj.ids_from_sel_list('ssub');
543 netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite');
545 JSAN.use('util.functional');
547 var ssub_list = util.functional.map_list(
550 return obj.map_ssub[ 'ssub_' + o ].start_date();
552 ).join(document.getElementById('commonStrings').getString('common.grouping_string'));
554 var xml = '<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" flex="1" style="overflow: auto">';
555 xml += '<description>';
556 xml += document.getElementById('catStrings').getFormattedString('staff.cat.copy_browser.transfer.prompt', [ssub_list, obj.data.hash.aou[ obj.data.marked_library.lib ].shortname()]);
557 xml += '</description>';
558 xml += '<hbox><button label="' + document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer.submit.label') + '" name="fancy_submit"/>';
559 xml += '<button label="'
560 + document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer.cancel.label')
562 + document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer.cancel.accesskey')
563 + '" name="fancy_cancel"/></hbox>';
564 xml += '<iframe style="overflow: scroll" flex="1" src="' + urls.XUL_BIB_BRIEF + '?docid=' + obj.data.marked_library.docid + '"/>';
566 JSAN.use('OpenILS.data');
567 var data = new OpenILS.data(); data.init({'via':'stash'});
568 //data.temp_transfer = xml; data.stash('temp_transfer');
569 JSAN.use('util.window'); var win = new util.window();
570 var fancy_prompt_data = win.open(
571 urls.XUL_FANCY_PROMPT,
572 //+ '?xml_in_stash=temp_transfer'
573 //+ '&title=' + window.escape('Volume Transfer'),
574 'fancy_prompt', 'chrome,resizable,modal,width=500,height=300',
577 'title' : document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer.title')
581 if (fancy_prompt_data.fancy_status == 'incomplete') {
582 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer.incomplete'));
586 var robj = obj.network.simple_request(
588 [ ses(), { 'docid' : obj.data.marked_library.docid, 'lib' : obj.data.marked_library.lib, 'subscriptions' : list } ],
591 'title' : document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer.override.failure'),
592 'overridable_events' : [
593 1208, // TITLE_LAST_COPY
594 1219, // COPY_REMOTE_CIRC_LIB
599 if (typeof robj.ilsevent != 'undefined') {
600 if (robj.ilsevent == 1221) { // ORG_CANNOT_HAVE_VOLS
601 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer.ineligible_destination'));
606 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer.success'));
610 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer.unexpected_error'),E);
616 'cmd_transfer_sdists' : [
620 obj.data.stash_retrieve();
621 if (!obj.data.marked_subscription) {
622 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer_items.missing_volume'));
626 JSAN.use('util.functional');
628 var list = obj.ids_from_sel_list('sdist');
629 var subscription = obj.network.simple_request('FM_ACN_RETRIEVE.authoritative',[ obj.data.marked_subscription ]);
631 JSAN.use('cat.util'); cat.util.transfer_copies( {
632 'distribution_ids' : list,
633 'docid' : subscription.record(),
634 'subscription_label' : subscription.start_date(),
635 'owning_lib' : subscription.owning_lib(),
639 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer_items.unexpected_error'),E);
644 'cmd_refresh_list' : [
650 'cmd_make_predictions' : [
654 var list = obj.ids_from_sel_list('ssub');
655 if (list.length == 0) {
656 alert($('serialStrings').getString('serial.manage_subs.predict.alert')); //TODO: better error
660 var num_to_predict = prompt($('serialStrings').getString('serial.manage_subs.predict.prompt'),
662 $('serialStrings').getString('serial.manage_subs.predict.prompt.text'));
663 num_to_predict = String( num_to_predict ).replace(/\D/g,'');
664 if (num_to_predict == '') {
665 alert($('serialStrings').getString('serial.manage_subs.invalid_number')); //TODO: better error
669 for (i = 0; i < list.length; i++) {
670 var robj = obj.network.request(
672 'open-ils.serial.make_predictions',
673 [ ses(), {"ssub_id":list[i], "num_to_predict":num_to_predict}]
675 alert($('serialStrings').getFormattedString('serial.manage_subs.predict_success', [robj.length, list[i]]));
681 obj.error.standard_unexpected_error_alert('cmd_make_predictions failed!',E);
685 /*dbw2 'sel_distribution_details' : [
688 JSAN.use('util.functional');
690 var list = util.functional.filter_list(
693 return o.split(/_/)[0] == 'sdist';
697 list = util.functional.map_list(
700 return o.split(/_/)[1];
704 JSAN.use('circ.util');
705 for (var i = 0; i < list.length; i++) {
706 circ.util.show_copy_details( list[i] );
710 'cmd_edit_sdists' : [
714 JSAN.use('util.functional');
716 var list = util.functional.filter_list(
719 return o.split(/_/)[0] == 'sdist';
723 list = util.functional.map_list(
726 return o.split(/_/)[1];
730 JSAN.use('cat.util'); cat.util.spawn_copy_editor( { 'copy_ids' : list, 'edit' : 1 } );
734 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.edit_items.error'),E);
739 /*dbw2 'cmd_print_spine_labels' : [
743 JSAN.use('util.functional');
745 var list = util.functional.filter_list(
748 return o.split(/_/)[0] == 'sdist';
752 list = util.functional.map_list(
755 return obj.map_sdist[ o ];
759 obj.data.temp_barcodes_for_labels = util.functional.map_list( list, function(o){return o.barcode();}) ;
760 obj.data.stash('temp_barcodes_for_labels');
762 xulG.url_prefix( urls.XUL_SPINE_LABEL ),
763 { 'tab_name' : document.getElementById('catStrings').getString('staff.cat.copy_browser.print_spine.tab') },
767 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.print_spine.error'),E);
771 'cmd_edit_subscriptions' : [
775 JSAN.use('util.functional');
776 var list = util.functional.map_list(
777 util.functional.filter_list(
780 return o.split(/_/)[0] == 'ssub';
784 return o.split(/_/)[1];
787 if (list.length == 0) return;
791 edit = obj.network.request(
792 api.PERM_MULTI_ORG_CHECK.app,
793 api.PERM_MULTI_ORG_CHECK.method,
796 obj.data.list.au[0].id(),
797 util.functional.map_list(
800 return obj.map_ssub[ 'ssub_' + o ].owning_lib();
805 ).length == 0 ? 1 : 0;
807 obj.error.sdump('D_ERROR','batch permission check: ' + E);
811 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.edit_volume.permission_error'));
812 return; // no read-only view for this interface
815 list = util.functional.map_list(
818 var my_ssub = obj.map_ssub['ssub_' + o];
819 return function(r){return r;}(my_ssub);
824 if (list.length == 1) {
825 title = document.getElementById('catStrings').getString('staff.cat.copy_browser.edit_volume.title');
827 title = document.getElementById('catStrings').getString('staff.cat.copy_browser.edit_volume.title.plural');
830 JSAN.use('util.window'); var win = new util.window();
831 //obj.data.volumes_temp = js2JSON( list );
832 //obj.data.stash('volumes_temp');
833 var my_xulG = win.open(
834 window.xulG.url_prefix(urls.XUL_VOLUME_EDITOR),
836 'chrome,modal,resizable',
837 { 'subscriptions' : JSON2js(js2JSON(list)) }
840 // FIXME -- need to unique the temp space, and not rely on modalness of window
841 //obj.data.stash_retrieve();
842 if (typeof my_xulG.update_these_subscriptions == 'undefined') { return; }
843 var subscriptions = my_xulG.subscriptions;
844 if (!subscriptions) return;
846 subscriptions = util.functional.filter_list(
849 return o.ischanged() == '1';
853 subscriptions = util.functional.map_list(
856 o.record( obj.docid ); // staff client 2 did not do this. Does it matter?
861 if (subscriptions.length == 0) return;
864 var r = obj.network.request(
865 api.FM_ACN_TREE_UPDATE.app,
866 api.FM_ACN_TREE_UPDATE.method,
867 [ ses(), subscriptions, true ]
869 if (typeof r.ilsevent != 'undefined') {
870 switch(Number(r.ilsevent)) {
871 case 1705 : // VOLUME_LABEL_EXISTS
872 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.edit_volume.failed'));
877 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.edit_volume.success'));
880 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.edit_volume.error'),E);
885 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.edit_volume.exception'),E);
893 obj.list_init(params);
895 obj.org_ids = obj.network.simple_request('FM_SSUB_AOU_IDS_RETRIEVE_VIA_RECORD_ID.authoritative',[ obj.docid ]);
896 if (typeof obj.org_ids.ilsevent != 'undefined') throw(obj.org_ids);
897 JSAN.use('util.functional');
898 obj.org_ids = util.functional.map_list( obj.org_ids, function (o) { return Number(o); });
900 var org = obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ];
901 //obj.show_libs( org );
903 //obj.show_my_libs();
905 JSAN.use('util.file'); JSAN.use('util.widgets');
907 var file; var list_data; var ml;
909 file = new util.file('offline_ou_list');
910 if (file._file.exists()) {
911 list_data = file.get_object(); file.close();
912 ml = util.widgets.make_menulist( list_data[0], list_data[1] );
913 ml.setAttribute('id','lib_menu'); document.getElementById('serial_sub_lib_menu').appendChild(ml);
914 //TODO: class this menu properly
915 for (var i = 0; i < obj.org_ids.length; i++) {
916 ml.getElementsByAttribute('value',obj.org_ids[i])[0].setAttribute('class','has_distributions');
918 ml.firstChild.addEventListener(
921 document.getElementById('legend').setAttribute('hidden','false');
925 ml.firstChild.addEventListener(
928 document.getElementById('legend').setAttribute('hidden','true');
935 if (document.getElementById('refresh_button')) document.getElementById('refresh_button').focus();
936 JSAN.use('util.file'); var file = new util.file('manage_subs_prefs.'+obj.data.server_unadorned);
937 util.widgets.save_attributes(file, { 'lib_menu' : [ 'value' ], 'show_ssubs' : [ 'checked' ], 'show_ssub_groups' : [ 'checked' ] });
943 throw(document.getElementById('catStrings').getString('staff.cat.copy_browser.missing_library') + '\n');
946 file = new util.file('manage_subs_prefs.'+obj.data.server_unadorned);
947 util.widgets.load_attributes(file);
948 ml.value = ml.getAttribute('value');
951 ml.setAttribute('value',ml.value);
954 document.getElementById('show_ssubs').addEventListener(
957 JSAN.use('util.file'); var file = new util.file('manage_subs_prefs.'+obj.data.server_unadorned);
958 util.widgets.save_attributes(file, { 'lib_menu' : [ 'value' ], 'show_ssubs' : [ 'checked' ], 'show_ssub_groups' : [ 'checked' ] });
963 document.getElementById('show_ssub_groups').addEventListener(
966 JSAN.use('util.file'); var file = new util.file('manage_subs_prefs.'+obj.data.server_unadorned);
967 util.widgets.save_attributes(file, { 'lib_menu' : [ 'value' ], 'show_ssubs' : [ 'checked' ], 'show_ssub_groups' : [ 'checked' ] });
972 obj.show_my_libs( ml.value );
974 JSAN.use('util.exec'); var exec = new util.exec(20); exec.timer(obj.funcs,100);
976 obj.toggle_actions(); // disable menus initially
979 this.error.standard_unexpected_error_alert('serial/manage_subs.init: ',E);
983 'show_my_libs' : function(org) {
987 org = obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ];
989 if (typeof org != 'object') org = obj.data.hash.aou[ org ];
991 obj.show_libs( org, false );
993 var p_org = obj.data.hash.aou[ org.parent_ou() ];
995 obj.funcs.push( function() {
996 document.getElementById('cmd_refresh_list').setAttribute('disabled','true');
997 document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','true');
998 document.getElementById('lib_menu').setAttribute('disabled','true');
1000 for (var i = 0; i < p_org.children().length; i++) {
1004 obj.show_libs( o, false );
1006 }( p_org.children()[i] )
1009 obj.funcs.push( function() {
1010 document.getElementById('cmd_refresh_list').setAttribute('disabled','false');
1011 document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','false');
1012 document.getElementById('lib_menu').setAttribute('disabled','false');
1020 'show_all_libs' : function() {
1025 obj.show_libs( obj.data.tree.aou );
1027 obj.funcs.push( function() {
1028 document.getElementById('cmd_refresh_list').setAttribute('disabled','true');
1029 document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','true');
1030 document.getElementById('lib_menu').setAttribute('disabled','true');
1033 for (var i = 0; i < obj.data.tree.aou.children().length; i++) {
1039 }( obj.data.tree.aou.children()[i] )
1042 obj.funcs.push( function() {
1043 document.getElementById('cmd_refresh_list').setAttribute('disabled','false');
1044 document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','false');
1045 document.getElementById('lib_menu').setAttribute('disabled','false');
1053 'show_libs_with_distributions' : function() {
1056 JSAN.use('util.functional');
1058 var orgs = util.functional.map_list(
1060 function(id) { return obj.data.hash.aou[id]; }
1063 if (a.shortname() < b.shortname()) return -1;
1064 if (a.shortname() > b.shortname()) return 1;
1068 obj.funcs.push( function() {
1069 document.getElementById('cmd_refresh_list').setAttribute('disabled','true');
1070 document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','true');
1071 document.getElementById('lib_menu').setAttribute('disabled','true');
1074 for (var i = 0; i < orgs.length; i++) {
1078 obj.show_libs(o,false);
1083 obj.funcs.push( function() {
1084 document.getElementById('cmd_refresh_list').setAttribute('disabled','false');
1085 document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','false');
1086 document.getElementById('lib_menu').setAttribute('disabled','false');
1094 'show_libs' : function(start_aou,show_open) {
1097 if (!start_aou) throw('show_libs: Need a start_aou');
1098 JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.init({'via':'stash'});
1099 JSAN.use('util.functional');
1102 var temp_aou = start_aou;
1103 while ( temp_aou.parent_ou() ) {
1104 temp_aou = obj.data.hash.aou[ temp_aou.parent_ou() ];
1105 parents.push( temp_aou );
1109 for (var i = 0; i < parents.length; i++) {
1113 obj.append_org(o,p,{'container':'true','open':'true'});
1115 }(parents[i], obj.data.hash.aou[ parents[i].parent_ou() ])
1121 return function() { obj.append_org(o,p); };
1122 }(start_aou,obj.data.hash.aou[ start_aou.parent_ou() ])
1127 if (start_aou.children()) {
1128 var x = obj.map_tree[ 'aou_' + start_aou.id() ];
1129 x.setAttribute('container','true');
1130 if (show_open) x.setAttribute('open','true');
1131 for (var i = 0; i < start_aou.children().length; i++) {
1134 return function() { obj.append_org(o,p); };
1135 }( start_aou.children()[i], start_aou )
1147 'on_select' : function(list,twisty) {
1151 for (var i = 0; i < list.length; i++) {
1152 var row_type = list[i].split('_')[0];
1153 var id = list[i].split('_')[1];
1155 if (!sel_lists[row_type]) sel_lists[row_type] = [];
1156 sel_lists[row_type].push(id);
1159 case 'aou' : obj.on_click_aou(id,twisty); break;
1160 case 'ssub' : obj.on_select_ssub(id,twisty); break;
1165 if (!obj.focused_node_retrieve_id) return;
1167 var row_type = obj.focused_node_retrieve_id.split('_')[0];
1168 var id = obj.focused_node_retrieve_id.split('_')[1];
1170 if (sel_lists[row_type]) { // the type focused is in the selection (usually the case)
1172 case 'aou' : obj.on_click_aou(id,twisty); break;
1173 default: if (obj['on_click_' + row_type]) obj['on_click_' + row_type](sel_lists[row_type],twisty);
1178 'on_select_ssub' : function(ssub_id,twisty) {
1181 //typo? var ssub_tree = obj.map_sdist[ 'ssub_' + ssub_id ];
1182 var ssub_tree = obj.map_ssub[ 'ssub_' + ssub_id ];
1183 obj.funcs.push( function() {
1184 document.getElementById('cmd_refresh_list').setAttribute('disabled','true');
1185 document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','true');
1186 document.getElementById('lib_menu').setAttribute('disabled','true');
1188 if (ssub_tree.distributions()) {
1189 for (var i = 0; i < ssub_tree.distributions().length; i++) {
1193 obj.append_member(c,a,[],'sdist');
1195 }( ssub_tree.distributions()[i], ssub_tree )
1199 if (ssub_tree.issuances()) {
1200 for (var i = 0; i < ssub_tree.issuances().length; i++) {
1204 obj.append_member(c,a,[],'siss');
1206 }( ssub_tree.issuances()[i], ssub_tree )
1210 if (ssub_tree.scaps()) {
1211 for (var i = 0; i < ssub_tree.scaps().length; i++) {
1215 obj.append_member(c,a,[],'scap');
1217 }( ssub_tree.scaps()[i], ssub_tree )
1221 obj.funcs.push( function() {
1222 document.getElementById('cmd_refresh_list').setAttribute('disabled','false');
1223 document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','false');
1224 document.getElementById('lib_menu').setAttribute('disabled','false');
1231 'on_click_ssub' : function(ssub_ids,twisty) {
1234 // draw sdist editor
1235 if (typeof twisty == 'undefined') {
1237 params.ssub_ids = ssub_ids;
1238 obj.editor_init('ssub', 'edit', params);
1245 'on_click_sdist' : function(sdist_ids,twisty) {
1248 // draw sdist editor
1249 if (typeof twisty == 'undefined') {
1251 params.sdist_ids = sdist_ids;
1252 obj.editor_init('sdist', 'edit', params);
1259 'on_click_siss' : function(siss_ids,twisty) {
1263 if (typeof twisty == 'undefined') {
1265 params.siss_ids = siss_ids;
1266 obj.editor_init('siss', 'edit', params);
1273 'on_click_scap' : function(scap_ids,twisty) {
1277 if (typeof twisty == 'undefined') {
1279 params.scap_ids = scap_ids;
1280 obj.editor_init('scap', 'edit', params);
1287 'on_click_aou' : function(org_id,twisty) {
1289 var org = obj.data.hash.aou[ org_id ];
1290 obj.funcs.push( function() {
1291 document.getElementById('cmd_refresh_list').setAttribute('disabled','true');
1292 document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','true');
1293 document.getElementById('lib_menu').setAttribute('disabled','true');
1295 if (org.children()) {
1296 for (var i = 0; i < org.children().length; i++) {
1302 }(org.children()[i],org)
1306 if (obj.map_ssub[ 'aou_' + org_id ]) {
1307 for (var i = 0; i < obj.map_ssub[ 'aou_' + org_id ].length; i++) {
1311 obj.append_ssub(o,a);
1313 }( org, obj.map_ssub[ 'aou_' + org_id ][i] )
1317 obj.funcs.push( function() {
1318 document.getElementById('cmd_refresh_list').setAttribute('disabled','false');
1319 document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','false');
1320 document.getElementById('lib_menu').setAttribute('disabled','false');
1323 // remove current editor
1324 if (typeof twisty == 'undefined') {
1325 document.getElementById('serial_manage_subs_editor_deck').selectedIndex = 0;
1329 'append_org' : function (org,parent_org,params) {
1332 if (obj.map_tree[ 'aou_' + org.id() ]) {
1333 var x = obj.map_tree[ 'aou_' + org.id() ];
1335 for (var i in params) {
1336 x.setAttribute(i,params[i]);
1348 'skip_all_columns_except' : [0,1,2],
1349 'retrieve_id' : 'aou_' + org.id(),
1351 'no_auto_select' : true,
1355 if ( obj.org_ids.indexOf( Number( org.id() ) ) == -1 ) {
1356 if ( get_bool( obj.data.hash.aout[ org.ou_type() ].can_have_vols() ) ) {
1357 data.row.my.subscription_count = '0';
1358 //data.row.my.distribution_count = '<0>';
1360 data.row.my.subscription_count = '';
1361 //data.row.my.distribution_count = '';
1364 var v_count = 0; var d_count = 0;
1365 ssub_tree_list = obj.network.simple_request(
1366 'FM_SSUB_TREE_LIST_RETRIEVE_VIA_RECORD_ID_AND_ORG_IDS.authoritative',
1367 [ ses(), obj.docid, [ org.id() ] ]
1369 for (var i = 0; i < ssub_tree_list.length; i++) {
1371 obj.map_ssub[ 'ssub_' + ssub_tree_list[i].id() ] = function(r){return r;}(ssub_tree_list[i]);
1372 var distributions = ssub_tree_list[i].distributions();
1373 //if (distributions) d_count += distributions.length;
1374 for (var j = 0; j < distributions.length; j++) {
1375 obj.map_sdist[ 'sdist_' + distributions[j].id() ] = function(r){return r;}(distributions[j]);
1377 var issuances = ssub_tree_list[i].issuances();
1378 for (var j = 0; j < issuances.length; j++) {
1379 obj.map_siss[ 'siss_' + issuances[j].id() ] = function(r){return r;}(issuances[j]);
1381 var scaps = ssub_tree_list[i].scaps();
1382 for (var j = 0; j < scaps.length; j++) {
1383 obj.map_scap[ 'scap_' + scaps[j].id() ] = function(r){return r;}(scaps[j]);
1386 data.row.my.subscription_count = v_count;
1387 //data.row.my.distribution_count = '<' + d_count + '>';
1390 data.node = obj.map_tree[ 'aou_' + parent_org.id() ];
1392 var nparams = obj.list.append(data);
1393 var node = nparams.treeitem_node;
1395 for (var i in params) {
1396 node.setAttribute(i,params[i]);
1399 obj.map_tree[ 'aou_' + org.id() ] = node;
1401 if (org.children()) {
1402 node.setAttribute('container','true');
1406 if ( obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ].parent_ou() == parent_org.id() ) {
1407 data.node.setAttribute('open','true');
1410 obj.map_tree[ 'aou_' + org.id() ].setAttribute('open','true');
1413 if (ssub_tree_list) {
1414 obj.map_ssub[ 'aou_' + org.id() ] = ssub_tree_list;
1415 node.setAttribute('container','true');
1418 if (document.getElementById('show_ssubs').checked) {
1419 obj.funcs.push( function() { obj.on_click_aou( org.id() ); } );
1420 node.setAttribute('open','true');
1429 'append_ssub' : function( org, ssub_tree, params ) {
1432 if (obj.map_tree[ 'ssub_' + ssub_tree.id() ]) {
1433 var x = obj.map_tree[ 'ssub_' + ssub_tree.id() ];
1435 for (var i in params) {
1436 x.setAttribute(i,params[i]);
1442 var parent_node = obj.map_tree[ 'aou_' + org.id() ];
1448 'subscription_count' : '',
1449 //'distribution_count' : ssub_tree.distributions() ? ssub_tree.distributions().length : '0',
1452 'skip_all_columns_except' : [0,1,2],
1453 'retrieve_id' : 'ssub_' + ssub_tree.id(),
1454 'node' : parent_node,
1456 'no_auto_select' : true,
1458 var nparams = obj.list.append(data);
1459 var node = nparams.treeitem_node;
1460 obj.map_tree[ 'ssub_' + ssub_tree.id() ] = node;
1462 for (var i in params) {
1463 node.setAttribute(i,params[i]);
1466 if (ssub_tree.distributions() || ssub_tree.scaps() || ssub_tree.issuances()) {
1467 //did this support a later typo? obj.map_sdist[ 'ssub_' + ssub_tree.id() ] = ssub_tree;
1468 node.setAttribute('container','true');
1470 if (document.getElementById('show_ssub_groups').checked) {
1471 node.setAttribute('open','true');
1472 obj.funcs.push( function() { obj.on_select_ssub( ssub_tree.id(), true ); } );
1474 var sdist_group_node_data = {
1477 'label' : $('serialStrings').getString('serial.manage_subs.distributions'),
1480 'retrieve_id' : 'sdist-group_' + ssub_tree.id(),
1483 'no_auto_select' : true,
1485 nparams = obj.list.append(sdist_group_node_data);
1486 obj.map_tree[ 'ssub_sdist_group_' + ssub_tree.id() ] = nparams.treeitem_node;
1488 var siss_group_node_data = {
1491 'label' : $('serialStrings').getString('serial.manage_subs.issuances'),
1494 'retrieve_id' : 'siss-group_' + ssub_tree.id(),
1497 'no_auto_select' : true,
1499 nparams = obj.list.append(siss_group_node_data);
1500 obj.map_tree[ 'ssub_siss_group_' + ssub_tree.id() ] = nparams.treeitem_node;
1502 var scap_group_node_data = {
1505 'label' : $('serialStrings').getString('serial.manage_subs.captions_patterns'),
1508 'retrieve_id' : 'scap-group_' + ssub_tree.id(),
1511 'no_auto_select' : true,
1513 nparams = obj.list.append(scap_group_node_data);
1514 obj.map_tree[ 'ssub_scap_group_' + ssub_tree.id() ] = nparams.treeitem_node;
1521 'append_member' : function( item, ssub_tree, attributes, type ) {
1524 if (obj.map_tree[ type + '_' + item.id() ]) {
1525 var x = obj.map_tree[ type + '_' + item.id() ];
1527 for (var i in attributes) {
1528 x.setAttribute(i,attributes[i]);
1534 var parent_node = obj.map_tree[ 'ssub_' + type + '_group_' + ssub_tree.id() ];
1538 'aou' : obj.data.hash.aou[ ssub_tree.owning_lib() ],
1540 'subscription_count' : '',
1541 //'distribution_count' : '',
1544 'retrieve_id' : type + '_' + item.id(),
1545 'node' : parent_node,
1547 'no_auto_select' : true,
1549 data['row']['my'][type] = item; // TODO: future optimization: get only the IDs of these leaves, then fetch the full row in 'retrieve_row'
1550 var nparams = obj.list.append(data);
1551 var node = nparams.treeitem_node;
1552 obj.map_tree[ type + '_' + item.id() ] = node;
1554 for (var i in attributes) {
1555 node.setAttribute(i,attributes[i]);
1565 'list_init' : function( params ) {
1568 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
1571 JSAN.use('circ.util');
1574 'id' : 'tree_location',
1575 'label' : $('serialStrings').getString('serial.manage_subs.tree_location'),
1576 'flex' : 1, 'primary' : true, 'hidden' : false,
1577 'render' : function(my) {
1578 if (my.sdist) { return my.sdist.label(); }
1579 if (my.siss) { return my.siss.label(); }
1580 if (my.scap) { return $('serialStrings').getFormattedString('serial.manage_subs.scap_id', [my.scap.id()]); }
1581 if (my.ssub) { return $('serialStrings').getFormattedString('serial.manage_subs.ssub_id', [my.ssub.id()]); }
1582 if (my.aou) { return $('serialStrings').getFormattedString('serial.manage_dists.library_label', [my.aou.shortname(), my.aou.name()]); }
1583 if (my.label) { return my.label; }
1584 /* If all else fails... */
1589 'id' : 'subscription_count',
1590 'label' : $('serialStrings').getString('serial.manage_subs.subscriptions'),
1591 'flex' : 0, 'primary' : false, 'hidden' : false,
1592 'render' : function(my) { return my.subscription_count; },
1595 'id' : 'distribution_count',
1596 'label' : 'Members',
1598 'primary' : false, 'hidden' : false,
1599 'render' : function(my) { return my.distribution_count; },
1602 JSAN.use('util.list'); obj.list = new util.list('subs_tree');
1605 'no_auto_select' : true,
1606 'columns' : columns,
1607 'retrieve_row' : function(params) {
1609 var row = params.row;
1613 if (typeof params.on_retrieve == 'function') {
1614 params.on_retrieve(row);
1622 'on_click' : function(ev) {
1623 netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserRead');
1624 var row = {}; var col = {}; var nobj = {};
1625 obj.list.node.treeBoxObject.getCellAt(ev.clientX,ev.clientY,row,col,nobj);
1626 if ((row.value == -1)||(nobj.value != 'twisty')) { return; } // on_click runs for twistys only
1628 var node = obj.list.node.contentView.getItemAtIndex(row.value);
1629 var list = [ node.getAttribute('retrieve_id') ];
1630 if (typeof obj.on_select == 'function') {
1631 obj.on_select(list,true);
1633 if (typeof window.xulG == 'object' && typeof window.xulG.on_select == 'function') {
1634 window.xulG.on_select(list);
1637 'on_select' : function(ev) {
1638 JSAN.use('util.functional');
1640 // get the actual node clicked to determine which editor to use
1641 if (obj.list.node.view.selection.currentIndex > -1) {
1642 var node = obj.list.node.contentView.getItemAtIndex(obj.list.node.view.selection.currentIndex);
1643 obj.focused_node_retrieve_id = node.getAttribute('retrieve_id');
1646 var sel = obj.list.retrieve_selection();
1647 obj.controller.view.sel_clip.disabled = sel.length < 1;
1648 obj.sel_list = util.functional.map_list(
1650 function(o) { return o.getAttribute('retrieve_id'); }
1652 obj.toggle_actions();
1653 if (typeof obj.on_select == 'function') {
1654 obj.on_select(obj.sel_list);
1656 if (typeof window.xulG == 'object' && typeof window.xulG.on_select == 'function') {
1657 window.xulG.on_select(obj.sel_list);
1663 obj.controller.render();
1666 this.error.sdump('D_ERROR','serial/manage_subs.list_init: ' + E + '\n');
1671 'toggle_actions' : function() {
1674 var found_aou = false; var found_ssub = false; var found_sdist = false; var found_siss = false; var found_scap = false; var found_sdist_group = false; var found_siss_group = false; var found_scap_group = false;
1675 for (var i = 0; i < obj.sel_list.length; i++) {
1676 var type = obj.sel_list[i].split(/_/)[0];
1681 case 'ssub' : found_ssub = true; break;
1682 case 'sdist' : found_sdist = true; break;
1683 case 'siss' : found_siss = true; break;
1684 case 'scap' : found_scap = true; break;
1685 case 'sdist-group' : found_sdist_group = true; break;
1686 case 'siss-group' : found_siss_group = true; break;
1687 case 'scap-group' : found_scap_group = true; break;
1690 obj.controller.view.cmd_add_sdist.setAttribute('disabled','true');
1691 obj.controller.view.cmd_add_siss.setAttribute('disabled','true');
1692 obj.controller.view.cmd_add_scap.setAttribute('disabled','true');
1693 obj.controller.view.cmd_make_predictions.setAttribute('disabled','true');
1694 obj.controller.view.cmd_delete_sdist.setAttribute('disabled','true');
1695 obj.controller.view.cmd_delete_siss.setAttribute('disabled','true');
1696 obj.controller.view.cmd_delete_scap.setAttribute('disabled','true');
1697 obj.controller.view.cmd_add_subscriptions.setAttribute('disabled','true');
1698 obj.controller.view.cmd_mark_library.setAttribute('disabled','true');
1699 obj.controller.view.cmd_delete_ssub.setAttribute('disabled','true');
1700 obj.controller.view.cmd_mark_subscription.setAttribute('disabled','true');
1701 obj.controller.view.cmd_transfer_subscription.setAttribute('disabled','true');
1702 obj.controller.view.cmd_transfer_sdists.setAttribute('disabled','true');
1704 obj.controller.view.cmd_add_subscriptions.setAttribute('disabled','false');
1705 obj.controller.view.cmd_mark_library.setAttribute('disabled','false');
1708 obj.controller.view.cmd_delete_ssub.setAttribute('disabled','false');
1709 obj.controller.view.cmd_mark_subscription.setAttribute('disabled','false');
1710 obj.controller.view.cmd_add_sdist.setAttribute('disabled','false');
1711 obj.controller.view.cmd_add_siss.setAttribute('disabled','false');
1712 obj.controller.view.cmd_add_scap.setAttribute('disabled','false');
1713 obj.controller.view.cmd_transfer_subscription.setAttribute('disabled','false');
1714 obj.controller.view.cmd_make_predictions.setAttribute('disabled','false');
1716 if (found_sdist_group) {
1717 obj.controller.view.cmd_add_sdist.setAttribute('disabled','false');
1719 if (found_siss_group) {
1720 obj.controller.view.cmd_add_siss.setAttribute('disabled','false');
1722 if (found_scap_group) {
1723 obj.controller.view.cmd_add_scap.setAttribute('disabled','false');
1726 obj.controller.view.cmd_delete_sdist.setAttribute('disabled','false');
1727 obj.controller.view.cmd_transfer_sdists.setAttribute('disabled','false');
1730 obj.controller.view.cmd_delete_siss.setAttribute('disabled','false');
1733 obj.controller.view.cmd_delete_scap.setAttribute('disabled','false');
1736 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.actions.error'),E);
1740 'refresh_list' : function() {
1749 obj.org_ids = obj.network.simple_request('FM_SSUB_AOU_IDS_RETRIEVE_VIA_RECORD_ID.authoritative',[ obj.docid ]);
1750 if (typeof obj.org_ids.ilsevent != 'undefined') throw(obj.org_ids);
1751 JSAN.use('util.functional');
1752 obj.org_ids = util.functional.map_list( obj.org_ids, function (o) { return Number(o); });
1754 var org = obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ];
1755 obj.show_libs( org );
1757 obj.show_my_libs( document.getElementById('lib_menu').value );
1759 this.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.refresh_list.error'),E);
1764 dump('exiting serial/manage_subs.js\n');