4 [% USE AuthorisedValues %]
8 [% INCLUDE 'doc-head-open.inc' %]
10 [% IF ( attribute_type_form ) %]
11 [% IF ( edit_attribute_type ) %]
12 Modify patron attribute type › [% ELSE %]
13 Add patron attribute type › [% END %]
16 [% IF ( delete_attribute_type_form ) %]
17 Confirm deletion of patron attribute type "[% code | html %]" › [% END %]
19 Patron attribute types › Administration › Koha
21 [% INCLUDE 'doc-head-close.inc' %]
24 <body id="admin_patron-attr-types" class="admin">
25 [% WRAPPER 'header.inc' %]
26 [% INCLUDE 'prefs-admin-search.inc' %]
29 [% WRAPPER 'sub-header.inc' %]
30 [% WRAPPER breadcrumbs %]
31 [% WRAPPER breadcrumb_item %]
32 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
35 [% IF ( attribute_type_form || delete_attribute_type_form ) %]
36 [% WRAPPER breadcrumb_item %]
37 <a href="/cgi-bin/koha/admin/patron-attr-types.pl">Patron attribute types</a>
41 [% IF ( attribute_type_form ) %]
42 [% WRAPPER breadcrumb_item bc_active= 1 %]
43 [% IF ( edit_attribute_type ) %]
44 <span>Modify patron attribute type</span>
46 <span>Add patron attribute type</span>
50 [% ELSIF ( delete_attribute_type_form ) %]
51 [% WRAPPER breadcrumb_item bc_active= 1 %]
52 <span>Confirm deletion of patron attribute type '[% code | html %]'</span>
56 [% WRAPPER breadcrumb_item bc_active= 1 %]
57 <span>Patron attribute types</span>
60 [% END #/ WRAPPER breadcrumbs %]
61 [% END #/ WRAPPER sub-header.inc %]
63 <div class="main container-fluid">
65 <div class="col-sm-10 col-sm-push-2">
68 [% IF ( WARNING_extended_attributes_off ) %]
69 <div class="dialog message">Because the 'ExtendedPatronAttributes` system preference is currently not enabled, extended patron attributes cannot be given to patron records. <br/>Go to the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ExtendedPatronAttributes">ExtendedPatronAttributes</a> system preference if you wish to enable this feature.</div>
72 [% IF ( attribute_type_form ) %]
73 [% IF ( edit_attribute_type ) %]
74 <h1>Modify patron attribute type</h1>
76 <h1>Add patron attribute type</h1>
78 [% IF ( duplicate_code_error ) %]
79 <div class="dialog message">Could not add patron attribute type "[% duplicate_code_error | html %]"
80 — one with that code already exists.
83 <form action="[% script_name | html %]" class="validated" method="post">
84 <input type="hidden" name="op" value="[% confirm_op | html %]" />
85 <fieldset class="rows">
88 [% IF attribute_type %]
89 <span class="label">Patron attribute type code: </span>
90 <input type="hidden" name="code" value="[% attribute_type.code |html %]" />
91 [% attribute_type.code |html %]
93 <label for="code" class="required">Patron attribute type code: </label>
94 <input type="text" id="code" name="code" required="required" class="required focus" size="10" maxlength="10" />
95 <span class="required">Required</span>
98 <li><label for="description" class="required">Description: </label>
99 <input type="text" id="description" name="description" required="required" class="required" size="50" maxlength="250" value="[% attribute_type.description |html %]" />
100 <span class="required">Required</span>
103 [% IF attribute_type AND attribute_type.repeatable AND NOT can_be_set_to_nonrepeatable %]
104 <li aria-disabled="true">
108 <label for="repeatable">Repeatable: </label>
109 [% IF attribute_type %]
110 [% IF attribute_type.repeatable AND NOT can_be_set_to_nonrepeatable %]
111 <input type="checkbox" id="repeatable" name="repeatable" checked="checked" disabled="disabled" title="At least one patron has more than one value for this attribute" />
112 <input type="hidden" name="repeatable" value="1" />
113 [% ELSIF attribute_type.repeatable %]
114 <input type="checkbox" id="repeatable" name="repeatable" checked="checked" />
116 <input type="checkbox" id="repeatable" name="repeatable" />
119 <input type="checkbox" id="repeatable" name="repeatable" />
121 <span class="hint">Check to let a patron record have multiple values of this attribute.</span>
124 [% IF attribute_type AND not can_be_set_to_unique %]
125 <li aria-disabled="true">
129 <label for="unique_id">Unique identifier: </label>
130 [% IF attribute_type %]
131 [% IF attribute_type.unique_id %]
132 <input type="checkbox" id="unique_id" name="unique_id" checked="checked" />
133 [% ELSIF can_be_set_to_unique %]
134 <input type="checkbox" id="unique_id" name="unique_id" />
136 <input type="checkbox" id="unique_id" name="unique_id" disabled="disabled" title="At least two patrons have the same value for this attribute" />
137 <input type="hidden" name="unique_id" value="0" />
140 <input type="checkbox" id="unique_id" name="unique_id" />
142 <span class="hint">If checked, attribute will be a unique identifier. If a value is given to a patron record, the same value
143 cannot be given to a different record.</span>
146 <li><label for="opac_display">Display in OPAC: </label>
147 [% IF attribute_type AND attribute_type.opac_display %]
148 <input type="checkbox" id="opac_display" name="opac_display" checked="checked" />
150 <input type="checkbox" id="opac_display" name="opac_display" />
152 <span class="hint">Check to display this attribute on a patron's details page in the OPAC.</span>
154 <li><label for="opac_editable">Editable in OPAC: </label>
155 [% IF attribute_type AND attribute_type.opac_editable %]
156 <input type="checkbox" id="opac_editable" name="opac_editable" checked="checked" />
158 <input type="checkbox" id="opac_editable" name="opac_editable" />
160 <span class="hint">Check to allow patrons to edit this attribute from their details page in the OPAC. (Requires above)</span>
162 <li><label for="staff_searchable">Searchable: </label>
163 [% IF attribute_type AND attribute_type.staff_searchable %]
164 <input type="checkbox" id="staff_searchable" name="staff_searchable" checked="checked" />
166 <input type="checkbox" id="staff_searchable" name="staff_searchable" />
168 <span class="hint">Check to make this attribute staff_searchable in the staff patron search.</span>
170 <li><label for="mandatory">Mandatory: </label>
171 [% IF attribute_type AND attribute_type.mandatory %]
172 <input type="checkbox" id="mandatory" name="mandatory" checked="checked" />
174 <input type="checkbox" id="mandatory" name="mandatory" />
176 <span class="hint">Check to make this attribute mandatory when creating or editing a patron.</span>
178 <li><label for="display_checkout">Display in patron's brief information: </label>
179 [% IF attribute_type AND attribute_type.display_checkout %]
180 <input type="checkbox" id="display_checkout" name="display_checkout" checked="checked" />
182 <input type="checkbox" id="display_checkout" name="display_checkout" />
184 <span class="hint">Check to show this attribute in the brief information panel in the patron's record (staff interface).</span>
187 [% IF Koha.Preference('Pseudonymization') %]
189 <label for="keep_for_pseudonymization">Keep for pseudonymization: </label>
190 [% IF attribute_type AND attribute_type.keep_for_pseudonymization %]
191 <input type="checkbox" id="keep_for_pseudonymization" name="keep_for_pseudonymization" checked="checked" />
193 <input type="checkbox" id="keep_for_pseudonymization" name="keep_for_pseudonymization" />
195 <span class="hint">Check to make this attribute copied to the patron's pseudonymized attributes.</span>
199 <li><label for="authorised_value_category">Authorized value category: </label>
200 <select name="authorised_value_category" id="authorised_value_category">
201 <option value=""></option>
202 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => attribute_type.authorised_value_category ) %]
204 <div class="hint">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.</div>
206 <li><label for="branches">Library limitation: </label>
207 <select id="branches" name="branches" multiple size="10">
208 <option value="">All libraries</option>
209 [% PROCESS options_for_libraries libraries => Branches.all( selected => attribute_type.library_limits ) %]
211 <div class="hint">Select "All libraries" if this attribute type should always be displayed. Otherwise select libraries you want to associate with this value.
215 <label for="category">Category: </label>
216 <select name="category_code" id="category">
217 <option value=""></option>
218 [% FOREACH cat IN categories %]
219 [% IF ( cat.categorycode == attribute_type.category_code ) %]<option value="[% cat.categorycode | html %]" selected="selected">[% cat.description |html %]</option>[% ELSE %]<option value="[% cat.categorycode | html %]">[% cat.description |html %]</option>[% END %]
222 <div class="hint">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.</div>
225 <label for="class">Class: </label>
226 [% PROCESS 'av-build-dropbox.inc' name="class", category="PA_CLASS" default=attribute_type.class empty=1 %]
228 [% IF ( CAN_user_parameters_manage_auth_values ) %]
229 Group attributes types with a block title (based on <a target="_blank" href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=PA_CLASS">authorized values category 'PA_CLASS'</a>)
231 Group attributes types with a block title (based on authorized values category 'PA_CLASS')
237 <fieldset class="action">
238 <input type="submit" class="btn btn-primary" value="Save" />
239 <a class="cancel" href="/cgi-bin/koha/admin/patron-attr-types.pl">Cancel</a>
244 [% IF ( delete_attribute_type_form ) %]
245 <div class="dialog alert">
246 <h1>Confirm deletion of patron attribute type <span class="ex">'[% code | html %]' ([% description | html %])</span>?</h1>
247 <form action="[% script_name | html %]" name="Aform" method="post">
248 <input type="hidden" name="op" value="[% confirm_op | html %]" />
249 <input type="hidden" name="code" value="[% code | html %]" />
250 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete patron attribute type</button>
252 <form action="[% script_name | html %]" method="get">
253 <button type="submit" class="deny"><i class="fa fa-fw fa-times"></i> No, do not delete</button>
258 [% IF ( display_list ) %]
260 <div id="toolbar" class="btn-toolbar">
261 <a class="btn btn-default" id="newrule" href="[% script_name | url %]?op=add_attribute_type"><i class="fa fa-plus"></i> New patron attribute type</a>
264 <h1>Patron attribute types</h1>
265 [% IF ( added_attribute_type ) %]
266 <div class="dialog message">Added patron attribute type "[% added_attribute_type | html %]"</div>
268 [% IF ( edited_attribute_type ) %]
269 <div class="dialog message">Modified patron attribute type "[% edited_attribute_type | html %]"</div>
271 [% IF ( deleted_attribute_type ) %]
272 <div class="dialog message">Deleted patron attribute type "[% deleted_attribute_type | html %]"</div>
274 [% IF ( ERROR_delete_in_use ) %]
275 <div class="dialog message">Could not delete patron attribute type "[% ERROR_delete_in_use | html %]"
276 — it is in use by [% ERROR_num_patrons | html %] patron records</div>
278 [% IF ( ERROR_delete_not_found ) %]
279 <div class="dialog message">Could not delete patron attribute type "[% ERROR_delete_not_found | html %]"
280 — it was already absent from the database.</div>
282 [% IF ( available_attribute_types ) %]
283 [% FOREACH attribute IN available_attribute_types %]
284 <div class="page-section">
285 [% IF attribute.class %]
286 <h2>[% attribute.lib | html %]</h2>
288 <h2>Unclassified types</h2>
290 <table class="patron_attributes_types" id="patron_attr[% attribute.class | html %]">
295 <th>Library limitation</th>
296 <th>Authorized value category</th>
298 <th class="NoSort noExport">Actions</th>
302 [% FOREACH item IN attribute.items %]
304 <td>[% item.code | html %]</td>
305 <td>[% item.description | html %]</td>
307 [% SET libraries = item.library_limits %]
308 [% IF ( libraries && libraries.count > 0 ) %]
309 [% branches_str = "" %]
310 [% FOREACH branch IN libraries %]
311 [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
313 <span title="[% branches_str | html %]">
314 [% IF libraries.count > 1 %]
315 <span>[% libraries.count | html %] library limitations</span>
317 <span>[% libraries.count | html %] library limitation</span>
325 [% IF ( CAN_user_parameters_manage_auth_values ) %]
326 <a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% item.authorised_value_category | uri %]">[% item.authorised_value_category | html %]</a></td>
328 [% item.authorised_value_category | html %]
331 [% IF ( item.mandatory ) -%]
338 <a class="btn btn-default btn-xs" href="[% script_name | url %]?op=edit_attribute_type&code=[% item.code | uri %]"><i class="fa fa-pencil-alt"></i> Edit</a>
339 <a class="btn btn-default btn-xs" href="[% script_name | url %]?op=delete_attribute_type&code=[% item.code | uri %]"><i class="fa fa-trash-can"></i> Delete</a>
345 </div><!-- ./page-section -->
348 <p>There are no saved patron attribute types.</p>
351 <div class="pages">[% pagination_bar | $raw %]</div>
356 </div> <!-- /.col-sm-10.col-sm-push-2 -->
358 <div class="col-sm-2 col-sm-pull-10">
360 [% INCLUDE 'admin-menu.inc' %]
362 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
363 </div> <!-- /.row -->
365 [% MACRO jsinclude BLOCK %]
366 [% Asset.js("js/admin-menu.js") | $raw %]
367 [% INCLUDE 'datatables.inc' %]
368 [% INCLUDE 'columns_settings.inc' %]
370 $(document).ready(function() {
371 if ( $("#branches option:selected").length < 1 ) {
372 $("#branches option:first").attr("selected", "selected");
375 $("#opac_display").change( function() {
376 if ( this.checked ) {
377 $("#opac_editable").removeAttr('disabled').parent().removeAttr('aria-disabled');
379 $("#opac_editable").attr('disabled', true).parent().attr('aria-disabled', 'true');
383 $(".patron_attributes_types").each(function(){
384 var tableid = $(this).attr("id");
385 KohaTable( tableid, {
393 [% INCLUDE 'intranet-bottom.inc' %]