2 <!-- Application: Evergreen Staff Client -->
3 <!-- Screen: Brief Bib Display -->
5 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
7 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
8 <?xml-stylesheet href="chrome://open_ils_staff_client/skin/global.css" type="text/css"?>
9 <?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
11 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
13 <!DOCTYPE window PUBLIC "" ""[
14 <!--#include virtual="/opac/locale/en-US/lang.dtd"-->
17 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
19 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
21 <window id="cat_bib_brief_win"
22 onload="try { my_init(); font_helper(); } catch(E) { alert(E); }"
23 xmlns:html="http://www.w3.org/1999/xhtml"
24 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
26 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
28 <script type="text/javascript">
29 var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};
31 <scripts id="openils_util_scripts"/>
33 <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
41 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
42 if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
43 JSAN.errorLevel = "die"; // none, warn, or die
44 JSAN.addRepository('/xul/server/');
45 JSAN.use('util.error'); g.error = new util.error();
46 g.error.sdump('D_TRACE','my_init() for cat_bib_brief.xul');
48 JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
50 docid = xul_param('docid');
52 var key = location.pathname + location.search + location.hash;
53 if (!docid && typeof data.modal_xulG_stack != 'undefined' && typeof data.modal_xulG_stack[key] != 'undefined') {
54 var xulG = data.modal_xulG_stack[key][ data.modal_xulG_stack[key].length - 1 ];
55 if (typeof xulG == 'object') {
60 JSAN.use('util.network'); g.network = new util.network();
61 JSAN.use('util.date');
63 document.getElementById('caption').setAttribute('tooltiptext','Record ID = ' + docid);
67 data.last_record = docid; data.stash('last_record');
70 api.MODS_SLIM_RECORD_RETRIEVE.app,
71 api.MODS_SLIM_RECORD_RETRIEVE.method,
74 var mods = req.getResultObject();
76 if (mods.title()) document.getElementById('title').appendChild(
77 document.createTextNode(String(mods.title()).substr(0,50))
79 if (mods.author()) document.getElementById('author').appendChild(
80 document.createTextNode(mods.author())
82 if (mods.edition()) document.getElementById('edition').appendChild(
83 document.createTextNode(mods.edition())
85 if (mods.pubdate()) document.getElementById('pubdate').appendChild(
86 document.createTextNode(mods.pubdate())
88 if (mods.tcn()) document.getElementById('tcn').appendChild(
89 document.createTextNode(mods.tcn())
92 if (window.xulG && typeof window.xulG.set_tab_name == 'function') {
94 window.xulG.set_tab_name(mods.tcn());
96 g.error.sdump('D_ERROR','bib_brief.xul, set_tab: ' + E);
101 api.FM_BRE_RETRIEVE_VIA_ID.app,
102 api.FM_BRE_RETRIEVE_VIA_ID.method,
103 [ ses(), [ docid ] ],
106 var meta = req.getResultObject();
107 if (typeof meta.ilsevent != 'undefined') throw(meta);
109 document.getElementById('tcn_source').appendChild(
110 document.createTextNode(meta.tcn_source())
112 g.network.simple_request('FM_AU_FLESHED_RETRIEVE_VIA_ID',[ses(),meta.creator().id()],
114 var creator_au = rreq.getResultObject();
115 document.getElementById('creator_bc').appendChild(
116 document.createTextNode(creator_au.card().barcode())
120 g.network.simple_request('FM_AU_FLESHED_RETRIEVE_VIA_ID',[ses(),meta.editor().id()],
122 var editor_au = rreq.getResultObject();
123 document.getElementById('editor_bc').appendChild(
124 document.createTextNode(editor_au.card().barcode())
128 document.getElementById('creator').appendChild(
129 document.createTextNode('('+data.hash.aou[meta.creator().home_ou()].shortname()+') ')
131 document.getElementById('creator_bc').setAttribute('au_id',meta.creator().id());
132 document.getElementById('editor').appendChild(
133 document.createTextNode('('+data.hash.aou[meta.editor().home_ou()].shortname()+') ')
135 document.getElementById('editor_bc').setAttribute('au_id',meta.editor().id());
136 document.getElementById('edit_date').appendChild(
137 document.createTextNode(
138 util.date.formatted_date(meta.edit_date(),"%D")
141 var t = document.getElementById('caption').getAttribute('label');
142 if (get_bool( meta.deleted() )) {
144 document.getElementById('caption').setAttribute('style','background: red; color: white;');
146 if ( ! get_bool( meta.active() ) ) {
148 document.getElementById('caption').setAttribute('style','background: red; color: white;');
150 document.getElementById('caption').setAttribute('label',t);
152 g.error.standard_unexpected_error_alert('meta retrieve',E);
160 var t = document.getElementById('caption').getAttribute('label');
161 t += ' (Not Cataloged) ';
162 document.getElementById('caption').setAttribute('style','background: red; color: white;');
163 document.getElementById('caption').setAttribute('label',t);
167 var err_msg = "!! This software has encountered an error. Please tell your friendly " +
168 "system administrator or software developer the following:\ncat/bib_brief.xul\n" + E + '\n';
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('Item not cataloged.');
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 <groupbox id="groupbox" flex="1" style="overflow: auto; min-height: 100px;">
207 <caption label="Record Summary" id="caption"/>
208 <html:table width="90%">
209 <html:tr valign="top">
210 <html:td colspan="3">
211 <html:span style="font-weight: bold;">Title: </html:span><html:span id="title" />
214 (<html:a href="javascript:view_marc();" style="text-decoration: underline; color: blue;">View MARC</html:a>)
217 <html:tr valign="top">
218 <html:td colspan="2">
219 <html:span style="font-weight: bold;">Author: </html:span><html:span id="author" />
222 <html:span style="font-weight: bold;">Edition: </html:span><html:span id="edition" />
225 <html:span style="font-weight: bold;">Pub Date: </html:span><html:span id="pubdate" />
228 <html:tr valign="top">
230 <html:span style="font-weight: bold;">TCN: (</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)"/>
233 <html:span style="font-weight: bold;">Created By: </html:span><html:span id="creator" />
234 <html:span id="creator_bc" style="text-decoration: underline; color: blue;" onclick="try{spawn_patron(this);}catch(E){alert(E);}"/>
237 <html:span style="font-weight: bold;">Last Edited By: </html:span><html:span id="editor" />
238 <html:span id="editor_bc" style="text-decoration: underline; color: blue;" onclick="try{spawn_patron(this);}catch(E){alert(E);}"/>
241 <html:span style="font-weight: bold;">Last Edited On: </html:span><html:span id="edit_date" />