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