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.
340 lines
14 KiB
340 lines
14 KiB
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Administration › Patron attribute types
|
|
[% IF ( attribute_type_form ) %]
|
|
[% IF ( edit_attribute_type ) %]
|
|
› Modify patron attribute type
|
|
[% ELSE %]
|
|
› Add patron attribute type
|
|
[% END %]
|
|
[% END %]
|
|
[% IF ( delete_attribute_type_form ) %]
|
|
› Confirm deletion of patron attribute type "[% code |html %]"
|
|
[% END %]
|
|
</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
$(document).ready(function() {
|
|
if ( $("#branches option:selected").length < 1 ) {
|
|
$("#branches option:first").attr("selected", "selected");
|
|
}
|
|
} );
|
|
|
|
function DoCancel(f) {
|
|
f.op.value='';
|
|
document.Aform.submit();
|
|
}
|
|
|
|
function CheckAttributeTypeForm(f) {
|
|
var ok=1;
|
|
var _alertString="";
|
|
var alertString2;
|
|
if (f.code.value.length==0) {
|
|
_alertString += "\n- " + _("Patron attribute type code missing");
|
|
}
|
|
if (f.description.value.length==0) {
|
|
_alertString += "\n- " + _("Description missing");
|
|
}
|
|
if (_alertString.length==0) {
|
|
document.Aform.submit();
|
|
} else {
|
|
alertString2 = _("Form not submitted because of the following problem(s)");
|
|
alertString2 += "\n------------------------------------------------------------------------------------\n";
|
|
alertString2 += _alertString;
|
|
alert(alertString2);
|
|
}
|
|
}
|
|
|
|
//]]>
|
|
</script>
|
|
</head>
|
|
<body id="admin_patron-attr-types" class="admin">
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE 'cat-search.inc' %]
|
|
|
|
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › [% IF ( display_list ) %]Patron attribute types[% ELSE %]<a href="/cgi-bin/koha/admin/patron-attr-types.pl">Patron attribute types</a>[% END %]
|
|
[% IF ( attribute_type_form ) %]
|
|
[% IF ( edit_attribute_type ) %]
|
|
› Modify patron attribute type
|
|
[% ELSE %]
|
|
› Add patron attribute type
|
|
[% END %]
|
|
[% END %]
|
|
[% IF ( delete_attribute_type_form ) %]
|
|
› Confirm deletion of patron attribute type "[% code |html %]"
|
|
[% END %]
|
|
</div>
|
|
|
|
<div id="doc3" class="yui-t2">
|
|
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<div class="yui-b">
|
|
|
|
[% IF ( WARNING_extended_attributes_off ) %]
|
|
<div class="dialog message">Because the 'ExtendedPatronAttributes` system preference is currently not enabled, extended patron attributes cannot be given to patron records. Go <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ExtendedPatronAttributes">here</a> if you wish to enable this feature.</div>
|
|
[% END %]
|
|
|
|
[% IF ( attribute_type_form ) %]
|
|
[% IF ( edit_attribute_type ) %]
|
|
<h2>Modify patron attribute type</h2>
|
|
[% ELSE %]
|
|
<h2>Add patron attribute type</h2>
|
|
[% END %]
|
|
[% IF ( duplicate_code_error ) %]
|
|
<div class="dialog message">Could not add patron attribute type "[% duplicate_code_error %]"
|
|
— one with that code already exists.
|
|
</div>
|
|
[% END %]
|
|
<form action="[% script_name %]" name="Aform" method="post">
|
|
<input type="hidden" name="op" value="[% confirm_op %]" />
|
|
<fieldset class="rows">
|
|
<ol>
|
|
<li>
|
|
[% IF ( edit_attribute_type ) %]
|
|
<span class="label">Patron attribute type code: </span>
|
|
<input type="hidden" name="code" value="[% code |html %]" />
|
|
[% code |html %]
|
|
[% ELSE %]
|
|
<label for="code">Patron attribute type code: </label>
|
|
<input type="text" id="code" name="code" size="10" maxlength="10" />
|
|
[% END %]
|
|
</li>
|
|
<li><label for="description">Description: </label>
|
|
<input type="text" id="description" name="description" size="50" maxlength="250"
|
|
value="[% description |html %]" />
|
|
</li>
|
|
<li><label for="repeatable">Repeatable: </label>
|
|
[% IF ( repeatable_checked ) %]
|
|
[% IF ( repeatable_disabled ) %]
|
|
<input type="checkbox" id="repeatable" name="repeatable" checked="checked" disabled="disabled" />
|
|
[% ELSE %]
|
|
<input type="checkbox" id="repeatable" name="repeatable" checked="checked" />
|
|
[% END %]
|
|
[% ELSE %]
|
|
[% IF ( repeatable_disabled ) %]
|
|
<input type="checkbox" id="repeatable" name="repeatable" disabled="disabled" />
|
|
[% ELSE %]
|
|
<input type="checkbox" id="repeatable" name="repeatable" />
|
|
[% END %]
|
|
[% END %]
|
|
<span>Check to let a patron record have multiple values of this attribute.
|
|
This setting cannot be changed after an attribute is defined.</span>
|
|
</li>
|
|
<li><label for="unique_id">Unique identifier: </label>
|
|
[% IF ( unique_id_checked ) %]
|
|
[% IF ( unique_id_disabled ) %]
|
|
<input type="checkbox" id="unique_id" name="unique_id" checked="checked" disabled="disabled" />
|
|
[% ELSE %]
|
|
<input type="checkbox" id="unique_id" name="unique_id" checked="checked" />
|
|
[% END %]
|
|
[% ELSE %]
|
|
[% IF ( unique_id_disabled ) %]
|
|
<input type="checkbox" id="unique_id" name="unique_id" disabled="disabled" />
|
|
[% ELSE %]
|
|
<input type="checkbox" id="unique_id" name="unique_id" />
|
|
[% END %]
|
|
[% END %]
|
|
<span>If checked, attribute will be a unique identifier — if a value is given to a patron record, the same value
|
|
cannot be given to a different record. This setting cannot be changed after an attribute is defined.</span>
|
|
</li>
|
|
<li><label for="opac_display">Display in OPAC: </label>
|
|
[% IF ( opac_display_checked ) %]
|
|
<input type="checkbox" id="opac_display" name="opac_display" checked="checked" />
|
|
[% ELSE %]
|
|
<input type="checkbox" id="opac_display" name="opac_display" />
|
|
[% END %]
|
|
<span>Check to display this attribute on a patron's details page in the OPAC.</span>
|
|
</li>
|
|
<li><label for="staff_searchable">Searchable: </label>
|
|
[% IF ( staff_searchable_checked ) %]
|
|
<input type="checkbox" id="staff_searchable" name="staff_searchable" checked="checked" />
|
|
[% ELSE %]
|
|
<input type="checkbox" id="staff_searchable" name="staff_searchable" />
|
|
[% END %]
|
|
<span>Check to make this attribute staff_searchable in the staff patron search.</span>
|
|
</li>
|
|
<li><label for="display_checkout">Display in check-out: </label>
|
|
[% IF display_checkout_checked %]
|
|
<input type="checkbox" id="display_checkout" name="display_checkout" checked="checked" />
|
|
[% ELSE %]
|
|
<input type="checkbox" id="display_checkout" name="display_checkout" />
|
|
[% END %]
|
|
<span>Check to show this attribute in patron check-out.</span>
|
|
</li>
|
|
|
|
<li><label for="authorised_value_category">Authorized value category: </label>
|
|
<select name="authorised_value_category" id="authorised_value_category">
|
|
<option value=""></option>
|
|
[% FOREACH authorised_value_categorie IN authorised_value_categories %]
|
|
[% IF ( authorised_value_categorie.selected ) %]
|
|
<option value="[% authorised_value_categorie.category %]" selected="selected">
|
|
[% authorised_value_categorie.category %]
|
|
</option>
|
|
[% ELSE %]
|
|
<option value="[% authorised_value_categorie.category %]">
|
|
[% authorised_value_categorie.category %]
|
|
</option>
|
|
[% END %]
|
|
[% END %]
|
|
</select>
|
|
<span>Authorized value category; if one is selected, the patron record input page will only allow values
|
|
to be chosen from the authorized value list. However, an authorized value list is not
|
|
enforced during batch patron import.</span>
|
|
</li>
|
|
<li><label for="branches">Branches limitation: </label>
|
|
<select id="branches" name="branches" multiple size="10">
|
|
<option value="">All branches</option>
|
|
[% FOREACH branch IN branches_loop %]
|
|
[% IF ( branch.selected ) %]
|
|
<option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
|
|
[% ELSE %]
|
|
<option value="[% branch.branchcode %]">[% branch.branchname %]</option>
|
|
[% END %]
|
|
[% END %]
|
|
</select>
|
|
<span>Select All if this attribute type must to be displayed all the time. Otherwise select libraries you want to associate with this value.
|
|
</span>
|
|
</li>
|
|
<li>
|
|
<label for="category">Category: </label>
|
|
<select name="category_code" id="category">
|
|
<option value=""></option>
|
|
[% FOREACH cat IN categories %]
|
|
[% IF ( cat.categorycode == category_code ) %]<option value="[% cat.categorycode %]" selected="selected">[% cat.description %]</option>[% ELSE %]<option value="[% cat.categorycode %]">[% cat.description %]</option>[% END %]
|
|
[% END %]
|
|
</select>
|
|
<span>Choose one to limit this attribute to one patron type. Please leave blank if you want these attributes to be available for all types of patrons.</span>
|
|
</li>
|
|
<li>
|
|
<label for="class">Class: </label>
|
|
<select name="class">
|
|
<option value="" />
|
|
[% FOREACH class IN classes_val_loop %]
|
|
[% IF class.authorised_value == category_class %]
|
|
<option value="[% class.authorised_value %]" selected="selected">
|
|
[% class.lib %]
|
|
</option>
|
|
[% ELSE %]
|
|
<option value="[% class.authorised_value %]" >
|
|
[% class.lib %]
|
|
</option>
|
|
[% END %]
|
|
[% END %]
|
|
</select>
|
|
<span>Group attributes types with a block title (based on authorized values category 'PA_CLASS')</span>
|
|
</li>
|
|
</ol>
|
|
</fieldset>
|
|
<fieldset class="action">
|
|
[% IF ( edit_attribute_type ) %]
|
|
<input type="button" value="Save"
|
|
onclick="CheckAttributeTypeForm(this.form)" />
|
|
[% ELSE %]
|
|
<input type="button" value="Save"
|
|
onclick="CheckAttributeTypeForm(this.form)" />
|
|
[% END %]
|
|
<a class="cancel" href="/cgi-bin/koha/admin/patron-attr-types.pl">Cancel</a>
|
|
</fieldset>
|
|
</form>
|
|
[% END %]
|
|
|
|
[% IF ( delete_attribute_type_form ) %]
|
|
<div class="dialog alert">
|
|
<h3>Confirm deletion of patron attribute type <span class="ex">'[% code |html %]' ([% description %])</span>?</h3>
|
|
<form action="[% script_name %]" name="Aform" method="post">
|
|
<input type="hidden" name="op" value="[% confirm_op %]" />
|
|
<input type="hidden" name="code" value="[% code |html %]" />
|
|
<button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete patron attribute type</button>
|
|
</form>
|
|
<form action="[% script_name %]" method="get">
|
|
<button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
|
|
</form>
|
|
</div>
|
|
[% END %]
|
|
|
|
[% IF ( display_list ) %]
|
|
|
|
<div id="toolbar" class="btn-toolbar">
|
|
<a class="btn btn-small" id="newrule" href="[% script_name %]?op=add_attribute_type"><i class="fa fa-plus"></i> New patron attribute type</a>
|
|
</div>
|
|
|
|
<h2>Patron attribute types</h2>
|
|
[% IF ( added_attribute_type ) %]
|
|
<div class="dialog message">Added patron attribute type "[% added_attribute_type %]"</div>
|
|
[% END %]
|
|
[% IF ( edited_attribute_type ) %]
|
|
<div class="dialog message">Modified patron attribute type "[% edited_attribute_type %]"</div>
|
|
[% END %]
|
|
[% IF ( deleted_attribute_type ) %]
|
|
<div class="dialog message">Deleted patron attribute type "[% deleted_attribute_type %]"</div>
|
|
[% END %]
|
|
[% IF ( ERROR_delete_in_use ) %]
|
|
<div class="dialog message">Could not delete patron attribute type "[% ERROR_delete_in_use %]"
|
|
— it is in use by [% ERROR_num_patrons %] patron records</div>
|
|
[% END %]
|
|
[% IF ( ERROR_delete_not_found ) %]
|
|
<div class="dialog message">Could not delete patron attribute type "[% ERROR_delete_not_found %]"
|
|
— it was already absent from the database.</div>
|
|
[% END %]
|
|
[% IF ( available_attribute_types ) %]
|
|
[% FOREACH attribute IN available_attribute_types %]
|
|
[% IF attribute.class %]
|
|
<h4>[% attribute.lib %]</h4>
|
|
[% END %]
|
|
<table class="patron_attributes_types">
|
|
<thead>
|
|
<tr>
|
|
<th>Code</th>
|
|
<th>Description</th>
|
|
<th>Branches limitation</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
[% FOREACH item IN attribute.items %]
|
|
<tr>
|
|
<td>[% item.code |html %]</td>
|
|
<td>[% item.description %]</td>
|
|
<td>
|
|
[% IF item.branches.size > 0 %]
|
|
[% branches_str = "" %]
|
|
[% FOREACH branch IN item.branches %]
|
|
[% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
|
|
[% END %]
|
|
<span title="[% branches_str %]">
|
|
[% IF item.branches.size > 1 %]
|
|
[% item.branches.size %] branches limitations
|
|
[% ELSE %]
|
|
[% item.branches.size %] branch limitation
|
|
[% END %]
|
|
</span>
|
|
[% ELSE %]
|
|
No limitation
|
|
[% END %]
|
|
</td>
|
|
<td>
|
|
<a href="[% item.script_name %]?op=edit_attribute_type&code=[% item.code |html %]">Edit</a>
|
|
<a href="[% item.script_name %]?op=delete_attribute_type&code=[% item.code |html %]">Delete</a>
|
|
</td>
|
|
</tr>
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
[% END %]
|
|
[% ELSE %]
|
|
<p>There are no saved patron attribute types.</p>
|
|
[% END %]
|
|
|
|
<div class="pages">[% pagination_bar %]</div>
|
|
|
|
[% END %]
|
|
|
|
</div>
|
|
</div>
|
|
<div class="yui-b">
|
|
[% INCLUDE 'admin-menu.inc' %]
|
|
</div>
|
|
</div>
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|
|
|