mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 07:24:34 -04:00
Fixes for customised language options for Preview Controller
This commit is contained in:
parent
0f861554f0
commit
8abce54d7e
@ -101,8 +101,6 @@ class Handler extends ExceptionHandler
|
|||||||
|
|
||||||
private function validException($exception)
|
private function validException($exception)
|
||||||
{
|
{
|
||||||
info("the exception is ");
|
|
||||||
info($exception->getMessage());
|
|
||||||
|
|
||||||
if(strpos($exception->getMessage(), 'file_put_contents') === TRUE)
|
if(strpos($exception->getMessage(), 'file_put_contents') === TRUE)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -110,6 +108,10 @@ class Handler extends ExceptionHandler
|
|||||||
if(strpos($exception->getMessage(), 'Permission denied') === TRUE)
|
if(strpos($exception->getMessage(), 'Permission denied') === TRUE)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
if(strpos($exception->getMessage(), 'flock()') === TRUE)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ class EmailController extends BaseController
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$entity_obj->service()->markSent()->save();
|
$entity_obj = $entity_obj->service()->markSent()->save();
|
||||||
|
|
||||||
$entity_obj->last_sent_date = now();
|
$entity_obj->last_sent_date = now();
|
||||||
$entity_obj->save();
|
$entity_obj->save();
|
||||||
@ -172,8 +172,6 @@ class EmailController extends BaseController
|
|||||||
$this->entity_transformer = RecurringInvoiceTransformer::class;
|
$this->entity_transformer = RecurringInvoiceTransformer::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
$entity_obj->service()->markSent()->save();
|
|
||||||
|
|
||||||
return $this->itemResponse($entity_obj);
|
return $this->itemResponse($entity_obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,11 +20,14 @@ use App\Models\InvoiceInvitation;
|
|||||||
use App\Services\PdfMaker\Design;
|
use App\Services\PdfMaker\Design;
|
||||||
use App\Services\PdfMaker\PdfMaker;
|
use App\Services\PdfMaker\PdfMaker;
|
||||||
use App\Utils\HtmlEngine;
|
use App\Utils\HtmlEngine;
|
||||||
|
use App\Utils\Ninja;
|
||||||
use App\Utils\PhantomJS\Phantom;
|
use App\Utils\PhantomJS\Phantom;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use App\Utils\Traits\MakesInvoiceHtml;
|
use App\Utils\Traits\MakesInvoiceHtml;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Response;
|
use Illuminate\Support\Facades\Response;
|
||||||
|
use Illuminate\Support\Facades\App;
|
||||||
|
use Illuminate\Support\Facades\Lang;
|
||||||
|
|
||||||
class PreviewController extends BaseController
|
class PreviewController extends BaseController
|
||||||
{
|
{
|
||||||
@ -96,15 +99,16 @@ class PreviewController extends BaseController
|
|||||||
|
|
||||||
$entity_obj->load('client');
|
$entity_obj->load('client');
|
||||||
|
|
||||||
|
App::setLocale($entity_obj->client->primary_contact()->preferredLocale());
|
||||||
|
App::forgetInstance('translator');
|
||||||
|
Lang::replace(Ninja::transformTranslations($entity_obj->client->getMergedSettings()));
|
||||||
|
|
||||||
$html = new HtmlEngine($entity_obj->invitations()->first());
|
$html = new HtmlEngine($entity_obj->invitations()->first());
|
||||||
|
|
||||||
$design_namespace = 'App\Services\PdfMaker\Designs\\'.request()->design['name'];
|
$design_namespace = 'App\Services\PdfMaker\Designs\\'.request()->design['name'];
|
||||||
|
|
||||||
$design_class = new $design_namespace();
|
$design_class = new $design_namespace();
|
||||||
|
|
||||||
// $designer = new Designer($entity_obj, $design_object, $entity_obj->client->getSetting('pdf_variables'), lcfirst($entity));
|
|
||||||
// $html = $this->generateEntityHtml($designer, $entity_obj);
|
|
||||||
|
|
||||||
$state = [
|
$state = [
|
||||||
'template' => $design_class->elements([
|
'template' => $design_class->elements([
|
||||||
'client' => $entity_obj->client,
|
'client' => $entity_obj->client,
|
||||||
@ -141,6 +145,10 @@ class PreviewController extends BaseController
|
|||||||
|
|
||||||
private function blankEntity()
|
private function blankEntity()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
App::forgetInstance('translator');
|
||||||
|
Lang::replace(Ninja::transformTranslations(auth()->user()->company()->settings));
|
||||||
|
|
||||||
DB::beginTransaction();
|
DB::beginTransaction();
|
||||||
|
|
||||||
$client = Client::factory()->create([
|
$client = Client::factory()->create([
|
||||||
|
Loading…
x
Reference in New Issue
Block a user