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 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › [% IF op == 'add_form' %] <a href="/cgi-bin/koha/admin/categories.pl">Patron categories</a> › [% IF ( categorycode ) %]Modify category '[% categorycode | html %]'[% ELSE %]New category[% END %][% END %]
21 [% IF op == 'delete_confirm' %] <a href="/cgi-bin/koha/admin/categories.pl">Patron categories</a> › [% IF ( patrons_in_category > 0 ) %]Cannot delete: Category [% categorycode | html %] in use[% ELSE %]Confirm deletion of category '[% categorycode | html %]'[% END %][% END %]
22 [% IF op == 'delete_confirmed' %] <a href="/cgi-bin/koha/admin/categories.pl">Patron categories</a> › Category deleted[% END %]
23 [% IF op == 'list' %]Patron categories[% END %]</div>
25 <div class="main container-fluid">
27 <div class="col-sm-10 col-sm-push-2">
30 [% FOR m IN messages %]
31 <div class="dialog [% m.type | html %]">
33 [% CASE 'error_on_update' %]
34 An error occurred when updating this patron category. Perhaps it already exists.
35 [% CASE 'error_on_insert' %]
36 An error occurred when inserting this patron category. The patron category might already exist.
37 [% CASE 'error_on_delete' %]
38 An error occurred when deleting this patron category. Check the logs.
39 [% CASE 'success_on_update' %]
40 Patron category updated successfully.
41 [% CASE 'success_on_insert' %]
42 Patron category inserted successfully.
43 [% CASE 'success_on_delete' %]
44 Patron category deleted successfully.
45 [% CASE 'already_exists' %]
46 This patron category already exists.
53 [% IF op == 'add_form' %]
54 <form id="category_form" action="/cgi-bin/koha/admin/categories.pl" method="post">
55 <input type="hidden" name="op" value="add_validate" />
56 <input type="hidden" name="checked" value="0" />
58 <h1>Modify category [% categorycode | html %]</h1>
62 <fieldset class="rows">
66 <span class="label">Category code: </span>[% categorycode | html %]
67 <input type="hidden" name="categorycode" value="[% category.categorycode | html %]" /><input type="hidden" name="is_a_modif" value="1" />
71 <label for="categorycode" class="required">Category code: </label>
72 <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" class="required" required="required" />
73 <span class="required">Required</span>
77 <label for="description" class="required">Description: </label>
78 <input type="text" name="description" id="description" size="40" maxlength="80" class="required" required="required" value="[% category.description | html %]" />
79 <span class="required">Required</span>
82 <span class="label">Enrollment period: </span>
84 <legend>Choose one</legend>
87 <label for="enrolmentperiod" style="width:6em;">In months: </label>
88 [% IF category.enrolmentperiod %]
89 <input type="text" class="enrollmentperiod" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% category.enrolmentperiod | html %]" /> months
91 <input type="text" class="enrollmentperiod" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="" /> months
95 <label for="enrolmentperioddate" style="width:6em;">Until date: </label>
96 <input type="text" class="enrollmentperiod" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" />
102 <label for="dateofbirthrequired">Age required: </label>
103 <input type="text" name="dateofbirthrequired" id="dateofbirthrequired" value="[% category.dateofbirthrequired | html %]" size="3" maxlength="3" /> years
106 <label for="upperagelimit">Upperage limit: </label>
107 <input type="text" name="upperagelimit" id="upperagelimit" size="3" maxlength="3" value="[% category.upperagelimit | html %]" /> years
110 <label for="enrolmentfee">Enrollment fee: </label>
111 <input type="text" name="enrolmentfee" id="enrolmentfee" size="6" value="[% category.enrolmentfee | $Price on_editing => 1 %]" />
114 <label for="overduenoticerequired">Overdue notice required: </label>
115 <select name="overduenoticerequired" id="overduenoticerequired">
116 [% IF category.overduenoticerequired %]
117 <option value="0">No</option>
118 <option value="1" selected="selected">Yes</option>
120 <option value="0" selected="selected">No</option>
121 <option value="1">Yes</option>
126 <label for="hidelostitems">Lost items in staff client: </label>
127 <select name="hidelostitems" id="hidelostitems">
128 [% IF category.hidelostitems %]
129 <option value="0">Shown</option>
130 <option value="1" selected="selected">Hidden by default</option>
132 <option value="0" selected="selected">Shown</option>
133 <option value="1">Hidden by default</option>
138 <label for="reservefee">Hold fee: </label>
139 <input type="text" name="reservefee" id="reservefee" size="6" value="[% category.reservefee | $Price on_editing => 1 %]" />
142 <label for="category_type" class="required">Category type: </label>
143 <select name="category_type" id="category_type">
144 [% UNLESS category %]<option value="" selected="selected">Select a category type</option>[% ELSE %]<option value="">Select a category type</option>[% END %]
145 [% IF category and category.category_type == 'A' %]<option value="A" selected="selected">Adult</option>[% ELSE %]<option value="A">Adult</option>[% END %]
146 [% IF category and category.category_type == 'C' %]<option value="C" selected="selected">Child</option>[% ELSE %]<option value="C">Child</option>[% END %]
147 [% IF category and category.category_type == 'S' %]<option value="S" selected="selected">Staff</option>[% ELSE %]<option value="S">Staff</option>[% END %]
148 [% IF category and category.category_type == 'I' %]<option value="I" selected="selected">Organization</option>[% ELSE %]<option value="I">Organization</option>[% END %]
149 [% IF category and category.category_type == 'P' %]<option value="P" selected="selected">Professional</option>[% ELSE %]<option value="P">Professional</option>[% END %]
150 [% IF category and category.category_type == 'X' %]<option value="X" selected="selected">Statistical</option>[% ELSE %]<option value="X">Statistical</option>[% END %]
152 <span class="required">Required</span>
154 <li><label for="branches">Library limitations: </label>
155 <select id="branches" name="branches" multiple size="10">
156 <option value="">All libraries</option>
157 [% FOREACH branch IN branches_loop %]
158 [% IF branch.selected %]
159 <option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
161 <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
165 <span>Select <i>All libraries</i> if this category type must to be displayed all the time. Otherwise select libraries you want to associate with this value.
169 <label for="reset_password">Password reset in OPAC: </label>
170 <select name="reset_password" id="reset_password">
171 [% IF category.reset_password.defined %]
172 [% IF category.reset_password %]
173 [% IF Koha.Preference('OpacResetPassword') %]
174 <option value="-1">Follow system preference OpacResetPassword (enabled)</option>
176 <option value="-1">Follow system preference OpacResetPassword (disabled)</option>
178 <option value="1" selected="selected">Allowed</option>
179 <option value="0">Not allowed</option>
181 [% IF Koha.Preference('OpacResetPassword') %]
182 <option value="-1">Follow system preference OpacResetPassword (enabled)</option>
184 <option value="-1">Follow system preference OpacResetPassword (disabled)</option>
186 <option value="1">Allowed</option>
187 <option value="0" selected="selected">Not allowed</option>
190 [% IF Koha.Preference('OpacResetPassword') %]
191 <option value="-1" selected="selected">Follow system preference OpacResetPassword (enabled)</option>
193 <option value="-1" selected="selected">Follow system preference OpacResetPassword (disabled)</option>
195 <option value="1">Allowed</option>
196 <option value="0">Not allowed</option>
201 <label for="change_password">Password change in OPAC: </label>
202 <select name="change_password" id="change_password">
203 [% IF category.change_password.defined %]
204 [% IF category.change_password %]
205 [% IF Koha.Preference('OpacPasswordChange') %]
206 <option value="-1">Follow system preference OpacPasswordChange (enabled)</option>
208 <option value="-1">Follow system preference OpacPasswordChange (disabled)</option>
210 <option value="1" selected="selected">Allowed</option>
211 <option value="0">Not allowed</option>
213 [% IF Koha.Preference('OpacPasswordChange') %]
214 <option value="-1">Follow system preference OpacPasswordChange (enabled)</option>
216 <option value="-1">Follow system preference OpacPasswordChange (disabled)</option>
218 <option value="1">Allowed</option>
219 <option value="0" selected="selected">Not allowed</option>
222 [% IF Koha.Preference('OpacPasswordChange') %]
223 <option value="-1" selected="selected">Follow system preference OpacPasswordChange (enabled)</option>
225 <option value="-1" selected="selected">Follow system preference OpacPasswordChange (disabled)</option>
227 <option value="1">Allowed</option>
228 <option value="0">Not allowed</option>
232 <li><label for="block_expired">Block expired patrons:</label>
233 <select name="BlockExpiredPatronOpacActions" id="block_expired">
234 [% IF not category or category.BlockExpiredPatronOpacActions == -1%]
235 <option value="-1" selected="selected"> Follow system preference BlockExpiredPatronOpacActions </option>
237 <option value="-1"> Follow system preference BlockExpiredPatronOpacActions </option>
240 [% IF category and category.BlockExpiredPatronOpacActions == 1 %]
241 <option value="1" selected="selected"> Block </option>
243 <option value="1"> Block </option>
246 [% IF category and category.BlockExpiredPatronOpacActions == 0 %]
247 <option value="0" selected="selected"> Don't block </option>
249 <option value="0"> Don't block </option>
253 Choose whether patrons of this category be blocked from public catalog actions such as renewing and placing holds when their cards have expired.
256 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
257 <li><label for="checkprevcheckout">Check for previous checkouts: </label>
258 <select name="checkprevcheckout" id="checkprevcheckout">
259 [% IF category.checkprevcheckout == 'yes' %]
260 <option value="yes" selected="selected">Yes and try to override system preferences</option>
261 <option value="no">No and try to override system preferences</option>
262 <option value="inherit">Inherit from system preferences</option>
263 [% ELSIF category.checkprevcheckout == 'no' %]
264 <option value="yes">Yes and try to override system preferences</option>
265 <option value="no" selected="selected">No and try to override system preferences</option>
266 <option value="inherit">Inherit from system preferences</option>
268 <option value="yes">Yes and try to override system preferences</option>
269 <option value="no">No and try to override system preferences</option>
270 <option value="inherit" selected="selected">Inherit from system preferences</option>
274 Choose whether patrons of this category by default are reminded if they try to borrow an item they borrowed before.
279 <label for="default_privacy">Default privacy: </label>
280 <select id="default_privacy" name="default_privacy">
281 [% SET default_privacy = 'default' %]
282 [% IF category %][% SET default_privacy = category.default_privacy %][% END %]
283 [% SWITCH default_privacy %]
285 <option value="default">Default</option>
286 <option value="never">Never</option>
287 <option value="forever" selected="selected">Forever</option>
289 <option value="default">Default</option>
290 <option value="never" selected="selected">Never</option>
291 <option value="forever">Forever</option>
293 <option value="default" selected="selected">Default</option>
294 <option value="never">Never</option>
295 <option value="forever">Forever</option>
298 <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 <i>batch_anonymise.pl</i> which should be set up by your system administrator.</span>
303 [% IF ( EnhancedMessagingPreferences ) %]
304 <fieldset class="rows">
305 <h4>Default messaging preferences for this patron category</h4>
306 [% INCLUDE 'messaging-preference-form.inc' %]
309 <fieldset class="action">
310 <input type="submit" value="Save" />
311 <a href="/cgi-bin/koha/admin/categories.pl" class="cancel">Cancel</a>
316 [% IF op == 'delete_confirm' %]
317 <form action="/cgi-bin/koha/admin/categories.pl" method="post">
320 [% IF patrons_in_category > 0 %]
321 Category [% categorycode | html %] is in use. Deletion not possible!
323 Confirm deletion of category [% categorycode | html %]
327 [% IF patrons_in_category > 0 %]
328 <div class="dialog alert">
329 <strong>This category is used [% patrons_in_category | html %] times</strong>. Deletion not possible
333 <tr><th scope="row">Category code: </th><td>[% category.categorycode | html %]</td></tr>
334 <tr><th scope="row">Description: </th><td>[% category.description | html %]</td></tr>
335 <tr><th scope="row">Enrollment period: </th>
337 [% IF category.enrolmentperiod %]
338 [% category.enrolmentperiod | html %] months
340 until [% category.enrolmentperioddate | $KohaDates %]
344 <tr><th scope="row">Age required: </th><td>[% category.dateofbirthrequired | html %] years</td></tr>
345 <tr><th scope="row">Upperage limit: </th><td>[% category.upperagelimit | html %] years</td></tr>
346 <tr><th scope="row">Enrollment fee: </th><td>[% category.enrolmentfee | $Price %]</td></tr>
347 <tr><th scope="row">Receives overdue notices: </th><td>[% IF category. overduenoticerequired %]Yes[% ELSE %]No[% END %]</td></tr>
348 <tr><th scope="row">Lost items in staff client</th><td>[% IF category.hidelostitems %]Hidden by default[% ELSE %]Shown[% END %]</td></tr>
349 <tr><th scope="row">Hold fee: </th><td>[% category.reservefee | $Price %]</td></tr>
351 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
353 <th scope="row">Check previous checkouts: </th>
355 [% SWITCH category.checkprevcheckout %]
367 <th scope="row">Default privacy: </th>
369 [% SWITCH category.default_privacy %]
380 <fieldset class="action">
381 [% IF patrons_in_category > 0 %]
382 <input type="submit" value="OK" />
384 <input type="hidden" name="op" value="delete_confirmed" />
385 <input type="hidden" name="categorycode" value="[% categorycode | html %]" />
386 <input type="submit" value="Delete this category" />
387 <a class="cancel" href="/cgi-bin/koha/admin/categories.pl">Cancel</a>
394 [% IF op == 'list' %]
396 <div id="toolbar" class="btn-toolbar">
397 <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>
400 <h2>Patron categories</h2>
402 You Searched for [% searchfield | html %]</span>
405 <table id="patron_categories">
408 <th scope="col">Code</th>
409 <th scope="col">Category name</th>
410 <th scope="col">Type</th>
411 <th scope="col">Enrollment period</th>
412 <th scope="col">Age required</th>
413 <th scope="col">Upper age limit</th>
414 <th scope="col">Enrollment fee</th>
415 <th scope="col">Overdue</th>
416 <th scope="col">Lost items</th>
417 <th scope="col">Hold fee</th>
418 [% IF ( EnhancedMessagingPreferences ) %]
419 <th scope="col">Messaging</th>
421 <th scope="col">Library limitations</th>
422 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
423 <th scope="col">Check previous checkout?</th>
425 <th scope="col">Default privacy</th>
426 <th scope="col">Actions</th>
430 [% FOREACH category IN categories %]
432 <td>[% category.categorycode | html %]</td>
434 <a href="/cgi-bin/koha/admin/categories.pl?op=add_form&categorycode=[% category.categorycode |uri %]">[% category.description | html %]</a>
437 [% SWITCH category.category_type %]
443 [% CASE 'X' %]Statistical
447 [% IF ( category.enrolmentperiod ) %]
448 [% category.enrolmentperiod | html %] months
450 until [% category.enrolmentperioddate | $KohaDates %]
453 [% IF (category.dateofbirthrequired) %]
454 <td>[% category.dateofbirthrequired | html %] years</td>
458 [% IF (category.upperagelimit) %]
459 <td>[% category.upperagelimit | html %] years</td>
463 [% IF (category.enrolmentfee > 0) %]
464 <td>[% category.enrolmentfee | $Price %]</td>
468 <td>[% IF ( category.overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td>
469 <td>[% IF ( category.hidelostitems ) %]Hidden[% ELSE %]Shown[% END %]</td>
470 [% IF (category.reservefee > 0) %]
471 <td>[% category.reservefee | $Price %]</td>
475 [% IF Koha.Preference('EnhancedMessagingPreferences') %]
476 <td style="white-space: nowrap; font-size:80%;">
477 [% SET default_messaging = category.default_messaging %]
478 [% IF default_messaging.size %]
479 [% FOREACH prefs IN default_messaging %]
480 [% FOREACH transport IN prefs.transports %]
481 [% IF ( transport.transport ) %]
482 [% IF ( prefs.Item_Due ) %]Item due
483 [% ELSIF ( prefs.Advance_Notice ) %]Advance notice
484 [% ELSIF ( prefs.Upcoming_Events ) %]Upcoming events
485 [% ELSIF ( prefs.Hold_Filled ) %]Hold filled
486 [% ELSIF ( prefs.Item_Check_in ) %]Item check-in
487 [% ELSIF ( prefs.Item_Checkout ) %]Item checkout
490 <strong>[% transport.transport | html %]</strong><br />
491 [% ELSE %]None<br />[% END %]
500 [% SET branch_limitations = category.branch_limitations %]
501 [% IF branch_limitations.size > 0 %]
502 [% branches_str = "" %]
503 [% FOREACH branch IN branch_limitations %]
504 [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
506 <span title="[% branches_str | html %]">
507 [% IF branch_limitations.size > 1 %]
508 [% branch_limitations.size | html %] library limitations
510 [% branch_limitations.size | html %] library limitation
517 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
519 [% SWITCH category.checkprevcheckout %]
530 [% SWITCH category.default_privacy %]
540 <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>
541 <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>
548 <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>
553 </div> <!-- /.col-sm-10.col-sm-push-2 -->
555 <div class="col-sm-2 col-sm-pull-10">
557 [% INCLUDE 'admin-menu.inc' %]
559 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
560 </div> <!-- /.row -->
562 [% MACRO jsinclude BLOCK %]
563 [% Asset.js("js/admin-menu.js") | $raw %]
564 [% Asset.js("js/messaging-preference-form.js") | $raw %]
565 [% INCLUDE 'calendar.inc' %]
566 [% INCLUDE 'datatables.inc' %]
567 [% INCLUDE 'columns_settings.inc' %]
569 var MSG_CATEGORYCODE_CHARS = _("Category code can only contain the following characters: letters, numbers, - and _.");
570 var MSG_ONE_ENROLLMENTPERIOD = ("Please choose an enrollment period in months OR by date.");
571 var columns_settings = [% TablesSettings.GetColumns( 'admin', 'categories', 'patron_categories', 'json' ) | $raw %];
573 [% Asset.js("js/categories.js") | $raw %]
575 [% INCLUDE 'intranet-bottom.inc' %]