1 <script type="text/javascript">
3 $(document).ready(function(e){
4 $("div#reldebarments .remove_restriction").on("click",function(){
5 return confirm(_("Remove restriction?"));
7 var mrform = $("#manual_restriction_form");
8 var mrlink = $("#add_manual_restriction");
10 mrlink.on("click",function(e){
15 $("#cancel_manual_restriction").on("click",function(e){
20 $(".clear-date").on("click",function(e){
22 var fieldID = this.id.replace("clear-date-","");
23 $("#" + fieldID).val("");
29 <div id="reldebarments">
30 [% IF ( not debarments.defined || debarments.size < 1 ) %]
31 <p>Patron is currently unrestricted.</p>
40 [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
46 [% FOREACH d IN debarments %]
54 [% CASE 'SUSPENSION' %]
56 [% CASE 'DISCHARGE' %]
61 [% IF d.comment.search('OVERDUES_PROCESS') %]
62 Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') %]
67 <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td>
68 <td>[% d.created | $KohaDates %]</td>
69 [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
71 <a class="remove_restriction btn btn-default btn-xs" href="/cgi-bin/koha/members/mod_debarment.pl?borrowernumber=[% borrowernumber %]&borrower_debarment_id=[% d.borrower_debarment_id %]&action=del">
72 <i class="fa fa-trash"></i> Remove
81 [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
82 <p><a href="#" id="add_manual_restriction"><i class="fa fa-plus"></i> Add manual restriction</a></p>
83 <form method="post" action="/cgi-bin/koha/members/mod_debarment.pl" class="clearfix">
84 <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
85 <input type="hidden" name="action" value="add" />
86 <fieldset class="rows" id="manual_restriction_form">
87 <legend>Add manual restriction</legend>
89 <li><label for="rcomment">Comment:</label> <input type="text" id="rcomment" name="comment" /></li>
90 <li><label for="rexpiration">Expiration:</label> <input name="expiration" id="rexpiration" size="10" value="" class="datepicker" />
91 <a href="#" class="clear-date" id="clear-date-rexpiration">Clear date</a></li>
93 <fieldset class="action"><input type="submit" value="Add restriction" /> <a href="#" class="cancel" id="cancel_manual_restriction">Cancel</a></fieldset>