Continuing to add resident search form and breakcrumbs. Markup cleanup all around.
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / itemtypes.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Administration &rsaquo;<!-- TMPL_IF name="add_form" -->
3   <!-- TMPL_IF name="itemtype" -->
4 Modify item type '<!-- TMPL_VAR name="itemtype" -->'
5   <!-- TMPL_ELSE -->
6 Add item type
7   <!-- /TMPL_IF -->
8 <!-- /TMPL_IF -->
9 <!-- TMPL_IF name="delete_confirm" -->
10   <!-- TMPL_IF name="total" -->
11 Cannot Delete Item Type '<!-- TMPL_VAR name="itemtype" -->'
12   <!-- TMPL_ELSE -->
13 Delete Item Type '<!-- TMPL_VAR name="itemtype" -->'?
14   <!-- /TMPL_IF -->
15 <!-- /TMPL_IF -->
16 <!-- TMPL_IF name="delete_confirmed" -->
17 Data Deleted
18 <!-- /TMPL_IF -->
19 <!-- TMPL_IF name="else" -->
20 Item Types Administration
21 <!-- /TMPL_IF -->
22 </title>
23 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" --><script type="text/javascript">
24 //<![CDATA[
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 //]]>
80 </script>
81 </head>
82 <body>
83 <!-- TMPL_INCLUDE NAME="header.inc" -->
84
85 <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; <!-- TMPL_IF name="add_form" -->
86   <!-- TMPL_IF name="itemtype" -->
87 Modify item type '<!-- TMPL_VAR name="itemtype" -->'
88   <!-- TMPL_ELSE -->
89 Add item type
90   <!-- /TMPL_IF -->
91 <!-- /TMPL_IF -->
92 <!-- TMPL_IF name="delete_confirm" -->
93   <!-- TMPL_IF name="total" -->
94 Cannot Delete Item Type '<!-- TMPL_VAR name="itemtype" -->'
95   <!-- TMPL_ELSE -->
96 Delete Item Type '<!-- TMPL_VAR name="itemtype" -->'?
97   <!-- /TMPL_IF -->
98 <!-- /TMPL_IF -->
99 <!-- TMPL_IF name="delete_confirmed" -->
100 Data Deleted
101 <!-- /TMPL_IF -->
102 <!-- TMPL_IF name="else" -->
103 Item Types Administration
104 <!-- /TMPL_IF --></div>
105
106 <div id="doc3" class="yui-t2">
107    
108    <div id="bd">
109         <div id="yui-main">
110         <div class="yui-b">
111
112 <!-- TMPL_IF name="add_form" -->
113   <!-- TMPL_IF name="itemtype" -->
114       <h3>Modify item type</h3>
115   <!-- TMPL_ELSE -->
116       <h3>Add item type</h3>
117   <!-- /TMPL_IF -->
118 <form action="<!-- TMPL_VAR name="script_name" -->" name="Aform" method="post">
119   <input type="hidden" name="op" value="add_validate" />
120     <input type="hidden" name="checked" value="0" />
121                 
122     <table>
123   <!-- TMPL_IF name="itemtype" -->
124       <tr>
125         <th>
126           <label>Item type</label>
127         </th>
128         <td>
129           <input type="hidden" name="itemtype" value="<!-- TMPL_VAR name="itemtype" -->" />
130           <!-- TMPL_VAR name="itemtype" -->
131         </td>
132       </tr>
133   <!-- TMPL_ELSE -->
134       <tr>
135         <th>
136           <label for="itemtype">Item type</label>
137         </th>
138         <td>
139           <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" />
140         </td>
141       </tr>
142   <!-- /TMPL_IF -->
143       <tr>
144         <th>
145           <label for="description">Description</label>
146         </th>
147         <td>
148           <input type="text" id="description" name="description" size="48" maxlength="80" value="<!-- TMPL_VAR name="description" escape="HTML" -->" />
149         </td>
150       </tr>
151       <tr>
152         <th>Image</th>
153         <td>
154           <p>
155   <!-- TMPL_LOOP NAME="IMAGESLOOP" -->
156             <label>
157     <!-- TMPL_IF name="checked" -->
158               <input type="radio" name="image" value="<!-- TMPL_VAR name="KohaImage" -->" checked="checked" />
159     <!-- TMPL_ELSE -->
160               <!-- TMPL_IF NAME="KohaImage" --> <!-- to delete the radio button if there is no image after -->
161               <input type="radio" name="image" value="<!-- TMPL_VAR name="KohaImage" -->" />
162               <!-- /TMPL_IF -->
163     <!-- /TMPL_IF -->
164         <!-- TMPL_IF NAME="KohaImageSrc" -->
165               <img src="<!-- TMPL_VAR name="KohaImageSrc" -->" alt="<!-- TMPL_VAR name="KohaImageSrc" -->" title="<!-- TMPL_VAR name="KohaImageSrc" -->" />
166         <!-- TMPL_ELSE -->
167               <br />
168         <!-- /TMPL_IF -->
169             </label>
170   <!-- /TMPL_LOOP -->
171           </p>
172
173           <p>
174             <label>
175   <!-- TMPL_IF name="remote_image" -->
176             <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />
177   <!-- TMPL_ELSE -->
178             <input type="radio" id="remote_image_check" name="image" value="remoteImage" />
179   <!-- /TMPL_IF -->
180             remote image
181             </label>
182             <input type="text" name="remoteImage" size="48" maxlength="200" value="<!-- TMPL_VAR name="remote_image" -->" onmousedown="document.getElementById('remote_image_check').checked = true;" />
183
184   <!-- TMPL_IF name="remote_image" -->
185             <img src="<!-- TMPL_VAR name="remote_image" -->" alt="" />
186   <!-- /TMPL_IF -->
187           </p>
188           <hr />
189           <p>
190             <label><input type="radio" name="image" value="removeImage" /> remove image</label>
191           </p>
192         </td>
193       </tr>
194       <tr>
195         <th>
196           <label for="notforloan">Not for loan</label>
197         </th>
198         <td>
199             <!-- TMPL_IF name="notforloan" -->
200                 <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
201             <!-- TMPL_ELSE -->
202                 <input type="checkbox" id="notforloan" name="notforloan" value="1" />
203             <!-- /TMPL_IF -->
204           (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)
205         </td>
206       </tr>
207       <tr>
208         <th>
209           <label for="renewalsallowed">Renewals</label>
210         </th>
211         <td>
212                   <input type="text" id="renewalsallowed" name="renewalsallowed" size="3" maxlength="3" value="<!-- TMPL_VAR NAME="renewalsallowed" -->" />
213         </td>
214       </tr>
215       <tr>
216         <th>
217           <label for="rentalcharge">Rental charge</label>
218         </th>
219         <td>
220           <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="<!-- TMPL_VAR name="rentalcharge" -->" />
221         </td>
222       </tr>
223       <tr>
224         <th>
225           <label for="rentalcharge">Summary</label>
226         </th>
227         <td><p>Enter a summary that will overwrite the default one in search results lists</p>
228           <p><textarea id="summary" name="summary" cols="40" rows="10"><!-- TMPL_VAR NAME="summary" --></textarea></p>
229           <p>Example, for a website itemtype : </p>
230           <p><b>&lt;a href="[856u]"&gt;open site&lt;/a&gt;</b> will show the link just below the title</p>
231         </td>
232       </tr>
233     </table>
234
235     <p id="action">
236       <input type="button" value="Save Changes" onclick="Check(this.form)" />
237       <input type="button" value="Cancel" onclick="history.back();" />
238     </p>
239 </form>
240 <!-- /TMPL_IF -->
241
242 <!-- TMPL_IF name="delete_confirm" -->
243 <!-- TMPL_IF name="total" --><div class="error">This record is used <!-- TMPL_VAR name="total" --> times. Deletion is not possible.<!-- /TMPL_IF -->
244 <div class="table details">     <table>
245         <caption><!-- TMPL_IF name="total" -->Cannot Delete Item Type<!-- TMPL_ELSE -->Delete Item Type '<!-- TMPL_VAR name="itemtype" -->'?<!-- /TMPL_IF --></caption>
246                 <tr>
247                         <th>Item type</th>
248                         <td><!-- TMPL_VAR name="itemtype" --></td>
249                 </tr>
250
251         <tr><th>Description</th><td><!-- TMPL_VAR name="description" --></td></tr>
252         <tr><th>Loan length</th><td><!-- TMPL_VAR name="loanlength" --></td></tr>
253         <tr><th>Renewals</th><td><!-- TMPL_IF name="renewalsallowed" -->Allowed<!-- TMPL_ELSE -->Not allowed<!-- /TMPL_IF --></td></tr>
254 <!-- Hide from NPL  --><tr><th>Rental charge</th><td><!-- TMPL_VAR name="rentalcharge" --></td></tr><!-- Hide from NPL --></table>
255                 <form action="<!-- TMPL_VAR name="script_name" -->" method="post">
256                 <input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="<!-- TMPL_VAR name="itemtype" -->" /><!-- TMPL_IF name="total" -->
257                 </form><form action="<!-- TMPL_VAR name="script_name" -->" method="post"><input type="submit" value="OK" /></form>
258         <!-- TMPL_ELSE -->
259                 <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>
260         <!-- /TMPL_IF -->
261
262         
263 <!-- /TMPL_IF -->
264
265 <!-- TMPL_IF name="else" -->
266 <h2>Item Types Administration</h2>
267 <table>
268   <tr>
269     <th>image</th>
270     <th>Code</th>
271     <th>Description</th>
272     <th>Not for Loan</th>
273     <th>Renewable</th>
274     <th>Charge</th>
275     <th>Actions</th>
276   </tr>
277   <!-- TMPL_LOOP name="loop" -->
278     <!-- TMPL_IF NAME="toggle" -->
279   <tr>
280     <!-- TMPL_ELSE -->
281   <tr class="highlight">
282     <!-- /TMPL_IF -->
283     <td><img src="<!-- TMPL_VAR name="imageurl" -->" alt="" /></td>
284     <td>
285       <a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&amp;itemtype=<!-- TMPL_VAR name="itemtype" escape="HTML" -->">
286         <!-- TMPL_VAR name="itemtype" -->
287       </a>
288     </td>
289     <td><!-- TMPL_VAR name="description" --></td>
290     <td><!-- TMPL_IF NAME="notforloan" -->Yes<!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></td>
291     <td>
292     <!-- TMPL_IF NAME="renewalsallowed" -->
293       <!-- TMPL_VAR name="renewalsallowed" --> time(s)
294     <!-- TMPL_ELSE -->
295       No
296     <!-- /TMPL_IF -->
297     </td>
298     <td>
299     <!-- TMPL_UNLESS name="notforloan" -->
300       <!-- TMPL_VAR NAME="rentalcharge" -->
301     <!-- /TMPL_UNLESS -->
302     </td>
303     <td>
304       <a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&amp;itemtype=<!-- TMPL_VAR name="itemtype" escape="HTML" -->">Edit</a>
305       <a href="<!-- TMPL_VAR name="script_name" -->?op=delete_confirm&amp;itemtype=<!-- TMPL_VAR name="itemtype" escape="HTML" -->">Delete</a>
306     </td>
307   </tr>
308   <!-- /TMPL_LOOP -->
309 </table>
310
311 <div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
312
313 <p><a href="<!-- TMPL_VAR name="script_name" -->?op=add_form">Add Item type</a></p>
314 <!-- /TMPL_IF -->
315
316
317
318 </div>
319 </div>
320 <div class="yui-b">
321 <!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
322 </div>
323 </div>
324 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->