From 93b64ba43cd8fc4f4070c8c08490bce9f0ccc3f0 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 11 Aug 2016 10:04:10 +0200 Subject: [PATCH] fixed minor error in report #10 --- .../include/functions_reporting.php | 52 +++++++++++-------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index d189ff2b8f..531173ad5e 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -4065,6 +4065,7 @@ function reporting_general($report, $content) { $mod_name = modules_get_agentmodule_name ($row['id_agent_module']); $ag_name = modules_get_agentmodule_agent_name ($row['id_agent_module']); + $type_mod = modules_get_last_value($row['id_agent_module']); $unit = db_get_value('unit', 'tagente_modulo', 'id_agente_modulo', $row['id_agent_module']); @@ -4074,28 +4075,32 @@ function reporting_general($report, $content) { modules_get_last_value($row['id_agent_module']); } else { - switch ($row['operation']) { - case 'sum': - $data_res[$key] = - reporting_get_agentmodule_data_sum( - $row['id_agent_module'], $content['period'], $report["datetime"]); - break; - case 'max': - $data_res[$key] = - reporting_get_agentmodule_data_max( - $row['id_agent_module'], $content['period']); - break; - case 'min': - $data_res[$key] = - reporting_get_agentmodule_data_min( - $row['id_agent_module'], $content['period']); - break; - case 'avg': - default: - $data_res[$key] = - reporting_get_agentmodule_data_average( - $row['id_agent_module'], $content['period']); - break; + if(is_numeric($type_mod)){ + switch ($row['operation']) { + case 'sum': + $data_res[$key] = + reporting_get_agentmodule_data_sum( + $row['id_agent_module'], $content['period'], $report["datetime"]); + break; + case 'max': + $data_res[$key] = + reporting_get_agentmodule_data_max( + $row['id_agent_module'], $content['period']); + break; + case 'min': + $data_res[$key] = + reporting_get_agentmodule_data_min( + $row['id_agent_module'], $content['period']); + break; + case 'avg': + default: + $data_res[$key] = + reporting_get_agentmodule_data_average( + $row['id_agent_module'], $content['period']); + break; + } + } else { + $data_res[$key] = $type_mod; } } @@ -4250,8 +4255,11 @@ function reporting_general($report, $content) { if (!is_numeric($d)) { $data['value'] = $d; + // to see the chains on the table + $data['formated_value'] = $d; } else { + $data['value'] = $d; $data['formated_value'] = format_for_graph($d, 2) . " " . $units[$i];