Merge branch 'ent-2133-14061-recursividad-en-la-vista-de-eventos-accelya' into 'develop'
filter recursive groups in events pandora_enterprise#2133 See merge request artica/pandorafms!5155
This commit is contained in:
commit
c8e8ea61f3
|
@ -3,4 +3,6 @@ START TRANSACTION;
|
|||
ALTER TABLE `tmodule_inventory` ADD COLUMN `script_mode` INT NOT NULL DEFAULT 2;
|
||||
ALTER TABLE `tmodule_inventory` ADD COLUMN `script_path` VARCHAR(1000) DEFAULT '';
|
||||
|
||||
ALTER TABLE `tevent_filter` ADD COLUMN `search_recursive_groups` INT NOT NULL DEFAULT 0;
|
||||
|
||||
COMMIT;
|
||||
|
|
|
@ -90,6 +90,7 @@ if ($id) {
|
|||
|
||||
$filter_only_alert = $filter['filter_only_alert'];
|
||||
$search_secondary_groups = $filter['search_secondary_groups'];
|
||||
$search_recursive_groups = $filter['search_recursive_groups'];
|
||||
$custom_data = $filter['custom_data'];
|
||||
$custom_data_filter_type = $filter['custom_data_filter_type'];
|
||||
|
||||
|
@ -128,6 +129,7 @@ if ($id) {
|
|||
$tag_without_base64 = base64_encode($tag_without_json);
|
||||
$filter_only_alert = '';
|
||||
$search_secondary_groups = 0;
|
||||
$search_recursive_groups = 0;
|
||||
}
|
||||
|
||||
if ($update || $create) {
|
||||
|
@ -170,6 +172,7 @@ if ($update || $create) {
|
|||
|
||||
$filter_only_alert = get_parameter('filter_only_alert', '');
|
||||
$search_secondary_groups = get_parameter('search_secondary_groups', 0);
|
||||
$search_recursive_groups = get_parameter('search_recursive_groups', 0);
|
||||
|
||||
$custom_data = get_parameter('custom_data', '');
|
||||
$custom_data_filter_type = get_parameter('custom_data_filter_type', '');
|
||||
|
@ -198,6 +201,7 @@ if ($update || $create) {
|
|||
'user_comment' => $user_comment,
|
||||
'filter_only_alert' => $filter_only_alert,
|
||||
'search_secondary_groups' => $search_secondary_groups,
|
||||
'search_recursive_groups' => $search_recursive_groups,
|
||||
'custom_data' => $custom_data,
|
||||
'custom_data_filter_type' => $custom_data_filter_type,
|
||||
];
|
||||
|
|
|
@ -360,10 +360,11 @@ if ($save_event_filter) {
|
|||
);
|
||||
$values['filter_only_alert'] = get_parameter('filter_only_alert');
|
||||
$values['search_secondary_groups'] = get_parameter('search_secondary_groups');
|
||||
$values['search_recursive_groups'] = get_parameter('search_recursive_groups');
|
||||
$values['id_group_filter'] = get_parameter('id_group_filter');
|
||||
$values['date_from'] = get_parameter('date_from');
|
||||
$values['date_from'] = get_parameter('date_from', null);
|
||||
$values['time_from'] = get_parameter('time_from');
|
||||
$values['date_to'] = get_parameter('date_to');
|
||||
$values['date_to'] = get_parameter('date_to', null);
|
||||
$values['time_to'] = get_parameter('time_to');
|
||||
$values['source'] = get_parameter('source');
|
||||
$values['id_extra'] = get_parameter('id_extra');
|
||||
|
@ -417,6 +418,7 @@ if ($update_event_filter) {
|
|||
);
|
||||
$values['filter_only_alert'] = get_parameter('filter_only_alert');
|
||||
$values['search_secondary_groups'] = get_parameter('search_secondary_groups');
|
||||
$values['search_recursive_groups'] = get_parameter('search_recursive_groups');
|
||||
$values['id_group_filter'] = get_parameter('id_group_filter');
|
||||
$values['date_from'] = get_parameter('date_from');
|
||||
$values['time_from'] = get_parameter('time_from');
|
||||
|
@ -471,6 +473,7 @@ if ($get_filter_values) {
|
|||
'module_search' => '',
|
||||
'filter_only_alert' => '-1',
|
||||
'search_secondary_groups' => 0,
|
||||
'search_recursive_groups' => 0,
|
||||
'user_comment' => '',
|
||||
'id_extra' => '',
|
||||
'id_user_ack' => '',
|
||||
|
@ -657,6 +660,8 @@ function load_form_filter() {
|
|||
$("#filter_only_alert").val(val);
|
||||
if (i == 'search_secondary_groups')
|
||||
$("#checkbox-search_secondary_groups").val(val);
|
||||
if (i == 'search_recursive_groups')
|
||||
$("#checkbox-search_recursive_groups").val(val);
|
||||
if (i == 'id_group_filter')
|
||||
$("#id_group_filter").val(val);
|
||||
if (i == 'source')
|
||||
|
@ -900,6 +905,7 @@ function save_new_filter() {
|
|||
"tag_without": Base64.decode($("#hidden-tag_without").val()),
|
||||
"filter_only_alert" : $("#filter_only_alert").val(),
|
||||
"search_secondary_groups" : $("#checkbox-search_secondary_groups").val(),
|
||||
"search_recursive_groups" : $("#checkbox-search_recursive_groups").val(),
|
||||
"id_group_filter": $("#id_group_filter_dialog").val(),
|
||||
"date_from": $("#text-date_from").val(),
|
||||
"time_from": $("#text-time_from").val(),
|
||||
|
@ -976,6 +982,7 @@ function save_update_filter() {
|
|||
"tag_without" : Base64.decode($("#hidden-tag_without").val()),
|
||||
"filter_only_alert" : $("#filter_only_alert").val(),
|
||||
"search_secondary_groups" : $("#checkbox-search_secondary_groups").val(),
|
||||
"search_recursive_groups" : $("#checkbox-search_recursive_groups").val(),
|
||||
"id_group_filter": $("#id_group_filter_dialog").val(),
|
||||
"date_from": $("#text-date_from").val(),
|
||||
"time_from": $("#text-time_from").val(),
|
||||
|
@ -2416,6 +2423,7 @@ if ($get_events_fired) {
|
|||
'tag_without' => [],
|
||||
'filter_only_alert' => -1,
|
||||
'search_secondary_groups' => 0,
|
||||
'search_recursive_groups' => 0,
|
||||
'source' => '',
|
||||
'id_extra' => '',
|
||||
'user_comment' => '',
|
||||
|
|
|
@ -627,6 +627,7 @@ function events_update_status($id_evento, $status, $filter=null)
|
|||
* 'tag_without'
|
||||
* 'filter_only_alert'
|
||||
* 'search_secondary_groups'
|
||||
* 'search_recursive_groups'
|
||||
* 'module_search'
|
||||
* 'group_rep'
|
||||
* 'server_id'
|
||||
|
@ -864,7 +865,10 @@ function events_get_all(
|
|||
if (isset($groups) === true
|
||||
&& (is_array($groups) === true || ($groups > 0))
|
||||
) {
|
||||
if ($recursiveGroups === true) {
|
||||
if ($recursiveGroups === true
|
||||
|| (isset($filter['search_recursive_groups']) === true
|
||||
&& (bool) $filter['search_recursive_groups'] === true)
|
||||
) {
|
||||
// Add children groups.
|
||||
$children = [];
|
||||
if (is_array($groups) === true) {
|
||||
|
|
|
@ -173,6 +173,10 @@ $search_secondary_groups = get_parameter(
|
|||
'filter[search_secondary_groups]',
|
||||
0
|
||||
);
|
||||
$search_recursive_groups = get_parameter(
|
||||
'filter[search_recursive_groups]',
|
||||
0
|
||||
);
|
||||
$id_group_filter = get_parameter(
|
||||
'filter[id_group_filter]',
|
||||
($filter['id_group'] ?? '')
|
||||
|
@ -1090,6 +1094,7 @@ if ($loaded_filter !== false && $from_event_graph != 1 && isset($fb64) === false
|
|||
|
||||
$filter_only_alert = $filter['filter_only_alert'];
|
||||
$search_secondary_groups = ($filter['search_secondary_groups'] ?? 0);
|
||||
$search_recursive_groups = ($filter['search_recursive_groups'] ?? 0);
|
||||
$id_group_filter = $filter['id_group_filter'];
|
||||
$date_from = $filter['date_from'];
|
||||
$time_from = $filter['time_from'];
|
||||
|
@ -1710,6 +1715,28 @@ $in = '<div class="filter_input"><label>'.__('Severity').'</label>';
|
|||
$in .= $data.'</div>';
|
||||
$inputs[] = $in;
|
||||
|
||||
// Search recursive groups.
|
||||
$data = html_print_checkbox_switch(
|
||||
'search_recursive_groups',
|
||||
$search_recursive_groups,
|
||||
$search_recursive_groups,
|
||||
true,
|
||||
false,
|
||||
'search_in_secondary_groups(this);',
|
||||
true
|
||||
);
|
||||
|
||||
$in = '<div class="filter_input filter_input_switch"><label>';
|
||||
$in .= __('Group recursion');
|
||||
$in .= ui_print_help_tip(
|
||||
__('WARNING: This could cause a performace impact.'),
|
||||
true
|
||||
);
|
||||
$in .= '</label>';
|
||||
$in .= $data;
|
||||
$in .= '</div>';
|
||||
$inputs[] = $in;
|
||||
|
||||
// Search secondary groups.
|
||||
$data = html_print_checkbox_switch(
|
||||
'search_secondary_groups',
|
||||
|
@ -1721,8 +1748,15 @@ $data = html_print_checkbox_switch(
|
|||
true
|
||||
);
|
||||
|
||||
$in = '<div class="filter_input filter_input_switch"><label>'.__('Search in secondary groups').'</label>';
|
||||
$in .= $data.'</div>';
|
||||
$in = '<div class="filter_input filter_input_switch"><label>';
|
||||
$in .= __('Search in secondary groups');
|
||||
$in .= ui_print_help_tip(
|
||||
__('WARNING: This could cause a performace impact.'),
|
||||
true
|
||||
);
|
||||
$in .= '</label>';
|
||||
$in .= $data;
|
||||
$in .= '</div>';
|
||||
$inputs[] = $in;
|
||||
|
||||
// Trick view in table.
|
||||
|
|
|
@ -1245,6 +1245,7 @@ CREATE TABLE IF NOT EXISTS `tevent_filter` (
|
|||
`tag_without` TEXT,
|
||||
`filter_only_alert` INT NOT NULL DEFAULT -1,
|
||||
`search_secondary_groups` INT NOT NULL DEFAULT 0,
|
||||
`search_recursive_groups` INT NOT NULL DEFAULT 0,
|
||||
`date_from` date DEFAULT NULL,
|
||||
`date_to` date DEFAULT NULL,
|
||||
`source` TINYTEXT,
|
||||
|
|
Loading…
Reference in New Issue