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