From 987678b33961122d9eceb629235bafcaed47e3a2 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Fri, 15 Jul 2022 11:38:46 +0200 Subject: [PATCH] #9107 Fixed filter event --- pandora_console/include/ajax/events.php | 10 +++++----- pandora_console/operation/events/events.php | 8 ++++---- pandora_console/operation/users/user_edit.php | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index 5a92d33c16..ea24e3afa8 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -771,7 +771,7 @@ if ($save_filter_modal) { $data[1] .= html_print_select( $user_groups_array, - 'id_group_filter', + 'id_group_filter_dialog', $id_group_filter, '', '', @@ -878,7 +878,7 @@ function save_new_filter() { "page" : "include/ajax/events", "save_event_filter" : 1, "id_name" : $("#text-id_name").val(), - "id_group" : $("select#id_group").val(), + "id_group" : $("#id_group_filter").val(), "event_type" : $("#event_type").val(), "severity" : $("#severity").val(), "status" : $("#status").val(), @@ -893,7 +893,7 @@ function save_new_filter() { "tag_with": Base64.decode($("#hidden-tag_with").val()), "tag_without": Base64.decode($("#hidden-tag_without").val()), "filter_only_alert" : $("#filter_only_alert").val(), - "id_group_filter": $("#id_group_filter").val(), + "id_group_filter": $("#id_group_filter_dialog").val(), "date_from": $("#text-date_from").val(), "time_from": $("#text-time_from").val(), "date_to": $("#text-date_to").val(), @@ -953,7 +953,7 @@ function save_update_filter() { {"page" : "include/ajax/events", "update_event_filter" : 1, "id" : $("#overwrite_filter").val(), - "id_group" : $("select#id_group").val(), + "id_group" : $("#id_group_filter").val(), "event_type" : $("#event_type").val(), "severity" : $("#severity").val(), "status" : $("#status").val(), @@ -968,7 +968,7 @@ function save_update_filter() { "tag_with" : Base64.decode($("#hidden-tag_with").val()), "tag_without" : Base64.decode($("#hidden-tag_without").val()), "filter_only_alert" : $("#filter_only_alert").val(), - "id_group_filter": $("#id_group_filter").val(), + "id_group_filter": $("#id_group_filter_dialog").val(), "date_from": $("#text-date_from").val(), "time_from": $("#text-time_from").val(), "date_to": $("#text-date_to").val(), diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 781301e2e0..09f6a972ad 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -171,7 +171,7 @@ $filter_only_alert = get_parameter( ); $id_group_filter = get_parameter( 'filter[id_group_filter]', - ($filter['id_group_filter'] ?? '') + ($filter['id_group'] ?? '') ); $date_from = get_parameter( 'filter[date_from]', @@ -1551,8 +1551,8 @@ if (enterprise_hook( */ // Group. -if ($id_group_filter === null) { - $id_group_filter = 0; +if ($id_group === null) { + $id_group = 0; } $data = html_print_input( @@ -1561,7 +1561,7 @@ $data = html_print_input( 'returnAllGroup' => true, 'privilege' => 'AR', 'type' => 'select_groups', - 'selected' => $id_group_filter, + 'selected' => $id_group, 'nothing' => false, 'return' => true, 'size' => '80%', diff --git a/pandora_console/operation/users/user_edit.php b/pandora_console/operation/users/user_edit.php index f76fbfff31..c9c875f4f4 100644 --- a/pandora_console/operation/users/user_edit.php +++ b/pandora_console/operation/users/user_edit.php @@ -446,7 +446,7 @@ if (isset($double_authentication)) { if (check_acl($config['id_user'], 0, 'ER')) { $event_filter = '

'.__('Event filter').'

'; - $user_groups = implode(',', array_keys((users_get_groups($config['id_user'], 'AR', $display_all_group)))); + $user_groups = implode(',', array_keys((users_get_groups($config['id_user'], 'AR', true)))); $event_filter .= html_print_select_from_sql( 'SELECT id_filter, id_name FROM tevent_filter WHERE id_group_filter IN ('.$user_groups.')', 'event_filter',