mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
N°2836 - Portal: Introduce bubbles conversation as default caselog rendering
This commit is contained in:
@@ -1110,12 +1110,13 @@ class UserRights
|
||||
/**
|
||||
* Return the absolute URL of the contact picture
|
||||
*
|
||||
* @param string $sLogin Login of the user from which we return the picture URL
|
||||
* @param bool $bAllowDefaultPicture Set to false if you want it to return null instead of the default picture URL when the contact has no picture defined. This can be useful when we want to display something else than the default picture (eg. initials)
|
||||
* @param string $sLogin Login of the user from which we return the picture URL
|
||||
* @param bool $bAllowDefaultPicture Set to false if you want it to return null instead of the default picture URL when the contact has no picture defined. This can be useful when we want to display something else than the default picture (eg. initials)
|
||||
*
|
||||
* @return null|string
|
||||
* @throws \ArchivedObjectException
|
||||
* @throws \CoreException
|
||||
* @throws \Exception
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public static function GetContactPictureAbsUrl($sLogin = '', $bAllowDefaultPicture = true)
|
||||
@@ -1134,10 +1135,10 @@ class UserRights
|
||||
$sContactId = UserRights::GetContactId($sLogin);
|
||||
if(!empty($sContactId))
|
||||
{
|
||||
$oContact = MetaModel::GetObject('Contact', $sContactId);
|
||||
$oContact = MetaModel::GetObject('Contact', $sContactId, false, true);
|
||||
$sContactClass = get_class($oContact);
|
||||
|
||||
// Check that contact has a picture attribute
|
||||
// Check that Contact object still exists and that Contact class has a picture attribute
|
||||
if(!is_null($oContact) && MetaModel::IsValidAttCode($sContactClass, static::DEFAULT_CONTACT_PICTURE_ATTCODE))
|
||||
{
|
||||
/** @var \ormDocument $oPicture */
|
||||
@@ -1157,7 +1158,12 @@ class UserRights
|
||||
}
|
||||
else
|
||||
{
|
||||
$sPictureUrl = $oPicture->GetDisplayURL($sContactClass, $oContact->GetKey(), static::DEFAULT_CONTACT_PICTURE_ATTCODE);
|
||||
if (ContextTag::Check(ContextTag::TAG_PORTAL)) {
|
||||
$sPictureUrl = utils::GetAbsoluteUrlAppRoot().'pages/exec.php/object/document/display/'.$sContactClass.'/'.$oContact->GetKey().'/'.static::DEFAULT_CONTACT_PICTURE_ATTCODE.'?exec_module=itop-portal-base&exec_page=index.php&portal_id='.PORTAL_ID;
|
||||
}
|
||||
else {
|
||||
$sPictureUrl = $oPicture->GetDisplayURL($sContactClass, $oContact->GetKey(), static::DEFAULT_CONTACT_PICTURE_ATTCODE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user