From af2835e5052595672f27c1cc6a15a34771c05c70 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Wed, 29 Apr 2015 17:27:40 +0000 Subject: [PATCH] Make sure that 'source' nodes for ComputedImpactedItems are not added twice to the ticket. SVN:trunk[3571] --- .../datamodel.itop-request-mgmt-itil.xml | 13 ++++++++----- .../datamodel.itop-request-mgmt.xml | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml b/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml index 955cb551ee..610d385a71 100755 --- a/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml +++ b/datamodels/2.x/itop-request-mgmt-itil/datamodel.itop-request-mgmt-itil.xml @@ -1374,13 +1374,16 @@ { if($oNode instanceof RelationObjectNode) { - $oObj = $oNode->GetProperty('object'); - $sRootClass = MetaModel::GetRootClass(get_class($oObj)); - if (!array_key_exists($sRootClass, $aComputed)) + if ($oNode->GetProperty('is_reached') && (!$oNode->GetProperty('source'))) { - $aComputed[$sRootClass] = array(); + $oObj = $oNode->GetProperty('object'); + $sRootClass = MetaModel::GetRootClass(get_class($oObj)); + if (!array_key_exists($sRootClass, $aComputed)) + { + $aComputed[$sRootClass] = array(); + } + $aComputed[$sRootClass][$oObj->GetKey()] = $oObj; } - $aComputed[$sRootClass][$oObj->GetKey()] = $oObj; } } diff --git a/datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml b/datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml index caa4e75048..7b238551c4 100755 --- a/datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml +++ b/datamodels/2.x/itop-request-mgmt/datamodel.itop-request-mgmt.xml @@ -1376,7 +1376,7 @@ { if($oNode instanceof RelationObjectNode) { - if ($oNode->GetProperty('is_reached')) + if ($oNode->GetProperty('is_reached') && (!$oNode->GetProperty('source'))) { $oObj = $oNode->GetProperty('object'); $sRootClass = MetaModel::GetRootClass(get_class($oObj));