]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/xul/staff_client/server/patron/holds.xul
LP#1086458: clean up after event listeners in circ/patron interface
[working/Evergreen.git] / Open-ILS / xul / staff_client / server / patron / holds.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/circ.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/holds_overlay.xul"?>
21
22 <window id="holds_win" active="true" 
23     onload="try { font_helper(); persist_helper(); my_init(); } catch(E) { alert(E); }"
24     onunload="try { my_cleanup(); persist_helper_cleanup(); } catch(E) { alert(E); }"
25     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
26
27     <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
28     <!-- BEHAVIOR -->
29         <script type="text/javascript">var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};</script>
30         <scripts id="openils_util_scripts"/>
31
32     <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
33     <script type="text/javascript" src="/xul/server/util/network.js"/>
34     <script type="text/javascript" src="/xul/server/patron/holds.js"/>
35     <script>
36     <![CDATA[
37         function $(id) { return document.getElementById(id); }
38         
39         function my_init() {
40             try {
41                 if (typeof JSAN == 'undefined') { throw( $("commonStrings").getString('common.jsan.missing') ); }
42                 JSAN.errorLevel = "die"; // none, warn, or die
43                 JSAN.addRepository('/xul/server/');
44                 JSAN.use('util.error'); g.error = new util.error();
45                 g.error.sdump('D_TRACE','my_init() for holds.xul');
46
47                 JSAN.use('patron.holds'); g.holds = new patron.holds();
48                 g.holds.init( 
49                     { 
50                         'patron_id' : xul_param('patron_id'), 
51                         'patron_barcode' : xul_param('patron_barcode'), 
52                         'docid' : xul_param('docid'),
53                         'shelf' : xul_param('shelf'),
54                         'pull' : xul_param('pull'),
55                         'clear' : xul_param('clear')
56                     } 
57                 );
58                 window.refresh = function(p) { g.holds.list.clear(); g.holds.retrieve(p); }
59
60                 default_focus();
61
62             } catch(E) {
63                 var err_msg = $("commonStrings").getFormattedString('common.exception', ['patron/holds.xul', E]);
64                 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
65                 alert(err_msg);
66             }
67         }
68
69         function my_cleanup() {
70             try {
71                 g.holds.cleanup();
72             } catch(E) {
73                 var err_msg = $("commonStrings").getFormattedString('common.exception', ['patron/holds.xul', E]);
74                 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
75                 alert(err_msg);
76             }
77         }
78
79         function default_focus() { try { document.getElementById('holds_print').focus(); } catch(E) { } }
80
81     ]]>
82     </script>
83
84     <messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale' -->/circ.properties"/>
85     <messagecatalog id="catStrings" src="/xul/server/locale/<!--#echo var='locale' -->/cat.properties"/>
86     <messagecatalog id="patronStrings" src="/xul/server/locale/<!--#echo var='locale' -->/patron.properties"/>
87
88         <commandset id="holds_cmds" />
89
90     <popupset id="holds_popupset"/>
91
92     <box id="holds_main" />
93
94 </window>
95