]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/xul/staff_client/server/patron/patron_barcode_entry.xul
toward patron display
[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 window SYSTEM "menu_frame.dtd">
13
14 <window id="patron_barcode_entry_win" 
15         onload="my_init()"
16         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
17
18         <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
19         <!-- BEHAVIOR -->
20         <script type="text/javascript">var myPackageDir = 'evergreen'; var IAMXUL = true; var g = {};</script>
21         <scripts id="openils_util_scripts"/>
22
23         <script>
24         <![CDATA[
25                 function my_init() {
26                         try {
27                                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
28                                 if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
29                                 JSAN.errorLevel = "die"; // none, warn, or die
30                                 JSAN.addRepository('/xul/server/');
31                                 JSAN.use('util.error'); g.error = new util.error();
32                                 g.error.sdump('D_TRACE','my_init() for patron_display.xul');
33
34                                 g.cgi = new CGI();
35
36                                 var tb = document.getElementById('barcode_tb');
37                                 tb.addEventListener(
38                                         'keypress',
39                                         function(ev) {
40                                                 if (ev.keyCode == 13 || ev.keyCode == 77) {
41                                                         spawn(g.cgi.params('session'));
42                                                 }
43                                         },
44                                         false
45                                 );
46                                 tb.focus();
47         
48                         } catch(E) {
49                                 var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
50                                         "system administrator or software developer the following:\n" + E + '\n';
51                                 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
52                                 alert(err_msg);
53                         }
54                 }
55
56                 function spawn(session) {
57                         var tb = document.getElementById('barcode_tb');
58                         var barcode = tb.value;
59
60                         location.href = '/xul/server/patron/patron_display.xul?session=' + session + '&barcode=' + barcode;
61                 }
62
63         ]]>
64         </script>
65
66         <vbox flex="1" class="my_overflow">
67                 <groupbox orient="vertical" flex="1">
68                         <caption label="Enter Patron Barcode" />
69                         <hbox>
70                                 <label value="Patron Barcode:" accesskey="B" control="barcode_tb"/>
71                                 <textbox id="barcode_tb" />
72                                 <button label="Submit" accesskey="S" oncommand="spawn();"/>
73                         </hbox>
74                         <hbox>
75                                 <label id="status"/>
76                         </hbox>
77                 </groupbox>
78         </vbox>
79
80 </window>
81