Bug 32910: (follow-up) Replace v4 icon names with v6
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / categories.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE Branches %]
5 [% USE KohaDates %]
6 [% USE Price %]
7 [% USE TablesSettings %]
8 [% SET footerjs = 1 %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>[% FILTER collapse %]
11     [% IF op == 'add_form' %]
12         [% IF ( categorycode ) %]
13             Modify category '[% categorycode | html %]'
14         [% ELSE %]
15             New category
16         [% END %]
17         &rsaquo;
18     [% END %]
19     [% IF op == 'delete_confirm' %]
20         [% IF ( patrons_in_category > 0 ) %]
21             Cannot delete: category [% categorycode | html %] in use
22         [% ELSE %]
23             Confirm deletion of category '[% categorycode | html %]'
24         [% END %]
25         &rsaquo;
26     [% END %]
27     Patron categories &rsaquo; Administration &rsaquo; Koha
28 [% END %]</title>
29 [% INCLUDE 'doc-head-close.inc' %]
30 <style>#enrolmentmessage.hint { display : none; }</style>
31 </head>
32
33 <body id="admin_categorie" class="admin">
34 [% WRAPPER 'header.inc' %]
35     [% INCLUDE 'patrons-admin-search.inc' %]
36 [% END %]
37
38 [% WRAPPER 'sub-header.inc' %]
39     [% WRAPPER breadcrumbs %]
40         [% WRAPPER breadcrumb_item %]
41             <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
42         [% END %]
43
44         [% IF op == 'add_form' || op == 'delete_confirm' || op == 'delete_confirmed' %]
45             [% WRAPPER breadcrumb_item %]
46                 <a href="/cgi-bin/koha/admin/categories.pl">Patron categories</a>
47             [% END %]
48         [% ELSE %]
49             [% WRAPPER breadcrumb_item bc_active= 1 %]
50                 <span>Patron categories</span>
51             [% END %]
52         [% END %]
53
54         [% IF op == 'add_form' %]
55             [% IF ( categorycode ) %]
56                 [% WRAPPER breadcrumb_item bc_active= 1 %]
57                     <span>Modify category '[% categorycode | html %]'</span>
58                 [% END %]
59             [% ELSE %]
60                 [% WRAPPER breadcrumb_item bc_active= 1 %]
61                     <span>New category</span>
62                 [% END %]
63             [% END %]
64         [% END %]
65
66         [% IF op == 'delete_confirm' %]
67             [% IF ( patrons_in_category > 0 ) %]
68                 [% WRAPPER breadcrumb_item bc_active= 1 %]
69                     <span>Cannot delete: Category [% categorycode | html %] in use</span>
70                 [% END %]
71             [% ELSE %]
72                 [% WRAPPER breadcrumb_item bc_active= 1 %]
73                     <span>Confirm deletion of category '[% categorycode | html %]'</span>
74                 [% END %]
75             [% END %]
76         [% END %]
77
78         [% IF op == 'delete_confirmed' %]
79             [% WRAPPER breadcrumb_item bc_active= 1 %]
80                 <span>Category deleted</span>
81             [% END %]
82         [% END %]
83     [% END #/ WRAPPER breadcrumbs %]
84 [% END #/ WRAPPER sub-header.inc %]
85
86 <div class="main container-fluid">
87     <div class="row">
88         <div class="col-sm-10 col-sm-push-2">
89             <main>
90
91 [% FOR m IN messages %]
92     <div class="dialog [% m.type | html %]">
93         [% SWITCH m.code %]
94         [% CASE 'error_on_update' %]
95             <span>An error occurred when updating this patron category. Perhaps it already exists.</span>
96         [% CASE 'error_on_insert' %]
97             <span>An error occurred when inserting this patron category. The patron category might already exist.</span>
98         [% CASE 'error_on_delete' %]
99             <span>An error occurred when deleting this patron category. Check the logs.</span>
100         [% CASE 'success_on_update' %]
101             <span>Patron category updated successfully.</span>
102         [% CASE 'success_on_insert' %]
103             <span>Patron category inserted successfully.</span>
104         [% CASE 'success_on_delete' %]
105             <span>Patron category deleted successfully.</span>
106         [% CASE 'already_exists' %]
107             <span>This patron category already exists.</span>
108         [% CASE %]
109             <span>[% m.code | html %]</span>
110         [% END %]
111     </div>
112 [% END %]
113
114 [% IF op == 'add_form' %]
115     <form id="category_form" action="/cgi-bin/koha/admin/categories.pl" method="post">
116         <input type="hidden" name="op" value="add_validate" />
117         <input type="hidden" name="checked" value="0" />
118         [% IF category %]
119             <h1>Modify category [% categorycode | html %]</h1>
120         [% ELSE %]
121             <h1>New category</h1>
122         [% END %]
123         <fieldset class="rows">
124             <ol>
125                 [% IF category %]
126                     <li>
127                         <span class="label">Category code: </span>[% categorycode | html %]
128                         <input type="hidden" name="categorycode" value="[% category.categorycode | html %]" /><input type="hidden" name="is_a_modif" value="1" />
129                     </li>
130                 [% ELSE %]
131                     <li>
132                         <label for="categorycode" class="required">Category code: </label>
133                         <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" class="required focus" required="required" />
134                         <span class="required">Required</span>
135                     </li>
136                 [% END %]
137                 <li>
138                     <label for="description" class="required">Description: </label>
139                     <input type="text" name="description" id="description" size="40" maxlength="80" class="required" required="required" value="[% category.description | html %]" />
140                     <span class="required">Required</span>
141                 </li>
142                 <li>
143                     <span class="label">Enrollment period: </span>
144                     <fieldset>
145                         <legend>Choose one</legend>
146                         <ol>
147                             <li>
148                                 <label for="enrolmentperiod">In months: </label>
149                                 [% IF category.enrolmentperiod %]
150                                     <input type="text" class="enrollmentperiod" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% category.enrolmentperiod | html %]" /> months
151                                [% ELSE %]
152                                     <input type="text" class="enrollmentperiod" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="" /> months
153                                [% END %]
154                             </li>
155                             <li>
156                                 <label for="enrolmentperioddate">Until date: </label>
157                                 <input type="text" class="enrollmentperiod flatpickr" data-flatpickr-futuredate="true" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | html %]" />
158                             </li>
159                         </ol>
160                     </fieldset>
161                 </li>
162                 <li>
163                     <label for="password_expiry_days">Password expiration: </label>
164                     <input type="text" name="password_expiry_days" id="password_expiry_days" value="[% category.password_expiry_days | html %]" size="3" maxlength="5" /> days
165                 </li>
166                 <li>
167                     <label for="dateofbirthrequired">Age required: </label>
168                     <input type="text" name="dateofbirthrequired" id="dateofbirthrequired" value="[% category.dateofbirthrequired | html %]" size="3" maxlength="3" /> years
169                 </li>
170                 <li>
171                     <label for="upperagelimit">Upperage limit: </label>
172                     <input type="text" name="upperagelimit" id="upperagelimit" size="3" maxlength="3" value="[% category.upperagelimit | html %]" /> years
173                 </li>
174                 <li>
175                     <label for="enrolmentfee">Enrollment fee: </label>
176                     <input type="text" name="enrolmentfee" id="enrolmentfee" size="6" value="[% category.enrolmentfee | $Price on_editing => 1 %]" />
177                 </li>
178                 <li>
179                     <label for="overduenoticerequired">Overdue notice required: </label>
180                     <select name="overduenoticerequired" id="overduenoticerequired">
181                         [% IF category.overduenoticerequired %]
182                             <option value="0">No</option>
183                             <option value="1" selected="selected">Yes</option>
184                         [% ELSE %]
185                             <option value="0" selected="selected">No</option>
186                             <option value="1">Yes</option>
187                         [% END %]
188                     </select>
189                 </li>
190                 <li>
191                     <label for="hidelostitems">Lost items in staff interface: </label>
192                     <select name="hidelostitems" id="hidelostitems">
193                         [% IF category.hidelostitems %]
194                             <option value="0">Shown</option>
195                             <option value="1" selected="selected">Hidden by default</option>
196                         [% ELSE %]
197                             <option value="0" selected="selected">Shown</option>
198                             <option value="1">Hidden by default</option>
199                         [% END %]
200                     </select>
201                 </li>
202                 <li>
203                     <label for="reservefee">Hold fee: </label>
204                     <input type="text" name="reservefee" id="reservefee" size="6" value="[% category.reservefee | $Price on_editing => 1 %]" />
205                 </li>
206                 <li>
207                     <label for="category_type" class="required">Category type: </label>
208                     <select name="category_type" id="category_type">
209                         [% UNLESS category %]<option value="" selected="selected">Select a category type</option>[% ELSE %]<option value="">Select a category type</option>[% END %]
210                         [% IF category and category.category_type == 'A' %]<option value="A" selected="selected">Adult</option>[% ELSE %]<option value="A">Adult</option>[% END %]
211                         [% IF category and category.category_type == 'C' %]<option value="C" selected="selected">Child</option>[% ELSE %]<option value="C">Child</option>[% END %]
212                         [% IF category and category.category_type == 'S' %]<option value="S" selected="selected">Staff</option>[% ELSE %]<option value="S">Staff</option>[% END %]
213                         [% IF category and category.category_type == 'I' %]<option value="I" selected="selected">Organization</option>[% ELSE %]<option value="I">Organization</option>[% END %]
214                         [% IF category and category.category_type == 'P' %]<option value="P" selected="selected">Professional</option>[% ELSE %]<option value="P">Professional</option>[% END %]
215                         [% IF category and category.category_type == 'X' %]<option value="X" selected="selected">Statistical</option>[% ELSE %]<option value="X">Statistical</option>[% END %]
216                     </select>
217                     <span class="required">Required</span>
218                 </li>
219                 <li>
220                     <label for="can_be_guarantee">Can be guarantee</label>
221                     <select name="can_be_guarantee" id="can_be_guarantee">
222                         [% IF category.can_be_guarantee %]
223                             <option value="1" selected>Yes</option>
224                             <option value="0">No</option>
225                         [% ELSE %]
226                             <option value="1">Yes</option>
227                             <option value="0" selected>No</option>
228                         [% END %]
229                     <select>
230                 </li>
231                 <li><label for="branches">Library limitations: </label>
232                     <select id="branches" name="branches" multiple size="10">
233                         <option value="">All libraries</option>
234                         [% PROCESS options_for_libraries libraries => Branches.all( selected => category.get_library_limits, unfiltered => 1, do_not_select_my_library => 1 ) %]
235                     </select>
236                     <div class="hint">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.
237                     </div>
238                 </li>
239                 <li>
240                     <label for="reset_password">Password reset in OPAC: </label>
241                     <select name="reset_password" id="reset_password">
242                       [% IF category.reset_password.defined %]
243                         [% IF category.reset_password %]
244                           [% IF Koha.Preference('OpacResetPassword') %]
245                             <option value="-1">Follow system preference OpacResetPassword (enabled)</option>
246                           [% ELSE %]
247                             <option value="-1">Follow system preference OpacResetPassword (disabled)</option>
248                           [% END %]
249                             <option value="1" selected="selected">Allowed</option>
250                             <option value="0">Not allowed</option>
251                         [% ELSE %]
252                           [% IF Koha.Preference('OpacResetPassword') %]
253                             <option value="-1">Follow system preference OpacResetPassword (enabled)</option>
254                           [% ELSE %]
255                             <option value="-1">Follow system preference OpacResetPassword (disabled)</option>
256                           [% END %]
257                             <option value="1">Allowed</option>
258                             <option value="0" selected="selected">Not allowed</option>
259                         [% END %]
260                       [% ELSE %]
261                           [% IF Koha.Preference('OpacResetPassword') %]
262                             <option value="-1" selected="selected">Follow system preference OpacResetPassword (enabled)</option>
263                           [% ELSE %]
264                             <option value="-1" selected="selected">Follow system preference OpacResetPassword (disabled)</option>
265                           [% END %]
266                             <option value="1">Allowed</option>
267                             <option value="0">Not allowed</option>
268                       [% END %]
269                     </select>
270                 </li>
271                 <li>
272                     <label for="change_password">Password change in OPAC: </label>
273                     <select name="change_password" id="change_password">
274                       [% IF category.change_password.defined %]
275                         [% IF category.change_password %]
276                           [% IF Koha.Preference('OpacPasswordChange') %]
277                             <option value="-1">Follow system preference OpacPasswordChange (enabled)</option>
278                           [% ELSE %]
279                             <option value="-1">Follow system preference OpacPasswordChange (disabled)</option>
280                           [% END %]
281                             <option value="1" selected="selected">Allowed</option>
282                             <option value="0">Not allowed</option>
283                         [% ELSE %]
284                           [% IF Koha.Preference('OpacPasswordChange') %]
285                             <option value="-1">Follow system preference OpacPasswordChange (enabled)</option>
286                           [% ELSE %]
287                             <option value="-1">Follow system preference OpacPasswordChange (disabled)</option>
288                           [% END %]
289                             <option value="1">Allowed</option>
290                             <option value="0" selected="selected">Not allowed</option>
291                         [% END %]
292                       [% ELSE %]
293                           [% IF Koha.Preference('OpacPasswordChange') %]
294                             <option value="-1" selected="selected">Follow system preference OpacPasswordChange (enabled)</option>
295                           [% ELSE %]
296                             <option value="-1" selected="selected">Follow system preference OpacPasswordChange (disabled)</option>
297                           [% END %]
298                             <option value="1">Allowed</option>
299                             <option value="0">Not allowed</option>
300                       [% END %]
301                     </select>
302                 </li>
303                 <li>
304                     <label for="min_password_length">Minimum password length:</label>
305                     <input id="min_password_length" type="text" inputmode="numeric" name="min_password_length" value="[% category.min_password_length | html %]"/>
306                     <div class="hint">Leave blank to use system default ([% Koha.Preference('minPasswordLength') | html %])</div>
307                 </li>
308                 <li class="pwd_setting_wrapper">
309                     <label for="require_strong_password">Require strong password:</label>
310                     <select id="require_strong_password" name="require_strong_password">
311                     [% IF category.require_strong_password.defined %]
312                         [% IF category.require_strong_password %]
313                           [% IF Koha.Preference('RequireStrongPassword') %]
314                             <option value="-1">Follow system preference RequireStrongPassword (yes)</option>
315                           [% ELSE %]
316                             <option value="-1">Follow system preference RequireStrongPassword (no)</option>
317                           [% END %]
318                             <option value="1" selected="selected">Yes</option>
319                             <option value="0">No</option>
320                         [% ELSE %]
321                           [% IF Koha.Preference('RequireStrongPassword') %]
322                             <option value="-1">Follow system preference RequireStrongPassword (yes)</option>
323                           [% ELSE %]
324                             <option value="-1">Follow system preference RequireStrongPassword (no)</option>
325                           [% END %]
326                             <option value="1">Yes</option>
327                             <option value="0" selected="selected">No</option>
328                         [% END %]
329                       [% ELSE %]
330                           [% IF Koha.Preference('RequireStrongPassword') %]
331                             <option value="-1">Follow system preference RequireStrongPassword (yes)</option>
332                           [% ELSE %]
333                             <option value="-1">Follow system preference RequireStrongPassword (no)</option>
334                           [% END %]
335                             <option value="1">Yes</option>
336                             <option value="0">No</option>
337                       [% END %]
338                     </select>
339                 </li>
340                 <li><label for="block_expired">Block expired patrons:</label>
341                     <select name="BlockExpiredPatronOpacActions" id="block_expired">
342                         [% IF not category or category.BlockExpiredPatronOpacActions == -1%]
343                             <option value="-1" selected="selected"> Follow system preference BlockExpiredPatronOpacActions </option>
344                         [% ELSE %]
345                             <option value="-1"> Follow system preference BlockExpiredPatronOpacActions </option>
346                         [% END %]
347
348                         [% IF category and category.BlockExpiredPatronOpacActions == 1 %]
349                             <option value="1" selected="selected"> Block </option>
350                         [% ELSE %]
351                             <option value="1"> Block </option>
352                         [% END %]
353
354                         [% IF category and category.BlockExpiredPatronOpacActions == 0 %]
355                             <option value="0" selected="selected"> Don't block </option>
356                         [% ELSE %]
357                             <option value="0"> Don't block </option>
358                         [% END %]
359                     </select>
360                     <div class="hint">
361                         Choose whether patrons of this category be blocked from public catalog actions such as renewing and placing holds when their cards have expired.
362                     </div>
363                 </li>
364                 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' )  %]
365                   <li><label for="checkprevcheckout">Check for previous checkouts: </label>
366                       <select name="checkprevcheckout" id="checkprevcheckout">
367                           [% IF category.checkprevcheckout == 'yes' %]
368                           <option value="yes" selected="selected">Yes and try to override system preferences</option>
369                           <option value="no">No and try to override system preferences</option>
370                           <option value="inherit">Inherit from system preferences</option>
371                           [% ELSIF category.checkprevcheckout == 'no' %]
372                           <option value="yes">Yes and try to override system preferences</option>
373                           <option value="no" selected="selected">No and try to override system preferences</option>
374                           <option value="inherit">Inherit from system preferences</option>
375                           [% ELSE %]
376                           <option value="yes">Yes and try to override system preferences</option>
377                           <option value="no">No and try to override system preferences</option>
378                           <option value="inherit" selected="selected">Inherit from system preferences</option>
379                           [% END %]
380                       </select>
381                       <div class="hint">
382                           Choose whether patrons of this category by default are reminded if they try to borrow an item they borrowed before.
383                       </div>
384                   </li>
385                 [% END %]
386                 <li>
387                     <label for="default_privacy">Default privacy: </label>
388                     <select id="default_privacy" name="default_privacy">
389                         [% SET default_privacy = 'default' %]
390                         [% IF category %][% SET default_privacy = category.default_privacy %][% END %]
391                         [% SWITCH default_privacy %]
392                         [% CASE 'forever' %]
393                             <option value="default">Default</option>
394                             <option value="never">Never</option>
395                             <option value="forever" selected="selected">Forever</option>
396                         [% CASE 'never' %]
397                             <option value="default">Default</option>
398                             <option value="never" selected="selected">Never</option>
399                             <option value="forever">Forever</option>
400                         [% CASE %]
401                             <option value="default" selected="selected">Default</option>
402                             <option value="never">Never</option>
403                             <option value="forever">Forever</option>
404                         [% END %]
405                     </select>
406                     <div class="hint">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.</div>
407                 </li>
408                 <li>
409                     <label for="exclude_from_local_holds_priority">Exclude from local holds priority:</label>
410                     <select id="exclude_from_local_holds_priority" name="exclude_from_local_holds_priority">
411                     [% IF category.exclude_from_local_holds_priority %]
412                         <option value="1" selected>Yes</option>
413                         <option value="0">No</option>
414                     [% ELSE %]
415                         <option value="1">Yes</option>
416                         <option value="0" selected>No</option>
417                     [% END %]
418                     </select>
419                     <div class="hint">If <i>Yes</i>, holds placed by patrons of this category will not be given priority</div>
420                 </li>
421             </ol>
422         </fieldset>
423
424         [% IF ( EnhancedMessagingPreferences ) %]
425             <fieldset class="rows">
426                 <legend>Default messaging preferences for this patron category</legend>
427                 [% INCLUDE 'messaging-preference-form.inc' %]
428             </fieldset>
429         [% END %]
430         <fieldset class="action">
431             <input type="submit" class="btn btn-primary" value="Save" />
432             <a href="/cgi-bin/koha/admin/categories.pl" class="cancel">Cancel</a>
433         </fieldset>
434     </form>
435 [% END %]
436
437 [% IF op == 'delete_confirm' %]
438     <form action="/cgi-bin/koha/admin/categories.pl" method="post">
439         <fieldset>
440             <legend>
441                 <h1>
442                     [% IF patrons_in_category > 0 %]
443                         <span>Category [% categorycode | html %] is in use. Deletion not possible!</span>
444                     [% ELSE %]
445                         <span>Confirm deletion of category [% categorycode | html %]</span>
446                     [% END %]
447             </h1>
448             </legend>
449
450             [% IF patrons_in_category > 0  %]
451                 <div class="dialog alert">
452                     <strong>This category is used [% patrons_in_category | html %] times</strong>. Deletion not possible
453                 </div>
454             [% END %]
455             <table>
456                 <tr><th scope="row">Category code: </th><td>[% category.categorycode | html %]</td></tr>
457                 <tr><th scope="row">Description: </th><td>[% category.description | html %]</td></tr>
458                 <tr><th scope="row">Enrollment period: </th>
459                     <td>
460                         [% IF category.enrolmentperiod %]
461                             [% category.enrolmentperiod | html %] months
462                         [% ELSE %]
463                             until [% category.enrolmentperioddate | $KohaDates %]
464                         [% END %]
465                     </td>
466                 </tr>
467                 <tr><th scope="row">Password expiration: </th><td>[% category.password_expiry_days | html %] days</td></tr>
468                 <tr><th scope="row">Age required: </th><td>[% category.dateofbirthrequired | html %] years</td></tr>
469                 <tr><th scope="row">Upperage limit: </th><td>[% category.upperagelimit | html %] years</td></tr>
470                 <tr><th scope="row">Enrollment fee: </th><td>[% category.enrolmentfee | $Price %]</td></tr>
471                 <tr><th scope="row">Receives overdue notices: </th><td>[% IF category. overduenoticerequired %]Yes[% ELSE %]No[% END %]</td></tr>
472                 <tr><th scope="row">Lost items in staff interface</th><td>[% IF category.hidelostitems %]Hidden by default[% ELSE %]Shown[% END %]</td></tr>
473                 <tr><th scope="row">Hold fee: </th><td>[% category.reservefee | $Price %]</td></tr>
474
475                 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
476                   <tr>
477                       <th scope="row">Check previous checkouts: </th>
478                       <td>
479                           [% SWITCH category.checkprevcheckout %]
480                           [% CASE 'yes' %]
481                               <span>Yes</span>
482                           [% CASE 'no' %]
483                               <span>No</span>
484                           [% CASE 'inherit' %]
485                               <span>Inherit</span>
486                           [% END %]
487                       </td>
488                   </tr>
489                 [% END %]
490                 <tr><th scope="row">Can be guarantee</th><td>[% IF category.can_be_guarantee %]Yes[% ELSE %]No[% END %]</td></tr>
491                 <tr>
492                     <th scope="row">Default privacy: </th>
493                     <td>
494                         [% SWITCH category.default_privacy %]
495                         [% CASE 'default' %]
496                             <span>Default</span>
497                         [% CASE 'never' %]
498                             <span>Never</span>
499                         [% CASE 'forever' %]
500                             <span>Forever</span>
501                         [% END %]
502                     </td>
503                 </tr>
504             </table>
505             <fieldset class="action">
506                 [% IF patrons_in_category > 0 %]
507                     <input type="submit" class="btn btn-primary" value="OK" />
508                 [% ELSE %]
509                     <input type="hidden" name="op" value="delete_confirmed" />
510                     <input type="hidden" name="categorycode" value="[% categorycode | html %]" />
511                     <input type="submit" class="btn btn-primary" value="Delete this category" />
512                     <a class="cancel" href="/cgi-bin/koha/admin/categories.pl">Cancel</a>
513                 [% END %]
514             </fieldset>
515         </fieldset>
516     </form>
517 [% END %]
518
519 [% IF op == 'list' %]
520
521     <div id="toolbar" class="btn-toolbar">
522         <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>
523     </div>
524
525     <h1>Patron categories</h1>
526     <div class="page-section">
527     [% IF searchfield %]
528         You searched for [% searchfield | html %]</span>
529     [% END %]
530     [% IF categories %]
531         <table id="patron_categories">
532             <thead>
533                 <tr>
534                     <th scope="col">Code</th>
535                     <th scope="col">Category name</th>
536                     <th scope="col">Type</th>
537                     <th scope="col">Enrollment period</th>
538                     <th scope="col">Password expiration</th>
539                     <th scope="col">Age required</th>
540                     <th scope="col">Upper age limit</th>
541                     <th scope="col">Enrollment fee</th>
542                     <th scope="col">Overdue</th>
543                     <th scope="col">Lost items</th>
544                     <th scope="col">Hold fee</th>
545                     [% IF ( EnhancedMessagingPreferences ) %]
546                     <th scope="col">Messaging</th>
547                     [% END %]
548                     <th scope="col">Library limitations</th>
549                     [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
550                     <th scope="col">Check previous checkout?</th>
551                     [% END %]
552                     <th scope="col">Can be guarantee</th>
553                     <th scope="col">Default privacy</th>
554                     <th scope="col">Exclude from local holds priority</th>
555                     <th scope="col">Actions</th>
556                 </tr>
557             </thead>
558             <tbody>
559                 [% FOREACH category IN categories %]
560                     <tr>
561                         <td>[% category.categorycode | html %]</td>
562                         <td>
563                             <a href="/cgi-bin/koha/admin/categories.pl?op=add_form&amp;categorycode=[% category.categorycode |uri %]">[% category.description | html %]</a>
564                         </td>
565                         <td>
566                             [% SWITCH category.category_type %]
567                                 [% CASE 'A' %]<span>Adult</span>
568                                 [% CASE 'C' %]<span>Child</span>
569                                 [% CASE 'P' %]<span>Prof.</span>
570                                 [% CASE 'I' %]<span>Org.</span>
571                                 [% CASE 'S' %]<span>Staff</span>
572                                 [% CASE 'X' %]<span>Statistical</span>
573                             [% END %]
574                         </td>
575                         <td>
576                             [% IF ( category.enrolmentperiod ) %]
577                                 [% category.enrolmentperiod | html %] months
578                             [% ELSE %]
579                                 until [% category.enrolmentperioddate | $KohaDates %]
580                             [% END %]
581                         </td>
582                         [% IF (category.password_expiry_days) %]
583                             <td>[% category.password_expiry_days | html %] days</td>
584                         [% ELSE %]
585                             <td>-</td>
586                         [% END %]
587                         [% IF (category.dateofbirthrequired) %]
588                             <td>[% category.dateofbirthrequired | html %] years</td>
589                         [% ELSE %]
590                             <td>-</td>
591                         [% END %]
592                         [% IF (category.upperagelimit) %]
593                             <td>[% category.upperagelimit | html %] years</td>
594                         [% ELSE %]
595                             <td>-</td>
596                         [% END %]
597                         [% IF (category.enrolmentfee > 0) %]
598                             <td>[% category.enrolmentfee | $Price %]</td>
599                         [% ELSE %]
600                             <td>-</td>
601                         [% END %]
602                         <td>[% IF ( category.overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td>
603                         <td>[% IF ( category.hidelostitems ) %]Hidden[% ELSE %]Shown[% END %]</td>
604                         [% IF (category.reservefee > 0) %]
605                             <td>[% category.reservefee | $Price %]</td>
606                         [% ELSE %]
607                             <td>-</td>
608                         [% END %]
609                         [% IF Koha.Preference('EnhancedMessagingPreferences') %]
610                             <td style="white-space: nowrap; font-size:80%;">
611                                 [% SET default_messaging = category.default_messaging %]
612                                 [% IF default_messaging.size %]
613                                     [% FOREACH prefs IN default_messaging %]
614                                         [% NEXT IF !Koha.Preference( 'ILLModule' ) && prefs.message_name.match('^Ill_') %]
615                                         [% FOREACH transport IN prefs.transports %]
616                                             [% IF ( transport.transport ) %]
617                                                 [% IF ( prefs.Item_Due ) %]<span>Item due</span>
618                                                 [% ELSIF ( prefs.Advance_Notice ) %]<span>Advance notice</span>
619                                                 [% ELSIF ( prefs.Hold_Filled ) %]<span>Hold filled</span>
620                                                 [% ELSIF ( prefs.Item_Check_in ) %]<span>Item check-in</span>
621                                                 [% ELSIF ( prefs.Item_Checkout ) %]<span>Item checkout</span>
622                                                 [% ELSIF ( prefs.Ill_ready ) %]<span>Interlibrary loan ready</span>
623                                                 [% ELSIF ( prefs.Ill_unavailable ) %]<span>Interlibrary loan unavailable</span>
624                                                 [% ELSIF ( prefs.Ill_update ) %]<span>Interlibrary loan updated</span>
625                                                 [% ELSIF ( prefs.Auto_Renewals ) %]<span>Auto renewal</span>
626                                                 [% ELSIF ( prefs.Hold_Reminder ) %]<span>Hold reminder</span>
627                                                 [% ELSE %]<span>Unknown</span>
628                                                 [% END %]:
629                                                 <strong>[% transport.transport | html %]</strong><br />
630                                             [% ELSE %]<span>None</span><br />[% END %]
631                                         [% END %]
632                                     [% END %]
633                                 [% ELSE %]
634                                     <span>None</span>
635                                 [% END %]
636                             </td>
637                         [% END %]
638                         <td>
639                             [% SET library_limits = category.library_limits %]
640                             [% IF library_limits.count > 0 %]
641                                 [% library_str = "" %]
642                                 [% FOREACH library IN library_limits %]
643                                     [%- IF loop.first -%]
644                                         [% library_str = library.branchname _ " (" _ library.branchcode _ ")" %]
645                                     [% ELSE %]
646                                         [% library_str = library_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %]
647                                     [% END %]
648                                 [% END %]
649                                 <span class="library_limitation" title="[% library_str | html %]">
650                                     [% IF library_limits.count > 1 %]
651                                         <span>[% library_limits.count | html %] library limitations</span>
652                                     [% ELSE %]
653                                         <span>[% library_limits.count | html %] library limitation</span>
654                                     [% END %]
655                             [% ELSE %]
656                                 <span>No limitation</span>
657                             [% END %]
658                         </td>
659                         [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
660                           <td>
661                               [% SWITCH category.checkprevcheckout %]
662                               [% CASE 'yes' %]
663                               <span>Yes</span>
664                               [% CASE 'no' %]
665                               <span>No</span>
666                               [% CASE 'inherit' %]
667                               <span>Inherit</span>
668                               [% END %]
669                           </td>
670                         [% END %]
671                         <td>[% IF category.can_be_guarantee %] Yes [% ELSE %] No [% END %]</td>
672                         <td>
673                             [% SWITCH category.default_privacy %]
674                             [% CASE 'default' %]
675                                 <span>Default</span>
676                             [% CASE 'never' %]
677                                 <span>Never</span>
678                             [% CASE 'forever' %]
679                                 <span>Forever</span>
680                             [% END %]
681                         </td>
682                         <td>
683                             [% IF category.exclude_from_local_holds_priority %]
684                                 <span>Yes</span>
685                             [% ELSE %]
686                                 <span>No</span>
687                             [% END %]
688                         </td>
689                         <td class="actions">
690                             <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/categories.pl?op=add_form&amp;categorycode=[% category.categorycode |uri %]"><i class="fa fa-pencil-alt"></i> Edit</a>
691                             <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/categories.pl?op=delete_confirm&amp;categorycode=[% category.categorycode |uri %]"><i class="fa fa-trash-can"></i> Delete</a>
692                         </td>
693                     </tr>
694                 [% END %]
695             </tbody>
696         </table>
697     [% ELSE %]
698         <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>
699     [% END %]
700     </div>
701 [% END %]
702
703             </main>
704         </div> <!-- /.col-sm-10.col-sm-push-2 -->
705
706         <div class="col-sm-2 col-sm-pull-10">
707             <aside>
708                 [% INCLUDE 'admin-menu.inc' %]
709             </aside>
710         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
711      </div> <!-- /.row -->
712
713 [% MACRO jsinclude BLOCK %]
714     <script>
715         var TalkingTechItivaPhoneNotification = [% Koha.Preference('TalkingTechItivaPhoneNotification') || 0 | html %];
716         var PhoneNotification = [% Koha.Preference('PhoneNotification') || 0 | html %];
717     </script>
718     [% Asset.js("js/admin-menu.js") | $raw %]
719     [% Asset.js("js/messaging-preference-form.js") | $raw %]
720     [% INCLUDE 'calendar.inc' %]
721     [% INCLUDE 'datatables.inc' %]
722     [% INCLUDE 'columns_settings.inc' %]
723     <script>
724         var table_settings = [% TablesSettings.GetTableSettings( 'admin', 'categories', 'patron_categories', 'json' ) | $raw %];
725     </script>
726     [% Asset.js("js/categories.js") | $raw %]
727 [% END %]
728 [% INCLUDE 'intranet-bottom.inc' %]