N°4142 - Improve backoffice rendering by showing system avatar no matter what

This commit is contained in:
Molkobain
2021-07-15 21:34:58 +02:00
parent dfbbee2a1c
commit 82e3ddaacd

View File

@@ -221,13 +221,15 @@ class ActivityEntry extends UIBlock
// - Initials
$this->sAuthorInitials = UserRights::GetUserInitials($this->sAuthorLogin);
// - Picture
// ... first compute the user picture...
if (in_array('backoffice', utils::GetConfig()->Get('activity_panel.hide_avatars'))) {
$this->sAuthorPictureAbsUrl = null;
} else {
$this->sAuthorPictureAbsUrl = UserRights::GetUserPictureAbsUrl($this->sAuthorLogin, false);
if ((null === $this->sAuthorPictureAbsUrl) && (ITOP_APPLICATION_SHORT === $this->sAuthorLogin)) {
$this->sAuthorPictureAbsUrl = utils::GetAbsoluteUrlAppRoot().static::DEFAULT_AUTHOR_PICTURE_REL_URL;
}
}
// ... then fallback on system picture if necessary
if ((null === $this->sAuthorPictureAbsUrl) && (ITOP_APPLICATION_SHORT === $this->sAuthorLogin)) {
$this->sAuthorPictureAbsUrl = utils::GetAbsoluteUrlAppRoot().static::DEFAULT_AUTHOR_PICTURE_REL_URL;
}
$this->bIsFromCurrentUser = UserRights::GetUserId($this->sAuthorLogin) === UserRights::GetUserId();