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_copy_summary_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"/>
36 function $(id) { return document.getElementById(id); }
37 function $w(id,text) { if ($(id)) util.widgets.set_text($(id),text); }
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_copy_summary.xul');
49 var copy_id = g.cgi.param('copy_id');
51 JSAN.use('util.network'); g.network = new util.network();
52 JSAN.use('util.date'); JSAN.use('util.widgets');
53 JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.stash_retrieve();
55 if (g.data.temp_copy) {
56 copy = g.data.temp_copy; g.data.temp_copy = null; g.data.stash('temp_copy');
59 if (g.data.temp_callnumber) {
60 callnumber = g.data.temp_callnumber; g.data.temp_callnumber = null; g.data.stash('temp_callnumber');
63 $('caption').setAttribute('tooltiptext','Copy ID = ' + (copy_id || copy.id() ) );
65 JSAN.use('circ.util');
66 var columns = circ.util.columns(
68 'barcode' : { 'hidden' : false },
69 'location' : { 'hidden' : false },
70 'owning_lib' : { 'hidden' : false },
71 'circ_lib' : { 'hidden' : false },
72 'call_number' : { 'hidden' : false },
73 'status' : { 'hidden' : false },
74 'alert_message' : { 'hidden' : false },
78 'id' : 'total_circs', 'label' : 'Total Circs', 'flex' : 1,
79 'primary' : false, 'hidden' : false, 'persist' : 'hidden width ordinal',
80 'render' : 'v = obj.network.simple_request("FM_CIRC_COUNT_RETRIEVE_VIA_COPY",[ my.acp.id() ]).total.count; v;'
84 JSAN.use('util.list'); g.list = new util.list('item_summary_list');
88 'map_row_to_columns' : circ.util.std_map_row_to_columns(),
92 function acp_callback(req) {
94 var copy = req.getResultObject();
95 if (typeof copy.ilsevent != 'undefined') throw(copy);
97 function acn_callback(rreq) {
99 $w('barcode',copy.barcode());
100 $w('ref',get_bool(copy.ref()) ? 'Yes' : 'No');
101 $w('opac_visible',get_bool(copy.opac_visible()) ? 'Yes' : 'No');
102 $w('circulate',get_bool(copy.circulate()) ? 'Yes' : 'No');
103 $w('holdable',get_bool(copy.holdable()) ? 'Yes' : 'No');
104 $w('age_protect',copy.age_protect() == null ? '<Unset>' : ( typeof copy.age_protect() == 'object' ? copy.age_protect().name() : g.data.hash.crahp[ copy.age_protect() ].name() ) );
105 $w('location',typeof copy.location() == 'object' ? copy.location().name() : g.data.lookup('acpl',copy.location()).name() );
106 $w('create_date',util.date.formatted_date(copy.create_date(),'%F'));
107 $w('edit_date',util.date.formatted_date(copy.edit_date(),'%F'));
108 $w('status',typeof copy.status() == 'object' ? copy.status().name() : g.data.hash.ccs[ copy.status() ].name() );
110 g.error.standard_unexpected_error_alert('rendering copy',E);
113 var cn = rreq.getResultObject();
114 if (typeof cn.ilsevent != 'undefined') {
115 switch(cn.ilsevent) {
116 case 1508 /* ASSET_CALL_NUMBER_NOT_FOUND */ :
117 $w('callnumber','Not Cataloged');
124 $w('callnumber',cn.label());
126 g.list.append({'row':{'my':{'acp':copy,'acn':cn}}});
128 g.error.standard_unexpected_error_alert('retrieving volume',E);
133 acn_callback( { 'getResultObject' : function() { return callnumber; } } );
135 g.network.simple_request(
137 [ copy.call_number() ], acn_callback
141 g.error.standard_unexpected_error_alert('retrieving copy',E);
146 g.network.simple_request( 'FM_ACP_RETRIEVE', [ copy_id ], acp_callback);
148 acp_callback( { 'getResultObject' : function() { return copy; } } );
152 g.network.simple_request('FM_CIRC_COUNT_RETRIEVE_VIA_COPY',[ copy_id ],function(req) {
154 var robj = req.getResultObject();
155 if (typeof robj.ilsevent != 'undefined') throw(robj);
156 $w('total_circs',robj.total.count);
158 g.error.standard_unexpected_error_alert('retrieving circ total',E);
162 toggle_deck(); toggle_deck(); /* quick hack */
165 try { g.error.standard_unexpected_error_alert('copy_summary.xul',E); } catch(F) { alert(E + '\n' + F); }
169 function toggle_deck() {
171 if ($('item_deck').selectedIndex == 0) {
172 $('item_deck').selectedIndex = 1; /* change to grid */
173 $('save_columns').hidden = true;
174 $('sel_clip').hidden = true;
176 $('item_deck').selectedIndex = 0; /* change to tree */
177 $('save_columns').hidden = false;
178 $('sel_clip').hidden = false;
186 <groupbox id="groupbox" flex="1" style="overflow: none; min-height: 80;">
187 <caption label="Item Summary" id="caption"/>
188 <deck id="item_deck" persist="selectedIndex">
189 <tree id="item_summary_list" enableColumnDrag="true" flex="1"/>
203 <label style="font-weight: bold" value="Barcode:"/>
204 <label id="barcode" style="color: blue; text-decoration: underline; -moz-user-focus: normal;" onclick="copy_to_clipboard(event);"/>
205 <label style="font-weight: bold" value="Location:"/>
206 <label id="location"/>
207 <label style="font-weight: bold" value="Call Number:"/>
208 <label id="callnumber"/>
209 <label style="font-weight: bold" value="Status:"/>
213 <label style="font-weight: bold" value="Circulate:"/>
214 <label id="circulate"/>
215 <label style="font-weight: bold" value="Reference:"/>
217 <label style="font-weight: bold" value="Holdable:"/>
218 <label id="holdable"/>
219 <label style="font-weight: bold" value="Opac Visible:"/>
220 <label id="opac_visible"/>
223 <label style="font-weight: bold" value="Created:"/>
224 <label id="create_date"/>
225 <label style="font-weight: bold" value="Edited:"/>
226 <label id="edit_date"/>
227 <label style="font-weight: bold" value="Age Protect:"/>
228 <label id="age_protect"/>
229 <label style="font-weight: bold" value="Total Circs:"/>
230 <label id="total_circs"/>
236 <button label="Alternate View" oncommand="toggle_deck()"/>
237 <button id="save_columns" label="Save Columns" oncommand="try { g.list.save_columns(); } catch(E) { alert(E); }"/>
238 <button id="sel_clip" label="Copy to Clipboard" oncommand="try { g.list.node.view.selection.selectAll(); g.list.clipboard(); } catch(E) { alert(E); }"/>
239 <button id="print_export" label="Print Export" oncommand="try { g.list.on_all_fleshed = function() { JSAN.use('util.print'); var p = new util.print(); p.simple( g.list.dump_csv(), { 'content_type' : 'text/plain' } ); setTimeout( function() { g.list.on_all_fleshed = null; }, 0); }; g.list.full_retrieve(); } catch(E) { alert(E); }"/>