Fixed bug #231: distinguish between external key (id) and external key (name) for loading fields that are external keys pointing to externla keys! Example: Connected To->Device is to be mapped to the Connected Interface's device NAME whereas Connected To->Device->id is to be mapped to the connected interface's device id

SVN:trunk[747]
This commit is contained in:
Denis Flaven
2010-09-02 15:57:08 +00:00
parent 66c7d99c46
commit b1f877f845
2 changed files with 25 additions and 6 deletions

View File

@@ -661,7 +661,14 @@ abstract class cmdbAbstractObject extends CMDBObject
{
$sExtKeyLabel = MetaModel::GetLabel($sClassName, $oAttDef->GetKeyAttCode());
$sRemoteAttLabel = MetaModel::GetLabel($oAttDef->GetTargetClass(), $oAttDef->GetExtAttCode());
$aHeader[] = $sExtKeyLabel.'->'.$sRemoteAttLabel;
$oTargetAttDef = MetaModel::GetAttributeDef($oAttDef->GetTargetClass(), $oAttDef->GetExtAttCode());
$sSuffix = '';
if ($oTargetAttDef->IsExternalKey())
{
$sSuffix = '->id';
}
$aHeader[] = $sExtKeyLabel.'->'.$sRemoteAttLabel.$sSuffix;
}
else
{