mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 01:28:47 +02:00
Exports: continuation of commit 3681 (Make the correct column name for friendly names (ext key -> ext field) enlarged to ALL formats with the exception of XML
SVN:trunk[3698]
This commit is contained in:
@@ -149,10 +149,22 @@ class ExcelBulkExport extends TabularBulkExport
|
||||
{
|
||||
$sType = 'datetime';
|
||||
}
|
||||
$sLabel = $sAttCode;
|
||||
if ($this->aStatusInfo['localize'])
|
||||
if (($oAttDef instanceof AttributeExternalField) || (($oAttDef instanceof AttributeFriendlyName) && ($oAttDef->GetKeyAttCode() != 'id')))
|
||||
{
|
||||
$sLabel = $oAttDef->GetLabel();
|
||||
$oKeyAttDef = MetaModel::GetAttributeDef($sClass, $oAttDef->GetKeyAttCode());
|
||||
$oExtAttDef = MetaModel::GetAttributeDef($oKeyAttDef->GetTargetClass(), $oAttDef->GetExtAttCode());
|
||||
if ($this->aStatusInfo['localize'])
|
||||
{
|
||||
$sLabel = $oKeyAttDef->GetLabel().'->'.$oExtAttDef->GetLabel();
|
||||
}
|
||||
else
|
||||
{
|
||||
$sLabel = $oKeyAttDef->GetCode().'->'.$oExtAttDef->GetCode();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$sLabel = $this->aStatusInfo['localize'] ? $oAttDef->GetLabel() : $sAttCode;
|
||||
}
|
||||
|
||||
$aTableHeaders[] = array('label' => $sFullAlias.$sLabel, 'type' => $sType);
|
||||
|
||||
@@ -115,13 +115,23 @@ class HTMLBulkExport extends TabularBulkExport
|
||||
|
||||
default:
|
||||
$oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
|
||||
if (count($aSelectedClasses) > 1)
|
||||
if (($oAttDef instanceof AttributeExternalField) || (($oAttDef instanceof AttributeFriendlyName) && ($oAttDef->GetKeyAttCode() != 'id')))
|
||||
{
|
||||
$aData[] = $sAlias.'.'.$oAttDef->GetLabel();
|
||||
$oKeyAttDef = MetaModel::GetAttributeDef($sClass, $oAttDef->GetKeyAttCode());
|
||||
$oExtAttDef = MetaModel::GetAttributeDef($oKeyAttDef->GetTargetClass(), $oAttDef->GetExtAttCode());
|
||||
$sLabel = $oKeyAttDef->GetLabel().'->'.$oExtAttDef->GetLabel();
|
||||
}
|
||||
else
|
||||
{
|
||||
$aData[] = $oAttDef->GetLabel();
|
||||
$sLabel = $oAttDef->GetLabel();
|
||||
}
|
||||
if (count($aSelectedClasses) > 1)
|
||||
{
|
||||
$aData[] = $sAlias.'.'.$sLabel;
|
||||
}
|
||||
else
|
||||
{
|
||||
$aData[] = $sLabel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,23 @@ class SpreadsheetBulkExport extends TabularBulkExport
|
||||
|
||||
default:
|
||||
$oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
|
||||
$sColLabel = $this->aStatusInfo['localize'] ? MetaModel::GetLabel($sClass, $sAttCode) : $sAttCode;
|
||||
if (($oAttDef instanceof AttributeExternalField) || (($oAttDef instanceof AttributeFriendlyName) && ($oAttDef->GetKeyAttCode() != 'id')))
|
||||
{
|
||||
$oKeyAttDef = MetaModel::GetAttributeDef($sClass, $oAttDef->GetKeyAttCode());
|
||||
$oExtAttDef = MetaModel::GetAttributeDef($oKeyAttDef->GetTargetClass(), $oAttDef->GetExtAttCode());
|
||||
if ($this->aStatusInfo['localize'])
|
||||
{
|
||||
$sColLabel = $oKeyAttDef->GetLabel().'->'.$oExtAttDef->GetLabel();
|
||||
}
|
||||
else
|
||||
{
|
||||
$sColLabel = $oKeyAttDef->GetCode().'->'.$oExtAttDef->GetCode();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$sColLabel = $this->aStatusInfo['localize'] ? $oAttDef->GetLabel() : $sAttCode;
|
||||
}
|
||||
$oFinalAttDef = $oAttDef->GetFinalAttDef();
|
||||
if (get_class($oFinalAttDef) == 'AttributeDateTime')
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user