]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/xul/staff_client/server/circ/copy_details.xul
i18n for copy details and circulation summary screens
[working/Evergreen.git] / Open-ILS / xul / staff_client / server / circ / copy_details.xul
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- Application: Evergreen Staff Client -->
3 <!-- Screen: Brief Bib Display -->
4
5 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
6 <!-- STYLESHEETS -->
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"?>
11
12 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
13 <!-- LOCALIZATION -->
14 <!DOCTYPE window PUBLIC "" ""[
15         <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
16 ]>
17
18 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
19 <!-- OVERLAYS -->
20 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
21
22 <window id="circ_copy_details_win" 
23         onload="try { my_init(); font_helper(); } 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">
27
28         <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
29         <!-- BEHAVIOR -->
30         <script type="text/javascript">
31                 var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};
32         </script>
33         <scripts id="openils_util_scripts"/>
34
35         <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
36         <script>
37         <![CDATA[
38                 function $(id) { return document.getElementById(id); }
39
40                 var xulG = {};
41
42                 function my_init() {
43                         try {
44                                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
45                                 if (typeof JSAN == 'undefined') { 
46                                         throw( document.getElementById("commonStrings").getString('common.jsan.missing') );
47                                 }
48                                 JSAN.errorLevel = "die"; // none, warn, or die
49                                 JSAN.addRepository('/xul/server/');
50                                 JSAN.use('util.error'); g.error = new util.error();
51                                 g.error.sdump('D_TRACE','my_init() for circ_copy_details.xul');
52
53                                 g.copy_id = xul_param('copy_id',{'modal_xulG':true});
54
55                                 JSAN.use('util.network'); g.network = new util.network();
56                                 JSAN.use('util.date');
57                                 JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.init({'via':'stash'});
58
59                                 // uber method
60                                 var robj = g.network.simple_request('FM_ACP_DETAILS', [ ses(), g.copy_id ] );
61                                 if (typeof robj.ilsevent != 'undefined') {
62                                         throw(robj);
63                                 }
64                                 if (robj.copy) {
65                                         g.copy = robj.copy;
66                                 } else {
67                                         throw(robj);
68                                 }
69                                 g.hold = robj.hold; g.transit = robj.transit; g.circ = robj.circ; g.callnumber = robj.volume;
70                                 var tt_msg = '';
71                                 if (g.hold) {
72                                         tt_msg = $('circStrings').getFormattedString('staff.circ.copy_details.hold', [g.hold.id()]);
73                                         $('hold_caption').setAttribute('tooltiptext', tt_msg);
74                                 }
75                                 if (g.transit) {
76                                         tt_msg = $('circStrings').getFormattedString('staff.circ.copy_details.transit', [g.transit.id()]);
77                                         $('transit_caption').setAttribute('tooltiptext', tt_msg);
78                                 }
79                                 if (g.circ) {
80                                         tt_msg = $('circStrings').getFormattedString('staff.circ.copy_details.circ', [g.circ.id()]);
81                                         $('circ_caption').setAttribute('tooltiptext', tt_msg);
82                                 }
83
84                                 //g.callnumber = g.network.simple_request('FM_ACN_RETRIEVE',[ g.copy.call_number() ]);
85                                 //if (typeof g.callnumber.ilsevent != 'undefined') throw(g.callnumber);
86
87                                 $('top').setAttribute('src',urls.XUL_BIB_BRIEF); // + '?docid=' + g.callnumber.record());
88                                 get_contentWindow($('top')).xulG = { 'docid' : g.callnumber.record() };
89                                 //g.data.temp_copy = g.copy; g.data.stash('temp_copy'); 
90                                 //g.data.temp_callnumber = g.callnumber; g.data.stash('temp_callnumber'); 
91                                 $('item_summary').setAttribute('src',urls.XUL_COPY_SUMMARY);
92                                 get_contentWindow($('item_summary')).xulG = { 'copy' : g.copy, 'callnumber' : g.callnumber };
93
94                                 $('r_last').disabled = true;
95                                 if (g.circ) {
96                                         $('r_last').disabled = false;
97                                         g.data.temp_circ = g.circ; g.data.stash('temp_circ');
98                                         $('circ').setAttribute('src',urls.XUL_CIRC_BRIEF); // + '?no_border=1');
99                                         get_contentWindow($('circ')).xulG = { 'no_border' : 1 };
100                                         if (g.circ.checkin_time()) {
101                                                 $('circ_caption').setAttribute('label', $('circStrings').getString('staff.circ.copy_details.last_circ'));
102                                         } else {
103                                                 $('circ_caption').setAttribute('label', $('circStrings').getString('staff.circ.copy_details.current_circ'));
104                                         }
105                                 } else {
106                                         $('circ_caption').setAttribute('label', $('circStrings').getString('staff.circ.copy_details.no_circ'));
107                                         $('circ').hidden = true;
108                                 }
109
110                                 if (g.transit) {
111                                         JSAN.use('circ.util'); var columns = circ.util.transit_columns({});
112
113                                         JSAN.use('util.list'); g.list = new util.list('transit');
114                                         g.list.init( { 'columns' : columns, 'map_row_to_columns' : circ.util.std_map_row_to_columns(), });
115                                         g.list.append( { 'row' : { 'my' : { 'atc' : g.transit, } } });
116         
117                                 } else {
118                                         $('transit_caption').setAttribute('label', $('circStrings').getString('staff.circ.copy_details.not_transit'));
119                                         $('transit').hidden = true;
120                                 }
121
122
123                                 $('r_hold').disabled = true;
124                                 if (g.hold) {
125                                         $('r_hold').disabled = false;
126                                         var status_robj = g.network.simple_request('FM_AHR_STATUS',[ ses(), g.hold.id() ]);
127                                         JSAN.use('circ.util');
128                                         var columns = circ.util.hold_columns( 
129                                                 { 
130                                                         'request_time' : { 'hidden' : false },
131                                                         'pickup_lib_shortname' : { 'hidden' : false },
132                                                         'hold_type' : { 'hidden' : true },
133                                                         'current_copy' : { 'hidden' : true },
134                                                         'capture_time' : { 'hidden' : true },
135                                                         'email_notify' : { 'hidden' : false },
136                                                         'phone_notify' : { 'hidden' : false },
137                                                 } 
138                                         );
139
140                                         JSAN.use('util.list'); g.list = new util.list('hold');
141                                         g.list.init( { 'columns' : columns, 'map_row_to_columns' : circ.util.std_map_row_to_columns(), });
142                                         g.list.append( { 'row' : { 'my' : { 'ahr' : g.hold, 'acp' : g.copy, 'status' : status_robj, } } });
143         
144                                         JSAN.use('patron.util'); 
145                                         var au_obj = patron.util.retrieve_fleshed_au_via_id( ses(), g.hold.usr() );
146                                         $('patron_name').setAttribute('value', $('circStrings').getFormattedString('staff.circ.copy_details.user_details', [au_obj.family_name(), au_obj.first_given_name(), au_obj.card().barcode()]) );
147
148                                 } else {
149                                         if (g.copy.status() == 8 /* ON HOLDS SHELF */) {
150                                                 $('hold_caption').setAttribute('label', $('circStrings').getString('staff.circ.copy_details.bad_hold_status'));
151                                         } else {
152                                                 $('hold_caption').setAttribute('label', $('circStrings').getString('staff.circ.copy_details.no_hold'));
153                                         }
154                                         $('hold').hidden = true;
155                                 }
156
157                         } catch(E) {
158                                 g.error.standard_unexpected_error_alert('Error in copy_details.xul, my_init()',E);
159                         }
160                 }
161
162                 function retrieve_last_patron() {
163                         try {
164                                 //g.data.fancy_prompt_data = js2JSON( [ g.circ.usr() ] );
165                                 //g.data.stash('fancy_prompt_data');
166                                 xulG.retrieve_these_patrons = [ g.circ.usr() ];
167                                 update_modal_xulG(xulG);
168                                 window.close();
169                         } catch(E) {
170                                 alert(E);
171                         }
172                 }
173
174                 function retrieve_hold_patron() {
175                         try {
176                                 //g.data.fancy_prompt_data = js2JSON( [ g.hold.usr() ] );
177                                 //g.data.stash('fancy_prompt_data');
178                                 xulG.retrieve_these_patrons = [ g.hold.usr() ];
179                                 update_modal_xulG(xulG);
180                                 window.close();
181                         } catch(E) {
182                                 alert(E);
183                         }
184                 }
185
186         ]]>
187         </script>
188
189         <messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale'-->/circ.properties" />
190
191         <vbox flex="1" style="overflow: auto;">
192                 <vbox style="border: none; overflow: none; min-height: 80;">
193                         <iframe flex="1" id="top" style="overflow: none; min-height: 80;"/>
194                 </vbox>
195                 <splitter><grippy/></splitter>
196                 <vbox style="border: none; overflow: none; min-height: 80;">
197                         <iframe flex="1" id="item_summary" style="overflow: none; min-height: 80;"/>
198                 </vbox>
199                 <splitter><grippy/></splitter>
200                 <groupbox flex="1" id="holds" style="overflow: none; min-height: 80;">
201                         <caption id="hold_caption" label="&staff.circ.copy_details.hold_caption;"/>
202                         <label id="patron_name" class="patronNameLarge"/>
203                         <tree id="hold" flex="1" enableColumnDrag="true"/>
204                         <spacer FIXME="label and tree get swapped without this"/>
205                 </groupbox>
206                 <splitter><grippy/></splitter>
207                 <groupbox flex="1" id="transits" style="overflow: none; min-height: 80;">
208                         <caption id="transit_caption" label="&staff.circ.copy_details.transit_caption;"/>
209                         <tree id="transit" flex="1" enableColumnDrag="true"/>
210                 </groupbox>
211                 <splitter><grippy/></splitter>
212                 <groupbox flex="1" id="circs" style="overflow: none; min-height: 80;">
213                         <caption id="circ_caption" label="&staff.circ.copy_details.circ_caption;" style="font-weight: bold"/>
214                         <iframe id="circ" style="min-height: 80" flex="1"/>
215                 </groupbox>
216         </vbox>
217         <hbox>
218                 <button id="r_last" label="&staff.circ.copy_details.r_last.label;" accesskey="&staff.circ.copy_details.r_last.accesskey;" oncommand="retrieve_last_patron();"/>
219                 <button id="r_hold" label="&staff.circ.copy_details.r_hold.label;" accesskey="&staff.circ.copy_details.r_hold.accesskey;" oncommand="retrieve_hold_patron();"/>
220                 <spacer flex="1"/>
221                 <button id="done" label="&staff.circ.copy_details.done.label;" accesskey="&staff.circ.copy_details.done.accesskey;" oncommand="window.close();"/>
222         </hbox>
223
224 </window>
225