]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/xul/staff_client/server/circ/pre_cat_fields.xul
Improve Firefox/XULRunner Support
[Evergreen.git] / Open-ILS / xul / staff_client / server / circ / pre_cat_fields.xul
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- Application: Evergreen Staff Client -->
3 <!-- Screen: Patron Display -->
4 <!--
5  vim:noet:sw=4:ts=4:
6 -->
7
8 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
9 <!-- STYLESHEETS -->
10 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
11 <?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
12
13 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
14 <!-- LOCALIZATION -->
15 <!DOCTYPE window PUBLIC "" ""[
16     <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
17 ]>
18
19 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
20 <!-- OVERLAYS -->
21 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
22
23 <window id="pre_cat_fields" title="&staff.circ.pre_cat.window.title;"
24     orient="vertical" style="overflow: auto" oils_persist="height width sizemode"
25     onload="try{ my_init(); font_helper(); persist_helper(); }catch(E){alert(E);}"
26     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
27
28     <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
29     <!-- BEHAVIOR -->
30         <script type="text/javascript">var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};</script>
31         <scripts id="openils_util_scripts"/>
32
33     <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
34
35     <script>
36     <![CDATA[
37
38         function my_init() {
39             if (typeof JSAN == 'undefined') {
40                 throw( document.getElementById("commonStrings").getString('common.jsan.missing') );
41             }
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 pre_cat_fields.xul');
46             JSAN.use('OpenILS.data'); g.data = new OpenILS.data();
47             g.data.init({'via':'stash'});
48
49             g.data.precat_dummy_title = '';
50             g.data.precat_dummy_author = '';
51             g.data.precat_dummy_isbn = '';
52             g.data.precat_submit = 'cancel';
53             g.data.stash('precat_submit');
54
55             JSAN.use('util.widgets'); JSAN.use('util.functional');
56             var x = util.widgets.make_menulist( 
57                 [ [ $("catStrings").getString("staff.cat.copy_editor.field.unset_or_null"), "<HACK:KLUDGE:NULL>" ] ].concat( 
58                     util.functional.map_list(
59                         g.data.list.ccm,
60                         function(obj) {
61                             return [
62                                 document.getElementById('commonStrings').getFormattedString('staff.circ_modifier.display',[obj.code(),obj.name(),obj.description()]),
63                                 obj.code()
64                             ];
65                         }
66                     ).sort() 
67                 ) 
68             );
69             x.setAttribute('id','dummy_circ_modifier');
70             document.getElementById('placeholder').appendChild(x);
71             if (g.data.precat_circ_modifier) {
72                 x.setAttribute('value', g.data.precat_circ_modifier);
73                 x.value = g.data.precat_circ_modifier;
74             }
75             document.getElementById('dummy_title').focus();
76         }
77
78         function my_finish() {
79             g.data.precat_dummy_title = document.getElementById('dummy_title').value;
80             g.data.precat_dummy_author = document.getElementById('dummy_author').value;
81             g.data.precat_dummy_isbn = document.getElementById('dummy_isbn').value;
82             var cm = document.getElementById('dummy_circ_modifier').value;
83             if (cm == '<HACK:KLUDGE:NULL>') cm = null;
84             g.data.precat_circ_modifier = cm;
85             g.data.precat_submit = 'go';
86             g.data.stash('precat_dummy_title','precat_dummy_author','precat_dummy_isbn','precat_circ_modifier','precat_submit');
87             window.close();
88         }
89
90     ]]>
91     </script>
92
93     <messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale'-->/circ.properties" />
94     <messagecatalog id="catStrings" src="/xul/server/locale/<!--#echo var='locale'-->/cat.properties" />
95
96     <groupbox flex="1" style="overflow: auto">
97         <caption label="&staff.circ.pre_cat.caption.label;"/>
98         <grid>
99             <columns><column /><column flex="1"/></columns>
100             <rows>
101                 <row>
102                     <label value="&staff.circ.pre_cat.dummy_title.label;" accesskey="&staff.circ.pre_cat.dummy_title.accesskey;" control="dummy_title"/>
103                     <textbox id="dummy_title" context="clipboard"/>
104                 </row>
105                 <row>
106                     <label value="&staff.circ.pre_cat.dummy_author.label;" accesskey="&staff.circ.pre_cat.dummy_author.accesskey;" control="dummy_author"/>
107                     <textbox id="dummy_author" context="clipboard"/>
108                 </row>
109                 <row>
110                     <label value="&staff.circ.pre_cat.dummy_isbn.label;" accesskey="&staff.circ.pre_cat.dummy_isbn.accesskey;" control="dummy_isbn"/>
111                     <textbox id="dummy_isbn" context="clipboard"/>
112                 </row>
113                 <row>
114                     <label value="&staff.circ.pre_cat.dummy_circ_modifier.label;" accesskey="&staff.circ.pre_cat.dummy_circ_modifier.accesskey;" control="dummy_circ_modifier"/>
115                     <box id="placeholder" />
116                 </row>
117             </rows>
118         </grid>
119         <hbox>
120             <spacer flex="1"/>
121             <button label="&staff.circ.pre_cat.cancel.label;" oncommand="window.close()" accesskey="&staff.circ.pre_cat.cancel.accesskey;"/>
122             <button label="&staff.circ.pre_cat.checkout.label;" oncommand="my_finish();" accesskey="&staff.circ.pre_cat.checkout.accesskey;"/>
123         </hbox>
124     </groupbox>
125
126 </window>
127
128