]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/xul/staff_client/server/circ/circ_brief.xul
Add Billing in other interfaces
[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(); } 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                                 JSAN.use('util.network'); g.network = new util.network();
50                                 JSAN.use('util.date');
51                                 JSAN.use('OpenILS.data'); g.data = new OpenILS.data(); g.data.init({'via':'stash'});
52
53                                 g.network.request(
54                                         api.FM_CIRC_RETRIEVE_VIA_ID.app,
55                                         api.FM_CIRC_RETRIEVE_VIA_ID.method,
56                                         [ ses(), g.circ_id ],
57                                         function (req) {
58                                                 try {
59                                                 var r_circ = req.getResultObject();
60                                                 $('circ_lib').value = r_circ.circ_lib() ? g.data.hash.aou[ r_circ.circ_lib() ].shortname() : '';
61                                                 $('xact_start').value = r_circ.xact_start() ? r_circ.xact_start().toString().substr(0,16) : '';
62                                                 $('circ_staff').value = r_circ.circ_staff() ? 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) : '';
65                                                 $('checkin_staff').value = r_circ.checkin_staff() ? 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                                                 var r = '';
69                                                 if (r_circ.desk_renewal() == 't' || r_circ.desk_renewal() == '1') r += 'DESK ';
70                                                 if (r_circ.opac_renewal() == 't' || r_circ.opac_renewal() == '1') r += 'OPAC ';
71                                                 if (r_circ.phone_renewal() == 't' || r_circ.phone_renewal() == '1') r += 'PHONE ';
72                                                 $('renewal').value = r || 'No';
73                                                 } catch(E) {
74                                                         g.error.standard_unexpected_error_alert('Failure rendering circ.',E);
75                                                 }
76                                                 g.patron_id = r_circ.usr(); $('add_billing').disabled = false;
77                                                 g.network.simple_request('FM_AU_FLESHED_RETRIEVE_VIA_ID',[ ses(), r_circ.usr() ], function(preq) {
78                                                         var r_au = preq.getResultObject();
79                                                         $('barcode').value = r_au.card().barcode();
80                                                         $('patron_name').value = r_au.family_name() + ', ' + r_au.first_given_name() + ' ' + (r_au.second_given_name() ? r_au.second_given_name() : '');
81                                                         JSAN.use('patron.util'); patron.util.set_penalty_css(r_au);
82                                                 });
83                                         }
84                                 );
85
86
87
88                         } catch(E) {
89                                 var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
90                                         "system administrator or software developer the following:\ncirc/circ_brief.xul\n" + E + '\n';
91                                 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
92                                 alert(err_msg);
93                         }
94                 }
95
96                 function $(id) { return document.getElementById(id); }
97
98                 g.add_billing = function() {
99                         JSAN.use('util.window');
100                         var win = new util.window();
101                         var w = win.open(
102                                 urls.XUL_PATRON_BILL_WIZARD
103                                         + '?patron_id=' + window.escape(g.patron_id)
104                                         + '&xact_id=' + window.escape( g.circ_id ),
105                                 'billwizard',
106                                 'chrome,resizable,modal'
107                         );
108                 }
109
110         ]]>
111         </script>
112
113         <groupbox flex="1" style="overflow: auto;">
114                 <hbox>
115                         <label id="patron_name" class="patronNameLarge"/>
116                         <textbox id="barcode" class="plain" readonly="true" onclick="this.select()"/>
117                         <spacer flex="1"/>
118                         <button id="add_billing" disabled="true" label="Add Billing" oncommand="g.add_billing();"/>
119                 </hbox>
120                 <grid flex="1">
121                         <columns>
122                                 <column/>
123                                 <column flex="1"/>
124                                 <column/>
125                                 <column flex="1"/>
126                                 <column/>
127                                 <column flex="1"/>
128                         </columns>
129                         <rows>
130                                 <row>
131                                         <label style="font-weight: bold" value="Circ Id"/><label id="id"/>
132                                         <label style="font-weight: bold" value="Renewal"/><label id="renewal"/>
133                                         <label style="font-weight: bold" value="Stop Fines Reason"/><label id="stop_fines"/>
134                                 </row>
135                                 <row>
136                                         <label style="font-weight: bold" value="Check Out Lib"/><label id="circ_lib"/>
137                                         <label style="font-weight: bold" value="Check Out Time"/><label id="xact_start"/>
138                                         <label style="font-weight: bold" value="Check Out Staff ID"/><label id="circ_staff"/>
139                                 </row>
140                                 <row>
141                                         <label style="font-weight: bold" value="Check In Lib"/><label id="checkin_lib"/>
142                                         <label style="font-weight: bold" value="Check In Time"/><label id="checkin_time"/>
143                                         <label style="font-weight: bold" value="Check In Staff ID"/><label id="checkin_staff"/>
144                                 </row>
145                         </rows>
146                 </grid>
147         </groupbox>
148
149 </window>
150