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