]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/xul/staff_client/server/patron/barcode_entry.xul
receipt printing
[Evergreen.git] / Open-ILS / xul / staff_client / server / patron / barcode_entry.xul
1 <?xml version="1.0"?>
2 <!-- Application: Evergreen Staff Client -->
3 <!-- Screen: Retrieve Patron By Barcode -->
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
11 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
12 <!-- LOCALIZATION -->
13 <!DOCTYPE window SYSTEM "chrome://open_ils_staff_client/locale/lang.dtd">
14
15 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
16 <!-- OVERLAYS -->
17 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
18
19 <window id="patron_barcode_entry_win" 
20         onload="my_init()"
21         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
22
23         <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
24         <!-- BEHAVIOR -->
25         <script type="text/javascript">var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};</script>
26         <scripts id="openils_util_scripts"/>
27
28         <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
29         <script>
30         <![CDATA[
31                 function my_init() {
32                         try {
33                                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
34                                 if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
35                                 JSAN.errorLevel = "die"; // none, warn, or die
36                                 JSAN.addRepository('/xul/server/');
37                                 JSAN.use('util.error'); g.error = new util.error();
38                                 g.error.sdump('D_TRACE','my_init() for patron/barcode_entry.xul');
39
40                                 g.cgi = new CGI();
41                                 var session = g.cgi.param('session');
42                                 if (!session) { 
43                                         g.error.sdump('D_ERROR','session = ' + session + '\n'
44                                                 + 'g.cgi._keys = ' + g.cgi._keys + '\n'
45                                                 + 'g.cgi.param("session") = ' + g.cgi.param('session') + '\n'
46                                                 + 'location = ' + location + '\n'
47                                                 + 'location.href = ' + location.href + '\n'
48                                         );
49                                         alert('pause.  session is ' + session ); 
50                                 }
51
52                                 var tb = document.getElementById('barcode_tb');
53                                 tb.addEventListener(
54                                         'keypress',
55                                         function(ev) {
56                                                 if (ev.keyCode == 13 || ev.keyCode == 77) {
57                                                         setTimeout(
58                                                                 function() {
59                                                                         spawn();
60                                                                 }, 0
61                                                         );
62                                                 }
63                                         },
64                                         false
65                                 );
66                                 tb.focus();
67         
68                                 if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') {
69                                         try { window.xulG.set_tab_name('Patron Scan'); } catch(E) { alert(E); }
70                                 }
71
72                         } catch(E) {
73                                 var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
74                                         "system administrator or software developer the following:\n" + E + '\n';
75                                 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
76                                 alert(err_msg);
77                         }
78                 }
79
80                 function spawn() {
81                         try {
82                                 JSAN.use('util.sound'); var sound = new util.sound(); sound.good();
83                                 var tb = document.getElementById('barcode_tb');
84                                 var barcode = tb.value;
85
86                                 var loc = urls.XUL_PATRON_DISPLAY + '?session=' + 
87                                         window.escape(g.cgi.param('session')) + '&barcode=' + window.escape(barcode);
88
89                                 if (typeof window.xulG == 'object' && typeof window.xulG.set_tab == 'function') {
90
91                                         window.xulG.set_tab( loc );
92                                 } else {
93
94                                         location.href = loc;
95                                 }
96                         } catch(E) {
97                                 var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
98                                         "system administrator or software developer the following:\n" + E + '\n';
99                                 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
100                                 alert(err_msg);
101                         }
102                 }
103
104         ]]>
105         </script>
106
107         <vbox flex="1" class="my_overflow">
108                 <groupbox orient="vertical" flex="1">
109                         <caption label="Retrieve Patron" />
110                         <hbox>
111                                 <label value="Barcode:" accesskey="B" control="barcode_tb"/>
112                                 <textbox id="barcode_tb" />
113                                 <button label="Submit" accesskey="S" oncommand="spawn();"/>
114                         </hbox>
115                         <hbox>
116                                 <label id="status"/>
117                         </hbox>
118                 </groupbox>
119         </vbox>
120
121 </window>
122