added mod_validate block to aqbookfund.tmpl
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / aqbookfund.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Administration &rsaquo; Funds and Budgets</title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 <!-- TMPL_IF name="add_form" -->
5 <script type="text/javascript">
6 //<![CDATA[
7
8         function isNotNull(f,noalert) {
9                 if (f.value.length ==0) {
10    return false;
11                 }
12                 return true;
13         }
14
15         function toUC(f) {
16                 var x=f.value.toUpperCase();
17                 f.value=x;
18                 return true;
19         }
20
21         function isNum(v,maybenull) {
22         var n = new Number(v.value);
23         if (isNaN(n)) {
24                 return false;
25                 }
26         if (maybenull==0 && v.value=="") {
27                 return false;
28         }
29         return true;
30         }
31
32         function isDate(f) {
33                 var t = Date.parse(f.value);
34                 if (isNaN(t)) {
35                         return false;
36                 }
37         }
38
39         function Check(f) {
40                 var ok=1;
41                 var _alertString="";
42                 var alertString2;
43                 if (f.bookfundid.value.length==0) {
44                         _alertString += "- bookfundid missing\n";
45                 }
46                 if (f.bookfundname.value.length==0) {
47                         _alertString += "- bookfundname missing\n";
48                 }
49                 if (_alertString.length==0) {
50                         document.Aform.submit();
51                 } else {
52                         alertString2 = "Form not submitted because of the following problem(s)\n";
53                         alertString2 += "------------------------------------------------------------------------------------\n\n";
54                         alertString2 += _alertString;
55                         alert(alertString2);
56                 }
57         }
58         //]]>
59 </script>
60 <!-- /TMPL_IF -->
61 </head>
62 <body>
63 <!-- TMPL_INCLUDE NAME="header.inc" -->
64 <!-- TMPL_INCLUDE NAME="cat-search.inc" -->
65
66 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; Funds and Budgets </div>
67
68 <div id="doc3" class="yui-t2">
69    
70    <div id="bd">
71         <div id="yui-main">
72         <div class="yui-b">
73
74 <!-- TMPL_IF name="else" -->
75 <h1>Funds and budgets administration</h1>
76   <!-- TMPL_IF NAME="bookfund" -->
77 <table>
78   <tr>
79     <th>Code</th>
80     <th>Name</th>
81     <th>Branch</th>
82     <th>Actions</th>
83   </tr>
84
85 <form action="<!-- TMPL_VAR name="scriptname" -->" method="post">
86   <tr class="filter">
87     <td>
88       <select name="filter_bookfundid">
89         <option value="">----</option>
90     <!-- TMPL_LOOP name="filter_bookfundids" -->
91       <!-- TMPL_IF NAME="selected" -->
92         <option value="<!-- TMPL_VAR name="bookfundid" -->" selected="selected"><!-- TMPL_VAR name="bookfundid" --></option>
93       <!-- TMPL_ELSE -->
94         <option value="<!-- TMPL_VAR name="bookfundid" -->"><!-- TMPL_VAR name="bookfundid" --></option>
95       <!-- /TMPL_IF -->
96     <!-- /TMPL_LOOP -->
97       </select>
98     </td>
99     <td>
100       <input type="text" name="filter_bookfundname" value="<!-- TMPL_VAR name="filter_bookfundname" -->" />
101     </td>
102     <td>
103       <select name="filter_branchcode">
104         <option value="">----</option>
105     <!-- TMPL_LOOP name="filter_branches" -->
106       <!-- TMPL_IF NAME="selected" -->
107         <option value="<!-- TMPL_VAR name="code" -->" selected="selected"><!-- TMPL_VAR name="name" --></option>
108       <!-- TMPL_ELSE -->
109         <option value="<!-- TMPL_VAR name="code" -->"><!-- TMPL_VAR name="name" --></option>
110       <!-- /TMPL_IF -->
111     <!-- /TMPL_LOOP -->
112       </select>
113     </td>
114     <td>
115       <input type="submit" name="filter" value="Filter" />
116     </td>
117   </tr>
118 </form>
119
120 <form action="aqbudget.pl" method="post">
121     <!-- TMPL_LOOP name="bookfund" -->
122       <!-- TMPL_IF NAME="toggle" -->
123   <tr class="highlight">
124       <!-- TMPL_ELSE -->
125   <tr>
126       <!-- /TMPL_IF -->
127     <td>
128       <!-- TMPL_VAR name="bookfundid" -->
129     </td>
130     <td>
131       <!-- TMPL_VAR name="bookfundname" -->
132     </td>
133     <td>
134       <!-- TMPL_IF NAME="branchname" -->
135       <!-- TMPL_VAR name="branchname" -->
136       <!-- TMPL_ELSE -->
137       <!-- /TMPL_IF -->
138     </td>
139     <td>
140       <a href="<!-- TMPL_VAR name="scriptname" -->?op=add_form&amp;bookfundid=<!-- TMPL_VAR name="bookfundid" -->&amp;branchcode=<!-- TMPL_VAR name="branchcode" -->">Edit</a>
141       <a href="<!-- TMPL_VAR name="scriptname" -->?op=delete_confirm&amp;bookfundid=<!-- TMPL_VAR name="bookfundid" -->&amp;branchcode=<!-- TMPL_VAR name="branchcode" -->">Delete</a>
142       <a href="aqbudget.pl?op=add_form&amp;bookfundid=<!-- TMPL_VAR name="bookfundid" -->&amp;branchcode=<!-- TMPL_VAR name="branchcode" -->">Add budget</a>
143       <!-- TMPL_IF NAME="has_budgets" -->
144       <a href="aqbudget.pl?filter_bookfundid=<!-- TMPL_VAR name="bookfundid" -->">Show budgets</a>
145       <!-- /TMPL_IF -->
146     </td>
147   </tr>
148
149     <!-- /TMPL_LOOP --> <!-- bookfund -->
150 </table>
151
152 <div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
153   <!-- /TMPL_IF --> <!-- bookfund -->
154
155 <p>
156   <a href="<!-- TMPL_VAR name="scriptname" -->?op=add_form">Add fund</a>
157   <a href="aqbudget.pl">Show all budgets</a>
158 </p>
159
160 </form>
161 <!-- /TMPL_IF --> <!-- else -->
162
163 <!-- TMPL_IF name="add_form" -->
164 <form action="<!-- TMPL_VAR name="action" -->" name="Aform" method="post">
165
166
167 <!-- TMPL_IF name="header-is-modify-p" -->
168   <input type="hidden" name="op" value="mod_validate" />
169   <input type="hidden" name="current_branch" value="<!-- TMPL_VAR name="current_branch" -->"
170   <!-- /TMPL_IF -->
171
172 <!-- TMPL_IF name="header-is-add-p" -->
173   <input type="hidden" name="op" value="add_validate" />
174   <!-- /TMPL_IF -->
175
176
177   <input type="hidden" name="checked" value="0" />
178
179   <fieldset class="rows">
180     <legend><!-- TMPL_VAR name="header" --></legend>
181     
182   <ol><!-- TMPL_IF name="add_or_modify" -->
183     <li>
184         <span class="label">Fund: </span>
185         <input type="hidden" name="bookfundid" id="bookfundid" value="<!-- TMPL_VAR name="bookfundid" -->" />
186         <!-- TMPL_VAR name="bookfundid" -->
187     </li>
188   <!-- TMPL_ELSE -->
189     <li>
190       <label for="bookfundid">Fund: </label>
191       <input type="text" name="bookfundid" id="bookfundid" size="5" maxlength="5" onblur="toUC(this)" />
192     </li>
193   <!-- /TMPL_IF --> <!-- add_or_modify -->
194     
195     <li>
196       <label for="bookfundname">Name: </label>
197           <input type="text" name="bookfundname" id="bookfundname" size="40" maxlength="80" value="<!-- TMPL_VAR name="bookfundname" escape="HTML" -->" />
198       </li>
199
200     <li>
201       <label for="branchcode">Library: </label>
202       <select name="branchcode" id="branchcode">
203           <option value="">----</option>
204   <!-- TMPL_LOOP NAME="branches" -->
205     <!-- TMPL_IF NAME="selected" -->
206           <option value="<!-- TMPL_VAR NAME="branchcode" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
207     <!-- TMPL_ELSE -->
208           <option value="<!-- TMPL_VAR NAME="branchcode" -->"><!-- TMPL_VAR NAME="branchname" --></option>
209     <!-- /TMPL_IF -->
210   <!-- /TMPL_LOOP -->
211         </select>
212     </li></ol>
213     
214   </fieldset>
215
216   <p>
217     <input type="button" value="Submit" onclick="Check(this.form); return false;" />
218   </p>
219 </form>
220 <!-- /TMPL_IF --> <!-- add_form -->
221
222
223 <!-- TMPL_IF name="add_validate" -->
224 <h3>Bookfund Added</h3>
225
226 <p>
227   <a href="<!-- TMPL_VAR name="action" -->">Return to fund list</a>
228 </p>
229 <!-- /TMPL_IF -->
230
231
232 <!-- TMPL_IF name="mod_validate" -->
233 <h3>Bookfund Modified</h3>
234
235 <p>
236   <a href="<!-- TMPL_VAR name="action" -->">Return to fund list</a>
237 </p>
238 <!-- /TMPL_IF -->
239
240
241
242 <!-- TMPL_IF name="delete_confirm" -->
243 <h3>Confirm Deletion of Fund <em><!-- TMPL_VAR name="bookfundid" --></em></h3>
244 <table>
245   <tr>
246     <th>Fund</th>
247     <td><!-- TMPL_VAR name="bookfundid" --></td>
248   </tr>
249   <tr>
250     <th>Branch</th>
251     <td><!-- TMPL_VAR name="branchcode" --></td>
252   </tr>
253   <tr>
254     <th>Name</th>
255     <td><!-- TMPL_VAR name="bookfundname" --></td>
256   </tr>
257   <tr>
258     <th>Group</th>
259     <td><!-- TMPL_VAR name="bookfundgroup" --></td>
260   </tr>
261 </table>
262
263 <form action="<!-- TMPL_VAR name="action" -->" method="post">
264   <input type="hidden" name="op" value="delete_confirmed" />
265   <input type="hidden" name="bookfundid" value="<!-- TMPL_VAR name="bookfundid" -->" />
266   <input type="hidden" name="branchcode" value="<!-- TMPL_VAR name="branchcode" -->" />
267
268   <div id="action">
269     <input type="submit" value="Delete this Fund" />
270   </div>
271 </form>
272
273 <form action="<!-- TMPL_VAR name="action" -->" method="post">
274   <input type="submit" value="Do not Delete" />
275 </form>
276 <!-- /TMPL_IF --> <!-- delete_confirm -->
277
278 <!-- TMPL_IF name="delete_confirmed" -->
279 <h3>Data Deleted</h3>
280 <form action="<!-- TMPL_VAR name="action" -->" method="post">
281   <input type="submit" value="OK" />
282 </form>
283 <!-- /TMPL_IF --> <!-- delete_confirmed -->
284
285 </div>
286 </div>
287 <div class="yui-b">
288 <!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
289 </div>
290 </div>
291 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->