mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 17:18:51 +02:00
Object details: Fix icon / color lost since 27e68404
This commit is contained in:
@@ -66,16 +66,13 @@ class ObjectDetails extends Panel implements iKeyboardShortcut
|
||||
// Note: We get the raw name as only the front-end consumer knows when and how to encode it.
|
||||
$this->sObjectMode = $sMode;
|
||||
|
||||
if ($this->sObjectMode == "create") {
|
||||
$this->sObjectName = Dict::Format('UI:CreationTitle_Class', $this->sClassLabel);
|
||||
} else {
|
||||
$this->sObjectName = $oObject->GetRawName();
|
||||
$this->ComputeObjectName($oObject);
|
||||
|
||||
$this->SetColorFromClass($this->sClassName);
|
||||
$this->ComputeIconUrl($oObject);
|
||||
$this->ComputeState($oObject);
|
||||
}
|
||||
parent::__construct($this->sObjectName, [], static::DEFAULT_COLOR, $sId);
|
||||
|
||||
$this->SetColorFromClass($this->sClassName);
|
||||
$this->ComputeIconUrl($oObject);
|
||||
$this->ComputeState($oObject);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -207,6 +204,21 @@ class ObjectDetails extends Panel implements iKeyboardShortcut
|
||||
$this->sStatusColor = UIHelper::GetColorFromStatus($this->sClassName, $this->sStatusCode);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \DBObject $oObject
|
||||
* @see static::$oObject
|
||||
*
|
||||
* @throws \CoreException
|
||||
*/
|
||||
protected function ComputeObjectName(DBObject $oObject): void
|
||||
{
|
||||
if ($this->sObjectMode === cmdbAbstractObject::ENUM_OBJECT_MODE_CREATE) {
|
||||
$this->sObjectName = Dict::Format('UI:CreationTitle_Class', $this->sClassLabel);
|
||||
} else {
|
||||
$this->sObjectName = $oObject->GetRawName();
|
||||
}
|
||||
}
|
||||
|
||||
public static function GetShortcutKeys(): array
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user