mirror of
https://github.com/Combodo/iTop.git
synced 2026-08-22 22:28:19 +02:00
XML Modelization of the relations: reworked toward an asymetric definition (downstream: A impacts B, upstream: B depends on A)
- The queries are developped at runtime (cache) - More complex algorithm to take into account the legacy type of specification (GetRelationQueries) - New dictionary naming convention (preserving backward compatibility): "VerbUp" to be replaced by "DownStream - Temporary hacks to preserve the relation 'depends on', until we have a new GUI - Special handling for the relation LogicalVolume impacts VirtualDevice which had to be implemented in the bridge module - Improved the backward compatibility by leaving legacy methods GetRelationQueries returning an empty definition, allowing for an eventual XML redefinition SVN:trunk[3542]
This commit is contained in:
@@ -2547,10 +2547,20 @@ abstract class DBObject implements iDisplay
|
||||
|
||||
public function GetRelatedObjects($sRelCode, $iMaxDepth = 99, &$aResults = array())
|
||||
{
|
||||
foreach (MetaModel::EnumRelationQueries(get_class($this), $sRelCode) as $sDummy => $aQueryInfo)
|
||||
// Temporary patch: until the impact analysis GUI gets rewritten,
|
||||
// let's consider that "depends on" is equivalent to "impacts/up"
|
||||
// The current patch has been implemented in DBObject and MetaModel
|
||||
$sHackedRelCode = $sRelCode;
|
||||
$bDown = true;
|
||||
if ($sRelCode == 'depends on')
|
||||
{
|
||||
MetaModel::DbgTrace("object=".$this->GetKey().", depth=$iMaxDepth, rel=".$aQueryInfo["sQuery"]);
|
||||
$sQuery = $aQueryInfo["sQuery"];
|
||||
$sHackedRelCode = 'impacts';
|
||||
$bDown = false;
|
||||
}
|
||||
foreach (MetaModel::EnumRelationQueries(get_class($this), $sHackedRelCode, $bDown) as $sDummy => $aQueryInfo)
|
||||
{
|
||||
MetaModel::DbgTrace("object=".$this->GetKey().", depth=$iMaxDepth, rel=".$aQueryInfo['sQueryDown']);
|
||||
$sQuery = $bDown ? $aQueryInfo['sQueryDown'] : $aQueryInfo['sQueryUp'];
|
||||
//$bPropagate = $aQueryInfo["bPropagate"];
|
||||
//$iDepth = $bPropagate ? $iMaxDepth - 1 : 0;
|
||||
$iDepth = $iMaxDepth - 1;
|
||||
|
||||
Reference in New Issue
Block a user