Bug 22553: Unchecking a subpermission does not uncheck the top level permission
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / files.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% USE Branches %]
5 [% USE AuthorisedValues %]
6 [% SET footerjs = 1 %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Files for [% INCLUDE 'patron-title.inc' no_html = 1 %]</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 </head>
11
12 <body id="pat_files" class="pat">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'patron-search.inc' %]
15
16 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Files for [% INCLUDE 'patron-title.inc' %]</div>
17
18 <div class="main container-fluid">
19     <div class="row">
20         <div class="col-sm-10 col-sm-push-2">
21             <main>
22
23                 [% INCLUDE 'members-toolbar.inc' %]
24
25                 <h1>Files</h1>
26
27                 [% IF errors %]
28                     <div class="dialog alert">
29                         [% IF errors.empty_upload %]The file you are attempting to upload has no contents.[% END %]
30                         [% IF errors.no_file %]You did not select a file to upload.[% END %]
31                     </div>
32                 [% END %]
33
34                 [% IF ( files ) %]
35                 <table>
36                     <thead>
37                         <tr>
38                             <th>Name</th>
39                             <th>Type</th>
40                             <th>Description</th>
41                             <th>Uploaded</th>
42                             [% IF CAN_user_borrowers_edit_borrowers %]<th>&nbsp;</th>[% END %]
43                         </tr>
44                     </thead>
45
46                     <tbody>
47                         [% FOREACH f IN files %]
48                             <tr>
49                                  <td><a href="?borrowernumber=[% patron.borrowernumber | uri %]&amp;op=download&amp;file_id=[% f.file_id | uri %]">[% f.file_name | html %]</a></td>
50                                  <td>[% f.file_type | html %]</td>
51                                  <td>[% f.file_description | html %]</td>
52                                  <td>[% f.date_uploaded | $KohaDates %]</td>
53                                  [% IF CAN_user_borrowers_edit_borrowers %]<td><a class="btn btn-default btn-xs confirmdelete" href="?borrowernumber=[% patron.borrowernumber | html %]&amp;op=delete&amp;file_id=[% f.file_id | html %]"><i class="fa fa-trash"></i> Delete</a></td>[% END %]
54                             </tr>
55                         [% END %]
56                     </tbody>
57                 </table>
58                 [% ELSE %]
59                 <div class="dialog message">
60                     <p>This patron has no files attached.</p>
61                 </div>
62                 [% END %]
63
64                 <form method="post" action="/cgi-bin/koha/members/files.pl" enctype="multipart/form-data">
65                     <fieldset class="rows">
66                         <legend>Upload new file</legend>
67                         <ol>
68                         <li><input type="hidden" name="op" value="upload" />
69                         <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
70                         <input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
71
72                         <label for="description">Description:</label>
73                         <input name="description" id="description" type="text" /></li>
74
75                         <li><label for="uploadfile">File:</label><input name="uploadfile" type="file" id="uploadfile" /></li>
76
77                         </ol>
78                         <fieldset class="action"><input name="upload" type="submit" id="upload" value="Upload file" /></fieldset>
79                     </fieldset>
80                 </form>
81
82             </main>
83         </div> <!-- /.col-sm-10.col-sm-push-2 -->
84
85         <div class="col-sm-2 col-sm-pull-10">
86             <aside>
87                 [% INCLUDE 'circ-menu.inc' %]
88             </aside>
89         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
90      </div> <!-- /.row -->
91
92 [% MACRO jsinclude BLOCK %]
93     [% INCLUDE 'str/members-menu.inc' %]
94     [% Asset.js("js/members-menu.js") | $raw %]
95     <script>
96         $(document).ready(function(){
97             $(".confirmdelete").on("click", function(){
98                 $(this).parents('tr').addClass("warn");
99                 if(confirm(_("Are you sure you want to delete this file?"))){
100                     return true;
101                 } else {
102                     $(this).parents('tr').removeClass("warn");
103                     return false;
104                 }
105             });
106     });
107     </script>
108 [% END %]
109
110 [% INCLUDE 'intranet-bottom.inc' %]