mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 09:38:48 +02:00
Impact analysis enhancement:
- Some of the "context" rules are marked as "default=yes" - Only the "default" context rules are used for the initial display of the impact analysis graph AND are used to compute the impacted items of a ticket. SVN:trunk[3713]
This commit is contained in:
@@ -999,7 +999,7 @@ class DisplayableGraph extends SimpleGraph
|
||||
*/
|
||||
function GetAsJSON($sContextKey)
|
||||
{
|
||||
$aContextDefs = $this->GetContextDefinitions($sContextKey, false);
|
||||
$aContextDefs = static::GetContextDefinitions($sContextKey, false);
|
||||
|
||||
$aData = array('nodes' => array(), 'edges' => array(), 'groups' => array());
|
||||
$iGroupIdx = 0;
|
||||
@@ -1055,7 +1055,7 @@ class DisplayableGraph extends SimpleGraph
|
||||
*/
|
||||
function RenderAsPDF(PDFPage $oPage, $sComments = '', $sContextKey, $xMin = -1, $xMax = -1, $yMin = -1, $yMax = -1)
|
||||
{
|
||||
$aContextDefs = $this->GetContextDefinitions($sContextKey, false); // No need to develop the parameters
|
||||
$aContextDefs = static::GetContextDefinitions($sContextKey, false); // No need to develop the parameters
|
||||
$oPdf = $oPage->get_tcpdf();
|
||||
|
||||
$aBB = $this->GetBoundingBox();
|
||||
@@ -1219,7 +1219,7 @@ class DisplayableGraph extends SimpleGraph
|
||||
* @param array $aContextParams Arguments for the queries (via ToArgs()) if $bDevelopParams == true
|
||||
* @return multitype:multitype:string
|
||||
*/
|
||||
public function GetContextDefinitions($sContextKey, $bDevelopParams = true, $aContextParams = array())
|
||||
public static function GetContextDefinitions($sContextKey, $bDevelopParams = true, $aContextParams = array())
|
||||
{
|
||||
$aLevels = explode('/', $sContextKey);
|
||||
$sLeafClass = $aLevels[2];
|
||||
@@ -1246,6 +1246,7 @@ class DisplayableGraph extends SimpleGraph
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
IssueLog::Warning('Invalid OQL query: '.$sOQL.' in the parameter '.$sContextKey);
|
||||
unset($aContextDefs[$sKey]);
|
||||
}
|
||||
}
|
||||
@@ -1262,7 +1263,7 @@ class DisplayableGraph extends SimpleGraph
|
||||
*/
|
||||
function Display(WebPage $oP, $aResults, $sRelation, ApplicationContext $oAppContext, $aExcludedObjects = array(), $sObjClass = null, $iObjKey = null, $sContextKey, $aContextParams = array())
|
||||
{
|
||||
$aContextDefs = $this->GetContextDefinitions($sContextKey, true, $aContextParams);
|
||||
$aContextDefs = static::GetContextDefinitions($sContextKey, true, $aContextParams);
|
||||
$aExcludedByClass = array();
|
||||
foreach($aExcludedObjects as $oObj)
|
||||
{
|
||||
@@ -1310,7 +1311,7 @@ EOF
|
||||
$aAdditionalContexts = array();
|
||||
foreach($aContextDefs as $sKey => $aDefinition)
|
||||
{
|
||||
$aAdditionalContexts[] = array('key' => $sKey, 'label' => Dict::S($aDefinition['dict']), 'oql' => $aDefinition['oql']);
|
||||
$aAdditionalContexts[] = array('key' => $sKey, 'label' => Dict::S($aDefinition['dict']), 'oql' => $aDefinition['oql'], 'default' => (array_key_exists('default', $aDefinition) && ($aDefinition['default'] == 'yes')));
|
||||
}
|
||||
|
||||
$sDirection = utils::ReadParam('d', 'horizontal');
|
||||
|
||||
Reference in New Issue
Block a user