diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 7543e30413..2691a7b0d8 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -3529,15 +3529,11 @@ function series_type_graph_array($data, $show_elements_graph) break; } - if (isset($show_elements_graph['labels']) + if (isset($show_elements_graph['labels'][$value['agent_module_id']]) && is_array($show_elements_graph['labels']) && (count($show_elements_graph['labels']) > 0) ) { - if ($value['unit']) { - $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].' / '.__('Unit ').' '.$value['unit'].': '; - } else { - $name_legend = $data_return['legend'][$key] = $value['agent_alias'].' / '.$value['module_name'].': '; - } + $name_legend = $data_return['legend'][$key] = $show_elements_graph['labels'][$value['agent_module_id']].' '; } else { if (strpos($key, 'baseline') !== false) { if ($value['unit']) { diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 72667e0480..d97817eb3f 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1222,11 +1222,11 @@ function graphic_combined_module( foreach ($sources as $source) { array_push($modules, $source['id_agent_module']); array_push($weights, $source['weight']); - if ($source['label'] != '') { + if ($source['label'] != '' || $params_combined['labels']) { $item['type'] = 'custom_graph'; $item['id_agent'] = agents_get_module_id($source['id_agent_module']); $item['id_agent_module'] = $source['id_agent_module']; - $labels[$source['id_agent_module']] = reporting_label_macro($item, $source['label']); + $labels[$source['id_agent_module']] = ($source['label'] != '') ? reporting_label_macro($item, $source['label']) : reporting_label_macro($item, $params_combined['labels']); } } } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 1581119772..1b612ebf80 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -4384,6 +4384,9 @@ function reporting_value($report, $content, $type, $pdf=false) $return['description'] = $content['description']; $return['date'] = reporting_get_date_text($report, $content); $return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : ''; + $return['agents'] = [$content['id_agent']]; + $return['id_agent'] = $content['id_agent']; + $return['id_agent_module'] = $content['id_agent_module']; $return['agent_name'] = $agent_name; $return['module_name'] = $module_name; @@ -7072,6 +7075,7 @@ function reporting_custom_graph( 'modules_series' => $graphs[0]['modules_series'], 'id_graph' => $id_graph, 'type_report' => $type_report, + 'labels' => $content['style']['label'], ]; $return['chart'] = graphic_combined_module(