#684 CSV import / reconciliation using an enum does not take the translation into account

SVN:trunk[2630]
This commit is contained in:
Romain Quetiez
2013-03-18 10:26:14 +00:00
parent d60d634208
commit b52be60776

View File

@@ -297,7 +297,9 @@ class BulkChange
foreach ($this->m_aExtKeys[$sAttCode] as $sForeignAttCode => $iCol) foreach ($this->m_aExtKeys[$sAttCode] as $sForeignAttCode => $iCol)
{ {
// The foreign attribute is one of our reconciliation key // The foreign attribute is one of our reconciliation key
$oReconFilter->AddCondition($sForeignAttCode, $aRowData[$iCol], '='); $oForeignAtt = MetaModel::GetAttributeDef($oExtKey->GetTargetClass(), $sForeignAttCode);
$value = $oForeignAtt->MakeValueFromString($aRowData[$iCol], $this->m_bLocalizedValues);
$oReconFilter->AddCondition($sForeignAttCode, $value);
$aResults[$iCol] = new CellStatus_Void($aRowData[$iCol]); $aResults[$iCol] = new CellStatus_Void($aRowData[$iCol]);
} }
@@ -359,7 +361,9 @@ class BulkChange
foreach ($aKeyConfig as $sForeignAttCode => $iCol) foreach ($aKeyConfig as $sForeignAttCode => $iCol)
{ {
// The foreign attribute is one of our reconciliation key // The foreign attribute is one of our reconciliation key
$oReconFilter->AddCondition($sForeignAttCode, $aRowData[$iCol], '='); $oForeignAtt = MetaModel::GetAttributeDef($oExtKey->GetTargetClass(), $sForeignAttCode);
$value = $oForeignAtt->MakeValueFromString($aRowData[$iCol], $this->m_bLocalizedValues);
$oReconFilter->AddCondition($sForeignAttCode, $value, '=');
$aResults[$iCol] = new CellStatus_Void($aRowData[$iCol]); $aResults[$iCol] = new CellStatus_Void($aRowData[$iCol]);
} }
$oExtObjects = new CMDBObjectSet($oReconFilter); $oExtObjects = new CMDBObjectSet($oReconFilter);
@@ -824,7 +828,8 @@ class BulkChange
{ {
// The value is given in the data row // The value is given in the data row
$iCol = $this->m_aAttList[$sAttCode]; $iCol = $this->m_aAttList[$sAttCode];
$valuecondition = $aRowData[$iCol]; $oAttDef = MetaModel::GetAttributeDef($this->m_sClass, $sAttCode);
$valuecondition = $oAttDef->MakeValueFromString($aRowData[$iCol], $this->m_bLocalizedValues);
} }
if (is_null($valuecondition)) if (is_null($valuecondition))
{ {