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 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › [% IF op == 'add_form' %]
42 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> › Modify item type '[% itemtype.itemtype | html %]'
44 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> › Add item type
47 [% IF op == 'delete_confirm' %]
49 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> › Cannot delete item type '[% itemtype.itemtype | html %]'
51 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> › Delete item type '[% itemtype.itemtype | html %]'?
54 [% IF op == 'delete_confirmed' %]
55 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> ›Data deleted
58 Item types administration
61 <div class="main container-fluid">
63 <div class="col-sm-10 col-sm-push-2">
66 [% IF op == 'list' %]<div id="toolbar" class="btn-toolbar">
67 <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>
70 [% FOREACH m IN messages %]
71 <div class="dialog [% m.type | html %]">
73 [% CASE 'error_on_update' %]
74 An error occurred when updating this item type. Perhaps the value already exists.
75 [% CASE 'error_on_insert' %]
76 An error occurred when inserting this item type. Perhaps the value already exists.
77 [% CASE 'error_on_delete' %]
78 An error occurred when deleting this item type. Check the logs.
79 [% CASE 'success_on_update' %]
80 Item type updated successfully.
81 [% CASE 'success_on_insert' %]
82 Item type inserted successfully.
83 [% CASE 'success_on_delete' %]
84 Item type deleted successfully.
85 [% CASE 'already_exists' %]
86 This item type already exists.
87 [% CASE 'cannot_be_deleted' %]
88 Cannot delete this item type. <p><strong>This record is in use</strong>. Deletion is not possible.</p>
96 [% IF op == 'add_form' %]
98 <h3>Modify item type</h3>
100 <h3>Add item type</h3>
102 <form action="/cgi-bin/koha/admin/itemtypes.pl" name="Aform" method="post" id="itemtypeentry">
103 <input type="hidden" name="op" value="add_validate" />
104 <fieldset class="rows">
108 <input type="hidden" name="is_a_modif" value="1" />
109 <span class="label">Item type: </span> <input type="hidden" name="itemtype" value="[% itemtype.itemtype | html %]" />
110 [% itemtype.itemtype | html %]
114 <label for="itemtype" class="required">Item type: </label>
115 <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" required="required" class="focus" /> <span class="required">Required</span>
119 <label for="parent_type">Parent item type: </label>
120 [% IF !is_a_parent && parent_types %]
121 <select name="parent_type" id="parent_type">
122 <option value="">None</option>
123 [% FOREACH pt IN parent_types %]
124 [% IF parent_type == pt.itemtype %]
125 <option value="[% pt.itemtype | html %]" selected="selected">[% pt.description | html %]</option>
127 <option value="[% pt.itemtype | html %]">[% pt.description | html %]</option>
131 [% ELSIF is_a_parent %]
132 <input type="text" id="parent_type" value="[% parent_type | html %]" name="parent_type" size="10" maxlength="10" disabled/>
133 <p>Is a parent to another type, cannot have a parent</p>
135 <input type="text" id="parent_type" value="[% parent_type | html %]" name="parent_type" size="10" maxlength="10" disabled/>
136 <p>No available parent types</p>
138 <span class="hint">Defining a parent type will apply checkout limits for all children as described on the circulation rules page.</span>
141 <label for="description" class="required">Description: </label>
142 <input type="text" id="description" name="description" size="48" value="[% itemtype.description | html %]" required="required" /> <span class="required">Required</span>
143 [% IF can_be_translated %]
144 <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>
148 <span class="label">Search category</span>
149 <select id="searchcategory" name="searchcategory">
150 <option value="">None</option>
151 [% FOREACH cat IN searchcategory %]
152 [% IF cat.authorised_value == itemtype.searchcategory %]
153 <option value="[% cat.authorised_value | html %]" selected="selected">
157 <option value="[% cat.authorised_value | html %]" >
163 <span class="hint">Options are defined as the authorized values for the ITEMTYPECAT category.</span>
165 [% IF ( Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') ) %]
167 <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>
171 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
172 <div id="icons" class="toptabs" style="clear:both">
173 <h5 style="margin-left:10px;">Choose an icon:</h5>
175 <li><a href="#none">None</a></li>
176 [% FOREACH imageset IN imagesets %]
177 [% IF ( imageset.imagesetactive ) %]
178 <li class="ui-tabs-active">
182 <a href="#[% imageset.imagesetname | uri %]">[% imageset.imagesetname | html %]</a>
185 [% IF itemtype.image_location('intranet').match('^http') %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#remote">Remote image</a></li>
189 <li><label for="noimage">No image: </label><input type="radio" name="image" id="noimage" value="removeImage" /></li>
194 [% FOREACH imageset IN imagesets %]
195 <div id="[% imageset.imagesetname | html %]">
197 [% FOREACH image IN imageset.images %]
198 <li style="float: none; display: inline-block; clear : none; width: auto;">
200 [% IF image.StaffImageUrl %]
201 <img src="[% image.StaffImageUrl | html %]" alt="[% image.StaffImageUrl | html %]" title="[% image.StaffImageUrl | html %]" />
203 [% IF image.checked %]
204 <input type="radio" name="image" value="[% image.KohaImage | html %]" checked="checked" />
205 [% ELSIF image.KohaImage %] <!-- to delete the radio button if there is no image after -->
206 <input type="radio" name="image" value="[% image.KohaImage | html %]" />
219 <label for="remote_image_check"> Remote image:</label>
220 [% SET image_location = itemtype.image_location('intranet') %]
221 [% IF image_location.match('^http') %]
222 <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />
223 <input type="text" name="remoteImage" size="48" maxlength="200" value="[% image_location | html %]" onmousedown="document.getElementById('remote_image_check').checked = true;" />
224 [% IF itemtype.imageurl %]
225 <img src="[% image_location | html %]" alt="" />
228 <input type="radio" id="remote_image_check" name="image" value="remoteImage" />
229 <input type="text" name="remoteImage" size="48" maxlength="200" value="" onmousedown="document.getElementById('remote_image_check').checked = true;" />
237 <ol class="oladditemtype">
239 <label for="hideinopac">Hide in OPAC: </label>
240 [% IF ( itemtype.hideinopac ) %]
241 <input type="checkbox" id="hideinopac" name="hideinopac" checked="checked" value="1" />
243 <input type="checkbox" id="hideinopac" name="hideinopac" value="1" />
245 <span class="hint">If checked, items of this type will be hidden as filters in OPAC's advanced search.</span>
248 <label for="notforloan">Not for loan: </label>
249 [% IF itemtype.notforloan %]
250 <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
252 <input type="checkbox" id="notforloan" name="notforloan" value="1" />
254 <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>
257 <label for="rentalcharge">Rental charge: </label>
258 <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% itemtype.rentalcharge | $Price on_editing => 1 %]" />
259 <span class="hint">This fee is charged once per checkout/renewal per item</span>
262 <label for="rentalcharge_daily">Daily rental charge: </label>
263 <input type="text" id="rentalcharge_daily" name="rentalcharge_daily" size="10" value="[% itemtype.rentalcharge_daily | $Price on_editing => 1 %]" />
264 <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>
267 <label for="rentalcharge_daily_calendar">Daily rentals use calendar: </label>
268 [% IF itemtype.rentalcharge_daily_calendar %]
269 <input type="checkbox" id="rentalcharge_daily_calendar" name="rentalcharge_daily_calendar" checked="checked" value="1" />
271 <input type="checkbox" id="rentalcharge_daily_calendar" name="rentalcharge_daily_calendar" value="1" />
273 <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>
276 <label for="rentalcharge_hourly">Hourly rental charge: </label>
277 <input type="text" id="rentalcharge_hourly" name="rentalcharge_hourly" size="10" value="[% itemtype.rentalcharge_hourly | $Price on_editing => 1 %]" />
278 <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>
281 <label for="rentalcharge_hourly_calendar">Hourly rentals use calendar: </label>
282 [% IF itemtype.rentalcharge_hourly_calendar %]
283 <input type="checkbox" id="rentalcharge_hourly_calendar" name="rentalcharge_hourly_calendar" checked="checked" value="1" />
285 <input type="checkbox" id="rentalcharge_hourly_calendar" name="rentalcharge_hourly_calendar" value="1" />
287 <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>
290 <label for="defaultreplacecost">Default replacement cost: </label>
291 <input type="text" id="defaultreplacecost" name="defaultreplacecost" size="10" value="[% itemtype.defaultreplacecost | html %]" />
294 <label for="processfee">Processing fee (when lost): </label>
295 <input type="text" id="processfee" name="processfee" size="10" value="[% itemtype.processfee | html %]" />
298 <label for="checkinmsg">Checkin message: </label>
299 <textarea id="checkinmsg" name="checkinmsg" cols="55" rows="5">[% itemtype.checkinmsg | html %]</textarea>
302 <label for="checkinmsgtype">Checkin message type: </label>
303 <select type="text" id="checkinmsgtype" name="checkinmsgtype">
304 [% IF itemtype.checkinmsgtype == 'message' %]
305 <option value="message" selected="selected">Message</option>
307 <option value="message">Message</option>
309 [% IF itemtype.checkinmsgtype == 'alert' %]
310 <option value="alert" selected="selected">Alert</option>
312 <option value="alert">Alert</option>
317 <label for="sip_media_type">SIP media type: </label>
318 <select id="sip_media_type" name="sip_media_type">
319 <option value=""></option>
320 [% FOREACH a IN AuthorisedValues.Get('SIP_MEDIA_TYPE') %]
321 [% IF a.authorised_value == itemtype.sip_media_type %]
322 <option value="[% a.authorised_value | html %]" selected="selected">[% a.lib | html %]</option>
324 <option value="[% a.authorised_value | html %]">[% a.lib | html %]</option>
329 <li><label for="branches">Library limitation: </label>
330 <select id="branches" name="branches" multiple size="10">
331 <option value="">All libraries</option>
332 [% FOREACH branch IN branches_loop %]
333 [% IF ( branch.selected ) %]
334 <option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
336 <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
340 <span class="hint">Select 'All libraries' if all libraries use this item type. Otherwise, select the specific libraries that use this item type.</span>
343 <label for="summary">Summary: </label>
344 <textarea id="summary" name="summary" cols="55" rows="5">[% itemtype.summary | html %]</textarea>
345 <p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
346 <p><strong><a href="[856u]">open site</a></strong> will show the link just below the title</p>
351 <fieldset class="action">
352 <input type="submit" value="Save changes" />
353 <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
358 [% IF op == 'delete_confirm' %]
359 <div class="dialog alert">
360 <h3>Delete item type '[% itemtype.itemtype | html %]'?</h3>
363 <th scope="row">Item type</th>
364 <td>[% itemtype.itemtype | html %]</td>
366 <tr><th scope="row">Description</th><td>[% itemtype.translated_description | html %]</td></tr>
367 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
369 <th scope="row">Image</th>
371 [% SET image_location = itemtype.image_location('intranet') %]
372 [% IF image_location %]<img src="[% image_location | html %]" alt="" />[% END %]
376 <tr><th scope="row">Rental charge</th><td>[% itemtype.rentalcharge | $Price %]</td></tr>
378 <form action="/cgi-bin/koha/admin/itemtypes.pl" method="post">
379 <input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="[% itemtype.itemtype | html %]" />
380 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this item type</button>
382 <form action="/cgi-bin/koha/admin/itemtypes.pl" method="post">
383 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
388 [% IF op == 'list' %]
389 <h2>Item types administration</h2>
391 <table id="table_item_type">
393 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]<th class="noExport">Image</th>[% END %]
397 <th>Search category</th>
398 <th>Not for loan</th>
399 <th>Hide in OPAC</th>
400 <th>Rental charge</th>
401 <th>Daily rental charge</th>
402 <th>Hourly rental charge</th>
403 <th>Default replacement cost</th>
404 <th>Processing fee (when lost)</th>
405 <th>Checkin message</th>
406 <th>Library limitations</th>
407 <th class="noExport NoSort">Actions</th>
409 [% FOREACH itemtype IN itemtypes %]
411 [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %]
413 [% SET image_location = itemtype.image_location('intranet') %]
414 [% IF image_location %]<img src="[% image_location | html %]" alt="" />[% ELSE %] [% END %]
418 [% IF itemtype.parent_type %]
419 [% IF itemtype.parent.translated_descriptions.size %]
420 [% itemtype.parent.description | html %] (default)<br/>
422 [% itemtype.parent.description | html %]
425 [% IF itemtype.translated_descriptions.size %]
426 [% itemtype.description | html %] (default)<br/>
427 [% FOR description IN itemtype.translated_descriptions %]
428 [% IF description.translation == itemtype.translated_description %]
429 -- <strong>[% description.translation | html %]</strong>
431 -- [% description.translation | html %] ([% description.lang | html %])
436 -- [% itemtype.description | html %]
439 [% IF itemtype.translated_descriptions.size %]
440 [% itemtype.description | html %] (default)<br/>
441 [% FOR description IN itemtype.translated_descriptions %]
442 [% IF description.translation == itemtype.translated_description %]
443 <strong>[% description.translation | html %]</strong>
445 [% description.translation | html %] ([% description.lang | html %])
450 [% itemtype.description | html %]
455 <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=[% itemtype.itemtype | uri %]">
456 [% itemtype.itemtype | html %]
460 [% itemtype.parent_type | html %]
462 <td>[% AuthorisedValues.GetByCode( 'ITEMTYPECAT', itemtype.searchcategory ) | html %]</td>
463 <td>[% IF ( itemtype.notforloan ) %]Yes[% ELSE %] [% END %]</td>
464 <td>[% IF ( itemtype.hideinopac ) %]Yes[% ELSE %] [% END %]</td>
466 [% UNLESS ( itemtype.notforloan ) %]
467 [% itemtype.rentalcharge | $Price %]
471 [% UNLESS ( itemtype.notforloan ) %]
472 [% itemtype.rentalcharge_daily | $Price %]
476 [% UNLESS ( itemtype.notforloan ) %]
477 [% itemtype.rentalcharge_hourly | $Price %]
481 <td>[% itemtype.defaultreplacecost | $Price %]</td>
482 <td>[% itemtype.processfee | $Price %]</td>
483 <td>[% itemtype.checkinmsg | html_line_break | $raw %]</td>
485 [% IF itemtype.library_limits %]
486 [% libraries_str = "" %]
487 [% FOREACH library IN itemtype.library_limits %]
488 [%- IF loop.first -%]
489 [% libraries_str = library.branchname _ " (" _ library.branchcode _ ")" %]
491 [% libraries_str = libraries_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %]
494 <span class="library_limitation" title="[% libraries_str | html %]">
495 [% IF itemtype.library_limits.count > 1 %]
496 [% itemtype.library_limits.count | html %] library limitations
498 [% itemtype.library_limits.count | html %] library limitation
505 <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>
506 <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>
512 <div class="dialog message">There are no itemtypes defined</div>
517 </div> <!-- /.col-sm-10.col-sm-push-2 -->
519 <div class="col-sm-2 col-sm-pull-10">
521 [% INCLUDE 'admin-menu.inc' %]
523 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
524 </div> <!-- /.row -->
526 [% MACRO jsinclude BLOCK %]
527 [% Asset.js("js/admin-menu.js") | $raw %]
528 [% INCLUDE 'greybox.inc' %]
529 [% INCLUDE 'datatables.inc' %]
530 [% INCLUDE 'columns_settings.inc' %]
532 $(document).ready(function() {
534 var columns_settings = [% TablesSettings.GetColumns( 'admin', 'itemtypes', 'table_item_type', 'json' ) | $raw %];
535 [% IF ( Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') ) %]
536 columns_settings.shift(); // Remove item type image column from configuration
539 $(document).ready(function() {
540 KohaTable("table_item_type", {
541 "aaSorting": [[ 1, "asc" ]],
542 "iDisplayLength": 10,
543 "sPaginationType": "full"
544 }, columns_settings);
547 $( "#itemtypeentry" ).validate({
549 itemtype: { required: true },
550 description: { required: true },
551 rentalcharge: { number: true }
554 $("#itemtype").on("blur",function(){
557 $(".library_limitation").tooltip();
562 [% INCLUDE 'intranet-bottom.inc' %]