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>
39 [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
45 [% FOREACH d IN debarments %]
53 [% CASE 'SUSPENSION' %]
55 [% CASE 'DISCHARGE' %]
60 [% IF d.comment.search('OVERDUES_PROCESS') %]
61 Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') %]
66 <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td>
67 [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
69 <a class="remove_restriction btn btn-mini" href="/cgi-bin/koha/members/mod_debarment.pl?borrowernumber=[% borrowernumber %]&borrower_debarment_id=[% d.borrower_debarment_id %]&action=del">
70 <i class="fa fa-trash"></i> Remove
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>
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>
91 <fieldset class="action"><input type="submit" value="Add restriction" /> <a href="#" class="cancel" id="cancel_manual_restriction">Cancel</a></fieldset>