From bc166dfba2f4b8683d4ec2ebae1cd3246d571d9a Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 17 Sep 2020 16:51:23 +0200 Subject: [PATCH] module custom id in event list + minor fixes --- pandora_console/godmode/events/custom_events.php | 1 + pandora_console/include/functions_events.php | 4 ++++ pandora_console/operation/events/events.php | 16 +++++++++++++--- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/events/custom_events.php b/pandora_console/godmode/events/custom_events.php index fb4b6f9ab1..124b0711c5 100644 --- a/pandora_console/godmode/events/custom_events.php +++ b/pandora_console/godmode/events/custom_events.php @@ -114,6 +114,7 @@ $fields_available['server_name'] = __('Server Name'); $fields_available['data'] = __('Data'); $fields_available['module_status'] = __('Module Status'); $fields_available['mini_severity'] = __('Severity mini'); +$fields_available['module_custom_id'] = __('Module custom ID'); // Remove fields already selected. diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 9f8cfdbf08..a6f0f83752 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -207,6 +207,7 @@ function events_get_all_fields() $columns['server_name'] = __('Server name'); $columns['data'] = __('Data'); $columns['module_status'] = __('Module status'); + $columns['module_custom_id'] = __('Module custom id'); return $columns; } @@ -291,6 +292,9 @@ function events_get_column_name($field, $table_alias=false) case 'module_status': return __('Module Status'); + case 'module_custom_id': + return __('Module custom ID'); + case 'options': return __('Options'); diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index f9a727f6c2..b0e7cc3002 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -292,6 +292,7 @@ if (is_ajax()) { if (!is_metaconsole()) { $fields[] = 'am.nombre as module_name'; $fields[] = 'am.id_agente_modulo as id_agentmodule'; + $fields[] = 'am.custom_id as module_custom_id'; $fields[] = 'ta.server_name as server_name'; } else { $fields[] = 'ts.server_name as server_name'; @@ -470,9 +471,13 @@ $tags_select_with = []; $tags_select_without = []; $tag_with_temp = []; $tag_without_temp = []; -$tag_with = json_decode(base64_decode($tag_with), true); -$tag_without = json_decode(base64_decode($tag_without), true); +if (is_array($tag_with) === false) { + $tag_with = json_decode(base64_decode($tag_with), true); +} +if (is_array($tag_without) === false) { + $tag_without = json_decode(base64_decode($tag_without), true); +} foreach ($tags as $id_tag => $tag) { if (is_array($tag_with) === true @@ -1315,10 +1320,12 @@ try { // 'timestamp_rep', // 'timestamp_rep_min', // 'module_name', + // 'custom_id', [ 'text' => 'options', 'class' => 'action_buttons w120px', - ],[ + ], + [ 'text' => 'm', 'extra' => $checkbox_all, 'class' => 'mw120px', @@ -2004,6 +2011,9 @@ function process_datatables_item(item) { /* Module name */ item.id_agentmodule = item.module_name; + + // Module custom_id. + item.custom_id = item.module_custom_id; } /* Datatables auxiliary functions ends */