From 609802eb44efce427a9c24acb049ae4946db77ca Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 23 Feb 2015 15:13:21 +0100 Subject: [PATCH] Fixed the string module data in reports of items 'general'. #1819 --- pandora_console/include/functions_modules.php | 8 ++++++++ pandora_console/include/functions_reporting.php | 17 ++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index ab4d3d9b56..1bc432c898 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -867,6 +867,14 @@ function modules_is_string_type ($id_type) { return (bool)preg_match('/_string$/', $type_name); } +function modules_is_string($id_agentmodule) { + $id_type = db_get_value('id_tipo_modulo', + 'tagente_modulo', 'id_agente_modulo', + (int) $id_agentmodule); + + return modules_is_string_type($id_type); +} + /** * Get the icon of a module type * diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index f9561f5f8e..d735ae7d1f 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -5490,8 +5490,13 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f $data[3] = '--'; } else { - $data[3] = format_for_graph($d, 2) . " " . - $units[$i]; + if (!is_numeric($d)) { + $data[3] = $d; + } + else { + $data[3] = format_for_graph($d, 2) . " " . + $units[$i]; + } } array_push ($table1->data, $data); $i++; @@ -5660,7 +5665,13 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f $data[$i] = '--'; } else { - $data[$i] = format_for_graph($value_res, 2) . " " . $unit; + if (!is_numeric($d)) { + $data[$i] = $value_res; + } + else { + $data[$i] = format_for_graph($value_res, 2) . " " . $unit; + } + } $found = true; }