mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #4264 from turbo124/v5-develop
Fixes for importing company logo
This commit is contained in:
commit
9b7aef1de6
@ -74,6 +74,7 @@ use App\Repositories\VendorRepository;
|
|||||||
use App\Utils\Traits\CleanLineItems;
|
use App\Utils\Traits\CleanLineItems;
|
||||||
use App\Utils\Traits\CompanyGatewayFeesAndLimitsSaver;
|
use App\Utils\Traits\CompanyGatewayFeesAndLimitsSaver;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use App\Utils\Traits\Uploadable;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
@ -91,7 +92,7 @@ class Import implements ShouldQueue
|
|||||||
use CompanyGatewayFeesAndLimitsSaver;
|
use CompanyGatewayFeesAndLimitsSaver;
|
||||||
use MakesHash;
|
use MakesHash;
|
||||||
use CleanLineItems;
|
use CleanLineItems;
|
||||||
|
use Uploadable;
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
@ -260,6 +261,14 @@ class Import implements ShouldQueue
|
|||||||
$company_repository = new CompanyRepository();
|
$company_repository = new CompanyRepository();
|
||||||
$company_repository->save($data, $this->company);
|
$company_repository->save($data, $this->company);
|
||||||
|
|
||||||
|
if(isset($data['settings']->company_logo)) {
|
||||||
|
|
||||||
|
$tempImage = tempnam(sys_get_temp_dir(), basename($data['settings']->company_logo));
|
||||||
|
copy($data['settings']->company_logo, $tempImage);
|
||||||
|
$this->uploadLogo($tempImage, $this->company, $this->company);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Company::reguard();
|
Company::reguard();
|
||||||
|
|
||||||
/*Improve memory handling by setting everything to null when we have finished*/
|
/*Improve memory handling by setting everything to null when we have finished*/
|
||||||
|
@ -25,8 +25,6 @@ trait Uploadable
|
|||||||
{
|
{
|
||||||
$company_logo = $company->settings->company_logo;
|
$company_logo = $company->settings->company_logo;
|
||||||
|
|
||||||
info("company logo to be deleted = {$company_logo}");
|
|
||||||
|
|
||||||
$file_name = basename($company_logo);
|
$file_name = basename($company_logo);
|
||||||
|
|
||||||
$storage_path = $company->company_key . '/' . $file_name;
|
$storage_path = $company->company_key . '/' . $file_name;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user