mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 06:28:46 +02:00
N°3203 - Datamodel: Add semantic for image & state attributes Part. II
This commit is contained in:
@@ -52,8 +52,8 @@ class TitleFactory
|
||||
$oTitle->SetIcon($sObjIconUrl, $sIconCoverMethod);
|
||||
}
|
||||
|
||||
$sStatusAttCode = MetaModel::GetStateAttributeCode($sObjClass);
|
||||
if (!empty($sStatusAttCode)) {
|
||||
if (MetaModel::HasStateAttributeCode($sObjClass)) {
|
||||
$sStatusAttCode = MetaModel::GetStateAttributeCode($sObjClass);
|
||||
$sStateCode = $oObject->GetState();
|
||||
$sStatusLabel = $oObject->GetStateLabel();
|
||||
$sStatusColor = UIHelper::GetColorFromStatus(get_class($oObject), $sStateCode);
|
||||
|
||||
@@ -45,7 +45,7 @@ class CMDBChangeOpSetAttributeScalarFactory extends CMDBChangeOpSetAttributeFact
|
||||
$sAttCode = $oChangeOp->Get('attcode');
|
||||
|
||||
// Specific ActivityEntry for transition, otherwise just a regular EditsEntry
|
||||
if($sAttCode === MetaModel::GetStateAttributeCode($sHostObjectClass))
|
||||
if(MetaModel::HasLifecycle($sHostObjectClass) && ($sAttCode === MetaModel::GetStateAttributeCode($sHostObjectClass)))
|
||||
{
|
||||
$oDateTime = DateTime::createFromFormat(AttributeDateTime::GetInternalFormat(), $oChangeOp->Get('date'));
|
||||
|
||||
|
||||
@@ -48,8 +48,7 @@ class ObjectDetails extends Panel
|
||||
$this->sName = $oObject->GetRawName();
|
||||
$this->sIconUrl = $oObject->GetIcon(false);
|
||||
|
||||
$sStatusAttCode = MetaModel::GetStateAttributeCode($this->sClassName);
|
||||
if(!empty($sStatusAttCode)) {
|
||||
if(MetaModel::HasStateAttributeCode($this->sClassName)) {
|
||||
$this->sStatusCode = $oObject->GetState();
|
||||
$this->sStatusLabel = $oObject->GetStateLabel();
|
||||
$this->sStatusColor = UIHelper::GetColorFromStatus($this->sClassName, $this->sStatusCode);
|
||||
|
||||
Reference in New Issue
Block a user