From 9a55ee7d2a45fb64705c7d4c78de5dc514f1d32b Mon Sep 17 00:00:00 2001 From: fermin831 Date: Thu, 12 Apr 2018 15:42:53 +0200 Subject: [PATCH] [SLA] Added priority mode to report style (only interface) --- .../reporting_builder.item_editor.php | 33 +++++++++++++++++++ .../godmode/reporting/reporting_builder.php | 2 ++ .../include/functions_reporting.php | 6 ++++ 3 files changed, 41 insertions(+) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 3730319347..eb49dd3eb8 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -130,6 +130,7 @@ switch ($action) { $show_in_same_row = 0; $show_in_landscape = 0; $hide_notinit_agents = 0; + $priority_mode = REPORT_PRIORITY_MODE_OK; $server_name = ''; $server_id = 0; $dyn_height = 230; @@ -272,6 +273,9 @@ switch ($action) { $time_from = $item['time_from']; $time_to = $item['time_to']; $show_graph = $item['show_graph']; + $priority_mode = isset($style['priority_mode']) + ? $style['priority_mode'] + : REPORT_PRIORITY_MODE_OK; // 'top_n' filed will be reused for SLA sort option $sla_sorted_by = $item['top_n']; $period = $item['period']; @@ -1589,6 +1593,33 @@ You can of course remove the warnings, that's why we include the source and do n + + + + '; + html_print_radio_button ( + 'priority_mode', + REPORT_PRIORITY_MODE_OK, + '', + $priority_mode == REPORT_PRIORITY_MODE_OK, + '' + ); + + echo (''); + + echo __('Priority unknown mode').''; + html_print_radio_button ( + 'priority_mode', + REPORT_PRIORITY_MODE_UNKNOWN, + '', + $priority_mode == REPORT_PRIORITY_MODE_UNKNOWN, + '' + ); + ?> + + + @@ -2801,6 +2832,7 @@ function chooseType() { $("#row_visual_format").hide(); $("#row_show_in_landscape").hide(); $('#row_hide_notinit_agents').hide(); + $('#row_priority_mode').hide(); $("#row_module_group").hide(); $("#row_servers").hide(); $("#row_sort").hide(); @@ -2963,6 +2995,7 @@ function chooseType() { $("#sla_list").show(); $("#row_working_time").show(); $("#row_sort").show(); + $("#row_priority_mode").show(); $("#row_historical_db_check").hide(); break; diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 5c16b60150..f07ee98f86 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -1212,6 +1212,7 @@ switch ($action) { $style['show_in_same_row'] = get_parameter('show_in_same_row', 0); $style['show_in_landscape'] = get_parameter('show_in_landscape', 0); $style['hide_notinit_agents'] = get_parameter('hide_notinit_agents', 0); + $style['priority_mode'] = get_parameter('priority_mode', REPORT_PRIORITY_MODE_OK); $style['dyn_height'] = get_parameter('dyn_height', 230); switch ($values['type']) { @@ -1552,6 +1553,7 @@ switch ($action) { $style['show_in_same_row'] = get_parameter('show_in_same_row', 0); $style['show_in_landscape'] = get_parameter('show_in_landscape', 0); $style['hide_notinit_agents'] = get_parameter('hide_notinit_agents', 0); + $style['priority_mode'] = get_parameter('priority_mode', REPORT_PRIORITY_MODE_OK); $style['dyn_height'] = get_parameter('dyn_height', 230); switch ($values['type']) { diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 5df97acf9d..4c8dfe2d3a 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -39,6 +39,12 @@ include_once($config['homedir'] . "/include/functions_ui.php"); include_once($config['homedir'] . "/include/functions_netflow.php"); include_once($config['homedir'] . "/include/functions_os.php"); +///////////////////////////////////////////////////////// +// CONSTANTS DEFINITIONS // +///////////////////////////////////////////////////////// +define ('REPORT_PRIORITY_MODE_OK', 1); +define ('REPORT_PRIORITY_MODE_UNKNOWN', 2); + function reporting_user_can_see_report($id_report, $id_user = null) { global $config;