diff --git a/core/config.class.inc.php b/core/config.class.inc.php
index d8135eadc..059b4c360 100644
--- a/core/config.class.inc.php
+++ b/core/config.class.inc.php
@@ -597,6 +597,15 @@ class Config
'source_of_value' => '',
'show_in_conf_sample' => false,
),
+ 'impact_analysis_first_tab' => array(
+ 'type' => 'string',
+ 'description' => 'Which tab to display first in the impact analysis view: list or graphics. Graphics are nicer but slower to display when there are many objects',
+ // examples... not used
+ 'default' => 'graphics',
+ 'value' => '',
+ 'source_of_value' => '',
+ 'show_in_conf_sample' => false,
+ ),
);
public function IsProperty($sPropCode)
diff --git a/pages/UI.php b/pages/UI.php
index f4b67c675..461424da1 100644
--- a/pages/UI.php
+++ b/pages/UI.php
@@ -500,6 +500,148 @@ function DisplayMultipleSelectionForm($oP, $oFilter, $sNextOperation, $oChecker,
$oP->add_ready_script("$('#1 table.listResults').trigger('check_all');");
}
+function DisplayNavigatorListTab($oP, $aResults, $sRelation, $oObj)
+{
+ $oP->SetCurrentTab(Dict::S('UI:RelationshipList'));
+ $oP->add("
");
+ $iBlock = 1; // Zero is not a valid blockid
+ foreach($aResults as $sListClass => $aObjects)
+ {
+ $oSet = CMDBObjectSet::FromArray($sListClass, $aObjects);
+ $oP->add("
".MetaModel::GetRelationDescription($sRelation).' '.$oObj->GetName()."
\n");
+ $oP->add("\n");
+ $oBlock = DisplayBlock::FromObjectSet($oSet, 'list');
+ $oBlock->Display($oP, $iBlock++);
+ $oP->P(' '); // Some space ?
+ }
+ $oP->add("");
+}
+
+function DisplayNavigatorGraphicsTab($oP, $aResults, $sClass, $id, $sRelation, $oAppContext)
+{
+ $oP->SetCurrentTab(Dict::S('UI:RelationshipGraph'));
+
+ $oP->add("\n");
+ $oP->add("\n");
+ $oP->add("".Dict::S('UI:ElementsDisplayed')."
\n");
+
+ $width = 1000;
+ $height = 700;
+ $sDrillUrl = utils::GetAbsoluteUrlAppRoot().'pages/UI.php?operation=details&'.$oAppContext->GetForLink();
+ $sParams = "pWidth=$width&pHeight=$height&drillUrl=".urlencode($sDrillUrl)."&displayController=false&xmlUrl=".urlencode("./xml.navigator.php")."&obj_class=$sClass&obj_id=$id&relation=$sRelation";
+
+ $oP->add("\n");
+ $oP->add_script(
+<<add_ready_script(
+<<GetRelatedObjects($sRelation, 20 /* iMaxDepth */, $aResults);
$oP->AddTabContainer('Navigator');
$oP->SetCurrentTabContainer('Navigator');
- $oP->SetCurrentTab(Dict::S('UI:RelationshipGraph'));
+
+ $sFirstTab = MetaModel::GetConfig()->Get('impact_analysis_first_tab');
+ if ($sFirstTab == 'list')
+ {
+ DisplayNavigatorListTab($oP, $aResults, $sRelation, $oObj);
+ DisplayNavigatorGraphicsTab($oP, $aResults, $sClass, $id, $sRelation, $oAppContext);
+ }
+ else
+ {
+ DisplayNavigatorGraphicsTab($oP, $aResults, $sClass, $id, $sRelation, $oAppContext);
+ DisplayNavigatorListTab($oP, $aResults, $sRelation, $oObj);
+ }
- $oP->add("\n");
- $oP->add("\n");
- $oP->add("".Dict::S('UI:ElementsDisplayed')."
\n");
-
- $width = 1000;
- $height = 700;
- $sDrillUrl = utils::GetAbsoluteUrlAppRoot().'pages/UI.php?operation=details&'.$oAppContext->GetForLink();
- $sParams = "pWidth=$width&pHeight=$height&drillUrl=".urlencode($sDrillUrl)."&displayController=false&xmlUrl=".urlencode("./xml.navigator.php")."&obj_class=$sClass&obj_id=$id&relation=$sRelation";
-
- $oP->add("\n");
- $oP->SetCurrentTab(Dict::S('UI:RelationshipList'));
- $oP->add("");
- $oP->add_script(
-<<add_ready_script(
-<<SetCurrentTab('');
break;