Moving inline script blocks to <head> where possible
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / aqbudget.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; System Administration &rsaquo; Budgets</title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 <!-- Additions to enable Calendar system -->
5 <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR name="themelang" -->/lib/calendar/calendar-system.css" />
6 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/calendar/calendar.js"></script>
7 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/calendar/calendar-en.js"></script>
8 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/calendar/calendar-setup.js"></script>
9 <!-- End of additions -->
10 <!-- TMPL_IF name="add_form" -->
11 <script type="text/javascript">
12         //
13         function isNotNull(f,noalert) {
14                 if (f.value.length ==0) {
15    return false;
16                 }
17                 return true;
18         }
19         //
20         function toUC(f) {
21                 var x=f.value.toUpperCase();
22                 f.value=x;
23                 return true;
24         }
25         //
26         function isNum(v,maybenull) {
27         var n = new Number(v.value);
28         if (isNaN(n)) {
29                 return false;
30                 }
31         if (maybenull==0 && v.value=='') {
32                 return false;
33         }
34         return true;
35         }
36         //
37         function isDate(f) {
38                 var t = Date.parse(f.value);
39                 if (isNaN(t)) {
40                         return false;
41                 }
42         }
43         //
44         function Check(f) {
45                 var ok=1;
46                 var _alertString="";
47                 var alertString2;
48                 if (f.bookfundid.value.length==0) {
49                         _alertString += "- bookfundid missing\n";
50                 }
51                 if (!(isNotNull(window.document.Aform.budgetamount,1))) {
52                         _alertString += "- Budget missing\n";
53                 }
54                 if (_alertString.length==0) {
55                         document.Aform.submit();
56                 } else {
57                         alertString2 = "Form not submitted because of the following problem(s)\n";
58                         alertString2 += "------------------------------------------------------------------------------------\n\n";
59                         alertString2 += _alertString;
60                         alert(alertString2);
61                 }
62         }
63 </script>
64 <!-- /TMPL_IF -->
65 </head>
66 <body>
67 <!-- TMPL_INCLUDE NAME="header.inc" -->
68
69
70
71 <!-- TMPL_INCLUDE NAME="menu-admin.inc" -->
72
73 <div id="doc3" class="yui-t2">
74    
75    <div id="bd">
76         <div id="yui-main">
77         <div class="yui-b"><div class="yui-g">
78
79 <ul id="_informations">
80 <!-- TMPL_IF NAME="add_validate" -->
81   <li>Budget Data Recorded, return to <a href="<!-- TMPL_VAR name="script_name" -->">budget list</a></li>
82 <!-- /TMPL_IF --> <!-- add_validate -->
83
84 <!-- TMPL_IF name="delete_confirmed" -->
85   <li>Budget deleted, return to <a href="<!-- TMPL_VAR name="script_name" -->">budget list</a></li>
86 <!-- /TMPL_IF --> <!-- delete_confirmed -->
87 </ul>
88
89 <!-- TMPL_IF name="else" -->
90 <h1>Budget admin</h1>
91
92 <table>
93   <tr>
94     <th>Book fund</th>
95     <th>Branch</th>
96     <th>Start date</th>
97     <th>End date</th>
98     <th>Budget amount</th>
99     <th>Actions</th>
100   </tr>
101
102 <form action="/cgi-bin/koha/admin/aqbudget.pl" method="post">
103   <tr class="filter">
104     <td>
105       <select name="filter_bookfundid">
106         <option value="">----</option>
107     <!-- TMPL_LOOP name="filter_bookfundids" -->
108       <!-- TMPL_IF NAME="selected" -->
109         <option value="<!-- TMPL_VAR name="bookfundid" -->" selected="selected"><!-- TMPL_VAR name="bookfundid" --></option>
110       <!-- TMPL_ELSE -->
111         <option value="<!-- TMPL_VAR name="bookfundid" -->"><!-- TMPL_VAR name="bookfundid" --></option>
112       <!-- /TMPL_IF -->
113     <!-- /TMPL_LOOP -->
114       </select>
115     </td>
116     <td>
117       <select name="filter_branchcode">
118         <option value="">----</option>
119     <!-- TMPL_LOOP name="filter_branches" -->
120       <!-- TMPL_IF NAME="selected" -->
121         <option value="<!-- TMPL_VAR name="code" -->" selected="selected"><!-- TMPL_VAR name="name" --></option>
122       <!-- TMPL_ELSE -->
123         <option value="<!-- TMPL_VAR name="code" -->"><!-- TMPL_VAR name="name" --></option>
124       <!-- /TMPL_IF -->
125     <!-- /TMPL_LOOP -->
126       </select>
127     </td>
128     <td>
129       <select name="filter_startdate_sign">
130     <!-- TMPL_IF NAME="filter_startdate_sign_equal_selected" -->
131         <option value="=" selected="selected">=</option>
132     <!-- TMPL_ELSE -->
133         <option value="=">=</option>
134     <!-- /TMPL_IF -->
135
136     <!-- TMPL_IF NAME="filter_startdate_sign_superior_selected" -->
137         <option value="&gt;=" selected="selected">&gt;=</option>
138     <!-- TMPL_ELSE -->
139         <option value="&gt;=">&gt;=</option>
140     <!-- /TMPL_IF -->
141
142     <!-- TMPL_IF NAME="filter_startdate_sign_inferior_selected" -->
143         <option value="&lt;=" selected="selected">&lt;=</option>
144     <!-- TMPL_ELSE -->
145         <option value="&lt;=">&lt;=</option>
146     <!-- /TMPL_IF -->
147       </select>
148       <input type="text" size="10" id="filter_startdate" name="filter_startdate" value="<!-- TMPL_VAR Name="filter_startdate" -->" />
149       <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="filter_startdate_button" />
150       <script type="text/javascript">
151         Calendar.setup(
152           {
153             inputField : "filter_startdate",
154             ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
155             button : "filter_startdate_button"
156           }
157         );
158       </script>
159     </td>
160     <td>
161       <select name="filter_enddate_sign">
162     <!-- TMPL_IF NAME="filter_enddate_sign_equal_selected" -->
163         <option value="=" selected="selected">=</option>
164     <!-- TMPL_ELSE -->
165         <option value="=">=</option>
166     <!-- /TMPL_IF -->
167
168     <!-- TMPL_IF NAME="filter_enddate_sign_superior_selected" -->
169         <option value="&gt;=" selected="selected">&gt;=</option>
170     <!-- TMPL_ELSE -->
171         <option value="&gt;=">&gt;=</option>
172     <!-- /TMPL_IF -->
173
174     <!-- TMPL_IF NAME="filter_enddate_sign_inferior_selected" -->
175         <option value="&lt;=" selected="selected">&lt;=</option>
176     <!-- TMPL_ELSE -->
177         <option value="&lt;=">&lt;=</option>
178     <!-- /TMPL_IF -->
179       </select>
180       <input type="text" size="8" maxlength="10" id="filter_enddate" name="filter_enddate" value="<!-- TMPL_VAR Name="filter_enddate" -->" />
181       <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="filter_enddate_button" />
182       <script type="text/javascript">
183         Calendar.setup(
184           {
185             inputField : "filter_enddate",
186             ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
187             button : "filter_enddate_button"
188           }
189         );
190       </script>
191     </td>
192     <td>
193       <select name="filter_amount_sign">
194     <!-- TMPL_IF NAME="filter_amount_sign_equal_selected" -->
195         <option value="=" selected="selected">=</option>
196     <!-- TMPL_ELSE -->
197         <option value="=">=</option>
198     <!-- /TMPL_IF -->
199
200     <!-- TMPL_IF NAME="filter_amount_sign_superior_selected" -->
201         <option value="&gt;=" selected="selected">&gt;=</option>
202     <!-- TMPL_ELSE -->
203         <option value="&gt;=">&gt;=</option>
204     <!-- /TMPL_IF -->
205
206     <!-- TMPL_IF NAME="filter_amount_sign_inferior_selected" -->
207         <option value="&lt;=" selected="selected">&lt;=</option>
208     <!-- TMPL_ELSE -->
209         <option value="&lt;=">&lt;=</option>
210     <!-- /TMPL_IF -->
211       </select>
212       <input type="text" name="filter_amount" value="<!-- TMPL_VAR NAME="filter_amount" -->" size="8" />
213     </td>
214     <td>
215       <input type="submit" name="filter" value="Filter" />
216     </td>
217   </tr>
218 </form>
219   
220   <!-- TMPL_LOOP name="budget" -->
221     <!-- TMPL_IF NAME="toggle" -->
222   <tr class="highlight">
223     <!-- TMPL_ELSE -->
224   <tr>
225     <!-- /TMPL_IF -->
226     <td><!-- TMPL_VAR NAME="bookfundid" --></td>
227     <td><!-- TMPL_VAR NAME="branchname" --></td>
228     <td><!-- TMPL_VAR NAME="startdate" --></td>
229     <td><!-- TMPL_VAR NAME="enddate" --></td>
230     <td><!-- TMPL_VAR NAME="budgetamount" --></td>
231     <td>
232       <a href="/cgi-bin/koha/admin/aqbudget.pl?op=add_form&amp;aqbudgetid=<!-- TMPL_VAR NAME="aqbudgetid" -->">Edit</a>
233       <a href="/cgi-bin/koha/admin/aqbudget.pl?op=delete_confirm&amp;aqbudgetid=<!-- TMPL_VAR NAME="aqbudgetid" -->">Delete</a>
234     </td>
235   </tr>
236   <!-- /TMPL_LOOP --> <!-- budget -->
237 </table>
238
239 <div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
240 <!-- /TMPL_IF --> <!-- else -->
241
242 <!-- TMPL_IF name="add_form" -->
243
244
245 <form action="/cgi-bin/koha/admin/aqbudget.pl" name="Aform" method="post">
246   <fieldset>
247     <legend>Add budget</legend>
248     <input type="hidden" name="op" value="add_validate" />
249     <input type="hidden" name="checked" value="0" />
250
251     <table>
252       <tr>
253         <th>Book fund</th>
254         <td>
255           <input type="hidden" name="bookfundid" value="<!-- TMPL_VAR NAME="bookfundid" -->" />
256           <!-- TMPL_VAR NAME="bookfundname" -->
257         </td>
258       </tr>
259
260       <tr>
261         <th>
262           <label for="startdate">Start date (<!-- TMPL_VAR NAME="dateformat" -->)</label>
263         </th>
264         <td>
265           <input type="text" size="8" maxlength="10" id="startdate" name="startdate" value="<!-- TMPL_VAR Name="startdate" -->" />
266           <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="startdate_button" />
267           <script type="text/javascript">
268             Calendar.setup(
269               {
270                 inputField : "startdate",
271                 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
272                 button : "startdate_button"
273               }
274             );
275           </script>
276         </td>
277       </tr>
278       <tr>
279         <th>
280           <label for="enddate">End date (<!-- TMPL_VAR NAME="dateformat" -->)</label>
281         </th>
282         <td>
283           <input type="text" size="8" maxlength="10" id="enddate" name="enddate" value="<!-- TMPL_VAR Name="enddate" -->" />
284           <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="enddate_button" alt="" />
285           <script type="text/javascript">
286             Calendar.setup(
287               {
288                 inputField : "enddate",
289                 ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
290                 button : "enddate_button"
291               }
292             );
293           </script>
294         </td>
295       </tr>
296       <tr>
297         <th>
298           <label for="budgetamount">Budget amount</label>
299         </th>
300         <td>
301           <input type="text" name="budgetamount" id="budgetamount" value="<!-- TMPL_VAR NAME="budgetamount" -->" size="8" />
302         </td>
303       </tr>
304       <tr>
305         <th>
306           <label for="branch">Branch</label>
307         </th>
308         <td>
309   <!-- TMPL_IF NAME="disable_branchselection" -->
310           <!-- Pierrick's note: I've found that a disabled select was not -->
311           <!-- giving its value to Perl :-/ So I use a hidden field trick -->
312           <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->" />
313           <select name="branch" disabled="disabled">
314   <!-- TMPL_ELSE -->
315           <select name="branch">
316   <!-- /TMPL_IF -->
317
318             <option value="">----</option>
319   <!-- TMPL_LOOP NAME="branches" -->
320     <!-- TMPL_IF NAME="selected" -->
321             <option value="<!-- TMPL_VAR NAME="branchcode" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
322     <!-- TMPL_ELSE -->
323             <option value="<!-- TMPL_VAR NAME="branchcode" -->"><!-- TMPL_VAR NAME="branchname" --></option>
324     <!-- /TMPL_IF -->
325   <!-- /TMPL_LOOP -->
326           </select>
327         </td>
328       </tr>
329     </table>
330
331   <!-- TMPL_IF NAME="aqbudgetid" -->
332     <input type="hidden" name="aqbudgetid" value="<!-- TMPL_VAR NAME="aqbudgetid" -->" />
333   <!-- /TMPL_IF -->
334
335     <p id="action">
336       <input type="button" value="Submit" onclick="Check(this.form)" />
337       <input type="submit" value="Cancel" onclick="location.href='/cgi-bin/koha/admin/aqbudget.pl'; return false;" />
338     </p>
339   </fieldset>
340 </form>
341 <!-- /TMPL_IF --> <!-- add_form -->
342
343 <!-- TMPL_IF name="delete_confirm" -->
344 <form action="<!-- TMPL_VAR NAME="action" -->" method="post">
345   <fieldset>
346     <legend>Delete Book Budget?</legend>
347
348     <table>
349       <tr>
350         <th>Start date</th>
351         <td><!-- TMPL_VAR NAME="startdate" --></td>
352       </tr>
353       
354       <tr>
355         <th>End date</th>
356         <td><!-- TMPL_VAR NAME="enddate" --></td>
357       </tr>
358       
359       <tr>
360         <th>Budget Amount</th>
361         <td><!-- TMPL_VAR NAME="budgetamount" --></td>
362       </tr>
363     </table>
364
365     <input type="hidden" name="op" value="delete_confirmed" />
366     <input type="hidden" name="aqbudgetid" value="<!-- TMPL_VAR NAME="aqbudgetid" -->" />
367
368     <p id="action">
369       <input type="submit" value="Delete this budget" />
370       <input type="submit" value="Do Not Delete" />
371     </p>
372   </fieldset>
373 </form>
374 <!-- /TMPL_IF -->
375
376 </div>
377 </div>
378 </div>
379
380 <!-- TMPL_INCLUDE NAME="mainmenu.inc" -->
381 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->