From 2bfe4d42633793c9377d0166d3d582189b067422 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Wed, 11 Feb 2015 09:54:44 +0100 Subject: [PATCH] Fixed problem when return false instead of data, variable not change and enter a infinite bucle (cherry picked from commit 70b95d7f1eec8107602cc5617cc6604d3a0ca0ed) --- pandora_console/operation/agentes/exportdata.csv.php | 3 ++- pandora_console/operation/agentes/exportdata.excel.php | 5 +++-- pandora_console/operation/agentes/exportdata.php | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pandora_console/operation/agentes/exportdata.csv.php b/pandora_console/operation/agentes/exportdata.csv.php index 7357da843f..2987a58cab 100644 --- a/pandora_console/operation/agentes/exportdata.csv.php +++ b/pandora_console/operation/agentes/exportdata.csv.php @@ -105,7 +105,7 @@ if (!empty ($module)) { foreach ($module as $selected) { $output = ""; - $work_period = 120000; + $work_period = SECONDS_1DAY; if ($work_period > $period) { $work_period = $period; } @@ -120,6 +120,7 @@ if (!empty ($module)) { $arr = array (); $arr["data"] = reporting_get_agentmodule_data_average ($selected, $work_period, $work_end); if ($arr["data"] === false) { + $work_end = $work_end + $work_period; continue; } $arr["module_name"] = modules_get_agentmodule_name ($selected); diff --git a/pandora_console/operation/agentes/exportdata.excel.php b/pandora_console/operation/agentes/exportdata.excel.php index 64d4e8b0c2..82bc16aaf2 100644 --- a/pandora_console/operation/agentes/exportdata.excel.php +++ b/pandora_console/operation/agentes/exportdata.excel.php @@ -104,7 +104,7 @@ if (!empty ($module)) { foreach ($module as $selected) { $output = ""; - $work_period = 120000; + $work_period = SECONDS_1DAY; if ($work_period > $period) { $work_period = $period; } @@ -119,6 +119,7 @@ if (!empty ($module)) { $arr = array (); $arr["data"] = reporting_get_agentmodule_data_average ($selected, $work_period, $work_end); if ($arr["data"] === false) { + $work_end = $work_end + $work_period; continue; } $arr["module_name"] = modules_get_agentmodule_name ($selected); @@ -162,4 +163,4 @@ if (!empty ($module)) { else { ui_print_error_message (__('No modules specified')); } -?> \ No newline at end of file +?> diff --git a/pandora_console/operation/agentes/exportdata.php b/pandora_console/operation/agentes/exportdata.php index 084aaf40bc..d2cb568a3c 100644 --- a/pandora_console/operation/agentes/exportdata.php +++ b/pandora_console/operation/agentes/exportdata.php @@ -137,6 +137,7 @@ if (!empty ($export_btn) && !empty ($module)) { reporting_get_agentmodule_data_average( $selected, $work_period, $work_end); if ($arr["data"] === false) { + $work_end = $work_end + $work_period; continue; } $arr["module_name"] = modules_get_agentmodule_name ($selected);