4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Administration › Patron categories › [% IF op == 'add_form' %][% IF ( categorycode ) %]Modify category '[% categorycode |html %]'[% ELSE %]New category[% END %][% END %]
6 [% 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 %]
8 [% INCLUDE 'doc-head-close.inc' %]
9 [% INCLUDE 'calendar.inc' %]
10 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
11 [% INCLUDE 'datatables.inc' %]
12 <script type="text/javascript" id="js">
14 $(document).ready(function() {
15 $("#table_categorie").dataTable($.extend(true, {}, dataTablesDefaults, {
21 "aTargets": [3, 4, 5],
27 "sPaginationType": "four_button"
30 $("#enrolmentperioddate").datepicker({
32 }); // Require that "until date" be in the future
34 if ($("#branches option:selected").length < 1) {
35 $("#branches option:first").attr("selected", "selected");
39 function isNotNull(f, noalert) {
40 if (f.value.length == 0) {
46 function isNum(v, maybenull) {
47 var n = new Number(v.value);
51 if (maybenull == 0 && v.value == '') {
57 // to check if the data are correctly entered.
60 var _alertString = _("Form not submitted because of the following problem(s)");
61 _alertString += "\n-------------------------------------------------------------------\n\n";
62 ff.categorycode.value = $.trim(ff.categorycode.value);
63 if (ff.categorycode.value.length == 0) {
65 _alertString += _("- categorycode missing") + "\n";
67 var patt = /^[a-zA-Z0-9\-_]+$/g;
68 if (!patt.test(ff.categorycode.value)) {
70 _alertString += _("- category code can only contain the following characters: letters, numbers, - and _") + "\n";
73 if (!(ff.category_type.value)) {
75 _alertString += _("- category type missing") + "\n";
77 if (!(isNotNull(ff.description, 1))) {
79 _alertString += _("- description missing") + "\n";
81 if (!isNum(ff.upperagelimit, 0) && ff.category_type.value == 'C') {
83 _alertString += _("- upperagelimit is not a number") + "\n";
86 if (!(ff.enrolmentperioddate.value || ff.enrolmentperiod.value)) {
88 _alertString += _("- either Enrollment period or Until date must be provided") + "\n";
90 if (ff.enrolmentperioddate.value && ff.enrolmentperiod.value) {
91 document.getElementById('enrolmentmessage').className = "error";
95 if (ok) { // if there is a problem
104 <style type="text/css">#enrolmentmessage.hint { display : none; }</style>
106 <body id="admin_categorie" class="admin">
107 [% INCLUDE 'header.inc' %]
108 [% INCLUDE 'patrons-admin-search.inc' %]
110 <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 %]
111 [% 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 %]
112 [% IF op == 'delete_confirmed' %] <a href="/cgi-bin/koha/admin/categories.pl">Patron categories</a> › Category deleted[% END %]
113 [% IF op == 'list' %]Patron categories[% END %]</div>
115 <div id="doc3" class="yui-t2">
120 [% FOR m IN messages %]
121 <div class="dialog [% m.type %]">
123 [% CASE 'error_on_update' %]
124 An error occurred when updating this patron category. Perhaps it already exists.
125 [% CASE 'error_on_insert' %]
126 An error occurred when inserting this patron category. The patron category might already exist.
127 [% CASE 'error_on_delete' %]
128 An error occurred when deleting this patron category. Check the logs.
129 [% CASE 'success_on_update' %]
130 Patron category updated successfully.
131 [% CASE 'success_on_insert' %]
132 Patron category inserted successfully.
133 [% CASE 'success_on_delete' %]
134 Patron category deleted successfully.
135 [% CASE 'already_exists' %]
136 This patron category already exists.
143 [% IF op == 'add_form' %]
144 <form name="Aform" action="/cgi-bin/koha/admin/categories.pl" method="post">
145 <input type="hidden" name="op" value="add_validate" />
146 <input type="hidden" name="checked" value="0" />
148 <h1>Modify category [% categorycode |html %]</h1>
150 <h1>New category</h1>
152 <fieldset class="rows">
156 <span class="label">Category code: </span>[% categorycode |html %]
157 <input type="hidden" name="categorycode" value="[% category.categorycode |html %]" /><input type="hidden" name="is_a_modif" value="1" />
161 <label for="categorycode" class="required">Category code: </label>
162 <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" onblur="toUC(this)" />
163 <span class="required">Required</span>
167 <label for="description" class="required">Description: </label>
168 <input type="text" name="description" id="description" size="40" maxlength="80" value="[% category.description |html %]" />
169 <span class="required">Required</span>
172 <label for="enrolmentperiod" class="required">Enrollment period: </label>
174 <legend>Choose one</legend>
177 <label for="enrolmentperiod" style="width:6em;">In months: </label>
178 <input type="text" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% IF category.enrolmentperiod %][% category.enrolmentperiod %][% END %]" /> months
181 <label for="enrolmentperioddate" style="width:6em;">Until date: </label>
182 <input type="text" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" />
183 <div id="enrolmentmessage" class="hint" style="margin-left:0;">Cannot have "months" and "until date" at the same time</div>
189 <label for="dateofbirthrequired">Age required: </label>
190 <input type="text" name="dateofbirthrequired" id="dateofbirthrequired" value="[% category.dateofbirthrequired %]" size="3" maxlength="3" /> years
193 <label for="upperagelimit">Upperage limit: </label>
194 <input type="text" name="upperagelimit" id="upperagelimit" size="3" maxlength="3" value="[% category.upperagelimit %]" /> years
197 <label for="enrolmentfee">Enrollment fee: </label>
198 <input type="text" name="enrolmentfee" id="enrolmentfee" size="6" value="[% category.enrolmentfee | $Price on_editing => 1 %]" />
201 <label for="overduenoticerequired">Overdue notice required: </label>
202 <select name="overduenoticerequired" id="overduenoticerequired">
203 [% IF category.overduenoticerequired %]
204 <option value="0">No</option>
205 <option value="1" selected="selected">Yes</option>
207 <option value="0" selected="selected">No</option>
208 <option value="1">Yes</option>
213 <label for="hidelostitems">Lost items in staff client: </label>
214 <select name="hidelostitems" id="hidelostitems">
215 [% IF category.hidelostitems %]
216 <option value="0">Shown</option>
217 <option value="1" selected="selected">Hidden by default</option>
219 <option value="0" selected="selected">Shown</option>
220 <option value="1">Hidden by default</option>
225 <label for="reservefee">Hold fee: </label>
226 <input type="text" name="reservefee" id="reservefee" size="6" value="[% category.reservefee | $Price on_editing => 1 %]" />
229 <label for="category_type" class="required">Category type: </label>
230 <select name="category_type" id="category_type">
231 [% UNLESS category %]<option value="" selected="selected">Select a category type</option>[% ELSE %]<option value="">Select a category type</option>[% END %]
232 [% IF category and category.category_type == 'A' %]<option value="A" selected="selected">Adult</option>[% ELSE %]<option value="A">Adult</option>[% END %]
233 [% IF category and category.category_type == 'C' %]<option value="C" selected="selected">Child</option>[% ELSE %]<option value="C">Child</option>[% END %]
234 [% IF category and category.category_type == 'S' %]<option value="S" selected="selected">Staff</option>[% ELSE %]<option value="S">Staff</option>[% END %]
235 [% IF category and category.category_type == 'I' %]<option value="I" selected="selected">Organization</option>[% ELSE %]<option value="I">Organization</option>[% END %]
236 [% IF category and category.category_type == 'P' %]<option value="P" selected="selected">Professional</option>[% ELSE %]<option value="P">Professional</option>[% END %]
237 [% IF category and category.category_type == 'X' %]<option value="X" selected="selected">Statistical</option>[% ELSE %]<option value="X">Statistical</option>[% END %]
239 <span class="required">Required</span>
241 <li><label for="branches">Branches limitation: </label>
242 <select id="branches" name="branches" multiple size="10">
243 <option value="">All branches</option>
244 [% FOREACH branch IN branches_loop %]
245 [% IF branch.selected %]
246 <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
248 <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
252 <span>Select <i>All branches</i> if this category type must to be displayed all the time. Otherwise select libraries you want to associate with this value.
255 <li><label for="block_expired">Block expired patrons:</label>
256 <select name="BlockExpiredPatronOpacActions" id="block_expired">
257 [% IF not category or category.BlockExpiredPatronOpacActions == -1%]
258 <option value="-1" selected="selected"> Follow system preference BlockExpiredPatronOpacActions </option>
260 <option value="-1"> Follow system preference BlockExpiredPatronOpacActions </option>
263 [% IF category and category.BlockExpiredPatronOpacActions == 1 %]
264 <option value="1" selected="selected"> Block </option>
266 <option value="1"> Block </option>
269 [% IF category and category.BlockExpiredPatronOpacActions == 0 %]
270 <option value="0" selected="selected"> Don't block </option>
272 <option value="0"> Don't block </option>
276 Choose whether patrons of this category be blocked from public catalog actions such as renewing and placing holds when their cards have expired.
280 <label for="default_privacy">Default privacy: </label>
281 <select id="default_privacy" name="default_privacy">
282 [% SET default_privacy = 'default' %]
283 [% IF category %][% SET default_privacy = category.default_privacy %][% END %]
284 [% SWITCH default_privacy %]
286 <option value="default">Default</option>
287 <option value="never">Never</option>
288 <option value="forever" selected="selected">Forever</option>
290 <option value="default">Default</option>
291 <option value="never" selected="selected">Never</option>
292 <option value="forever">Forever</option>
294 <option value="default" selected="selected">Default</option>
295 <option value="never">Never</option>
296 <option value="forever">Forever</option>
299 <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>
304 [% IF ( EnhancedMessagingPreferences ) %]
305 <fieldset class="rows">
306 <h4>Default messaging preferences for this patron category</h4>
307 [% INCLUDE 'messaging-preference-form.inc' %]
310 <fieldset class="action"><input type="button" value="Save" onclick="Check(this.form);" /> </fieldset>
314 [% IF op == 'delete_confirm' %]
315 <form action="/cgi-bin/koha/admin/categories.pl" method="post">
318 [% IF patrons_in_category > 0 %]
319 Category [% categorycode |html %] is in use. Deletion not possible!
321 Confirm deletion of category [% categorycode |html %]
325 [% IF patrons_in_category > 0 %]
326 <div class="dialog alert">
327 <strong>This category is used [% patrons_in_category %] times</strong>. Deletion not possible
331 <tr><th scope="row">Category code: </th><td>[% category.categorycode |html %]</td></tr>
332 <tr><th scope="row">Description: </th><td>[% category.description |html %]</td></tr>
333 <tr><th scope="row">Enrollment period: </th>
335 [% IF category.enrolmentperiod %]
336 [% category.enrolmentperiod %] months
338 until [% category.enrolmentperioddate | $KohaDates %]
342 <tr><th scope="row">Age required: </th><td>[% category.dateofbirthrequired %] years</td></tr>
343 <tr><th scope="row">Upperage limit: </th><td>[% category.upperagelimit %] years</td></tr>
344 <tr><th scope="row">Enrollment fee: </th><td>[% category.enrolmentfee | $Price %]</td></tr>
345 <tr><th scope="row">Receives overdue notices: </th><td>[% IF category. overduenoticerequired %]Yes[% ELSE %]No[% END %]</td></tr>
346 <tr><th scope="row">Lost items in staff client</th><td>[% IF category.hidelostitems %]Hidden by default[% ELSE %]Shown[% END %]</td></tr>
347 <tr><th scope="row">Hold fee: </th><td>[% category.reservefee | $Price %]</td></tr>
349 <th scope="row">Default privacy: </th>
351 [% SWITCH category.default_privacy %]
362 <fieldset class="action">
363 [% IF patrons_in_category > 0 %]
364 <input type="submit" value="OK" />
366 <input type="hidden" name="op" value="delete_confirmed" />
367 <input type="hidden" name="categorycode" value="[% categorycode |html %]" />
368 <input type="submit" value="Delete this category" />
369 <a class="cancel" href="/cgi-bin/koha/admin/categories.pl">Cancel</a>
376 [% IF op == 'list' %]
378 <div id="toolbar" class="btn-toolbar">
379 <a class="btn btn-small" id="newcategory" href="/cgi-bin/koha/admin/categories.pl?op=add_form"><i class="fa fa-plus"></i> New category</a>
382 <h2>Patron category administration</h2>
384 You Searched for [% searchfield %]</span>
387 <table id="table_categorie">
390 <th scope="col">Code</th>
391 <th scope="col">Category name</th>
392 <th scope="col">Type</th>
393 <th scope="col">Enrollment period</th>
394 <th scope="col">Age required</th>
395 <th scope="col">Upper age limit</th>
396 <th scope="col">Enrollment fee</th>
397 <th scope="col">Overdue</th>
398 <th scope="col">Lost items</th>
399 <th scope="col">Hold fee</th>
400 [% IF ( EnhancedMessagingPreferences ) %]
401 <th scope="col">Messaging</th>
403 <th scope="col">Branches limitations</th>
404 <th scope="col">Default privacy</th>
405 <th scope="col"> </th>
406 <th scope="col"> </th>
410 [% FOREACH category IN categories %]
412 <td>[% category.categorycode |html %]</td>
414 <a href="/cgi-bin/koha/admin/categories.pl?op=add_form&categorycode=[% category.categorycode |uri %]">[% category.description |html %]</a>
417 [% SWITCH category.category_type %]
423 [% CASE 'X' %]Statistical
427 [% IF ( category.enrolmentperiod ) %]
428 [% category.enrolmentperiod %] months
430 until [% category.enrolmentperioddate | $KohaDates %]
433 <td>[% category.dateofbirthrequired %] years</td>
434 <td>[% category.upperagelimit %] years</td>
435 <td>[% category.enrolmentfee | $Price %]</td>
436 <td>[% IF ( category.overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td>
437 <td>[% IF ( category.hidelostitems ) %]Hidden[% ELSE %]Shown[% END %]</td>
438 <td>[% category.reservefee | $Price %]</td>
439 [% IF Koha.Preference('EnhancedMessagingPreferences') %]
440 <td style="white-space: nowrap; font-size:80%;">
441 [% SET default_messaging = category.default_messaging %]
442 [% IF default_messaging.size %]
443 [% FOREACH prefs IN default_messaging %]
444 [% FOREACH transport IN prefs.transports %]
445 [% IF ( transport.transport ) %]
446 [% IF ( prefs.Item_Due ) %]Item due
447 [% ELSIF ( prefs.Advance_Notice ) %]Advance notice
448 [% ELSIF ( prefs.Upcoming_Events ) %]Upcoming events
449 [% ELSIF ( prefs.Hold_Filled ) %]Hold filled
450 [% ELSIF ( prefs.Item_Check_in ) %]Item check-in
451 [% ELSIF ( prefs.Item_Checkout ) %]Item checkout
454 <strong>[% transport.transport %]</strong><br />
455 [% ELSE %]None<br />[% END %]
464 [% SET branch_limitations = category.branch_limitations %]
465 [% IF branch_limitations.size > 0 %]
466 [% branches_str = "" %]
467 [% FOREACH branch IN branch_limitations %]
468 [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
470 <span title="[% branches_str %]">
471 [% IF branch_limitations.size > 1 %]
472 [% branch_limitations.size %] branches limitations
474 [% branch_limitations.size %] branch limitation
482 [% SWITCH category.default_privacy %]
491 <td><a href="/cgi-bin/koha/admin/categories.pl?op=add_form&categorycode=[% category.categorycode |uri %]">Edit</a></td>
492 <td><a href="/cgi-bin/koha/admin/categories.pl?op=delete_confirm&categorycode=[% category.categorycode |uri %]">Delete</a></td>
498 <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>
505 [% INCLUDE 'admin-menu.inc' %]
508 [% INCLUDE 'intranet-bottom.inc' %]