]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/xul/staff_client/server/patron/search_form.xul
43a4fde48a404311e4bdcc4fd9d2ddfa2685e070
[working/Evergreen.git] / Open-ILS / xul / staff_client / server / patron / search_form.xul
1 <?xml version="1.0"?>
2 <!-- Application: Evergreen Staff Client -->
3 <!-- Screen: Patron Display -->
4
5 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
6 <!-- STYLESHEETS -->
7 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
8 <?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
9 <?xml-stylesheet href="/xul/server/skin/patron_display.css" type="text/css"?>
10
11 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
12 <!-- LOCALIZATION -->
13 <!DOCTYPE window PUBLIC "" ""[
14     <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
15 ]>
16
17 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
18 <!-- OVERLAYS -->
19 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
20 <?xul-overlay href="/xul/server/patron/search_form_overlay.xul"?>
21
22 <window id="patron_search_form_win" 
23     onload="try { my_init(); font_helper(); persist_helper(); } catch(E) { alert(E); }"
24     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
25
26     <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
27     <!-- BEHAVIOR -->
28         <script type="text/javascript">var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};</script>
29         <scripts id="openils_util_scripts"/>
30
31     <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
32     <script>
33     <![CDATA[
34         function $(id) { return document.getElementById(id); }
35         
36         function my_init() {
37             try {
38                 if (typeof JSAN == 'undefined') { throw( $("commonStrings").getString('common.jsan.missing') ); }
39                 JSAN.errorLevel = "die"; // none, warn, or die
40                 JSAN.addRepository('/xul/server/');
41                 JSAN.use('util.error'); g.error = new util.error();
42                 g.error.sdump('D_TRACE','my_init() for patron_search_form.xul');
43
44                 g.cgi = new CGI();
45                 var keys = g.cgi.keys();
46                 var query = {};
47                 for (var i = 0; i < keys.length; i++) {
48                     query[keys[i]] = g.cgi.param(keys[i]);
49                 }
50                 if (xulG.query) {
51                     for (var i in xulG.query) {
52                         if (typeof xulG.query[i] == 'object') { xulG.query[i] = xulG.query[i].value; }
53                         query[i] = xulG.query[i];
54                     }
55                 }
56
57                 JSAN.use('patron.search_form'); g.search_form = new patron.search_form();
58                 g.search_form.init( { 'query' : query } );
59
60                 if (g.cgi.param('doit')||xulG.doit) {
61                     g.search_form.submit();
62                 }
63     
64             } catch(E) {
65                 var err_msg = $("commonStrings").getFormattedString('common.exception', ['patron/search_form.xul', E]);
66                 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
67                 alert(err_msg);
68             }
69         }
70         
71         function default_focus() {
72             setTimeout(
73                 function() {
74                     try {
75                         document.getElementById('family_name').focus();
76                     } catch(E) {
77                         g.error.sdump('D_ERROR','default_focus(): ' + js2JSON(E));
78                     }
79                 }, 0
80             );
81         }
82
83
84     ]]>
85     </script>
86     
87     <messagecatalog id="patronStrings" src="/xul/server/locale/<!--#echo var='locale'-->/patron.properties"/>
88
89     <commandset id="patron_search_form_cmds">
90     </commandset>
91
92     <box id="patron_search_form_main" />
93
94 </window>
95