mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 19:48:49 +02:00
N°3928 Migrate impact analysis page to 3.0 style
This commit is contained in:
@@ -10,6 +10,7 @@ $ibo-simple-graph--grouping-threshold-additional-context--container--margin-righ
|
||||
$ibo-simple-graph--grouping-threshold-additional-context--content--margin-right: 1em !default;
|
||||
|
||||
$ibo-impact-analysis--graph-zoom-slider--width: 10em !default;
|
||||
$ibo-impact-analysis--impacted-objects-lists--div--margin-top: 24px !default;
|
||||
|
||||
$ibo-display-graph--search-box--criterion--content--padding-y: 0 !default;
|
||||
$ibo-display-graph--search-box--criterion--content--padding-x: 15px !default;
|
||||
@@ -108,4 +109,12 @@ $ibo-display-graph--search-box--criterion--content--checkbox--margin-right: 10px
|
||||
#ReloadMovieBtn {
|
||||
align-self: flex-end;
|
||||
}
|
||||
}
|
||||
}
|
||||
#impacted_objects_lists{
|
||||
> div ~ div{
|
||||
margin-top: $ibo-impact-analysis--impacted-objects-lists--div--margin-top;
|
||||
}
|
||||
}
|
||||
#impacted_objects_lists_placeholder, #impacted_groups_placeholder{
|
||||
height: 250px;
|
||||
}
|
||||
|
||||
@@ -749,9 +749,10 @@ $(function()
|
||||
else
|
||||
{
|
||||
this.element.closest('[data-role="ibo-tab-container"]').tab_container("GetTabWidget").enable(2);
|
||||
$('#impacted_groups').html('<img src="../images/indicator.gif">');
|
||||
$('#impacted_groups').block({message:this.options.labels.loading});
|
||||
var sUrl = GetAbsoluteUrlAppRoot()+'pages/ajax.render.php';
|
||||
$.post(sUrl, { operation: 'relation_groups', groups: aGroups }, function(data) {
|
||||
$('#impacted_groups').unblock();
|
||||
$('#impacted_groups').html(data);
|
||||
});
|
||||
}
|
||||
@@ -772,9 +773,10 @@ $(function()
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#impacted_objects_lists').html('<img src="../images/indicator.gif">');
|
||||
$('#impacted_objects_lists').block({message:this.options.labels.loading});
|
||||
var sUrl = GetAbsoluteUrlAppRoot()+'pages/ajax.render.php';
|
||||
$.post(sUrl, { operation: 'relation_lists', lists: aLists }, function(data) {
|
||||
$('#impacted_objects_lists').unblock();
|
||||
$('#impacted_objects_lists').html(data);
|
||||
});
|
||||
}
|
||||
|
||||
20
pages/UI.php
20
pages/UI.php
@@ -244,15 +244,14 @@ function DisplayMultipleSelectionForm(WebPage $oP, DBSearch $oFilter, string $sN
|
||||
function DisplayNavigatorListTab($oP, $aResults, $sRelation, $sDirection, $oObj)
|
||||
{
|
||||
$oP->SetCurrentTab('UI:RelationshipList');
|
||||
$oP->add("<div id=\"impacted_objects\" style=\"width:100%;background-color:#fff;padding:10px;\">");
|
||||
$oP->add("<div id=\"impacted_objects\">");
|
||||
$sOldRelation = $sRelation;
|
||||
if (($sRelation == 'impacts') && ($sDirection == 'up'))
|
||||
{
|
||||
$sOldRelation = 'depends on';
|
||||
}
|
||||
$oP->add("<h1>".MetaModel::GetRelationDescription($sOldRelation).' '.$oObj->GetName()."</h1>\n");
|
||||
$oP->add("<div id=\"impacted_objects_lists\">");
|
||||
$oP->add('<img src="../images/indicator.gif">');
|
||||
$oP->add("<div id=\"impacted_objects_lists_placeholder\"></div>");
|
||||
/*
|
||||
* Content is rendered asynchronously via pages/ajax.render.php?operation=relation_lists
|
||||
*/
|
||||
@@ -264,8 +263,9 @@ function DisplayNavigatorListTab($oP, $aResults, $sRelation, $sDirection, $oObj)
|
||||
function DisplayNavigatorGroupTab($oP)
|
||||
{
|
||||
$oP->SetCurrentTab('UI:RelationGroups');
|
||||
$oP->add("<div id=\"impacted_groups\" style=\"width:100%;background-color:#fff;padding:10px;\">");
|
||||
$oP->add('<img src="../images/indicator.gif">');
|
||||
$oP->add("<div id=\"impacted_groups\">");
|
||||
$oP->add("<div id=\"impacted_groups_placeholder\"></div>");
|
||||
|
||||
/*
|
||||
* Content is rendered asynchronously via pages/ajax.render.php?operation=relation_groups
|
||||
*/
|
||||
@@ -1774,8 +1774,14 @@ EOF
|
||||
|
||||
$aResults = $oRelGraph->GetObjectsByClass();
|
||||
$oDisplayGraph = DisplayableGraph::FromRelationGraph($oRelGraph, $iGroupingThreshold, ($sDirection == 'down'));
|
||||
|
||||
$oP->AddTabContainer('Navigator');
|
||||
$oPanel = PanelUIBlockFactory::MakeForClass($sClass, MetaModel::GetRelationDescription($sRelation).' '.$oObj->GetName());
|
||||
$sClassIcon = MetaModel::GetClassIcon($sClass, false);
|
||||
if (strlen($sClassIcon) > 0){
|
||||
$oPanel->SetIcon($sClassIcon);
|
||||
}
|
||||
|
||||
$oP->AddUiBlock($oPanel);
|
||||
$oP->AddTabContainer('Navigator', '', $oPanel);
|
||||
$oP->SetCurrentTabContainer('Navigator');
|
||||
|
||||
$sFirstTab = MetaModel::GetConfig()->Get('impact_analysis_first_tab');
|
||||
|
||||
@@ -2239,13 +2239,13 @@ EOF
|
||||
$oSearch = new DBObjectSearch($sListClass);
|
||||
$oSearch->AddCondition('id', $aDefinition['keys'], 'IN');
|
||||
$oSearch->SetShowObsoleteData(utils::ShowObsoleteData());
|
||||
$oPage->add("<h1>".Dict::Format('UI:RelationGroupNumber_N', (1 + $idx))."</h1>\n");
|
||||
$oPage->add("<div id=\"relation_group_$idx\" class=\"page_header\">\n");
|
||||
$oPage->add("<h2>".MetaModel::GetClassIcon($sListClass)." <span class=\"hilite\">".Dict::Format('UI:Search:Count_ObjectsOf_Class_Found', count($aDefinition['keys']), Metamodel::GetName($sListClass))."</h2>\n");
|
||||
$oPage->add("</div>\n");
|
||||
$oPage->AddUiBlock(TitleUIBlockFactory::MakeNeutral(Dict::Format('UI:RelationGroupNumber_N', (1 + $idx))));
|
||||
$oBlock = new DisplayBlock($oSearch, 'list');
|
||||
$oBlock->Display($oPage, 'group_'.$iBlock++);
|
||||
$oPage->p(' '); // Some space ?
|
||||
$oBlock->Display($oPage, 'group_'.$iBlock++, array('surround_with_panel' => true,
|
||||
'panel_class' => $sListClass,
|
||||
'panel_title' => Dict::Format('UI:Search:Count_ObjectsOf_Class_Found', count($aDefinition['keys']), Metamodel::GetName($sListClass)),
|
||||
'panel_icon' => MetaModel::GetClassIcon($sListClass, false),
|
||||
));
|
||||
}
|
||||
$oKPI->ComputeAndReport('Data fetch and format');
|
||||
break;
|
||||
@@ -2259,12 +2259,13 @@ EOF
|
||||
$oSearch = new DBObjectSearch($sListClass);
|
||||
$oSearch->AddCondition('id', $aKeys, 'IN');
|
||||
$oSearch->SetShowObsoleteData(utils::ShowObsoleteData());
|
||||
$oPage->add("<div class=\"page_header\">\n");
|
||||
$oPage->add("<h2>".MetaModel::GetClassIcon($sListClass)." <span class=\"hilite\">".Dict::Format('UI:Search:Count_ObjectsOf_Class_Found', count($aKeys), Metamodel::GetName($sListClass))."</h2>\n");
|
||||
$oPage->add("</div>\n");
|
||||
$oBlock = new DisplayBlock($oSearch, 'list');
|
||||
$oBlock->Display($oPage, 'list_'.$iBlock++, array('table_id' => 'ImpactAnalysis_'.$sListClass));
|
||||
$oPage->p(' '); // Some space ?
|
||||
$oBlock->Display($oPage, 'list_'.$iBlock++, array('table_id' => 'ImpactAnalysis_'.$sListClass,
|
||||
'surround_with_panel' => true,
|
||||
'panel_class' => $sListClass,
|
||||
'panel_title' => Dict::Format('UI:Search:Count_ObjectsOf_Class_Found', count($aKeys), Metamodel::GetName($sListClass)),
|
||||
'panel_icon' => MetaModel::GetClassIcon($sListClass, false),
|
||||
));
|
||||
}
|
||||
$oKPI->ComputeAndReport('Data fetch and format');
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user