mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
Fix excel export when reconciliation key list is containing empty keys.
Fix the compiler to avoid generating a reconciliation array not empty when the tag is present in the xml definition of the class but no key is defined. SVN:trunk[6011]
This commit is contained in:
@@ -150,15 +150,18 @@ abstract class TabularBulkExport extends BulkExport
|
||||
// Add the reconciliation keys
|
||||
foreach(MetaModel::GetReconcKeys($sRemoteClass) as $sRemoteAttCode)
|
||||
{
|
||||
$sAttCodeEx = $sAttCode.'->'.$sRemoteAttCode;
|
||||
if (!array_key_exists($sAttCodeEx, $aResult))
|
||||
{
|
||||
$oRemoteAttDef = MetaModel::GetAttributeDef($sRemoteClass, $sRemoteAttCode);
|
||||
if ($this->IsExportableField($sRemoteClass, $sRemoteAttCode, $oRemoteAttDef))
|
||||
{
|
||||
$aResult[$sAttCodeEx] = array('code' => $sAttCodeEx, 'unique_label' => $oAttDef->GetLabel().'->'.$oRemoteAttDef->GetLabel(), 'label' => MetaModel::GetLabel($sRemoteClass, $sRemoteAttCode), 'attdef' => $oRemoteAttDef);
|
||||
}
|
||||
}
|
||||
if (!empty($sRemoteAttCode))
|
||||
{
|
||||
$sAttCodeEx = $sAttCode.'->'.$sRemoteAttCode;
|
||||
if (!array_key_exists($sAttCodeEx, $aResult))
|
||||
{
|
||||
$oRemoteAttDef = MetaModel::GetAttributeDef($sRemoteClass, $sRemoteAttCode);
|
||||
if ($this->IsExportableField($sRemoteClass, $sRemoteAttCode, $oRemoteAttDef))
|
||||
{
|
||||
$aResult[$sAttCodeEx] = array('code' => $sAttCodeEx, 'unique_label' => $oAttDef->GetLabel().'->'.$oRemoteAttDef->GetLabel(), 'label' => MetaModel::GetLabel($sRemoteClass, $sRemoteAttCode), 'attdef' => $oRemoteAttDef);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -1001,7 +1001,14 @@ EOF
|
||||
{
|
||||
$aReconcAttCodes[] = $oAttribute->getAttribute('id');
|
||||
}
|
||||
$sReconcKeys = "array('".implode("', '", $aReconcAttCodes)."')";
|
||||
if (empty($aReconcAttCodes))
|
||||
{
|
||||
$sReconcKeys = "array()";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sReconcKeys = "array('".implode("', '", $aReconcAttCodes)."')";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user