mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #8694 from turbo124/v5-develop
Fixes for unlinking company exports
This commit is contained in:
commit
9af4d3fe6c
@ -188,19 +188,19 @@ class PreviewController extends BaseController
|
|||||||
|
|
||||||
if ($request->input('entity') == 'quote') {
|
if ($request->input('entity') == 'quote') {
|
||||||
$repo = new QuoteRepository();
|
$repo = new QuoteRepository();
|
||||||
$entity_obj = QuoteFactory::create($company->id, auth()->user()->id);
|
$entity_obj = QuoteFactory::create($company->id, $user->id);
|
||||||
$class = Quote::class;
|
$class = Quote::class;
|
||||||
} elseif ($request->input('entity') == 'credit') {
|
} elseif ($request->input('entity') == 'credit') {
|
||||||
$repo = new CreditRepository();
|
$repo = new CreditRepository();
|
||||||
$entity_obj = CreditFactory::create($company->id, auth()->user()->id);
|
$entity_obj = CreditFactory::create($company->id, $user->id);
|
||||||
$class = Credit::class;
|
$class = Credit::class;
|
||||||
} elseif ($request->input('entity') == 'recurring_invoice') {
|
} elseif ($request->input('entity') == 'recurring_invoice') {
|
||||||
$repo = new RecurringInvoiceRepository();
|
$repo = new RecurringInvoiceRepository();
|
||||||
$entity_obj = RecurringInvoiceFactory::create($company->id, auth()->user()->id);
|
$entity_obj = RecurringInvoiceFactory::create($company->id, $user->id);
|
||||||
$class = RecurringInvoice::class;
|
$class = RecurringInvoice::class;
|
||||||
} else { //assume it is either an invoice or a null object
|
} else { //assume it is either an invoice or a null object
|
||||||
$repo = new InvoiceRepository();
|
$repo = new InvoiceRepository();
|
||||||
$entity_obj = InvoiceFactory::create($company->id, auth()->user()->id);
|
$entity_obj = InvoiceFactory::create($company->id, $user->id);
|
||||||
$class = Invoice::class;
|
$class = Invoice::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -460,7 +460,9 @@ class CompanyExport implements ShouldQueue
|
|||||||
$zip->close();
|
$zip->close();
|
||||||
|
|
||||||
Storage::disk(config('filesystems.default'))->put('backups/'.$file_name, file_get_contents($zip_path));
|
Storage::disk(config('filesystems.default'))->put('backups/'.$file_name, file_get_contents($zip_path));
|
||||||
unlink($zip_path);
|
|
||||||
|
if(file_exists($zip_path))
|
||||||
|
unlink($zip_path);
|
||||||
|
|
||||||
if(Ninja::isSelfHost())
|
if(Ninja::isSelfHost())
|
||||||
$storage_path = 'backups/'.$file_name;
|
$storage_path = 'backups/'.$file_name;
|
||||||
@ -489,7 +491,9 @@ class CompanyExport implements ShouldQueue
|
|||||||
|
|
||||||
if (Ninja::isHosted()) {
|
if (Ninja::isHosted()) {
|
||||||
sleep(3);
|
sleep(3);
|
||||||
unlink($zip_path);
|
|
||||||
|
if(file_exists($zip_path))
|
||||||
|
unlink($zip_path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user