]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/xul/staff_client/server/circ/circ_brief.xul
b084bcee151814d92d75477d4e24ee6882277c2d
[Evergreen.git] / Open-ILS / xul / staff_client / server / circ / circ_brief.xul
1 <?xml version="1.0"?>
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/en-US/lang.dtd"-->
16 ]>
17
18 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
19 <!-- OVERLAYS -->
20 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
21
22 <window id="circ_circ_brief_win" 
23         onload="try { my_init(); font_helper(); } catch(E) { alert(E); }"
24         xmlns:html="http://www.w3.org/1999/xhtml"
25         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
26
27         <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
28         <!-- BEHAVIOR -->
29         <script type="text/javascript">
30                 var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};
31         </script>
32         <scripts id="openils_util_scripts"/>
33
34         <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
35         <script>
36         <![CDATA[
37                 function my_init() {
38                         try {
39                                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
40                                 if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
41                                 JSAN.errorLevel = "die"; // none, warn, or die
42                                 JSAN.addRepository('/xul/server/');
43                                 JSAN.use('util.error'); g.error = new util.error();
44                                 g.error.sdump('D_TRACE','my_init() for circ_circ_brief.xul');
45
46                                 g.cgi = new CGI();
47                                 g.circ_id = g.cgi.param('circ_id');
48
49                                 if (g.cgi.param('caption')) $('caption').setAttribute('label',g.cgi.param('caption'));
50                                 if (g.cgi.param('no_border')) $('gb').setAttribute('style','border: none');
51
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'});
55
56                                 function circ_callback(req) {
57                                         try {
58                                                 var r_circ = req.getResultObject();
59                                                 $('circ_lib').value = r_circ.circ_lib() ? g.data.hash.aou[ r_circ.circ_lib() ].shortname() : '';
60                                                 $('xact_start').value = r_circ.xact_start() ? r_circ.xact_start().toString().substr(0,16).replace(/T/,' ') : '';
61                                                 $('due_date').value = r_circ.due_date() ? r_circ.due_date().toString().substr(0,10) : '';
62                                                 $('circ_lib').setAttribute('tooltiptext','Check Out Staff ID = ' + r_circ.circ_staff() );
63                                                 $('checkin_lib').value = r_circ.checkin_lib() ? g.data.hash.aou[ r_circ.checkin_lib() ].shortname() : '';
64                                                 $('checkin_time').value = r_circ.checkin_time() ? r_circ.checkin_time().toString().substr(0,16).replace(/T/,' ') : '';
65                                                 $('checkin_lib').setAttribute('tooltiptext','Check In Staff ID = ' + r_circ.checkin_staff() );
66                                                 $('id').value = r_circ.id() ? r_circ.id() : '';
67                                                 $('stop_fines').value = r_circ.stop_fines() ? r_circ.stop_fines() : '';
68                                                 $('stop_fines_time').value = r_circ.stop_fines_time() ? r_circ.stop_fines_time().toString().substr(0,16).replace(/T/,' ') : '';
69                                                 var r = '';
70                                                 if (get_bool( r_circ.desk_renewal() ) ) r += 'DESK ';
71                                                 if (get_bool(r_circ.opac_renewal() ) ) r += 'OPAC ';
72                                                 if (get_bool(r_circ.phone_renewal() ) ) r += 'PHONE ';
73                                                 $('renewal').value = r || 'No';
74                                                 g.patron_id = r_circ.usr(); $('add_billing').disabled = false;
75                                                 g.network.simple_request('FM_AU_FLESHED_RETRIEVE_VIA_ID',[ ses(), r_circ.usr() ], function(preq) {
76                                                         var r_au = preq.getResultObject();
77                                                         $('patron_name').value = r_au.family_name() + ', ' + r_au.first_given_name() + ' ' + (r_au.second_given_name() ? r_au.second_given_name() + ' : ' + r_au.card().barcode() : '');
78                                                         JSAN.use('patron.util'); patron.util.set_penalty_css(r_au);
79                                                 });
80
81                                         } catch(E) {
82                                                 g.error.standard_unexpected_error_alert('Failure rendering circ.',E);
83                                         }
84                                 }
85
86                                 if (g.circ_id) {
87                                         g.network.simple_request( 'FM_CIRC_RETRIEVE_VIA_ID', [ ses(), g.circ_id ], circ_callback);
88                                 } else {
89                                         g.circ = g.data.temp_circ; g.data.temp_circ = null; g.data.stash('temp_circ');
90                                         g.circ_id = g.circ.id();
91                                         circ_callback( { 'getResultObject' : function() { return g.circ; } } );
92                                 }
93
94                         } catch(E) {
95                                 var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
96                                         "system administrator or software developer the following:\ncirc/circ_brief.xul\n" + E + '\n';
97                                 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
98                                 alert(err_msg);
99                         }
100                 }
101
102                 function $(id) { return document.getElementById(id); }
103
104                 g.add_billing = function() {
105                         JSAN.use('util.window');
106                         var win = new util.window();
107                         var w = win.open(
108                                 urls.XUL_PATRON_BILL_WIZARD
109                                         + '?patron_id=' + window.escape(g.patron_id)
110                                         + '&xact_id=' + window.escape( g.circ_id ),
111                                 'billwizard',
112                                 'chrome,resizable,modal'
113                         );
114                 }
115
116         ]]>
117         </script>
118
119         <groupbox id="gb" flex="1" style="overflow: auto;">
120                 <caption id="caption"/>
121                 <hbox>
122                         <label id="patron_name" class="patronNameLarge" flex="1"/>
123                         <label value="Circ ID: "/><label id="id"/>
124                         <button id="add_billing" disabled="true" label="Add Billing" oncommand="g.add_billing();"/>
125                 </hbox>
126                 <grid flex="1">
127                         <columns>
128                                 <column/>
129                                 <column flex="1"/>
130                                 <column/>
131                                 <column flex="1"/>
132                                 <column/>
133                                 <column flex="1"/>
134                                 <column/>
135                                 <column flex="1"/>
136                         </columns>
137                         <rows>
138                                 <row>
139                                         <label style="font-weight: bold" value="Check Out Time"/><label id="xact_start"/>
140                                         <label style="font-weight: bold" value="Due Date"/><label id="due_date"/>
141                                         <label style="font-weight: bold" value="Stop Fines Time"/><label id="stop_fines_time"/>
142                                         <label style="font-weight: bold" value="Check In Time"/><label id="checkin_time"/>
143                                 </row>
144                                 <row>
145                                         <label style="font-weight: bold" value="Check Out Lib"/><label id="circ_lib"/>
146                                         <label style="font-weight: bold" value="Renewal"/><label id="renewal"/>
147                                         <label style="font-weight: bold" value="Stop Fines Reason"/><label id="stop_fines"/>
148                                         <label style="font-weight: bold" value="Check In Lib"/><label id="checkin_lib"/>
149                                 </row>
150                         </rows>
151                 </grid>
152         </groupbox>
153
154 </window>
155