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