4 [% USE AuthorisedValues %]
6 [% USE TablesSettings %]
8 [% INCLUDE 'doc-head-open.inc' %]
10 [% IF op == 'add_form' %]
12 Modify item type '[% itemtype.itemtype | html %]'
15 [% END %] › [% END %]
16 [% IF op == 'delete_confirm' %]
18 Cannot delete item type '[% itemtype.itemtype | html %]'
20 Delete item type '[% itemtype.itemtype | html %]'?
21 [% END %] › [% END %]
22 [% IF op == 'delete_confirmed' %]
23 Data deleted › [% END %]
24 Item types › Administration › Koha
26 [% INCLUDE 'doc-head-close.inc' %]
28 fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; }
29 fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-active {background-color : #F4F8F9; }
30 fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;}
31 fieldset.rows .ui-tabs-nav { margin-left : 10px; }
35 <body id="admin_itemtypes" class="admin">
36 [% INCLUDE 'header.inc' %]
37 [% INCLUDE 'prefs-admin-search.inc' %]
39 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
42 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
45 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
48 [% IF op == 'add_form' %]
50 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a>
54 <a href="#" aria-current="page">
55 Modify item type '[% itemtype.itemtype | html %]'
60 <a href="#" aria-current="page">
67 [% IF op == 'delete_confirm' %]
69 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a>
73 <a href="#" aria-current="page">
74 Cannot delete item type '[% itemtype.itemtype | html %]'
79 <a href="#" aria-current="page">
80 Delete item type '[% itemtype.itemtype | html %]'?
86 [% IF op == 'delete_confirmed' %]
88 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a>
91 <a href="#" aria-current="page">
99 <a href="#" aria-current="page">
100 Item types administration
107 <div class="main container-fluid">
109 <div class="col-sm-10 col-sm-push-2">
112 [% IF op == 'list' %]<div id="toolbar" class="btn-toolbar">
113 <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>
116 [% FOREACH m IN messages %]
117 <div class="dialog [% m.type | html %]">
119 [% CASE 'error_on_update' %]
120 An error occurred when updating this item type. Perhaps the value already exists.
121 [% CASE 'error_on_insert' %]
122 An error occurred when inserting this item type. Perhaps the value already exists.
123 [% CASE 'error_on_delete' %]
124 An error occurred when deleting this item type. Check the logs.
125 [% CASE 'success_on_update' %]
126 Item type updated successfully.
127 [% CASE 'success_on_insert' %]
128 Item type inserted successfully.
129 [% CASE 'success_on_delete' %]
130 Item type deleted successfully.
131 [% CASE 'already_exists' %]
132 This item type already exists.
133 [% CASE 'cannot_be_deleted' %]
134 Cannot delete this item type. <p><strong>This record is in use</strong>. Deletion is not possible.</p>
142 [% IF op == 'add_form' %]
144 <h3>Modify item type</h3>
146 <h3>Add item type</h3>
148 <form action="/cgi-bin/koha/admin/itemtypes.pl" name="Aform" method="post" id="itemtypeentry">
149 <input type="hidden" name="op" value="add_validate" />
150 <fieldset class="rows">
154 <input type="hidden" name="is_a_modif" value="1" />
155 <span class="label">Item type: </span> <input type="hidden" name="itemtype" value="[% itemtype.itemtype | html %]" />
156 [% itemtype.itemtype | html %]
160 <label for="itemtype" class="required">Item type: </label>
161 <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" required="required" class="focus" /> <span class="required">Required</span>
165 <label for="parent_type">Parent item type: </label>
166 [% IF !is_a_parent && parent_types %]
167 <select name="parent_type" id="parent_type">
168 <option value="">None</option>
169 [% FOREACH pt IN parent_types %]
170 [% IF parent_type == pt.itemtype %]
171 <option value="[% pt.itemtype | html %]" selected="selected">[% pt.description | html %]</option>
173 <option value="[% pt.itemtype | html %]">[% pt.description | html %]</option>
177 [% ELSIF is_a_parent %]
178 <input type="text" id="parent_type" value="[% parent_type | html %]" name="parent_type" size="10" maxlength="10" disabled/>
179 <p>Is a parent to another type, cannot have a parent</p>
181 <input type="text" id="parent_type" value="[% parent_type | html %]" name="parent_type" size="10" maxlength="10" disabled/>
182 <p>No available parent types</p>
184 <span class="hint">Defining a parent type will apply checkout limits for all children as described on the circulation rules page.</span>
187 <label for="description" class="required">Description: </label>
188 <input type="text" id="description" name="description" size="48" value="[% itemtype.description | html %]" required="required" /> <span class="required">Required</span>
189 [% IF can_be_translated %]
190 <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>
194 <span class="label">Search category</span>
195 <select id="searchcategory" name="searchcategory">
196 <option value="">None</option>
197 [% FOREACH cat IN searchcategory %]
198 [% IF cat.authorised_value == itemtype.searchcategory %]
199 <option value="[% cat.authorised_value | html %]" selected="selected">
203 <option value="[% cat.authorised_value | html %]" >
209 <span class="hint">Options are defined as the authorized values for the ITEMTYPECAT category.</span>
211 [% IF ( Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') ) %]
213 <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>
217 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
218 <div id="icons" class="toptabs" style="clear:both">
219 <h5 style="margin-left:10px;">Choose an icon:</h5>
221 <li><a href="#none">None</a></li>
222 [% FOREACH imageset IN imagesets %]
223 [% IF ( imageset.imagesetactive ) %]
224 <li class="ui-tabs-active">
228 <a href="#[% imageset.imagesetname | uri %]">[% imageset.imagesetname | html %]</a>
231 [% IF itemtype.image_location('intranet').match('^http') %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#remote">Remote image</a></li>
235 <li><label for="noimage">No image: </label><input type="radio" name="image" id="noimage" value="removeImage" /></li>
240 [% FOREACH imageset IN imagesets %]
241 <div id="[% imageset.imagesetname | html %]">
243 [% FOREACH image IN imageset.images %]
244 <li style="float: none; display: inline-block; clear : none; width: auto;">
246 [% IF image.StaffImageUrl %]
247 <img src="[% image.StaffImageUrl | html %]" alt="[% image.StaffImageUrl | html %]" title="[% image.StaffImageUrl | html %]" />
249 [% IF image.checked %]
250 <input type="radio" name="image" value="[% image.KohaImage | html %]" checked="checked" />
251 [% ELSIF image.KohaImage %] <!-- to delete the radio button if there is no image after -->
252 <input type="radio" name="image" value="[% image.KohaImage | html %]" />
265 <label for="remote_image_check"> Remote image:</label>
266 [% SET image_location = itemtype.image_location('intranet') %]
267 [% IF image_location.match('^http') %]
268 <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />
269 <input type="text" name="remoteImage" size="48" maxlength="200" value="[% image_location | html %]" onmousedown="document.getElementById('remote_image_check').checked = true;" />
270 [% IF itemtype.imageurl %]
271 <img src="[% image_location | html %]" alt="" />
274 <input type="radio" id="remote_image_check" name="image" value="remoteImage" />
275 <input type="text" name="remoteImage" size="48" maxlength="200" value="" onmousedown="document.getElementById('remote_image_check').checked = true;" />
283 <ol class="oladditemtype">
285 <label for="hideinopac">Hide in OPAC: </label>
286 [% IF ( itemtype.hideinopac ) %]
287 <input type="checkbox" id="hideinopac" name="hideinopac" checked="checked" value="1" />
289 <input type="checkbox" id="hideinopac" name="hideinopac" value="1" />
291 <span class="hint">If checked, items of this type will be hidden as filters in OPAC's advanced search.</span>
294 <label for="notforloan">Not for loan: </label>
295 [% IF itemtype.notforloan %]
296 <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
298 <input type="checkbox" id="notforloan" name="notforloan" value="1" />
300 <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>
303 <label for="rentalcharge">Rental charge: </label>
304 <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% itemtype.rentalcharge | $Price on_editing => 1 %]" />
305 <span class="hint">This fee is charged once per checkout/renewal per item</span>
308 <label for="rentalcharge_daily">Daily rental charge: </label>
309 <input type="text" id="rentalcharge_daily" name="rentalcharge_daily" size="10" value="[% itemtype.rentalcharge_daily | $Price on_editing => 1 %]" />
310 <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>
313 <label for="rentalcharge_daily_calendar">Daily rentals use calendar: </label>
314 [% IF itemtype.rentalcharge_daily_calendar %]
315 <input type="checkbox" id="rentalcharge_daily_calendar" name="rentalcharge_daily_calendar" checked="checked" value="1" />
317 <input type="checkbox" id="rentalcharge_daily_calendar" name="rentalcharge_daily_calendar" value="1" />
319 <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>
322 <label for="rentalcharge_hourly">Hourly rental charge: </label>
323 <input type="text" id="rentalcharge_hourly" name="rentalcharge_hourly" size="10" value="[% itemtype.rentalcharge_hourly | $Price on_editing => 1 %]" />
324 <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>
327 <label for="rentalcharge_hourly_calendar">Hourly rentals use calendar: </label>
328 [% IF itemtype.rentalcharge_hourly_calendar %]
329 <input type="checkbox" id="rentalcharge_hourly_calendar" name="rentalcharge_hourly_calendar" checked="checked" value="1" />
331 <input type="checkbox" id="rentalcharge_hourly_calendar" name="rentalcharge_hourly_calendar" value="1" />
333 <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>
336 <label for="defaultreplacecost">Default replacement cost: </label>
337 <input type="text" id="defaultreplacecost" name="defaultreplacecost" size="10" value="[% itemtype.defaultreplacecost | html %]" />
340 <label for="processfee">Processing fee (when lost): </label>
341 <input type="text" id="processfee" name="processfee" size="10" value="[% itemtype.processfee | html %]" />
344 <label for="checkinmsg">Checkin message: </label>
345 <textarea id="checkinmsg" name="checkinmsg" cols="55" rows="5">[% itemtype.checkinmsg | html %]</textarea>
348 <label for="checkinmsgtype">Checkin message type: </label>
349 <select type="text" id="checkinmsgtype" name="checkinmsgtype">
350 [% IF itemtype.checkinmsgtype == 'message' %]
351 <option value="message" selected="selected">Message</option>
353 <option value="message">Message</option>
355 [% IF itemtype.checkinmsgtype == 'alert' %]
356 <option value="alert" selected="selected">Alert</option>
358 <option value="alert">Alert</option>
363 <label for="sip_media_type">SIP media type: </label>
364 <select id="sip_media_type" name="sip_media_type">
365 <option value=""></option>
366 [% FOREACH a IN AuthorisedValues.Get('SIP_MEDIA_TYPE') %]
367 [% IF a.authorised_value == itemtype.sip_media_type %]
368 <option value="[% a.authorised_value | html %]" selected="selected">[% a.lib | html %]</option>
370 <option value="[% a.authorised_value | html %]">[% a.lib | html %]</option>
375 <li><label for="branches">Library limitation: </label>
376 <select id="branches" name="branches" multiple size="10">
377 <option value="">All libraries</option>
378 [% FOREACH branch IN branches_loop %]
379 [% IF ( branch.selected ) %]
380 <option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
382 <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
386 <span class="hint">Select 'All libraries' if all libraries use this item type. Otherwise, select the specific libraries that use this item type.</span>
389 <label for="summary">Summary: </label>
390 <textarea id="summary" name="summary" cols="55" rows="5">[% itemtype.summary | html %]</textarea>
391 <p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
392 <p><strong><a href="[856u]">open site</a></strong> will show the link just below the title</p>
397 <fieldset class="action">
398 <input type="submit" value="Save changes" />
399 <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
404 [% IF op == 'delete_confirm' %]
405 <div class="dialog alert">
406 <h3>Delete item type '[% itemtype.itemtype | html %]'?</h3>
409 <th scope="row">Item type</th>
410 <td>[% itemtype.itemtype | html %]</td>
412 <tr><th scope="row">Description</th><td>[% itemtype.translated_description | html %]</td></tr>
413 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
415 <th scope="row">Image</th>
417 [% SET image_location = itemtype.image_location('intranet') %]
418 [% IF image_location %]<img src="[% image_location | html %]" alt="" />[% END %]
422 <tr><th scope="row">Rental charge</th><td>[% itemtype.rentalcharge | $Price %]</td></tr>
424 <form action="/cgi-bin/koha/admin/itemtypes.pl" method="post">
425 <input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="[% itemtype.itemtype | html %]" />
426 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this item type</button>
428 <form action="/cgi-bin/koha/admin/itemtypes.pl" method="post">
429 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
434 [% IF op == 'list' %]
435 <h2>Item types administration</h2>
437 <table id="table_item_type">
439 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]<th class="noExport">Image</th>[% END %]
443 <th>Search category</th>
444 <th>Not for loan</th>
445 <th>Hide in OPAC</th>
446 <th>Rental charge</th>
447 <th>Daily rental charge</th>
448 <th>Hourly rental charge</th>
449 <th>Default replacement cost</th>
450 <th>Processing fee (when lost)</th>
451 <th>Checkin message</th>
452 <th>Library limitations</th>
453 <th class="noExport NoSort">Actions</th>
455 [% FOREACH itemtype IN itemtypes %]
457 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
459 [% SET image_location = itemtype.image_location('intranet') %]
460 [% IF image_location %]<img src="[% image_location | html %]" alt="" />[% ELSE %] [% END %]
464 [% IF itemtype.parent_type %]
465 [% IF itemtype.parent.translated_descriptions.size %]
466 [% itemtype.parent.description | html %] (default)<br/>
468 [% itemtype.parent.description | html %]
471 [% IF itemtype.translated_descriptions.size %]
472 [% itemtype.description | html %] (default)<br/>
473 [% FOR description IN itemtype.translated_descriptions %]
474 [% IF description.translation == itemtype.translated_description %]
475 -- <strong>[% description.translation | html %]</strong>
477 -- [% description.translation | html %] ([% description.lang | html %])
482 -- [% itemtype.description | html %]
485 [% IF itemtype.translated_descriptions.size %]
486 [% itemtype.description | html %] (default)<br/>
487 [% FOR description IN itemtype.translated_descriptions %]
488 [% IF description.translation == itemtype.translated_description %]
489 <strong>[% description.translation | html %]</strong>
491 [% description.translation | html %] ([% description.lang | html %])
496 [% itemtype.description | html %]
501 <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=[% itemtype.itemtype | uri %]">
502 [% itemtype.itemtype | html %]
506 [% itemtype.parent_type | html %]
508 <td>[% AuthorisedValues.GetByCode( 'ITEMTYPECAT', itemtype.searchcategory ) | html %]</td>
509 <td>[% IF ( itemtype.notforloan ) %]Yes[% ELSE %] [% END %]</td>
510 <td>[% IF ( itemtype.hideinopac ) %]Yes[% ELSE %] [% END %]</td>
512 [% UNLESS ( itemtype.notforloan ) %]
513 [% itemtype.rentalcharge | $Price %]
517 [% UNLESS ( itemtype.notforloan ) %]
518 [% itemtype.rentalcharge_daily | $Price %]
522 [% UNLESS ( itemtype.notforloan ) %]
523 [% itemtype.rentalcharge_hourly | $Price %]
527 <td>[% itemtype.defaultreplacecost | $Price %]</td>
528 <td>[% itemtype.processfee | $Price %]</td>
529 <td>[% itemtype.checkinmsg | html_line_break | $raw %]</td>
531 [% IF itemtype.library_limits %]
532 [% libraries_str = "" %]
533 [% FOREACH library IN itemtype.library_limits %]
534 [%- IF loop.first -%]
535 [% libraries_str = library.branchname _ " (" _ library.branchcode _ ")" %]
537 [% libraries_str = libraries_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %]
540 <span class="library_limitation" title="[% libraries_str | html %]">
541 [% IF itemtype.library_limits.count > 1 %]
542 [% itemtype.library_limits.count | html %] library limitations
544 [% itemtype.library_limits.count | html %] library limitation
551 <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>
552 <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>
558 <div class="dialog message">There are no itemtypes defined</div>
563 </div> <!-- /.col-sm-10.col-sm-push-2 -->
565 <div class="col-sm-2 col-sm-pull-10">
567 [% INCLUDE 'admin-menu.inc' %]
569 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
570 </div> <!-- /.row -->
572 [% MACRO jsinclude BLOCK %]
573 [% Asset.js("js/admin-menu.js") | $raw %]
574 [% INCLUDE 'greybox.inc' %]
575 [% INCLUDE 'datatables.inc' %]
576 [% INCLUDE 'columns_settings.inc' %]
578 $(document).ready(function() {
580 var columns_settings = [% TablesSettings.GetColumns( 'admin', 'itemtypes', 'table_item_type', 'json' ) | $raw %];
581 [% IF ( Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') ) %]
582 columns_settings.shift(); // Remove item type image column from configuration
585 $(document).ready(function() {
586 KohaTable("table_item_type", {
587 "aaSorting": [[ 1, "asc" ]],
588 "iDisplayLength": 10,
589 "sPaginationType": "full"
590 }, columns_settings);
593 $( "#itemtypeentry" ).validate({
595 itemtype: { required: true },
596 description: { required: true },
597 rentalcharge: { number: true }
600 $("#itemtype").on("blur",function(){
603 $(".library_limitation").tooltip();
608 [% INCLUDE 'intranet-bottom.inc' %]