N.707 Export of custom fields: improved the xlsx format and implemented the spreadsheet format (both are aligned)

SVN:trunk[4935]
This commit is contained in:
Romain Quetiez
2017-09-22 13:37:44 +00:00
parent c11753d91c
commit 3e61fd2452
3 changed files with 9 additions and 7 deletions

View File

@@ -7406,7 +7406,7 @@ class AttributeCustomFields extends AttributeDefinition
public function GetEditValue($sValue, $oHostObj = null)
{
return 'GetEditValueNotImplemented for '.get_class($this);
return $this->GetForTemplate($sValue, '', $oHostObj, true);
}
/**

View File

@@ -188,11 +188,6 @@ EOF
$oAttDef = MetaModel::GetAttributeDef(get_class($oObj), $sAttCode);
$sRet = $oAttDef->GetAsCSV($value, '', '', $oObj);
}
else if ($value instanceOf ormCustomFieldsValue)
{
$oAttDef = MetaModel::GetAttributeDef(get_class($oObj), $sAttCode);
$sRet = $oAttDef->GetAsCSV($value, "\n", '', $oObj);
}
else
{
$oAttDef = MetaModel::GetAttributeDef(get_class($oObj), $sAttCode);

View File

@@ -175,7 +175,8 @@ EOF
}
elseif ($oAttDef instanceof AttributeCustomFields)
{
$sRet = $oObj->GetAsHTML($sAttCode);
// Stick to the weird implementation made in GetNextChunk
$sRet = utils::TextToHtml($oObj->GetEditValue($sAttCode));
}
else
{
@@ -326,6 +327,12 @@ EOF
}
$sData .= "<td x:str>$sField</td>";
}
elseif ($oAttDef instanceof AttributeCustomFields)
{
// GetAsHTML returns a table that would not fit
$sField = utils::TextToHtml($oObj->GetEditValue($sAttCode));
$sData .= "<td x:str>$sField</td>";
}
else if($oAttDef instanceof AttributeString)
{
$sField = $oObj->GetAsHTML($sAttCode, $this->bLocalizeOutput);