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