7 [% USE TablesSettings %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>[% IF op == 'add_form' %][% IF ( categorycode ) %]Modify category '[% categorycode | html %]'[% ELSE %]New category[% END %][% END %]
11 [% 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 %] › Patron categories › Administration › Koha
13 [% INCLUDE 'doc-head-close.inc' %]
14 <style>#enrolmentmessage.hint { display : none; }</style>
17 <body id="admin_categorie" class="admin">
18 [% INCLUDE 'header.inc' %]
19 [% INCLUDE 'patrons-admin-search.inc' %]
21 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
24 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
27 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
30 [% IF op == 'add_form' %]
32 <a href="/cgi-bin/koha/admin/categories.pl">Patron categories</a>
34 [% IF ( categorycode ) %]
36 <a href="#" aria-current="page">
37 Modify category '[% categorycode | html %]'
42 <a href="#" aria-current="page">
49 [% IF op == 'delete_confirm' %]
51 <a href="/cgi-bin/koha/admin/categories.pl">Patron categories</a>
53 [% IF ( patrons_in_category > 0 ) %]
55 <a href="#" aria-current="page">
56 Cannot delete: Category [% categorycode | html %] in use
61 <a href="#" aria-current="page">
62 Confirm deletion of category '[% categorycode | html %]'
68 [% IF op == 'delete_confirmed' %]
70 <a href="/cgi-bin/koha/admin/categories.pl">Patron categories</a>
73 <a href="#" aria-current="page">
81 <a href="#" aria-current="page">
89 <div class="main container-fluid">
91 <div class="col-sm-10 col-sm-push-2">
94 [% FOR m IN messages %]
95 <div class="dialog [% m.type | html %]">
97 [% CASE 'error_on_update' %]
98 <span>An error occurred when updating this patron category. Perhaps it already exists.</span>
99 [% CASE 'error_on_insert' %]
100 <span>An error occurred when inserting this patron category. The patron category might already exist.</span>
101 [% CASE 'error_on_delete' %]
102 <span>An error occurred when deleting this patron category. Check the logs.</span>
103 [% CASE 'success_on_update' %]
104 <span>Patron category updated successfully.</span>
105 [% CASE 'success_on_insert' %]
106 <span>Patron category inserted successfully.</span>
107 [% CASE 'success_on_delete' %]
108 <span>Patron category deleted successfully.</span>
109 [% CASE 'already_exists' %]
110 <span>This patron category already exists.</span>
112 <span>[% m.code | html %]</span>
117 [% IF op == 'add_form' %]
118 <form id="category_form" action="/cgi-bin/koha/admin/categories.pl" method="post">
119 <input type="hidden" name="op" value="add_validate" />
120 <input type="hidden" name="checked" value="0" />
122 <h1>Modify category [% categorycode | html %]</h1>
124 <h1>New category</h1>
126 <fieldset class="rows">
130 <span class="label">Category code: </span>[% categorycode | html %]
131 <input type="hidden" name="categorycode" value="[% category.categorycode | html %]" /><input type="hidden" name="is_a_modif" value="1" />
135 <label for="categorycode" class="required">Category code: </label>
136 <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" class="required" required="required" />
137 <span class="required">Required</span>
141 <label for="description" class="required">Description: </label>
142 <input type="text" name="description" id="description" size="40" maxlength="80" class="required" required="required" value="[% category.description | html %]" />
143 <span class="required">Required</span>
146 <span class="label">Enrollment period: </span>
148 <legend>Choose one</legend>
151 <label for="enrolmentperiod">In months: </label>
152 [% IF category.enrolmentperiod %]
153 <input type="text" class="enrollmentperiod" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% category.enrolmentperiod | html %]" /> months
155 <input type="text" class="enrollmentperiod" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="" /> months
159 <label for="enrolmentperioddate">Until date: </label>
160 <input type="text" class="enrollmentperiod flatpickr" data-flatpickr-futuredate="true" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" />
166 <label for="password_expiry_days">Password expiration: </label>
167 <input type="text" name="password_expiry_days" id="password_expiry_days" value="[% category.password_expiry_days | html %]" size="3" maxlength="5" /> days
170 <label for="dateofbirthrequired">Age required: </label>
171 <input type="text" name="dateofbirthrequired" id="dateofbirthrequired" value="[% category.dateofbirthrequired | html %]" size="3" maxlength="3" /> years
174 <label for="upperagelimit">Upperage limit: </label>
175 <input type="text" name="upperagelimit" id="upperagelimit" size="3" maxlength="3" value="[% category.upperagelimit | html %]" /> years
178 <label for="enrolmentfee">Enrollment fee: </label>
179 <input type="text" name="enrolmentfee" id="enrolmentfee" size="6" value="[% category.enrolmentfee | $Price on_editing => 1 %]" />
182 <label for="overduenoticerequired">Overdue notice required: </label>
183 <select name="overduenoticerequired" id="overduenoticerequired">
184 [% IF category.overduenoticerequired %]
185 <option value="0">No</option>
186 <option value="1" selected="selected">Yes</option>
188 <option value="0" selected="selected">No</option>
189 <option value="1">Yes</option>
194 <label for="hidelostitems">Lost items in staff interface: </label>
195 <select name="hidelostitems" id="hidelostitems">
196 [% IF category.hidelostitems %]
197 <option value="0">Shown</option>
198 <option value="1" selected="selected">Hidden by default</option>
200 <option value="0" selected="selected">Shown</option>
201 <option value="1">Hidden by default</option>
206 <label for="reservefee">Hold fee: </label>
207 <input type="text" name="reservefee" id="reservefee" size="6" value="[% category.reservefee | $Price on_editing => 1 %]" />
210 <label for="category_type" class="required">Category type: </label>
211 <select name="category_type" id="category_type">
212 [% UNLESS category %]<option value="" selected="selected">Select a category type</option>[% ELSE %]<option value="">Select a category type</option>[% END %]
213 [% IF category and category.category_type == 'A' %]<option value="A" selected="selected">Adult</option>[% ELSE %]<option value="A">Adult</option>[% END %]
214 [% IF category and category.category_type == 'C' %]<option value="C" selected="selected">Child</option>[% ELSE %]<option value="C">Child</option>[% END %]
215 [% IF category and category.category_type == 'S' %]<option value="S" selected="selected">Staff</option>[% ELSE %]<option value="S">Staff</option>[% END %]
216 [% IF category and category.category_type == 'I' %]<option value="I" selected="selected">Organization</option>[% ELSE %]<option value="I">Organization</option>[% END %]
217 [% IF category and category.category_type == 'P' %]<option value="P" selected="selected">Professional</option>[% ELSE %]<option value="P">Professional</option>[% END %]
218 [% IF category and category.category_type == 'X' %]<option value="X" selected="selected">Statistical</option>[% ELSE %]<option value="X">Statistical</option>[% END %]
220 <span class="required">Required</span>
222 <li><label for="branches">Library limitations: </label>
223 <select id="branches" name="branches" multiple size="10">
224 <option value="">All libraries</option>
225 [% PROCESS options_for_libraries libraries => Branches.all( selected => category.get_library_limits, unfiltered => 1, do_not_select_my_library => 1 ) %]
227 <div class="hint">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.
231 <label for="reset_password">Password reset in OPAC: </label>
232 <select name="reset_password" id="reset_password">
233 [% IF category.reset_password.defined %]
234 [% IF category.reset_password %]
235 [% IF Koha.Preference('OpacResetPassword') %]
236 <option value="-1">Follow system preference OpacResetPassword (enabled)</option>
238 <option value="-1">Follow system preference OpacResetPassword (disabled)</option>
240 <option value="1" selected="selected">Allowed</option>
241 <option value="0">Not allowed</option>
243 [% IF Koha.Preference('OpacResetPassword') %]
244 <option value="-1">Follow system preference OpacResetPassword (enabled)</option>
246 <option value="-1">Follow system preference OpacResetPassword (disabled)</option>
248 <option value="1">Allowed</option>
249 <option value="0" selected="selected">Not allowed</option>
252 [% IF Koha.Preference('OpacResetPassword') %]
253 <option value="-1" selected="selected">Follow system preference OpacResetPassword (enabled)</option>
255 <option value="-1" selected="selected">Follow system preference OpacResetPassword (disabled)</option>
257 <option value="1">Allowed</option>
258 <option value="0">Not allowed</option>
263 <label for="change_password">Password change in OPAC: </label>
264 <select name="change_password" id="change_password">
265 [% IF category.change_password.defined %]
266 [% IF category.change_password %]
267 [% IF Koha.Preference('OpacPasswordChange') %]
268 <option value="-1">Follow system preference OpacPasswordChange (enabled)</option>
270 <option value="-1">Follow system preference OpacPasswordChange (disabled)</option>
272 <option value="1" selected="selected">Allowed</option>
273 <option value="0">Not allowed</option>
275 [% IF Koha.Preference('OpacPasswordChange') %]
276 <option value="-1">Follow system preference OpacPasswordChange (enabled)</option>
278 <option value="-1">Follow system preference OpacPasswordChange (disabled)</option>
280 <option value="1">Allowed</option>
281 <option value="0" selected="selected">Not allowed</option>
284 [% IF Koha.Preference('OpacPasswordChange') %]
285 <option value="-1" selected="selected">Follow system preference OpacPasswordChange (enabled)</option>
287 <option value="-1" selected="selected">Follow system preference OpacPasswordChange (disabled)</option>
289 <option value="1">Allowed</option>
290 <option value="0">Not allowed</option>
295 <label for="min_password_length">Minimum password length:</label>
296 <input id="min_password_length" type="text" inputmode="numeric" name="min_password_length" value="[% category.min_password_length | html %]"/>
297 <div class="hint">Leave blank to use system default ([% Koha.Preference('minPasswordLength') | html %])</div>
299 <li class="pwd_setting_wrapper">
300 <label for="require_strong_password">Require strong password:</label>
301 <select id="require_strong_password" name="require_strong_password">
302 [% IF category.require_strong_password.defined %]
303 [% IF category.require_strong_password %]
304 [% IF Koha.Preference('RequireStrongPassword') %]
305 <option value="-1">Follow system preference RequireStrongPassword (yes)</option>
307 <option value="-1">Follow system preference RequireStrongPassword (no)</option>
309 <option value="1" selected="selected">Yes</option>
310 <option value="0">No</option>
312 [% IF Koha.Preference('RequireStrongPassword') %]
313 <option value="-1">Follow system preference RequireStrongPassword (yes)</option>
315 <option value="-1">Follow system preference RequireStrongPassword (no)</option>
317 <option value="1">Yes</option>
318 <option value="0" selected="selected">No</option>
321 [% IF Koha.Preference('RequireStrongPassword') %]
322 <option value="-1">Follow system preference RequireStrongPassword (yes)</option>
324 <option value="-1">Follow system preference RequireStrongPassword (no)</option>
326 <option value="1">Yes</option>
327 <option value="0">No</option>
331 <li><label for="block_expired">Block expired patrons:</label>
332 <select name="BlockExpiredPatronOpacActions" id="block_expired">
333 [% IF not category or category.BlockExpiredPatronOpacActions == -1%]
334 <option value="-1" selected="selected"> Follow system preference BlockExpiredPatronOpacActions </option>
336 <option value="-1"> Follow system preference BlockExpiredPatronOpacActions </option>
339 [% IF category and category.BlockExpiredPatronOpacActions == 1 %]
340 <option value="1" selected="selected"> Block </option>
342 <option value="1"> Block </option>
345 [% IF category and category.BlockExpiredPatronOpacActions == 0 %]
346 <option value="0" selected="selected"> Don't block </option>
348 <option value="0"> Don't block </option>
352 Choose whether patrons of this category be blocked from public catalog actions such as renewing and placing holds when their cards have expired.
355 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
356 <li><label for="checkprevcheckout">Check for previous checkouts: </label>
357 <select name="checkprevcheckout" id="checkprevcheckout">
358 [% IF category.checkprevcheckout == 'yes' %]
359 <option value="yes" selected="selected">Yes and try to override system preferences</option>
360 <option value="no">No and try to override system preferences</option>
361 <option value="inherit">Inherit from system preferences</option>
362 [% ELSIF category.checkprevcheckout == 'no' %]
363 <option value="yes">Yes and try to override system preferences</option>
364 <option value="no" selected="selected">No and try to override system preferences</option>
365 <option value="inherit">Inherit from system preferences</option>
367 <option value="yes">Yes and try to override system preferences</option>
368 <option value="no">No and try to override system preferences</option>
369 <option value="inherit" selected="selected">Inherit from system preferences</option>
373 Choose whether patrons of this category by default are reminded if they try to borrow an item they borrowed before.
378 <label for="default_privacy">Default privacy: </label>
379 <select id="default_privacy" name="default_privacy">
380 [% SET default_privacy = 'default' %]
381 [% IF category %][% SET default_privacy = category.default_privacy %][% END %]
382 [% SWITCH default_privacy %]
384 <option value="default">Default</option>
385 <option value="never">Never</option>
386 <option value="forever" selected="selected">Forever</option>
388 <option value="default">Default</option>
389 <option value="never" selected="selected">Never</option>
390 <option value="forever">Forever</option>
392 <option value="default" selected="selected">Default</option>
393 <option value="never">Never</option>
394 <option value="forever">Forever</option>
397 <div class="hint">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.</div>
400 <label for="exclude_from_local_holds_priority">Exclude from local holds priority:</label>
401 <select id="exclude_from_local_holds_priority" name="exclude_from_local_holds_priority">
402 [% IF category.exclude_from_local_holds_priority %]
403 <option value="1" selected>Yes</option>
404 <option value="0">No</option>
406 <option value="1">Yes</option>
407 <option value="0" selected>No</option>
410 <div class="hint">If <i>Yes</i>, holds placed by patrons of this category will not be given priority</div>
415 [% IF ( EnhancedMessagingPreferences ) %]
416 <fieldset class="rows">
417 <legend>Default messaging preferences for this patron category</legend>
418 [% INCLUDE 'messaging-preference-form.inc' %]
421 <fieldset class="action">
422 <input type="submit" value="Save" />
423 <a href="/cgi-bin/koha/admin/categories.pl" class="cancel">Cancel</a>
428 [% IF op == 'delete_confirm' %]
429 <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 %]
441 [% IF patrons_in_category > 0 %]
442 <div class="dialog alert">
443 <strong>This category is used [% patrons_in_category | html %] times</strong>. Deletion not possible
447 <tr><th scope="row">Category code: </th><td>[% category.categorycode | html %]</td></tr>
448 <tr><th scope="row">Description: </th><td>[% category.description | html %]</td></tr>
449 <tr><th scope="row">Enrollment period: </th>
451 [% IF category.enrolmentperiod %]
452 [% category.enrolmentperiod | html %] months
454 until [% category.enrolmentperioddate | $KohaDates %]
458 <tr><th scope="row">Password expiration: </th><td>[% category.password_expiry_days | html %] days</td></tr>
459 <tr><th scope="row">Age required: </th><td>[% category.dateofbirthrequired | html %] years</td></tr>
460 <tr><th scope="row">Upperage limit: </th><td>[% category.upperagelimit | html %] years</td></tr>
461 <tr><th scope="row">Enrollment fee: </th><td>[% category.enrolmentfee | $Price %]</td></tr>
462 <tr><th scope="row">Receives overdue notices: </th><td>[% IF category. overduenoticerequired %]Yes[% ELSE %]No[% END %]</td></tr>
463 <tr><th scope="row">Lost items in staff interface</th><td>[% IF category.hidelostitems %]Hidden by default[% ELSE %]Shown[% END %]</td></tr>
464 <tr><th scope="row">Hold fee: </th><td>[% category.reservefee | $Price %]</td></tr>
466 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
468 <th scope="row">Check previous checkouts: </th>
470 [% SWITCH category.checkprevcheckout %]
482 <th scope="row">Default privacy: </th>
484 [% SWITCH category.default_privacy %]
495 <fieldset class="action">
496 [% IF patrons_in_category > 0 %]
497 <input type="submit" value="OK" />
499 <input type="hidden" name="op" value="delete_confirmed" />
500 <input type="hidden" name="categorycode" value="[% categorycode | html %]" />
501 <input type="submit" value="Delete this category" />
502 <a class="cancel" href="/cgi-bin/koha/admin/categories.pl">Cancel</a>
509 [% IF op == 'list' %]
511 <div id="toolbar" class="btn-toolbar">
512 <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>
515 <h1>Patron categories</h1>
517 You searched for [% searchfield | html %]</span>
520 <table id="patron_categories">
523 <th scope="col">Code</th>
524 <th scope="col">Category name</th>
525 <th scope="col">Type</th>
526 <th scope="col">Enrollment period</th>
527 <th scope="col">Password expiration</th>
528 <th scope="col">Age required</th>
529 <th scope="col">Upper age limit</th>
530 <th scope="col">Enrollment fee</th>
531 <th scope="col">Overdue</th>
532 <th scope="col">Lost items</th>
533 <th scope="col">Hold fee</th>
534 [% IF ( EnhancedMessagingPreferences ) %]
535 <th scope="col">Messaging</th>
537 <th scope="col">Library limitations</th>
538 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
539 <th scope="col">Check previous checkout?</th>
541 <th scope="col">Default privacy</th>
542 <th scope="col">Exclude from local holds priority</th>
543 <th scope="col">Actions</th>
547 [% FOREACH category IN categories %]
549 <td>[% category.categorycode | html %]</td>
551 <a href="/cgi-bin/koha/admin/categories.pl?op=add_form&categorycode=[% category.categorycode |uri %]">[% category.description | html %]</a>
554 [% SWITCH category.category_type %]
555 [% CASE 'A' %]<span>Adult</span>
556 [% CASE 'C' %]<span>Child</span>
557 [% CASE 'P' %]<span>Prof.</span>
558 [% CASE 'I' %]<span>Org.</span>
559 [% CASE 'S' %]<span>Staff</span>
560 [% CASE 'X' %]<span>Statistical</span>
564 [% IF ( category.enrolmentperiod ) %]
565 [% category.enrolmentperiod | html %] months
567 until [% category.enrolmentperioddate | $KohaDates %]
570 [% IF (category.password_expiry_days) %]
571 <td>[% category.password_expiry_days | html %] days</td>
575 [% IF (category.dateofbirthrequired) %]
576 <td>[% category.dateofbirthrequired | html %] years</td>
580 [% IF (category.upperagelimit) %]
581 <td>[% category.upperagelimit | html %] years</td>
585 [% IF (category.enrolmentfee > 0) %]
586 <td>[% category.enrolmentfee | $Price %]</td>
590 <td>[% IF ( category.overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td>
591 <td>[% IF ( category.hidelostitems ) %]Hidden[% ELSE %]Shown[% END %]</td>
592 [% IF (category.reservefee > 0) %]
593 <td>[% category.reservefee | $Price %]</td>
597 [% IF Koha.Preference('EnhancedMessagingPreferences') %]
598 <td style="white-space: nowrap; font-size:80%;">
599 [% SET default_messaging = category.default_messaging %]
600 [% IF default_messaging.size %]
601 [% FOREACH prefs IN default_messaging %]
602 [% NEXT IF !Koha.Preference( 'ILLModule' ) && prefs.message_name.match('^Ill_') %]
603 [% FOREACH transport IN prefs.transports %]
604 [% IF ( transport.transport ) %]
605 [% IF ( prefs.Item_Due ) %]<span>Item due</span>
606 [% ELSIF ( prefs.Advance_Notice ) %]<span>Advance notice</span>
607 [% ELSIF ( prefs.Hold_Filled ) %]<span>Hold filled</span>
608 [% ELSIF ( prefs.Item_Check_in ) %]<span>Item check-in</span>
609 [% ELSIF ( prefs.Item_Checkout ) %]<span>Item checkout</span>
610 [% ELSIF ( prefs.Ill_ready ) %]<span>Interlibrary loan ready</span>
611 [% ELSIF ( prefs.Ill_unavailable ) %]<span>Interlibrary loan unavailable</span>
612 [% ELSIF ( prefs.Auto_Renewals ) %]<span>Auto renewal</span>
613 [% ELSIF ( prefs.Hold_Reminder ) %]<span>Hold reminder</span>
614 [% ELSE %]<span>Unknown</span>
616 <strong>[% transport.transport | html %]</strong><br />
617 [% ELSE %]<span>None</span><br />[% END %]
626 [% SET library_limits = category.library_limits %]
627 [% IF library_limits.count > 0 %]
628 [% library_str = "" %]
629 [% FOREACH library IN library_limits %]
630 [%- IF loop.first -%]
631 [% library_str = library.branchname _ " (" _ library.branchcode _ ")" %]
633 [% library_str = library_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %]
636 <span class="library_limitation" title="[% library_str | html %]">
637 [% IF library_limits.count > 1 %]
638 [% library_limits.count | html %] library limitations
640 [% library_limits.count | html %] library limitation
646 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
648 [% SWITCH category.checkprevcheckout %]
659 [% SWITCH category.default_privacy %]
669 [% IF category.exclude_from_local_holds_priority %]
676 <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>
677 <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>
684 <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>
689 </div> <!-- /.col-sm-10.col-sm-push-2 -->
691 <div class="col-sm-2 col-sm-pull-10">
693 [% INCLUDE 'admin-menu.inc' %]
695 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
696 </div> <!-- /.row -->
698 [% MACRO jsinclude BLOCK %]
699 [% Asset.js("js/admin-menu.js") | $raw %]
700 [% Asset.js("js/messaging-preference-form.js") | $raw %]
701 [% INCLUDE 'calendar.inc' %]
702 [% INCLUDE 'datatables.inc' %]
703 [% INCLUDE 'columns_settings.inc' %]
705 var table_settings = [% TablesSettings.GetTableSettings( 'admin', 'categories', 'patron_categories', 'json' ) | $raw %];
707 [% Asset.js("js/categories.js") | $raw %]
709 [% INCLUDE 'intranet-bottom.inc' %]