Main Koha release repository https://koha-community.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

400 lines
19 KiB

[% USE Koha %]
[% USE AuthorisedValues %]
[% USE Price %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Administration &rsaquo; Item types [% IF op == 'add_form' %]&rsaquo;
[% IF ( itemtype ) %]
Modify item type '[% itemtype.itemtype %]'
[% ELSE %]
Add item type
[% END %]
[% END %]
[% IF op == 'delete_confirm' %]&rsaquo;
[% IF ( total ) %]
Cannot delete item type '[% itemtype.itemtype %]'
[% ELSE %]
Delete item type '[% itemtype.itemtype %]'?
[% END %]
[% END %]
[% IF op == 'delete_confirmed' %]&rsaquo;
Data deleted
[% END %]
</title>
[% INCLUDE 'doc-head-close.inc' %]
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
[% INCLUDE 'greybox.inc' %]
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
$('#icons').tabs();
$("#table_item_type").dataTable($.extend(true, {}, dataTablesDefaults, {
"aoColumnDefs": [
{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
],
"aaSorting": [[ 2, "asc" ]],
"iDisplayLength": 10,
"sPaginationType": "four_button"
}));
$( "#itemtypeentry" ).validate({
rules: {
itemtype: { required: true },
description: { required: true },
rentalcharge: { number: true }
}
});
});
//]]>
</script>
<style type="text/css">
fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; }
fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-active {background-color : #F4F8F9; }
fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;}
fieldset.rows .ui-tabs-nav { margin-left : 10px; }
</style>
</head>
<body id="admin_itemtypes" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; [% IF op == 'add_form' %]
[% IF itemtype %]
<a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Modify item type '[% itemtype.itemtype %]'
[% ELSE %]
<a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Add item type
[% END %]
[% END %]
[% IF op == 'delete_confirm' %]
[% IF total %]
<a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Cannot delete item type '[% itemtype.itemtype %]'
[% ELSE %]
<a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Delete item type '[% itemtype.itemtype %]'?
[% END %]
[% END %]
[% IF op == 'delete_confirmed' %]
<a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo;Data deleted
[% END %]
[% IF op == 'list' %]
Item types administration
[% END %]</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
[% IF op == 'list' %]<div id="toolbar" class="btn-toolbar">
<a class="btn btn-small" id="newitemtype" href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form"><i class="fa fa-plus"></i> New item type</a>
</div>[% END %]
[% FOREACH m IN messages %]
<div class="dialog [% m.type %]">
[% SWITCH m.code %]
[% CASE 'error_on_update' %]
An error occurred when updating this item type. Perhaps the value already exists.
[% CASE 'error_on_insert' %]
An error occurred when inserting this item type. Perhaps the value already exists.
[% CASE 'error_on_delete' %]
An error occurred when deleting this item type. Check the logs.
[% CASE 'success_on_update' %]
Item type updated successfully.
[% CASE 'success_on_insert' %]
Item type inserted successfully.
[% CASE 'success_on_delete' %]
Item type deleted successfully.
[% CASE 'already_exists' %]
This item type already exists.
[% CASE 'cannot_be_deleted' %]
Cannot delete this item type. <p><strong>This record is used [% m.total %] times</strong>. Deletion is not possible.</p>
[% CASE %]
[% m.code %]
[% END %]
</div>
[% END %]
[% IF op == 'add_form' %]
[% IF itemtype %]
<h3>Modify item type</h3>
[% ELSE %]
<h3>Add item type</h3>
[% END %]
<form action="/cgi-bin/koha/admin/itemtypes.pl" name="Aform" method="post" id="itemtypeentry">
<input type="hidden" name="op" value="add_validate" />
<fieldset class="rows">
<ol>
[% IF itemtype %]
<li>
<input type="hidden" name="is_a_modif" value="1" />
<span class="label">Item type: </span> <input type="hidden" name="itemtype" value="[% itemtype.itemtype %]" />
[% itemtype.itemtype %]
</li>
[% ELSE %]
<li>
<label for="itemtype" class="required">Item type: </label>
<input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" required="required" /> <span class="required">Required</span>
</li>
[% END %]
<li>
<label for="description" class="required">Description: </label>
<input type="text" id="description" name="description" size="48" value="[% itemtype.description |html %]" required="required" /> <span class="required">Required</span>
[% IF can_be_translated %]
<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>
[% END %]
</li>
<li>
<span class="label">Search category</span>
<select id="searchcategory" name="searchcategory">
<option value="">None</option>
[% FOREACH cat IN searchcategory %]
[% IF cat.authorised_value == itemtype.searchcategory %]
<option value="[% cat.authorised_value %]" selected="selected">
[% cat.lib %]
</option>
[% ELSE %]
<option value="[% cat.authorised_value %]" >
[% cat.lib %]
</option>
[% END %]
[% END %]
</select>
(Options are defined as the authorized values for the ITEMTYPECAT category)
</li>
[% IF Koha.Preference('noItemTypeImages') %]
<li>
<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&amp;searchfield=noItemTypeImages">noItemTypeImages system preference</a>
</li>
[% END %]
</ol>
[% UNLESS Koha.Preference('noItemTypeImages') %]
<div id="icons" class="toptabs" style="clear:both">
<h5 style="margin-left:10px;">Choose an icon:</h5>
<ul>
<li><a href="#none">None</a></li>
[% FOREACH imageset IN imagesets %]
[% IF ( imageset.imagesetactive ) %]
<li class="ui-tabs-active">
[% ELSE %]
<li>
[% END %]
<a href="#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a>
</li>
[% END %]
[% IF itemtype.image_location.match('^http') %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#remote">Remote image</a></li>
</ul>
<div id="none">
<ul>
<li><label for="noimage">No image: </label><input type="radio" name="image" id="noimage" value="removeImage" /></li>
</ul>
<br class="clear" />
</div>
[% FOREACH imageset IN imagesets %]
<div id="[% imageset.imagesetname %]">
<ul>
[% FOREACH image IN imageset.images %]
<li style="float: none; display: inline-block; clear : none; width: auto;">
<label>
[% IF image.StaffImageUrl %]
<img src="[% image.StaffImageUrl %]" alt="[% image.StaffImageUrl %]" title="[% image.StaffImageUrl %]" />
[% END %]
[% IF image.checked %]
<input type="radio" name="image" value="[% image.KohaImage %]" checked="checked" />
[% ELSIF image.KohaImage %] <!-- to delete the radio button if there is no image after -->
<input type="radio" name="image" value="[% image.KohaImage %]" />
[% END %]
</label>
</li>
[% END %]
</ul>
<br class="clear" />
</div>
[% END %]
<div id="remote">
<ul>
<li>
<label for="remote_image_check"> Remote image:</label>
[% IF remote_image %]
<input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />
[% ELSE %]
<input type="radio" id="remote_image_check" name="image" value="remoteImage" />
[% END %]
<input type="text" name="remoteImage" size="48" maxlength="200" value="[% remote_image %]" onmousedown="document.getElementById('remote_image_check').checked = true;" />
[% IF ( remote_image ) %]
<img src="[% remote_image %]" alt="" />
[% END %]
</li>
</ul>
<br class="clear" />
</div>
</div>
[% END %]
<ol>
<li>
<label for="hideinopac">Hide in OPAC: </label>
[% IF ( itemtype.hideinopac ) %]
<input type="checkbox" id="hideinopac" name="hideinopac" checked="checked" value="1" />
[% ELSE %]
<input type="checkbox" id="hideinopac" name="hideinopac" value="1" />
[% END %]
(if checked, items of this type will be hidden as filters in OPAC's advanced search)
</li>
<li>
<label for="notforloan">Not for loan: </label>
[% IF itemtype.notforloan %]
<input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
[% ELSE %]
<input type="checkbox" id="notforloan" name="notforloan" value="1" />
[% END %]
(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)
</li>
<li>
<label for="rentalcharge">Rental charge: </label>
<input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% itemtype.rentalcharge %]" />
</li>
<li>
<label for="checkinmsg">Checkin message: </label>
<textarea id="checkinmsg" name="checkinmsg" cols="55" rows="5">[% itemtype.checkinmsg %]</textarea>
</li>
<li>
<label for="checkinmsgtype">Checkin message type: </label>
<select type="text" id="checkinmsgtype" name="checkinmsgtype">
[% IF itemtype.checkinmsgtype == 'message' %]
<option value="message" selected="selected">Message</option>
[% ELSE %]
<option value="message">Message</option>
[% END %]
[% IF itemtype.checkinmsgtype == 'alert' %]
<option value="alert" selected="selected">Alert</option>
[% ELSE %]
<option value="alert">Alert</option>
[% END %]
</select>
</li>
<li>
<label for="sip_media_type">SIP media type: </label>
<select id="sip_media_type" name="sip_media_type">
<option value=""></option>
[% FOREACH a IN AuthorisedValues.Get('SIP_MEDIA_TYPE') %]
[% IF a.authorised_value == itemtype.sip_media_type %]
<option value="[% a.authorised_value %]" selected="selected">[% a.lib %]</option>
[% ELSE %]
<option value="[% a.authorised_value %]">[% a.lib %]</option>
[% END %]
[% END %]
</select>
</li>
<li>
<label for="summary">Summary: </label>
<textarea id="summary" name="summary" cols="55" rows="5">[% itemtype.summary %]</textarea>
<p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
<p><b>&lt;a href="[856u]"&gt;open site&lt;/a&gt;</b> will show the link just below the title</p>
</li>
</ol>
</fieldset>
<fieldset class="action">
<input type="submit" value="Save changes" />
<a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
</fieldset>
</form>
[% END %]
[% IF op == 'delete_confirm' %]
<div class="dialog alert">
<h3>Delete item type '[% itemtype.itemtype %]'?</h3>
<table>
<tr>
<th scope="row">Item type</th>
<td>[% itemtype.itemtype %]</td>
</tr>
<tr><th scope="row">Description</th><td>[% itemtype.translated_description %]</td></tr>
[% UNLESS Koha.Preference('noItemTypeImages') %]
<tr>
<th scope="row">Image</th>
<td>
[% IF itemtype.image_location %]<img src="[% itemtype.image_location %]" alt="" />[% END %]
</td>
</tr>
[% END %]
<tr><th scope="row">Rental charge</th><td>[% itemtype.rentalcharge | $Price %]</td></tr>
</table>
<form action="/cgi-bin/koha/admin/itemtypes.pl" method="post">
<input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="[% itemtype.itemtype %]" />
<button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this item type</button>
</form>
<form action="/cgi-bin/koha/admin/itemtypes.pl" method="post">
<button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
</form>
</div>
[% END %]
[% IF op == 'list' %]
<h2>Item types administration</h2>
[% IF itemtypes %]
<table id="table_item_type">
<thead>
[% UNLESS Koha.Preference('noItemTypeImages') %]<th>Image</th>[% END %]
<th>Code</th>
<th>Description</th>
<th>Search category</th>
<th>Not for loan</th>
<th>Hide in OPAC</th>
<th>Charge</th>
<th>Checkin message</th>
<th>Actions</th>
</thead>
[% FOREACH itemtype IN itemtypes %]
<tr>
[% UNLESS Koha.Preference('noItemTypeImages') %] <td>[% IF itemtype.image_location %]<img src="[% itemtype.image_location %]" alt="" />[% ELSE %]&nbsp;[% END %]</td>[% END %]
<td>
<a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&amp;itemtype=[% itemtype.itemtype |html %]">
[% itemtype.itemtype %]
</a>
</td>
<td>
[% IF itemtype.translated_descriptions.size %]
[% itemtype.description %] (default)<br/>
[% FOR description IN itemtype.translated_descriptions %]
[% IF description.translation == itemtype.translated_description %]
<b>[% description.translation %]</b>
[% ELSE %]
[% description.translation %] ([% description.lang %])
[% END %]
<br/>
[% END %]
[% ELSE %]
[% itemtype.description %]
[% END %]
</td>
<td>[% itemtype.searchcategory %]</td>
<td>[% IF ( itemtype.notforloan ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
<td>[% IF ( itemtype.hideinopac ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
<td>
[% UNLESS ( itemtype.notforloan ) %]
[% itemtype.rentalcharge | $Price %]
[% END %]
</td>
<td>[% itemtype.checkinmsg | html_line_break %]</td>
<td>
<a href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form&amp;itemtype=[% itemtype.itemtype |html %]">Edit</a>
<a href="/cgi-bin/koha/admin/itemtypes.pl?op=delete_confirm&amp;itemtype=[% itemtype.itemtype |html %]">Delete</a>
</td>
</tr>
[% END %]
</table>
[% ELSE %]
<div class="dialog message">There are no itemtypes defined</div>
[% END %]
[% END %]
</div>
</div>
<div class="yui-b">
[% INCLUDE 'admin-menu.inc' %]
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]