|
@@ -484,11 +484,14 @@ abstract class AttributeDefinition
|
|
$sLabel = $this->GetLabel();
|
|
$sLabel = $this->GetLabel();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ $sNewValueHtml = $this->GetAsHTML($sNewValue);
|
|
|
|
+ $sOldValueHtml = $this->GetAsHTML($sOldValue);
|
|
|
|
+
|
|
if($this->IsExternalKey())
|
|
if($this->IsExternalKey())
|
|
{
|
|
{
|
|
$sTargetClass = $this->GetTargetClass();
|
|
$sTargetClass = $this->GetTargetClass();
|
|
- $sOldValue = (int)$sOldValue ? MetaModel::GetHyperLink($sTargetClass, (int)$sOldValue) : null;
|
|
|
|
- $sNewValue = (int)$sNewValue ? MetaModel::GetHyperLink($sTargetClass, (int)$sNewValue) : null;
|
|
|
|
|
|
+ $sOldValueHtml = (int)$sOldValue ? MetaModel::GetHyperLink($sTargetClass, (int)$sOldValue) : null;
|
|
|
|
+ $sNewValueHtml = (int)$sNewValue ? MetaModel::GetHyperLink($sTargetClass, (int)$sNewValue) : null;
|
|
}
|
|
}
|
|
if ( (($this->GetType() == 'String') || ($this->GetType() == 'Text')) &&
|
|
if ( (($this->GetType() == 'String') || ($this->GetType() == 'Text')) &&
|
|
(strlen($sNewValue) > strlen($sOldValue)) )
|
|
(strlen($sNewValue) > strlen($sOldValue)) )
|
|
@@ -496,27 +499,27 @@ abstract class AttributeDefinition
|
|
// Check if some text was not appended to the field
|
|
// Check if some text was not appended to the field
|
|
if (substr($sNewValue,0, strlen($sOldValue)) == $sOldValue) // Text added at the end
|
|
if (substr($sNewValue,0, strlen($sOldValue)) == $sOldValue) // Text added at the end
|
|
{
|
|
{
|
|
- $sDelta = substr($sNewValue, strlen($sOldValue));
|
|
|
|
|
|
+ $sDelta = $this->GetAsHTML(substr($sNewValue, strlen($sOldValue)));
|
|
$sResult = Dict::Format('Change:Text_AppendedTo_AttName', $sDelta, $sLabel);
|
|
$sResult = Dict::Format('Change:Text_AppendedTo_AttName', $sDelta, $sLabel);
|
|
}
|
|
}
|
|
else if (substr($sNewValue, -strlen($sOldValue)) == $sOldValue) // Text added at the beginning
|
|
else if (substr($sNewValue, -strlen($sOldValue)) == $sOldValue) // Text added at the beginning
|
|
{
|
|
{
|
|
- $sDelta = substr($sNewValue, 0, strlen($sNewValue) - strlen($sOldValue));
|
|
|
|
|
|
+ $sDelta = $this->GetAsHTML(substr($sNewValue, 0, strlen($sNewValue) - strlen($sOldValue)));
|
|
$sResult = Dict::Format('Change:Text_AppendedTo_AttName', $sDelta, $sLabel);
|
|
$sResult = Dict::Format('Change:Text_AppendedTo_AttName', $sDelta, $sLabel);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
if (strlen($sOldValue) == 0)
|
|
if (strlen($sOldValue) == 0)
|
|
{
|
|
{
|
|
- $sResult = Dict::Format('Change:AttName_SetTo', $sLabel, $sNewValue);
|
|
|
|
|
|
+ $sResult = Dict::Format('Change:AttName_SetTo', $sLabel, $sNewValueHtml);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
if (is_null($sNewValue))
|
|
if (is_null($sNewValue))
|
|
{
|
|
{
|
|
- $sNewValue = Dict::S('UI:UndefinedObject');
|
|
|
|
|
|
+ $sNewValueHtml = Dict::S('UI:UndefinedObject');
|
|
}
|
|
}
|
|
- $sResult = Dict::Format('Change:AttName_SetTo_NewValue_PreviousValue_OldValue', $sLabel, $sNewValue, $sOldValue);
|
|
|
|
|
|
+ $sResult = Dict::Format('Change:AttName_SetTo_NewValue_PreviousValue_OldValue', $sLabel, $sNewValueHtml, $sOldValueHtml);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -524,15 +527,15 @@ abstract class AttributeDefinition
|
|
{
|
|
{
|
|
if (strlen($sOldValue) == 0)
|
|
if (strlen($sOldValue) == 0)
|
|
{
|
|
{
|
|
- $sResult = Dict::Format('Change:AttName_SetTo', $sLabel, $sNewValue);
|
|
|
|
|
|
+ $sResult = Dict::Format('Change:AttName_SetTo', $sLabel, $sNewValueHtml);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
if (is_null($sNewValue))
|
|
if (is_null($sNewValue))
|
|
{
|
|
{
|
|
- $sNewValue = Dict::S('UI:UndefinedObject');
|
|
|
|
|
|
+ $sNewValueHtml = Dict::S('UI:UndefinedObject');
|
|
}
|
|
}
|
|
- $sResult = Dict::Format('Change:AttName_SetTo_NewValue_PreviousValue_OldValue', $sLabel, $sNewValue, $sOldValue);
|
|
|
|
|
|
+ $sResult = Dict::Format('Change:AttName_SetTo_NewValue_PreviousValue_OldValue', $sLabel, $sNewValueHtml, $sOldValueHtml);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return $sResult;
|
|
return $sResult;
|
|
@@ -2339,14 +2342,6 @@ class AttributeEnum extends AttributeString
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public function GetAsHTMLForHistory($sOldValue, $sNewValue, $sLabel = null)
|
|
|
|
- {
|
|
|
|
- $sOldValue = is_null($sOldValue) ? null : $this->GetAsHTML($sOldValue);
|
|
|
|
- $sNewValue = is_null($sNewValue) ? null : $this->GetAsHTML($sNewValue);
|
|
|
|
- $sResult = parent::GetAsHTMLForHistory($sOldValue, $sNewValue, $sLabel);
|
|
|
|
- return $sResult;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
public function GetAllowedValues($aArgs = array(), $sContains = '')
|
|
public function GetAllowedValues($aArgs = array(), $sContains = '')
|
|
{
|
|
{
|
|
$aRawValues = parent::GetAllowedValues($aArgs, $sContains);
|
|
$aRawValues = parent::GetAllowedValues($aArgs, $sContains);
|