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 [% INCLUDE 'header.inc' %]
51 [% INCLUDE 'prefs-admin-search.inc' %]
53 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
56 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
59 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
62 [% IF op == 'add_form' %]
64 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a>
68 <a href="#" aria-current="page">
69 Modify item type '[% itemtype.itemtype | html %]'
74 <a href="#" aria-current="page">
81 [% IF op == 'delete_confirm' %]
83 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a>
87 <a href="#" aria-current="page">
88 Cannot delete item type '[% itemtype.itemtype | html %]'
93 <a href="#" aria-current="page">
94 Delete item type '[% itemtype.itemtype | html %]'?
100 [% IF op == 'delete_confirmed' %]
102 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a>
105 <a href="#" aria-current="page">
111 [% IF op == 'list' %]
113 <a href="#" aria-current="page">
114 Item types administration
121 <div class="main container-fluid">
123 <div class="col-sm-10 col-sm-push-2">
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>
130 [% FOREACH m IN messages %]
131 <div class="dialog [% m.type | html %]">
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>
150 <span>[% m.code | html %]</span>
156 [% IF op == 'add_form' %]
158 <h1>Modify item type</h1>
160 <h1>Add item type</h1>
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">
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 %]
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>
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>
187 <option value="[% pt.itemtype | html %]">[% pt.description | html %]</option>
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>
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>
198 <div class="hint">Defining a parent type will apply checkout limits for all children as described on the circulation rules page.</div>
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>
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">
217 <option value="[% cat.authorised_value | html %]" >
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>
227 <span>Options are defined by the authorized value ITEMTYPECAT.</span>
231 [% IF ( Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') ) %]
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&searchfield=noItemTypeImages">noItemTypeImages or OpacNoItemTypeImages system preferences</a>
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>
244 [% FOREACH imageset IN imagesets %]
245 [% IF ( imageset.imagesetactive ) %]
246 <li role="presentation" class="active">
248 <li role="presentation">
250 <a aria-controls="[% imageset.imagesetname | uri %]" role="tab" data-toggle="tab" href="#[% imageset.imagesetname | uri %]">[% imageset.imagesetname | html %]</a>
253 [% IF itemtype.image_location('intranet').match('^http') %]
254 <li role="presentation" class="active">
256 <li role="presentation">
258 <a aria-controls="remote" role="tab" data-toggle="tab" href="#remote">Remote image</a>
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" />
268 </div> <!-- /.tab-pane -->
270 [% FOREACH imageset IN imagesets %]
271 [% IF ( imageset.imagesetactive ) %]
272 <div id="[% imageset.imagesetname | html %]" role="tabpanel" class="tab-pane active">
274 <div id="[% imageset.imagesetname | html %]" role="tabpanel" class="tab-pane">
276 <div class="itemtype-icons">
277 [% FOREACH image IN imageset.images %]
279 [% IF image.StaffImageUrl %]
280 <img src="[% image.StaffImageUrl | html %]" alt="[% image.StaffImageUrl | html %]" title="[% image.StaffImageUrl | html %]" />
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 %]" />
288 [% END #/ FOREACH image %]
289 </div> <!-- /.itemtype-icons -->
290 </div> <!-- /.tab-pane -->
291 [% END #/FOREACH imageset %]
293 [% SET image_location = itemtype.image_location('intranet') %]
294 [% IF image_location.match('^http') %]
295 <div id="remote" role="tabpanel" class="tab-pane active">
297 <div id="remote" role="tabpanel" class="tab-pane">
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="" />
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;" />
310 </div> <!-- /#remote -->
311 </div> <!-- /.tab-content -->
312 </div> <!-- /#icons -->
314 <ol class="oladditemtype">
316 <label for="hideinopac">Hide in OPAC: </label>
317 [% IF ( itemtype.hideinopac ) %]
318 <input type="checkbox" id="hideinopac" name="hideinopac" checked="checked" value="1" />
320 <input type="checkbox" id="hideinopac" name="hideinopac" value="1" />
322 <span class="hint">If checked, items of this type will be hidden as filters in OPAC's advanced search.</span>
325 <label for="notforloan">Not for loan: </label>
326 [% IF itemtype.notforloan %]
327 <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
329 <input type="checkbox" id="notforloan" name="notforloan" value="1" />
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>
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" />
338 <input type="checkbox" id="automatic_checkin" name="automatic_checkin" value="1" />
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>
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>
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>
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" />
357 <input type="checkbox" id="rentalcharge_daily_calendar" name="rentalcharge_daily_calendar" value="1" />
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>
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>
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" />
371 <input type="checkbox" id="rentalcharge_hourly_calendar" name="rentalcharge_hourly_calendar" value="1" />
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>
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" />
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" />
384 <label for="checkinmsg">Checkin message: </label>
385 <textarea id="checkinmsg" name="checkinmsg" cols="55" rows="5">[% itemtype.checkinmsg | html %]</textarea>
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>
393 <option value="message">Message</option>
395 [% IF itemtype.checkinmsgtype == 'alert' %]
396 <option value="alert" selected="selected">Alert</option>
398 <option value="alert">Alert</option>
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>
410 <option value="[% a.authorised_value | html %]">[% a.lib | html %]</option>
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 ) %]
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>
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><a href="[856u]">open site</a></strong> will show the link just below the title</div>
431 <fieldset class="action">
432 <input type="submit" value="Save changes" />
433 <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
438 [% IF op == 'delete_confirm' %]
439 <div class="dialog alert">
440 <h1>Delete item type '[% itemtype.itemtype | html %]'?</h1>
443 <th scope="row">Item type</th>
444 <td>[% itemtype.itemtype | html %]</td>
446 <tr><th scope="row">Description</th><td>[% itemtype.translated_description | html %]</td></tr>
447 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
449 <th scope="row">Image</th>
451 [% SET image_location = itemtype.image_location('intranet') %]
452 [% IF image_location %]<img src="[% image_location | html %]" alt="" />[% END %]
456 <tr><th scope="row">Rental charge</th><td>[% itemtype.rentalcharge | $Price %]</td></tr>
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>
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>
468 [% IF op == 'list' %]
469 <h1>Item types administration</h1>
471 <table id="table_item_type">
473 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]<th class="noExport">Image</th>[% END %]
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>
490 [% FOREACH itemtype IN itemtypes %]
492 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
494 [% SET image_location = itemtype.image_location('intranet') %]
495 [% IF image_location %]<img src="[% image_location | html %]" alt="" />[% ELSE %] [% END %]
499 [% IF itemtype.parent_type %]
500 [% IF itemtype.parent.translated_descriptions.size %]
501 [% itemtype.parent.description | html %] <span>(default)</span><br/>
503 [% itemtype.parent.description | html %]
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>
512 -- [% description.translation | html %] ([% description.lang | html %])
517 -- [% itemtype.description | html %]
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>
526 [% description.translation | html %] ([% description.lang | html %])
531 [% itemtype.description | html %]
536 <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=[% itemtype.itemtype | uri %]">
537 [% itemtype.itemtype | html %]
541 [% itemtype.parent_type | html %]
543 <td>[% AuthorisedValues.GetByCode( 'ITEMTYPECAT', itemtype.searchcategory ) | html %]</td>
544 <td>[% IF ( itemtype.notforloan ) %]Yes[% ELSE %] [% END %]</td>
545 <td>[% IF ( itemtype.hideinopac ) %]Yes[% ELSE %] [% END %]</td>
547 [% UNLESS ( itemtype.notforloan ) %]
548 [% itemtype.rentalcharge | $Price %]
552 [% UNLESS ( itemtype.notforloan ) %]
553 [% itemtype.rentalcharge_daily | $Price %]
557 [% UNLESS ( itemtype.notforloan ) %]
558 [% itemtype.rentalcharge_hourly | $Price %]
562 <td>[% itemtype.defaultreplacecost | $Price %]</td>
563 <td>[% itemtype.processfee | $Price %]</td>
564 <td>[% itemtype.checkinmsg | html_line_break | $raw %]</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 _ ")" %]
573 [% library_str = library_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %]
576 <span class="library_limitation" title="[% library_str | html %]">
577 [% IF library_limits.count > 1 %]
578 [% library_limits.count | html %] library limitations
580 [% library_limits.count | html %] library limitation
586 <td>[% IF ( itemtype.automatic_checkin ) %]Yes[% ELSE %] [% END %]</td>
588 <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>
589 <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>
595 <div class="dialog message">There are no itemtypes defined</div>
600 </div> <!-- /.col-sm-10.col-sm-push-2 -->
602 <div class="col-sm-2 col-sm-pull-10">
604 [% INCLUDE 'admin-menu.inc' %]
606 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
607 </div> <!-- /.row -->
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' %]
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
621 $(document).ready(function() {
622 KohaTable("table_item_type", {
623 "aaSorting": [[ 1, "asc" ]],
624 "iDisplayLength": 10,
625 "sPaginationType": "full"
626 }, columns_settings);
629 $( "#itemtypeentry" ).validate({
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 }
639 $("#itemtype").on("blur",function(){
642 $(".library_limitation").tooltip();
643 if( $(".tab-pane.active").length < 1 ){
644 $("#icons a:first").tab("show");
650 [% INCLUDE 'intranet-bottom.inc' %]