diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index 5cb86d027e..c66cb148ea 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -553,7 +553,7 @@ if ($load_filter_modal) { ); echo '
'; - echo '
'; + echo ''; $table = new StdClass; $table->id = 'load_filter_form'; diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index e95f16b355..5a00ff9828 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -222,7 +222,7 @@ $id_source_event = get_parameter( $server_id = get_parameter( 'filter[server_id]', - ($filter['id_server_meta'] ?? '') + ($filter['server_id'] ?? '') ); if (is_metaconsole() === true) { @@ -241,13 +241,19 @@ if (is_metaconsole() === true) { $servers[0] = __('Metaconsola'); - if ($server_id === '') { + if (empty($server_id) === true) { $server_id = array_keys($servers); - } else if (is_array($server_id) === false) { - if ((int) $server_id !== 0) { - $server_id = [$server_id]; - } else { - $server_id = array_keys($servers); + } else { + if (is_array($server_id) === false) { + if (is_numeric($server_id) === true) { + if ($server_id !== 0) { + $server_id = [$filter['server_id']]; + } else { + $server_id = array_keys($servers); + } + } else { + $server_id = explode(',', $filter['server_id']); + } } } } @@ -1108,7 +1114,21 @@ if ($loaded_filter !== false && $from_event_graph != 1 && isset($fb64) === false $id_extra = $filter['id_extra']; $user_comment = $filter['user_comment']; $id_source_event = ($filter['id_source_event'] ?? ''); - $server_id = $filter['server_id']; + $server_id = ''; + if (empty($filter['server_id']) === false) { + if (is_array($server_id) === false) { + if (is_numeric($server_id) === true) { + if ($server_id !== 0) { + $server_id = [$filter['server_id']]; + } else { + $server_id = array_keys($servers); + } + } else { + $server_id = explode(',', $filter['server_id']); + } + } + } + $custom_data = $filter['custom_data']; $custom_data_filter_type = $filter['custom_data_filter_type']; } @@ -2849,7 +2869,11 @@ $(document).ready( function() { inputs = $("# :input"); values = {}; inputs.each(function() { - values[this.name] = $(this).val(); + if (this.name === 'server_id') { + values[this.name] = $(this).val().join(); + } else { + values[this.name] = $(this).val(); + } }) values['history'] = ""; @@ -3030,7 +3054,11 @@ $(document).ready( function() { inputs = $("#events_form :input"); values = {}; inputs.each(function() { - values[this.name] = $(this).val(); + if (this.name === 'server_id') { + values[this.name] = $(this).val().join(); + } else { + values[this.name] = $(this).val(); + } }) var newValue = btoa(JSON.stringify(values)); diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 89fa418389..ae0e6624f3 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1256,7 +1256,7 @@ CREATE TABLE IF NOT EXISTS `tevent_filter` ( `id_extra` TINYTEXT, `user_comment` TEXT, `id_source_event` INT NULL DEFAULT 0, - `server_id` INT NOT NULL DEFAULT 0, + `server_id` TEXT, `time_from` TIME NULL, `time_to` TIME NULL, `custom_data` VARCHAR(500) DEFAULT '',