Bug 17014 - Remove more event attributes from patron templates
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / borrower_debarments.inc
1 <script type="text/javascript">
2    //<![CDATA[
3         $(document).ready(function(e){
4             $("div#reldebarments .remove_restriction").on("click",function(){
5                 return confirm(_("Remove restriction?"));
6             });
7             var mrform = $("#manual_restriction_form");
8             var mrlink = $("#add_manual_restriction");
9             mrform.hide();
10             mrlink.on("click",function(e){
11                 $(this).hide();
12                 mrform.show();
13                 e.preventDefault();
14             });
15             $("#cancel_manual_restriction").on("click",function(e){
16                 mrlink.show();
17                 mrform.hide();
18                 e.preventDefault();
19             });
20             $(".clear-date").on("click",function(e){
21                 e.preventDefault();
22                 var fieldID = this.id.replace("clear-date-","");
23                 $("#" + fieldID).val("");
24             });
25         })
26     //]]>
27 </script>
28
29 <div id="reldebarments">
30     [% IF ( not debarments.defined || debarments.size < 1 ) %]
31         <p>Patron is currently unrestricted.</p>
32     [% ELSE %]
33         <table>
34             <thead>
35                 <tr>
36                      <th>Type</th>
37                      <th>Comment</th>
38                      <th>Expiration</th>
39                      [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
40                          <th>&nbsp;</th>
41                      [% END %]
42                 </tr>
43             </thead>
44             <tbody>
45                 [% FOREACH d IN debarments %]
46                     <tr>
47                         <td>
48                             [% SWITCH d.type %]
49                                 [% CASE 'MANUAL' %]
50                                     Manual
51                                 [% CASE 'OVERDUES' %]
52                                     Overdues
53                                 [% CASE 'SUSPENSION' %]
54                                     Suspension
55                                 [% CASE 'DISCHARGE' %]
56                                     Discharge
57                             [% END %]
58                         </td>
59                         <td>
60                             [% IF d.comment.search('OVERDUES_PROCESS') %]
61                                 Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') %]
62                             [% ELSE %]
63                                 [% d.comment %]
64                             [% END %]
65                         </td>
66                         <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td>
67                         [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
68                             <td>
69                                 <a class="remove_restriction btn btn-default btn-xs" href="/cgi-bin/koha/members/mod_debarment.pl?borrowernumber=[% borrowernumber %]&amp;borrower_debarment_id=[% d.borrower_debarment_id %]&amp;action=del">
70                                     <i class="fa fa-trash"></i> Remove
71                                 </a>
72                             </td>
73                         [% END %]
74                     </tr>
75                 [% END %]
76             </tbody>
77         </table>
78     [% END %]
79     [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
80         <p><a href="#" id="add_manual_restriction"><i class="fa fa-plus"></i> Add manual restriction</a></p>
81         <form method="post" action="/cgi-bin/koha/members/mod_debarment.pl" class="clearfix">
82             <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
83             <input type="hidden" name="action" value="add" />
84             <fieldset class="rows" id="manual_restriction_form">
85                 <legend>Add manual restriction</legend>
86                 <ol>
87                     <li><label for="rcomment">Comment:</label> <input type="text" id="rcomment" name="comment" /></li>
88                     <li><label for="rexpiration">Expiration:</label> <input name="expiration" id="rexpiration" size="10" value="" class="datepicker" />
89                         <a href="#" class="clear-date" id="clear-date-rexpiration">Clear date</a></li>
90                 </ol>
91             <fieldset class="action"><input type="submit" value="Add restriction" /> <a href="#" class="cancel" id="cancel_manual_restriction">Cancel</a></fieldset>
92             </fieldset>
93         </form>
94     [% END %]
95 </div>