mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
- Better display of the archives/change log on each object (Trac ticket #9)
SVN:trunk[89]
This commit is contained in:
@@ -42,6 +42,16 @@ class CMDBChangeOp extends DBObject
|
||||
MetaModel::Init_AddFilterFromAttribute("objkey");
|
||||
MetaModel::Init_AddFilterFromAttribute("date");
|
||||
MetaModel::Init_AddFilterFromAttribute("userinfo");
|
||||
|
||||
MetaModel::Init_SetZListItems('details', array('change', 'date', 'userinfo')); // Attributes to be displayed for the complete details
|
||||
MetaModel::Init_SetZListItems('list', array('change', 'date', 'userinfo')); // Attributes to be displayed for the complete details
|
||||
}
|
||||
/**
|
||||
* Describe (as a text string) the modifications corresponding to this change
|
||||
*/
|
||||
public function GetDescription()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,6 +90,14 @@ class CMDBChangeOpCreate extends CMDBChangeOp
|
||||
|
||||
MetaModel::Init_InheritFilters();
|
||||
}
|
||||
|
||||
/**
|
||||
* Describe (as a text string) the modifications corresponding to this change
|
||||
*/
|
||||
public function GetDescription()
|
||||
{
|
||||
return 'Object created';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -116,6 +134,13 @@ class CMDBChangeOpDelete extends CMDBChangeOp
|
||||
|
||||
MetaModel::Init_InheritFilters();
|
||||
}
|
||||
/**
|
||||
* Describe (as a text string) the modifications corresponding to this change
|
||||
*/
|
||||
public function GetDescription()
|
||||
{
|
||||
return 'Object deleted';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -162,6 +187,24 @@ class CMDBChangeOpSetAttribute extends CMDBChangeOp
|
||||
MetaModel::Init_SetZListItems('details', array('date', 'userinfo', 'attcode', 'oldvalue', 'newvalue')); // Attributes to be displayed for the complete details
|
||||
MetaModel::Init_SetZListItems('list', array('date', 'userinfo', 'attcode', 'oldvalue', 'newvalue')); // Attributes to be displayed for a list
|
||||
}
|
||||
|
||||
/**
|
||||
* Describe (as a text string) the modifications corresponding to this change
|
||||
*/
|
||||
public function GetDescription()
|
||||
{
|
||||
$sResult = '';
|
||||
$oEmptySet = new DBObjectSet($this->Get('objclass'));
|
||||
if (UserRights::IsActionAllowedOnAttribute($this->Get('objclass'), $this->Get('attcode'), UR_ACTION_READ, $oEmptySet) == UR_ALLOWED_YES)
|
||||
{
|
||||
$oAttDef = MetaModel::GetAttributeDef($this->Get('objclass'), $this->Get('attcode'));
|
||||
$sAttName = $oAttDef->GetLabel();
|
||||
$sNewValue = $this->Get('newvalue');
|
||||
$sOldValue = $this->Get('oldvalue');
|
||||
$sResult = "$sAttName set to $sNewValue (previous value: $sOldValue)";
|
||||
}
|
||||
return $sResult;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user