Corrections for XHTML compliance, again.
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / itemtypes.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; System Administration &rsaquo;
3 <!-- TMPL_IF name="add_form" -->
4   <!-- TMPL_IF name="itemtype" -->
5 Modify item type '<!-- TMPL_VAR name="itemtype" -->'
6   <!-- TMPL_ELSE -->
7 Add item type
8   <!-- /TMPL_IF -->
9 <!-- /TMPL_IF -->
10 <!-- TMPL_IF name="delete_confirm" -->
11   <!-- TMPL_IF name="total" -->
12 Cannot Delete Item Type '<!-- TMPL_VAR name="itemtype" -->'
13   <!-- TMPL_ELSE -->
14 Delete Item Type '<!-- TMPL_VAR name="itemtype" -->'?
15   <!-- /TMPL_IF -->
16 <!-- /TMPL_IF -->
17 <!-- TMPL_IF name="delete_confirmed" -->
18 Data Deleted
19 <!-- /TMPL_IF -->
20 <!-- TMPL_IF name="else" -->
21 Item Types Administration
22 <!-- /TMPL_IF -->
23 </title>
24 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
25
26 <!-- TMPL_INCLUDE NAME="menus.inc" -->
27 <!-- TMPL_INCLUDE NAME="menu-admin.inc" -->
28
29 <!-- TMPL_IF name="add_form" -->
30
31 <form action="<!-- TMPL_VAR name="script_name" -->" name="Aform" method="post">
32   <feldset>
33     <legend>
34   <!-- TMPL_IF name="itemtype" -->
35       <h3>Modify item type</h3>
36   <!-- TMPL_ELSE -->
37       <h3>Add item type</h3>
38   <!-- /TMPL_IF -->
39     </legend>
40
41     <input type="hidden" name="op" value="add_validate" />
42     <input type="hidden" name="checked" value="0" />
43                 
44     <table>
45   <!-- TMPL_IF name="itemtype" -->
46       <tr>
47         <th>
48           <label for="">Item type</label>
49         </th>
50         <td>
51           <input type="hidden" name="itemtype" value="<!-- TMPL_VAR name="itemtype" -->" />
52           <!-- TMPL_VAR name="itemtype" -->
53         </td>
54       </tr>
55   <!-- TMPL_ELSE -->
56       <tr>
57         <th>
58           <label for="itemtype">Item type</label>
59         </th>
60         <td>
61           <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" />
62         </td>
63       </tr>
64   <!-- /TMPL_IF -->
65       <tr>
66         <th>
67           <label for="description">Description</label>
68         </th>
69         <td>
70           <input type="text" id="description" name="description" size="48" maxlength="80" value="<!-- TMPL_VAR name="description" escape="HTML" -->" />
71         </td>
72       </tr>
73       <tr>
74         <th>Image</th>
75         <td>
76           <p>
77   <!-- TMPL_LOOP NAME="IMAGESLOOP" -->
78             <label>
79     <!-- TMPL_IF name="checked" -->
80               <input type="radio" name="image" value="<!-- TMPL_VAR name="KohaImage" -->" checked="checked" />
81     <!-- TMPL_ELSE -->
82               <!-- TMPL_IF NAME="KohaImage" --> <!-- to delete the radio button if there is no image after -->
83               <input type="radio" name="image" value="<!-- TMPL_VAR name="KohaImage" -->" />
84               <!-- /TMPL_IF -->
85     <!-- /TMPL_IF -->
86         <!-- TMPL_IF NAME="KohaImageSrc" -->
87               <img src="<!-- TMPL_VAR name="KohaImageSrc" -->" alt="" />
88         <!-- TMPL_ELSE -->
89               <br />
90         <!-- /TMPL_IF -->
91             </label>
92   <!-- /TMPL_LOOP -->
93           </p>
94           <hr />
95           <p>
96             <label>
97   <!-- TMPL_IF name="remote_image" -->
98             <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />
99   <!-- TMPL_ELSE -->
100             <input type="radio" id="remote_image_check" name="image" value="remoteImage" />
101   <!-- /TMPL_IF -->
102             remote image
103             </label>
104             <input type="text" name="remoteImage" size="48" maxlength="200" value="<!-- TMPL_VAR name="remote_image" -->" onmousedown="document.getElementById('remote_image_check').checked = true;" />
105             </label>
106   <!-- TMPL_IF name="remote_image" -->
107             <img src="<!-- TMPL_VAR name="remote_image" -->" alt="" />
108   <!-- /TMPL_IF -->
109           </p>
110           <hr />
111           <p>
112             <label><input type="radio" name="image" value="removeImage" /> remove image</label>
113           </p>
114         </td>
115       </tr>
116       <tr>
117         <th>
118           <label for="notforloan">Not for loan</label>
119         </th>
120         <td>
121             <!-- TMPL_IF name="notforloan" -->
122                 <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
123             <!-- TMPL_ELSE -->
124                 <input type="checkbox" id="notforloan" name="notforloan" value="1" />
125             <!-- /TMPL_IF -->
126           (if checked, no item of this type can be issued. If not checked, every item of this type can be issued unless notforloan is set for a specific item)
127         </td>
128       </tr>
129       <tr>
130         <th>
131           <label for="renewalsallowed">Renewals</label>
132         </th>
133         <td>
134           <input type="text" id="renewalsallowed" name="renewalsallowed" size="3" maxlength="3" value="
135   <!-- TMPL_IF name="renewalsallowed" -->
136           <!-- TMPL_VAR NAME="renewalsallowed" -->
137   <!-- /TMPL_IF -->" value="1" />
138         </td>
139       </tr>
140       <tr>
141         <th>
142           <label for="rentalcharge">Rental charge</label>
143         </th>
144         <td>
145           <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="<!-- TMPL_VAR name="rentalcharge" -->" />
146         </td>
147       </tr>
148       <tr>
149         <th>
150           <label for="rentalcharge">Summary</label>
151         </th>
152         <td><p>Enter a summary that will overwrite the default one in search results lists</p>
153           <p><textarea id="summary" name="summary" cols="40" rows="10"><!-- TMPL_VAR NAME="summary" --></textarea></p>
154           <p>Example, for a website itemtype : </p>
155           <p><b>&lt;a href="[856u]"&gt;open site&lt;/a&gt;</b> will show the link just below the title</p>
156         </td>
157       </tr>
158     </table>
159
160     <p id="action">
161       <input type="button" value="Save Changes" onclick="Check(this.form)" />
162       <input type="button" value="Cancel" onclick="history.back();" />
163     </p>
164   </fieldset>
165 </form>
166 <!-- /TMPL_IF -->
167
168 <!-- TMPL_IF name="delete_confirm" -->
169 <!-- TMPL_IF name="total" --><div class="error">This record is used <!-- TMPL_VAR name="total" --> times. Deletion is not possible.<!-- /TMPL_IF -->
170 <div class="table details">     <table>
171         <caption><!-- TMPL_IF name="total" -->Cannot Delete Item Type<!-- TMPL_ELSE -->Delete Item Type '<!-- TMPL_VAR name="itemtype" -->'?<!-- /TMPL_IF --></caption>
172                 <tr>
173                         <th>Item type</th>
174                         <td><!-- TMPL_VAR name="itemtype" --></td>
175                 </tr>
176
177         <tr><th>Description</th><td><!-- TMPL_VAR name="description" --></td></tr>
178         <tr><th>Loan length</th><td><!-- TMPL_VAR name="loanlength" --></td></tr>
179         <tr><th>Renewals</th><td><!-- TMPL_IF name="renewalsallowed" -->Allowed<!-- TMPL_ELSE -->Not allowed<!-- /TMPL_IF --></td></tr>
180 <!-- Hide from NPL  --><tr><th>Rental charge</th><td><!-- TMPL_VAR name="rentalcharge" --></td></tr><!-- Hide from NPL --></table>
181                 <form action="<!-- TMPL_VAR name="script_name" -->" method="post">
182                 <input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="<!-- TMPL_VAR name="itemtype" -->" /><!-- TMPL_IF name="total" -->
183                 </form><form action="<!-- TMPL_VAR name="script_name" -->" method="post"><input type="submit" value="OK" /></form>
184         <!-- TMPL_ELSE -->
185                 <input type="submit" value="Delete this Item Type" /></form> <form action="<!-- TMPL_VAR name="script_name" -->" method="post"><input type="submit" value="Do Not Delete" /></form>
186         <!-- /TMPL_IF -->
187
188         
189 <!-- /TMPL_IF -->
190
191 <!-- TMPL_IF name="else" -->
192 <h2>Item Types Administration</h2>
193 <table>
194   <tr>
195     <th>image</th>
196     <th>Code</th>
197     <th>Description</th>
198     <th>Not for Loan</th>
199     <th>Renewable</th>
200     <th>Charge</th>
201     <th>Actions</th>
202   </tr>
203   <!-- TMPL_LOOP name="loop" -->
204     <!-- TMPL_IF NAME="toggle" -->
205   <tr>
206     <!-- TMPL_ELSE -->
207   <tr class="highlight">
208     <!-- /TMPL_IF -->
209     <td><img src="<!-- TMPL_VAR name="imageurl" -->" alt="" /></td>
210     <td>
211       <a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&amp;itemtype=<!-- TMPL_VAR name="itemtype" escape="HTML" -->">
212         <!-- TMPL_VAR name="itemtype" -->
213       </a>
214     </td>
215     <td><!-- TMPL_VAR name="description" --></td>
216     <td><!-- TMPL_IF NAME="notforloan" -->Yes<!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></td>
217     <td>
218     <!-- TMPL_IF NAME="renewalsallowed" -->
219       <!-- TMPL_VAR name="renewalsallowed" --> time(s)
220     <!-- TMPL_ELSE -->
221       No
222     <!-- /TMPL_IF -->
223     </td>
224     <td>
225     <!-- TMPL_UNLESS name="notforloan" -->
226       <!-- TMPL_VAR NAME="rentalcharge" -->
227     <!-- /TMPL_UNLESS -->
228     </td>
229     <td>
230       <a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&amp;itemtype=<!-- TMPL_VAR name="itemtype" escape="HTML" -->">Edit</a>
231       <a href="<!-- TMPL_VAR name="script_name" -->?op=delete_confirm&amp;itemtype=<!-- TMPL_VAR name="itemtype" escape="HTML" -->">Delete</a>
232     </td>
233   </tr>
234   <!-- /TMPL_LOOP -->
235 </table>
236
237 <div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
238
239 <p><a href="<!-- TMPL_VAR name="script_name" -->?op=add_form">Add Item type</a></p>
240 <!-- /TMPL_IF -->
241
242
243 <script language="javascript" type="text/javascript">
244
245 function isNotNull(f,noalert) {
246         if (f.value.length ==0) {
247                 return false;
248         }
249         return true;
250 }
251
252 function toUC(f) {
253         var x=f.value.toUpperCase();
254         f.value=x;
255         return true;
256 }
257
258 function isNum(v,maybenull) {
259 var n = new Number(v.value);
260 if (isNaN(n)) {
261         return false;
262         }
263 if (maybenull==0 && v.value=='') {
264         return false;
265 }
266 return true;
267 }
268
269 function isDate(f) {
270         var t = Date.parse(f.value);
271         if (isNaN(t)) {
272                 return false;
273         }
274 }
275
276 function Check(f) {
277         var ok=1;
278         var _alertString="";
279         var alertString2;
280         if (f.itemtype.value.length==0) {
281                 _alertString += "\n- " + _("Itemtype missing");
282         }
283         if (!(isNotNull(window.document.Aform.description,1))) {
284                 _alertString += "\n- " + _("Description missing");
285         }
286         if ((!isNum(f.rentalcharge,0)) && f.rentalcharge.value.length > 0) {
287                 _alertString += "\n- " + _("Rental charge is not a number");
288         }
289         if (_alertString.length==0) {
290                 document.Aform.submit();
291         } else {
292                 alertString2  = _("Form not submitted because of the following problem(s)");
293                 alertString2 += "\n------------------------------------------------------------------------------------\n";
294                 alertString2 += _alertString;
295                 alert(alertString2);
296         }
297 }
298 </script>
299 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->