mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 15:22:17 +02:00
- Improvements to the history log for large text fields
SVN:code[91]
This commit is contained in:
@@ -201,8 +201,30 @@ class CMDBChangeOpSetAttribute extends CMDBChangeOp
|
|||||||
$sAttName = $oAttDef->GetLabel();
|
$sAttName = $oAttDef->GetLabel();
|
||||||
$sNewValue = $this->Get('newvalue');
|
$sNewValue = $this->Get('newvalue');
|
||||||
$sOldValue = $this->Get('oldvalue');
|
$sOldValue = $this->Get('oldvalue');
|
||||||
|
if ( (($oAttDef->GetType() == 'String') || ($oAttDef->GetType() == 'Text')) &&
|
||||||
|
(strlen($sNewValue) > strlen($sOldValue)) )
|
||||||
|
{
|
||||||
|
// Check if some text was not appended to the field
|
||||||
|
if (substr($sNewValue,0, strlen($sOldValue)) == $sOldValue) // Text added at the end
|
||||||
|
{
|
||||||
|
$sDelta = substr($sNewValue, strlen($sOldValue));
|
||||||
|
$sResult = "$sDelta appended to $sAttName";
|
||||||
|
}
|
||||||
|
else if (substr($sNewValue, -strlen($sOldValue)) == $sOldValue) // Text added at the beginning
|
||||||
|
{
|
||||||
|
$sDelta = substr($sNewValue, 0, strlen($sNewValue) - strlen($sOldValue));
|
||||||
|
$sResult = "$sDelta appended to $sAttName";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$sResult = "$sAttName set to $sNewValue (previous value: $sOldValue)";
|
$sResult = "$sAttName set to $sNewValue (previous value: $sOldValue)";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sResult = "$sAttName set to $sNewValue (previous value: $sOldValue)";
|
||||||
|
}
|
||||||
|
}
|
||||||
return $sResult;
|
return $sResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user