]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/xul/staff_client/server/serial/select_unit.xul
ad513c916dd428681d191fc0191c2887b24ae5b0
[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                 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 serial/select_unit.xul');
43
44                 JSAN.use('util.widgets');
45
46                 var ml;
47                                 JSAN.use('util.network'); g.network = new util.network();
48                 var sdist_ids = xul_param('sdist_ids',{'modal_xulG':true});
49                 //TODO: unit_list.retrieve option for binding units only (that is, units containing bound items only)
50                 var robj = g.network.request(
51                     'open-ils.serial',
52                     'open-ils.serial.unit_list.retrieve',
53                     sdist_ids
54                 );
55                 if (typeof robj.ilsevent != 'undefined') throw(robj);
56                 ml = util.widgets.make_menulist(robj);
57                 ml.setAttribute('id','unit_menu');
58                 document.getElementById('x_unit_menu').appendChild(ml);
59             } catch(E) {
60                 //TODO: better error
61                 g.error.standard_unexpected_error_alert('', E);
62             }
63         }
64
65         g.select_unit = function() {
66             var selection = JSON2js($('unit_menu').value);
67             selection.label = $('unit_menu').selectedItem.label;
68             update_modal_xulG({'sunit_selection' : selection});
69             window.close();
70         }
71
72         ]]>
73         </script>
74         
75         <messagecatalog id="catStrings" src="/xul/server/locale/<!--#echo var='locale'-->/cat.properties" />
76
77         <vbox flex="1" style="overflow: auto">
78         <groupbox flex="1">
79 <!--TODO: label strings -->
80                 <caption label="Select a Serial Unit"/>
81                 <description id="desc">Please select a Serial Unit</description>
82         <hbox id="x_unit_menu"/>
83                 <hbox>
84                         <button label="Select"
85                                 accesskey="s" oncommand="g.select_unit()"/>
86                         <button label="&staff.cat.record_buckets_quick.cancel.label;"
87                                 accesskey="&staff.cat.record_buckets_quick.cancel.accesskey;" oncommand="window.close()"/>
88                 </hbox>
89                 <hbox>
90                 </hbox>
91         </groupbox>
92         </vbox>
93
94 </window>
95