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