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