Bug 15788: Use delete_borrowers permission
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / str / members-menu.inc
1 [% USE scalar %]
2 [% USE Koha %]
3 [% USE Categories %]
4 <!-- str/members-menu.inc -->
5 <script>
6     var advsearch = "[% advsearch | html %]";
7     var destination = "[% destination | html %]";
8
9     var CAN_user_borrowers_edit_borrowers = "[% CAN_user_borrowers_edit_borrowers | html %]";
10     var CAN_user_borrowers_delete_borrowers = "[% CAN_user_borrowers_delete_borrowers | html %]";
11
12     var dateformat = "[% Koha.Preference('dateformat') | html %]";
13
14     var borrowernumber;
15     var number_of_adult_categories = 0;
16     [% IF patron %]
17         borrowernumber = "[% patron.borrowernumber | html %]";
18         [% IF patron.is_child %]
19             [% SET adult_categories = Categories.scalar.all(category_type => 'A') %]
20             [% SET number_of_adult_categories = adult_categories.count %]
21             number_of_adult_categories = [% number_of_adult_categories | html %]
22         [% END %]
23     [% END %]
24
25     [% IF ( patron.image ) %]
26         $("body").on("click", "#delpicture", function(){
27              return confirm(_("Are you sure you want to delete this patron image? This cannot be undone."));
28         });
29         $('#manage-patron-image').find("input[value*=Upload]").click(function(){
30             if($("#uploadfile").val() == ""){
31                 alert(_("Please choose a file to upload"));
32                 return false;
33             }
34             return confirm(_("Are you sure you want to replace the current patron image? This cannot be undone."));
35         });
36     [% END %]
37 </script>
38 <!-- / str/members-menu.inc -->