]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/xul/staff_client/server/serial/select_aou.xul
Teach the i18n Makefile how to handle serial.properties
[working/Evergreen.git] / Open-ILS / xul / staff_client / server / serial / select_aou.xul
1 <?xml version="1.0"?>
2 <!-- Application: Evergreen Staff Client -->
3 <!-- Screen: Select AOU Dialog -->
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 <?xml-stylesheet href="/xul/server/skin/cat.css" type="text/css"?>
11
12 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
13 <!-- LOCALIZATION -->
14 <!DOCTYPE window PUBLIC "" ""[
15         <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
16 ]>
17
18 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
19 <!-- OVERLAYS -->
20 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
21
22 <window id="select_aou_win" title="Select Org Unit"
23         onload="try { my_init(); font_helper(); persist_helper(); } catch(E) { alert(E); }" oils_persist="height width"
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                 function $c(n) { return document.createElement(n); }
36
37                 function my_init() {
38                         try {
39                                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
40                 if (typeof JSAN == 'undefined') { throw( $("commonStrings").getString('common.jsan.missing') ); }
41                                 JSAN.errorLevel = "die"; // none, warn, or die
42                                 JSAN.addRepository('/xul/server/');
43                                 JSAN.use('util.error'); g.error = new util.error();
44                                 g.error.sdump('D_TRACE','my_init() for serial/select_aou.xul');
45
46                 JSAN.use('util.file'); JSAN.use('util.widgets');
47
48                 var file; var list_data; var ml;
49
50                 file = new util.file('offline_ou_list');
51                 var server_unadorned = xul_param('server_unadorned',{'modal_xulG':true});
52                 if (file._file.exists()) {
53                     list_data = file.get_object(); file.close();
54                     ml = util.widgets.make_menulist( list_data[0], list_data[1] );
55                     ml.setAttribute('id','lib_menu');
56                     document.getElementById('x_lib_menu').appendChild(ml);
57                     ml.addEventListener(
58                         'command',
59                         function(ev) {
60                             //if (document.getElementById('refresh_button')) document.getElementById('refresh_button').focus();
61                             JSAN.use('util.file'); var file = new util.file('mfhd_create_prefs.'+server_unadorned);
62                             util.widgets.save_attributes(file, { 'lib_menu' : [ 'value' ] });
63                         },
64                         false
65                     );
66                 } else {
67                     throw(document.getElementById('catStrings').getString('staff.cat.copy_browser.missing_library') + '\n');  //TODO: different error?
68                 }
69
70                 file = new util.file('mfhd_create_prefs.'+server_unadorned);
71                 util.widgets.load_attributes(file);
72                 ml.value = ml.getAttribute('value');
73             } catch(E) {
74                 //TODO: better error
75                 g.error.standard_unexpected_error_alert('', E);
76             }
77         }
78
79         g.select_aou = function() {
80             update_modal_xulG({'create_mfhd_aou' : $('lib_menu').value});
81             window.close();
82         }
83
84         ]]>
85         </script>
86         
87         <messagecatalog id="catStrings" src="/xul/server/locale/<!--#echo var='locale'-->/cat.properties" />
88
89         <vbox flex="1" style="overflow: auto">
90         <groupbox flex="1">
91 <!--TODO: label strings -->
92                 <caption label="Select an Org Unit"/>
93                 <description id="desc">Please select an Org Unit</description>
94         <hbox id="x_lib_menu"/>
95                 <hbox>
96                         <button label="Select"
97                                 accesskey="s" oncommand="g.select_aou()"/>
98                         <button label="&staff.cat.record_buckets_quick.cancel.label;"
99                                 accesskey="&staff.cat.record_buckets_quick.cancel.accesskey;" oncommand="window.close()"/>
100                 </hbox>
101                 <hbox>
102                 </hbox>
103         </groupbox>
104         </vbox>
105
106 </window>
107