5 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
6 if (typeof JSAN == 'undefined') { throw( document.getElementById("commonStrings").getString('common.jsan.missing') ); }
7 JSAN.errorLevel = "die"; // none, warn, or die
8 JSAN.addRepository('/xul/server/');
9 JSAN.use('util.error'); g.error = new util.error();
10 g.error.sdump('D_TRACE','my_init() for cat_bib_brief.xul');
12 JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
14 docid = xul_param('docid');
16 var key = location.pathname + location.search + location.hash;
17 if (!docid && typeof data.modal_xulG_stack != 'undefined' && typeof data.modal_xulG_stack[key] != 'undefined') {
18 var xulG = data.modal_xulG_stack[key][ data.modal_xulG_stack[key].length - 1 ];
19 if (typeof xulG == 'object') {
24 JSAN.use('util.network'); g.network = new util.network();
25 JSAN.use('util.date');
27 document.getElementById('caption').setAttribute('tooltiptext',document.getElementById('catStrings').getFormattedString('staff.cat.bib_brief.record_id', [docid]));
31 data.last_record = docid; data.stash('last_record');
33 g.network.simple_request(
34 'MODS_SLIM_RECORD_RETRIEVE.authoritative',
37 var mods = req.getResultObject();
39 if (window.xulG && typeof window.xulG.set_tab_name == 'function') {
41 window.xulG.set_tab_name(mods.tcn());
43 g.error.sdump('D_ERROR','bib_brief.xul, set_tab: ' + E);
47 g.network.simple_request(
48 'FM_BRE_RETRIEVE_VIA_ID.authoritative',
52 var meta = req.getResultObject();
53 if (typeof meta.ilsevent != 'undefined') throw(meta);
55 var t = document.getElementById('caption').getAttribute('label');
56 if (get_bool( meta.deleted() )) {
57 t += ' ' + document.getElementById('catStrings').getString('staff.cat.bib_brief.deleted') + ' ';
58 document.getElementById('caption').setAttribute('style','background: red; color: white;');
60 if ( ! get_bool( meta.active() ) ) {
61 t += ' ' + document.getElementById('catStrings').getString('staff.cat.bib_brief.inactive') + ' ';
62 document.getElementById('caption').setAttribute('style','background: red; color: white;');
64 document.getElementById('caption').setAttribute('label',t);
66 bib_brief_overlay( { 'mvr' : mods, 'bre' : meta } );
69 g.error.standard_unexpected_error_alert('meta retrieve',E);
77 var t = document.getElementById('caption').getAttribute('label');
78 t += ' ' + document.getElementById('catStrings').getString('staff.cat.bib_brief.noncat') + ' ';
79 document.getElementById('caption').setAttribute('style','background: red; color: white;');
80 document.getElementById('caption').setAttribute('label',t);
84 var err_msg = document.getElementById("commonStrings").getFormattedString('common.exception', ['cat/bib_brief.xul', E]);
85 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
90 function view_marc() {
92 JSAN.use('util.window'); var win = new util.window();
94 alert(document.getElementById("catStrings").getString('staff.cat.bib_brief.noncat.alert'));
96 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
97 //win.open( urls.XUL_MARC_VIEW + '?noprint=1&docid=' + docid, 'marc_view', 'chrome,resizable,modal,width=400,height=400');
98 win.open( urls.XUL_MARC_VIEW, 'marc_view', 'chrome,resizable,modal,width=400,height=400',{'noprint':1,'docid':docid});
101 g.error.standard_unexpected_error_alert('spawning marc display',E);
105 function spawn_patron(span) {
107 if (typeof window.xulG == 'object' && typeof window.xulG.set_patron_tab == 'function') {
108 window.xulG.set_patron_tab( {}, { 'id' : span.getAttribute('au_id') } );
110 copy_to_clipboard( span.textContent );
113 g.error.standard_unexpected_error_alert('spawning patron display',E);