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