Bug 21946: Update Administration->Item types to allow for defining parent types
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / itemtypes.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE AuthorisedValues %]
5 [% USE Price %]
6 [% USE TablesSettings %]
7 [% SET footerjs = 1 %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Koha &rsaquo; Administration &rsaquo; Item types [% IF op == 'add_form' %]&rsaquo;
10   [% IF ( itemtype ) %]
11 Modify item type '[% itemtype.itemtype | html %]'
12   [% ELSE %]
13 Add item type
14   [% END %]
15 [% END %]
16 [% IF op == 'delete_confirm' %]&rsaquo;
17   [% IF ( total ) %]
18 Cannot delete item type '[% itemtype.itemtype | html %]'
19   [% ELSE %]
20 Delete item type '[% itemtype.itemtype | html %]'?
21   [% END %]
22 [% END %]
23 [% IF op == 'delete_confirmed' %]&rsaquo;
24 Data deleted
25 [% END %]
26 </title>
27 [% INCLUDE 'doc-head-close.inc' %]
28 <style>
29         fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; }
30   fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-active {background-color : #F4F8F9; }
31         fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;}
32   fieldset.rows .ui-tabs-nav { margin-left : 10px; }
33 </style>
34 </head>
35
36 <body id="admin_itemtypes" class="admin">
37 [% INCLUDE 'header.inc' %]
38 [% INCLUDE 'prefs-admin-search.inc' %]
39
40 <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 op == 'add_form' %]
41   [% IF itemtype %]
42 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Modify item type '[% itemtype.itemtype | html %]'
43   [% ELSE %]
44 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Add item type
45   [% END %]
46 [% END %]
47 [% IF op == 'delete_confirm' %]
48   [% IF total %]
49 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Cannot delete item type '[% itemtype.itemtype | html %]'
50   [% ELSE %]
51 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Delete item type '[% itemtype.itemtype | html %]'?
52   [% END %]
53 [% END %]
54 [% IF op == 'delete_confirmed' %]
55 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo;Data deleted
56 [% END %]
57 [% IF op == 'list' %]
58 Item types administration
59 [% END %]</div>
60
61 <div class="main container-fluid">
62     <div class="row">
63         <div class="col-sm-10 col-sm-push-2">
64             <main>
65
66 [% IF op == 'list' %]<div id="toolbar" class="btn-toolbar">
67     <a class="btn btn-default" id="newitemtype" href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form"><i class="fa fa-plus"></i> New item type</a>
68 </div>[% END %]
69
70 [% FOREACH m IN messages %]
71     <div class="dialog [% m.type | html %]">
72         [% SWITCH m.code %]
73         [% CASE 'error_on_update' %]
74             An error occurred when updating this item type. Perhaps the value already exists.
75         [% CASE 'error_on_insert' %]
76             An error occurred when inserting this item type. Perhaps the value already exists.
77         [% CASE 'error_on_delete' %]
78             An error occurred when deleting this item type. Check the logs.
79         [% CASE 'success_on_update' %]
80             Item type updated successfully.
81         [% CASE 'success_on_insert' %]
82             Item type inserted successfully.
83         [% CASE 'success_on_delete' %]
84             Item type deleted successfully.
85         [% CASE 'already_exists' %]
86             This item type already exists.
87         [% CASE 'cannot_be_deleted' %]
88             Cannot delete this item type. <p><strong>This record is in use</strong>. Deletion is not possible.</p>
89         [% CASE %]
90             [% m.code | html %]
91         [% END %]
92     </div>
93 [% END %]
94
95
96 [% IF op == 'add_form' %]
97     [% IF itemtype %]
98         <h3>Modify item type</h3>
99     [% ELSE %]
100         <h3>Add item type</h3>
101     [% END %]
102     <form action="/cgi-bin/koha/admin/itemtypes.pl" name="Aform" method="post" id="itemtypeentry">
103         <input type="hidden" name="op" value="add_validate" />
104         <fieldset class="rows">
105             <ol>
106                 [% IF itemtype %]
107                     <li>
108                         <input type="hidden" name="is_a_modif" value="1" />
109                         <span class="label">Item type: </span> <input type="hidden" name="itemtype" value="[% itemtype.itemtype | html %]" />
110                         [% itemtype.itemtype | html %]
111                     </li>
112                 [% ELSE %]
113                     <li>
114                         <label for="itemtype" class="required">Item type: </label>
115                         <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" required="required" /> <span class="required">Required</span>
116                     </li>
117                 [% END %]
118                 <li>
119                     <label for="parent_type">Parent item type: </label>
120                     [% IF !is_a_parent && parent_types %]
121                     <select name="parent_type" id="parent_type">
122                         <option value="">None</option>
123                         [% FOREACH pt IN parent_types %]
124                             [% IF parent_type == pt.itemtype %]
125                                 <option value="[% pt.itemtype | html %]" selected="selected">[% pt.description | html %]</option>
126                             [% ELSE %]
127                                 <option value="[% pt.itemtype | html %]">[% pt.description | html %]</option>
128                             [% END %]
129                         [% END %]
130                     </select>
131                     [% ELSIF is_a_parent %]
132                     <input type="text" id="parent_type" value="[% parent_type | html %]" name="parent_type" size="10" maxlength="10" disabled/>
133                     <p>Is a parent to another type, cannot have a parent</p>
134                     [% ELSE %]
135                     <input type="text" id="parent_type" value="[% parent_type | html %]" name="parent_type" size="10" maxlength="10" disabled/>
136                     <p>No available parent types</p>
137                     [% END %]
138                 </li>
139                 <li>
140                     <label for="description" class="required">Description: </label>
141                     <input type="text" id="description" name="description" size="48" value="[% itemtype.description | html %]" required="required" /> <span class="required">Required</span>
142                     [% IF can_be_translated %]
143                         <a href="/cgi-bin/koha/admin/localization.pl?entity=itemtypes&code=[% itemtype.itemtype | uri %]" title="Translate item type [% itemtype.itemtype | html %]" rel="gb_page_center[600,500]"><i class="fa fa-pencil"></i> Translate into other languages</a>
144                     [% END %]
145                 </li>
146                 <li>
147                     <span class="label">Search category</span>
148                     <select id="searchcategory" name="searchcategory">
149                     <option value="">None</option>
150                         [% FOREACH cat IN searchcategory %]
151                             [% IF cat.authorised_value == itemtype.searchcategory %]
152                                 <option value="[% cat.authorised_value | html %]" selected="selected">
153                                     [% cat.lib | html %]
154                                 </option>
155                             [% ELSE %]
156                                 <option value="[% cat.authorised_value | html %]" >
157                                     [% cat.lib | html %]
158                                 </option>
159                             [% END %]
160                         [% END %]
161                     </select>
162                     <span class="hint">Options are defined as the authorized values for the ITEMTYPECAT category.</span>
163                 </li>
164                 [% IF ( Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') ) %]
165                     <li>
166                         <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 or OpacNoItemTypeImages system preferences</a>
167                     </li>
168                 [% END %]
169             </ol>
170             [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
171                 <div id="icons" class="toptabs" style="clear:both">
172                     <h5 style="margin-left:10px;">Choose an icon:</h5>
173                     <ul>
174                         <li><a href="#none">None</a></li>
175                         [% FOREACH imageset IN imagesets %]
176                             [% IF ( imageset.imagesetactive ) %]
177                                 <li class="ui-tabs-active">
178                             [% ELSE %]
179                                 <li>
180                             [% END %]
181                             <a href="#[% imageset.imagesetname | uri %]">[% imageset.imagesetname | html %]</a>
182                             </li>
183                         [% END %]
184                         [% IF itemtype.image_location('intranet').match('^http') %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#remote">Remote image</a></li>
185                     </ul>
186                     <div id="none">
187                         <ul>
188                             <li><label for="noimage">No image: </label><input type="radio" name="image" id="noimage" value="removeImage" /></li>
189                         </ul>
190                         <br class="clear" />
191                     </div>
192
193                     [% FOREACH imageset IN imagesets %]
194                         <div id="[% imageset.imagesetname | html %]">
195                             <ul>
196                                 [% FOREACH image IN imageset.images %]
197                                     <li style="float: none; display: inline-block; clear : none; width: auto;">
198                                         <label>
199                                             [% IF image.StaffImageUrl %]
200                                                 <img src="[% image.StaffImageUrl | html %]" alt="[% image.StaffImageUrl | html %]" title="[% image.StaffImageUrl | html %]" />
201                                             [% END %]
202                                             [% IF image.checked %]
203                                                 <input type="radio" name="image" value="[% image.KohaImage | html %]" checked="checked" />
204                                             [% ELSIF image.KohaImage %] <!-- to delete the radio button if there is no image after -->
205                                                 <input type="radio" name="image" value="[% image.KohaImage | html %]" />
206                                             [% END %]
207                                         </label>
208                                     </li>
209                                 [% END %]
210                             </ul>
211                             <br class="clear" />
212                         </div>
213                     [% END %]
214
215                     <div id="remote">
216                         <ul>
217                             <li>
218                                 <label for="remote_image_check"> Remote image:</label>
219                                 [% SET image_location = itemtype.image_location('intranet') %]
220                                 [% IF image_location.match('^http') %]
221                                     <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />
222                                     <input type="text" name="remoteImage" size="48" maxlength="200" value="[% image_location | html %]" onmousedown="document.getElementById('remote_image_check').checked = true;" />
223                                     [% IF itemtype.imageurl %]
224                                         <img src="[% image_location | html %]" alt="" />
225                                     [% END %]
226                                 [% ELSE %]
227                                     <input type="radio" id="remote_image_check" name="image" value="remoteImage" />
228                                     <input type="text" name="remoteImage" size="48" maxlength="200" value="" onmousedown="document.getElementById('remote_image_check').checked = true;" />
229                                 [% END %]
230                             </li>
231                         </ul>
232                         <br class="clear" />
233                     </div>
234                 </div>
235             [% END %]
236             <ol class="oladditemtype">
237                 <li>
238                     <label for="hideinopac">Hide in OPAC: </label>
239                     [% IF ( itemtype.hideinopac ) %]
240                         <input type="checkbox" id="hideinopac" name="hideinopac" checked="checked" value="1" />
241                     [% ELSE %]
242                         <input type="checkbox" id="hideinopac" name="hideinopac" value="1" />
243                     [% END %]
244                     <span class="hint">If checked, items of this type will be hidden as filters in OPAC's advanced search.</span>
245                 </li>
246                 <li>
247                     <label for="notforloan">Not for loan: </label>
248                         [% IF itemtype.notforloan %]
249                             <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
250                         [% ELSE %]
251                             <input type="checkbox" id="notforloan" name="notforloan" value="1" />
252                         [% END %]
253                         <span class="hint">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.</span>
254                 </li>
255                 <li>
256                     <label for="rentalcharge">Rental charge: </label>
257                     <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% itemtype.rentalcharge | $Price on_editing => 1 %]" />
258                     <span class="hint">This fee is charged once per checkout/renewal per item</span>
259                 </li>
260                 <li>
261                     <label for="rentalcharge_daily">Daily rental charge: </label>
262                     <input type="text" id="rentalcharge_daily" name="rentalcharge_daily" size="10" value="[% itemtype.rentalcharge_daily | $Price on_editing => 1 %]" />
263                     <span class="hint">This fee is charged at checkout/renewal time for each day between the checkout/renewal date and due date for loans specified in days.</span>
264                 </li>
265                 <li>
266                     <label for="rentalcharge_daily_calendar">Daily rentals use calendar: </label>
267                         [% IF itemtype.rentalcharge_daily_calendar %]
268                             <input type="checkbox" id="rentalcharge_daily_calendar" name="rentalcharge_daily_calendar" checked="checked" value="1" />
269                         [% ELSE %]
270                             <input type="checkbox" id="rentalcharge_daily_calendar" name="rentalcharge_daily_calendar" value="1" />
271                         [% END %]
272                         <span class="hint">If checked, daily charge will be calculated using the calendar to exclude holidays. If not checked, the fee will be calculated based on the number of days until due, directly.</span>
273                 </li>
274                 <li>
275                     <label for="rentalcharge_hourly">Hourly rental charge: </label>
276                     <input type="text" id="rentalcharge_hourly" name="rentalcharge_hourly" size="10" value="[% itemtype.rentalcharge_hourly | $Price on_editing => 1 %]" />
277                     <span class="hint">This fee is charged at checkout/renewal time for each hour between the checkout/renewal date and due date for loans specified in hours.</span>
278                 </li>
279                 <li>
280                     <label for="rentalcharge_hourly_calendar">Hourly rentals use calendar: </label>
281                         [% IF itemtype.rentalcharge_hourly_calendar %]
282                             <input type="checkbox" id="rentalcharge_hourly_calendar" name="rentalcharge_hourly_calendar" checked="checked" value="1" />
283                         [% ELSE %]
284                             <input type="checkbox" id="rentalcharge_hourly_calendar" name="rentalcharge_hourly_calendar" value="1" />
285                         [% END %]
286                         <span class="hint">If checked, hourly charge will be calculated using the calendar to exclude holidays. If not checked, the fee will be calculated based on the number of hours until due, directly.</span>
287                 </li>
288                 <li>
289                     <label for="defaultreplacecost">Default replacement cost: </label>
290                     <input type="text" id="defaultreplacecost" name="defaultreplacecost" size="10" value="[% itemtype.defaultreplacecost | html %]" />
291                 </li>
292                 <li>
293                     <label for="processfee">Processing fee (when lost): </label>
294                     <input type="text" id="processfee" name="processfee" size="10" value="[% itemtype.processfee | html %]" />
295                 </li>
296                 <li>
297                     <label for="checkinmsg">Checkin message: </label>
298                     <textarea id="checkinmsg" name="checkinmsg" cols="55" rows="5">[% itemtype.checkinmsg | html %]</textarea>
299                 </li>
300                 <li>
301                     <label for="checkinmsgtype">Checkin message type: </label>
302                     <select type="text" id="checkinmsgtype" name="checkinmsgtype">
303                         [% IF itemtype.checkinmsgtype == 'message' %]
304                             <option value="message" selected="selected">Message</option>
305                         [% ELSE %]
306                             <option value="message">Message</option>
307                         [% END %]
308                         [% IF itemtype.checkinmsgtype == 'alert' %]
309                             <option value="alert" selected="selected">Alert</option>
310                         [% ELSE %]
311                             <option value="alert">Alert</option>
312                         [% END %]
313                     </select>
314                 </li>
315                 <li>
316                     <label for="sip_media_type">SIP media type: </label>
317                     <select id="sip_media_type" name="sip_media_type">
318                         <option value=""></option>
319                         [% FOREACH a IN AuthorisedValues.Get('SIP_MEDIA_TYPE') %]
320                             [% IF a.authorised_value == itemtype.sip_media_type %]
321                                 <option value="[% a.authorised_value | html %]" selected="selected">[% a.lib | html %]</option>
322                             [% ELSE %]
323                                 <option value="[% a.authorised_value | html %]">[% a.lib | html %]</option>
324                             [% END %]
325                         [% END %]
326                     </select>
327                 </li>
328                 <li><label for="branches">Library limitation: </label>
329                     <select id="branches" name="branches" multiple size="10">
330                         <option value="">All libraries</option>
331                         [% FOREACH branch IN branches_loop %]
332                         [% IF ( branch.selected ) %]
333                             <option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
334                         [% ELSE %]
335                             <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
336                         [% END %]
337                         [% END %]
338                     </select>
339                     <span class="hint">Select 'All libraries' if all libraries use this item type. Otherwise, select the specific libraries that use this item type.</span>
340                 </li>
341                 <li>
342                     <label for="summary">Summary: </label>
343                    <textarea id="summary" name="summary" cols="55" rows="5">[% itemtype.summary | html %]</textarea>
344                     <p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
345                     <p><b>&lt;a href="[856u]"&gt;open site&lt;/a&gt;</b> will show the link just below the title</p>
346                 </li>
347             </ol>
348         </fieldset>
349
350         <fieldset class="action">
351             <input type="submit" value="Save changes" />
352             <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
353         </fieldset>
354     </form>
355 [% END %]
356
357 [% IF op == 'delete_confirm' %]
358     <div class="dialog alert">
359         <h3>Delete item type '[% itemtype.itemtype | html %]'?</h3>
360         <table>
361             <tr>
362                 <th scope="row">Item type</th>
363                 <td>[% itemtype.itemtype | html %]</td>
364             </tr>
365             <tr><th scope="row">Description</th><td>[% itemtype.translated_description | html %]</td></tr>
366             [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
367                 <tr>
368                     <th scope="row">Image</th>
369                     <td>
370                         [% SET image_location = itemtype.image_location('intranet') %]
371                         [% IF image_location %]<img src="[% image_location | html %]" alt="" />[% END %]
372                     </td>
373                 </tr>
374             [% END %]
375             <tr><th scope="row">Rental charge</th><td>[% itemtype.rentalcharge | $Price %]</td></tr>
376         </table>
377         <form action="/cgi-bin/koha/admin/itemtypes.pl" method="post">
378             <input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="[% itemtype.itemtype | html %]" />
379             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this item type</button>
380         </form>
381         <form action="/cgi-bin/koha/admin/itemtypes.pl" method="post">
382             <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
383         </form>
384     </div>
385 [% END %]
386
387 [% IF op == 'list' %]
388     <h2>Item types administration</h2>
389     [% IF itemtypes %]
390         <table id="table_item_type">
391           <thead>
392             [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]<th class="noExport">Image</th>[% END %]
393             <th>Description</th>
394             <th>Code</th>
395             <th>Parent code</th>
396             <th>Search category</th>
397             <th>Not for loan</th>
398             <th>Hide in OPAC</th>
399             <th>Rental charge</th>
400             <th>Daily rental charge</th>
401             <th>Hourly rental charge</th>
402             <th>Default replacement cost</th>
403             <th>Processing fee (when lost)</th>
404             <th>Checkin message</th>
405             <th>Library limitations</th>
406             <th class="noExport">Actions</th>
407           </thead>
408           [% FOREACH itemtype IN itemtypes %]
409             <tr>
410                 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
411                     <td>
412                         [% SET image_location = itemtype.image_location('intranet') %]
413                         [% IF image_location %]<img src="[% image_location | html %]" alt="" />[% ELSE %]&nbsp;[% END %]
414                     </td>
415                 [% END %]
416             <td>
417                 [% IF itemtype.parent_type %]
418                     [% IF itemtype.parent.translated_descriptions.size %]
419                         [% itemtype.parent.description | html %] (default)<br/>
420                     [% ELSE %]
421                         [% itemtype.parent.description | html %]
422                     [% END %]
423                     </br>
424                     [% IF itemtype.translated_descriptions.size %]
425                         [% itemtype.description | html %] (default)<br/>
426                         [% FOR description IN itemtype.translated_descriptions %]
427                             [% IF description.translation == itemtype.translated_description %]
428                             --    <b>[% description.translation | html %]</b>
429                             [% ELSE %]
430                             --    [% description.translation | html %] ([% description.lang | html %])
431                             [% END %]
432                             <br/>
433                         [% END %]
434                     [% ELSE %]
435                     --    [% itemtype.description | html %]
436                     [% END %]
437                 [% ELSE %]
438                     [% IF itemtype.translated_descriptions.size %]
439                         [% itemtype.description | html %] (default)<br/>
440                         [% FOR description IN itemtype.translated_descriptions %]
441                             [% IF description.translation == itemtype.translated_description %]
442                                 <b>[% description.translation | html %]</b>
443                             [% ELSE %]
444                                 [% description.translation | html %] ([% description.lang | html %])
445                             [% END %]
446                             <br/>
447                         [% END %]
448                     [% ELSE %]
449                         [% itemtype.description | html %]
450                     [% END %]
451                 [% END %]
452             </td>
453             <td>
454               <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&amp;itemtype=[% itemtype.itemtype | uri %]">
455                 [% itemtype.itemtype | html %]
456               </a>
457             </td>
458             <td>
459                 [% itemtype.parent_type | html %]
460             </td>
461             <td>[% itemtype.searchcategory | html %]</td>
462             <td>[% IF ( itemtype.notforloan ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
463             <td>[% IF ( itemtype.hideinopac ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
464             <td>
465             [% UNLESS ( itemtype.notforloan ) %]
466               [% itemtype.rentalcharge | $Price %]
467             [% END %]
468             </td>
469             <td>
470             [% UNLESS ( itemtype.notforloan ) %]
471               [% itemtype.rentalcharge_daily | $Price %]
472             [% END %]
473             </td>
474             <td>
475             [% UNLESS ( itemtype.notforloan ) %]
476               [% itemtype.rentalcharge_hourly | $Price %]
477             [% END %]
478             </td>
479
480             <td>[% itemtype.defaultreplacecost | $Price %]</td>
481             <td>[% itemtype.processfee | $Price %]</td>
482             <td>[% itemtype.checkinmsg | html_line_break | $raw %]</td>
483             <td>
484                 [% IF itemtype.library_limits %]
485                     [% libraries_str = "" %]
486                     [% FOREACH library IN itemtype.library_limits %]
487                         [%- IF loop.first -%]
488                         [% libraries_str = library.branchname _ " (" _ library.branchcode _ ")" %]
489                         [% ELSE %]
490                         [% libraries_str = libraries_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %]
491                         [% END %]
492                     [% END %]
493                     <span class="library_limitation" title="[% libraries_str | html %]">
494                         [% IF itemtype.library_limits.count > 1 %]
495                             [% itemtype.library_limits.count | html %] library limitations
496                         [% ELSE %]
497                             [% itemtype.library_limits.count | html %] library limitation
498                         [% END %]
499                 [% ELSE %]
500                     No limitation
501                 [% END %]
502             </td>
503             <td class="actions">
504               <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&amp;itemtype=[% itemtype.itemtype | uri %]" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
505               <a href="/cgi-bin/koha/admin/itemtypes.pl?op=delete_confirm&amp;itemtype=[% itemtype.itemtype | uri %]" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
506             </td>
507           </tr>
508           [% END %]
509         </table>
510     [% ELSE %]
511         <div class="dialog message">There are no itemtypes defined</div>
512     [% END %]
513 [% END %]
514
515             </main>
516         </div> <!-- /.col-sm-10.col-sm-push-2 -->
517
518         <div class="col-sm-2 col-sm-pull-10">
519             <aside>
520                 [% INCLUDE 'admin-menu.inc' %]
521             </aside>
522         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
523      </div> <!-- /.row -->
524
525 [% MACRO jsinclude BLOCK %]
526     [% Asset.js("js/admin-menu.js") | $raw %]
527     [% INCLUDE 'greybox.inc' %]
528     [% INCLUDE 'datatables.inc' %]
529     [% INCLUDE 'columns_settings.inc' %]
530     <script>
531          $(document).ready(function() {
532             $('#icons').tabs();
533             var columns_settings = [% TablesSettings.GetColumns( 'admin', 'itemtypes', 'table_item_type', 'json' ) | $raw %];
534             [% IF ( Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') ) %]
535                 columns_settings.shift(); // Remove item type image column from configuration
536             [% END %]
537
538             $(document).ready(function() {
539                 KohaTable("table_item_type", {
540                     "aoColumnDefs": [
541                         { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
542                     ],
543                 "aaSorting": [[ 1, "asc" ]],
544                 "iDisplayLength": 10,
545                 "sPaginationType": "full"
546                 }, columns_settings);
547             });
548
549             $( "#itemtypeentry" ).validate({
550                 rules: {
551                     itemtype: { required: true },
552                     description: { required: true },
553                     rentalcharge: { number: true }
554                 }
555             });
556             $("#itemtype").on("blur",function(){
557                 toUC(this);
558             });
559             $(".library_limitation").tooltip();
560          });
561     </script>
562 [% END %]
563
564 [% INCLUDE 'intranet-bottom.inc' %]