Bug 27631: admin folder
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / categories.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE Branches %]
5 [% USE KohaDates %]
6 [% USE Price %]
7 [% USE TablesSettings %]
8 [% SET footerjs = 1 %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>[% IF op == 'add_form' %][% IF ( categorycode ) %]Modify category '[% categorycode | html %]'[% ELSE %]New category[% END %][% END %]
11 [% IF op == 'delete_confirm' %][% IF ( patrons_in_category > 0 ) %]Cannot delete: category [% categorycode | html %] in use[% ELSE %]Confirm deletion of category '[% categorycode | html %]'[% END %][% END %] &rsaquo; Patron categories &rsaquo; Administration &rsaquo; Koha
12 </title>
13 [% INCLUDE 'doc-head-close.inc' %]
14 <style>#enrolmentmessage.hint { display : none; }</style>
15 </head>
16
17 <body id="admin_categorie" class="admin">
18 [% INCLUDE 'header.inc' %]
19 [% INCLUDE 'patrons-admin-search.inc' %]
20
21 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
22     <ol>
23         <li>
24             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
25         </li>
26         <li>
27             <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
28         </li>
29
30         [% IF op == 'add_form' %]
31             <li>
32                 <a href="/cgi-bin/koha/admin/categories.pl">Patron categories</a>
33             </li>
34             [% IF ( categorycode ) %]
35                 <li>
36                     <a href="#" aria-current="page">
37                         Modify category '[% categorycode | html %]'
38                     </a>
39                 </li>
40             [% ELSE %]
41                 <li>
42                     <a href="#" aria-current="page">
43                         New category
44                     </a>
45                 </li>
46             [% END %]
47         [% END %]
48
49         [% IF op == 'delete_confirm' %]
50             <li>
51                 <a href="/cgi-bin/koha/admin/categories.pl">Patron categories</a>
52             </li>
53             [% IF ( patrons_in_category > 0 ) %]
54                 <li>
55                     <a href="#" aria-current="page">
56                         Cannot delete: Category [% categorycode | html %] in use
57                     </a>
58                 </li>
59             [% ELSE %]
60                 <li>
61                     <a href="#" aria-current="page">
62                         Confirm deletion of category '[% categorycode | html %]'
63                     </a>
64                 </li>
65             [% END %]
66         [% END %]
67
68         [% IF op == 'delete_confirmed' %]
69             <li>
70                 <a href="/cgi-bin/koha/admin/categories.pl">Patron categories</a>
71             </li>
72             <li>
73                 <a href="#" aria-current="page">
74                     Category deleted
75                 </a>
76             </li>
77         [% END %]
78
79         [% IF op == 'list' %]
80             <li>
81                 <a href="#" aria-current="page">
82                     Patron categories
83                 </a>
84             </li>
85         [% END %]
86     </ol>
87 </nav>
88
89 <div class="main container-fluid">
90     <div class="row">
91         <div class="col-sm-10 col-sm-push-2">
92             <main>
93
94 [% FOR m IN messages %]
95     <div class="dialog [% m.type | html %]">
96         [% SWITCH m.code %]
97         [% CASE 'error_on_update' %]
98             <span>An error occurred when updating this patron category. Perhaps it already exists.</span>
99         [% CASE 'error_on_insert' %]
100             <span>An error occurred when inserting this patron category. The patron category might already exist.</span>
101         [% CASE 'error_on_delete' %]
102             <span>An error occurred when deleting this patron category. Check the logs.</span>
103         [% CASE 'success_on_update' %]
104             <span>Patron category updated successfully.</span>
105         [% CASE 'success_on_insert' %]
106             <span>Patron category inserted successfully.</span>
107         [% CASE 'success_on_delete' %]
108             <span>Patron category deleted successfully.</span>
109         [% CASE 'already_exists' %]
110             <span>This patron category already exists.</span>
111         [% CASE %]
112             <span>[% m.code | html %]</span>
113         [% END %]
114     </div>
115 [% END %]
116
117 [% IF op == 'add_form' %]
118     <form id="category_form" action="/cgi-bin/koha/admin/categories.pl" method="post">
119         <input type="hidden" name="op" value="add_validate" />
120         <input type="hidden" name="checked" value="0" />
121         [% IF category %]
122             <h1>Modify category [% categorycode | html %]</h1>
123         [% ELSE %]
124             <h1>New category</h1>
125         [% END %]
126         <fieldset class="rows">
127             <ol>
128                 [% IF category %]
129                     <li>
130                         <span class="label">Category code: </span>[% categorycode | html %]
131                         <input type="hidden" name="categorycode" value="[% category.categorycode | html %]" /><input type="hidden" name="is_a_modif" value="1" />
132                     </li>
133                 [% ELSE %]
134                     <li>
135                         <label for="categorycode" class="required">Category code: </label>
136                         <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" class="required" required="required" />
137                         <span class="required">Required</span>
138                     </li>
139                 [% END %]
140                 <li>
141                     <label for="description" class="required">Description: </label>
142                     <input type="text" name="description" id="description" size="40" maxlength="80" class="required" required="required" value="[% category.description | html %]" />
143                     <span class="required">Required</span>
144                 </li>
145                 <li>
146                     <span class="label">Enrollment period: </span>
147                     <fieldset>
148                         <legend>Choose one</legend>
149                         <ol>
150                             <li>
151                                 <label for="enrolmentperiod">In months: </label>
152                                 [% IF category.enrolmentperiod %]
153                                     <input type="text" class="enrollmentperiod" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% category.enrolmentperiod | html %]" /> months
154                                [% ELSE %]
155                                     <input type="text" class="enrollmentperiod" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="" /> months
156                                [% END %]
157                             </li>
158                             <li>
159                                 <label for="enrolmentperioddate">Until date: </label>
160                                 <input type="text" class="enrollmentperiod flatpickr" data-flatpickr-futuredate="true" name="enrolmentperioddate" id="enrolmentperioddate" value="[% category.enrolmentperioddate | $KohaDates %]" />
161                             </li>
162                         </ol>
163                     </fieldset>
164                 </li>
165                 <li>
166                     <label for="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                 <h1>
429                     [% IF patrons_in_category > 0 %]
430                         Category [% categorycode | html %] is in use.  Deletion not possible!
431                     [% ELSE %]
432                         Confirm deletion of category [% categorycode | html %]
433                     [% END %]
434             </h1>
435             </legend>
436
437             [% IF patrons_in_category > 0  %]
438                 <div class="dialog alert">
439                     <strong>This category is used [% patrons_in_category | html %] times</strong>. Deletion not possible
440                 </div>
441             [% END %]
442             <table>
443                 <tr><th scope="row">Category code: </th><td>[% category.categorycode | html %]</td></tr>
444                 <tr><th scope="row">Description: </th><td>[% category.description | html %]</td></tr>
445                 <tr><th scope="row">Enrollment period: </th>
446                     <td>
447                         [% IF category.enrolmentperiod %]
448                             [% category.enrolmentperiod | html %] months
449                         [% ELSE %]
450                             until [% category.enrolmentperioddate | $KohaDates %]
451                         [% END %]
452                     </td>
453                 </tr>
454                 <tr><th scope="row">Age required: </th><td>[% category.dateofbirthrequired | html %] years</td></tr>
455                 <tr><th scope="row">Upperage limit: </th><td>[% category.upperagelimit | html %] years</td></tr>
456                 <tr><th scope="row">Enrollment fee: </th><td>[% category.enrolmentfee | $Price %]</td></tr>
457                 <tr><th scope="row">Receives overdue notices: </th><td>[% IF category. overduenoticerequired %]Yes[% ELSE %]No[% END %]</td></tr>
458                 <tr><th scope="row">Lost items in staff interface</th><td>[% IF category.hidelostitems %]Hidden by default[% ELSE %]Shown[% END %]</td></tr>
459                 <tr><th scope="row">Hold fee: </th><td>[% category.reservefee | $Price %]</td></tr>
460
461                 [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
462                   <tr>
463                       <th scope="row">Check previous checkouts: </th>
464                       <td>
465                           [% SWITCH category.checkprevcheckout %]
466                           [% CASE 'yes' %]
467                               <span>Yes</span>
468                           [% CASE 'no' %]
469                               <span>No</span>
470                           [% CASE 'inherit' %]
471                               <span>Inherit</span>
472                           [% END %]
473                       </td>
474                   </tr>
475                 [% END %]
476                 <tr>
477                     <th scope="row">Default privacy: </th>
478                     <td>
479                         [% SWITCH category.default_privacy %]
480                         [% CASE 'default' %]
481                             <span>Default</span>
482                         [% CASE 'never' %]
483                             <span>Never</span>
484                         [% CASE 'forever' %]
485                             <span>Forever</span>
486                         [% END %]
487                     </td>
488                 </tr>
489             </table>
490             <fieldset class="action">
491                 [% IF patrons_in_category > 0 %]
492                     <input type="submit" value="OK" />
493                 [% ELSE %]
494                     <input type="hidden" name="op" value="delete_confirmed" />
495                     <input type="hidden" name="categorycode" value="[% categorycode | html %]" />
496                     <input type="submit" value="Delete this category" />
497                     <a class="cancel" href="/cgi-bin/koha/admin/categories.pl">Cancel</a>
498                 [% END %]
499             </fieldset>
500         </fieldset>
501     </form>
502 [% END %]
503
504 [% IF op == 'list' %]
505
506     <div id="toolbar" class="btn-toolbar">
507         <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>
508     </div>
509
510     <h1>Patron categories</h1>
511     [% IF searchfield %]
512         You searched for [% searchfield | html %]</span>
513     [% END %]
514     [% IF categories%]
515         <table id="patron_categories">
516             <thead>
517                 <tr>
518                     <th scope="col">Code</th>
519                     <th scope="col">Category name</th>
520                     <th scope="col">Type</th>
521                     <th scope="col">Enrollment period</th>
522                     <th scope="col">Age required</th>
523                     <th scope="col">Upper age limit</th>
524                     <th scope="col">Enrollment fee</th>
525                     <th scope="col">Overdue</th>
526                     <th scope="col">Lost items</th>
527                     <th scope="col">Hold fee</th>
528                     [% IF ( EnhancedMessagingPreferences ) %]
529                     <th scope="col">Messaging</th>
530                     [% END %]
531                     <th scope="col">Library limitations</th>
532                     [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
533                     <th scope="col">Check previous checkout?</th>
534                     [% END %]
535                     <th scope="col">Default privacy</th>
536                     <th scope="col">Exclude from local holds priority</th>
537                     <th scope="col">Actions</th>
538                 </tr>
539             </thead>
540             <tbody>
541                 [% FOREACH category IN categories %]
542                     <tr>
543                         <td>[% category.categorycode | html %]</td>
544                         <td>
545                             <a href="/cgi-bin/koha/admin/categories.pl?op=add_form&amp;categorycode=[% category.categorycode |uri %]">[% category.description | html %]</a>
546                         </td>
547                         <td>
548                             [% SWITCH category.category_type %]
549                                 [% CASE 'A' %]<span>Adult</span>
550                                 [% CASE 'C' %]<span>Child</span>
551                                 [% CASE 'P' %]<span>Prof.</span>
552                                 [% CASE 'I' %]<span>Org.</span>
553                                 [% CASE 'S' %]<span>Staff</span>
554                                 [% CASE 'X' %]<span>Statistical</span>
555                             [% END %]
556                         </td>
557                         <td>
558                             [% IF ( category.enrolmentperiod ) %]
559                                 [% category.enrolmentperiod | html %] months
560                             [% ELSE %]
561                                 until [% category.enrolmentperioddate | $KohaDates %]
562                             [% END %]
563                         </td>
564                         [% IF (category.dateofbirthrequired) %]
565                             <td>[% category.dateofbirthrequired | html %] years</td>
566                         [% ELSE %]
567                             <td>-</td>
568                         [% END %]
569                         [% IF (category.upperagelimit) %]
570                             <td>[% category.upperagelimit | html %] years</td>
571                         [% ELSE %]
572                             <td>-</td>
573                         [% END %]
574                         [% IF (category.enrolmentfee > 0) %]
575                             <td>[% category.enrolmentfee | $Price %]</td>
576                         [% ELSE %]
577                             <td>-</td>
578                         [% END %]
579                         <td>[% IF ( category.overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td>
580                         <td>[% IF ( category.hidelostitems ) %]Hidden[% ELSE %]Shown[% END %]</td>
581                         [% IF (category.reservefee > 0) %]
582                             <td>[% category.reservefee | $Price %]</td>
583                         [% ELSE %]
584                             <td>-</td>
585                         [% END %]
586                         [% IF Koha.Preference('EnhancedMessagingPreferences') %]
587                             <td style="white-space: nowrap; font-size:80%;">
588                                 [% SET default_messaging = category.default_messaging %]
589                                 [% IF default_messaging.size %]
590                                     [% FOREACH prefs IN default_messaging %]
591                                         [% NEXT IF !Koha.Preference( 'ILLModule' ) && prefs.message_name.match('^Ill_') %]
592                                         [% FOREACH transport IN prefs.transports %]
593                                             [% IF ( transport.transport ) %]
594                                                 [% IF ( prefs.Item_Due ) %]<span>Item due</span>
595                                                 [% ELSIF ( prefs.Advance_Notice ) %]<span>Advance notice</span>
596                                                 [% ELSIF ( prefs.Hold_Filled ) %]<span>Hold filled</span>
597                                                 [% ELSIF ( prefs.Item_Check_in ) %]<span>Item check-in</span>
598                                                 [% ELSIF ( prefs.Item_Checkout ) %]<span>Item checkout</span>
599                                                 [% ELSIF ( prefs.Ill_ready ) %]<span>Interlibrary loan ready</span>
600                                                 [% ELSIF ( prefs.Ill_unavailable ) %]<span>Interlibrary loan unavailable</span>
601                                                 [% ELSIF ( prefs.Auto_Renewals ) %]<span>Auto renewal</span>
602                                                 [% ELSIF ( prefs.Hold_Reminder ) %]<span>Hold reminder</span>
603                                                 [% ELSE %]<span>Unknown</span>
604                                                 [% END %]:
605                                                 <strong>[% transport.transport | html %]</strong><br />
606                                             [% ELSE %]<span>None</span><br />[% END %]
607                                         [% END %]
608                                     [% END %]
609                                 [% ELSE %]
610                                     None
611                                 [% END %]
612                             </td>
613                         [% END %]
614                         <td>
615                             [% SET library_limits = category.library_limits %]
616                             [% IF library_limits.count > 0 %]
617                                 [% library_str = "" %]
618                                 [% FOREACH library IN library_limits %]
619                                     [%- IF loop.first -%]
620                                         [% library_str = library.branchname _ " (" _ library.branchcode _ ")" %]
621                                     [% ELSE %]
622                                         [% library_str = library_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %]
623                                     [% END %]
624                                 [% END %]
625                                 <span class="library_limitation" title="[% library_str | html %]">
626                                     [% IF library_limits.count > 1 %]
627                                         [% library_limits.count | html %] library limitations
628                                     [% ELSE %]
629                                         [% library_limits.count | html %] library limitation
630                                     [% END %]
631                             [% ELSE %]
632                                 No limitation
633                             [% END %]
634                         </td>
635                         [% IF ( Koha.Preference('CheckPrevCheckout') == 'softyes' || Koha.Preference('CheckPrevCheckout') == 'softno' ) %]
636                           <td>
637                               [% SWITCH category.checkprevcheckout %]
638                               [% CASE 'yes' %]
639                               <span>Yes</span>
640                               [% CASE 'no' %]
641                               <span>No</span>
642                               [% CASE 'inherit' %]
643                               <span>Inherit</span>
644                               [% END %]
645                           </td>
646                         [% END %]
647                         <td>
648                             [% SWITCH category.default_privacy %]
649                             [% CASE 'default' %]
650                                 <span>Default</span>
651                             [% CASE 'never' %]
652                                 <span>Never</span>
653                             [% CASE 'forever' %]
654                                 <span>Forever</span>
655                             [% END %]
656                         </td>
657                         <td>
658                             [% IF category.exclude_from_local_holds_priority %]
659                                 <span>Yes</span>
660                             [% ELSE %]
661                                 <span>No</span>
662                             [% END %]
663                         </td>
664                         <td class="actions">
665                             <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>
666                             <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>
667                         </td>
668                     </tr>
669                 [% END %]
670             </tbody>
671         </table>
672     [% ELSE %]
673         <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>
674     [% END %]
675 [% END %]
676
677             </main>
678         </div> <!-- /.col-sm-10.col-sm-push-2 -->
679
680         <div class="col-sm-2 col-sm-pull-10">
681             <aside>
682                 [% INCLUDE 'admin-menu.inc' %]
683             </aside>
684         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
685      </div> <!-- /.row -->
686
687 [% MACRO jsinclude BLOCK %]
688     [% Asset.js("js/admin-menu.js") | $raw %]
689     [% Asset.js("js/messaging-preference-form.js") | $raw %]
690     [% INCLUDE 'calendar.inc' %]
691     [% INCLUDE 'datatables.inc' %]
692     [% INCLUDE 'columns_settings.inc' %]
693     <script>
694         var columns_settings = [% TablesSettings.GetColumns( 'admin', 'categories', 'patron_categories', 'json' ) | $raw %];
695     </script>
696     [% Asset.js("js/categories.js") | $raw %]
697 [% END %]
698 [% INCLUDE 'intranet-bottom.inc' %]