From 5346cca9acda40e38c28e45091942f43a544d9e2 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 14 Feb 2018 20:29:30 +0200 Subject: [PATCH] translation of time intervals in clients portal do not apply #1812 --- app/Http/Controllers/ClientPortalController.php | 10 ---------- app/Http/Middleware/Authenticate.php | 1 + app/Ninja/Repositories/InvoiceRepository.php | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/ClientPortalController.php b/app/Http/Controllers/ClientPortalController.php index d8954717aa..fab55f18d6 100644 --- a/app/Http/Controllers/ClientPortalController.php +++ b/app/Http/Controllers/ClientPortalController.php @@ -77,8 +77,6 @@ class ClientPortalController extends BaseController ]); } - $account->loadLocalizationSettings($client); - if (! Input::has('phantomjs') && ! session('silent:' . $client->id) && ! Session::has($invitation->invitation_key) && (! Auth::check() || Auth::user()->account_id != $invoice->account_id)) { if ($invoice->isType(INVOICE_TYPE_QUOTE)) { @@ -263,7 +261,6 @@ class ClientPortalController extends BaseController return redirect(request()->url()); } - $account->loadLocalizationSettings($client); $color = $account->primary_color ? $account->primary_color : '#0b4d78'; $customer = false; @@ -336,7 +333,6 @@ class ClientPortalController extends BaseController } $account = $contact->account; - $account->loadLocalizationSettings($contact->client); if (! $account->enable_client_portal) { return $this->returnError(); @@ -370,7 +366,6 @@ class ClientPortalController extends BaseController } $account = $contact->account; - $account->loadLocalizationSettings($contact->client); if (! $account->enable_client_portal) { return $this->returnError(); @@ -416,7 +411,6 @@ class ClientPortalController extends BaseController } $account = $contact->account; - $account->loadLocalizationSettings($contact->client); if (! $account->enable_client_portal) { return $this->returnError(); @@ -501,7 +495,6 @@ class ClientPortalController extends BaseController } $account = $contact->account; - $account->loadLocalizationSettings($contact->client); if (! $account->enable_client_portal) { return $this->returnError(); @@ -537,7 +530,6 @@ class ClientPortalController extends BaseController } $account = $contact->account; - $account->loadLocalizationSettings($contact->client); if (! $account->enable_client_portal) { return $this->returnError(); @@ -573,7 +565,6 @@ class ClientPortalController extends BaseController } $account = $contact->account; - $account->loadLocalizationSettings($contact->client); if (! $contact->client->show_tasks_in_portal) { return redirect()->to($account->enable_client_portal_dashboard ? '/client/dashboard' : '/client/payment_methods/'); @@ -613,7 +604,6 @@ class ClientPortalController extends BaseController } $account = $contact->account; - $account->loadLocalizationSettings($contact->client); if (! $account->enable_client_portal) { return $this->returnError(); diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index d9412a9012..852bef8abf 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -91,6 +91,7 @@ class Authenticate if ($authenticated) { $request->merge(['contact' => $contact]); + $account->loadLocalizationSettings($contact->client); } } diff --git a/app/Ninja/Repositories/InvoiceRepository.php b/app/Ninja/Repositories/InvoiceRepository.php index 32a3909f25..9f86a88c6b 100644 --- a/app/Ninja/Repositories/InvoiceRepository.php +++ b/app/Ninja/Repositories/InvoiceRepository.php @@ -240,7 +240,7 @@ class InvoiceRepository extends BaseRepository $table = \Datatable::query($query) ->addColumn('frequency', function ($model) { - return $model->frequency; + return trans('texts.freq_' . \Str::snake($model->frequency)); }) ->addColumn('start_date', function ($model) { return Utils::fromSqlDate($model->start_date);