From be8d87e9e7abc1014b45e37c55cd7320a7902ca8 Mon Sep 17 00:00:00 2001 From: vgilc Date: Wed, 6 Jun 2012 16:13:12 +0000 Subject: [PATCH] 2012-06-06 Vanessa Gil * operation/agentes/exportdata.php: Fixed bug: If the data type of module is string, don't export the data in format: table, Excel or CSV. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6424 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ .../operation/agentes/exportdata.php | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 6d14a95a4f..b3ab870e42 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-06-06 Vanessa Gil + + * operation/agentes/exportdata.php: Fixed bug: + If the data type of module is string, don't export the data in format: table, Excel or CSV. + 2012-06-06 Vanessa Gil * include/functions_modules.php: Fixed bug: When you diff --git a/pandora_console/operation/agentes/exportdata.php b/pandora_console/operation/agentes/exportdata.php index 30c4f07d1d..b621e14a3b 100644 --- a/pandora_console/operation/agentes/exportdata.php +++ b/pandora_console/operation/agentes/exportdata.php @@ -327,6 +327,7 @@ if (empty($export_btn)) { //Module selector $table->data[2][0] = ''.__('Modules').''; + $table->data[2][0] .= ui_print_help_tip(__("No modules of type string. You can not calculate their average"),true); if ($agent > 0) { $modules = agents_get_modules ($agent); @@ -334,6 +335,23 @@ if (empty($export_btn)) { $modules = array (); } + if(!empty($modules)) { //remove modules of type string because you cant calculate their average. + $i = 0; + foreach ($modules as $key=>$module) { + $id_module_type = modules_get_agentmodule_type ($key); + switch ($id_module_type) { + case 3: + case 10: + case 17: + case 23: + case 33: + unset($modules[$i]); + break; + } + $i++; + } + } + $disabled_export_button = false; if (empty($modules)) { $disabled_export_button = true;