Bug 27846: modules and modules/acqui folders
[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 [% INCLUDE 'doc-head-close.inc' %]
8 </head>
9
10 <body id="acq_invoice_files" class="acq">
11 [% INCLUDE 'header.inc' %]
12 [% INCLUDE 'acquisitions-search.inc' %]
13
14
15 <nav aria-label="Breadcrumb" class="breadcrumb">
16     <ol>
17         <li>
18             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
19         </li>
20         <li>
21             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
22         </li>
23         <li>
24             <a href="/cgi-bin/koha/acqui/invoices.pl">Invoices</a>
25         </li>
26         <li>
27             <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoiceid | uri %]">[% invoicenumber | html %]</a>
28         </li>
29         <li>
30             <a href="#" aria-current="page">Files</a>
31         </li>
32     </ol>
33 </nav>
34
35 <div class="main container-fluid">
36     <div class="row">
37         <div class="col-sm-10 col-sm-push-2">
38             <main>
39
40       <h2>Files for invoice: [% invoicenumber | html %]</h2>
41       <p><strong>Vendor: </strong><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% suppliername | html %]</a></p>
42       <br />
43       [% IF errors %]
44         <div class="dialog alert">
45           [% IF errors.empty_upload %]The file you are attempting to upload has no contents.[% END %]
46           [% IF errors.no_file %]You did not select a file to upload.[% END %]
47           [% IF errors.invalid_parameter %]Invalid or missing script parameter.[% END %]
48         </div>
49       [% END %]
50       [% IF files %]
51           <table id="invoice_files_details_table">
52               <thead>
53                   <tr>
54                       <th>Name</th>
55                       <th>Type</th>
56                       <th>Description</th>
57                       <th>Uploaded</th>
58                       <th>Bytes</th>
59                       <th>&nbsp;</th>
60                       <th>&nbsp;</th>
61                   </tr>
62               </thead>
63               <tbody>
64                 [% FOREACH f IN files %]
65                   <tr>
66                       <td><a href="?invoiceid=[% invoiceid | uri %]&amp;op=download&amp;view=1&amp;file_id=[% f.file_id | uri %]">[% f.file_name | html %]</a></td>
67                       <td>[% f.file_type | html %]</td>
68                       <td>[% f.file_description | html %]</td>
69                       <td class="title-string">
70                         <span title="[% f.date_uploaded | html %]">[% f.date_uploaded | $KohaDates %]</span>
71                       </td>
72                       <td>[% f.file_size | html %]</td>
73                       <td><a class="delete_file" href="?invoiceid=[% invoiceid | html %]&amp;op=delete&amp;file_id=[% f.file_id | html %]">Delete</a></td>
74                       <td><a href="?invoiceid=[% invoiceid | uri %]&amp;op=download&amp;file_id=[% f.file_id | uri %]">Download</a></td>
75                   </tr>
76                 [% END %]
77               </tbody>
78           </table>
79       [% ELSE %]
80           <div class="dialog message">
81               <p>This invoice has no files attached.</p>
82           </div>
83       [% END %]
84       [% IF invoiceid %]
85           <br />
86           <form method="post" action="/cgi-bin/koha/acqui/invoice-files.pl" enctype="multipart/form-data">
87               <fieldset class="rows">
88                   <legend>Upload New File</legend>
89                   <ol>
90                       <li><input type="hidden" name="op" value="upload" />
91                       <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
92                       <label for="description">Description:</label>
93                       <input name="description" id="description" type="text" /></li>
94                       <li><label for="uploadfile">File:</label><input name="uploadfile" type="file" id="uploadfile" /></li>
95                   </ol>
96                   <fieldset class="action"><input name="upload" type="submit" id="upload" value="Upload File" /></fieldset>
97               </fieldset>
98           </form>
99       [% END %]
100     </main>
101   </div> <!-- /.col-sm-10.col-sm-push-2 -->
102
103 <div class="col-sm-2 col-sm-pull-10">
104     <aside>
105         [% INCLUDE 'acquisitions-menu.inc' %]
106     </aside>
107 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
108 </div> <!-- /.row -->
109
110 [% MACRO jsinclude BLOCK %]
111     [% Asset.js("js/acquisitions-menu.js") | $raw %]
112     [% INCLUDE 'datatables.inc' %]
113     <script>
114         $(document).ready(function() {
115             $("#invoice_files_details_table").dataTable($.extend(true, {}, dataTablesDefaults, {
116                 "aoColumnDefs": [
117                     { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
118                     { "aTargets": [ "title-string" ], "sType": "title-string" }
119                 ],
120                 bInfo: false,
121                 bPaginate: false,
122                 bFilter: false,
123                 sDom: "t"
124             }));
125             $("a.delete_file").click(function(){
126                 return ( confirm( _("Are you sure you want to delete this file ?") ) );
127             });
128         });
129     </script>
130 [% END %]
131
132 [% INCLUDE 'intranet-bottom.inc' %]