mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-17 06:18:44 +02:00
N°3685 - Front-end performances: Include graph libs. (Raphael, simple_graph, ...) only when necessary
This commit is contained in:
@@ -1499,10 +1499,12 @@ EOF
|
||||
|
||||
$sDirection = utils::ReadParam('d', 'horizontal');
|
||||
$iGroupingThreshold = utils::ReadParam('g', 5);
|
||||
|
||||
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/raphael-min.js');
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/fraphael.js');
|
||||
$oP->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/jquery.contextMenu.css');
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.contextMenu.js');
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.mousewheel.js');
|
||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/simple_graph.js');
|
||||
try
|
||||
{
|
||||
|
||||
@@ -281,14 +281,9 @@ class _Ticket extends cmdbAbstractObject
|
||||
// Display the impact analysis for tickets not in 'closed' or 'resolved' status... and not in edition
|
||||
if ((!$bEditMode) && (!in_array($this->Get('status'), array('resolved', 'closed'))))
|
||||
{
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/fraphael.js');
|
||||
$oPage->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/jquery.contextMenu.css');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.contextMenu.js');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/simple_graph.js');
|
||||
$oPage->AddAjaxTab('Ticket:ImpactAnalysis',
|
||||
utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php?operation=ticket_impact&class='.get_class($this).'&id='.$this->GetKey(),
|
||||
true, null, AjaxTab::ENUM_TAB_PLACEHOLDER_MISC);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -2207,6 +2207,7 @@ EOF
|
||||
require_once(APPROOT.'core/simplegraph.class.inc.php');
|
||||
require_once(APPROOT.'core/relationgraph.class.inc.php');
|
||||
require_once(APPROOT.'core/displayablegraph.class.inc.php');
|
||||
|
||||
$sRelation = utils::ReadParam('relation', 'impacts');
|
||||
$sDirection = utils::ReadParam('direction', 'down');
|
||||
$iGroupingThreshold = utils::ReadParam('g', 5);
|
||||
@@ -2216,6 +2217,13 @@ EOF
|
||||
$sImpactAttCodeValue = utils::ReadParam('impact_attcode_value', 'manual');
|
||||
$iId = (int)utils::ReadParam('id', 0, false, 'integer');
|
||||
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/raphael-min.js');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/fraphael.js');
|
||||
$oPage->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/jquery.contextMenu.css');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.contextMenu.js');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.mousewheel.js');
|
||||
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/simple_graph.js');
|
||||
|
||||
// Get the list of source objects
|
||||
$oTicket = MetaModel::GetObject($sClass, $iId);
|
||||
$oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
|
||||
|
||||
@@ -43,6 +43,9 @@ class iTopWebPage extends NiceWebPage implements iTabbedPage
|
||||
// - DashletGroupBy & other specific places
|
||||
'js/d3.js',
|
||||
'js/c3.js',
|
||||
// - DisplayableGraph, impact analysis
|
||||
'js/raphael-min.js',
|
||||
'js/jquery.mousewheel.js',
|
||||
|
||||
// Deprecated files
|
||||
'js/date.js',
|
||||
@@ -189,8 +192,6 @@ class iTopWebPage extends NiceWebPage implements iTabbedPage
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/property_field.js');
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/icon_select.js');
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/ajaxfileupload.js');
|
||||
|
||||
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/raphael-min.js');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user