4 [% USE AuthorisedValues %]
6 [% USE TablesSettings %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Koha › Administration › Item types [% IF op == 'add_form' %]›
11 Modify item type '[% itemtype.itemtype | html %]'
16 [% IF op == 'delete_confirm' %]›
18 Cannot delete item type '[% itemtype.itemtype | html %]'
20 Delete item type '[% itemtype.itemtype | html %]'?
23 [% IF op == 'delete_confirmed' %]›
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="rentalcharge">Rental charge: </label>
305 <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% itemtype.rentalcharge | $Price on_editing => 1 %]" />
306 <span class="hint">This fee is charged once per checkout/renewal per item</span>
309 <label for="rentalcharge_daily">Daily rental charge: </label>
310 <input type="text" id="rentalcharge_daily" name="rentalcharge_daily" size="10" value="[% itemtype.rentalcharge_daily | $Price on_editing => 1 %]" />
311 <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>
314 <label for="rentalcharge_daily_calendar">Daily rentals use calendar: </label>
315 [% IF itemtype.rentalcharge_daily_calendar %]
316 <input type="checkbox" id="rentalcharge_daily_calendar" name="rentalcharge_daily_calendar" checked="checked" value="1" />
318 <input type="checkbox" id="rentalcharge_daily_calendar" name="rentalcharge_daily_calendar" value="1" />
320 <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>
323 <label for="rentalcharge_hourly">Hourly rental charge: </label>
324 <input type="text" id="rentalcharge_hourly" name="rentalcharge_hourly" size="10" value="[% itemtype.rentalcharge_hourly | $Price on_editing => 1 %]" />
325 <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>
328 <label for="rentalcharge_hourly_calendar">Hourly rentals use calendar: </label>
329 [% IF itemtype.rentalcharge_hourly_calendar %]
330 <input type="checkbox" id="rentalcharge_hourly_calendar" name="rentalcharge_hourly_calendar" checked="checked" value="1" />
332 <input type="checkbox" id="rentalcharge_hourly_calendar" name="rentalcharge_hourly_calendar" value="1" />
334 <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>
337 <label for="defaultreplacecost">Default replacement cost: </label>
338 <input type="text" id="defaultreplacecost" name="defaultreplacecost" size="10" value="[% itemtype.defaultreplacecost | html %]" />
341 <label for="processfee">Processing fee (when lost): </label>
342 <input type="text" id="processfee" name="processfee" size="10" value="[% itemtype.processfee | html %]" />
345 <label for="checkinmsg">Checkin message: </label>
346 <textarea id="checkinmsg" name="checkinmsg" cols="55" rows="5">[% itemtype.checkinmsg | html %]</textarea>
349 <label for="checkinmsgtype">Checkin message type: </label>
350 <select type="text" id="checkinmsgtype" name="checkinmsgtype">
351 [% IF itemtype.checkinmsgtype == 'message' %]
352 <option value="message" selected="selected">Message</option>
354 <option value="message">Message</option>
356 [% IF itemtype.checkinmsgtype == 'alert' %]
357 <option value="alert" selected="selected">Alert</option>
359 <option value="alert">Alert</option>
364 <label for="sip_media_type">SIP media type: </label>
365 <select id="sip_media_type" name="sip_media_type">
366 <option value=""></option>
367 [% FOREACH a IN AuthorisedValues.Get('SIP_MEDIA_TYPE') %]
368 [% IF a.authorised_value == itemtype.sip_media_type %]
369 <option value="[% a.authorised_value | html %]" selected="selected">[% a.lib | html %]</option>
371 <option value="[% a.authorised_value | html %]">[% a.lib | html %]</option>
376 <li><label for="branches">Library limitation: </label>
377 <select id="branches" name="branches" multiple size="10">
378 <option value="">All libraries</option>
379 [% FOREACH branch IN branches_loop %]
380 [% IF ( branch.selected ) %]
381 <option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
383 <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
387 <span class="hint">Select 'All libraries' if all libraries use this item type. Otherwise, select the specific libraries that use this item type.</span>
390 <label for="summary">Summary: </label>
391 <textarea id="summary" name="summary" cols="55" rows="5">[% itemtype.summary | html %]</textarea>
392 <p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
393 <p><strong><a href="[856u]">open site</a></strong> will show the link just below the title</p>
398 <fieldset class="action">
399 <input type="submit" value="Save changes" />
400 <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
405 [% IF op == 'delete_confirm' %]
406 <div class="dialog alert">
407 <h3>Delete item type '[% itemtype.itemtype | html %]'?</h3>
410 <th scope="row">Item type</th>
411 <td>[% itemtype.itemtype | html %]</td>
413 <tr><th scope="row">Description</th><td>[% itemtype.translated_description | html %]</td></tr>
414 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
416 <th scope="row">Image</th>
418 [% SET image_location = itemtype.image_location('intranet') %]
419 [% IF image_location %]<img src="[% image_location | html %]" alt="" />[% END %]
423 <tr><th scope="row">Rental charge</th><td>[% itemtype.rentalcharge | $Price %]</td></tr>
425 <form action="/cgi-bin/koha/admin/itemtypes.pl" method="post">
426 <input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="[% itemtype.itemtype | html %]" />
427 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this item type</button>
429 <form action="/cgi-bin/koha/admin/itemtypes.pl" method="post">
430 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
435 [% IF op == 'list' %]
436 <h2>Item types administration</h2>
438 <table id="table_item_type">
440 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]<th class="noExport">Image</th>[% END %]
444 <th>Search category</th>
445 <th>Not for loan</th>
446 <th>Hide in OPAC</th>
447 <th>Rental charge</th>
448 <th>Daily rental charge</th>
449 <th>Hourly rental charge</th>
450 <th>Default replacement cost</th>
451 <th>Processing fee (when lost)</th>
452 <th>Checkin message</th>
453 <th>Library limitations</th>
454 <th class="noExport NoSort">Actions</th>
456 [% FOREACH itemtype IN itemtypes %]
458 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
460 [% SET image_location = itemtype.image_location('intranet') %]
461 [% IF image_location %]<img src="[% image_location | html %]" alt="" />[% ELSE %] [% END %]
465 [% IF itemtype.parent_type %]
466 [% IF itemtype.parent.translated_descriptions.size %]
467 [% itemtype.parent.description | html %] (default)<br/>
469 [% itemtype.parent.description | html %]
472 [% IF itemtype.translated_descriptions.size %]
473 [% itemtype.description | html %] (default)<br/>
474 [% FOR description IN itemtype.translated_descriptions %]
475 [% IF description.translation == itemtype.translated_description %]
476 -- <strong>[% description.translation | html %]</strong>
478 -- [% description.translation | html %] ([% description.lang | html %])
483 -- [% itemtype.description | html %]
486 [% IF itemtype.translated_descriptions.size %]
487 [% itemtype.description | html %] (default)<br/>
488 [% FOR description IN itemtype.translated_descriptions %]
489 [% IF description.translation == itemtype.translated_description %]
490 <strong>[% description.translation | html %]</strong>
492 [% description.translation | html %] ([% description.lang | html %])
497 [% itemtype.description | html %]
502 <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=[% itemtype.itemtype | uri %]">
503 [% itemtype.itemtype | html %]
507 [% itemtype.parent_type | html %]
509 <td>[% AuthorisedValues.GetByCode( 'ITEMTYPECAT', itemtype.searchcategory ) | html %]</td>
510 <td>[% IF ( itemtype.notforloan ) %]Yes[% ELSE %] [% END %]</td>
511 <td>[% IF ( itemtype.hideinopac ) %]Yes[% ELSE %] [% END %]</td>
513 [% UNLESS ( itemtype.notforloan ) %]
514 [% itemtype.rentalcharge | $Price %]
518 [% UNLESS ( itemtype.notforloan ) %]
519 [% itemtype.rentalcharge_daily | $Price %]
523 [% UNLESS ( itemtype.notforloan ) %]
524 [% itemtype.rentalcharge_hourly | $Price %]
528 <td>[% itemtype.defaultreplacecost | $Price %]</td>
529 <td>[% itemtype.processfee | $Price %]</td>
530 <td>[% itemtype.checkinmsg | html_line_break | $raw %]</td>
532 [% IF itemtype.library_limits %]
533 [% libraries_str = "" %]
534 [% FOREACH library IN itemtype.library_limits %]
535 [%- IF loop.first -%]
536 [% libraries_str = library.branchname _ " (" _ library.branchcode _ ")" %]
538 [% libraries_str = libraries_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %]
541 <span class="library_limitation" title="[% libraries_str | html %]">
542 [% IF itemtype.library_limits.count > 1 %]
543 [% itemtype.library_limits.count | html %] library limitations
545 [% itemtype.library_limits.count | html %] library limitation
552 <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>
553 <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>
559 <div class="dialog message">There are no itemtypes defined</div>
564 </div> <!-- /.col-sm-10.col-sm-push-2 -->
566 <div class="col-sm-2 col-sm-pull-10">
568 [% INCLUDE 'admin-menu.inc' %]
570 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
571 </div> <!-- /.row -->
573 [% MACRO jsinclude BLOCK %]
574 [% Asset.js("js/admin-menu.js") | $raw %]
575 [% INCLUDE 'greybox.inc' %]
576 [% INCLUDE 'datatables.inc' %]
577 [% INCLUDE 'columns_settings.inc' %]
579 $(document).ready(function() {
581 var columns_settings = [% TablesSettings.GetColumns( 'admin', 'itemtypes', 'table_item_type', 'json' ) | $raw %];
582 [% IF ( Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') ) %]
583 columns_settings.shift(); // Remove item type image column from configuration
586 $(document).ready(function() {
587 KohaTable("table_item_type", {
588 "aaSorting": [[ 1, "asc" ]],
589 "iDisplayLength": 10,
590 "sPaginationType": "full"
591 }, columns_settings);
594 $( "#itemtypeentry" ).validate({
596 itemtype: { required: true },
597 description: { required: true },
598 rentalcharge: { number: true }
601 $("#itemtype").on("blur",function(){
604 $(".library_limitation").tooltip();
609 [% INCLUDE 'intranet-bottom.inc' %]