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' %]
29 fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; }
30 fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-active {background-color : #F4F8F9; }
31 fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;}
32 fieldset.rows .ui-tabs-nav { margin-left : 10px; }
36 <body id="admin_itemtypes" class="admin">
37 [% INCLUDE 'header.inc' %]
38 [% INCLUDE 'prefs-admin-search.inc' %]
40 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
43 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
46 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
49 [% IF op == 'add_form' %]
51 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a>
55 <a href="#" aria-current="page">
56 Modify item type '[% itemtype.itemtype | html %]'
61 <a href="#" aria-current="page">
68 [% IF op == 'delete_confirm' %]
70 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a>
74 <a href="#" aria-current="page">
75 Cannot delete item type '[% itemtype.itemtype | html %]'
80 <a href="#" aria-current="page">
81 Delete item type '[% itemtype.itemtype | html %]'?
87 [% IF op == 'delete_confirmed' %]
89 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a>
92 <a href="#" aria-current="page">
100 <a href="#" aria-current="page">
101 Item types administration
108 <div class="main container-fluid">
110 <div class="col-sm-10 col-sm-push-2">
113 [% IF op == 'list' %]<div id="toolbar" class="btn-toolbar">
114 <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>
117 [% FOREACH m IN messages %]
118 <div class="dialog [% m.type | html %]">
120 [% CASE 'error_on_update' %]
121 An error occurred when updating this item type. Perhaps the value already exists.
122 [% CASE 'error_on_insert' %]
123 An error occurred when inserting this item type. Perhaps the value already exists.
124 [% CASE 'error_on_delete' %]
125 An error occurred when deleting this item type. Check the logs.
126 [% CASE 'success_on_update' %]
127 Item type updated successfully.
128 [% CASE 'success_on_insert' %]
129 Item type inserted successfully.
130 [% CASE 'success_on_delete' %]
131 Item type deleted successfully.
132 [% CASE 'already_exists' %]
133 This item type already exists.
134 [% CASE 'cannot_be_deleted' %]
135 Cannot delete this item type. <p><strong>This record is in use</strong>. Deletion is not possible.</p>
143 [% IF op == 'add_form' %]
145 <h3>Modify item type</h3>
147 <h3>Add item type</h3>
149 <form action="/cgi-bin/koha/admin/itemtypes.pl" name="Aform" method="post" id="itemtypeentry">
150 <input type="hidden" name="op" value="add_validate" />
151 <fieldset class="rows">
155 <input type="hidden" name="is_a_modif" value="1" />
156 <span class="label">Item type: </span> <input type="hidden" name="itemtype" value="[% itemtype.itemtype | html %]" />
157 [% itemtype.itemtype | html %]
161 <label for="itemtype" class="required">Item type: </label>
162 <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" required="required" class="focus" /> <span class="required">Required</span>
166 <label for="parent_type">Parent item type: </label>
167 [% IF !is_a_parent && parent_types %]
168 <select name="parent_type" id="parent_type">
169 <option value="">None</option>
170 [% FOREACH pt IN parent_types %]
171 [% IF parent_type == pt.itemtype %]
172 <option value="[% pt.itemtype | html %]" selected="selected">[% pt.description | html %]</option>
174 <option value="[% pt.itemtype | html %]">[% pt.description | html %]</option>
178 [% ELSIF is_a_parent %]
179 <input type="text" id="parent_type" value="[% parent_type | html %]" name="parent_type" size="10" maxlength="10" disabled/>
180 <p>Is a parent to another type, cannot have a parent</p>
182 <input type="text" id="parent_type" value="[% parent_type | html %]" name="parent_type" size="10" maxlength="10" disabled/>
183 <p>No available parent types</p>
185 <span class="hint">Defining a parent type will apply checkout limits for all children as described on the circulation rules page.</span>
188 <label for="description" class="required">Description: </label>
189 <input type="text" id="description" name="description" size="48" value="[% itemtype.description | html %]" required="required" /> <span class="required">Required</span>
190 [% IF can_be_translated %]
191 <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>
195 <span class="label">Search category</span>
196 <select id="searchcategory" name="searchcategory">
197 <option value="">None</option>
198 [% FOREACH cat IN searchcategory %]
199 [% IF cat.authorised_value == itemtype.searchcategory %]
200 <option value="[% cat.authorised_value | html %]" selected="selected">
204 <option value="[% cat.authorised_value | html %]" >
210 <span class="hint">Options are defined as the authorized values for the ITEMTYPECAT category.</span>
212 [% IF ( Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') ) %]
214 <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>
218 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
219 <div id="icons" class="toptabs" style="clear:both">
220 <h5 style="margin-left:10px;">Choose an icon:</h5>
222 <li><a href="#none">None</a></li>
223 [% FOREACH imageset IN imagesets %]
224 [% IF ( imageset.imagesetactive ) %]
225 <li class="ui-tabs-active">
229 <a href="#[% imageset.imagesetname | uri %]">[% imageset.imagesetname | html %]</a>
232 [% IF itemtype.image_location('intranet').match('^http') %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#remote">Remote image</a></li>
236 <li><label for="noimage">No image: </label><input type="radio" name="image" id="noimage" value="removeImage" /></li>
241 [% FOREACH imageset IN imagesets %]
242 <div id="[% imageset.imagesetname | html %]">
244 [% FOREACH image IN imageset.images %]
245 <li style="float: none; display: inline-block; clear : none; width: auto;">
247 [% IF image.StaffImageUrl %]
248 <img src="[% image.StaffImageUrl | html %]" alt="[% image.StaffImageUrl | html %]" title="[% image.StaffImageUrl | html %]" />
250 [% IF image.checked %]
251 <input type="radio" name="image" value="[% image.KohaImage | html %]" checked="checked" />
252 [% ELSIF image.KohaImage %] <!-- to delete the radio button if there is no image after -->
253 <input type="radio" name="image" value="[% image.KohaImage | html %]" />
266 <label for="remote_image_check"> Remote image:</label>
267 [% SET image_location = itemtype.image_location('intranet') %]
268 [% IF image_location.match('^http') %]
269 <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />
270 <input type="text" name="remoteImage" size="48" maxlength="200" value="[% image_location | html %]" onmousedown="document.getElementById('remote_image_check').checked = true;" />
271 [% IF itemtype.imageurl %]
272 <img src="[% image_location | html %]" alt="" />
275 <input type="radio" id="remote_image_check" name="image" value="remoteImage" />
276 <input type="text" name="remoteImage" size="48" maxlength="200" value="" onmousedown="document.getElementById('remote_image_check').checked = true;" />
284 <ol class="oladditemtype">
286 <label for="hideinopac">Hide in OPAC: </label>
287 [% IF ( itemtype.hideinopac ) %]
288 <input type="checkbox" id="hideinopac" name="hideinopac" checked="checked" value="1" />
290 <input type="checkbox" id="hideinopac" name="hideinopac" value="1" />
292 <span class="hint">If checked, items of this type will be hidden as filters in OPAC's advanced search.</span>
295 <label for="notforloan">Not for loan: </label>
296 [% IF itemtype.notforloan %]
297 <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
299 <input type="checkbox" id="notforloan" name="notforloan" value="1" />
301 <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>
304 <label for="automatic_checkin">Automatic checkin: </label>
305 [% IF itemtype.automatic_checkin %]
306 <input type="checkbox" id="automatic_checkin" name="automatic_checkin" checked="checked" value="1" />
308 <input type="checkbox" id="automatic_checkin" name="automatic_checkin" value="1" />
310 <span class="hint">If checked, items will be automatically checked in once they've reached their due date.</span>
313 <label for="rentalcharge">Rental charge: </label>
314 <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% itemtype.rentalcharge | $Price on_editing => 1 %]" />
315 <span class="hint">This fee is charged once per checkout/renewal per item</span>
318 <label for="rentalcharge_daily">Daily rental charge: </label>
319 <input type="text" id="rentalcharge_daily" name="rentalcharge_daily" size="10" value="[% itemtype.rentalcharge_daily | $Price on_editing => 1 %]" />
320 <span 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.</span>
323 <label for="rentalcharge_daily_calendar">Daily rentals use calendar: </label>
324 [% IF itemtype.rentalcharge_daily_calendar %]
325 <input type="checkbox" id="rentalcharge_daily_calendar" name="rentalcharge_daily_calendar" checked="checked" value="1" />
327 <input type="checkbox" id="rentalcharge_daily_calendar" name="rentalcharge_daily_calendar" value="1" />
329 <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>
332 <label for="rentalcharge_hourly">Hourly rental charge: </label>
333 <input type="text" id="rentalcharge_hourly" name="rentalcharge_hourly" size="10" value="[% itemtype.rentalcharge_hourly | $Price on_editing => 1 %]" />
334 <span 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.</span>
337 <label for="rentalcharge_hourly_calendar">Hourly rentals use calendar: </label>
338 [% IF itemtype.rentalcharge_hourly_calendar %]
339 <input type="checkbox" id="rentalcharge_hourly_calendar" name="rentalcharge_hourly_calendar" checked="checked" value="1" />
341 <input type="checkbox" id="rentalcharge_hourly_calendar" name="rentalcharge_hourly_calendar" value="1" />
343 <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>
346 <label for="defaultreplacecost">Default replacement cost: </label>
347 <input type="text" id="defaultreplacecost" name="defaultreplacecost" size="10" value="[% itemtype.defaultreplacecost | html %]" />
350 <label for="processfee">Processing fee (when lost): </label>
351 <input type="text" id="processfee" name="processfee" size="10" value="[% itemtype.processfee | html %]" />
354 <label for="checkinmsg">Checkin message: </label>
355 <textarea id="checkinmsg" name="checkinmsg" cols="55" rows="5">[% itemtype.checkinmsg | html %]</textarea>
358 <label for="checkinmsgtype">Checkin message type: </label>
359 <select type="text" id="checkinmsgtype" name="checkinmsgtype">
360 [% IF itemtype.checkinmsgtype == 'message' %]
361 <option value="message" selected="selected">Message</option>
363 <option value="message">Message</option>
365 [% IF itemtype.checkinmsgtype == 'alert' %]
366 <option value="alert" selected="selected">Alert</option>
368 <option value="alert">Alert</option>
373 <label for="sip_media_type">SIP media type: </label>
374 <select id="sip_media_type" name="sip_media_type">
375 <option value=""></option>
376 [% FOREACH a IN AuthorisedValues.Get('SIP_MEDIA_TYPE') %]
377 [% IF a.authorised_value == itemtype.sip_media_type %]
378 <option value="[% a.authorised_value | html %]" selected="selected">[% a.lib | html %]</option>
380 <option value="[% a.authorised_value | html %]">[% a.lib | html %]</option>
385 <li><label for="branches">Library limitation: </label>
386 <select id="branches" name="branches" multiple size="10">
387 <option value="">All libraries</option>
388 [% PROCESS options_for_libraries libraries => Branches.all( selected => itemtype.get_library_limits, unfiltered => 1, do_not_select_my_library => 1 ) %]
390 <span class="hint">Select 'All libraries' if all libraries use this item type. Otherwise, select the specific libraries that use this item type.</span>
393 <label for="summary">Summary: </label>
394 <textarea id="summary" name="summary" cols="55" rows="5">[% itemtype.summary | html %]</textarea>
395 <p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
396 <p><strong><a href="[856u]">open site</a></strong> will show the link just below the title</p>
401 <fieldset class="action">
402 <input type="submit" value="Save changes" />
403 <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
408 [% IF op == 'delete_confirm' %]
409 <div class="dialog alert">
410 <h3>Delete item type '[% itemtype.itemtype | html %]'?</h3>
413 <th scope="row">Item type</th>
414 <td>[% itemtype.itemtype | html %]</td>
416 <tr><th scope="row">Description</th><td>[% itemtype.translated_description | html %]</td></tr>
417 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
419 <th scope="row">Image</th>
421 [% SET image_location = itemtype.image_location('intranet') %]
422 [% IF image_location %]<img src="[% image_location | html %]" alt="" />[% END %]
426 <tr><th scope="row">Rental charge</th><td>[% itemtype.rentalcharge | $Price %]</td></tr>
428 <form action="/cgi-bin/koha/admin/itemtypes.pl" method="post">
429 <input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="[% itemtype.itemtype | html %]" />
430 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this item type</button>
432 <form action="/cgi-bin/koha/admin/itemtypes.pl" method="post">
433 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
438 [% IF op == 'list' %]
439 <h2>Item types administration</h2>
441 <table id="table_item_type">
443 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]<th class="noExport">Image</th>[% END %]
447 <th>Search category</th>
448 <th>Not for loan</th>
449 <th>Hide in OPAC</th>
450 <th>Rental charge</th>
451 <th>Daily rental charge</th>
452 <th>Hourly rental charge</th>
453 <th>Default replacement cost</th>
454 <th>Processing fee (when lost)</th>
455 <th>Checkin message</th>
456 <th>Library limitations</th>
457 <th>Automatic checkin</th>
458 <th class="noExport NoSort">Actions</th>
460 [% FOREACH itemtype IN itemtypes %]
462 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
464 [% SET image_location = itemtype.image_location('intranet') %]
465 [% IF image_location %]<img src="[% image_location | html %]" alt="" />[% ELSE %] [% END %]
469 [% IF itemtype.parent_type %]
470 [% IF itemtype.parent.translated_descriptions.size %]
471 [% itemtype.parent.description | html %] (default)<br/>
473 [% itemtype.parent.description | html %]
476 [% IF itemtype.translated_descriptions.size %]
477 [% itemtype.description | html %] (default)<br/>
478 [% FOR description IN itemtype.translated_descriptions %]
479 [% IF description.translation == itemtype.translated_description %]
480 -- <strong>[% description.translation | html %]</strong>
482 -- [% description.translation | html %] ([% description.lang | html %])
487 -- [% itemtype.description | html %]
490 [% IF itemtype.translated_descriptions.size %]
491 [% itemtype.description | html %] (default)<br/>
492 [% FOR description IN itemtype.translated_descriptions %]
493 [% IF description.translation == itemtype.translated_description %]
494 <strong>[% description.translation | html %]</strong>
496 [% description.translation | html %] ([% description.lang | html %])
501 [% itemtype.description | html %]
506 <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=[% itemtype.itemtype | uri %]">
507 [% itemtype.itemtype | html %]
511 [% itemtype.parent_type | html %]
513 <td>[% AuthorisedValues.GetByCode( 'ITEMTYPECAT', itemtype.searchcategory ) | html %]</td>
514 <td>[% IF ( itemtype.notforloan ) %]Yes[% ELSE %] [% END %]</td>
515 <td>[% IF ( itemtype.hideinopac ) %]Yes[% ELSE %] [% END %]</td>
517 [% UNLESS ( itemtype.notforloan ) %]
518 [% itemtype.rentalcharge | $Price %]
522 [% UNLESS ( itemtype.notforloan ) %]
523 [% itemtype.rentalcharge_daily | $Price %]
527 [% UNLESS ( itemtype.notforloan ) %]
528 [% itemtype.rentalcharge_hourly | $Price %]
532 <td>[% itemtype.defaultreplacecost | $Price %]</td>
533 <td>[% itemtype.processfee | $Price %]</td>
534 <td>[% itemtype.checkinmsg | html_line_break | $raw %]</td>
536 [% SET library_limits = itemtype.library_limits %]
537 [% IF library_limits.count > 0 %]
538 [% library_str = "" %]
539 [% FOREACH library IN library_limits %]
540 [%- IF loop.first -%]
541 [% library_str = library.branchname _ " (" _ library.branchcode _ ")" %]
543 [% library_str = library_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %]
546 <span class="library_limitation" title="[% library_str | html %]">
547 [% IF library_limits.count > 1 %]
548 [% library_limits.count | html %] library limitations
550 [% library_limits.count | html %] library limitation
556 <td>[% IF ( itemtype.automatic_checkin ) %]Yes[% ELSE %] [% END %]</td>
558 <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>
559 <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>
565 <div class="dialog message">There are no itemtypes defined</div>
570 </div> <!-- /.col-sm-10.col-sm-push-2 -->
572 <div class="col-sm-2 col-sm-pull-10">
574 [% INCLUDE 'admin-menu.inc' %]
576 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
577 </div> <!-- /.row -->
579 [% MACRO jsinclude BLOCK %]
580 [% Asset.js("js/admin-menu.js") | $raw %]
581 [% INCLUDE 'greybox.inc' %]
582 [% INCLUDE 'datatables.inc' %]
583 [% INCLUDE 'columns_settings.inc' %]
585 $(document).ready(function() {
587 var columns_settings = [% TablesSettings.GetColumns( 'admin', 'itemtypes', 'table_item_type', 'json' ) | $raw %];
588 [% IF ( Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') ) %]
589 columns_settings.shift(); // Remove item type image column from configuration
592 $(document).ready(function() {
593 KohaTable("table_item_type", {
594 "aaSorting": [[ 1, "asc" ]],
595 "iDisplayLength": 10,
596 "sPaginationType": "full"
597 }, columns_settings);
600 $( "#itemtypeentry" ).validate({
602 itemtype: { required: true },
603 description: { required: true },
604 rentalcharge: { number: true }
607 $("#itemtype").on("blur",function(){
610 $(".library_limitation").tooltip();
615 [% INCLUDE 'intranet-bottom.inc' %]