From 15f4f2ec7733e45e7366d8d3d7dadb44342925a6 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Fri, 15 Feb 2019 11:28:40 +0100 Subject: [PATCH 1/2] Added missing options parameters Former-commit-id: 7232a12ea2b4609e2727051b7779aaaf96479060 --- .../reporting_builder.item_editor.php | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 38584d6b6a..08b63b2c99 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -448,8 +448,42 @@ switch ($action) { break; case 'event_report_agent': - case 'event_report_group': + $description = $item['description']; + $period = $item['period']; + $group = $item['id_group']; $recursion = $item['recursion']; + $idAgent = $item['id_agent']; + $idAgentModule = $item['id_agent_module']; + + + $show_summary_group = $style['show_summary_group']; + $filter_event_severity = json_decode($style['filter_event_severity'], true); + $filter_event_status = json_decode($style['filter_event_status'], true); + $filter_event_type = json_decode($style['filter_event_type'], true); + + $event_graph_by_user_validator = $style['event_graph_by_user_validator']; + $event_graph_by_criticity = $style['event_graph_by_criticity']; + $event_graph_validated_vs_unvalidated = $style['event_graph_validated_vs_unvalidated']; + + $filter_search = $style['event_filter_search']; + + break; + + case 'event_report_group': + $description = $item['description']; + $period = $item['period']; + $group = $item['id_group']; + $recursion = $item['recursion']; + + $event_graph_by_agent = $style['event_graph_by_agent']; + $event_graph_by_user_validator = $style['event_graph_by_user_validator']; + $event_graph_by_criticity = $style['event_graph_by_criticity']; + $event_graph_validated_vs_unvalidated = $style['event_graph_validated_vs_unvalidated']; + + $filter_search = $style['event_filter_search']; + + + break; case 'event_report_module': From c6d1bb65333beb24e6cc6cb0fd5012722d1f108f Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Thu, 6 Jun 2019 10:33:46 +0200 Subject: [PATCH 2/2] Fixed fields not saving in event reports --- .../reporting_builder.item_editor.php | 1 + .../godmode/reporting/reporting_builder.php | 27 +++++++------------ 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 48c47a340c..71151ed7fa 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -563,6 +563,7 @@ switch ($action) { $event_graph_by_user_validator = $style['event_graph_by_user_validator']; $event_graph_by_criticity = $style['event_graph_by_criticity']; $event_graph_validated_vs_unvalidated = $style['event_graph_validated_vs_unvalidated']; + $include_extended_events = $item['show_extended_events']; $filter_search = $style['event_filter_search']; diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 44e616977d..79612d703e 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -1345,6 +1345,8 @@ switch ($action) { $values['description'] = get_parameter('description'); $values['type'] = get_parameter('type', null); $values['recursion'] = get_parameter('recursion', null); + $values['show_extended_events'] = get_parameter('include_extended_events', null); + $label = get_parameter('label', ''); // Add macros name. @@ -1900,8 +1902,8 @@ switch ($action) { $style['event_graph_by_user_validator'] = $event_graph_by_user_validator; $style['event_graph_by_criticity'] = $event_graph_by_criticity; $style['event_graph_validated_vs_unvalidated'] = $event_graph_validated_vs_unvalidated; - $style['event_filter_search'] = $event_filter_search; + if ($label != '') { $style['label'] = $label; } else { @@ -2007,6 +2009,7 @@ switch ($action) { ); $name_it = (string) get_parameter('name'); $values['recursion'] = get_parameter('recursion', null); + $values['show_extended_events'] = get_parameter('include_extended_events', null); $values['name'] = reporting_label_macro( $items_label, $name_it @@ -2418,6 +2421,7 @@ switch ($action) { case 'event_report_agent': case 'event_report_group': case 'event_report_module': + $show_summary_group = get_parameter( 'show_summary_group', 0 @@ -2473,22 +2477,11 @@ switch ($action) { $style['event_graph_by_user_validator'] = $event_graph_by_user_validator; $style['event_graph_by_criticity'] = $event_graph_by_criticity; $style['event_graph_validated_vs_unvalidated'] = $event_graph_validated_vs_unvalidated; - - - switch ($values['type']) { - case 'event_report_group': - case 'event_report_agent': - $style['event_filter_search'] = $event_filter_search; - if ($label != '') { - $style['label'] = $label; - } else { - $style['label'] = ''; - } - break; - - default: - // Default. - break; + $style['event_filter_search'] = $event_filter_search; + if ($label != '') { + $style['label'] = $label; + } else { + $style['label'] = ''; } break;