Bug 23681: Allow for selection of restriction type
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / borrower_debarments.inc
1 [% USE raw %]
2 [% USE Koha %]
3 <div id="reldebarments">
4     [% IF ( not debarments.defined || debarments.size < 1 ) %]
5         <p>Patron is currently unrestricted.</p>
6     [% ELSE %]
7         <table>
8             <thead>
9                 <tr>
10                      <th>Type</th>
11                      <th>Comment</th>
12                      <th>Expiration</th>
13                      <th>Created</th>
14                      [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
15                          <th>&nbsp;</th>
16                      [% END %]
17                 </tr>
18             </thead>
19             <tbody>
20                 [% FOREACH d IN debarments %]
21                     [% dtype = d.type %]
22                     <tr>
23                         <td>
24                             [% restriction_types.$dtype.display_text | html %]
25                         </td>
26                         <td>
27                             [% IF d.comment.search('OVERDUES_PROCESS') %]
28                                 <span>Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') | $raw %]</span>
29                             [% ELSE %]
30                                 [% d.comment | $raw %]
31                             [% END %]
32                         </td>
33                         <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <em>Indefinite</em> [% END %]</td>
34                         <td>[% d.created | $KohaDates %]</td>
35                         [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
36                             <td>
37                                 <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">
38                                     <i class="fa fa-trash"></i> Remove
39                                 </a>
40                             </td>
41                         [% END %]
42                     </tr>
43                 [% END %]
44             </tbody>
45         </table>
46     [% END %]
47     [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
48         <p><a href="#" id="add_manual_restriction"><i class="fa fa-plus"></i> Add manual restriction</a></p>
49         <form method="post" action="/cgi-bin/koha/members/mod_debarment.pl" class="clearfix">
50             <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
51             <input type="hidden" name="action" value="add" />
52             <fieldset class="rows" id="manual_restriction_form">
53                 <legend>Add manual restriction</legend>
54                 <ol>
55                     [% IF Koha.Preference('PatronRestrictionTypes') %]
56                     <li>
57                         <label for="debarred_type">Type:</label>
58                         <select name="debarred_type">
59                             [% FOREACH code IN restriction_types.keys %]
60                                 <option value="[% code | html %]">[% restriction_types.$code.display_text | html %]</option>
61                             [% END %]
62                         </select>
63                     </li>
64                     [% END %]
65                     <li><label for="rcomment">Comment:</label> <input type="text" id="rcomment" name="comment" /></li>
66                     <li>
67                         <label for="rexpiration">Expiration:</label>
68                         <input name="expiration" id="rexpiration" size="20" value="" class="flatpickr" data-flatpickr-futuredate="true" type="text" />
69                     </li>
70                 </ol>
71             <fieldset class="action"><input type="submit" value="Add restriction" /> <a href="#" class="cancel" id="cancel_manual_restriction">Cancel</a></fieldset>
72             </fieldset>
73         </form>
74     [% END %]
75 </div>