mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +02:00
Solved a SLA problem on no-init modules TICKETS #3479
This commit is contained in:
parent
ec21d8a6d3
commit
278255ff51
@ -7832,13 +7832,21 @@ function reporting_get_agentmodule_sla_day ($id_agent_module, $period = 0, $min_
|
|||||||
} else if (count ($interval_data) > 0) {
|
} else if (count ($interval_data) > 0) {
|
||||||
// Propagate undefined status to first time point
|
// Propagate undefined status to first time point
|
||||||
$first_interval_time = array_shift ($interval_data);
|
$first_interval_time = array_shift ($interval_data);
|
||||||
$period_reduced -= $first_interval_time['utimestamp'] - $datelimit + $datelimit_increased;
|
$previous_point = $datelimit + $datelimit_increased;
|
||||||
array_unshift ($interval_data, $first_interval_time);
|
$point = $datelimit + $datelimit_increased;
|
||||||
// Remove rebased points
|
// Remove rebased points and substract time only on working time
|
||||||
while ($wt_points[0] <= $first_interval_time['utimestamp']) {
|
while ($wt_points[0] <= $first_interval_time['utimestamp']) {
|
||||||
array_shift ($wt_points);
|
$point = array_shift ($wt_points);
|
||||||
|
if ($wt_status){
|
||||||
|
$period_reduced -= $point - $previous_point;
|
||||||
|
}
|
||||||
$wt_status = !$wt_status;
|
$wt_status = !$wt_status;
|
||||||
|
$previous_point = $point;
|
||||||
}
|
}
|
||||||
|
if ($wt_status){
|
||||||
|
$period_reduced -= $first_interval_time['utimestamp'] - $point;
|
||||||
|
}
|
||||||
|
array_unshift ($interval_data, $first_interval_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count ($wt_points) < 2) {
|
if (count ($wt_points) < 2) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user