]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/xul/staff_client/server/patron/adv_barcode_entry.xul
adv user editor entry point and let user editor retrieve users by barcode
[Evergreen.git] / Open-ILS / xul / staff_client / server / patron / adv_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('User Scan for Advanced Edit'); } 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_REMOTE_BROWSER + '?url=' + window.escape( 
86                                         urls.XUL_PATRON_EDIT
87                                         + '?ses=' + window.escape( g.cgi.param('session') )
88                                         + '&adv=1'
89                                         + '&barcode=' + window.escape( barcode )
90                                 );
91
92                                 if (typeof window.xulG == 'object' && typeof window.xulG.set_tab == 'function') {
93
94                                         window.xulG.set_tab( loc, {}, { 'show_print_button' : true, } );
95
96                                 } else {
97
98                                         location.href = loc;
99                                 }
100
101                         } catch(E) {
102                                 var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
103                                         "system administrator or software developer the following:\n" + E + '\n';
104                                 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
105                                 alert(err_msg);
106                         }
107                 }
108
109         ]]>
110         </script>
111
112         <vbox flex="1" class="my_overflow">
113                 <groupbox orient="vertical" flex="1">
114                         <caption label="Retrieve Patron" />
115                         <hbox>
116                                 <label value="Barcode:" accesskey="B" control="barcode_tb"/>
117                                 <textbox id="barcode_tb" />
118                                 <button label="Submit" accesskey="S" oncommand="spawn();"/>
119                         </hbox>
120                         <hbox>
121                                 <label id="status"/>
122                         </hbox>
123                 </groupbox>
124         </vbox>
125
126 </window>
127