format($format); } catch (\Exception $e) { $hireDateLabel = $hireDate; } } $avatarUuid = (string) ($values['uuid'] ?? ''); $hasAvatar = !empty($values['has_avatar']) && $avatarUuid !== ''; $initials = ''; if ($displayName !== '') { $parts = array_filter(array_map('trim', preg_split('/\s+/', $displayName) ?: [])); $chars = ''; foreach ($parts as $part) { if (function_exists('mb_substr')) { $chars .= mb_substr($part, 0, 1); } else { $chars .= substr($part, 0, 1); } } $initials = strtoupper($chars !== '' ? $chars : '?'); } $tenantGroups = $values['tenant_groups'] ?? []; $tenantGroups = is_array($tenantGroups) ? $tenantGroups : []; $primaryTenantLabel = ''; $primaryTenantDepartments = []; foreach ($tenantGroups as $group) { if (!empty($group['is_primary'])) { $primaryTenantLabel = trim((string) ($group['label'] ?? '')); $primaryDepts = $group['departments'] ?? []; $primaryTenantDepartments = is_array($primaryDepts) ? $primaryDepts : []; break; } } $hasContact = ($email !== '' || $phone !== '' || $mobile !== ''); $hasAddress = ($address !== '' || $postalCode !== '' || $city !== '' || $region !== '' || $country !== ''); // Organization tab only appears for multi-tenant users — single-tenant info // is already communicated through the header chips, and redundancy hurts more // than a minor asymmetry. $hasOrganization = count($tenantGroups) > 1; $hasAbout = ($profileDescription !== '' || $hireDateLabel !== '' || $shortDial !== ''); $hasAnyTab = ($hasAddress || $hasAbout || $hasOrganization); $copyEmailLabel = t('Copy email address'); $copyPhoneLabel = t('Copy phone number'); $copyMobileLabel = t('Copy mobile number'); ?>
' . htmlspecialchars($label, ENT_QUOTES, 'UTF-8') . ''; }; ?>
  • ·