|
Lines 1-64
Link Here
|
| 1 |
<script type="text/javascript"> |
1 |
<script type="text/javascript"> |
| 2 |
//<![CDATA[ |
2 |
//<![CDATA[ |
| 3 |
|
3 |
$(document).ready(function(e){ |
| 4 |
function confirm_remove_restriction() { |
4 |
$("#remove_restriction").on("click",function(){ |
| 5 |
return confirm(_("Remove restriction?")); |
5 |
return confirm(_("Remove restriction?")); |
| 6 |
} |
6 |
}); |
| 7 |
|
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 |
}) |
| 8 |
//]]> |
21 |
//]]> |
| 9 |
</script> |
22 |
</script> |
| 10 |
|
23 |
|
| 11 |
<div id="reldebarments"> |
24 |
<div id="reldebarments"> |
| 12 |
[% UNLESS debarments %]<p>Patron is currently unrestricted.</p>[% END %] |
25 |
[% IF ( debarments.size < 1 ) %] |
| 13 |
|
26 |
<p>Patron is currently unrestricted.</p> |
| 14 |
<table> |
27 |
[% ELSE %] |
| 15 |
<thead> |
28 |
<table> |
| 16 |
<tr> |
29 |
<thead> |
| 17 |
<th>Type</th> |
|
|
| 18 |
<th>Comment</th> |
| 19 |
<th>Expiration</th> |
| 20 |
[% IF ( CAN_user_borrowers ) %] |
| 21 |
<th> </th> |
| 22 |
[% END %] |
| 23 |
</tr> |
| 24 |
</thead> |
| 25 |
|
| 26 |
<tbody> |
| 27 |
[% FOREACH d IN debarments %] |
| 28 |
<tr> |
30 |
<tr> |
| 29 |
<td>[% d.type %]</td> |
31 |
<th>Type</th> |
| 30 |
<td>[% d.comment %]</td> |
32 |
<th>Comment</th> |
| 31 |
<td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td> |
33 |
<th>Expiration</th> |
| 32 |
[% IF ( CAN_user_borrowers )%] |
34 |
[% IF ( CAN_user_borrowers ) %] |
| 33 |
<td> |
35 |
<th> </th> |
| 34 |
<a href="/cgi-bin/koha/members/mod_debarment.pl?borrowernumber=[% borrowernumber %]&borrower_debarment_id=[% d.borrower_debarment_id %]&action=del" onclick="return confirm_remove_restriction()"> |
36 |
[% END %] |
| 35 |
Remove |
|
|
| 36 |
</a> |
| 37 |
</td> |
| 38 |
[% END %] |
| 39 |
</tr> |
37 |
</tr> |
| 40 |
[% END %] |
38 |
</thead> |
| 41 |
</tbody> |
39 |
<tbody> |
| 42 |
|
40 |
[% FOREACH d IN debarments %] |
| 43 |
[% IF ( CAN_user_borrowers )%] |
|
|
| 44 |
<form method="post" action="/cgi-bin/koha/members/mod_debarment.pl"> |
| 45 |
<input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> |
| 46 |
<input type="hidden" name="action" value="add" /> |
| 47 |
|
| 48 |
<tfoot> |
| 49 |
<tr> |
41 |
<tr> |
| 50 |
<td>MANUAL</td> |
42 |
<td>[% d.type %]</td> |
| 51 |
<td><input type="text" name="comment" /></td> |
43 |
<td>[% d.comment %]</td> |
| 52 |
<td> |
44 |
<td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td> |
| 53 |
<input name="expiration" id="expiration" size="10" readonly="readonly" value="" class="datepicker" /> |
45 |
[% IF ( CAN_user_borrowers )%] |
| 54 |
<a href='#' onclick="document.getElementById('expiration').value='';">Clear Date</a> |
46 |
<td> |
| 55 |
</td> |
47 |
<a id="remove_restriction" href="/cgi-bin/koha/members/mod_debarment.pl?borrowernumber=[% borrowernumber %]&borrower_debarment_id=[% d.borrower_debarment_id %]&action=del"> |
| 56 |
<td> |
48 |
Remove |
| 57 |
<input type="submit" value="Add restriction" /> |
49 |
</a> |
| 58 |
</td> |
50 |
</td> |
|
|
51 |
[% END %] |
| 59 |
</tr> |
52 |
</tr> |
| 60 |
</tfoot> |
53 |
[% END %] |
| 61 |
</form> |
54 |
</tbody> |
| 62 |
[% END %] |
55 |
</table> |
| 63 |
</table> |
56 |
[% END %] |
|
|
57 |
<p><a href="#" id="add_manual_restriction">Add manual restriction</a></p> |
| 58 |
[% IF ( CAN_user_borrowers )%] |
| 59 |
<form method="post" action="/cgi-bin/koha/members/mod_debarment.pl" class="clearfix"> |
| 60 |
<input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> |
| 61 |
<input type="hidden" name="action" value="add" /> |
| 62 |
<fieldset class="rows" id="manual_restriction_form"> |
| 63 |
<legend>Add manual restriction</legend> |
| 64 |
<ol> |
| 65 |
<li><label for="rcomment">Comment:</label> <input type="text" id="rcomment" name="comment" /></li> |
| 66 |
<li><label for="rexpiration">Expiration:</label> <input name="expiration" id="rexpiration" size="10" readonly="readonly" value="" class="datepicker" /> |
| 67 |
<a href='#' onclick="document.getElementById('expiration').value='';">Clear date</a></li> |
| 68 |
</ol> |
| 69 |
<fieldset class="action"><input type="submit" value="Add restriction" /> <a href="#" class="cancel" id="cancel_manual_restriction">Cancel</a></fieldset> |
| 70 |
</fieldset> |
| 71 |
</form> |
| 72 |
[% END %] |
| 64 |
</div> |
73 |
</div> |