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 An error occurred when updating this patron category. Perhaps it already exists.
99 [% CASE 'error_on_insert' %]
100 An error occurred when inserting this patron category. The patron category might already exist.
101 [% CASE 'error_on_delete' %]
102 An error occurred when deleting this patron category. Check the logs.
103 [% CASE 'success_on_update' %]
104 Patron category updated successfully.
105 [% CASE 'success_on_insert' %]
106 Patron category inserted successfully.
107 [% CASE 'success_on_delete' %]
108 Patron category deleted successfully.
109 [% CASE 'already_exists' %]
110 This patron category already exists.
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" style="width:6em;">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" style="width:6em;">Until date: </label>
160 <input type="text" class="enrollmentperiod" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" />
166 <label for="dateofbirthrequired">Age required: </label>
167 <input type="text" name="dateofbirthrequired" id="dateofbirthrequired" value="[% category.dateofbirthrequired | html %]" size="3" maxlength="3" /> years
170 <label for="upperagelimit">Upperage limit: </label>
171 <input type="text" name="upperagelimit" id="upperagelimit" size="3" maxlength="3" value="[% category.upperagelimit | html %]" /> years
174 <label for="enrolmentfee">Enrollment fee: </label>
175 <input type="text" name="enrolmentfee" id="enrolmentfee" size="6" value="[% category.enrolmentfee | $Price on_editing => 1 %]" />
178 <label for="overduenoticerequired">Overdue notice required: </label>
179 <select name="overduenoticerequired" id="overduenoticerequired">
180 [% IF category.overduenoticerequired %]
181 <option value="0">No</option>
182 <option value="1" selected="selected">Yes</option>
184 <option value="0" selected="selected">No</option>
185 <option value="1">Yes</option>
190 <label for="hidelostitems">Lost items in staff interface: </label>
191 <select name="hidelostitems" id="hidelostitems">
192 [% IF category.hidelostitems %]
193 <option value="0">Shown</option>
194 <option value="1" selected="selected">Hidden by default</option>
196 <option value="0" selected="selected">Shown</option>
197 <option value="1">Hidden by default</option>
202 <label for="reservefee">Hold fee: </label>
203 <input type="text" name="reservefee" id="reservefee" size="6" value="[% category.reservefee | $Price on_editing => 1 %]" />
206 <label for="category_type" class="required">Category type: </label>
207 <select name="category_type" id="category_type">
208 [% UNLESS category %]<option value="" selected="selected">Select a category type</option>[% ELSE %]<option value="">Select a category type</option>[% END %]
209 [% IF category and category.category_type == 'A' %]<option value="A" selected="selected">Adult</option>[% ELSE %]<option value="A">Adult</option>[% END %]
210 [% IF category and category.category_type == 'C' %]<option value="C" selected="selected">Child</option>[% ELSE %]<option value="C">Child</option>[% END %]
211 [% IF category and category.category_type == 'S' %]<option value="S" selected="selected">Staff</option>[% ELSE %]<option value="S">Staff</option>[% END %]
212 [% IF category and category.category_type == 'I' %]<option value="I" selected="selected">Organization</option>[% ELSE %]<option value="I">Organization</option>[% END %]
213 [% IF category and category.category_type == 'P' %]<option value="P" selected="selected">Professional</option>[% ELSE %]<option value="P">Professional</option>[% END %]
214 [% IF category and category.category_type == 'X' %]<option value="X" selected="selected">Statistical</option>[% ELSE %]<option value="X">Statistical</option>[% END %]
216 <span class="required">Required</span>
218 <li><label for="branches">Library limitations: </label>
219 <select id="branches" name="branches" multiple size="10">
220 <option value="">All libraries</option>
221 [% PROCESS options_for_libraries libraries => Branches.all( selected => category.get_library_limits, unfiltered => 1, do_not_select_my_library => 1 ) %]
223 <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.
227 <label for="reset_password">Password reset in OPAC: </label>
228 <select name="reset_password" id="reset_password">
229 [% IF category.reset_password.defined %]
230 [% IF category.reset_password %]
231 [% IF Koha.Preference('OpacResetPassword') %]
232 <option value="-1">Follow system preference OpacResetPassword (enabled)</option>
234 <option value="-1">Follow system preference OpacResetPassword (disabled)</option>
236 <option value="1" selected="selected">Allowed</option>
237 <option value="0">Not allowed</option>
239 [% IF Koha.Preference('OpacResetPassword') %]
240 <option value="-1">Follow system preference OpacResetPassword (enabled)</option>
242 <option value="-1">Follow system preference OpacResetPassword (disabled)</option>
244 <option value="1">Allowed</option>
245 <option value="0" selected="selected">Not allowed</option>
248 [% IF Koha.Preference('OpacResetPassword') %]
249 <option value="-1" selected="selected">Follow system preference OpacResetPassword (enabled)</option>
251 <option value="-1" selected="selected">Follow system preference OpacResetPassword (disabled)</option>
253 <option value="1">Allowed</option>
254 <option value="0">Not allowed</option>
259 <label for="change_password">Password change in OPAC: </label>
260 <select name="change_password" id="change_password">
261 [% IF category.change_password.defined %]
262 [% IF category.change_password %]
263 [% IF Koha.Preference('OpacPasswordChange') %]
264 <option value="-1">Follow system preference OpacPasswordChange (enabled)</option>
266 <option value="-1">Follow system preference OpacPasswordChange (disabled)</option>
268 <option value="1" selected="selected">Allowed</option>
269 <option value="0">Not allowed</option>
271 [% IF Koha.Preference('OpacPasswordChange') %]
272 <option value="-1">Follow system preference OpacPasswordChange (enabled)</option>
274 <option value="-1">Follow system preference OpacPasswordChange (disabled)</option>
276 <option value="1">Allowed</option>
277 <option value="0" selected="selected">Not allowed</option>
280 [% IF Koha.Preference('OpacPasswordChange') %]
281 <option value="-1" selected="selected">Follow system preference OpacPasswordChange (enabled)</option>
283 <option value="-1" selected="selected">Follow system preference OpacPasswordChange (disabled)</option>
285 <option value="1">Allowed</option>
286 <option value="0">Not allowed</option>
291 <label for="min_password_length">Minimum password length:</label>
292 <input id="min_password_length" type="text" inputmode="numeric" name="min_password_length" value="[% category.min_password_length | html %]"/>
293 <span>Leave blank to use system default ([% Koha.Preference('minPasswordLength') | html %])</span>
295 <li class="pwd_setting_wrapper">
296 <label for="require_strong_password">Require strong password:</label>
297 <select id="require_strong_password" name="require_strong_password">
298 [% IF category.require_strong_password.defined %]
299 [% IF category.require_strong_password %]
300 [% IF Koha.Preference('RequireStrongPassword') %]
301 <option value="-1">Follow system preference RequireStrongPassword (yes)</option>
303 <option value="-1">Follow system preference RequireStrongPassword (no)</option>
305 <option value="1" selected="selected">Yes</option>
306 <option value="0">No</option>
308 [% IF Koha.Preference('RequireStrongPassword') %]
309 <option value="-1">Follow system preference RequireStrongPassword (yes)</option>
311 <option value="-1">Follow system preference RequireStrongPassword (no)</option>
313 <option value="1">Yes</option>
314 <option value="0" selected="selected">No</option>
317 [% IF Koha.Preference('RequireStrongPassword') %]
318 <option value="-1">Follow system preference RequireStrongPassword (yes)</option>
320 <option value="-1">Follow system preference RequireStrongPassword (no)</option>
322 <option value="1">Yes</option>
323 <option value="0">No</option>
327 <li><label for="block_expired">Block expired patrons:</label>
328 <select name="BlockExpiredPatronOpacActions" id="block_expired">
329 [% IF not category or category.BlockExpiredPatronOpacActions == -1%]
330 <option value="-1" selected="selected"> Follow system preference BlockExpiredPatronOpacActions </option>
332 <option value="-1"> Follow system preference BlockExpiredPatronOpacActions </option>
335 [% IF category and category.BlockExpiredPatronOpacActions == 1 %]
336 <option value="1" selected="selected"> Block </option>
338 <option value="1"> Block </option>
341 [% IF category and category.BlockExpiredPatronOpacActions == 0 %]
342 <option value="0" selected="selected"> Don't block </option>
344 <option value="0"> Don't block </option>
348 Choose whether patrons of this category be blocked from public catalog actions such as renewing and placing holds when their cards have expired.
351 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
352 <li><label for="checkprevcheckout">Check for previous checkouts: </label>
353 <select name="checkprevcheckout" id="checkprevcheckout">
354 [% IF category.checkprevcheckout == 'yes' %]
355 <option value="yes" selected="selected">Yes and try to override system preferences</option>
356 <option value="no">No and try to override system preferences</option>
357 <option value="inherit">Inherit from system preferences</option>
358 [% ELSIF category.checkprevcheckout == 'no' %]
359 <option value="yes">Yes and try to override system preferences</option>
360 <option value="no" selected="selected">No and try to override system preferences</option>
361 <option value="inherit">Inherit from system preferences</option>
363 <option value="yes">Yes and try to override system preferences</option>
364 <option value="no">No and try to override system preferences</option>
365 <option value="inherit" selected="selected">Inherit from system preferences</option>
369 Choose whether patrons of this category by default are reminded if they try to borrow an item they borrowed before.
374 <label for="default_privacy">Default privacy: </label>
375 <select id="default_privacy" name="default_privacy">
376 [% SET default_privacy = 'default' %]
377 [% IF category %][% SET default_privacy = category.default_privacy %][% END %]
378 [% SWITCH default_privacy %]
380 <option value="default">Default</option>
381 <option value="never">Never</option>
382 <option value="forever" selected="selected">Forever</option>
384 <option value="default">Default</option>
385 <option value="never" selected="selected">Never</option>
386 <option value="forever">Forever</option>
388 <option value="default" selected="selected">Default</option>
389 <option value="never">Never</option>
390 <option value="forever">Forever</option>
393 <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>
396 <label for="exclude_from_local_holds_priority">Exclude from local holds priority:</label>
397 <select id="exclude_from_local_holds_priority" name="exclude_from_local_holds_priority">
398 [% IF category.exclude_from_local_holds_priority %]
399 <option value="1" selected>Yes</option>
400 <option value="0">No</option>
402 <option value="1">Yes</option>
403 <option value="0" selected>No</option>
406 <span>If <i>Yes</i>, holds placed by patrons of this category will not be given priority</span>
411 [% IF ( EnhancedMessagingPreferences ) %]
412 <fieldset class="rows">
413 <h4>Default messaging preferences for this patron category</h4>
414 [% INCLUDE 'messaging-preference-form.inc' %]
417 <fieldset class="action">
418 <input type="submit" value="Save" />
419 <a href="/cgi-bin/koha/admin/categories.pl" class="cancel">Cancel</a>
424 [% IF op == 'delete_confirm' %]
425 <form action="/cgi-bin/koha/admin/categories.pl" method="post">
428 [% IF patrons_in_category > 0 %]
429 Category [% categorycode | html %] is in use. Deletion not possible!
431 Confirm deletion of category [% categorycode | html %]
435 [% IF patrons_in_category > 0 %]
436 <div class="dialog alert">
437 <strong>This category is used [% patrons_in_category | html %] times</strong>. Deletion not possible
441 <tr><th scope="row">Category code: </th><td>[% category.categorycode | html %]</td></tr>
442 <tr><th scope="row">Description: </th><td>[% category.description | html %]</td></tr>
443 <tr><th scope="row">Enrollment period: </th>
445 [% IF category.enrolmentperiod %]
446 [% category.enrolmentperiod | html %] months
448 until [% category.enrolmentperioddate | $KohaDates %]
452 <tr><th scope="row">Age required: </th><td>[% category.dateofbirthrequired | html %] years</td></tr>
453 <tr><th scope="row">Upperage limit: </th><td>[% category.upperagelimit | html %] years</td></tr>
454 <tr><th scope="row">Enrollment fee: </th><td>[% category.enrolmentfee | $Price %]</td></tr>
455 <tr><th scope="row">Receives overdue notices: </th><td>[% IF category. overduenoticerequired %]Yes[% ELSE %]No[% END %]</td></tr>
456 <tr><th scope="row">Lost items in staff interface</th><td>[% IF category.hidelostitems %]Hidden by default[% ELSE %]Shown[% END %]</td></tr>
457 <tr><th scope="row">Hold fee: </th><td>[% category.reservefee | $Price %]</td></tr>
459 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
461 <th scope="row">Check previous checkouts: </th>
463 [% SWITCH category.checkprevcheckout %]
475 <th scope="row">Default privacy: </th>
477 [% SWITCH category.default_privacy %]
488 <fieldset class="action">
489 [% IF patrons_in_category > 0 %]
490 <input type="submit" value="OK" />
492 <input type="hidden" name="op" value="delete_confirmed" />
493 <input type="hidden" name="categorycode" value="[% categorycode | html %]" />
494 <input type="submit" value="Delete this category" />
495 <a class="cancel" href="/cgi-bin/koha/admin/categories.pl">Cancel</a>
502 [% IF op == 'list' %]
504 <div id="toolbar" class="btn-toolbar">
505 <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>
508 <h2>Patron categories</h2>
510 You Searched for [% searchfield | html %]</span>
513 <table id="patron_categories">
516 <th scope="col">Code</th>
517 <th scope="col">Category name</th>
518 <th scope="col">Type</th>
519 <th scope="col">Enrollment period</th>
520 <th scope="col">Age required</th>
521 <th scope="col">Upper age limit</th>
522 <th scope="col">Enrollment fee</th>
523 <th scope="col">Overdue</th>
524 <th scope="col">Lost items</th>
525 <th scope="col">Hold fee</th>
526 [% IF ( EnhancedMessagingPreferences ) %]
527 <th scope="col">Messaging</th>
529 <th scope="col">Library limitations</th>
530 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
531 <th scope="col">Check previous checkout?</th>
533 <th scope="col">Default privacy</th>
534 <th scope="col">Exclude from local holds priority</th>
535 <th scope="col">Actions</th>
539 [% FOREACH category IN categories %]
541 <td>[% category.categorycode | html %]</td>
543 <a href="/cgi-bin/koha/admin/categories.pl?op=add_form&categorycode=[% category.categorycode |uri %]">[% category.description | html %]</a>
546 [% SWITCH category.category_type %]
552 [% CASE 'X' %]Statistical
556 [% IF ( category.enrolmentperiod ) %]
557 [% category.enrolmentperiod | html %] months
559 until [% category.enrolmentperioddate | $KohaDates %]
562 [% IF (category.dateofbirthrequired) %]
563 <td>[% category.dateofbirthrequired | html %] years</td>
567 [% IF (category.upperagelimit) %]
568 <td>[% category.upperagelimit | html %] years</td>
572 [% IF (category.enrolmentfee > 0) %]
573 <td>[% category.enrolmentfee | $Price %]</td>
577 <td>[% IF ( category.overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td>
578 <td>[% IF ( category.hidelostitems ) %]Hidden[% ELSE %]Shown[% END %]</td>
579 [% IF (category.reservefee > 0) %]
580 <td>[% category.reservefee | $Price %]</td>
584 [% IF Koha.Preference('EnhancedMessagingPreferences') %]
585 <td style="white-space: nowrap; font-size:80%;">
586 [% SET default_messaging = category.default_messaging %]
587 [% IF default_messaging.size %]
588 [% FOREACH prefs IN default_messaging %]
589 [% NEXT IF !Koha.Preference( 'ILLModule' ) && prefs.message_name.match('^Ill_') %]
590 [% FOREACH transport IN prefs.transports %]
591 [% IF ( transport.transport ) %]
592 [% IF ( prefs.Item_Due ) %]Item due
593 [% ELSIF ( prefs.Advance_Notice ) %]Advance notice
594 [% ELSIF ( prefs.Hold_Filled ) %]Hold filled
595 [% ELSIF ( prefs.Item_Check_in ) %]Item check-in
596 [% ELSIF ( prefs.Item_Checkout ) %]Item checkout
597 [% ELSIF ( prefs.Ill_ready ) %]Interlibrary loan ready
598 [% ELSIF ( prefs.Ill_unavailable ) %]Interlibrary loan unavailable
601 <strong>[% transport.transport | html %]</strong><br />
602 [% ELSE %]None<br />[% END %]
611 [% SET library_limits = category.library_limits %]
612 [% IF library_limits.count > 0 %]
613 [% library_str = "" %]
614 [% FOREACH library IN library_limits %]
615 [%- IF loop.first -%]
616 [% library_str = library.branchname _ " (" _ library.branchcode _ ")" %]
618 [% library_str = library_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %]
621 <span class="library_limitation" title="[% library_str | html %]">
622 [% IF library_limits.count > 1 %]
623 [% library_limits.count | html %] library limitations
625 [% library_limits.count | html %] library limitation
631 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
633 [% SWITCH category.checkprevcheckout %]
644 [% SWITCH category.default_privacy %]
654 [% IF category.exclude_from_local_holds_priority %]
661 <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>
662 <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>
669 <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>
674 </div> <!-- /.col-sm-10.col-sm-push-2 -->
676 <div class="col-sm-2 col-sm-pull-10">
678 [% INCLUDE 'admin-menu.inc' %]
680 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
681 </div> <!-- /.row -->
683 [% MACRO jsinclude BLOCK %]
684 [% Asset.js("js/admin-menu.js") | $raw %]
685 [% Asset.js("js/messaging-preference-form.js") | $raw %]
686 [% INCLUDE 'calendar.inc' %]
687 [% INCLUDE 'datatables.inc' %]
688 [% INCLUDE 'columns_settings.inc' %]
690 var columns_settings = [% TablesSettings.GetColumns( 'admin', 'categories', 'patron_categories', 'json' ) | $raw %];
692 [% Asset.js("js/categories.js") | $raw %]
694 [% INCLUDE 'intranet-bottom.inc' %]