2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha › Administration › Patron categories › [% IF ( add_form ) %][% IF ( categorycode ) %]Modify category '[% categorycode |html %]'[% ELSE %]New category[% END %][% END %]
4 [% IF ( delete_confirm ) %][% IF ( patrons_in_category > 0 ) %]Cannot delete: category [% categorycode |html %] in use[% ELSE %]Confirm deletion of category '[% categorycode |html %]'[% END %][% END %]
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% INCLUDE 'calendar.inc' %]
8 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
9 [% INCLUDE 'datatables.inc' %]
10 <script type="text/javascript" id="js">
12 $(document).ready(function() {
13 $("#table_categorie").dataTable($.extend(true, {}, dataTablesDefaults, {
15 { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
16 { "aTargets": [ 3,4,5 ], "sType": "natural" },
18 "aaSorting": [[ 1, "asc" ]],
19 "sPaginationType": "four_button"
22 $( "#enrolmentperioddate" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
24 if ( $("#branches option:selected").length < 1 ) {
25 $("#branches option:first").attr("selected", "selected");
28 function isNotNull(f,noalert) {
29 if (f.value.length ==0) {
35 function isNum(v,maybenull) {
36 var n = new Number(v.value);
40 if (maybenull==0 && v.value=='') {
45 // to check if the data are correctly entered.
48 var _alertString=_("Form not submitted because of the following problem(s)");
49 _alertString +="\n-------------------------------------------------------------------\n\n";
50 ff.categorycode.value = $.trim(ff.categorycode.value);
51 if (ff.categorycode.value.length==0) {
53 _alertString += _("- categorycode missing") + "\n";
56 var patt=/^[a-zA-Z0-9\-_]+$/g;
57 if ( !patt.test(ff.categorycode.value) ) {
59 _alertString += _("- category code can only contain the following characters: letters, numbers, - and _") + "\n";
62 if (!(ff.category_type.value)){
64 _alertString += _("- category type missing") + "\n";
66 if (!(isNotNull(ff.description,1))) {
68 _alertString += _("- description missing") + "\n";
70 if (!isNum(ff.upperagelimit,0) && ff.category_type.value=='C') {
72 _alertString += _("- upperagelimit is not a number") + "\n";
75 if(!(ff.enrolmentperioddate.value || ff.enrolmentperiod.value)) {
77 _alertString += _("- either Enrollment period or Until date must be provided") + "\n";
79 if(ff.enrolmentperioddate.value && ff.enrolmentperiod.value){
80 document.getElementById('enrolmentmessage').className = "error";
84 if (ok) { // if there is a problem
93 <style type="text/css">#enrolmentmessage.hint { display : none; }</style>
95 <body id="admin_categorie" class="admin">
96 [% INCLUDE 'header.inc' %]
97 [% INCLUDE 'patrons-admin-search.inc' %]
99 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › [% IF ( add_form ) %] <a href="/cgi-bin/koha/admin/categorie.pl">Patron categories</a> › [% IF ( categorycode ) %]Modify category '[% categorycode |html %]'[% ELSE %]New category[% END %][% END %]
100 [% IF ( delete_confirm ) %] <a href="/cgi-bin/koha/admin/categorie.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 %]
101 [% IF ( delete_confirmed ) %] <a href="/cgi-bin/koha/admin/categorie.pl">Patron categories</a> › Category deleted[% END %]
102 [% IF ( else ) %]Patron categories[% END %]</div>
104 <div id="doc3" class="yui-t2">
110 [% FOR m IN messages %]
111 <div class="dialog [% m.type %]">
113 [% CASE 'error_on_insert' %]
114 An error occurred when inserting this patron category. The patron category might already exist.
115 [% CASE 'error_on_delete' %]
116 An error occurred when deleting this patron category. Check the logs.
117 [% CASE 'success_on_insert' %]
118 Patron category added successfully
119 [% CASE 'success_on_delete' %]
120 Patron category deleted successfully.
127 [% IF ( add_form ) %]
128 <form name="Aform" action="[% script_name %]" method="post">
129 <input type="hidden" name="op" value="add_validate" />
130 <input type="hidden" name="checked" value="0" />
131 [% IF ( categorycode ) %]
132 <h1>Modify category [% categorycode |html %]</h1>
134 <h1>New category</h1>
136 <fieldset class="rows">
137 <ol>[% IF ( categorycode ) %]
138 <li><span class="label">Category code: </span>[% categorycode |html %]
139 <input type="hidden" name="categorycode" value="[% categorycode |html %]" /><input type="hidden" name="is_a_modif" value="1" /></li>
142 <label for="categorycode" class="required">Category code: </label>
143 <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" onblur="toUC(this)" />
144 <span class="required">Required</span>
148 <label for="description" class="required">Description: </label>
149 <input type="text" name="description" id="description" size="40" maxlength="80" value="[% description |html %]" />
150 <span class="required">Required</span>
152 <li><label for="enrolmentperiod" class="required">Enrollment period: </label>
154 <legend>Choose one</legend>
156 <li><label for="enrolmentperiod" style="width:6em;">In months: </label>
157 <input type="text" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% IF ( enrolmentperiod ) %][% enrolmentperiod %][% END %]" /> months</li>
158 <li><label for="enrolmentperioddate" style="width:6em;">Until date: </label>
159 <input type="text" name="enrolmentperioddate" id="enrolmentperioddate" value="[% enrolmentperioddate | $KohaDates %]" />
160 <div id="enrolmentmessage" class="hint" style="margin-left:0;">Cannot have "months" and "until date" at the same time</div>
165 <li><label for="dateofbirthrequired">Age required: </label> <input type="text" name="dateofbirthrequired" id="dateofbirthrequired" value="[% dateofbirthrequired %]" size="3" maxlength="3" /> years</li>
166 <li><label for="upperagelimit">Upperage limit: </label> <input type="text" name="upperagelimit" id="upperagelimit" size="3" maxlength="3" value="[% upperagelimit %]" /> years</li>
167 <li><label for="enrolmentfee">Enrollment fee: </label><input type="text" name="enrolmentfee" id="enrolmentfee" size="6" value="[% enrolmentfee %]" /></li>
168 <li><label for="overduenoticerequired">Overdue notice required: </label> <select name="overduenoticerequired" id="overduenoticerequired">
169 [% IF ( overduenoticerequired ) %]
170 <option value="0">No</option>
171 <option value="1" selected="selected">Yes</option>
173 <option value="0" selected="selected">No</option>
174 <option value="1">Yes</option>
177 <li><label for="hidelostitems">Lost items in staff client: </label> <select name="hidelostitems" id="hidelostitems">
178 [% IF ( hidelostitems ) %]
179 <option value="0">Shown</option>
180 <option value="1" selected="selected">Hidden by default</option>
182 <option value="0" selected="selected">Shown</option>
183 <option value="1">Hidden by default</option>
186 <li><label for="reservefee">Hold fee: </label><input type="text" name="reservefee" id="reservefee" size="6" value="[% reservefee %]" /></li>
188 <label for="category_type" class="required">Category type: </label>
189 <select name="category_type" id="category_type">
190 [% IF ( type_n ) %]<option value="" selected="selected">Select a category type</option>[% ELSE %]<option value="">Select a category type</option>[% END %]
191 [% IF ( type_A ) %]<option value="A" selected="selected">Adult</option>[% ELSE %]<option value="A">Adult</option>[% END %]
192 [% IF ( type_C ) %]<option value="C" selected="selected">Child</option>[% ELSE %]<option value="C">Child</option>[% END %]
193 [% IF ( type_S ) %]<option value="S" selected="selected">Staff</option>[% ELSE %]<option value="S">Staff</option>[% END %]
194 [% IF ( type_I ) %]<option value="I" selected="selected">Organization</option>[% ELSE %]<option value="I">Organization</option>[% END %]
195 [% IF ( type_P ) %]<option value="P" selected="selected">Professional</option>[% ELSE %]<option value="P">Professional</option>[% END %]
196 [% IF ( type_X ) %]<option value="X" selected="selected">Statistical</option>[% ELSE %]<option value="X">Statistical</option>[% END %]
198 <span class="required">Required</span>
200 <li><label for="branches">Branches limitation: </label>
201 <select id="branches" name="branches" multiple size="10">
202 <option value="">All branches</option>
203 [% FOREACH branch IN branches_loop %]
204 [% IF ( branch.selected ) %]
205 <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
207 <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
211 <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.
214 <li><label for="block_expired">Block expired patrons</label>
215 <select name="block_expired" id="block_expired">
216 [% IF ( BlockExpiredPatronOpacActions == -1 ) %]
217 <option value="-1" selected="selected"> Follow system preference BlockExpiredPatronOpacActions </option>
219 <option value="-1"> Follow system preference BlockExpiredPatronOpacActions </option>
222 [% IF ( BlockExpiredPatronOpacActions == 1 ) %]
223 <option value="1" selected="selected"> Block </option>
225 <option value="1"> Block </option>
228 [% IF ( BlockExpiredPatronOpacActions == 0 ) %]
229 <option value="0" selected="selected"> Don't block </option>
231 <option value="0"> Don't block </option>
235 Choose whether patrons of this category be blocked from public catalog actions such as renewing and placing holds when their cards have expired.
239 <label for="default_privacy">Default privacy: </label>
240 <select id="default_privacy" name="default_privacy">
241 [% SWITCH default_privacy %]
243 <option value="default">Default</option>
244 <option value="never">Never</option>
245 <option value="forever" selected="selected">Forever</option>
247 <option value="default">Default</option>
248 <option value="never" selected="selected">Never</option>
249 <option value="forever">Forever</option>
251 <option value="default" selected="selected">Default</option>
252 <option value="never">Never</option>
253 <option value="forever">Forever</option>
256 <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>
261 [% IF ( EnhancedMessagingPreferences ) %]
262 <fieldset class="rows">
263 <h4>Default messaging preferences for this patron category</h4>
264 [% INCLUDE 'messaging-preference-form.inc' %]
267 <fieldset class="action"><input type="button" value="Save" onclick="Check(this.form);" /> </fieldset>
272 [% IF ( delete_confirm ) %]
273 <form action="[% script_name %]" method="post">
276 [% IF ( patrons_in_category > 0 ) %]
277 Category [% categorycode |html %] is in use. Deletion not possible!
279 Confirm deletion of category [% categorycode |html %]
283 [% IF ( totalgtzero ) %]<div class="dialog alert"><strong>This category is used [% total %] times</strong>. Deletion not possible</div>[% END %]
285 <tr><th scope="row">Category code: </th><td>[% categorycode |html %]</td></tr>
286 <tr><th scope="row">Description: </th><td>[% description |html %]</td></tr>
287 <tr><th scope="row">Enrollment period: </th>
289 [% IF ( enrolmentperiod ) %]
290 [% enrolmentperiod %] months
292 until [% enrolmentperioddate | $KohaDates %]
296 <tr><th scope="row">Age required: </th><td>[% dateofbirthrequired %] years</td></tr>
297 <tr><th scope="row">Upperage limit: </th><td>[% upperagelimit %] years</td></tr>
298 <tr><th scope="row">Enrollment fee: </th><td>[% enrolmentfee %]</td></tr>
299 <tr><th scope="row">Receives overdue notices: </th><td>[% IF ( overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td></tr>
300 <tr><th scope="row">Lost items in staff client</th><td>[% IF ( hidelostitems ) %]Hidden by default[% ELSE %]Shown[% END %]</td></tr>
301 <tr><th scope="row">Hold fee: </th><td>[% reservefee %]</td></tr>
303 <th scope="row">Default privacy: </th>
305 [% SWITCH category.default_privacy %]
316 <fieldset class="action">[% IF ( totalgtzero ) %]
317 <input type="submit" value="OK" /></form>
319 <input type="hidden" name="op" value="delete_confirmed" />
320 <input type="hidden" name="categorycode" value="[% categorycode |html %]" /> <input type="submit" value="Delete this category" /> <a class="cancel" href="/cgi-bin/koha/admin/categorie.pl">Cancel</a>
321 [% END %]</fieldset></fieldset></form>
326 <div id="toolbar" class="btn-toolbar">
327 <a class="btn btn-small" id="newcategory" href="/cgi-bin/koha/admin/categorie.pl?op=add_form"><i class="fa fa-plus"></i> New category</a>
330 <h2>Patron category administration</h2>
331 [% IF ( searchfield ) %]
332 You Searched for [% searchfield %]</span>
335 <div id="pagertable_categorie">
337 <table id="table_categorie">
340 <th scope="col">Code</th>
341 <th scope="col">Category name</th>
342 <th scope="col">Type</th>
343 <th scope="col">Enrollment period</th>
344 <th scope="col">Age required</th>
345 <th scope="col">Upper age limit</th>
346 <th scope="col">Enrollment fee</th>
347 <th scope="col">Overdue</th>
348 <th scope="col">Lost items</th>
349 <th scope="col">Hold fee</th>
350 [% IF ( EnhancedMessagingPreferences ) %]
351 <th scope="col">Messaging</th>
353 <th scope="col">Branches limitations</th>
354 <th scope="col">Default privacy</th>
355 <th scope="col"> </th>
356 <th scope="col"> </th>
360 [% FOREACH loo IN loop %]
362 <td>[% loo.categorycode |html %]</td>
364 <a href="[% loo.script_name %]?op=add_form&categorycode=[% loo.categorycode |uri %]">[% loo.description |html %]</a>
367 [% IF ( loo.type_A ) %]Adult[% END %]
368 [% IF ( loo.type_C ) %]Child[% END %]
369 [% IF ( loo.type_P ) %]Prof.[% END %]
370 [% IF ( loo.type_I ) %]Org.[% END %]
371 [% IF ( loo.type_S ) %]Staff[% END %]
372 [% IF ( loo.type_X ) %]Statistical[% END %]
375 [% IF ( loo.enrolmentperiod ) %]
376 [% loo.enrolmentperiod %] months
378 until [% loo.enrolmentperioddate | $KohaDates %]
382 <td>[% loo.dateofbirthrequired %] years</td>
383 <td>[% loo.upperagelimit %] years</td>
384 <td>[% loo.enrolmentfee %]</td>
385 <td>[% IF ( loo.overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td>
386 <td>[% IF ( loo.hidelostitems ) %]Hidden[% ELSE %]Shown[% END %]</td>
387 <td>[% loo.reservefee %]</td>
388 [% IF ( EnhancedMessagingPreferences ) %]
389 <td style="white-space: nowrap; font-size:80%;">
390 [% IF ( loo.messaging_prefs ) %]
391 [% FOREACH prefs IN loo.messaging_prefs %]
392 [% FOREACH transport IN prefs.transports %]
393 [% IF ( transport.transport ) %]
394 [% IF ( prefs.Item_Due ) %]Item due
395 [% ELSIF ( prefs.Advance_Notice ) %]Advance notice
396 [% ELSIF ( prefs.Upcoming_Events ) %]Upcoming events
397 [% ELSIF ( prefs.Hold_Filled ) %]Hold filled
398 [% ELSIF ( prefs.Item_Check_in ) %]Item check-in
399 [% ELSIF ( prefs.Item_Checkout ) %]Item checkout
402 <strong>[% transport.transport %]</strong><br />
403 [% ELSE %]None<br />[% END %]
412 [% IF loo.branches.size > 0 %]
413 [% branches_str = "" %]
414 [% FOREACH branch IN loo.branches %]
415 [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
417 <span title="[% branches_str %]">
418 [% IF loo.branches.size > 1 %]
419 [% loo.branches.size %] branches limitations
421 [% loo.branches.size %] branch limitation
429 [% SWITCH loo.default_privacy %]
438 <td><a href="[% loo.script_name %]?op=add_form&categorycode=[% loo.categorycode |uri %]">Edit</a></td>
439 <td><a href="[% loo.script_name %]?op=delete_confirm&categorycode=[% loo.categorycode |uri %]">Delete</a></td>
445 <div class="dialog alert">No categories have been defined. <a href="/cgi-bin/koha/admin/categorie.pl?op=add_form">Create a new category</a>.</div>
452 [% INCLUDE 'admin-menu.inc' %]
455 [% INCLUDE 'intranet-bottom.inc' %]