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