diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php
index 4686e5588f..fb91f3584a 100644
--- a/pandora_console/include/functions_netflow.php
+++ b/pandora_console/include/functions_netflow.php
@@ -1099,11 +1099,6 @@ function netflow_draw_item(
}
if ($output == 'HTML' || $output == 'PDF') {
- $html .= ' '.__('Aggregate').': '.netflow_format_aggregate($aggregate);
- if ($interval_length != 0) {
- $html .= ' '._('Resolution').': '.netflow_get_resolution_name($interval_length);
- }
-
$html .= graph_netflow_aggregate_area(
$data,
$interval,
@@ -1140,11 +1135,6 @@ function netflow_draw_item(
}
if ($output == 'HTML' || $output == 'PDF') {
- $html .= ' '.__('Aggregate').': '.netflow_format_aggregate($aggregate);
- if ($interval_length != 0) {
- $html .= ' '._('Resolution').': '.netflow_get_resolution_name($interval_length);
- }
-
$html .= "
";
$html .= netflow_data_table($data, $start_date, $end_date, $aggregate);
$html .= '
';
@@ -1219,16 +1209,10 @@ function netflow_draw_item(
}
if ($output == 'HTML') {
- $html .= ' '.__('Aggregate').': '.netflow_format_aggregate($aggregate);
- $html .= graph_netflow_aggregate_pie($data_pie, netflow_format_aggregate($aggregate));
return $html;
} else if ($output == 'PDF') {
- $html .= ' '.__('Aggregate').': '.$aggregate;
- $html .= graph_netflow_aggregate_pie($data_pie, netflow_format_aggregate($aggregate), 2, true);
return $html;
} else if ($output == 'XML') {
- $xml .= ''.$aggregate."\n";
- $xml .= netflow_aggregate_pie_xml($data_pie);
return $xml;
}
break;
@@ -1264,7 +1248,6 @@ function netflow_draw_item(
$html .= '';
$html .= '';
$html .= netflow_summary_table($data_summary);
- $html .= ' '.__('Aggregate').': '.netflow_format_aggregate($aggregate);
$html .= ' | ';
$html .= '';
$html .= graph_netflow_aggregate_pie($data_pie, netflow_format_aggregate($aggregate));
@@ -1789,3 +1772,32 @@ function netflow_get_resolution_name($value)
$resolutions = netflow_resolution_select_params();
return (isset($resolutions[$value])) ? $resolutions[$value] : __('Unknown');
}
+
+
+/**
+ * Report formatted subtitle.
+ *
+ * @param string $aggreagate Aggregate by param.
+ * @param string $resolution Netfow live view resolution.
+ * @param string $type Type of view.
+ *
+ * @return string HTML with formatted subtitle.
+ */
+function netflow_generate_subtitle_report($aggregate, $resolution, $type)
+{
+ $subt = __(
+ 'Agregate by %s',
+ netflow_format_aggregate($aggregate)
+ );
+
+ // Display the resolution only in required reports.
+ if (in_array($type, ['netflow_area', 'netflow_data']) === true) {
+ $subt .= ' - ';
+ $subt .= __(
+ 'Resolution %s',
+ netflow_get_resolution_name($resolution)
+ );
+ }
+
+ return $subt;
+}
diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php
index 6ab9fefabe..e42a076015 100755
--- a/pandora_console/include/functions_reporting.php
+++ b/pandora_console/include/functions_reporting.php
@@ -3964,6 +3964,20 @@ function reporting_monitor_report($report, $content)
}
+/**
+ * Generates the data structure to build a netflow report.
+ *
+ * @param array $report Global report info.
+ * @param array $content Report item info.
+ * @param string $type Report type (static, dynamic, data).
+ * @param integer $force_width_chart Fixed width chart.
+ * @param integer $force_height_chart Fixed height chart.
+ * @param string $type_netflow One of netflow_area, netflow_pie,
+ * netflow_data, netflow_statistics, netflow_summary.
+ * @param boolean $pdf True if a pdf report is generating.
+ *
+ * @return array Report item structure.
+ */
function reporting_netflow(
$report,
$content,
@@ -3995,6 +4009,10 @@ function reporting_netflow(
case 'netflow_summary':
$return['type'] = 'netflow_summary';
break;
+
+ default:
+ $return['type'] = 'unknown';
+ break;
}
if (empty($content['name'])) {
@@ -4018,6 +4036,10 @@ function reporting_netflow(
case 'netflow_summary':
$content['name'] = __('Netflow Summary');
break;
+
+ default:
+ $content['name'] = __('Unknown report');
+ break;
}
}
@@ -4025,7 +4047,7 @@ function reporting_netflow(
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
- // Get chart
+ // Get chart.
reporting_set_conf_charts(
$width,
$height,
@@ -4043,7 +4065,7 @@ function reporting_netflow(
$height = $force_height_chart;
}
- // Get item filters
+ // Get item filters.
$filter = db_get_row_sql(
"SELECT *
FROM tnetflow_filter
@@ -4068,9 +4090,17 @@ function reporting_netflow(
break;
case 'data':
+ default:
+ // Nothing to do.
break;
}
+ $return['subtitle'] = netflow_generate_subtitle_report(
+ $filter['aggregate'],
+ $content['top_n'],
+ $type_netflow
+ );
+
return reporting_check_structure_content($return);
}
|