]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/xul/staff_client/server/patron/barcode_entry.xul
another great renaming. package names have to be lowercase apparently
[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/open_ils_staff_client.css" type="text/css"?>
9 <?xml-stylesheet href="/xul/server/skin/open_ils_staff_client.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                                 var tb = document.getElementById('barcode_tb');
83                                 var barcode = tb.value;
84
85                                 var loc = urls.XUL_PATRON_DISPLAY + '?session=' + 
86                                         window.escape(g.cgi.param('session')) + '&barcode=' + window.escape(barcode);
87
88                                 if (typeof window.xulG == 'object' && typeof window.xulG.set_tab == 'function') {
89
90                                         window.xulG.set_tab( loc );
91                                 } else {
92
93                                         location.href = loc;
94                                 }
95                         } catch(E) {
96                                 var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
97                                         "system administrator or software developer the following:\n" + E + '\n';
98                                 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
99                                 alert(err_msg);
100                         }
101                 }
102
103         ]]>
104         </script>
105
106         <vbox flex="1" class="my_overflow">
107                 <groupbox orient="vertical" flex="1">
108                         <caption label="Retrieve Patron" />
109                         <hbox>
110                                 <label value="Barcode:" accesskey="B" control="barcode_tb"/>
111                                 <textbox id="barcode_tb" />
112                                 <button label="Submit" accesskey="S" oncommand="spawn();"/>
113                         </hbox>
114                         <hbox>
115                                 <label id="status"/>
116                         </hbox>
117                 </groupbox>
118         </vbox>
119
120 </window>
121