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