Bug 13618: Add html filters to all the variables
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / invoice-files.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Acquisitions &rsaquo; Invoice &rsaquo; Files</title>
7 [% Asset.css("css/datatables.css") | $raw %]
8 [% INCLUDE 'doc-head-close.inc' %]
9 </head>
10
11 <body id="acq_invoice_files" class="acq">
12 [% INCLUDE 'header.inc' %]
13 [% INCLUDE 'acquisitions-search.inc' %]
14
15 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="/cgi-bin/koha/acqui/invoices.pl">Invoices</a> &rsaquo; <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoiceid | html %]">[% invoicenumber | html %]</a> &rsaquo; Files</div>
16
17 <div class="main container-fluid">
18     <div class="row">
19         <div class="col-sm-10 col-sm-push-2">
20             <main>
21
22       <h2>Files for invoice: [% invoicenumber | html %]</h2>
23       <p><b>Vendor: </b><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]">[% suppliername | html %]</a></p>
24       <br />
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           [% IF errors.invalid_parameter %]Invalid or missing script parameter.[% END %]
30         </div>
31       [% END %]
32       [% IF files %]
33           <table id="invoice_files_details_table">
34               <thead>
35                   <tr>
36                       <th>Name</th>
37                       <th>Type</th>
38                       <th>Description</th>
39                       <th>Uploaded</th>
40                       <th>Bytes</th>
41                       <th>&nbsp;</th>
42                       <th>&nbsp;</th>
43                   </tr>
44               </thead>
45               <tbody>
46                 [% FOREACH f IN files %]
47                   <tr>
48                       <td><a href="?invoiceid=[% invoiceid | html %]&amp;op=download&amp;view=1&amp;file_id=[% f.file_id | html %]">[% f.file_name | html %]</a></td>
49                       <td>[% f.file_type | html %]</td>
50                       <td>[% f.file_description | html %]</td>
51                       <td class="title-string">
52                         <span title="[% f.date_uploaded | html %]">[% f.date_uploaded | $KohaDates %]</span>
53                       </td>
54                       <td>[% f.file_size | html %]</td>
55                       <td><a class="delete_file" href="?invoiceid=[% invoiceid | html %]&amp;op=delete&amp;file_id=[% f.file_id | html %]">Delete</a></td>
56                       <td><a href="?invoiceid=[% invoiceid | html %]&amp;op=download&amp;file_id=[% f.file_id | html %]">Download</a></td>
57                   </tr>
58                 [% END %]
59               </tbody>
60           </table>
61       [% ELSE %]
62           <div class="dialog message">
63               <p>This invoice has no files attached.</p>
64           </div>
65       [% END %]
66       [% IF invoiceid %]
67           <br />
68           <form method="post" action="/cgi-bin/koha/acqui/invoice-files.pl" enctype="multipart/form-data">
69               <fieldset class="rows">
70                   <legend>Upload New File</legend>
71                   <ol>
72                       <li><input type="hidden" name="op" value="upload" />
73                       <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
74                       <label for="description">Description:</label>
75                       <input name="description" id="description" type="text" /></li>
76                       <li><label for="uploadfile">File:</label><input name="uploadfile" type="file" id="uploadfile" /></li>
77                   </ol>
78                   <fieldset class="action"><input name="upload" type="submit" id="upload" value="Upload File" /></fieldset>
79               </fieldset>
80           </form>
81       [% END %]
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 'acquisitions-menu.inc' %]
88     </aside>
89 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
90 </div> <!-- /.row -->
91
92 [% MACRO jsinclude BLOCK %]
93     [% Asset.js("js/acquisitions-menu.js") | $raw %]
94     [% INCLUDE 'datatables.inc' %]
95     <script>
96         $(document).ready(function() {
97             $("#invoice_files_details_table").dataTable($.extend(true, {}, dataTablesDefaults, {
98                 "aoColumnDefs": [
99                     { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
100                     { "aTargets": [ "title-string" ], "sType": "title-string" }
101                 ],
102                 bInfo: false,
103                 bPaginate: false,
104                 bFilter: false,
105                 sDom: "t"
106             }));
107             $("a.delete_file").click(function(){
108                 return ( confirm( _("Are you sure you want to delete this file ?") ) );
109             });
110         });
111     </script>
112 [% END %]
113
114 [% INCLUDE 'intranet-bottom.inc' %]