From f61867804403c2f21b619c211d87444795a8234e Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Mon, 14 Sep 2009 08:38:52 +0000 Subject: [PATCH] Hyperlinks in the history logs presentation SVN:code[155] --- trunk/core/cmdbchangeop.class.inc.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/trunk/core/cmdbchangeop.class.inc.php b/trunk/core/cmdbchangeop.class.inc.php index 2c09139103..c7ff31d5de 100644 --- a/trunk/core/cmdbchangeop.class.inc.php +++ b/trunk/core/cmdbchangeop.class.inc.php @@ -193,6 +193,9 @@ class CMDBChangeOpSetAttribute extends CMDBChangeOp */ public function GetDescription() { + // Temporary, until we change the options of GetDescription() -needs a more global revision + $bIsHtml = true; + $sResult = ''; $oTargetObjectClass = $this->Get('objclass'); $oTargetObjectKey = $this->Get('objkey'); @@ -225,9 +228,16 @@ class CMDBChangeOpSetAttribute extends CMDBChangeOp $sResult = "$sAttName set to $sNewValue (previous value: $sOldValue)"; } } + elseif($bIsHtml && $oAttDef->IsExternalKey()) + { + $sTargetClass = $oAttDef->GetTargetClass(); + $sFrom = MetaModel::GetHyperLink($sTargetClass, $sOldValue); + $sTo = MetaModel::GetHyperLink($sTargetClass, $sNewValue); + $sResult = "$sAttName set to $sTo (previous: $sFrom)"; + } else { - $sResult = "$sAttName set to $sNewValue (previous value: $sOldValue)"; + $sResult = "$sAttName set too $sNewValue (previous value: $sOldValue)"; } } return $sResult;