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