N°931 Fix TagSet export : with format=spreadsheet codes where always returned (now uses codes or labels according to what was set)

This commit is contained in:
Pierre Goiffon
2018-10-04 14:56:06 +02:00
parent d36fd6a47d
commit 714fada9f0
2 changed files with 7 additions and 2 deletions

View File

@@ -9946,7 +9946,6 @@ class AttributeTagSet extends AttributeSet
* @param bool $bConvertToPlainText
*
* @return mixed|string
* @throws \CoreException
*/
public function GetAsCSV(
$value, $sSeparator = ',', $sTextQualifier = '"', $oHostObject = null, $bLocalize = true,

View File

@@ -276,6 +276,7 @@ EOF
$sAttCode = $aFieldSpec['sAttCode'];
$sField = '';
/** @var \DBObject $oObj */
$oObj = $aRow[$sAlias];
if ($oObj == null)
{
@@ -333,11 +334,16 @@ EOF
$sField = utils::TextToHtml($oObj->GetEditValue($sAttCode));
$sData .= "<td x:str>$sField</td>";
}
else if($oAttDef instanceof AttributeString)
else if ($oAttDef instanceof AttributeString)
{
$sField = $oObj->GetAsHTML($sAttCode, $this->bLocalizeOutput);
$sData .= "<td x:str>$sField</td>";
}
else if ($oAttDef instanceof AttributeTagSet)
{
$sField = $oObj->GetAsCSV($sAttCode, $this->bLocalizeOutput, '');
$sData .= "<td x:str>$sField</td>";
}
else
{
$rawValue = $oObj->Get($sAttCode);