5 [% USE AuthorisedValues %]
7 [% USE TablesSettings %]
9 [% INCLUDE 'doc-head-open.inc' %]
11 [% IF op == 'add_form' %]
13 Modify item type '[% itemtype.itemtype | html %]'
16 [% END %] › [% END %]
17 [% IF op == 'delete_confirm' %]
19 Cannot delete item type '[% itemtype.itemtype | html %]'
21 Delete item type '[% itemtype.itemtype | html %]'?
22 [% END %] › [% END %]
23 [% IF op == 'delete_confirmed' %]
24 Data deleted › [% END %]
25 Item types › Administration › Koha
27 [% INCLUDE 'doc-head-close.inc' %]
30 fieldset.rows div.toptabs li {
41 .itemtype-icons label {
49 <body id="admin_itemtypes" class="admin">
50 [% WRAPPER 'header.inc' %]
51 [% INCLUDE 'prefs-admin-search.inc' %]
54 [% WRAPPER 'sub-header.inc' %]
55 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
58 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
61 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
64 [% IF op == 'add_form' %]
66 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a>
70 <a href="#" aria-current="page">
71 Modify item type '[% itemtype.itemtype | html %]'
76 <a href="#" aria-current="page">
83 [% IF op == 'delete_confirm' %]
85 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a>
89 <a href="#" aria-current="page">
90 Cannot delete item type '[% itemtype.itemtype | html %]'
95 <a href="#" aria-current="page">
96 Delete item type '[% itemtype.itemtype | html %]'?
102 [% IF op == 'delete_confirmed' %]
104 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a>
107 <a href="#" aria-current="page">
113 [% IF op == 'list' %]
115 <a href="#" aria-current="page">
116 Item types administration
124 <div class="main container-fluid">
126 <div class="col-sm-10 col-sm-push-2">
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>
133 [% FOREACH m IN messages %]
134 <div class="dialog [% m.type | html %]">
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>
153 <span>[% m.code | html %]</span>
159 [% IF op == 'add_form' %]
161 <h1>Modify item type</h1>
163 <h1>Add item type</h1>
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">
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 %]
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>
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>
190 <option value="[% pt.itemtype | html %]">[% pt.description | html %]</option>
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>
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>
201 <div class="hint">Defining a parent type will apply checkout limits for all children as described on the circulation rules page.</div>
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>
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">
220 <option value="[% cat.authorised_value | html %]" >
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>
230 <span>Options are defined by the authorized value ITEMTYPECAT.</span>
234 [% IF ( Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') ) %]
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&searchfield=noItemTypeImages">noItemTypeImages or OpacNoItemTypeImages system preferences</a>
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>
247 [% FOREACH imageset IN imagesets %]
248 [% IF ( imageset.imagesetactive ) %]
249 <li role="presentation" class="active">
251 <li role="presentation">
253 <a aria-controls="[% imageset.imagesetname | uri %]" role="tab" data-toggle="tab" href="#[% imageset.imagesetname | uri %]">[% imageset.imagesetname | html %]</a>
256 [% IF itemtype.image_location('intranet').match('^http') %]
257 <li role="presentation" class="active">
259 <li role="presentation">
261 <a aria-controls="remote" role="tab" data-toggle="tab" href="#remote">Remote image</a>
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" />
271 </div> <!-- /.tab-pane -->
273 [% FOREACH imageset IN imagesets %]
274 [% IF ( imageset.imagesetactive ) %]
275 <div id="[% imageset.imagesetname | html %]" role="tabpanel" class="tab-pane active">
277 <div id="[% imageset.imagesetname | html %]" role="tabpanel" class="tab-pane">
279 <div class="itemtype-icons">
280 [% FOREACH image IN imageset.images %]
282 [% IF image.StaffImageUrl %]
283 <img src="[% image.StaffImageUrl | html %]" alt="[% image.StaffImageUrl | html %]" title="[% image.StaffImageUrl | html %]" />
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 %]" />
291 [% END #/ FOREACH image %]
292 </div> <!-- /.itemtype-icons -->
293 </div> <!-- /.tab-pane -->
294 [% END #/FOREACH imageset %]
296 [% SET image_location = itemtype.image_location('intranet') %]
297 [% IF image_location.match('^http') %]
298 <div id="remote" role="tabpanel" class="tab-pane active">
300 <div id="remote" role="tabpanel" class="tab-pane">
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="" />
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;" />
313 </div> <!-- /#remote -->
314 </div> <!-- /.tab-content -->
315 </div> <!-- /#icons -->
317 <ol class="oladditemtype">
319 <label for="hideinopac">Hide in OPAC: </label>
320 [% IF ( itemtype.hideinopac ) %]
321 <input type="checkbox" id="hideinopac" name="hideinopac" checked="checked" value="1" />
323 <input type="checkbox" id="hideinopac" name="hideinopac" value="1" />
325 <span class="hint">If checked, items of this type will be hidden as filters in OPAC's advanced search.</span>
328 <label for="notforloan">Not for loan: </label>
329 [% IF itemtype.notforloan %]
330 <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
332 <input type="checkbox" id="notforloan" name="notforloan" value="1" />
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>
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" />
341 <input type="checkbox" id="automatic_checkin" name="automatic_checkin" value="1" />
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>
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>
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>
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" />
360 <input type="checkbox" id="rentalcharge_daily_calendar" name="rentalcharge_daily_calendar" value="1" />
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>
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>
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" />
374 <input type="checkbox" id="rentalcharge_hourly_calendar" name="rentalcharge_hourly_calendar" value="1" />
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>
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" />
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" />
387 <label for="checkinmsg">Checkin message: </label>
388 <textarea id="checkinmsg" name="checkinmsg" cols="55" rows="5">[% itemtype.checkinmsg | html %]</textarea>
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>
396 <option value="message">Message</option>
398 [% IF itemtype.checkinmsgtype == 'alert' %]
399 <option value="alert" selected="selected">Alert</option>
401 <option value="alert">Alert</option>
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>
413 <option value="[% a.authorised_value | html %]">[% a.lib | html %]</option>
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 ) %]
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>
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><a href="[856u]">open site</a></strong> will show the link just below the title</div>
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>
441 [% IF op == 'delete_confirm' %]
442 <div class="dialog alert">
443 <h1>Delete item type '[% itemtype.itemtype | html %]'?</h1>
446 <th scope="row">Item type</th>
447 <td>[% itemtype.itemtype | html %]</td>
449 <tr><th scope="row">Description</th><td>[% itemtype.translated_description | html %]</td></tr>
450 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
452 <th scope="row">Image</th>
454 [% SET image_location = itemtype.image_location('intranet') %]
455 [% IF image_location %]<img src="[% image_location | html %]" alt="" />[% END %]
459 <tr><th scope="row">Rental charge</th><td>[% itemtype.rentalcharge | $Price %]</td></tr>
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>
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>
471 [% IF op == 'list' %]
472 <h1>Item types administration</h1>
474 <div class="page-section">
475 <table id="table_item_type">
477 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]<th class="noExport">Image</th>[% END %]
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>
494 [% FOREACH itemtype IN itemtypes %]
496 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
498 [% SET image_location = itemtype.image_location('intranet') %]
499 [% IF image_location %]<img src="[% image_location | html %]" alt="" />[% ELSE %] [% END %]
503 [% IF itemtype.parent_type %]
504 [% IF itemtype.parent.translated_descriptions.size %]
505 [% itemtype.parent.description | html %] <span>(default)</span><br/>
507 [% itemtype.parent.description | html %]
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>
516 -- [% description.translation | html %] ([% description.lang | html %])
521 -- [% itemtype.description | html %]
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>
530 [% description.translation | html %] ([% description.lang | html %])
535 [% itemtype.description | html %]
540 <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=[% itemtype.itemtype | uri %]">
541 [% itemtype.itemtype | html %]
545 [% itemtype.parent_type | html %]
547 <td>[% AuthorisedValues.GetByCode( 'ITEMTYPECAT', itemtype.searchcategory ) | html %]</td>
548 <td>[% IF ( itemtype.notforloan ) %]Yes[% ELSE %] [% END %]</td>
549 <td>[% IF ( itemtype.hideinopac ) %]Yes[% ELSE %] [% END %]</td>
551 [% UNLESS ( itemtype.notforloan ) %]
552 [% itemtype.rentalcharge | $Price %]
556 [% UNLESS ( itemtype.notforloan ) %]
557 [% itemtype.rentalcharge_daily | $Price %]
561 [% UNLESS ( itemtype.notforloan ) %]
562 [% itemtype.rentalcharge_hourly | $Price %]
566 <td>[% itemtype.defaultreplacecost | $Price %]</td>
567 <td>[% itemtype.processfee | $Price %]</td>
568 <td>[% itemtype.checkinmsg | html_line_break | $raw %]</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 _ ")" %]
577 [% library_str = library_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %]
580 <span class="library_limitation" title="[% library_str | html %]">
581 [% IF library_limits.count > 1 %]
582 <span>[% library_limits.count | html %] library limitations</span>
584 <span>[% library_limits.count | html %] library limitation</span>
587 <span>No limitation</span>
590 <td>[% IF ( itemtype.automatic_checkin ) %]Yes[% ELSE %] [% END %]</td>
592 <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&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&itemtype=[% itemtype.itemtype | uri %]" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
600 <div class="dialog message">There are no itemtypes defined</div>
605 </div> <!-- /.col-sm-10.col-sm-push-2 -->
607 <div class="col-sm-2 col-sm-pull-10">
609 [% INCLUDE 'admin-menu.inc' %]
611 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
612 </div> <!-- /.row -->
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' %]
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
626 $(document).ready(function() {
627 KohaTable("table_item_type", {
628 "sPaginationType": "full"
632 $( "#itemtypeentry" ).validate({
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 }
642 $("#itemtype").on("blur",function(){
645 $(".library_limitation").tooltip();
646 if( $("#icons .tab-pane.active").length < 1 ){
647 $("#icons a:first").tab("show");
653 [% INCLUDE 'intranet-bottom.inc' %]