diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index 1987d754e626..73006f39bab1 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -124,7 +124,7 @@ class InvoiceController extends BaseController Session::put('invitation_key', $invitationKey); // track current invitation $account->loadLocalizationSettings($client); - + $invoice->invoice_date = Utils::fromSqlDate($invoice->invoice_date); $invoice->due_date = Utils::fromSqlDate($invoice->due_date); $invoice->is_pro = $account->isPro(); diff --git a/app/Http/Middleware/StartupCheck.php b/app/Http/Middleware/StartupCheck.php index 3d10c1cb813c..74d9c4c8ae5d 100644 --- a/app/Http/Middleware/StartupCheck.php +++ b/app/Http/Middleware/StartupCheck.php @@ -104,6 +104,8 @@ class StartupCheck } elseif (Auth::check()) { $locale = Auth::user()->account->language ? Auth::user()->account->language->locale : DEFAULT_LOCALE; App::setLocale($locale); + } elseif (session(SESSION_LOCALE)) { + App::setLocale(session(SESSION_LOCALE)); } // Make sure the account/user localization settings are in the session diff --git a/app/Http/routes.php b/app/Http/routes.php index 729f292c99df..0094629aa12c 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -394,7 +394,6 @@ if (!defined('CONTACT_EMAIL')) { define('DEFAULT_DATE_PICKER_FORMAT', 'M d, yyyy'); define('DEFAULT_DATETIME_FORMAT', 'F j, Y g:i a'); define('DEFAULT_DATETIME_MOMENT_FORMAT', 'MMM D, YYYY h:mm:ss a'); - define('DEFAULT_QUERY_CACHE', 120); // minutes define('DEFAULT_LOCALE', 'en'); define('DEFAULT_MAP_ZOOM', 10); diff --git a/app/Libraries/Utils.php b/app/Libraries/Utils.php index 08e74055c361..1df5d436c744 100644 --- a/app/Libraries/Utils.php +++ b/app/Libraries/Utils.php @@ -232,7 +232,7 @@ class Utils return floatval($value); } - public static function formatMoney($value, $currencyId = false) + public static function formatMoney($value, $currencyId = false, $showSymbol = true) { if (!$currencyId) { $currencyId = Session::get(SESSION_CURRENCY, DEFAULT_CURRENCY); @@ -252,9 +252,11 @@ class Utils $value = 0; } - Cache::add('currency', $currency, DEFAULT_QUERY_CACHE); - - return $currency->symbol.number_format($value, $currency->precision, $currency->decimal_separator, $currency->thousand_separator); + $str = ''; + if ($showSymbol) { + $str .= $currency->symbol; + } + return $str . number_format($value, $currency->precision, $currency->decimal_separator, $currency->thousand_separator); } public static function pluralize($string, $count) diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 4811d984e924..b47b6a1a14fe 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -939,6 +939,8 @@ return array( 'user_unregistered' => 'Please register your account to send emails', 'user_unconfirmed' => 'Please confirm your account to send emails', 'invalid_contact_email' => 'Invalid contact email', - ] + ], + + 'client_portal' => 'Client Portal', ); diff --git a/resources/views/master.blade.php b/resources/views/master.blade.php index 0227c9eed50c..a5238a437f52 100644 --- a/resources/views/master.blade.php +++ b/resources/views/master.blade.php @@ -1,8 +1,13 @@
-