]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/xul/staff_client/server/serial/select_unit.xul
Teach the i18n Makefile how to handle serial.properties
[working/Evergreen.git] / Open-ILS / xul / staff_client / server / serial / select_unit.xul
1 <?xml version="1.0"?>
2 <!-- Application: Evergreen Staff Client -->
3 <!-- Screen: Select Serial Unit 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_serial_unit_win" title="Select Serial 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
36                 function my_init() {
37                         try {
38                                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
39                 if (typeof JSAN == 'undefined') { throw( $("commonStrings").getString('common.jsan.missing') ); }
40                                 JSAN.errorLevel = "die"; // none, warn, or die
41                                 JSAN.addRepository('/xul/server/');
42                                 JSAN.use('util.error'); g.error = new util.error();
43                                 g.error.sdump('D_TRACE','my_init() for serial/select_unit.xul');
44
45                 JSAN.use('util.widgets');
46
47                 var ml;
48                                 JSAN.use('util.network'); g.network = new util.network();
49                 var sdist_ids = xul_param('sdist_ids',{'modal_xulG':true});
50                 //TODO: unit_list.retrieve option for binding units only (that is, units containing bound items only)
51                 var robj = g.network.request(
52                     'open-ils.serial',
53                     'open-ils.serial.unit_list.retrieve',
54                     sdist_ids
55                 );
56                 if (typeof robj.ilsevent != 'undefined') throw(robj);
57                 ml = util.widgets.make_menulist(robj);
58                 ml.setAttribute('id','unit_menu');
59                 document.getElementById('x_unit_menu').appendChild(ml);
60             } catch(E) {
61                 //TODO: better error
62                 g.error.standard_unexpected_error_alert('', E);
63             }
64         }
65
66         g.select_unit = function() {
67             var selection = JSON2js($('unit_menu').value);
68             selection.label = $('unit_menu').selectedItem.label;
69             update_modal_xulG({'sunit_selection' : selection});
70             window.close();
71         }
72
73         ]]>
74         </script>
75         
76         <messagecatalog id="catStrings" src="/xul/server/locale/<!--#echo var='locale'-->/cat.properties" />
77
78         <vbox flex="1" style="overflow: auto">
79         <groupbox flex="1">
80 <!--TODO: label strings -->
81                 <caption label="Select a Serial Unit"/>
82                 <description id="desc">Please select a Serial Unit</description>
83         <hbox id="x_unit_menu"/>
84                 <hbox>
85                         <button label="Select"
86                                 accesskey="s" oncommand="g.select_unit()"/>
87                         <button label="&staff.cat.record_buckets_quick.cancel.label;"
88                                 accesskey="&staff.cat.record_buckets_quick.cancel.accesskey;" oncommand="window.close()"/>
89                 </hbox>
90                 <hbox>
91                 </hbox>
92         </groupbox>
93         </vbox>
94
95 </window>
96