mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for bulk invoice downloads
This commit is contained in:
parent
055e40ccc6
commit
c298ab40fa
@ -185,7 +185,10 @@ class InvoiceController extends Controller
|
|||||||
$zip = new ZipStream(date('Y-m-d').'_'.str_replace(' ', '_', trans('texts.invoices')).'.zip', $options);
|
$zip = new ZipStream(date('Y-m-d').'_'.str_replace(' ', '_', trans('texts.invoices')).'.zip', $options);
|
||||||
|
|
||||||
foreach ($invoices as $invoice) {
|
foreach ($invoices as $invoice) {
|
||||||
$zip->addFileFromPath(basename($invoice->pdf_file_path()), TempFile::path($invoice->pdf_file_path()));
|
|
||||||
|
#add it to the zip
|
||||||
|
$zip->addFile(basename($invoice->pdf_file_path()), file_get_contents($invoice->pdf_file_path(null, 'url', true)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// finish the zip stream
|
// finish the zip stream
|
||||||
|
@ -107,7 +107,9 @@ class QuoteController extends Controller
|
|||||||
$zip = new ZipStream(date('Y-m-d').'_'.str_replace(' ', '_', trans('texts.invoices')).'.zip', $options);
|
$zip = new ZipStream(date('Y-m-d').'_'.str_replace(' ', '_', trans('texts.invoices')).'.zip', $options);
|
||||||
|
|
||||||
foreach ($quotes as $quote) {
|
foreach ($quotes as $quote) {
|
||||||
$zip->addFileFromPath(basename($quote->pdf_file_path()), TempFile::path($quote->pdf_file_path()));
|
$zip->addFile(basename($quote->pdf_file_path()), file_get_contents($quote->pdf_file_path(null, 'url', true)));
|
||||||
|
|
||||||
|
// $zip->addFileFromPath(basename($quote->pdf_file_path()), TempFile::path($quote->pdf_file_path()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// finish the zip stream
|
// finish the zip stream
|
||||||
|
@ -54,12 +54,19 @@ class CompanyPresenter extends EntityPresenter
|
|||||||
$settings = $this->entity->settings;
|
$settings = $this->entity->settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$context_options =array(
|
||||||
|
"ssl"=>array(
|
||||||
|
"verify_peer"=>false,
|
||||||
|
"verify_peer_name"=>false,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
if(strlen($settings->company_logo) >= 1 && (strpos($settings->company_logo, 'http') !== false))
|
if(strlen($settings->company_logo) >= 1 && (strpos($settings->company_logo, 'http') !== false))
|
||||||
return "data:image/png;base64, ". base64_encode(file_get_contents($settings->company_logo));
|
return "data:image/png;base64, ". base64_encode(file_get_contents($settings->company_logo, false, stream_context_create($context_options)));
|
||||||
else if(strlen($settings->company_logo) >= 1)
|
else if(strlen($settings->company_logo) >= 1)
|
||||||
return "data:image/png;base64, ". base64_encode(file_get_contents(url('') . $settings->company_logo));
|
return "data:image/png;base64, ". base64_encode(file_get_contents(url('') . $settings->company_logo, false, stream_context_create($context_options)));
|
||||||
else
|
else
|
||||||
return "data:image/png;base64, ". base64_encode(file_get_contents(asset('images/new_logo.png')));
|
return "data:image/png;base64, ". base64_encode(file_get_contents(asset('images/new_logo.png'), false, stream_context_create($context_options)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user