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