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