1 dump('entering cat.copy_browser.js\n');
4 if (typeof cat == 'undefined') cat = {};
5 cat.copy_browser = function (params) {
7 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
8 JSAN.use('util.error'); this.error = new util.error();
10 dump('cat.copy_browser: ' + E + '\n');
14 cat.copy_browser.prototype = {
22 'init' : function( params ) {
25 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
28 obj.docid = params.docid;
30 JSAN.use('util.network'); obj.network = new util.network();
31 JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.init({'via':'stash'});
33 obj.controller_init(params);
35 obj.list_init(params);
37 obj.controller.render();
39 obj.default_depth = obj.depth_menu_init();
40 obj.default_lib = obj.data.hash.aou[ obj.library_menu_init() ];
42 document.getElementById('show_acns').addEventListener(
45 JSAN.use('util.file'); var file = new util.file('copy_browser_prefs.'+obj.data.server_unadorned);
46 util.widgets.save_attributes(file, { 'lib_menu' : [ 'value' ], 'show_acns' : [ 'checked' ], 'show_acps' : [ 'checked' ] });
51 document.getElementById('show_acps').addEventListener(
54 JSAN.use('util.file'); var file = new util.file('copy_browser_prefs.'+obj.data.server_unadorned);
55 util.widgets.save_attributes(file, { 'lib_menu' : [ 'value' ], 'show_acns' : [ 'checked' ], 'show_acps' : [ 'checked' ] });
60 obj.show_my_libs( obj.default_lib.id() );
62 JSAN.use('util.exec'); var exec = new util.exec(20); exec.timer(obj.funcs,100);
64 obj.show_consortial_count();
67 this.error.standard_unexpected_error_alert('cat.copy_browser.init: ',E);
71 'controller_init' : function(params) {
74 JSAN.use('util.controller'); obj.controller = new util.controller();
78 'save_columns' : [ [ 'command' ], function() { obj.list.save_columns(); } ],
81 function() { obj.list.clipboard(); }
86 alert(document.getElementById('commonStrings').getString('common.unimplemented'));
89 'cmd_show_my_libs' : [
95 'cmd_show_all_libs' : [
101 'cmd_show_libs_with_copies' : [
104 obj.show_libs_with_copies();
114 'sel_mark_items_damaged' : [
117 JSAN.use('cat.util'); JSAN.use('util.functional');
119 var list = util.functional.filter_list( obj.sel_list, function (o) { return o.split(/_/)[0] == 'acp'; });
121 list = util.functional.map_list( list, function (o) { return o.split(/_/)[1]; });
123 cat.util.mark_item_damaged( list );
128 'sel_mark_items_missing' : [
131 JSAN.use('cat.util'); JSAN.use('util.functional');
133 var list = util.functional.filter_list( obj.sel_list, function (o) { return o.split(/_/)[0] == 'acp'; });
135 list = util.functional.map_list( list, function (o) { return o.split(/_/)[1]; });
137 cat.util.mark_item_missing( list );
145 JSAN.use('util.functional');
147 var list = util.functional.filter_list(
150 return o.split(/_/)[0] == 'acp';
154 list = util.functional.map_list(
157 return { 'copy_id' : o.split(/_/)[1] };
161 JSAN.use('circ.util');
162 circ.util.show_last_few_circs(list);
165 'sel_copy_details' : [
168 JSAN.use('util.functional');
170 var list = util.functional.filter_list(
173 return o.split(/_/)[0] == 'acp';
177 JSAN.use('circ.util');
178 circ.util.item_details_new(
179 util.functional.map_list(
181 return obj.map_acp[o].barcode();
190 JSAN.use("cat.util");
191 JSAN.use("util.functional");
193 /* Filter selected rows that aren"t copies. */
194 var list = util.functional.filter_list(
197 return o.split(/_/)[0] == "acp";
200 var results = cat.util.make_bookable(
201 util.functional.map_list(
203 return obj.map_acp[o].id();
207 if (results && results["brsrc"]) {
208 cat.util.edit_new_brsrc(results["brsrc"]);
212 'cmd_book_item_now' : [
215 JSAN.use("cat.util");
216 JSAN.use("util.functional");
218 /* Filter selected rows that aren"t copies. */
219 var list = util.functional.filter_list(
222 return o.split(/_/)[0] == "acp";
225 var results = cat.util.make_bookable(
226 util.functional.map_list(
228 return obj.map_acp[o].id();
233 cat.util.edit_new_bresv(results);
241 JSAN.use('util.functional');
242 var list = util.functional.map_list(
243 util.functional.filter_list(
246 return o.split(/_/)[0] == 'acn';
250 return o.split(/_/)[1];
253 if (list.length == 0) return;
255 var copy_shortcut = {};
256 list = util.functional.map_list(
259 var call_number = obj.map_acn['acn_'+o];
260 var ou_id = call_number.owning_lib();
262 var label = call_number.label();
263 var acnc_id = typeof call_number.label_class() == 'object'
264 ? call_number.label_class().id()
265 : call_number.label_class();
266 var acnp_id = typeof call_number.prefix() == 'object'
267 ? call_number.prefix().id()
268 : call_number.prefix();
269 var acns_id = typeof call_number.suffix() == 'object'
270 ? call_number.suffix().id()
271 : call_number.suffix();
272 if (!copy_shortcut[ou_id]) copy_shortcut[ou_id] = {};
273 var callnumber_composite_key = acnc_id + ':' + acnp_id + ':' + label + ':' + acns_id;
274 copy_shortcut[ou_id][ callnumber_composite_key ] = volume_id;
279 /* quick fix */ /* what was this fixing? */
280 list = []; for (var i in copy_shortcut) { list.push( i ); }
284 edit = obj.network.request(
285 api.PERM_MULTI_ORG_CHECK.app,
286 api.PERM_MULTI_ORG_CHECK.method,
289 obj.data.list.au[0].id(),
293 ).length == 0 ? 1 : 0;
295 obj.error.sdump('D_ERROR','batch permission check: ' + E);
298 if (edit==0) return; // no read-only view for this interface
300 var title = document.getElementById('catStrings').getString('staff.cat.copy_browser.add_item.title');
303 var unified_interface = String( obj.data.hash.aous['ui.unified_volume_copy_editor'] ) == 'true';
304 if (unified_interface) {
305 var horizontal_interface = String( obj.data.hash.aous['ui.cat.volume_copy_editor.horizontal'] ) == 'true';
306 url = xulG.url_prefix( horizontal_interface ? urls.XUL_VOLUME_COPY_CREATOR_HORIZONTAL : urls.XUL_VOLUME_COPY_CREATOR );
308 url = xulG.url_prefix( urls.XUL_VOLUME_COPY_CREATOR_ORIGINAL );
311 var w = xulG.new_tab(
313 { 'tab_name' : title },
315 'doc_id' : obj.docid,
317 'copy_shortcut' : copy_shortcut,
318 'onrefresh' : function() { obj.refresh_list(); }
322 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.add_item.error'),E);
326 'cmd_add_items_to_buckets' : [
330 JSAN.use('util.functional');
332 var list = util.functional.filter_list(
335 return o.split(/_/)[0] == 'acp';
339 list = util.functional.map_list(
342 return o.split(/_/)[1];
346 JSAN.use('cat.util');
347 cat.util.add_copies_to_bucket( list );
350 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.add_items_bucket.error'),E);
358 var unified_interface = String( obj.data.hash.aous['ui.unified_volume_copy_editor'] ) == 'true';
359 if (!unified_interface) {
360 obj.controller.control_map['old_cmd_edit_items'][1]();
364 JSAN.use('util.functional');
366 var list = util.functional.filter_list(
369 return o.split(/_/)[0] == 'acp';
373 list = util.functional.map_list(
376 var cloned_copy_obj = JSON2js( js2JSON( obj.map_acp[ o ] ) );
377 cloned_copy_obj.call_number( obj.map_acn[ 'acn_' + cloned_copy_obj.call_number() ] );
378 return cloned_copy_obj;
382 xulG.volume_item_creator( {'existing_copies':list, 'onrefresh' : function() { obj.refresh_list(); } } );
385 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.edit_items.error'),E);
390 'cmd_replace_barcode' : [
394 JSAN.use('util.functional');
396 var list = util.functional.filter_list(
399 return o.split(/_/)[0] == 'acp';
403 list = util.functional.map_list(
406 var cloned_copy_obj = JSON2js( js2JSON( obj.map_acp[ o ] ) );
407 cloned_copy_obj.call_number( obj.map_acn[ 'acn_' + cloned_copy_obj.call_number() ] );
408 return cloned_copy_obj;
412 xulG.volume_item_creator( {'existing_copies':list, 'onrefresh' : function() { obj.refresh_list(); } } );
415 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.edit_items.error'),E);
421 'old_cmd_edit_items' : [
425 JSAN.use('util.functional');
427 var list = util.functional.filter_list(
430 return o.split(/_/)[0] == 'acp';
434 list = util.functional.map_list(
437 return o.split(/_/)[1];
441 JSAN.use('cat.util'); cat.util.spawn_copy_editor( { 'copy_ids' : list, 'edit' : 1 } );
445 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.edit_items.error'),E);
449 'cmd_delete_items' : [
453 JSAN.use('util.functional');
455 var list = util.functional.filter_list(
458 return o.split(/_/)[0] == 'acp';
462 list = util.functional.map_list(
465 return JSON2js( js2JSON( obj.map_acp[ 'acp_' + o.split(/_/)[1] ] ) );
470 if (list.length != 1) {
471 delete_msg = document.getElementById('catStrings').getFormattedString('staff.cat.copy_browser.delete_items.confirm.plural', [list.length]);
473 delete_msg = document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_items.confirm');
475 var r = obj.error.yns_alert(
477 document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_items.title'),
478 document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_items.delete'),
479 document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_items.cancel'),
481 document.getElementById('commonStrings').getString('common.confirm')
485 var acn_hash = {}; var acn_list = [];
486 for (var i = 0; i < list.length; i++) {
487 list[i].isdeleted('1');
488 var acn_id = list[i].call_number();
489 if ( ! acn_hash[ acn_id ] ) {
490 acn_hash[ acn_id ] = obj.map_acn[ 'acn_' + acn_id ];
491 acn_hash[ acn_id ].copies( [] );
493 var temp = acn_hash[ acn_id ].copies();
494 temp.push( list[i] );
495 acn_hash[ acn_id ].copies( temp );
497 for (var i in acn_hash) acn_list.push( acn_hash[i] );
498 var robj = obj.network.simple_request(
499 'FM_ACN_TREE_UPDATE',
500 [ ses(), acn_list, true ],
503 'title' : document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_items.override'),
504 'overridable_events' : [
505 1208 /* TITLE_LAST_COPY */,
506 1227 /* COPY_DELETE_WARNING */,
510 if (robj == null) throw(robj);
511 if (typeof robj.ilsevent != 'undefined') {
512 if ( (robj.ilsevent != 0) && (robj.ilsevent != 1227 /* COPY_DELETE_WARNING */) && (robj.ilsevent != 1208 /* TITLE_LAST_COPY */) ) throw(robj);
519 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_items.error'),E);
524 'cmd_print_spine_labels' : [
528 JSAN.use('util.functional');
530 var list = util.functional.filter_list(
533 return o.split(/_/)[0] == 'acp';
537 list = util.functional.map_list(
540 return obj.map_acp[ o ];
545 xulG.url_prefix( urls.XUL_SPINE_LABEL ),
546 { 'tab_name' : document.getElementById('catStrings').getString('staff.cat.copy_browser.print_spine.tab') },
548 'barcodes' : util.functional.map_list( list, function(o){return o.barcode();})
552 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.print_spine.error'),E);
556 'cmd_add_volumes' : [
560 JSAN.use('util.functional');
561 var list = util.functional.filter_list(
564 return o.split(/_/)[0] == 'aou';
567 list = util.functional.map_list(
570 return o.split(/_/)[1];
575 edit = obj.network.request(
576 api.PERM_MULTI_ORG_CHECK.app,
577 api.PERM_MULTI_ORG_CHECK.method,
580 obj.data.list.au[0].id(),
582 [ 'CREATE_VOLUME', 'CREATE_COPY' ]
584 ).length == 0 ? 1 : 0;
586 obj.error.sdump('D_ERROR','batch permission check: ' + E);
590 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.add_volume.permission_error'));
591 return; // no read-only view for this interface
594 var title = document.getElementById('catStrings').getString('staff.cat.copy_browser.add_volume.title');
597 var unified_interface = String( obj.data.hash.aous['ui.unified_volume_copy_editor'] ) == 'true';
598 if (unified_interface) {
599 var horizontal_interface = String( obj.data.hash.aous['ui.cat.volume_copy_editor.horizontal'] ) == 'true';
600 url = xulG.url_prefix( horizontal_interface ? urls.XUL_VOLUME_COPY_CREATOR_HORIZONTAL : urls.XUL_VOLUME_COPY_CREATOR );
602 url = xulG.url_prefix( urls.XUL_VOLUME_COPY_CREATOR_ORIGINAL );
605 var w = xulG.new_tab(
607 { 'tab_name' : title },
608 { 'doc_id' : obj.docid, 'ou_ids' : list, 'onrefresh' : function() { obj.refresh_list(); } }
612 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.add_volume.error'),E);
616 'cmd_edit_volumes' : [
620 JSAN.use('util.functional');
621 var volumes = util.functional.map_list(
622 util.functional.filter_list(
625 return o.split(/_/)[0] == 'acn';
629 return o.split(/_/)[1];
632 volumes = util.functional.map_list(
635 var my_acn = obj.map_acn['acn_' + o];
636 return function(r){return r;}(my_acn);
640 JSAN.use('cat.util');
641 if ( cat.util.batch_edit_volumes( volumes ) ) {
646 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.edit_volume.exception'),E);
650 'cmd_delete_volumes' : [
654 JSAN.use('util.functional');
656 var list = util.functional.filter_list(
659 return o.split(/_/)[0] == 'acn';
663 list = util.functional.map_list(
666 return JSON2js( js2JSON( obj.map_acn[ 'acn_' + o.split(/_/)[1] ] ) );
671 if (list.length == 1) {
672 del_prompt = document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.prompt');
674 del_prompt = document.getElementById('catStrings').getFormattedString('staff.cat.copy_browser.delete_volume.prompt.plural', [list.length]);
677 var r = obj.error.yns_alert(
679 document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.title'),
680 document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.delete'),
681 document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.cancel'),
683 document.getElementById('commonStrings').getString('common.confirm')
687 for (var i = 0; i < list.length; i++) {
688 list[i].isdeleted('1');
690 var robj = obj.network.simple_request(
691 'FM_ACN_TREE_UPDATE',
692 [ ses(), list, true ],
695 'title' : document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.override'),
696 'overridable_events' : [
700 if (robj == null) throw(robj);
701 if (typeof robj.ilsevent != 'undefined') {
702 if (robj.ilsevent == 1206 /* VOLUME_NOT_EMPTY */) {
703 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.copies_remain'));
706 if (robj.ilsevent != 0) throw(robj);
711 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.exception'),E);
717 'cmd_mark_library' : [
721 var list = util.functional.filter_list(
724 return o.split(/_/)[0] == 'aou';
728 list = util.functional.map_list(
731 return o.split(/_/)[1];
735 if (list.length == 1) {
736 obj.data.marked_library = { 'lib' : list[0], 'docid' : obj.docid };
737 obj.data.stash('marked_library');
738 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.mark_library.alert'));
741 document.getElementById('catStrings').getString('staff.cat.copy_browser.mark_library.prompt'),
742 document.getElementById('catStrings').getString('staff.cat.copy_browser.mark_library.title'),
743 document.getElementById('commonStrings').getString('common.ok'),
746 document.getElementById('commonStrings').getString('common.confirm')
750 obj.error.standard_unexpected_error_alert('copy browser -> mark library',E);
755 'cmd_mark_volume' : [
759 var list = util.functional.filter_list(
762 return o.split(/_/)[0] == 'acn';
766 list = util.functional.map_list(
769 return o.split(/_/)[1];
773 if (list.length == 1) {
774 obj.data.marked_volume = list[0];
775 obj.data.stash('marked_volume');
776 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.mark_volume.alert'));
779 document.getElementById('catStrings').getString('staff.cat.copy_browser.mark_volume.prompt'),
780 document.getElementById('catStrings').getString('staff.cat.copy_browser.mark_volume.title'),
781 document.getElementById('commonStrings').getString('common.ok'),
784 document.getElementById('commonStrings').getString('common.confirm')
788 obj.error.standard_unexpected_error_alert('copy browser -> mark volume',E);
792 'cmd_refresh_list' : [
798 'cmd_transfer_volume' : [
802 obj.data.stash_retrieve();
803 if (!obj.data.marked_library) {
804 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer_volume.alert'));
808 JSAN.use('util.functional');
810 var list = util.functional.filter_list(
813 return o.split(/_/)[0] == 'acn';
817 list = util.functional.map_list(
820 return o.split(/_/)[1];
824 netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite');
826 var acn_list = util.functional.map_list(
829 return obj.map_acn[ 'acn_' + o ].label();
831 ).join(document.getElementById('commonStrings').getString('common.grouping_string'));
833 var xml = '<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" flex="1" style="overflow: auto">';
834 xml += '<description>';
835 xml += document.getElementById('catStrings').getFormattedString('staff.cat.copy_browser.transfer.prompt', [acn_list, obj.data.hash.aou[ obj.data.marked_library.lib ].shortname()]);
836 xml += '</description>';
837 xml += '<hbox><button label="' + document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer.submit.label') + '" name="fancy_submit"/>';
838 xml += '<button label="'
839 + document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer.cancel.label')
841 + document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer.cancel.accesskey')
842 + '" name="fancy_cancel"/></hbox>';
843 xml += '<iframe style="overflow: scroll" flex="1" src="' + urls.XUL_BIB_BRIEF + '?docid=' + obj.data.marked_library.docid + '"/>';
845 JSAN.use('OpenILS.data');
846 var data = new OpenILS.data(); data.init({'via':'stash'});
847 //data.temp_transfer = xml; data.stash('temp_transfer');
848 JSAN.use('util.window'); var win = new util.window();
849 var fancy_prompt_data = win.open(
850 urls.XUL_FANCY_PROMPT,
851 //+ '?xml_in_stash=temp_transfer'
852 //+ '&title=' + window.escape('Volume Transfer'),
853 'fancy_prompt', 'chrome,resizable,modal,width=500,height=300',
856 'title' : document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer.title')
860 if (fancy_prompt_data.fancy_status == 'incomplete') {
861 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer.incomplete'));
865 var robj = obj.network.simple_request(
867 [ ses(), { 'docid' : obj.data.marked_library.docid, 'lib' : obj.data.marked_library.lib, 'volumes' : list } ],
870 'title' : document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer.override.failure'),
871 'overridable_events' : [
872 1208 /* TITLE_LAST_COPY */,
873 1219 /* COPY_REMOTE_CIRC_LIB */,
878 if (typeof robj.ilsevent != 'undefined') {
879 if (robj.ilsevent == 1221 /* ORG_CANNOT_HAVE_VOLS */) {
880 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer.ineligible_destination'));
885 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer.success'));
889 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer.unexpected_error'),E);
895 'cmd_transfer_items' : [
899 obj.data.stash_retrieve();
900 if (!obj.data.marked_volume) {
901 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer_items.missing_volume'));
905 JSAN.use('util.functional');
907 var list = util.functional.filter_list(
910 return o.split(/_/)[0] == 'acp';
914 list = util.functional.map_list(
917 return o.split(/_/)[1];
921 var volume = obj.network.simple_request('FM_ACN_RETRIEVE.authoritative',[ obj.data.marked_volume ]);
923 JSAN.use('cat.util'); cat.util.transfer_copies( {
925 'docid' : volume.record(),
926 'volume_label' : volume.label(),
927 'owning_lib' : volume.owning_lib(),
931 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.transfer_items.unexpected_error'),E);
937 'cmd_link_as_multi_bib' : [
941 obj.data.stash_retrieve();
942 if (!obj.data.marked_multi_home_record) {
943 alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.link_as_multi_bib.missing_bib'));
947 JSAN.use('util.functional');
949 var list = util.functional.filter_list(
952 return o.split(/_/)[0] == 'acp';
956 list = util.functional.map_list(
959 return obj.map_acp[ o ].barcode();
964 window.xulG.url_prefix(urls.MANAGE_MULTI_HOME_ITEMS),
966 { 'docid' : obj.data.marked_multi_home_record, 'barcodes' : list }
970 alert('Error in copy_browser.js, cmd_link_as_multi_bib: ' + E);
980 this.error.standard_unexpected_error_alert('cat.copy_browser.controller_init(): ',E);
984 'depth_menu_init' : function(params) {
989 for (var i = 0; i < obj.data.list.aout.length; i++) {
990 var type = obj.data.list.aout[i];
991 var depth = type.depth();
992 if ( depth > max_depth) { max_depth = depth; }
993 if (typeof list[depth] == 'undefined') {
1001 list[depth][0] += ' / ' + type.opac_label();
1004 ml = util.widgets.make_menulist( list, max_depth );
1005 ml.setAttribute('id','depth_menu'); document.getElementById('x_depth_menu').appendChild(ml);
1006 ml.addEventListener(
1009 obj.default_depth = ev.target.value;
1010 if (document.getElementById('refresh_button')) document.getElementById('refresh_button').focus();
1011 JSAN.use('util.file'); var file = new util.file('copy_browser_prefs.'+obj.data.server_unadorned);
1012 util.widgets.save_attributes(file, {
1013 'lib_menu' : [ 'value' ],
1014 'depth_menu' : [ 'value' ],
1015 'show_acns' : [ 'checked' ],
1016 'show_acps' : [ 'checked' ]
1022 file = new util.file('copy_browser_prefs.'+obj.data.server_unadorned);
1023 util.widgets.load_attributes(file);
1024 ml.value = ml.getAttribute('value');
1026 ml.value = max_depth;
1027 ml.setAttribute('value',ml.value);
1032 alert('Error in copy_browser.js, depth_menu_init(): ' + E);
1036 'library_menu_init' : function(params) {
1040 obj.org_ids = obj.network.simple_request('FM_AOU_IDS_RETRIEVE_VIA_RECORD_ID.authoritative',[ obj.docid ]);
1041 if (typeof obj.org_ids.ilsevent != 'undefined') throw(obj.org_ids);
1042 JSAN.use('util.functional');
1043 obj.org_ids = util.functional.map_list( obj.org_ids, function (o) { return Number(o); });
1045 var org = obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ];
1047 JSAN.use('util.file'); JSAN.use('util.widgets');
1049 var file; var list_data; var ml;
1051 file = new util.file('offline_ou_list');
1052 if (file._file.exists()) {
1053 list_data = file.get_object(); file.close();
1054 for (var i = 0; i < list_data[0].length; i++) { // make sure all entries are enabled
1055 list_data[0][i][2] = false;
1057 ml = util.widgets.make_menulist( list_data[0], list_data[1] );
1058 ml.setAttribute('id','lib_menu'); document.getElementById('x_lib_menu').appendChild(ml);
1059 for (var i = 0; i < obj.org_ids.length; i++) {
1060 ml.getElementsByAttribute('value',obj.org_ids[i])[0].setAttribute('class','has_copies');
1062 ml.firstChild.addEventListener(
1065 document.getElementById('legend').setAttribute('hidden','false');
1069 ml.firstChild.addEventListener(
1072 document.getElementById('legend').setAttribute('hidden','true');
1076 ml.addEventListener(
1079 obj.default_lib = obj.data.hash.aou[ ev.target.value ];
1080 if (document.getElementById('refresh_button')) document.getElementById('refresh_button').focus();
1081 JSAN.use('util.file'); var file = new util.file('copy_browser_prefs.'+obj.data.server_unadorned);
1082 util.widgets.save_attributes(file, {
1083 'lib_menu' : [ 'value' ],
1084 'depth_menu' : [ 'value' ],
1085 'show_acns' : [ 'checked' ],
1086 'show_acps' : [ 'checked' ]
1093 throw(document.getElementById('catStrings').getString('staff.cat.copy_browser.missing_library') + '\n');
1096 file = new util.file('copy_browser_prefs.'+obj.data.server_unadorned);
1097 util.widgets.load_attributes(file);
1098 ml.value = ml.getAttribute('value');
1100 ml.value = org.id();
1101 ml.setAttribute('value',ml.value);
1107 this.error.standard_unexpected_error_alert('cat.copy_browser.library_menu_init(): ',E);
1111 'show_consortial_count' : function() {
1114 obj.network.simple_request('FM_ACP_COUNT.authoritative',[ obj.data.tree.aou.id(), obj.docid ],function(req){
1116 var robj = req.getResultObject();
1117 var x = document.getElementById('consortial_total');
1118 if (x) x.setAttribute('value',robj[0].count);
1119 x = document.getElementById('consortial_available');
1120 if (x) x.setAttribute('value',robj[0].available);
1122 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.consortial_copy_count.error'),E);
1126 this.error.standard_unexpected_error_alert('cat.copy_browser.show_consortial_count: ',E);
1130 'show_my_libs' : function(org) {
1134 org = obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ];
1136 if (typeof org != 'object') org = obj.data.hash.aou[ org ];
1138 obj.show_libs( org, false );
1140 var p_org = obj.data.hash.aou[ org.parent_ou() ];
1142 obj.funcs.push( function() {
1143 document.getElementById('cmd_refresh_list').setAttribute('disabled','true');
1144 document.getElementById('cmd_show_libs_with_copies').setAttribute('disabled','true');
1145 document.getElementById('lib_menu').setAttribute('disabled','true');
1147 for (var i = 0; i < p_org.children().length; i++) {
1151 obj.show_libs( o, false );
1153 }( p_org.children()[i] )
1156 obj.funcs.push( function() {
1157 document.getElementById('cmd_refresh_list').setAttribute('disabled','false');
1158 document.getElementById('cmd_show_libs_with_copies').setAttribute('disabled','false');
1159 document.getElementById('lib_menu').setAttribute('disabled','false');
1168 'show_all_libs' : function() {
1173 obj.show_libs( obj.data.tree.aou );
1175 obj.funcs.push( function() {
1176 document.getElementById('cmd_refresh_list').setAttribute('disabled','true');
1177 document.getElementById('cmd_show_libs_with_copies').setAttribute('disabled','true');
1178 document.getElementById('lib_menu').setAttribute('disabled','true');
1181 for (var i = 0; i < obj.data.tree.aou.children().length; i++) {
1182 var child = obj.data.tree.aou.children()[i];
1183 if (obj.data.hash.aout[child.ou_type()].depth() <= obj.default_depth
1184 && orgIsMine(obj.default_lib,child,obj.default_depth)) {
1194 obj.funcs.push( function() {
1195 document.getElementById('cmd_refresh_list').setAttribute('disabled','false');
1196 document.getElementById('cmd_show_libs_with_copies').setAttribute('disabled','false');
1197 document.getElementById('lib_menu').setAttribute('disabled','false');
1205 'show_libs_with_copies' : function() {
1208 JSAN.use('util.functional');
1210 var orgs = util.functional.map_list(
1212 function(id) { return obj.data.hash.aou[id]; }
1215 if (a.shortname() < b.shortname()) return -1;
1216 if (a.shortname() > b.shortname()) return 1;
1220 obj.funcs.push( function() {
1221 document.getElementById('cmd_refresh_list').setAttribute('disabled','true');
1222 document.getElementById('cmd_show_libs_with_copies').setAttribute('disabled','true');
1223 document.getElementById('lib_menu').setAttribute('disabled','true');
1226 for (var i = 0; i < orgs.length; i++) {
1230 obj.show_libs(o,false);
1235 obj.funcs.push( function() {
1236 document.getElementById('cmd_refresh_list').setAttribute('disabled','false');
1237 document.getElementById('cmd_show_libs_with_copies').setAttribute('disabled','false');
1238 document.getElementById('lib_menu').setAttribute('disabled','false');
1246 'show_libs' : function(start_aou,show_open) {
1249 if (!start_aou) throw('show_libs: Need a start_aou');
1250 JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.init({'via':'stash'});
1251 JSAN.use('util.functional');
1254 var temp_aou = start_aou;
1255 while ( temp_aou.parent_ou() ) {
1256 temp_aou = obj.data.hash.aou[ temp_aou.parent_ou() ];
1257 parents.push( temp_aou );
1261 for (var i = 0; i < parents.length; i++) {
1265 obj.append_org(o,p,{'container':'true','open':'true'});
1267 }(parents[i], obj.data.hash.aou[ parents[i].parent_ou() ])
1273 return function() { obj.append_org(o,p); };
1274 }(start_aou,obj.data.hash.aou[ start_aou.parent_ou() ])
1279 if (start_aou.children()) {
1280 var x = obj.map_tree[ 'aou_' + start_aou.id() ];
1281 x.setAttribute('container','true');
1282 if (show_open) x.setAttribute('open','true');
1283 for (var i = 0; i < start_aou.children().length; i++) {
1284 var child = start_aou.children()[i];
1285 if (obj.data.hash.aout[child.ou_type()].depth() <= obj.default_depth
1286 && orgIsMine(obj.default_lib,child,obj.default_depth)) {
1289 return function() { obj.append_org(o,p); };
1290 }( child, start_aou )
1303 'on_select' : function(list,twisty) {
1305 for (var i = 0; i < list.length; i++) {
1306 var node = obj.map_tree[ list[i] ];
1307 //if (node.lastChild.nodeName == 'treechildren') { continue; } else { alert(node.lastChild.nodeName); }
1308 var row_type = list[i].split('_')[0];
1309 var id = list[i].split('_')[1];
1311 case 'aou' : obj.on_select_org(id,twisty); break;
1312 case 'acn' : obj.on_select_acn(id,twisty); break;
1318 'on_select_acn' : function(acn_id,twisty) {
1321 var acn_tree = obj.map_acp[ 'acn_' + acn_id ];
1322 obj.funcs.push( function() {
1323 document.getElementById('cmd_refresh_list').setAttribute('disabled','true');
1324 document.getElementById('cmd_show_libs_with_copies').setAttribute('disabled','true');
1325 document.getElementById('lib_menu').setAttribute('disabled','true');
1327 if (acn_tree.copies()) {
1328 for (var i = 0; i < acn_tree.copies().length; i++) {
1332 obj.append_acp(c,a);
1334 }( acn_tree.copies()[i], acn_tree )
1338 obj.funcs.push( function() {
1339 document.getElementById('cmd_refresh_list').setAttribute('disabled','false');
1340 document.getElementById('cmd_show_libs_with_copies').setAttribute('disabled','false');
1341 document.getElementById('lib_menu').setAttribute('disabled','false');
1348 'on_select_org' : function(org_id,twisty) {
1351 var org = obj.data.hash.aou[ org_id ];
1352 obj.funcs.push( function() {
1353 document.getElementById('cmd_refresh_list').setAttribute('disabled','true');
1354 document.getElementById('cmd_show_libs_with_copies').setAttribute('disabled','true');
1355 document.getElementById('lib_menu').setAttribute('disabled','true');
1357 if (org.children()) {
1358 for (var i = 0; i < org.children().length; i++) {
1359 var child = org.children()[i];
1360 if (obj.data.hash.aout[child.ou_type()].depth() <= obj.default_depth
1361 && orgIsMine(obj.default_lib,child,obj.default_depth)) {
1372 if (obj.map_acn[ 'aou_' + org_id ]) {
1373 for (var i = 0; i < obj.map_acn[ 'aou_' + org_id ].length; i++) {
1377 obj.append_acn(o,a);
1379 }( org, obj.map_acn[ 'aou_' + org_id ][i] )
1383 obj.funcs.push( function() {
1384 document.getElementById('cmd_refresh_list').setAttribute('disabled','false');
1385 document.getElementById('cmd_show_libs_with_copies').setAttribute('disabled','false');
1386 document.getElementById('lib_menu').setAttribute('disabled','false');
1389 alert('Error in copy_browser.js, on_select_org(): ' + E);
1393 'append_org' : function (org,parent_org,params) {
1395 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
1396 obj.error.consoleService.logStringMessage('append_org: org = ' + org.shortname() + ' parent_org = ' + (parent_org ? parent_org.shortname() : '') + ' params = ' + js2JSON(params) + '\n');
1398 if (obj.map_tree[ 'aou_' + org.id() ]) {
1399 var x = obj.map_tree[ 'aou_' + org.id() ];
1401 for (var i in params) {
1402 x.setAttribute(i,params[i]);
1414 'skip_all_columns_except' : [0,1,2],
1415 'retrieve_id' : 'aou_' + org.id(),
1417 'no_auto_select' : true,
1421 if ( obj.org_ids.indexOf( Number( org.id() ) ) == -1 ) {
1422 if ( get_bool( obj.data.hash.aout[ org.ou_type() ].can_have_vols() ) ) {
1423 data.row.my.volume_count = '0';
1424 data.row.my.copy_count = '<0>';
1426 data.row.my.volume_count = '';
1427 data.row.my.copy_count = '';
1430 var v_count = 0; var c_count = 0;
1431 acn_tree_list = obj.network.simple_request(
1432 'FM_ACN_TREE_LIST_RETRIEVE_VIA_RECORD_ID_AND_ORG_IDS.authoritative',
1433 [ ses(), obj.docid, [ org.id() ] ]
1435 for (var i = 0; i < acn_tree_list.length; i++) {
1437 obj.map_acn[ 'acn_' + acn_tree_list[i].id() ] = function(r){return r;}(acn_tree_list[i]);
1438 var copies = acn_tree_list[i].copies(); if (copies) c_count += copies.length;
1439 for (var j = 0; j < copies.length; j++) {
1440 obj.map_acp[ 'acp_' + copies[j].id() ] = function(r){return r;}(copies[j]);
1443 data.row.my.volume_count = v_count;
1444 data.row.my.copy_count = '<' + c_count + '>';
1447 data.node = obj.map_tree[ 'aou_' + parent_org.id() ];
1449 var nparams = obj.list.append(data);
1450 var node = nparams.my_node;
1452 for (var i in params) {
1453 node.setAttribute(i,params[i]);
1456 obj.map_tree[ 'aou_' + org.id() ] = node;
1458 if (org.children()) {
1459 node.setAttribute('container','true');
1463 if ( obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ].parent_ou() == parent_org.id() ) {
1464 data.node.setAttribute('open','true');
1467 obj.map_tree[ 'aou_' + org.id() ].setAttribute('open','true');
1470 if (acn_tree_list) {
1471 obj.map_acn[ 'aou_' + org.id() ] = acn_tree_list;
1472 node.setAttribute('container','true');
1475 if (document.getElementById('show_acns').checked) {
1476 node.setAttribute('open','true');
1477 obj.funcs.push( function() { obj.on_select_org( org.id() ); } );
1486 'append_acn' : function( org, acn_tree, params ) {
1489 if (obj.map_tree[ 'acn_' + acn_tree.id() ]) {
1490 var x = obj.map_tree[ 'acn_' + acn_tree.id() ];
1492 for (var i in params) {
1493 x.setAttribute(i,params[i]);
1499 var parent_node = obj.map_tree[ 'aou_' + org.id() ];
1505 'volume_count' : '',
1506 'copy_count' : acn_tree.copies() ? acn_tree.copies().length : '0',
1509 'skip_all_columns_except' : [0,1,2],
1510 'retrieve_id' : 'acn_' + acn_tree.id(),
1511 'node' : parent_node,
1513 'no_auto_select' : true,
1515 var nparams = obj.list.append(data);
1516 var node = nparams.my_node;
1517 obj.map_tree[ 'acn_' + acn_tree.id() ] = node;
1519 for (var i in params) {
1520 node.setAttribute(i,params[i]);
1523 if (acn_tree.copies()) {
1524 obj.map_acp[ 'acn_' + acn_tree.id() ] = acn_tree;
1525 node.setAttribute('container','true');
1527 if (document.getElementById('show_acps').checked) {
1528 node.setAttribute('open','true');
1529 obj.funcs.push( function() { obj.on_select_acn( acn_tree.id() ); } );
1538 'append_acp' : function( acp_item, acn_tree, params ) {
1541 if (obj.map_tree[ 'acp_' + acp_item.id() ]) {
1542 var x = obj.map_tree[ 'acp_' + acp_item.id() ];
1544 for (var i in params) {
1545 x.setAttribute(i,params[i]);
1551 var parent_node = obj.map_tree[ 'acn_' + acn_tree.id() ];
1555 'doc_id' : obj.docid,
1556 'aou' : obj.data.hash.aou[ acn_tree.owning_lib() ],
1560 acp_item.circulations()
1562 acp_item.circulations().length > 0
1563 ? acp_item.circulations()[0]
1567 'volume_count' : '',
1571 'retrieve_id' : 'acp_' + acp_item.id(),
1572 'node' : parent_node,
1574 'no_auto_select' : true,
1576 var nparams = obj.list.append(data);
1577 var node = nparams.my_node;
1578 obj.map_tree[ 'acp_' + acp_item.id() ] = node;
1580 for (var i in params) {
1581 node.setAttribute(i,params[i]);
1591 'list_init' : function( params ) {
1594 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
1597 JSAN.use('circ.util');
1600 'id' : 'tree_location',
1601 'label' : document.getElementById('catStrings').getString('staff.cat.copy_browser.list_init.tree_location'),
1602 'flex' : 1, 'primary' : true, 'hidden' : false,
1603 'render' : function(my) { return my.acp ? my.acp.barcode() : my.acn ? my.acn.label() : my.aou ? my.aou.shortname() + " : " + my.aou.name() : "???"; },
1606 'id' : 'volume_count',
1607 'label' : document.getElementById('catStrings').getString('staff.cat.copy_browser.list_init.volume_count'),
1608 'flex' : 0, 'primary' : false, 'hidden' : false,
1609 'render' : function(my) { return my.volume_count; },
1612 'id' : 'copy_count',
1613 'label' : document.getElementById('catStrings').getString('staff.cat.copy_browser.list_init.copy_count'),
1615 'primary' : false, 'hidden' : false,
1616 'render' : function(my) { return my.copy_count; },
1621 'location' : { 'hidden' : false },
1622 'circ_lib' : { 'hidden' : false },
1623 'owning_lib' : { 'hidden' : false },
1624 'call_number' : { 'hidden' : false },
1625 'parts' : { 'hidden' : false },
1626 'due_date' : { 'hidden' : false },
1627 'acp_status' : { 'hidden' : false },
1655 'acp_mint_condition',
1661 JSAN.use('util.list'); obj.list = new util.list('copy_tree');
1664 'no_auto_select' : true,
1665 'columns' : columns,
1666 'map_row_to_columns' : circ.util.std_map_row_to_columns(' '),
1667 'retrieve_row' : function(params) {
1669 var row = params.row;
1672 if (!row.my.mvr) obj.funcs.push(
1675 row.my.mvr = obj.network.request(
1676 api.MODS_SLIM_RECORD_RETRIEVE_VIA_COPY.app,
1677 api.MODS_SLIM_RECORD_RETRIEVE_VIA_COPY.method,
1678 [ row.my.circ.target_copy() ]
1687 row.my.acp = obj.network.request(
1688 api.FM_ACP_RETRIEVE.app,
1689 api.FM_ACP_RETRIEVE.method,
1690 [ row.my.circ.target_copy() ]
1693 params.row_node.setAttribute( 'retrieve_id',row.my.acp.barcode() );
1698 params.row_node.setAttribute( 'retrieve_id',row.my.acp.barcode() );
1704 if (typeof params.on_retrieve == 'function') {
1705 params.on_retrieve(row);
1713 'on_click' : function(ev) {
1714 netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserRead');
1715 var row = {}; var col = {}; var nobj = {};
1716 obj.list.node.treeBoxObject.getCellAt(ev.clientX,ev.clientY,row,col,nobj);
1717 if ((row.value == -1)||(nobj.value != 'twisty')) { return; }
1718 var node = obj.list.node.contentView.getItemAtIndex(row.value);
1719 var list = [ node.getAttribute('retrieve_id') ];
1720 if (typeof obj.on_select == 'function') {
1721 obj.on_select(list,true);
1723 if (typeof window.xulG == 'object' && typeof window.xulG.on_select == 'function') {
1724 window.xulG.on_select(list);
1727 'on_select' : function(ev) {
1728 JSAN.use('util.functional');
1729 var sel = obj.list.retrieve_selection();
1730 obj.controller.view.sel_clip.disabled = sel.length < 1;
1731 obj.sel_list = util.functional.map_list(
1733 function(o) { return o.getAttribute('retrieve_id'); }
1735 obj.toggle_actions();
1736 if (typeof obj.on_select == 'function') {
1737 obj.on_select(obj.sel_list);
1739 if (typeof window.xulG == 'object' && typeof window.xulG.on_select == 'function') {
1740 window.xulG.on_select(obj.sel_list);
1747 this.error.sdump('D_ERROR','cat.copy_browser.list_init: ' + E + '\n');
1752 'toggle_actions' : function() {
1755 var found_aou = false; var found_acn = false; var found_acp = false;
1756 var found_aou_with_can_have_vols = false;
1757 var sel_copy_libs = {};
1758 for (var i = 0; i < obj.sel_list.length; i++) {
1759 var type = obj.sel_list[i].split(/_/)[0];
1763 var org = obj.data.hash.aou[ obj.sel_list[i].split(/_/)[1] ];
1764 if ( get_bool( obj.data.hash.aout[ org.ou_type() ].can_have_vols() ) ) found_aou_with_can_have_vols = true;
1766 case 'acn' : found_acn = true; break;
1772 obj.map_acp[obj.sel_list[i]].call_number()
1778 obj.controller.view.cmd_add_items.setAttribute('disabled','true');
1779 obj.controller.view.cmd_add_items_to_buckets.setAttribute('disabled','true');
1780 obj.controller.view.cmd_edit_items.setAttribute('disabled','true');
1781 obj.controller.view.cmd_replace_barcode.setAttribute('disabled','true');
1782 obj.controller.view.cmd_delete_items.setAttribute('disabled','true');
1783 obj.controller.view.cmd_print_spine_labels.setAttribute('disabled','true');
1784 obj.controller.view.cmd_add_volumes.setAttribute('disabled','true');
1785 obj.controller.view.cmd_mark_library.setAttribute('disabled','true');
1786 obj.controller.view.cmd_edit_volumes.setAttribute('disabled','true');
1787 obj.controller.view.cmd_delete_volumes.setAttribute('disabled','true');
1788 obj.controller.view.cmd_mark_volume.setAttribute('disabled','true');
1789 obj.controller.view.cmd_transfer_volume.setAttribute('disabled','true');
1790 obj.controller.view.cmd_transfer_items.setAttribute('disabled','true');
1791 obj.controller.view.sel_copy_details.setAttribute('disabled','true');
1792 obj.controller.view.cmd_create_brt.setAttribute('disabled','true');
1793 obj.controller.view.cmd_book_item_now.setAttribute('disabled','true');
1794 obj.controller.view.sel_patron.setAttribute('disabled','true');
1795 obj.controller.view.sel_mark_items_damaged.setAttribute('disabled','true');
1796 obj.controller.view.sel_mark_items_missing.setAttribute('disabled','true');
1797 if (found_aou && found_aou_with_can_have_vols) {
1798 obj.controller.view.cmd_add_volumes.setAttribute('disabled','false');
1799 obj.controller.view.cmd_mark_library.setAttribute('disabled','false');
1802 obj.controller.view.cmd_edit_volumes.setAttribute('disabled','false');
1803 obj.controller.view.cmd_delete_volumes.setAttribute('disabled','false');
1804 obj.controller.view.cmd_mark_volume.setAttribute('disabled','false');
1805 obj.controller.view.cmd_add_items.setAttribute('disabled','false');
1806 obj.controller.view.cmd_transfer_volume.setAttribute('disabled','false');
1809 obj.controller.view.sel_mark_items_damaged.setAttribute('disabled','false');
1810 obj.controller.view.sel_mark_items_missing.setAttribute('disabled','false');
1811 obj.controller.view.cmd_add_items_to_buckets.setAttribute('disabled','false');
1812 obj.controller.view.cmd_edit_items.setAttribute('disabled','false');
1813 obj.controller.view.cmd_replace_barcode.setAttribute('disabled','false');
1814 obj.controller.view.cmd_delete_items.setAttribute('disabled','false');
1815 obj.controller.view.cmd_print_spine_labels.setAttribute('disabled','false');
1816 obj.controller.view.cmd_transfer_items.setAttribute('disabled','false');
1817 obj.controller.view.sel_copy_details.setAttribute('disabled','false');
1818 obj.controller.view.cmd_create_brt.setAttribute('disabled','false');
1819 obj.controller.view.sel_patron.setAttribute('disabled','false');
1821 var L = 0; for (var k in sel_copy_libs) L++;
1823 obj.controller.view.cmd_book_item_now.setAttribute('disabled','false');
1827 obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.actions.error'),E);
1831 'refresh_list' : function() {
1838 obj.org_ids = obj.network.simple_request('FM_AOU_IDS_RETRIEVE_VIA_RECORD_ID.authoritative',[ obj.docid ]);
1839 if (typeof obj.org_ids.ilsevent != 'undefined') throw(obj.org_ids);
1840 JSAN.use('util.functional');
1841 obj.org_ids = util.functional.map_list( obj.org_ids, function (o) { return Number(o); });
1842 obj.show_my_libs( obj.default_lib.id() );
1843 // FIXME - we get a null from the copy_count call if we call it too quickly here
1844 setTimeout( function() { obj.show_consortial_count(); }, 2000 );
1846 this.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.refresh_list.error'),E);
1851 dump('exiting cat.copy_browser.js\n');