diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 6290d6ab..115c3d42 100644 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -93,6 +93,7 @@ class SettingsController extends Controller 'company_name' => Option::get('company_name', \Config::get('app.name')), 'next_ticket' => Option::get('next_ticket'), 'user_permissions' => Option::get('user_permissions', []), + 'email_branding' => Option::get('email_branding'), 'open_tracking' => Option::get('open_tracking'), 'enrich_customer_data' => Option::get('enrich_customer_data'), 'time_format' => Option::get('time_format', User::TIME_FORMAT_24), diff --git a/app/Option.php b/app/Option.php index 308d501a..b9ae0fef 100644 --- a/app/Option.php +++ b/app/Option.php @@ -8,6 +8,9 @@ use Illuminate\Database\Eloquent\Model; class Option extends Model { + // todo: cache in file (see WordPress) + public static $cache = []; + public $timestamps = false; /** @@ -62,18 +65,28 @@ class Option extends Model * @param string $name * @return string */ - public static function get($name, $default = false, $decode = true) + public static function get($name, $default = false, $decode = true, $cache = false) { + if ($cache && isset(self::$cache[$name])) { + return self::$cache[$name]; + } + $option = Option::where('name', (string)$name)->first(); if ($option) { if ($decode) { - return self::maybeUnserialize($option->value); + $value = self::maybeUnserialize($option->value); } else { - return $option->value; + $value = $option->value; } } else { - return $default; + $value = $default; } + + if ($cache) { + self::$cache[$name] = $value; + } + + return $value; } public static function remove($name) diff --git a/resources/views/conversations/conversations_table.blade.php b/resources/views/conversations/conversations_table.blade.php index 771887d6..9b21e0f0 100644 --- a/resources/views/conversations/conversations_table.blade.php +++ b/resources/views/conversations/conversations_table.blade.php @@ -39,7 +39,7 @@ {{ __("Conversation") }} @if ($folder->type == App\Folder::TYPE_ASSIGNED || $folder->type == App\Folder::TYPE_CLOSED) - + {{ __("Assigned To") }}