Merge branch '1173-Campo-label-no-funciona-en-templates-de-informe-en-la-metaconsola-dev' into 'develop'

Added label in automatic graph

See merge request !706
This commit is contained in:
vgilc 2017-08-14 12:13:58 +02:00
commit baf9b6aa5a
1 changed files with 25 additions and 18 deletions

View File

@ -5789,17 +5789,10 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
require_once ($config["homedir"] . '/include/functions_graph.php');
if ($type_report == 'automatic_graph') {
// Do none
}
else {
if ($config['metaconsole']) {
$id_meta = metaconsole_get_id_server($content["server_name"]);
$server = metaconsole_get_connection_by_id ($id_meta);
metaconsole_connect($server);
}
if ($config['metaconsole'] && $type_report != 'automatic_graph') {
$id_meta = metaconsole_get_id_server($content["server_name"]);
$server = metaconsole_get_connection_by_id ($id_meta);
metaconsole_connect($server);
}
$graph = db_get_row ("tgraph", "id_graph", $content['id_gs']);
@ -5853,6 +5846,25 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
'id_agent_module'=>$graph_item['id_agent_module']);
}
if($type_report == 'automatic_graph'){
$label = (isset($content['style']['label'])) ? $content['style']['label'] : '';
if (!empty($label)) {
if ($config['metaconsole']) {
$id_meta = metaconsole_get_id_server($content["server_name"]);
$server = metaconsole_get_connection_by_id ($id_meta);
metaconsole_connect($server);
}
$label = reporting_label_macro($content, $label);
if ($config['metaconsole']) {
metaconsole_restore_db();
}
}
} else {
$label = (isset($content['style']['label'])) ? $content['style']['label'] : '';
$label = reporting_label_macro($content, $label);
}
$labels[$graph_item['id_agent_module']] = $label;
}
}
@ -5909,13 +5921,8 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
break;
}
if ($type_report == 'automatic_graph') {
// Do none
}
else {
if ($config['metaconsole']) {
metaconsole_restore_db();
}
if ($config['metaconsole'] && $type_report != 'automatic_graph') {
metaconsole_restore_db();
}
return reporting_check_structure_content($return);