Fix adding agnents planned downtime

This commit is contained in:
Calvo 2022-10-18 09:52:08 +02:00
parent b29f7eb160
commit 3f8e0f765a
1 changed files with 12 additions and 2 deletions

View File

@ -1423,9 +1423,19 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
} else {
// If is selected 'Any', get all the agents.
if (count($agents) === 1 && (int) $agents[0] === -2) {
$agents = agents_get_agents(
$agents = db_get_all_rows_filter(
'tagente',
['id_grupo' => $filter_group],
'id_agent'
'id_agente'
);
$agents = array_reduce(
$agents,
function ($carry, $item) {
$carry[] = $item['id_agente'];
return $carry;
}
);
}