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