Fixed issue in CSV export: null enums rendered as 'undefined' whereas '' is the value expected in the import (See an export of Organization/status)

SVN:trunk[2501]
This commit is contained in:
Romain Quetiez
2012-12-04 15:17:22 +00:00
parent 07d88199b4
commit 24435401a5
2 changed files with 19 additions and 4 deletions

View File

@@ -2286,7 +2286,11 @@ class AttributeEnum extends AttributeString
public function GetAsXML($value, $oHostObject = null, $bLocalize = true)
{
if ($bLocalize)
if (is_null($value))
{
$sFinalValue = '';
}
elseif ($bLocalize)
{
$sFinalValue = $this->GetValueLabel($value);
}
@@ -2300,7 +2304,11 @@ class AttributeEnum extends AttributeString
public function GetAsCSV($sValue, $sSeparator = ',', $sTextQualifier = '"', $oHostObject = null, $bLocalize = true)
{
if ($bLocalize)
if (is_null($sValue))
{
$sFinalValue = '';
}
elseif ($bLocalize)
{
$sFinalValue = $this->GetValueLabel($sValue);
}
@@ -2315,7 +2323,14 @@ class AttributeEnum extends AttributeString
public function GetEditValue($sValue, $oHostObj = null)
{
return $this->GetValueLabel($sValue);
if (is_null($sValue))
{
return '';
}
else
{
return $this->GetValueLabel($sValue);
}
}
public function GetAsHTMLForHistory($sOldValue, $sNewValue, $sLabel = null)