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