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