Bug 19471: Show creation date in patron restrictions list
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / borrower_debarments.inc
blob477fcfab184ca6213e64d9d82f84789356585c7d
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>
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                      <th>Created</th>
40                      [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
41                          <th>&nbsp;</th>
42                      [% END %]
43                 </tr>
44             </thead>
45             <tbody>
46                 [% FOREACH d IN debarments %]
47                     <tr>
48                         <td>
49                             [% SWITCH d.type %]
50                                 [% CASE 'MANUAL' %]
51                                     Manual
52                                 [% CASE 'OVERDUES' %]
53                                     Overdues
54                                 [% CASE 'SUSPENSION' %]
55                                     Suspension
56                                 [% CASE 'DISCHARGE' %]
57                                     Discharge
58                             [% END %]
59                         </td>
60                         <td>
61                             [% IF d.comment.search('OVERDUES_PROCESS') %]
62                                 Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') %]
63                             [% ELSE %]
64                                 [% d.comment %]
65                             [% END %]
66                         </td>
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 %]
70                             <td>
71                                 <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">
72                                     <i class="fa fa-trash"></i> Remove
73                                 </a>
74                             </td>
75                         [% END %]
76                     </tr>
77                 [% END %]
78             </tbody>
79         </table>
80     [% END %]
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>
88                 <ol>
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>
92                 </ol>
93             <fieldset class="action"><input type="submit" value="Add restriction" /> <a href="#" class="cancel" id="cancel_manual_restriction">Cancel</a></fieldset>
94             </fieldset>
95         </form>
96     [% END %]
97 </div>