1 <?xml version="1.0" encoding="utf-8"?>
2 <!-- Application: Evergreen Staff Client -->
3 <!-- Screen: Brief Bib Display -->
8 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
10 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
11 <?xml-stylesheet href="chrome://open_ils_staff_client/skin/global.css" type="text/css"?>
12 <?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
14 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
16 <!DOCTYPE window PUBLIC "" ""[
17 <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
20 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
22 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
24 <window id="cat_bib_brief_win"
25 onload="try { my_init(); font_helper(); } catch(E) { alert(E); }"
26 xmlns:html="http://www.w3.org/1999/xhtml"
27 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
29 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
31 <script type="text/javascript">
32 var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};
34 <scripts id="openils_util_scripts"/>
36 <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
44 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
45 if (typeof JSAN == 'undefined') { throw( document.getElementById("commonStrings").getString('common.jsan.missing') ); }
46 JSAN.errorLevel = "die"; // none, warn, or die
47 JSAN.addRepository('/xul/server/');
48 JSAN.use('util.error'); g.error = new util.error();
49 g.error.sdump('D_TRACE','my_init() for cat_bib_brief.xul');
51 JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
53 docid = xul_param('docid');
55 var key = location.pathname + location.search + location.hash;
56 if (!docid && typeof data.modal_xulG_stack != 'undefined' && typeof data.modal_xulG_stack[key] != 'undefined') {
57 var xulG = data.modal_xulG_stack[key][ data.modal_xulG_stack[key].length - 1 ];
58 if (typeof xulG == 'object') {
63 JSAN.use('util.network'); g.network = new util.network();
64 JSAN.use('util.date');
66 document.getElementById('caption').setAttribute('tooltiptext',document.getElementById('catStrings').getFormattedString('staff.cat.bib_brief.record_id', [docid]));
70 data.last_record = docid; data.stash('last_record');
72 g.network.simple_request(
73 'MODS_SLIM_RECORD_RETRIEVE.authoritative',
76 var mods = req.getResultObject();
78 if (mods.title()) document.getElementById('title').appendChild(
79 document.createTextNode(String(mods.title()).substr(0,50))
81 if (mods.author()) document.getElementById('author').appendChild(
82 document.createTextNode(mods.author())
84 if (mods.edition()) document.getElementById('edition').appendChild(
85 document.createTextNode(mods.edition())
87 if (mods.pubdate()) document.getElementById('pubdate').appendChild(
88 document.createTextNode(mods.pubdate())
90 if (mods.tcn()) document.getElementById('tcn').appendChild(
91 document.createTextNode(mods.tcn())
94 if (window.xulG && typeof window.xulG.set_tab_name == 'function') {
96 window.xulG.set_tab_name(mods.tcn());
98 g.error.sdump('D_ERROR','bib_brief.xul, set_tab: ' + E);
102 g.network.simple_request(
103 'FM_BRE_RETRIEVE_VIA_ID.authoritative',
104 [ ses(), [ docid ] ],
107 var meta = req.getResultObject();
108 if (typeof meta.ilsevent != 'undefined') throw(meta);
110 document.getElementById('tcn_source').appendChild(
111 document.createTextNode(meta.tcn_source())
113 g.network.simple_request('FM_AU_FLESHED_RETRIEVE_VIA_ID',[ses(),meta.creator().id()],
115 var creator_au = rreq.getResultObject();
116 document.getElementById('creator_bc').appendChild(
117 document.createTextNode(creator_au.card().barcode())
121 g.network.simple_request('FM_AU_FLESHED_RETRIEVE_VIA_ID',[ses(),meta.editor().id()],
123 var editor_au = rreq.getResultObject();
124 document.getElementById('editor_bc').appendChild(
125 document.createTextNode(editor_au.card().barcode())
129 document.getElementById('creator').appendChild(
130 document.createTextNode('('+data.hash.aou[meta.creator().home_ou()].shortname()+') ')
132 document.getElementById('creator_bc').setAttribute('au_id',meta.creator().id());
133 document.getElementById('editor').appendChild(
134 document.createTextNode('('+data.hash.aou[meta.editor().home_ou()].shortname()+') ')
136 document.getElementById('editor_bc').setAttribute('au_id',meta.editor().id());
137 document.getElementById('edit_date').appendChild(
138 document.createTextNode(
139 util.date.formatted_date(meta.edit_date(),"%D")
142 var t = document.getElementById('caption').getAttribute('label');
143 if (get_bool( meta.deleted() )) {
144 t += ' ' + document.getElementById('catStrings').getString('staff.cat.bib_brief.deleted') + ' ';
145 document.getElementById('caption').setAttribute('style','background: red; color: white;');
147 if ( ! get_bool( meta.active() ) ) {
148 t += ' ' + document.getElementById('catStrings').getString('staff.cat.bib_brief.inactive') + ' ';
149 document.getElementById('caption').setAttribute('style','background: red; color: white;');
151 document.getElementById('caption').setAttribute('label',t);
153 g.error.standard_unexpected_error_alert('meta retrieve',E);
161 var t = document.getElementById('caption').getAttribute('label');
162 t += ' ' + document.getElementById('catStrings').getString('staff.cat.bib_brief.noncat') + ' ';
163 document.getElementById('caption').setAttribute('style','background: red; color: white;');
164 document.getElementById('caption').setAttribute('label',t);
168 var err_msg = document.getElementById("commonStrings").getFormattedString('common.exception', ['cat/bib_brief.xul', E]);
169 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
174 function view_marc() {
176 JSAN.use('util.window'); var win = new util.window();
178 alert(document.getElementById("catStrings").getString('staff.cat.bib_brief.noncat.alert'));
180 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
181 //win.open( urls.XUL_MARC_VIEW + '?noprint=1&docid=' + docid, 'marc_view', 'chrome,resizable,modal,width=400,height=400');
182 win.open( urls.XUL_MARC_VIEW, 'marc_view', 'chrome,resizable,modal,width=400,height=400',{'noprint':1,'docid':docid});
185 g.error.standard_unexpected_error_alert('spawning marc display',E);
189 function spawn_patron(span) {
191 var loc = urls.XUL_PATRON_DISPLAY; // + '?barcode=' + window.escape(barcode);
193 if (typeof window.xulG == 'object' && typeof window.xulG.set_tab == 'function') {
194 window.xulG.set_tab( loc, {}, { 'id' : span.getAttribute('au_id') } );
196 copy_to_clipboard( span.textContent );
199 g.error.standard_unexpected_error_alert('spawning patron display',E);
206 <messagecatalog id="commonStrings" src="/xul/server/locale/<!--#echo var='locale'-->/common.properties"/>
207 <messagecatalog id="catStrings" src="/xul/server/locale/<!--#echo var='locale'-->/cat.properties"/>
209 <groupbox id="groupbox" flex="1" style="overflow: auto; min-height: 100px;">
210 <caption label="&staff.cat.bib_brief.record_summary;" id="caption"/>
211 <html:table width="90%">
212 <html:tr valign="top">
213 <html:td colspan="3">
214 <html:span style="font-weight: bold;">&staff.cat.bib_brief.title; </html:span><html:span id="title" />
217 (<html:a href="javascript:view_marc();" style="text-decoration: underline; color: blue;">&staff.cat.bib_brief.view_marc;</html:a>)
220 <html:tr valign="top">
221 <html:td colspan="2">
222 <html:span style="font-weight: bold;">&staff.cat.bib_brief.author; </html:span><html:span id="author" />
225 <html:span style="font-weight: bold;">&staff.cat.bib_brief.edition; </html:span><html:span id="edition" />
228 <html:span style="font-weight: bold;">&staff.cat.bib_brief.pub_date; </html:span><html:span id="pubdate" />
231 <html:tr valign="top">
233 <html:span style="font-weight: bold;">&staff.cat.bib_brief.title_control_number; (</html:span><html:span id="tcn_source"/><html:span style="font-weight: bold;">) </html:span><html:span id="tcn" style="text-decoration: underline; color: blue;" onclick="copy_to_clipboard(event)"/>
236 <html:span style="font-weight: bold;">&staff.cat.bib_brief.created_by; </html:span><html:span id="creator" />
237 <html:span id="creator_bc" style="text-decoration: underline; color: blue;" onclick="try{spawn_patron(this);}catch(E){alert(E);}"/>
240 <html:span style="font-weight: bold;">&staff.cat.bib_brief.last_edited_by; </html:span><html:span id="editor" />
241 <html:span id="editor_bc" style="text-decoration: underline; color: blue;" onclick="try{spawn_patron(this);}catch(E){alert(E);}"/>
244 <html:span style="font-weight: bold;">&staff.cat.bib_brief.last_edited_on; </html:span><html:span id="edit_date" />