mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N°3905 - Polishing: CSV Import
This commit is contained in:
@@ -120,7 +120,6 @@ function GetMappingForField($sClassName, $sFieldName, $iFieldIndex, $bAdvancedMo
|
||||
$aChoices['id'] = Dict::S('UI:CSVImport:idField');
|
||||
}
|
||||
foreach (MetaModel::ListAttributeDefs($sClassName) as $sAttCode => $oAttDef) {
|
||||
$sStar = '';
|
||||
if ($oAttDef->IsExternalKey()) {
|
||||
if (($sFieldName == $oAttDef->GetLabel()) || ($sFieldName == $sAttCode)) {
|
||||
$sFieldCode = $sAttCode;
|
||||
@@ -128,10 +127,6 @@ function GetMappingForField($sClassName, $sFieldName, $iFieldIndex, $bAdvancedMo
|
||||
if ($bAdvancedMode) {
|
||||
$aChoices[$sAttCode] = $oAttDef->GetLabel();
|
||||
}
|
||||
$oExtKeyAttDef = MetaModel::GetAttributeDef($sClassName, $oAttDef->GetKeyAttCode());
|
||||
if (!$oExtKeyAttDef->IsNullAllowed()) {
|
||||
$sStar = '*';
|
||||
}
|
||||
// Get fields of the external class that are considered as reconciliation keys
|
||||
$sTargetClass = $oAttDef->GetTargetClass();
|
||||
foreach (MetaModel::ListAttributeDefs($sTargetClass) as $sTargetAttCode => $oTargetAttDef) {
|
||||
@@ -151,7 +146,7 @@ function GetMappingForField($sClassName, $sFieldName, $iFieldIndex, $bAdvancedMo
|
||||
$aChoices[$sAttCode.'->'.$sTargetAttCode] = MetaModel::GetLabel($sClassName, $sAttCode.'->'.$sTargetAttCode, true);
|
||||
foreach ($aSignatures as $sSignature) {
|
||||
if (strcasecmp($sFieldName, $sSignature) == 0) {
|
||||
$sFieldCode = $sAttCode.'->'.$sTargetAttCode.$sStar;
|
||||
$sFieldCode = $sAttCode.'->'.$sTargetAttCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user