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="/xul/server/skin/global.css" type="text/css"?>
13 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
15 <!DOCTYPE window PUBLIC "" ""[
16 <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
19 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
21 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
23 <window id="cat_copy_summary_win"
24 onload="try { font_helper(); persist_helper(); my_init(); } catch(E) { alert(E); }"
25 xmlns:html="http://www.w3.org/1999/xhtml"
26 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
28 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
30 <script type="text/javascript">
31 var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};
33 <scripts id="openils_util_scripts"/>
35 <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
38 function $(id) { return document.getElementById(id); }
39 function $w(id,text) { if ($(id)) util.widgets.set_text($(id),text); }
43 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
44 if (typeof JSAN == 'undefined') {
45 throw( $("commonStrings").getString('common.jsan.missing') );
47 JSAN.errorLevel = "die"; // none, warn, or die
48 JSAN.addRepository('/xul/server/');
49 JSAN.use('util.error'); g.error = new util.error();
50 g.error.sdump('D_TRACE','my_init() for cat_copy_summary.xul');
52 var copy_id = xul_param('copy_id');
54 JSAN.use('util.network'); g.network = new util.network();
55 JSAN.use('util.date'); JSAN.use('util.widgets');
56 JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.stash_retrieve();
57 var copy = xul_param('copy',{'stash_name':'temp_copy','clear_xpcom':true});
58 var callnumber = xul_param('callnumber',{'stash_name':'temp_callnumber','clear_xpcom':true});
60 $('caption').setAttribute('tooltiptext', $('catStrings').getFormattedString('staff.cat.copy_summary.copy_id', [(copy_id || copy.id())]));
62 JSAN.use('circ.util');
63 var columns = circ.util.columns(
65 'barcode' : { 'hidden' : false },
66 'location' : { 'hidden' : false },
67 'owning_lib' : { 'hidden' : false },
68 'circ_lib' : { 'hidden' : false },
69 'call_number' : { 'hidden' : false },
70 'status' : { 'hidden' : false },
71 'alert_message' : { 'hidden' : false },
75 'id' : 'total_circs', 'label' : $('catStrings').getString('staff.cat.copy_summary.total_circs.label'), 'flex' : 1,
76 'primary' : false, 'hidden' : false, 'persist' : 'hidden width ordinal',
77 'render' : 'v = obj.network.simple_request("FM_CIRC_COUNT_RETRIEVE_VIA_COPY",[ my.acp.id() ]).total.count; v;'
81 JSAN.use('util.list'); g.list = new util.list('item_summary_list');
85 'map_row_to_columns' : circ.util.std_map_row_to_columns(),
88 $('list_actions').appendChild( g.list.render_list_actions() );
89 g.list.set_list_actions();
91 function acp_callback(req) {
93 var copy = req.getResultObject();
94 if (typeof copy.ilsevent != 'undefined') throw(copy);
96 function acn_callback(rreq) {
98 $w('copy_summary_barcode',copy.barcode());
99 $w('copy_summary_ref',get_bool(copy.ref()) ? $('catStrings').getString('staff.cat.copy_summary.yes') : $('catStrings').getString('staff.cat.copy_summary.no'));
100 $w('copy_summary_opac_visible',get_bool(copy.opac_visible()) ? $('catStrings').getString('staff.cat.copy_summary.yes') : $('catStrings').getString('staff.cat.copy_summary.no'));
101 $w('copy_summary_circulate',get_bool(copy.circulate()) ? $('catStrings').getString('staff.cat.copy_summary.yes') : $('catStrings').getString('staff.cat.copy_summary.no'));
102 $w('copy_summary_holdable',get_bool(copy.holdable()) ? $('catStrings').getString('staff.cat.copy_summary.yes') : $('catStrings').getString('staff.cat.copy_summary.no'));
103 $w('copy_summary_age_protect',copy.age_protect() == null ? $('staff.cat.copy_summary.unset') : ( typeof copy.age_protect() == 'object' ? copy.age_protect().name() : g.data.hash.crahp[ copy.age_protect() ].name() ) );
104 $w('copy_summary_location',typeof copy.location() == 'object' ? copy.location().name() : g.data.lookup('acpl',copy.location()).name() );
105 $w('copy_summary_create_date',util.date.formatted_date(copy.create_date(),'%F'));
106 $w('copy_summary_edit_date',util.date.formatted_date(copy.edit_date(),'%F'));
107 $w('copy_summary_status',typeof copy.status() == 'object' ? copy.status().name() : g.data.hash.ccs[ copy.status() ].name() );
109 g.error.standard_unexpected_error_alert('rendering copy',E);
112 var cn = rreq.getResultObject();
113 if (typeof cn.ilsevent != 'undefined') {
114 switch(Number(cn.ilsevent)) {
115 case 1508 /* ASSET_CALL_NUMBER_NOT_FOUND */ :
116 $w('copy_summary_callnumber', $('catStrings').getString('staff.cat.copy_summary.not_cataloged'));
123 $w('copy_summary_callnumber',cn.label());
125 g.list.append({'row':{'my':{'acp':copy,'acn':cn,'circ':xulG.circ}}});
126 g.barcode = copy.barcode(); g.doc_id = cn.record();
128 $('show_in_opac').hidden = false;
131 g.error.standard_unexpected_error_alert('retrieving volume',E);
136 acn_callback( { 'getResultObject' : function() { return callnumber; } } );
138 g.network.simple_request(
139 'FM_ACN_RETRIEVE.authoritative',
140 [ copy.call_number() ], acn_callback
144 g.error.standard_unexpected_error_alert('retrieving copy',E);
149 g.network.simple_request( 'FM_ACP_RETRIEVE', [ copy_id ], acp_callback);
151 acp_callback( { 'getResultObject' : function() { return copy; } } );
155 g.network.simple_request('FM_CIRC_COUNT_RETRIEVE_VIA_COPY',[ copy_id ],function(req) {
157 var robj = req.getResultObject();
158 if (typeof robj.ilsevent != 'undefined') throw(robj);
159 $w('copy_summary_total_circs',robj.total.count);
161 g.error.standard_unexpected_error_alert('retrieving circ total',E);
165 if ( $('alternate_view').checked ) {
170 try { g.error.standard_unexpected_error_alert('copy_summary.xul',E); } catch(F) { alert(E + '\n' + F); }
174 function toggle_deck() {
176 if ($('item_deck').selectedIndex == 0) {
177 $('item_deck').selectedIndex = 1; /* change to grid */
179 $('item_deck').selectedIndex = 0; /* change to tree */
187 <messagecatalog id="catStrings" src="/xul/server/locale/<!--#echo var='locale'-->/cat.properties" />
188 <messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale'-->/circ.properties" />
190 <groupbox id="groupbox" flex="1" style="overflow: none; min-height: 80;">
191 <caption label="&staff.cat.copy_summary.label;" id="caption"/>
192 <deck id="item_deck" oils_persist="selectedIndex">
193 <tree id="item_summary_list" enableColumnDrag="true" flex="1"/>
207 <label style="font-weight: bold" value="&staff.cat.copy_summary.barcode.label;"/>
208 <label id="copy_summary_barcode" style="color: blue; text-decoration: underline; -moz-user-focus: normal;" onclick="copy_to_clipboard(event);"/>
209 <label style="font-weight: bold" value="&staff.cat.copy_summary.location.label;"/>
210 <label id="copy_summary_location"/>
211 <label style="font-weight: bold" value="&staff.cat.copy_summary.call_number.label;"/>
212 <label id="copy_summary_callnumber"/>
213 <label style="font-weight: bold" value="&staff.cat.copy_summary.status.label;"/>
214 <label id="copy_summary_status"/>
217 <label style="font-weight: bold" value="&staff.cat.copy_summary.circulate.label;"/>
218 <label id="copy_summary_circulate"/>
219 <label style="font-weight: bold" value="&staff.cat.copy_summary.reference.label;"/>
220 <label id="copy_summary_ref"/>
221 <label style="font-weight: bold" value="&staff.cat.copy_summary.holdable.label;"/>
222 <label id="copy_summary_holdable"/>
223 <label style="font-weight: bold" value="&staff.cat.copy_summary.opac_visible.label;"/>
224 <label id="copy_summary_opac_visible"/>
227 <label style="font-weight: bold" value="&staff.cat.copy_summary.created.label;"/>
228 <label id="copy_summary_create_date"/>
229 <label style="font-weight: bold" value="&staff.cat.copy_summary.edited.label;"/>
230 <label id="copy_summary_edit_date"/>
231 <label style="font-weight: bold" value="&staff.cat.copy_summary.age_protect.label;"/>
232 <label id="copy_summary_age_protect"/>
233 <label style="font-weight: bold" value="&staff.cat.copy_summary.total_circs.label;"/>
234 <label id="copy_summary_total_circs"/>
240 <hbox id="list_actions"/>
241 <button id="show_in_opac" hidden="true" label="&staff.cat.copy_summary.show_in_opac.label;" accesskey="&staff.cat.copy_summary.show_in_opac.accesskey;"
242 oncommand="JSAN.use('cat.util'); cat.util.show_in_opac([{barcode:g.barcode,doc_id:g.doc_id}]);"/>
243 <checkbox id="alternate_view" label="&staff.cat.copy_summary.alternate_view.label;" accesskey="&staff.cat.copy_summary.alternate_view.accesskey;"
244 oils_persist="checked" oils_persist_no_poke="true"
245 oncommand="toggle_deck()"/>