3 [% USE AuthorisedValues %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha › Administration › Item types [% IF op == 'add_form' %]›
9 Modify item type '[% itemtype.itemtype %]'
14 [% IF op == 'delete_confirm' %]›
16 Cannot delete item type '[% itemtype.itemtype %]'
18 Delete item type '[% itemtype.itemtype %]'?
21 [% IF op == 'delete_confirmed' %]›
25 [% INCLUDE 'doc-head-close.inc' %]
26 [% Asset.css("css/datatables.css") %]
27 <style type="text/css">
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 <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' %]
41 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> › Modify item type '[% itemtype.itemtype %]'
43 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> › Add item type
46 [% IF op == 'delete_confirm' %]
48 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> › Cannot delete item type '[% itemtype.itemtype %]'
50 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> › Delete item type '[% itemtype.itemtype %]'?
53 [% IF op == 'delete_confirmed' %]
54 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> ›Data deleted
57 Item types administration
60 <div id="doc3" class="yui-t2">
67 [% IF op == 'list' %]<div id="toolbar" class="btn-toolbar">
68 <a class="btn btn-default btn-sm" id="newitemtype" href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form"><i class="fa fa-plus"></i> New item type</a>
71 [% FOREACH m IN messages %]
72 <div class="dialog [% m.type %]">
74 [% CASE 'error_on_update' %]
75 An error occurred when updating this item type. Perhaps the value already exists.
76 [% CASE 'error_on_insert' %]
77 An error occurred when inserting this item type. Perhaps the value already exists.
78 [% CASE 'error_on_delete' %]
79 An error occurred when deleting this item type. Check the logs.
80 [% CASE 'success_on_update' %]
81 Item type updated successfully.
82 [% CASE 'success_on_insert' %]
83 Item type inserted successfully.
84 [% CASE 'success_on_delete' %]
85 Item type deleted successfully.
86 [% CASE 'already_exists' %]
87 This item type already exists.
88 [% CASE 'cannot_be_deleted' %]
89 Cannot delete this item type. <p><strong>This record is in use</strong>. Deletion is not possible.</p>
97 [% IF op == 'add_form' %]
99 <h3>Modify item type</h3>
101 <h3>Add item type</h3>
103 <form action="/cgi-bin/koha/admin/itemtypes.pl" name="Aform" method="post" id="itemtypeentry">
104 <input type="hidden" name="op" value="add_validate" />
105 <fieldset class="rows">
109 <input type="hidden" name="is_a_modif" value="1" />
110 <span class="label">Item type: </span> <input type="hidden" name="itemtype" value="[% itemtype.itemtype %]" />
111 [% itemtype.itemtype %]
115 <label for="itemtype" class="required">Item type: </label>
116 <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" required="required" /> <span class="required">Required</span>
120 <label for="description" class="required">Description: </label>
121 <input type="text" id="description" name="description" size="48" value="[% itemtype.description |html %]" required="required" /> <span class="required">Required</span>
122 [% IF can_be_translated %]
123 <a href="/cgi-bin/koha/admin/localization.pl?entity=itemtypes&code=[% itemtype.itemtype %]" title="Translate item type [% itemtype.itemtype %]" rel="gb_page_center[600,500]"><i class="fa fa-pencil"></i> Translate into other languages</a>
127 <span class="label">Search category</span>
128 <select id="searchcategory" name="searchcategory">
129 <option value="">None</option>
130 [% FOREACH cat IN searchcategory %]
131 [% IF cat.authorised_value == itemtype.searchcategory %]
132 <option value="[% cat.authorised_value %]" selected="selected">
136 <option value="[% cat.authorised_value %]" >
142 (Options are defined as the authorized values for the ITEMTYPECAT category)
144 [% IF Koha.Preference('noItemTypeImages') %]
146 <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 system preference</a>
150 [% UNLESS Koha.Preference('noItemTypeImages') %]
151 <div id="icons" class="toptabs" style="clear:both">
152 <h5 style="margin-left:10px;">Choose an icon:</h5>
154 <li><a href="#none">None</a></li>
155 [% FOREACH imageset IN imagesets %]
156 [% IF ( imageset.imagesetactive ) %]
157 <li class="ui-tabs-active">
161 <a href="#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a>
164 [% IF itemtype.image_location('intranet').match('^http') %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#remote">Remote image</a></li>
168 <li><label for="noimage">No image: </label><input type="radio" name="image" id="noimage" value="removeImage" /></li>
173 [% FOREACH imageset IN imagesets %]
174 <div id="[% imageset.imagesetname %]">
176 [% FOREACH image IN imageset.images %]
177 <li style="float: none; display: inline-block; clear : none; width: auto;">
179 [% IF image.StaffImageUrl %]
180 <img src="[% image.StaffImageUrl %]" alt="[% image.StaffImageUrl %]" title="[% image.StaffImageUrl %]" />
182 [% IF image.checked %]
183 <input type="radio" name="image" value="[% image.KohaImage %]" checked="checked" />
184 [% ELSIF image.KohaImage %] <!-- to delete the radio button if there is no image after -->
185 <input type="radio" name="image" value="[% image.KohaImage %]" />
198 <label for="remote_image_check"> Remote image:</label>
199 [% IF itemtype.imageurl %]
200 <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />
202 <input type="radio" id="remote_image_check" name="image" value="remoteImage" />
204 <input type="text" name="remoteImage" size="48" maxlength="200" value="[% itemtype.imageurl %]" onmousedown="document.getElementById('remote_image_check').checked = true;" />
205 [% IF itemtype.imageurl %]
206 <img src="[% itemtype.imageurl %]" alt="" />
214 <ol class="oladditemtype">
216 <label for="hideinopac">Hide in OPAC: </label>
217 [% IF ( itemtype.hideinopac ) %]
218 <input type="checkbox" id="hideinopac" name="hideinopac" checked="checked" value="1" />
220 <input type="checkbox" id="hideinopac" name="hideinopac" value="1" />
222 (if checked, items of this type will be hidden as filters in OPAC's advanced search)
225 <label for="notforloan">Not for loan: </label>
226 [% IF itemtype.notforloan %]
227 <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
229 <input type="checkbox" id="notforloan" name="notforloan" value="1" />
231 (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)
234 <label for="rentalcharge">Rental charge: </label>
235 <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% itemtype.rentalcharge %]" />
238 <label for="defaultreplacecost">Default replacement cost: </label>
239 <input type="text" id="defaultreplacecost" name="defaultreplacecost" size="10" value="[% itemtype.defaultreplacecost %]" />
242 <label for="processfee">Processing fee (when lost): </label>
243 <input type="text" id="processfee" name="processfee" size="10" value="[% itemtype.processfee %]" />
246 <label for="checkinmsg">Checkin message: </label>
247 <textarea id="checkinmsg" name="checkinmsg" cols="55" rows="5">[% itemtype.checkinmsg %]</textarea>
250 <label for="checkinmsgtype">Checkin message type: </label>
251 <select type="text" id="checkinmsgtype" name="checkinmsgtype">
252 [% IF itemtype.checkinmsgtype == 'message' %]
253 <option value="message" selected="selected">Message</option>
255 <option value="message">Message</option>
257 [% IF itemtype.checkinmsgtype == 'alert' %]
258 <option value="alert" selected="selected">Alert</option>
260 <option value="alert">Alert</option>
265 <label for="sip_media_type">SIP media type: </label>
266 <select id="sip_media_type" name="sip_media_type">
267 <option value=""></option>
268 [% FOREACH a IN AuthorisedValues.Get('SIP_MEDIA_TYPE') %]
269 [% IF a.authorised_value == itemtype.sip_media_type %]
270 <option value="[% a.authorised_value %]" selected="selected">[% a.lib %]</option>
272 <option value="[% a.authorised_value %]">[% a.lib %]</option>
278 <label for="summary">Summary: </label>
279 <textarea id="summary" name="summary" cols="55" rows="5">[% itemtype.summary %]</textarea>
280 <p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
281 <p><b><a href="[856u]">open site</a></b> will show the link just below the title</p>
286 <fieldset class="action">
287 <input type="submit" value="Save changes" />
288 <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
293 [% IF op == 'delete_confirm' %]
294 <div class="dialog alert">
295 <h3>Delete item type '[% itemtype.itemtype %]'?</h3>
298 <th scope="row">Item type</th>
299 <td>[% itemtype.itemtype %]</td>
301 <tr><th scope="row">Description</th><td>[% itemtype.translated_description %]</td></tr>
302 [% UNLESS Koha.Preference('noItemTypeImages') %]
304 <th scope="row">Image</th>
306 [% SET image_location = itemtype.image_location('intranet') %]
307 [% IF image_location %]<img src="[% image_location %]" alt="" />[% END %]
311 <tr><th scope="row">Rental charge</th><td>[% itemtype.rentalcharge | $Price %]</td></tr>
313 <form action="/cgi-bin/koha/admin/itemtypes.pl" method="post">
314 <input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="[% itemtype.itemtype %]" />
315 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this item type</button>
317 <form action="/cgi-bin/koha/admin/itemtypes.pl" method="post">
318 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
323 [% IF op == 'list' %]
324 <h2>Item types administration</h2>
326 <table id="table_item_type">
328 [% UNLESS Koha.Preference('noItemTypeImages') %]<th>Image</th>[% END %]
331 <th>Search category</th>
332 <th>Not for loan</th>
333 <th>Hide in OPAC</th>
335 <th>Default replacement cost</th>
336 <th>Processing fee (when lost)</th>
337 <th>Checkin message</th>
340 [% FOREACH itemtype IN itemtypes %]
342 [% UNLESS Koha.Preference('noItemTypeImages') %]
344 [% SET image_location = itemtype.image_location('intranet') %]
345 [% IF image_location %]<img src="[% image_location %]" alt="" />[% ELSE %] [% END %]
349 <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=[% itemtype.itemtype |html %]">
350 [% itemtype.itemtype %]
354 [% IF itemtype.translated_descriptions.size %]
355 [% itemtype.description %] (default)<br/>
356 [% FOR description IN itemtype.translated_descriptions %]
357 [% IF description.translation == itemtype.translated_description %]
358 <b>[% description.translation %]</b>
360 [% description.translation %] ([% description.lang %])
365 [% itemtype.description |html %]
368 <td>[% itemtype.searchcategory %]</td>
369 <td>[% IF ( itemtype.notforloan ) %]Yes[% ELSE %] [% END %]</td>
370 <td>[% IF ( itemtype.hideinopac ) %]Yes[% ELSE %] [% END %]</td>
372 [% UNLESS ( itemtype.notforloan ) %]
373 [% itemtype.rentalcharge | $Price %]
376 <td>[% itemtype.defaultreplacecost | $Price %]</td>
377 <td>[% itemtype.processfee | $Price %]</td>
378 <td>[% itemtype.checkinmsg | html | html_line_break %]</td>
380 <a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=[% itemtype.itemtype |html %]" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
381 <a href="/cgi-bin/koha/admin/itemtypes.pl?op=delete_confirm&itemtype=[% itemtype.itemtype |html %]" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
387 <div class="dialog message">There are no itemtypes defined</div>
394 [% INCLUDE 'admin-menu.inc' %]
398 [% MACRO jsinclude BLOCK %]
399 [% Asset.js("js/admin-menu.js") %]
400 [% INCLUDE 'greybox.inc' %]
401 [% INCLUDE 'datatables.inc' %]
402 <script type="text/javascript">
403 $(document).ready(function() {
405 $("#table_item_type").dataTable($.extend(true, {}, dataTablesDefaults, {
407 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
409 "aaSorting": [[ 2, "asc" ]],
410 "iDisplayLength": 10,
411 "sPaginationType": "four_button"
413 $( "#itemtypeentry" ).validate({
415 itemtype: { required: true },
416 description: { required: true },
417 rentalcharge: { number: true }
420 $("#itemtype").on("blur",function(){
427 [% INCLUDE 'intranet-bottom.inc' %]