From 6c62dbc604615f0cc2c4b0b58f0622f9ef86d0eb Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Fri, 29 Mar 2024 11:34:52 +0200 Subject: [PATCH] portal avatar color --- application/Espo/EntryPoints/Avatar.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/application/Espo/EntryPoints/Avatar.php b/application/Espo/EntryPoints/Avatar.php index 6a334f7d88..5b34ce0922 100644 --- a/application/Espo/EntryPoints/Avatar.php +++ b/application/Espo/EntryPoints/Avatar.php @@ -47,10 +47,11 @@ use LasseRafn\StringScript; */ class Avatar extends Image { - protected string $systemColor = '#a4b5bd'; + private string $systemColor = '#a4b5bd'; + private string $portalColor = '#c9a3d1'; /** @var string[] */ - protected $colorList = [ + private array $colorList = [ '#6fa8d6', '#edc555', '#d4729b', @@ -68,6 +69,10 @@ class Avatar extends Image return $this->metadata->get(['app', 'avatars', 'systemColor']) ?? $this->systemColor; } + if ($user->isPortal()) { + return $this->metadata->get(['app', 'avatars', 'portalColor']) ?? $this->portalColor; + } + $hash = $user->getId(); $length = strlen($hash);