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="[% themelang %]/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, {
17 { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
18 { "aTargets": [ 3,4,5 ], "sType": "natural" },
20 "aaSorting": [[ 1, "asc" ]],
21 "sPaginationType": "four_button"
24 $( "#enrolmentperioddate" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
26 if ( $("#branches option:selected").length < 1 ) {
27 $("#branches option:first").attr("selected", "selected");
30 function isNotNull(f,noalert) {
31 if (f.value.length ==0) {
37 function isNum(v,maybenull) {
38 var n = new Number(v.value);
42 if (maybenull==0 && v.value=='') {
47 // to check if the data are correctly entered.
50 var _alertString=_("Form not submitted because of the following problem(s)");
51 _alertString +="\n-------------------------------------------------------------------\n\n";
52 ff.categorycode.value = $.trim(ff.categorycode.value);
53 if (ff.categorycode.value.length==0) {
55 _alertString += _("- categorycode missing") + "\n";
58 var patt=/^[a-zA-Z0-9\-_]+$/g;
59 if ( !patt.test(ff.categorycode.value) ) {
61 _alertString += _("- category code can only contain the following characters: letters, numbers, - and _") + "\n";
64 if (!(ff.category_type.value)){
66 _alertString += _("- category type missing") + "\n";
68 if (!(isNotNull(ff.description,1))) {
70 _alertString += _("- description missing") + "\n";
72 if (!isNum(ff.upperagelimit,0) && ff.category_type.value=='C') {
74 _alertString += _("- upperagelimit is not a number") + "\n";
77 if(!(ff.enrolmentperioddate.value || ff.enrolmentperiod.value)) {
79 _alertString += _("- either Enrollment period or Until date must be provided") + "\n";
81 if(ff.enrolmentperioddate.value && ff.enrolmentperiod.value){
82 document.getElementById('enrolmentmessage').className = "error";
86 if (ok) { // if there is a problem
95 <style type="text/css">#enrolmentmessage.hint { display : none; }</style>
97 <body id="admin_categorie" class="admin">
98 [% INCLUDE 'header.inc' %]
99 [% INCLUDE 'patrons-admin-search.inc' %]
101 <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 %]
102 [% 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 %]
103 [% IF op == 'delete_confirmed' %] <a href="/cgi-bin/koha/admin/categories.pl">Patron categories</a> › Category deleted[% END %]
104 [% IF op == 'list' %]Patron categories[% END %]</div>
106 <div id="doc3" class="yui-t2">
112 [% FOR m IN messages %]
113 <div class="dialog [% m.type %]">
115 [% CASE 'error_on_update' %]
116 An error occurred when updating this patron category. Perhaps it already exists.
117 [% CASE 'error_on_insert' %]
118 An error occurred when inserting this patron category. The patron category might already exist.
119 [% CASE 'error_on_delete' %]
120 An error occurred when deleting this patron category. Check the logs.
121 [% CASE 'success_on_update' %]
122 Patron category updated successfully.
123 [% CASE 'success_on_insert' %]
124 Patron category inserted successfully.
125 [% CASE 'success_on_delete' %]
126 Patron category deleted successfully.
127 [% CASE 'already_exists' %]
128 This patron category already exists.
135 [% IF op == 'add_form' %]
136 <form name="Aform" action="/cgi-bin/koha/admin/categories.pl" method="post">
137 <input type="hidden" name="op" value="add_validate" />
138 <input type="hidden" name="checked" value="0" />
140 <h1>Modify category [% categorycode |html %]</h1>
142 <h1>New category</h1>
144 <fieldset class="rows">
148 <span class="label">Category code: </span>[% categorycode |html %]
149 <input type="hidden" name="categorycode" value="[% category.categorycode |html %]" /><input type="hidden" name="is_a_modif" value="1" />
153 <label for="categorycode" class="required">Category code: </label>
154 <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" onblur="toUC(this)" />
155 <span class="required">Required</span>
159 <label for="description" class="required">Description: </label>
160 <input type="text" name="description" id="description" size="40" maxlength="80" value="[% category.description |html %]" />
161 <span class="required">Required</span>
164 <label for="enrolmentperiod" class="required">Enrollment period: </label>
166 <legend>Choose one</legend>
169 <label for="enrolmentperiod" style="width:6em;">In months: </label>
170 <input type="text" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% IF category.enrolmentperiod %][% category.enrolmentperiod %][% END %]" /> months
173 <label for="enrolmentperioddate" style="width:6em;">Until date: </label>
174 <input type="text" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" />
175 <div id="enrolmentmessage" class="hint" style="margin-left:0;">Cannot have "months" and "until date" at the same time</div>
181 <label for="dateofbirthrequired">Age required: </label>
182 <input type="text" name="dateofbirthrequired" id="dateofbirthrequired" value="[% category.dateofbirthrequired %]" size="3" maxlength="3" /> years
185 <label for="upperagelimit">Upperage limit: </label>
186 <input type="text" name="upperagelimit" id="upperagelimit" size="3" maxlength="3" value="[% category.upperagelimit %]" /> years
189 <label for="enrolmentfee">Enrollment fee: </label>
190 <input type="text" name="enrolmentfee" id="enrolmentfee" size="6" value="[% category.enrolmentfee | $Price on_editing => 1 %]" />
193 <label for="overduenoticerequired">Overdue notice required: </label>
194 <select name="overduenoticerequired" id="overduenoticerequired">
195 [% IF category.overduenoticerequired %]
196 <option value="0">No</option>
197 <option value="1" selected="selected">Yes</option>
199 <option value="0" selected="selected">No</option>
200 <option value="1">Yes</option>
205 <label for="hidelostitems">Lost items in staff client: </label>
206 <select name="hidelostitems" id="hidelostitems">
207 [% IF category.hidelostitems %]
208 <option value="0">Shown</option>
209 <option value="1" selected="selected">Hidden by default</option>
211 <option value="0" selected="selected">Shown</option>
212 <option value="1">Hidden by default</option>
217 <label for="reservefee">Hold fee: </label>
218 <input type="text" name="reservefee" id="reservefee" size="6" value="[% category.reservefee | $Price on_editing => 1 %]" />
221 <label for="category_type" class="required">Category type: </label>
222 <select name="category_type" id="category_type">
223 [% UNLESS category %]<option value="" selected="selected">Select a category type</option>[% ELSE %]<option value="">Select a category type</option>[% END %]
224 [% IF category and category.category_type == 'A' %]<option value="A" selected="selected">Adult</option>[% ELSE %]<option value="A">Adult</option>[% END %]
225 [% IF category and category.category_type == 'C' %]<option value="C" selected="selected">Child</option>[% ELSE %]<option value="C">Child</option>[% END %]
226 [% IF category and category.category_type == 'S' %]<option value="S" selected="selected">Staff</option>[% ELSE %]<option value="S">Staff</option>[% END %]
227 [% IF category and category.category_type == 'I' %]<option value="I" selected="selected">Organization</option>[% ELSE %]<option value="I">Organization</option>[% END %]
228 [% IF category and category.category_type == 'P' %]<option value="P" selected="selected">Professional</option>[% ELSE %]<option value="P">Professional</option>[% END %]
229 [% IF category and category.category_type == 'X' %]<option value="X" selected="selected">Statistical</option>[% ELSE %]<option value="X">Statistical</option>[% END %]
231 <span class="required">Required</span>
233 <li><label for="branches">Branches limitation: </label>
234 <select id="branches" name="branches" multiple size="10">
235 <option value="">All branches</option>
236 [% FOREACH branch IN branches_loop %]
237 [% IF branch.selected %]
238 <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
240 <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
244 <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.
247 <li><label for="block_expired">Block expired patrons</label>
248 <select name="BlockExpiredPatronOpacActions" id="block_expired">
249 [% IF not category or category.BlockExpiredPatronOpacActions == -1%]
250 <option value="-1" selected="selected"> Follow system preference BlockExpiredPatronOpacActions </option>
252 <option value="-1"> Follow system preference BlockExpiredPatronOpacActions </option>
255 [% IF category and category.BlockExpiredPatronOpacActions == 1 %]
256 <option value="1" selected="selected"> Block </option>
258 <option value="1"> Block </option>
261 [% IF category and category.BlockExpiredPatronOpacActions == 0 %]
262 <option value="0" selected="selected"> Don't block </option>
264 <option value="0"> Don't block </option>
268 Choose whether patrons of this category be blocked from public catalog actions such as renewing and placing holds when their cards have expired.
272 <label for="default_privacy">Default privacy: </label>
273 <select id="default_privacy" name="default_privacy">
274 [% SET default_privacy = 'default' %]
275 [% IF category %][% SET default_privacy = category.default_privacy %][% END %]
276 [% SWITCH default_privacy %]
278 <option value="default">Default</option>
279 <option value="never">Never</option>
280 <option value="forever" selected="selected">Forever</option>
282 <option value="default">Default</option>
283 <option value="never" selected="selected">Never</option>
284 <option value="forever">Forever</option>
286 <option value="default" selected="selected">Default</option>
287 <option value="never">Never</option>
288 <option value="forever">Forever</option>
291 <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>
296 [% IF ( EnhancedMessagingPreferences ) %]
297 <fieldset class="rows">
298 <h4>Default messaging preferences for this patron category</h4>
299 [% INCLUDE 'messaging-preference-form.inc' %]
302 <fieldset class="action"><input type="button" value="Save" onclick="Check(this.form);" /> </fieldset>
306 [% IF op == 'delete_confirm' %]
307 <form action="/cgi-bin/koha/admin/categories.pl" method="post">
310 [% IF patrons_in_category > 0 %]
311 Category [% categorycode |html %] is in use. Deletion not possible!
313 Confirm deletion of category [% categorycode |html %]
317 [% IF patrons_in_category > 0 %]
318 <div class="dialog alert">
319 <strong>This category is used [% patrons_in_category %] times</strong>. Deletion not possible
323 <tr><th scope="row">Category code: </th><td>[% category.categorycode |html %]</td></tr>
324 <tr><th scope="row">Description: </th><td>[% category.description |html %]</td></tr>
325 <tr><th scope="row">Enrollment period: </th>
327 [% IF category.enrolmentperiod %]
328 [% category.enrolmentperiod %] months
330 until [% category.enrolmentperioddate | $KohaDates %]
334 <tr><th scope="row">Age required: </th><td>[% category.dateofbirthrequired %] years</td></tr>
335 <tr><th scope="row">Upperage limit: </th><td>[% category.upperagelimit %] years</td></tr>
336 <tr><th scope="row">Enrollment fee: </th><td>[% category.enrolmentfee | $Price %]</td></tr>
337 <tr><th scope="row">Receives overdue notices: </th><td>[% IF category. overduenoticerequired %]Yes[% ELSE %]No[% END %]</td></tr>
338 <tr><th scope="row">Lost items in staff client</th><td>[% IF category.hidelostitems %]Hidden by default[% ELSE %]Shown[% END %]</td></tr>
339 <tr><th scope="row">Hold fee: </th><td>[% category.reservefee | $Price %]</td></tr>
341 <th scope="row">Default privacy: </th>
343 [% SWITCH category.default_privacy %]
354 <fieldset class="action">
355 [% IF patrons_in_category > 0 %]
356 <input type="submit" value="OK" />
358 <input type="hidden" name="op" value="delete_confirmed" />
359 <input type="hidden" name="categorycode" value="[% categorycode |html %]" />
360 <input type="submit" value="Delete this category" />
361 <a class="cancel" href="/cgi-bin/koha/admin/categories.pl">Cancel</a>
368 [% IF op == 'list' %]
370 <div id="toolbar" class="btn-toolbar">
371 <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>
374 <h2>Patron category administration</h2>
376 You Searched for [% searchfield %]</span>
379 <table id="table_categorie">
382 <th scope="col">Code</th>
383 <th scope="col">Category name</th>
384 <th scope="col">Type</th>
385 <th scope="col">Enrollment period</th>
386 <th scope="col">Age required</th>
387 <th scope="col">Upper age limit</th>
388 <th scope="col">Enrollment fee</th>
389 <th scope="col">Overdue</th>
390 <th scope="col">Lost items</th>
391 <th scope="col">Hold fee</th>
392 [% IF ( EnhancedMessagingPreferences ) %]
393 <th scope="col">Messaging</th>
395 <th scope="col">Branches limitations</th>
396 <th scope="col">Default privacy</th>
397 <th scope="col"> </th>
398 <th scope="col"> </th>
402 [% FOREACH category IN categories %]
404 <td>[% category.categorycode |html %]</td>
406 <a href="/cgi-bin/koha/admin/categories.pl?op=add_form&categorycode=[% category.categorycode |uri %]">[% category.description |html %]</a>
409 [% SWITCH category.category_type %]
415 [% CASE 'X' %]Statistical
419 [% IF ( category.enrolmentperiod ) %]
420 [% category.enrolmentperiod %] months
422 until [% category.enrolmentperioddate | $KohaDates %]
425 <td>[% category.dateofbirthrequired %] years</td>
426 <td>[% category.upperagelimit %] years</td>
427 <td>[% category.enrolmentfee | $Price %]</td>
428 <td>[% IF ( category.overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td>
429 <td>[% IF ( category.hidelostitems ) %]Hidden[% ELSE %]Shown[% END %]</td>
430 <td>[% category.reservefee | $Price %]</td>
431 [% IF Koha.Preference('EnhancedMessagingPreferences') %]
432 <td style="white-space: nowrap; font-size:80%;">
433 [% SET default_messaging = category.default_messaging %]
434 [% IF default_messaging.size %]
435 [% FOREACH prefs IN default_messaging %]
436 [% FOREACH transport IN prefs.transports %]
437 [% IF ( transport.transport ) %]
438 [% IF ( prefs.Item_Due ) %]Item due
439 [% ELSIF ( prefs.Advance_Notice ) %]Advance notice
440 [% ELSIF ( prefs.Upcoming_Events ) %]Upcoming events
441 [% ELSIF ( prefs.Hold_Filled ) %]Hold filled
442 [% ELSIF ( prefs.Item_Check_in ) %]Item check-in
443 [% ELSIF ( prefs.Item_Checkout ) %]Item checkout
446 <strong>[% transport.transport %]</strong><br />
447 [% ELSE %]None<br />[% END %]
456 [% SET branch_limitations = category.branch_limitations %]
457 [% IF branch_limitations.size > 0 %]
458 [% branches_str = "" %]
459 [% FOREACH branch IN branch_limitations %]
460 [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
462 <span title="[% branches_str %]">
463 [% IF branch_limitations.size > 1 %]
464 [% branch_limitations.size %] branches limitations
466 [% branch_limitations.size %] branch limitation
474 [% SWITCH category.default_privacy %]
483 <td><a href="/cgi-bin/koha/admin/categories.pl?op=add_form&categorycode=[% category.categorycode |uri %]">Edit</a></td>
484 <td><a href="/cgi-bin/koha/admin/categories.pl?op=delete_confirm&categorycode=[% category.categorycode |uri %]">Delete</a></td>
490 <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>
497 [% INCLUDE 'admin-menu.inc' %]
500 [% INCLUDE 'intranet-bottom.inc' %]