Merge branch 'ent-7784-12114-en-las-templates-de-informes-en-metaconsola-no-busca-por-grupos-secundarios' into 'develop'

Fix list agent with secondaty grouos on selec

See merge request artica/pandorafms!4303
This commit is contained in:
Daniel Rodriguez 2021-11-15 10:16:24 +00:00
commit e573e79bcd
2 changed files with 13 additions and 2 deletions

View File

@ -990,6 +990,8 @@ if ($update_agent) {
$cps = get_parameter_switch('cps', -1);
$old_values = db_get_row('tagente', 'id_agente', $id_agente);
$fields = db_get_all_fields_in_table('tagent_custom_fields');
$secondary_groups = (string) get_parameter('secondary_hidden', '');
if ($fields === false) {
$fields = [];
@ -1219,7 +1221,16 @@ if ($update_agent) {
"Quiet":"'.(int) $quiet.'",
"Cps":"'.(int) $cps.'"}';
enterprise_hook('update_agent', [$id_agente]);
// Create the secondary groups.
enterprise_hook(
'agents_update_secondary_groups',
[
$id_agente,
explode(',', $secondary_groups),
[],
]
);
ui_print_success_message(__('Successfully updated'));
db_pandora_audit(
'Agent management',

View File

@ -1283,7 +1283,7 @@ function agents_get_group_agents(
if (!$add_alert_bulk_op) {
// Add the rest of the filter from the search array.
foreach ($search as $key => $value) {
$filter[] = $value;
$filter[$key] = $value;
}
}
} else if ($filter !== true) {