From 11ff9d46a1b106016cb3ec8c8d6c9b72b6242419 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Mon, 14 Mar 2016 15:53:43 +0100 Subject: [PATCH] Fixed some fails in SLA operation due to Working time improvement #3470 --- pandora_console/include/functions_reporting.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 7960676f6e..b105bff723 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -7801,6 +7801,15 @@ function reporting_get_agentmodule_sla_day ($id_agent_module, $period = 0, $min_ $first_interval_time = array_shift ($interval_data); $period_reduced -= $first_interval_time['utimestamp'] - $datelimit + $datelimit_increased; array_unshift ($interval_data, $first_interval_time); + // Remove rebased points + while ($wt_points[0] <= $first_interval_time['utimestamp']) { + array_shift ($wt_points); + $wt_status = !$wt_status; + } + } + + if (count ($wt_points) < 2) { + return false; } // Get next data