]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/xul/staff_client/server/patron/patron_barcode_entry.xul
sometimes patron_display?session=undefined happens
[Evergreen.git] / Open-ILS / xul / staff_client / server / patron / 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 overlay 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_display.xul');
38
39                                 g.cgi = new CGI();
40                                 var session = g.cgi.param('session');
41
42                                 var tb = document.getElementById('barcode_tb');
43                                 tb.addEventListener(
44                                         'keypress',
45                                         function(ev) {
46                                                 if (ev.keyCode == 13 || ev.keyCode == 77) {
47                                                         spawn(session);
48                                                 }
49                                         },
50                                         false
51                                 );
52                                 tb.focus();
53         
54                         } catch(E) {
55                                 var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
56                                         "system administrator or software developer the following:\n" + E + '\n';
57                                 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
58                                 alert(err_msg);
59                         }
60                 }
61
62                 function spawn(session) {
63                         var tb = document.getElementById('barcode_tb');
64                         var barcode = tb.value;
65
66                         location.href = '/xul/server/patron/patron_display.xul?session=' 
67                                 + window.escape(session) + '&barcode=' + window.escape(barcode);
68                 }
69
70         ]]>
71         </script>
72
73         <vbox flex="1" class="my_overflow">
74                 <groupbox orient="vertical" flex="1">
75                         <caption label="Enter Patron Barcode" />
76                         <hbox>
77                                 <label value="Patron Barcode:" accesskey="B" control="barcode_tb"/>
78                                 <textbox id="barcode_tb" />
79                                 <button label="Submit" accesskey="S" oncommand="spawn();"/>
80                         </hbox>
81                         <hbox>
82                                 <label id="status"/>
83                         </hbox>
84                 </groupbox>
85         </vbox>
86
87 </window>
88