Bug 18789: Use Koha::Patron->is_adult where needed
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / borrower_debarments.inc
1 <div id="reldebarments">
2     [% IF ( not debarments.defined || debarments.size < 1 ) %]
3         <p>Patron is currently unrestricted.</p>
4     [% ELSE %]
5         <table>
6             <thead>
7                 <tr>
8                      <th>Type</th>
9                      <th>Comment</th>
10                      <th>Expiration</th>
11                      <th>Created</th>
12                      [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
13                          <th>&nbsp;</th>
14                      [% END %]
15                 </tr>
16             </thead>
17             <tbody>
18                 [% FOREACH d IN debarments %]
19                     <tr>
20                         <td>
21                             [% SWITCH d.type %]
22                                 [% CASE 'MANUAL' %]
23                                     Manual
24                                 [% CASE 'OVERDUES' %]
25                                     Overdues
26                                 [% CASE 'SUSPENSION' %]
27                                     Suspension
28                                 [% CASE 'DISCHARGE' %]
29                                     Discharge
30                             [% END %]
31                         </td>
32                         <td>
33                             [% IF d.comment.search('OVERDUES_PROCESS') %]
34                                 Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') %]
35                             [% ELSE %]
36                                 [% d.comment %]
37                             [% END %]
38                         </td>
39                         <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td>
40                         <td>[% d.created | $KohaDates %]</td>
41                         [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
42                             <td>
43                                 <a class="remove_restriction btn btn-default btn-xs" href="/cgi-bin/koha/members/mod_debarment.pl?borrowernumber=[% patron.borrowernumber %]&amp;borrower_debarment_id=[% d.borrower_debarment_id %]&amp;action=del">
44                                     <i class="fa fa-trash"></i> Remove
45                                 </a>
46                             </td>
47                         [% END %]
48                     </tr>
49                 [% END %]
50             </tbody>
51         </table>
52     [% END %]
53     [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
54         <p><a href="#" id="add_manual_restriction"><i class="fa fa-plus"></i> Add manual restriction</a></p>
55         <form method="post" action="/cgi-bin/koha/members/mod_debarment.pl" class="clearfix">
56             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
57             <input type="hidden" name="action" value="add" />
58             <fieldset class="rows" id="manual_restriction_form">
59                 <legend>Add manual restriction</legend>
60                 <ol>
61                     <li><label for="rcomment">Comment:</label> <input type="text" id="rcomment" name="comment" /></li>
62                     <li><label for="rexpiration">Expiration:</label> <input name="expiration" id="rexpiration" size="10" value="" class="datepicker" />
63                         <a href="#" class="clear-date" id="clear-date-rexpiration">Clear date</a></li>
64                 </ol>
65             <fieldset class="action"><input type="submit" value="Add restriction" /> <a href="#" class="cancel" id="cancel_manual_restriction">Cancel</a></fieldset>
66             </fieldset>
67         </form>
68     [% END %]
69 </div>