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"?>
10 <?xml-stylesheet href="/xul/server/skin/patron_display.css" type="text/css"?>
12 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
14 <!DOCTYPE window PUBLIC "" ""[
15 <!--#include virtual="/opac/locale/en-US/lang.dtd"-->
18 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
20 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
22 <window id="circ_copy_details_win"
23 onload="try { my_init(); } catch(E) { alert(E); }"
24 width="800" height="600" persist="width height"
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); }
42 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
43 if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
44 JSAN.errorLevel = "die"; // none, warn, or die
45 JSAN.addRepository('/xul/server/');
46 JSAN.use('util.error'); g.error = new util.error();
47 g.error.sdump('D_TRACE','my_init() for circ_copy_details.xul');
50 g.copy_id = g.cgi.param('copy_id');
52 JSAN.use('util.network'); g.network = new util.network();
53 JSAN.use('util.date');
54 JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.init({'via':'stash'});
57 var robj = g.network.simple_request('FM_ACP_DETAILS', [ ses(), g.copy_id ] );
58 if (typeof robj.ilsevent != 'undefined') throw(robj);
59 if (robj.copy) g.copy = robj.copy; else throw(robj);
60 g.hold = robj.hold; g.transit = robj.transit; g.circ = robj.circ;
61 if (g.hold) $('hold_caption').setAttribute('tooltiptext','Hold ID = ' + g.hold.id());
62 if (g.transit) $('transit_caption').setAttribute('tooltiptext','Transit ID = ' + g.transit.id());
63 if (g.circ) $('circ_caption').setAttribute('tooltiptext','Circ ID = ' + g.circ.id());
65 g.callnumber = g.network.simple_request('FM_ACN_RETRIEVE',[ g.copy.call_number() ]);
66 if (typeof g.callnumber.ilsevent != 'undefined') throw(g.callnumber);
68 $('top').setAttribute('src',urls.XUL_BIB_BRIEF + '?docid=' + g.callnumber.record());
69 g.data.temp_copy = g.copy; g.data.stash('temp_copy'); $('mid').setAttribute('src',urls.XUL_COPY_SUMMARY);
71 $('r_last').disabled = true;
73 $('r_last').disabled = false;
74 g.data.temp_circ = g.circ; g.data.stash('temp_circ');
75 $('circ').setAttribute('src',urls.XUL_CIRC_BRIEF + '?no_border=1');
76 if (g.circ.checkin_time()) {
77 $('circ_caption').setAttribute('label','Last Circulation');
79 $('circ_caption').setAttribute('label','Current Circulation');
82 $('circ_caption').setAttribute('label','This item has yet to circulate.');
83 $('circ').hidden = true;
87 JSAN.use('circ.util'); var columns = circ.util.transit_columns({});
89 JSAN.use('util.list'); g.list = new util.list('transit');
90 g.list.init( { 'columns' : columns, 'map_row_to_column' : circ.util.std_map_row_to_column(), });
91 g.list.append( { 'row' : { 'my' : { 'atc' : g.transit, } } });
94 $('transit_caption').setAttribute('label','This item is not in transit.');
95 $('transit').hidden = true;
99 $('r_hold').disabled = true;
101 $('r_hold').disabled = false;
102 var status_robj = g.network.simple_request('FM_AHR_STATUS',[ ses(), g.hold.id() ]);
103 JSAN.use('circ.util');
104 var columns = circ.util.hold_columns(
106 'request_time' : { 'hidden' : false },
107 'pickup_lib_shortname' : { 'hidden' : false },
108 'hold_type' : { 'hidden' : true },
109 'current_copy' : { 'hidden' : true },
110 'capture_time' : { 'hidden' : true },
111 'email_notify' : { 'hidden' : false },
112 'phone_notify' : { 'hidden' : false },
116 JSAN.use('util.list'); g.list = new util.list('hold');
117 g.list.init( { 'columns' : columns, 'map_row_to_column' : circ.util.std_map_row_to_column(), });
118 g.list.append( { 'row' : { 'my' : { 'ahr' : g.hold, 'acp' : g.copy, 'status' : status_robj, } } });
120 JSAN.use('patron.util');
121 var au_obj = patron.util.retrieve_fleshed_au_via_id( ses(), g.hold.usr() );
122 $('patron_name').setAttribute('value', au_obj.family_name() + ', ' + au_obj.first_given_name() + ' : ' + au_obj.card().barcode() );
125 $('hold_caption').setAttribute('label','This item is not captured for a hold.');
126 $('hold').hidden = true;
130 g.error.standard_unexpected_error_alert('Error in copy_details.xul, my_init()',E);
134 function retrieve_last_patron() {
136 g.data.fancy_prompt_data = js2JSON( [ g.circ.usr() ] );
137 g.data.stash('fancy_prompt_data');
144 function retrieve_hold_patron() {
146 g.data.fancy_prompt_data = js2JSON( [ g.hold.usr() ] );
147 g.data.stash('fancy_prompt_data');
157 <vbox flex="1" style="overflow: auto;">
158 <iframe flex="1" id="top" style="overflow: none; min-height: 80;"/>
159 <splitter><grippy/></splitter>
160 <iframe flex="1" id="mid" style="overflow: none; min-height: 80;"/>
161 <splitter><grippy/></splitter>
162 <groupbox flex="1" id="circs" style="overflow: none; min-height: 80;">
163 <caption id="circ_caption" label="Last/Current Circulation" style="font-weight: bold"/>
164 <iframe id="circ" style="min-height: 80" flex="1"/>
166 <splitter><grippy/></splitter>
167 <groupbox flex="1" id="transits" style="overflow: none; min-height: 80;">
168 <caption id="transit_caption" label="In Transit"/>
169 <tree id="transit" flex="1" />
171 <splitter><grippy/></splitter>
172 <groupbox flex="1" id="holds" style="overflow: none; min-height: 80;">
173 <caption id="hold_caption" label="Captured for Hold"/>
174 <label id="patron_name" class="patronNameLarge"/>
175 <tree id="hold" flex="1" />
176 <spacer FIXME="label and tree get swapped without this"/>
180 <button id="r_last" label="Retrieve Last Patron" accesskey="L" oncommand="retrieve_last_patron();"/>
181 <button id="r_hold" label="Retrieve Hold Patron" accesskey="H" oncommand="retrieve_hold_patron();"/>
183 <button id="done" label="Done" accesskey="D" oncommand="window.close();"/>