[Legacy] Add 'show_fullname' option

This commit is contained in:
y.yerli 2024-06-13 11:53:52 +03:00
parent 6c8d45e914
commit 15b5e8aa6e
3 changed files with 8 additions and 1 deletions

View file

@ -57,6 +57,12 @@ class AssignedUserMapper implements FieldMapperInterface
}
$container[$name] = get_user_name($bean->assigned_user_id);
$assignedUser = BeanFactory::getBean('Users', $bean->assigned_user_id);
if (!empty(showFullName())) {
$container['full_name'] = $assignedUser->full_name ?? '';
}
}
/**

View file

@ -1134,7 +1134,7 @@ function showFullName()
$sysPref = !empty($sugar_config['use_real_names']);
$userPref = (is_object($current_user)) ? $current_user->getPreference('use_real_names') : null;
if ($userPref != null) {
if ($userPref != null && $userPref != 'off') {
$showFullName = ($userPref == 'on');
} else {
$showFullName = $sysPref;

View file

@ -1027,6 +1027,7 @@ class User extends Person implements EmailInterface
$cacheManager->markAsNeedsUpdate('app-metadata-user-preferences-'.$this->id);
$cacheManager->markAsNeedsUpdate('app-metadata-language-strings-'. ($_POST['language'] ?? '') ?? $_SESSION['authenticated_user_language']);
$cacheManager->markAsNeedsUpdate('app-metadata-theme-images');
$cacheManager->markAsNeedsUpdate('rebuild_all');
}