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