Bug 12150 - Use more javascript string formatting in intranet for translated strings.
[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         })
21     //]]>
22 </script>
23
24 <div id="reldebarments">
25     [% IF ( not debarments.defined || debarments.size < 1 ) %]
26         <p>Patron is currently unrestricted.</p>
27     [% ELSE %]
28         <table>
29             <thead>
30                 <tr>
31                      <th>Type</th>
32                      <th>Comment</th>
33                      <th>Expiration</th>
34                      [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
35                          <th>&nbsp;</th>
36                      [% END %]
37                 </tr>
38             </thead>
39             <tbody>
40                 [% FOREACH d IN debarments %]
41                     <tr>
42                         <td>
43                             [% SWITCH d.type %]
44                                 [% CASE 'MANUAL' %]
45                                     Manual
46                                 [% CASE 'OVERDUES' %]
47                                     Overdues
48                                 [% CASE 'SUSPENSION' %]
49                                     Suspension
50                             [% END %]
51                         </td>
52                         <td>[% d.comment %]</td>
53                         <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td>
54                         [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
55                             <td>
56                                 <a class="remove_restriction" href="/cgi-bin/koha/members/mod_debarment.pl?borrowernumber=[% borrowernumber %]&amp;borrower_debarment_id=[% d.borrower_debarment_id %]&amp;action=del">
57                                     Remove
58                                 </a>
59                             </td>
60                         [% END %]
61                     </tr>
62                 [% END %]
63             </tbody>
64         </table>
65     [% END %]
66     [% IF CAN_user_borrowers && CAN_user_circulate_manage_restrictions %]
67         <p><a href="#" id="add_manual_restriction">Add manual restriction</a></p>
68         <form method="post" action="/cgi-bin/koha/members/mod_debarment.pl" class="clearfix">
69             <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
70             <input type="hidden" name="action" value="add" />
71             <fieldset class="rows" id="manual_restriction_form">
72                 <legend>Add manual restriction</legend>
73                 <ol>
74                     <li><label for="rcomment">Comment:</label> <input type="text" id="rcomment" name="comment" /></li>
75                     <li><label for="rexpiration">Expiration:</label> <input name="expiration" id="rexpiration" size="10" readonly="readonly" value="" class="datepicker" />
76                         <a href='#' onclick="document.getElementById('expiration').value='';">Clear date</a></li>
77                 </ol>
78             <fieldset class="action"><input type="submit" value="Add restriction" /> <a href="#" class="cancel" id="cancel_manual_restriction">Cancel</a></fieldset>
79             </fieldset>
80         </form>
81     [% END %]
82 </div>