mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-17 22:39:03 +02:00
Completed missing impact/dependency rules (Datacenter device depends on power connection, and PDU depending on power connection)
SVN:trunk[2561]
This commit is contained in:
@@ -1999,6 +1999,19 @@
|
||||
if (class_exists('SANSwitch'))
|
||||
{
|
||||
$aRels['SANSwitch'] = array("sQuery"=>"SELECT SANSwitch AS san JOIN lnkSanToDatacenterDevice AS l1 ON l1.san_id = san.id WHERE l1.datacenterdevice_id = :this->id", "bPropagate"=>true, "iDistance"=>10);
|
||||
}
|
||||
if (class_exists('PowerConnection'))
|
||||
{
|
||||
$aRels['PowerA'] = array(
|
||||
"sQuery"=>"SELECT PowerConnection WHERE id = :this->powerA_id",
|
||||
"bPropagate"=>true,
|
||||
"iDistance"=>10
|
||||
);
|
||||
$aRels['PowerB'] = array(
|
||||
"sQuery"=>"SELECT PowerConnection WHERE id = :this->powerB_id",
|
||||
"bPropagate"=>true,
|
||||
"iDistance"=>10
|
||||
);
|
||||
}
|
||||
return array_merge($aRels, parent::GetRelationQueries($sRelCode));
|
||||
break;
|
||||
|
||||
@@ -428,15 +428,12 @@
|
||||
$aRels = array(
|
||||
"DatacenterDevice" => array("sQuery"=>"SELECT DatacenterDevice WHERE powerA_id = :this->id OR powerB_id = :this->id", "bPropagate"=>true, "iDistance"=>10),
|
||||
"pdu" => array("sQuery"=>"SELECT PDU WHERE powerstart_id = :this->id", "bPropagate"=>true, "iDistance"=>10),
|
||||
|
||||
);
|
||||
return array_merge($aRels, parent::GetRelationQueries($sRelCode));
|
||||
break;
|
||||
|
||||
case 'depends on':
|
||||
|
||||
$aRels = array(
|
||||
|
||||
);
|
||||
return array_merge($aRels, parent::GetRelationQueries($sRelCode));
|
||||
break;
|
||||
@@ -788,7 +785,34 @@
|
||||
<target_attcode>name</target_attcode>
|
||||
</field>
|
||||
</fields>
|
||||
<methods/>
|
||||
<methods>
|
||||
<method id="GetRelationQueries">
|
||||
<static>true</static>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[ public static function GetRelationQueries($sRelCode)
|
||||
{
|
||||
switch ($sRelCode)
|
||||
{
|
||||
case "impacts":
|
||||
$aRels = array(
|
||||
);
|
||||
return array_merge($aRels, parent::GetRelationQueries($sRelCode));
|
||||
break;
|
||||
|
||||
case 'depends on':
|
||||
$aRels = array(
|
||||
"powerconnection" => array("sQuery"=>"SELECT PowerConnection WHERE id = :this->powerstart_id", "bPropagate"=>true, "iDistance"=>10),
|
||||
);
|
||||
return array_merge($aRels, parent::GetRelationQueries($sRelCode));
|
||||
break;
|
||||
|
||||
default:
|
||||
return parent::GetRelationQueries($sRelCode);
|
||||
}
|
||||
}]]></code>
|
||||
</method>
|
||||
</methods>
|
||||
<presentation>
|
||||
<details>
|
||||
<items>
|
||||
|
||||
Reference in New Issue
Block a user