Bug 10937: cleanup and rename DOCTYPECAT to ITEMTYPECAT
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / itemtypes.tt
1 [% USE AuthorisedValues %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Administration &rsaquo; Item types [% IF ( add_form ) %]&rsaquo;
4   [% IF ( itemtype ) %]
5 Modify item type '[% itemtype %]'
6   [% ELSE %]
7 Add item type
8   [% END %]
9 [% END %]
10 [% IF ( delete_confirm ) %]&rsaquo; 
11   [% IF ( total ) %]
12 Cannot delete item type '[% itemtype %]'
13   [% ELSE %]
14 Delete item type '[% itemtype %]'?
15   [% END %]
16 [% END %]
17 [% IF ( delete_confirmed ) %]&rsaquo; 
18 Data deleted
19 [% END %]
20 </title>
21 [% INCLUDE 'doc-head-close.inc' %]
22 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
23 [% INCLUDE 'datatables.inc' %]
24 <script type="text/javascript">
25 //<![CDATA[
26      $(document).ready(function() {
27         $('#icons').tabs();
28         $("#table_item_type").dataTable($.extend(true, {}, dataTablesDefaults, {
29             "aoColumnDefs": [
30                 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
31             ],
32             "aaSorting": [[ 2, "asc" ]],
33             "iDisplayLength": 10,
34             "sPaginationType": "four_button"
35         }));
36         $( "#itemtypeentry" ).validate({
37             rules: {
38                 itemtype: { required: true },
39                 description: { required: true },
40                 rentalcharge: { number: true }
41             }
42         });
43      });
44 //]]>
45 </script>
46 <style type="text/css">
47         fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; }
48   fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-active {background-color : #F4F8F9; }
49         fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;}
50   fieldset.rows .ui-tabs-nav { margin-left : 10px; }
51 </style>
52 </head>
53 <body id="admin_itemtypes" class="admin">
54 [% INCLUDE 'header.inc' %]
55 [% INCLUDE 'cat-search.inc' %]
56
57 <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; [% IF ( add_form ) %]
58   [% IF ( itemtype ) %]
59 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Modify item type '[% itemtype %]'
60   [% ELSE %]
61 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Add item type
62   [% END %]
63 [% END %]
64 [% IF ( delete_confirm ) %]
65   [% IF ( total ) %]
66 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Cannot delete item type '[% itemtype %]'
67   [% ELSE %]
68 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Delete item type '[% itemtype %]'?
69   [% END %]
70 [% END %]
71 [% IF ( delete_confirmed ) %]
72 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo;Data deleted
73 [% END %]
74 [% IF ( else ) %]
75 Item types administration
76 [% END %]</div>
77
78 <div id="doc3" class="yui-t2">
79    
80    <div id="bd">
81         <div id="yui-main">
82         <div class="yui-b">
83         
84 [% IF ( else ) %]<div id="toolbar" class="btn-toolbar">
85     <a class="btn btn-small" id="newitemtype" href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form"><i class="icon-plus"></i> New item type</a>
86 </div>[% END %]
87
88 [% FOREACH message IN messages %]
89   [% IF message.type == 'success' %]
90     <div class="dialog message">
91   [% ELSIF message.type == 'warning' %]
92     <div class="dialog alert">
93   [% ELSIF message.type == 'error' %]
94     <div class="dialog error" style="margin:auto;">
95   [% END %]
96   [% IF message.code == 'already_exists' %]
97     This item type already exists.
98   [% END %]
99   </div>
100 [% END %]
101
102
103 [% IF ( add_form ) %]
104   [% IF ( itemtype ) %]
105       <h3>Modify item type</h3>
106   [% ELSE %]
107       <h3>Add item type</h3>
108   [% END %]
109 <form action="[% script_name %]" name="Aform" method="post" id="itemtypeentry">
110   <input type="hidden" name="op" value="add_validate" />
111     <input type="hidden" name="checked" value="0" />
112                 
113     <fieldset class="rows">
114         <ol>
115   [% IF ( itemtype ) %]
116       <li>
117           <input type="hidden" name="is_a_modif" value="1" />
118           <span class="label">Item type: </span> <input type="hidden" name="itemtype" value="[% itemtype %]" />
119           [% itemtype %]
120      </li>
121   [% ELSE %]
122       <li>
123           <label for="itemtype" class="required">Item type: </label> <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" required="required" /> <span class="required">Required</span>
124       </li>
125   [% END %]
126       <li>
127           <label for="description" class="required">Description: </label><input type="text" id="description" name="description" size="48" value="[% description |html %]" required="required" /> <span class="required">Required</span></li>
128       <li>
129           <span class="label">Search category</span>
130           <select id="searchcategory" name="searchcategory">
131           <option value="">None</option>
132                 [% FOREACH cat IN searchcategory %]
133                     [% IF ( cat.selected ) %]
134                         <option value="[% cat.authorised_value %]" selected="selected">
135                             [% cat.lib %]
136                         </option>
137                     [% ELSE %]
138                         <option value="[% cat.authorised_value %]" >
139                             [% cat.lib %]
140                         </option>
141                     [% END %]
142                 [% END %]
143           </select>
144           (Options are defined as the authorized values for the ITEMTYPECAT category)
145       </li>
146
147      [% IF ( noItemTypeImages ) %]
148          <li><span class="label">Image: </span>Item type images are disabled. To enable them, turn off the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=noItemTypeImages">noItemTypeImages system preference</a></li></ol>
149          [% ELSE %]</ol>
150     <div id="icons" class="toptabs" style="clear:both">
151         <h5 style="margin-left:10px;">Choose an icon:</h5>
152                         <ul>
153           <li><a href="#none">None</a></li>
154                                   [% FOREACH imageset IN imagesets %]
155             [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a></li>
156                                   [% END %]
157                   [% IF ( remote_image ) %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#remote">Remote image</a></li>
158                         </ul>
159   <div id="none"><ul>
160   <li><label for="noimage">No image: </label><input type="radio" name="image" id="noimage" value="removeImage" /></li>
161   </ul>
162   <br class="clear" /></div>
163
164   [% FOREACH imageset IN imagesets %]
165   <div id="[% imageset.imagesetname %]"><ul>
166   [% FOREACH image IN imageset.images %]
167                         <li style="float: none; display: inline-block; clear : none; width: auto;">
168             <label> [% IF ( image.StaffImageUrl ) %]
169               <img src="[% image.StaffImageUrl %]" alt="[% image.StaffImageUrl %]" title="[% image.StaffImageUrl %]" />
170         [% ELSE %]
171         [% END %]
172     [% IF ( image.checked ) %]
173               <input type="radio" name="image" value="[% image.KohaImage %]" checked="checked" />
174     [% ELSE %]
175               [% IF ( image.KohaImage ) %] <!-- to delete the radio button if there is no image after -->
176               <input type="radio" name="image" value="[% image.KohaImage %]" />
177               [% END %]
178     [% END %]
179             </label>
180                         </li>
181   [% END %]
182   </ul>
183   <br class="clear" />
184   </div>
185   [% END %]
186 <div id="remote"><ul>
187 <li> <label for="remote_image_check"> Remote image:</label>
188   [% IF ( remote_image ) %]
189             <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />
190   [% ELSE %]
191             <input type="radio" id="remote_image_check" name="image" value="remoteImage" />
192   [% END %]<input type="text" name="remoteImage" size="48" maxlength="200" value="[% remote_image %]" onmousedown="document.getElementById('remote_image_check').checked = true;" /> [% IF ( remote_image ) %]
193             <img src="[% remote_image %]" alt="" />
194   [% END %]</li>
195 </ul>
196   <br class="clear" />
197 </div>
198 </div>
199 [% END %]
200 <ol>
201       <li>
202           <label for="hideinopac">Hide in OPAC: </label>
203           [% IF ( hideinopac ) %]
204               <input type="checkbox" id="hideinopac" name="hideinopac" checked="checked" value="1" />
205           [% ELSE %]
206               <input type="checkbox" id="hideinopac" name="hideinopac" value="1" />
207           [% END %]
208           (if checked, items of this type will be hidden as filters in OPAC's advanced search)
209       </li>
210       <li>
211           <label for="notforloan">Not for loan: </label>   [% IF ( notforloan ) %]
212                 <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
213             [% ELSE %]
214                 <input type="checkbox" id="notforloan" name="notforloan" value="1" />
215             [% END %]
216           (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)
217         
218       </li>
219       <li>
220           <label for="rentalcharge">Rental charge: </label>
221                   <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% rentalcharge %]" />
222          </li>
223       <li>
224           <label for="checkinmsg">Checkin message: </label>
225           <textarea id="checkinmsg" name="checkinmsg" cols="55" rows="5">[% checkinmsg %]</textarea>
226       </li>
227       <li>
228           <label for="checkinmsgtype">Checkin message type: </label>
229           <select type="text" id="checkinmsgtype" name="checkinmsgtype">
230               [% IF ( checkinmsgtype == 'message' ) %]
231               <option value="message" selected="selected">Message</option>
232               [% ELSE %]
233                  <option value="message">Message</option>
234               [% END %]
235               [% IF ( checkinmsgtype == 'alert' ) %]
236               <option value="alert" selected="selected">Alert</option>
237               [% ELSE %]
238                   <option value="alert">Alert</option>
239               [% END %]
240           </select>
241       </li>
242       <li>
243           <label for="sip_media_type">SIP media type: </label>
244           <select id="sip_media_type" name="sip_media_type">
245               <option value=""></option>
246               [% FOREACH a IN AuthorisedValues.Get('SIP_MEDIA_TYPE', sip_media_type ) %]
247                   [% IF a.selected %]
248                       <option value="[% a.authorised_value %]" selected="selected">[% a.lib %]</option>
249                   [% ELSE %]
250                       <option value="[% a.authorised_value %]">[% a.lib %]</option>
251                   [% END %]
252               [% END %]
253           </select>
254       </li>
255       <li>
256           <label for="summary">Summary: </label>
257          <textarea id="summary" name="summary" cols="55" rows="5">[% summary %]</textarea>
258           <p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
259           <p><b>&lt;a href="[856u]"&gt;open site&lt;/a&gt;</b> will show the link just below the title</p>
260       </li>
261           </ol>
262     </fieldset>
263
264     <fieldset class="action">
265       <input type="submit" value="Save changes" />
266           <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
267     </fieldset>
268 </form>
269 [% END %]
270
271 [% IF ( delete_confirm ) %]
272 [% IF ( total ) %]<div class="dialog message">
273 <h3>Cannot delete item type</h3>
274 <p><strong>This record is used [% total %] times</strong>. Deletion is not possible.</p>
275 [% ELSE %]<div class="dialog alert">
276 <h3>Delete item type '[% itemtype %]'?</h3>
277 [% END %]
278 <table>
279                 <tr>
280                         <th scope="row">Item type</th>
281                         <td>[% itemtype %]</td>
282                 </tr>
283
284         <tr><th scope="row">Description</th><td>[% description %]</td></tr>
285         <tr><th scope="row">Loan length</th><td>[% loanlength %]</td></tr>
286 <tr><th scope="row">Rental charge</th><td>[% rentalcharge %]</td></tr></table>
287                 <form action="[% script_name %]" method="post">
288                 <input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="[% itemtype %]" />[% IF ( total ) %]
289                 </form>
290                 
291                 <form action="[% script_name %]" method="post"><input type="submit" class="approve" value="OK" /></form>
292         [% ELSE %]
293                 <input type="submit" class="approve" value="Delete this Item Type" /></form> <form action="[% script_name %]" method="post"><input type="submit" class="deny" value="Do Not Delete" /></form>
294         [% END %]
295 </div>
296         
297 [% END %]
298
299 [% IF ( else ) %]
300 <h2>Item types administration</h2>
301 [% IF ( loop ) %]
302 <table id="table_item_type">
303   <thead>
304     [% UNLESS ( noItemTypeImages ) %]<th>Image</th>[% END %]
305     <th>Code</th>
306     <th>Description</th>
307     <th>Search category</th>
308     <th>Not for loan</th>
309     <th>Hide in OPAC</th>
310     <th>Charge</th>
311     <th>Checkin message</th>
312     <th>Actions</th>
313   </thead>
314   [% FOREACH loo IN loop %]
315     <tr>
316    [% UNLESS ( noItemTypeImages ) %] <td>[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl %]" alt="" />[% ELSE %]&nbsp;[% END %]</td>[% END %]
317     <td>
318       <a href="[% loo.script_name %]?op=add_form&amp;itemtype=[% loo.itemtype |html %]">
319         [% loo.itemtype %]
320       </a>
321     </td>
322     <td>[% loo.description %]</td>
323     <td>[% loo.searchcategory %]</td>
324     <td>[% IF ( loo.notforloan ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
325     <td>[% IF ( loo.hideinopac ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
326     <td>
327     [% UNLESS ( loo.notforloan ) %]
328       [% loo.rentalcharge %]
329     [% END %]
330     </td>
331     <td>[% loo.checkinmsg | html_line_break %]</td>
332     <td>
333       <a href="[% loo.script_name %]?op=add_form&amp;itemtype=[% loo.itemtype |html %]">Edit</a>
334       <a href="[% loo.script_name %]?op=delete_confirm&amp;itemtype=[% loo.itemtype |html %]">Delete</a>
335     </td>
336   </tr>
337   [% END %]
338 </table>[% ELSE %]
339 <div class="dialog message">There are no itemtypes defined</div>
340 [% END %]
341
342 <div class="pages">[% pagination_bar %]</div>
343
344 [% END %]
345
346
347
348 </div>
349 </div>
350 <div class="yui-b">
351 [% INCLUDE 'admin-menu.inc' %]
352 </div>
353 </div>
354 [% INCLUDE 'intranet-bottom.inc' %]