148 lines
6.1 KiB
Text
148 lines
6.1 KiB
Text
[% USE raw %]
|
|
[% USE Asset %]
|
|
[% USE KohaDates %]
|
|
[% SET footerjs = 1 %]
|
|
[% PROCESS 'i18n.inc' %]
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>[% FILTER collapse %]
|
|
[% t("Files") | html %] ›
|
|
[% t("Invoice") | html %] ›
|
|
[% t("Acquisitions") | html %] ›
|
|
[% t("Koha") | html %]
|
|
[% END %]</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
</head>
|
|
|
|
<body id="acq_invoice_files" class="acq">
|
|
[% WRAPPER 'header.inc' %]
|
|
[% INCLUDE 'acquisitions-search.inc' %]
|
|
[% END %]
|
|
|
|
[% WRAPPER 'sub-header.inc' %]
|
|
[% WRAPPER breadcrumbs %]
|
|
[% WRAPPER breadcrumb_item %]
|
|
<a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
|
|
[% END %]
|
|
[% WRAPPER breadcrumb_item %]
|
|
<a href="/cgi-bin/koha/acqui/invoices.pl">Invoices</a>
|
|
[% END %]
|
|
[% WRAPPER breadcrumb_item %]
|
|
<a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoiceid | uri %]">[% invoicenumber | html %]</a>
|
|
[% END %]
|
|
[% WRAPPER breadcrumb_item bc_active= 1 %]
|
|
<span>Files</span>
|
|
[% END %]
|
|
[% END #/ WRAPPER breadcrumbs %]
|
|
[% END #/ WRAPPER sub-header.inc %]
|
|
|
|
<div class="main container-fluid">
|
|
<div class="row">
|
|
<div class="col-sm-10 col-sm-push-2">
|
|
<main>
|
|
[% INCLUDE 'messages.inc' %]
|
|
|
|
<h1>Files for invoice: [% invoicenumber | html %]</h1>
|
|
<p><strong>Vendor: </strong><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% suppliername | html %]</a></p>
|
|
<br />
|
|
[% IF errors %]
|
|
<div class="dialog alert">
|
|
[% IF errors.empty_upload %]The file you are attempting to upload has no contents.[% END %]
|
|
[% IF errors.no_file %]You did not select a file to upload.[% END %]
|
|
[% IF errors.invalid_parameter %]Invalid or missing script parameter.[% END %]
|
|
</div>
|
|
[% END %]
|
|
[% IF files %]
|
|
<div class="page-section">
|
|
<table id="invoice_files_details_table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
<th>Uploaded</th>
|
|
<th>Bytes</th>
|
|
<th> </th>
|
|
<th> </th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
[% FOREACH f IN files %]
|
|
<tr>
|
|
<td><a href="?invoiceid=[% invoiceid | uri %]&op=download&view=1&file_id=[% f.file_id | uri %]">[% f.file_name | html %]</a></td>
|
|
<td>[% f.file_type | html %]</td>
|
|
<td>[% f.file_description | html %]</td>
|
|
<td data-order="[% f.date_uploaded | html %]">
|
|
[% f.date_uploaded | $KohaDates %]
|
|
</td>
|
|
<td>[% f.file_size | html %]</td>
|
|
<td>
|
|
<form action="invoice-files.pl" method="post">
|
|
[% INCLUDE 'csrf-token.inc' %]
|
|
<input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
|
|
<input type="hidden" name="file_id" value="[% f.file_id | html %]" />
|
|
<input type="hidden" name="op" value="cud-delete" />
|
|
<button type="submit" class="btn btn-default btn-xs delete_file">
|
|
<i class="fa fa-trash"></i> Delete
|
|
</button>
|
|
</form>
|
|
</td>
|
|
<td><a class="btn btn-default btn-xs" href="?invoiceid=[% invoiceid | uri %]&op=download&file_id=[% f.file_id | uri %]"><i class="fa fa-download"></i> Download</a></td>
|
|
</tr>
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
[% ELSE %]
|
|
<div class="dialog message">
|
|
<p>This invoice has no files attached.</p>
|
|
</div>
|
|
[% END %]
|
|
[% IF invoiceid %]
|
|
<br />
|
|
<form method="post" action="/cgi-bin/koha/acqui/invoice-files.pl" enctype="multipart/form-data">
|
|
[% INCLUDE 'csrf-token.inc' %]
|
|
<fieldset class="rows">
|
|
<legend>Upload new file</legend>
|
|
<ol>
|
|
<li><input type="hidden" name="op" value="cud-upload" />
|
|
<input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
|
|
<label for="description">Description:</label>
|
|
<input name="description" id="description" type="text" /></li>
|
|
<li><label for="uploadfile">File:</label><input name="uploadfile" type="file" id="uploadfile" /></li>
|
|
</ol>
|
|
</fieldset>
|
|
<fieldset class="action"><input name="upload" type="submit" id="upload" class="btn btn-primary" value="Upload file" /></fieldset>
|
|
</form>
|
|
[% END %]
|
|
</main>
|
|
</div> <!-- /.col-sm-10.col-sm-push-2 -->
|
|
|
|
<div class="col-sm-2 col-sm-pull-10">
|
|
<aside>
|
|
[% INCLUDE 'acquisitions-menu.inc' %]
|
|
</aside>
|
|
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
|
|
</div> <!-- /.row -->
|
|
|
|
[% MACRO jsinclude BLOCK %]
|
|
[% Asset.js("js/acquisitions-menu.js") | $raw %]
|
|
[% INCLUDE 'datatables.inc' %]
|
|
<script>
|
|
$(document).ready(function() {
|
|
$("#invoice_files_details_table").dataTable($.extend(true, {}, dataTablesDefaults, {
|
|
"columnDefs": [
|
|
{ "targets": [ -1, -2 ], "orderable": false, "searchable": false }
|
|
],
|
|
"info": false,
|
|
"paging": false,
|
|
"searching": false,
|
|
"dom": "t"
|
|
}));
|
|
$(".delete_file").click(function(){
|
|
return ( confirm( _("Are you sure you want to delete this file ?") ) );
|
|
});
|
|
});
|
|
</script>
|
|
[% END %]
|
|
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|