6 [% USE TablesSettings %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Koha › Administration › Patron categories › [% IF op == 'add_form' %][% IF ( categorycode ) %]Modify category '[% categorycode | html %]'[% ELSE %]New category[% END %][% END %]
10 [% IF op == 'delete_confirm' %][% IF ( patrons_in_category > 0 ) %]Cannot delete: category [% categorycode | html %] in use[% ELSE %]Confirm deletion of category '[% categorycode | html %]'[% END %][% END %]
12 [% INCLUDE 'doc-head-close.inc' %]
13 <style>#enrolmentmessage.hint { display : none; }</style>
16 <body id="admin_categorie" class="admin">
17 [% INCLUDE 'header.inc' %]
18 [% INCLUDE 'patrons-admin-search.inc' %]
20 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
23 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
26 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
29 [% IF op == 'add_form' %]
31 <a href="/cgi-bin/koha/admin/categories.pl">Patron categories</a>
33 [% IF ( categorycode ) %]
35 <a href="#" aria-current="page">
36 Modify category '[% categorycode | html %]'
41 <a href="#" aria-current="page">
48 [% IF op == 'delete_confirm' %]
50 <a href="/cgi-bin/koha/admin/categories.pl">Patron categories</a>
52 [% IF ( patrons_in_category > 0 ) %]
54 <a href="#" aria-current="page">
55 Cannot delete: Category [% categorycode | html %] in use
60 <a href="#" aria-current="page">
61 Confirm deletion of category '[% categorycode | html %]'
67 [% IF op == 'delete_confirmed' %]
69 <a href="/cgi-bin/koha/admin/categories.pl">Patron categories</a>
72 <a href="#" aria-current="page">
80 <a href="#" aria-current="page">
88 <div class="main container-fluid">
90 <div class="col-sm-10 col-sm-push-2">
93 [% FOR m IN messages %]
94 <div class="dialog [% m.type | html %]">
96 [% CASE 'error_on_update' %]
97 An error occurred when updating this patron category. Perhaps it already exists.
98 [% CASE 'error_on_insert' %]
99 An error occurred when inserting this patron category. The patron category might already exist.
100 [% CASE 'error_on_delete' %]
101 An error occurred when deleting this patron category. Check the logs.
102 [% CASE 'success_on_update' %]
103 Patron category updated successfully.
104 [% CASE 'success_on_insert' %]
105 Patron category inserted successfully.
106 [% CASE 'success_on_delete' %]
107 Patron category deleted successfully.
108 [% CASE 'already_exists' %]
109 This patron category already exists.
116 [% IF op == 'add_form' %]
117 <form id="category_form" action="/cgi-bin/koha/admin/categories.pl" method="post">
118 <input type="hidden" name="op" value="add_validate" />
119 <input type="hidden" name="checked" value="0" />
121 <h1>Modify category [% categorycode | html %]</h1>
123 <h1>New category</h1>
125 <fieldset class="rows">
129 <span class="label">Category code: </span>[% categorycode | html %]
130 <input type="hidden" name="categorycode" value="[% category.categorycode | html %]" /><input type="hidden" name="is_a_modif" value="1" />
134 <label for="categorycode" class="required">Category code: </label>
135 <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" class="required" required="required" />
136 <span class="required">Required</span>
140 <label for="description" class="required">Description: </label>
141 <input type="text" name="description" id="description" size="40" maxlength="80" class="required" required="required" value="[% category.description | html %]" />
142 <span class="required">Required</span>
145 <span class="label">Enrollment period: </span>
147 <legend>Choose one</legend>
150 <label for="enrolmentperiod" style="width:6em;">In months: </label>
151 [% IF category.enrolmentperiod %]
152 <input type="text" class="enrollmentperiod" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% category.enrolmentperiod | html %]" /> months
154 <input type="text" class="enrollmentperiod" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="" /> months
158 <label for="enrolmentperioddate" style="width:6em;">Until date: </label>
159 <input type="text" class="enrollmentperiod" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" />
165 <label for="dateofbirthrequired">Age required: </label>
166 <input type="text" name="dateofbirthrequired" id="dateofbirthrequired" value="[% category.dateofbirthrequired | html %]" size="3" maxlength="3" /> years
169 <label for="upperagelimit">Upperage limit: </label>
170 <input type="text" name="upperagelimit" id="upperagelimit" size="3" maxlength="3" value="[% category.upperagelimit | html %]" /> years
173 <label for="enrolmentfee">Enrollment fee: </label>
174 <input type="text" name="enrolmentfee" id="enrolmentfee" size="6" value="[% category.enrolmentfee | $Price on_editing => 1 %]" />
177 <label for="overduenoticerequired">Overdue notice required: </label>
178 <select name="overduenoticerequired" id="overduenoticerequired">
179 [% IF category.overduenoticerequired %]
180 <option value="0">No</option>
181 <option value="1" selected="selected">Yes</option>
183 <option value="0" selected="selected">No</option>
184 <option value="1">Yes</option>
189 <label for="hidelostitems">Lost items in staff interface: </label>
190 <select name="hidelostitems" id="hidelostitems">
191 [% IF category.hidelostitems %]
192 <option value="0">Shown</option>
193 <option value="1" selected="selected">Hidden by default</option>
195 <option value="0" selected="selected">Shown</option>
196 <option value="1">Hidden by default</option>
201 <label for="reservefee">Hold fee: </label>
202 <input type="text" name="reservefee" id="reservefee" size="6" value="[% category.reservefee | $Price on_editing => 1 %]" />
205 <label for="category_type" class="required">Category type: </label>
206 <select name="category_type" id="category_type">
207 [% UNLESS category %]<option value="" selected="selected">Select a category type</option>[% ELSE %]<option value="">Select a category type</option>[% END %]
208 [% IF category and category.category_type == 'A' %]<option value="A" selected="selected">Adult</option>[% ELSE %]<option value="A">Adult</option>[% END %]
209 [% IF category and category.category_type == 'C' %]<option value="C" selected="selected">Child</option>[% ELSE %]<option value="C">Child</option>[% END %]
210 [% IF category and category.category_type == 'S' %]<option value="S" selected="selected">Staff</option>[% ELSE %]<option value="S">Staff</option>[% END %]
211 [% IF category and category.category_type == 'I' %]<option value="I" selected="selected">Organization</option>[% ELSE %]<option value="I">Organization</option>[% END %]
212 [% IF category and category.category_type == 'P' %]<option value="P" selected="selected">Professional</option>[% ELSE %]<option value="P">Professional</option>[% END %]
213 [% IF category and category.category_type == 'X' %]<option value="X" selected="selected">Statistical</option>[% ELSE %]<option value="X">Statistical</option>[% END %]
215 <span class="required">Required</span>
217 <li><label for="branches">Library limitations: </label>
218 <select id="branches" name="branches" multiple size="10">
219 <option value="">All libraries</option>
220 [% FOREACH branch IN branches_loop %]
221 [% IF branch.selected %]
222 <option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
224 <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
228 <span>Select <em>All libraries</em> if this category type must to be displayed all the time. Otherwise select libraries you want to associate with this value.
232 <label for="reset_password">Password reset in OPAC: </label>
233 <select name="reset_password" id="reset_password">
234 [% IF category.reset_password.defined %]
235 [% IF category.reset_password %]
236 [% IF Koha.Preference('OpacResetPassword') %]
237 <option value="-1">Follow system preference OpacResetPassword (enabled)</option>
239 <option value="-1">Follow system preference OpacResetPassword (disabled)</option>
241 <option value="1" selected="selected">Allowed</option>
242 <option value="0">Not allowed</option>
244 [% IF Koha.Preference('OpacResetPassword') %]
245 <option value="-1">Follow system preference OpacResetPassword (enabled)</option>
247 <option value="-1">Follow system preference OpacResetPassword (disabled)</option>
249 <option value="1">Allowed</option>
250 <option value="0" selected="selected">Not allowed</option>
253 [% IF Koha.Preference('OpacResetPassword') %]
254 <option value="-1" selected="selected">Follow system preference OpacResetPassword (enabled)</option>
256 <option value="-1" selected="selected">Follow system preference OpacResetPassword (disabled)</option>
258 <option value="1">Allowed</option>
259 <option value="0">Not allowed</option>
264 <label for="change_password">Password change in OPAC: </label>
265 <select name="change_password" id="change_password">
266 [% IF category.change_password.defined %]
267 [% IF category.change_password %]
268 [% IF Koha.Preference('OpacPasswordChange') %]
269 <option value="-1">Follow system preference OpacPasswordChange (enabled)</option>
271 <option value="-1">Follow system preference OpacPasswordChange (disabled)</option>
273 <option value="1" selected="selected">Allowed</option>
274 <option value="0">Not allowed</option>
276 [% IF Koha.Preference('OpacPasswordChange') %]
277 <option value="-1">Follow system preference OpacPasswordChange (enabled)</option>
279 <option value="-1">Follow system preference OpacPasswordChange (disabled)</option>
281 <option value="1">Allowed</option>
282 <option value="0" selected="selected">Not allowed</option>
285 [% IF Koha.Preference('OpacPasswordChange') %]
286 <option value="-1" selected="selected">Follow system preference OpacPasswordChange (enabled)</option>
288 <option value="-1" selected="selected">Follow system preference OpacPasswordChange (disabled)</option>
290 <option value="1">Allowed</option>
291 <option value="0">Not allowed</option>
296 <label for="min_password_length">Minimum password length:</label>
297 <input id="min_password_length" type="text" inputmode="numeric" name="min_password_length" value="[% category.min_password_length | html %]"/>
298 <span>Leave blank to use system default ([% Koha.Preference('minPasswordLength') | html %])</span>
300 <li class="pwd_setting_wrapper">
301 <label for="require_strong_password">Require strong password:</label>
302 <select id="require_strong_password" name="require_strong_password">
303 [% IF category.require_strong_password.defined %]
304 [% IF category.require_strong_password %]
305 [% IF Koha.Preference('RequireStrongPassword') %]
306 <option value="-1">Follow system preference RequireStrongPassword (yes)</option>
308 <option value="-1">Follow system preference RequireStrongPassword (no)</option>
310 <option value="1" selected="selected">Yes</option>
311 <option value="0">No</option>
313 [% IF Koha.Preference('RequireStrongPassword') %]
314 <option value="-1">Follow system preference RequireStrongPassword (yes)</option>
316 <option value="-1">Follow system preference RequireStrongPassword (no)</option>
318 <option value="1">Yes</option>
319 <option value="0" selected="selected">No</option>
322 [% IF Koha.Preference('RequireStrongPassword') %]
323 <option value="-1">Follow system preference RequireStrongPassword (yes)</option>
325 <option value="-1">Follow system preference RequireStrongPassword (no)</option>
327 <option value="1">Yes</option>
328 <option value="0">No</option>
332 <li><label for="block_expired">Block expired patrons:</label>
333 <select name="BlockExpiredPatronOpacActions" id="block_expired">
334 [% IF not category or category.BlockExpiredPatronOpacActions == -1%]
335 <option value="-1" selected="selected"> Follow system preference BlockExpiredPatronOpacActions </option>
337 <option value="-1"> Follow system preference BlockExpiredPatronOpacActions </option>
340 [% IF category and category.BlockExpiredPatronOpacActions == 1 %]
341 <option value="1" selected="selected"> Block </option>
343 <option value="1"> Block </option>
346 [% IF category and category.BlockExpiredPatronOpacActions == 0 %]
347 <option value="0" selected="selected"> Don't block </option>
349 <option value="0"> Don't block </option>
353 Choose whether patrons of this category be blocked from public catalog actions such as renewing and placing holds when their cards have expired.
356 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
357 <li><label for="checkprevcheckout">Check for previous checkouts: </label>
358 <select name="checkprevcheckout" id="checkprevcheckout">
359 [% IF category.checkprevcheckout == 'yes' %]
360 <option value="yes" selected="selected">Yes and try to override system preferences</option>
361 <option value="no">No and try to override system preferences</option>
362 <option value="inherit">Inherit from system preferences</option>
363 [% ELSIF category.checkprevcheckout == 'no' %]
364 <option value="yes">Yes and try to override system preferences</option>
365 <option value="no" selected="selected">No and try to override system preferences</option>
366 <option value="inherit">Inherit from system preferences</option>
368 <option value="yes">Yes and try to override system preferences</option>
369 <option value="no">No and try to override system preferences</option>
370 <option value="inherit" selected="selected">Inherit from system preferences</option>
374 Choose whether patrons of this category by default are reminded if they try to borrow an item they borrowed before.
379 <label for="default_privacy">Default privacy: </label>
380 <select id="default_privacy" name="default_privacy">
381 [% SET default_privacy = 'default' %]
382 [% IF category %][% SET default_privacy = category.default_privacy %][% END %]
383 [% SWITCH default_privacy %]
385 <option value="default">Default</option>
386 <option value="never">Never</option>
387 <option value="forever" selected="selected">Forever</option>
389 <option value="default">Default</option>
390 <option value="never" selected="selected">Never</option>
391 <option value="forever">Forever</option>
393 <option value="default" selected="selected">Default</option>
394 <option value="never">Never</option>
395 <option value="forever">Forever</option>
398 <span>Controls how long a patrons checkout history is kept for new patrons of this category. "Never" anonymizes checkouts on return, and "Forever" keeps a patron's checkout history indefinitely. When set to "Default", the amount of history kept is controlled by the cronjob <em>batch_anonymise.pl</em> which should be set up by your system administrator.</span>
401 <label for="exclude_from_local_holds_priority">Exclude from local holds priority:</label>
402 <select id="exclude_from_local_holds_priority" name="exclude_from_local_holds_priority">
403 [% IF category.exclude_from_local_holds_priority %]
404 <option value="1" selected>Yes</option>
405 <option value="0">No</option>
407 <option value="1">Yes</option>
408 <option value="0" selected>No</option>
411 <span>If <i>Yes</i>, holds placed by patrons of this category will not be given priority</span>
416 [% IF ( EnhancedMessagingPreferences ) %]
417 <fieldset class="rows">
418 <h4>Default messaging preferences for this patron category</h4>
419 [% INCLUDE 'messaging-preference-form.inc' %]
422 <fieldset class="action">
423 <input type="submit" value="Save" />
424 <a href="/cgi-bin/koha/admin/categories.pl" class="cancel">Cancel</a>
429 [% IF op == 'delete_confirm' %]
430 <form action="/cgi-bin/koha/admin/categories.pl" method="post">
433 [% IF patrons_in_category > 0 %]
434 Category [% categorycode | html %] is in use. Deletion not possible!
436 Confirm deletion of category [% categorycode | html %]
440 [% IF patrons_in_category > 0 %]
441 <div class="dialog alert">
442 <strong>This category is used [% patrons_in_category | html %] times</strong>. Deletion not possible
446 <tr><th scope="row">Category code: </th><td>[% category.categorycode | html %]</td></tr>
447 <tr><th scope="row">Description: </th><td>[% category.description | html %]</td></tr>
448 <tr><th scope="row">Enrollment period: </th>
450 [% IF category.enrolmentperiod %]
451 [% category.enrolmentperiod | html %] months
453 until [% category.enrolmentperioddate | $KohaDates %]
457 <tr><th scope="row">Age required: </th><td>[% category.dateofbirthrequired | html %] years</td></tr>
458 <tr><th scope="row">Upperage limit: </th><td>[% category.upperagelimit | html %] years</td></tr>
459 <tr><th scope="row">Enrollment fee: </th><td>[% category.enrolmentfee | $Price %]</td></tr>
460 <tr><th scope="row">Receives overdue notices: </th><td>[% IF category. overduenoticerequired %]Yes[% ELSE %]No[% END %]</td></tr>
461 <tr><th scope="row">Lost items in staff interface</th><td>[% IF category.hidelostitems %]Hidden by default[% ELSE %]Shown[% END %]</td></tr>
462 <tr><th scope="row">Hold fee: </th><td>[% category.reservefee | $Price %]</td></tr>
464 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
466 <th scope="row">Check previous checkouts: </th>
468 [% SWITCH category.checkprevcheckout %]
480 <th scope="row">Default privacy: </th>
482 [% SWITCH category.default_privacy %]
493 <fieldset class="action">
494 [% IF patrons_in_category > 0 %]
495 <input type="submit" value="OK" />
497 <input type="hidden" name="op" value="delete_confirmed" />
498 <input type="hidden" name="categorycode" value="[% categorycode | html %]" />
499 <input type="submit" value="Delete this category" />
500 <a class="cancel" href="/cgi-bin/koha/admin/categories.pl">Cancel</a>
507 [% IF op == 'list' %]
509 <div id="toolbar" class="btn-toolbar">
510 <a class="btn btn-default" id="newcategory" href="/cgi-bin/koha/admin/categories.pl?op=add_form"><i class="fa fa-plus"></i> New category</a>
513 <h2>Patron categories</h2>
515 You Searched for [% searchfield | html %]</span>
518 <table id="patron_categories">
521 <th scope="col">Code</th>
522 <th scope="col">Category name</th>
523 <th scope="col">Type</th>
524 <th scope="col">Enrollment period</th>
525 <th scope="col">Age required</th>
526 <th scope="col">Upper age limit</th>
527 <th scope="col">Enrollment fee</th>
528 <th scope="col">Overdue</th>
529 <th scope="col">Lost items</th>
530 <th scope="col">Hold fee</th>
531 [% IF ( EnhancedMessagingPreferences ) %]
532 <th scope="col">Messaging</th>
534 <th scope="col">Library limitations</th>
535 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
536 <th scope="col">Check previous checkout?</th>
538 <th scope="col">Default privacy</th>
539 <th scope="col">Exclude from local holds priority</th>
540 <th scope="col">Actions</th>
544 [% FOREACH category IN categories %]
546 <td>[% category.categorycode | html %]</td>
548 <a href="/cgi-bin/koha/admin/categories.pl?op=add_form&categorycode=[% category.categorycode |uri %]">[% category.description | html %]</a>
551 [% SWITCH category.category_type %]
557 [% CASE 'X' %]Statistical
561 [% IF ( category.enrolmentperiod ) %]
562 [% category.enrolmentperiod | html %] months
564 until [% category.enrolmentperioddate | $KohaDates %]
567 [% IF (category.dateofbirthrequired) %]
568 <td>[% category.dateofbirthrequired | html %] years</td>
572 [% IF (category.upperagelimit) %]
573 <td>[% category.upperagelimit | html %] years</td>
577 [% IF (category.enrolmentfee > 0) %]
578 <td>[% category.enrolmentfee | $Price %]</td>
582 <td>[% IF ( category.overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td>
583 <td>[% IF ( category.hidelostitems ) %]Hidden[% ELSE %]Shown[% END %]</td>
584 [% IF (category.reservefee > 0) %]
585 <td>[% category.reservefee | $Price %]</td>
589 [% IF Koha.Preference('EnhancedMessagingPreferences') %]
590 <td style="white-space: nowrap; font-size:80%;">
591 [% SET default_messaging = category.default_messaging %]
592 [% IF default_messaging.size %]
593 [% FOREACH prefs IN default_messaging %]
594 [% NEXT IF !Koha.Preference( 'ILLModule' ) && prefs.message_name.match('^Ill_') %]
595 [% FOREACH transport IN prefs.transports %]
596 [% IF ( transport.transport ) %]
597 [% IF ( prefs.Item_Due ) %]Item due
598 [% ELSIF ( prefs.Advance_Notice ) %]Advance notice
599 [% ELSIF ( prefs.Hold_Filled ) %]Hold filled
600 [% ELSIF ( prefs.Item_Check_in ) %]Item check-in
601 [% ELSIF ( prefs.Item_Checkout ) %]Item checkout
602 [% ELSIF ( prefs.Ill_ready ) %]Interlibrary loan ready
603 [% ELSIF ( prefs.Ill_unavailable ) %]Interlibrary loan unavailable
606 <strong>[% transport.transport | html %]</strong><br />
607 [% ELSE %]None<br />[% END %]
616 [% SET branch_limitations = category.branch_limitations %]
617 [% IF branch_limitations.size > 0 %]
618 [% branches_str = "" %]
619 [% FOREACH branch IN branch_limitations %]
620 [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
622 <span title="[% branches_str | html %]">
623 [% IF branch_limitations.size > 1 %]
624 [% branch_limitations.size | html %] library limitations
626 [% branch_limitations.size | html %] library limitation
633 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
635 [% SWITCH category.checkprevcheckout %]
646 [% SWITCH category.default_privacy %]
656 [% IF category.exclude_from_local_holds_priority %]
663 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/categories.pl?op=add_form&categorycode=[% category.categorycode |uri %]"><i class="fa fa-pencil"></i> Edit</a>
664 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/categories.pl?op=delete_confirm&categorycode=[% category.categorycode |uri %]"><i class="fa fa-trash"></i> Delete</a>
671 <div class="dialog alert">No categories have been defined. <a href="/cgi-bin/koha/admin/categories.pl?op=add_form">Create a new category</a>.</div>
676 </div> <!-- /.col-sm-10.col-sm-push-2 -->
678 <div class="col-sm-2 col-sm-pull-10">
680 [% INCLUDE 'admin-menu.inc' %]
682 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
683 </div> <!-- /.row -->
685 [% MACRO jsinclude BLOCK %]
686 [% Asset.js("js/admin-menu.js") | $raw %]
687 [% Asset.js("js/messaging-preference-form.js") | $raw %]
688 [% INCLUDE 'calendar.inc' %]
689 [% INCLUDE 'datatables.inc' %]
690 [% INCLUDE 'columns_settings.inc' %]
692 var columns_settings = [% TablesSettings.GetColumns( 'admin', 'categories', 'patron_categories', 'json' ) | $raw %];
694 [% Asset.js("js/categories.js") | $raw %]
696 [% INCLUDE 'intranet-bottom.inc' %]