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