5 [% USE AuthorisedValues %]
7 [% USE TablesSettings %]
8 [% PROCESS 'i18n.inc' %]
10 [% INCLUDE 'doc-head-open.inc' %]
11 <title>[% FILTER collapse %]
12 [% IF op == 'add_form' %]
14 [% tx("Modify item type '{item_type}'", { item_type = itemtype.itemtype }) | html %]
16 [% t("New item type") | html %]
19 [% IF op == 'delete_confirm' %]
21 [% tx("Cannot delete item type '{item_type}'", { item_type = itemtype.itemtype }) | html %]
23 [% tx("Confirm deletion of item type '{item_type}'?", { item_type = itemtype.itemtype }) | html %]
26 [% IF op == 'delete_confirmed' %]
27 [% t("Data deleted") | html %] ›
29 [% t("Item types") | html %] ›
30 [% t("Administration") | html %] ›
31 [% t("Koha") | html %]
33 [% INCLUDE 'doc-head-close.inc' %]
36 fieldset.rows div.toptabs li {
47 .itemtype-icons label {
55 <body id="admin_itemtypes" class="admin">
56 [% WRAPPER 'header.inc' %]
57 [% INCLUDE 'prefs-admin-search.inc' %]
60 [% WRAPPER 'sub-header.inc' %]
61 [% WRAPPER breadcrumbs %]
62 [% WRAPPER breadcrumb_item %]
63 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
66 [% IF op == 'add_form' || op == 'delete_confirm' || op == 'delete_confirmed' %]
67 [% WRAPPER breadcrumb_item %]
68 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a>
72 [% IF op == 'add_form' %]
74 [% WRAPPER breadcrumb_item bc_active= 1 %]
75 [% tx("Modify item type '{item_type}'", { item_type = itemtype.itemtype }) | html %]
78 [% WRAPPER breadcrumb_item bc_active= 1 %]
79 <span>New item type</span>
84 [% IF op == 'delete_confirm' %]
86 [% WRAPPER breadcrumb_item bc_active= 1 %]
87 [% tx("Cannot delete item type '{item_type}'", { item_type = itemtype.itemtype }) | html %]
90 [% WRAPPER breadcrumb_item bc_active= 1 %]
91 [% tx("Confirm deletion of item type '{item_type}'?", { item_type = itemtype.itemtype }) | html %]
96 [% IF op == 'delete_confirmed' %]
97 [% WRAPPER breadcrumb_item bc_active= 1 %]
98 <span>Data deleted</span>
102 [% IF op == 'list' %]
103 [% WRAPPER breadcrumb_item bc_active= 1 %]
104 <span>Item types</span>
107 [% END #/ WRAPPER breadcrumbs %]
108 [% END #/ WRAPPER sub-header.inc %]
110 <div class="main container-fluid">
112 <div class="col-sm-10 col-sm-push-2">
115 [% IF op == 'list' %]<div id="toolbar" class="btn-toolbar">
116 <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>
119 [% FOREACH m IN messages %]
120 <div class="dialog [% m.type | html %]">
122 [% CASE 'error_on_update' %]
123 <span>An error occurred when updating this item type. Perhaps the value already exists.</span>
124 [% CASE 'error_on_insert' %]
125 <span>An error occurred when inserting this item type. Perhaps the value already exists.</span>
126 [% CASE 'error_on_delete' %]
127 <span>An error occurred when deleting this item type. Check the logs for details.</span>
128 [% CASE 'success_on_update' %]
129 <span>Item type updated successfully.</span>
130 [% CASE 'success_on_insert' %]
131 <span>Item type inserted successfully.</span>
132 [% CASE 'success_on_delete' %]
133 <span>Item type deleted successfully.</span>
134 [% CASE 'already_exists' %]
135 <span>This item type already exists.</span>
136 [% CASE 'cannot_be_deleted' %]
137 <span>Cannot delete this item type. <p><strong>This record is in use</strong>. Deletion is not possible.</p></span>
139 <span>[% m.code | html %]</span>
145 [% IF op == 'add_form' %]
147 <h1>[% tx("Modify item type '{item_type}'", { item_type = itemtype.itemtype }) | html %]</h1>
149 <h1>New item type</h1>
151 <form action="/cgi-bin/koha/admin/itemtypes.pl" name="Aform" method="post" id="itemtypeentry">
152 <input type="hidden" name="op" value="add_validate" />
153 <fieldset class="rows">
157 <input type="hidden" name="is_a_modif" value="1" />
158 <span class="label">Item type: </span> <input type="hidden" name="itemtype" value="[% itemtype.itemtype | html %]" />
159 [% itemtype.itemtype | html %]
163 <label for="itemtype" class="required">Item type: </label>
164 <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" required="required" class="focus" /> <span class="required">Required</span>
168 <label for="parent_type">Parent item type: </label>
169 [% IF !is_a_parent && parent_types %]
170 <select name="parent_type" id="parent_type">
171 <option value="">None</option>
172 [% FOREACH pt IN parent_types %]
173 [% IF parent_type == pt.itemtype %]
174 <option value="[% pt.itemtype | html %]" selected="selected">[% pt.description | html %]</option>
176 <option value="[% pt.itemtype | html %]">[% pt.description | html %]</option>
180 [% ELSIF is_a_parent %]
181 <input type="text" id="parent_type" value="[% parent_type | html %]" name="parent_type" size="10" maxlength="10" disabled/>
182 <p>Is a parent to another type, cannot have a parent</p>
184 <input type="text" id="parent_type" value="[% parent_type | html %]" name="parent_type" size="10" maxlength="10" disabled/>
185 <p>No available parent types</p>
187 <div class="hint">Defining a parent type will apply checkout limits for all children as described on the circulation rules page.</div>
190 <label for="description" class="required">Description: </label>
191 <input type="text" id="description" name="description" size="48" value="[% itemtype.description | html %]" required="required" /> <span class="required">Required</span>
192 [% IF can_be_translated %]
193 <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-solid fa-pencil" aria-hidden="true"></i> Translate into other languages</a>
197 <label for="searchcategory">Search category: </label>
198 <select id="searchcategory" name="searchcategory">
199 <option value="">None</option>
200 [% FOREACH cat IN searchcategory %]
201 [% IF cat.authorised_value == itemtype.searchcategory %]
202 <option value="[% cat.authorised_value | html %]" selected="selected">
206 <option value="[% cat.authorised_value | html %]" >
213 [% IF ( CAN_user_parameters_manage_auth_values ) %]
214 <span>Options are defined by the authorized value <a target="_blank" href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=ITEMTYPECAT">ITEMTYPECAT</a>.</span>
216 <span>Options are defined by the authorized value ITEMTYPECAT.</span>
220 [% IF ( Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') ) %]
222 <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&searchfield=noItemTypeImages">noItemTypeImages or OpacNoItemTypeImages system preferences</a>
227 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
228 [% INCLUDE 'admin-icon-selection.inc' context = "itemtype" %]
231 <ol class="oladditemtype">
233 <label for="hideinopac">Hide in OPAC: </label>
234 [% IF ( itemtype.hideinopac ) %]
235 <input type="checkbox" id="hideinopac" name="hideinopac" checked="checked" value="1" />
237 <input type="checkbox" id="hideinopac" name="hideinopac" value="1" />
239 <span class="hint">If checked, items of this type will be hidden as filters in OPAC's advanced search.</span>
242 <label for="notforloan">Not for loan: </label>
243 [% IF itemtype.notforloan %]
244 <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
246 <input type="checkbox" id="notforloan" name="notforloan" value="1" />
248 <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>
251 <label for="automatic_checkin">Automatic check-in: </label>
252 [% IF itemtype.automatic_checkin %]
253 <input type="checkbox" id="automatic_checkin" name="automatic_checkin" checked="checked" value="1" />
255 <input type="checkbox" id="automatic_checkin" name="automatic_checkin" value="1" />
257 <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>
260 <label for="rentalcharge">Rental charge: </label>
261 <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% itemtype.rentalcharge | $Price on_editing => 1 %]" min="0" />
262 <div class="hint">This fee is charged once per checkout/renewal per item</div>
265 <label for="rentalcharge_daily">Daily rental charge: </label>
266 <input type="text" id="rentalcharge_daily" name="rentalcharge_daily" size="10" value="[% itemtype.rentalcharge_daily | $Price on_editing => 1 %]" min="0" />
267 <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>
270 <label for="rentalcharge_daily_calendar">Daily rentals use calendar: </label>
271 [% IF itemtype.rentalcharge_daily_calendar %]
272 <input type="checkbox" id="rentalcharge_daily_calendar" name="rentalcharge_daily_calendar" checked="checked" value="1" />
274 <input type="checkbox" id="rentalcharge_daily_calendar" name="rentalcharge_daily_calendar" value="1" />
276 <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>
279 <label for="rentalcharge_hourly">Hourly rental charge: </label>
280 <input type="text" id="rentalcharge_hourly" name="rentalcharge_hourly" size="10" value="[% itemtype.rentalcharge_hourly | $Price on_editing => 1 %]" min="0" />
281 <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>
284 <label for="rentalcharge_hourly_calendar">Hourly rentals use calendar: </label>
285 [% IF itemtype.rentalcharge_hourly_calendar %]
286 <input type="checkbox" id="rentalcharge_hourly_calendar" name="rentalcharge_hourly_calendar" checked="checked" value="1" />
288 <input type="checkbox" id="rentalcharge_hourly_calendar" name="rentalcharge_hourly_calendar" value="1" />
290 <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>
293 <label for="defaultreplacecost">Default replacement cost: </label>
294 <input type="text" id="defaultreplacecost" name="defaultreplacecost" size="10" value="[% itemtype.defaultreplacecost | $Price on_editing => 1 %]" min="0" />
297 <label for="processfee">Processing fee (when lost): </label>
298 <input type="text" id="processfee" name="processfee" size="10" value="[% itemtype.processfee | $Price on_editing => 1 %]" min="0" />
301 <label for="checkinmsg">Checkin message: </label>
302 <textarea id="checkinmsg" name="checkinmsg" cols="55" rows="5">[% itemtype.checkinmsg | html %]</textarea>
305 <label for="checkinmsgtype">Checkin message type: </label>
306 <select id="checkinmsgtype" name="checkinmsgtype">
307 [% IF itemtype.checkinmsgtype == 'message' %]
308 <option value="message" selected="selected">Message</option>
310 <option value="message">Message</option>
312 [% IF itemtype.checkinmsgtype == 'alert' %]
313 <option value="alert" selected="selected">Alert</option>
315 <option value="alert">Alert</option>
320 <label for="sip_media_type">SIP media type: </label>
321 <select id="sip_media_type" name="sip_media_type">
322 <option value=""></option>
323 [% FOREACH a IN AuthorisedValues.Get('SIP_MEDIA_TYPE') %]
324 [% IF a.authorised_value == itemtype.sip_media_type %]
325 <option value="[% a.authorised_value | html %]" selected="selected">[% a.lib | html %]</option>
327 <option value="[% a.authorised_value | html %]">[% a.lib | html %]</option>
332 <li><label for="branches">Library limitation: </label>
333 <select id="branches" name="branches" multiple size="10">
334 <option value="">All libraries</option>
335 [% PROCESS options_for_libraries libraries => Branches.all( selected => itemtype.get_library_limits, unfiltered => 1, do_not_select_my_library => 1 ) %]
337 <div class="hint">Select 'All libraries' if all libraries use this item type. Otherwise, select the specific libraries that use this item type.</div>
340 <label for="summary">Summary: </label>
341 <textarea id="summary" name="summary" cols="55" rows="5">[% itemtype.summary | html %]</textarea>
342 <div class="hint">Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </div>
343 <div class="hint"><strong><a href="[856u]">open site</a></strong> will show the link just below the title</div>
348 <fieldset class="action">
349 <input type="submit" class="btn btn-primary" value="Save changes" />
350 <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
355 [% IF op == 'delete_confirm' %]
356 <div class="dialog alert">
357 <h1>[% tx("Are you sure you want to delete item type '{item_type}'?", { item_type = itemtype.itemtype }) | html %]</h1>
360 <th scope="row">Item type</th>
361 <td>[% itemtype.itemtype | html %]</td>
363 <tr><th scope="row">Description</th><td>[% itemtype.translated_description | html %]</td></tr>
364 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
366 <th scope="row">Image</th>
368 [% SET image_location = itemtype.image_location('intranet') %]
369 [% IF image_location %]<img src="[% image_location | html %]" alt="" />[% END %]
373 <tr><th scope="row">Rental charge</th><td>[% itemtype.rentalcharge | $Price %]</td></tr>
375 <form action="/cgi-bin/koha/admin/itemtypes.pl" method="post">
376 <input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="[% itemtype.itemtype | html %]" />
377 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this item type</button>
379 <form action="/cgi-bin/koha/admin/itemtypes.pl" method="post">
380 <button type="submit" class="deny"><i class="fa fa-fw fa-times"></i> No, do not delete</button>
385 [% IF op == 'list' %]
388 <div class="page-section">
389 <table id="table_item_type">
391 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]<th class="noExport">Image</th>[% END %]
395 <th>Search category</th>
396 <th>Not for loan</th>
397 <th>Hide in OPAC</th>
398 <th>Rental charge</th>
399 <th>Daily rental charge</th>
400 <th>Hourly rental charge</th>
401 <th>Default replacement cost</th>
402 <th>Processing fee (when lost)</th>
403 <th>Checkin message</th>
404 <th>Library limitations</th>
405 <th>Automatic check-in</th>
406 <th class="noExport NoSort">Actions</th>
408 [% FOREACH itemtype IN itemtypes %]
410 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
412 [% SET image_location = itemtype.image_location('intranet') %]
413 [% IF image_location %]<img src="[% image_location | html %]" alt="" />[% ELSE %] [% END %]
417 [% IF itemtype.parent_type %]
418 [% IF itemtype.parent.translated_descriptions.size %]
419 [% itemtype.parent.description | html %] <span>(default)</span><br/>
421 [% itemtype.parent.description | html %]
424 [% IF itemtype.translated_descriptions.size %]
425 [% itemtype.description | html %] <span>(default)</span><br/>
426 [% FOR description IN itemtype.translated_descriptions %]
427 [% IF description.translation == itemtype.translated_description %]
428 -- <strong>[% description.translation | html %]</strong>
430 -- [% description.translation | html %] ([% description.lang | html %])
435 -- [% itemtype.description | html %]
438 [% IF itemtype.translated_descriptions.size %]
439 [% itemtype.description | html %] <span>(default)</span><br/>
440 [% FOR description IN itemtype.translated_descriptions %]
441 [% IF description.translation == itemtype.translated_description %]
442 <strong>[% description.translation | html %]</strong>
444 [% description.translation | html %] ([% description.lang | html %])
449 [% itemtype.description | html %]
454 <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=[% itemtype.itemtype | uri %]">
455 [% itemtype.itemtype | html %]
459 [% itemtype.parent_type | html %]
461 <td>[% AuthorisedValues.GetByCode( 'ITEMTYPECAT', itemtype.searchcategory ) | html %]</td>
462 <td>[% IF ( itemtype.notforloan ) %]Yes[% ELSE %] [% END %]</td>
463 <td>[% IF ( itemtype.hideinopac ) %]Yes[% ELSE %] [% END %]</td>
465 [% UNLESS ( itemtype.notforloan ) %]
466 [% itemtype.rentalcharge | $Price %]
470 [% UNLESS ( itemtype.notforloan ) %]
471 [% itemtype.rentalcharge_daily | $Price %]
475 [% UNLESS ( itemtype.notforloan ) %]
476 [% itemtype.rentalcharge_hourly | $Price %]
480 <td>[% itemtype.defaultreplacecost | $Price %]</td>
481 <td>[% itemtype.processfee | $Price %]</td>
482 <td>[% itemtype.checkinmsg | html_line_break | $raw %]</td>
484 [% SET library_limits = itemtype.library_limits %]
485 [% IF library_limits.count > 0 %]
486 [% library_str = "" %]
487 [% FOREACH library IN library_limits %]
488 [%- IF loop.first -%]
489 [% library_str = library.branchname _ " (" _ library.branchcode _ ")" %]
491 [% library_str = library_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %]
494 <span class="library_limitation" title="[% library_str | html %]">
495 [% IF library_limits.count > 1 %]
496 <span>[% library_limits.count | html %] library limitations</span>
498 <span>[% library_limits.count | html %] library limitation</span>
501 <span>No limitation</span>
504 <td>[% IF ( itemtype.automatic_checkin ) %]Yes[% ELSE %] [% END %]</td>
506 <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=[% itemtype.itemtype | uri %]" class="btn btn-default btn-xs"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
507 <a href="/cgi-bin/koha/admin/itemtypes.pl?op=delete_confirm&itemtype=[% itemtype.itemtype | uri %]" class="btn btn-default btn-xs"><i class="fa fa-trash-can"></i> Delete</a>
514 <div class="dialog message">There are no itemtypes defined</div>
519 </div> <!-- /.col-sm-10.col-sm-push-2 -->
521 <div class="col-sm-2 col-sm-pull-10">
523 [% INCLUDE 'admin-menu.inc' %]
525 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
526 </div> <!-- /.row -->
528 [% MACRO jsinclude BLOCK %]
529 [% Asset.js("js/admin-menu.js") | $raw %]
530 [% INCLUDE 'greybox.inc' %]
531 [% INCLUDE 'datatables.inc' %]
532 [% INCLUDE 'columns_settings.inc' %]
534 $(document).ready(function() {
535 var table_settings = [% TablesSettings.GetTableSettings( 'admin', 'itemtypes', 'table_item_type', 'json' ) | $raw %];
536 [% IF ( Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') ) %]
537 table_settings['columns'].shift(); // Remove item type image column from configuration
540 $(document).ready(function() {
541 KohaTable("table_item_type", {
542 "sPaginationType": "full"
546 $( "#itemtypeentry" ).validate({
548 itemtype: { required: true },
549 description: { required: true },
550 rentalcharge: { number: true },
551 rentalcharge_hourly: { number: true },
552 defaultreplacecost: { number: true },
553 processfee: { number: true }
556 $("#itemtype").on("blur",function(){
559 $(".library_limitation").tooltip();
560 if( $("#icons .tab-pane.active").length < 1 ){
561 $("#icons a:first").tab("show");
567 [% INCLUDE 'intranet-bottom.inc' %]