mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
N°2847 - ActivityPanel: Fix entry's author info for CMDBChangeOp
This commit is contained in:
@@ -175,22 +175,12 @@ class CMDBChangeOpDelete extends CMDBChangeOp
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface iCMDBChangeOpSetAttribute
|
||||
*
|
||||
* @since 2.8.0
|
||||
*/
|
||||
interface iCMDBChangeOpSetAttribute
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Record the modification of an attribute (abstract)
|
||||
*
|
||||
* @package iTopORM
|
||||
*/
|
||||
class CMDBChangeOpSetAttribute extends CMDBChangeOp implements iCMDBChangeOpSetAttribute
|
||||
class CMDBChangeOpSetAttribute extends CMDBChangeOp
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
|
||||
@@ -1291,7 +1291,20 @@ class UserRights
|
||||
}
|
||||
if (is_null($oUser))
|
||||
{
|
||||
return '';
|
||||
$sInitials = '';
|
||||
$aLoginParts = explode(' ', $sLogin);
|
||||
foreach($aLoginParts as $sLoginPart)
|
||||
{
|
||||
// Keep only upper case first letters
|
||||
// eg. "My first name My last name" => "MM"
|
||||
// eg. "Carrie Anne Moss" => "CAM"
|
||||
if(preg_match('/^\p{Lu}/u', $sLoginPart) > 0)
|
||||
{
|
||||
$sInitials .= mb_substr($sLoginPart, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
return $sInitials;
|
||||
}
|
||||
return $oUser->GetInitials();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user