2 <!-- Application: Evergreen Staff Client -->
3 <!-- Screen: Retrieve Patron By Barcode -->
5 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
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"?>
11 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
13 <!DOCTYPE window PUBLIC "" ""[
14 <!--#include virtual="/opac/locale/en-US/lang.dtd"-->
17 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
19 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
21 <window id="patron_barcode_entry_win"
22 onload="try { my_init(); font_helper(); } catch(E) { alert(E); }"
23 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
25 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
27 <script type="text/javascript">var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};</script>
28 <scripts id="openils_util_scripts"/>
30 <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
35 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
36 if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
37 JSAN.errorLevel = "die"; // none, warn, or die
38 JSAN.addRepository('/xul/server/');
39 JSAN.use('util.error'); g.error = new util.error();
40 g.error.sdump('D_TRACE','my_init() for patron/barcode_entry.xul');
44 var tb = document.getElementById('barcode_tb');
48 if (ev.keyCode == 13 || ev.keyCode == 77) {
60 if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') {
61 try { window.xulG.set_tab_name('Check Out'); } catch(E) { alert(E); }
64 if (g.cgi.param('error')) {
65 var error = g.cgi.param('error');
70 var err_msg = "!! This software has encountered an error. Please tell your friendly " +
71 "system administrator or software developer the following:\n" + E + '\n';
72 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
80 JSAN.use('util.sound'); var sound = new util.sound();
81 tb = document.getElementById('barcode_tb');
82 var barcode = tb.value;
84 barcode = String( barcode ).replace( /\s+/g, '' );
86 if (!barcode) { sound.bad(); add_msg('No barcode entered.'); tb.select(); tb.focus(); return; }
88 JSAN.use('util.network'); var net = new util.network();
91 document.getElementById('progress').setAttribute('hidden','false');
92 net.simple_request('PATRON_BARCODE_EXISTS',[ ses(), barcode ],
94 document.getElementById('progress').setAttribute('hidden','true');
95 tb.disabled = false; tb.select(); tb.focus(); ;
96 var robj = req.getResultObject();
97 if (typeof robj.ilsevent != 'undefined') {
99 add_msg('Problem retrieving ' + barcode + '. Please report this message: \n' + js2JSON(robj));
101 } else if (robj == 0) {
103 add_msg('Barcode ' + barcode + ' not found.');
113 tb.select(); tb.focus();
114 g.error.standard_unexpected_error_alert('barcode_entry.xul',E);
118 function add_msg(text) {
119 var x = document.getElementById('status');
120 var d = document.createElement('description');
122 d.appendChild( document.createTextNode( text ) );
123 d.setAttribute('style','color: red');
126 function spawn(barcode) {
128 var loc = urls.XUL_PATRON_DISPLAY; // + '?barcode=' + window.escape(barcode);
130 if (typeof window.xulG == 'object' && typeof window.xulG.set_tab == 'function') {
132 window.xulG.set_tab( loc, {}, { 'barcode' : barcode } );
135 location.href = loc + '?barcode=' + window.escape(barcode);
139 g.error.standard_unexpected_error_alert('spawning patron display',E);
143 function default_focus() { try { setTimeout( function() { document.getElementById('barcode_tb').focus(); }, 0); } catch(E) {} }
147 <vbox flex="1" class="my_overflow">
148 <groupbox orient="vertical" flex="1">
149 <caption label="Retrieve Patron" />
151 <label value="Barcode:" accesskey="B" control="barcode_tb"/>
152 <textbox id="barcode_tb" />
153 <button label="Submit" accesskey="S" oncommand="submit();"/>
155 <label value="Retrieving..." style="color: green" id="progress" hidden="true"/>