diff --git a/pandora_console/godmode/reporting/graph_builder.main.php b/pandora_console/godmode/reporting/graph_builder.main.php index 23cfc010c8..3b77ed932f 100644 --- a/pandora_console/godmode/reporting/graph_builder.main.php +++ b/pandora_console/godmode/reporting/graph_builder.main.php @@ -73,7 +73,7 @@ if (! check_acl($config['id_user'], 0, 'RW') exit; } -if ($edit_graph) { +if ($edit_graph === true) { $graphInTgraph = db_get_row_sql( 'SELECT * FROM tgraph WHERE id_graph = '.$id_graph ); @@ -113,18 +113,18 @@ if ($edit_graph) { // ----------------------- // CREATE/EDIT GRAPH FORM // ----------------------- -$url = 'index.php?sec=reporting&sec2=godmode/reporting/graph_builder'; -if ($edit_graph) { - $output = "
'; diff --git a/pandora_console/godmode/reporting/graph_builder.php b/pandora_console/godmode/reporting/graph_builder.php index c891f66cad..92d117df1b 100644 --- a/pandora_console/godmode/reporting/graph_builder.php +++ b/pandora_console/godmode/reporting/graph_builder.php @@ -109,7 +109,7 @@ if ($id_graph !== 0) { } -if ($add_graph) { +if ($add_graph === true) { $name = get_parameter_post('name'); $description = get_parameter_post('description'); $module_number = get_parameter_post('module_number'); @@ -178,7 +178,7 @@ if ($update_graph) { $stacked = $threshold; } - if (trim($name) != '') { + if (empty(trim($name)) === false) { $success = db_process_sql_update( 'tgraph', [ @@ -220,7 +220,7 @@ function add_quotes($item) } -if ($add_module) { +if ($add_module === true) { $id_graph = get_parameter('id'); $id_modules = get_parameter('module'); $id_agents = get_parameter('id_agents'); @@ -251,7 +251,7 @@ if ($add_module) { } } -if ($delete_module) { +if ($delete_module === true) { $id_graph = get_parameter('id'); $deleteGraph = get_parameter('delete'); @@ -260,7 +260,7 @@ if ($delete_module) { db_process_sql('UPDATE tgraph_source SET field_order=field_order-1 WHERE id_graph='.$id_graph.' AND field_order>'.$order_val); } -if ($change_weight) { +if ($change_weight === true) { $weight = get_parameter('weight'); $id_gs = get_parameter('graph'); db_process_sql_update( @@ -280,7 +280,7 @@ if ($change_label) { ); } -if ($edit_graph) { +if ($edit_graph === true) { $buttons = [ 'graph_list' => [ 'active' => false, @@ -334,7 +334,7 @@ if ($edit_graph) { $graphInTgraph = db_get_row_sql('SELECT name FROM tgraph WHERE id_graph = '.$id_graph); $name = $graphInTgraph['name']; } else { - $buttons = ''; + $buttons = []; } $head = __('Graph builder'); @@ -363,7 +363,7 @@ ui_print_standard_header( false, $headerHelp, false, - [$buttons], + $buttons, [ [ 'link' => '', @@ -410,12 +410,12 @@ if ($delete_module) { // Parse CHUNK information into showable information. // Split id to get all parameters. -if (!$delete_module) { - if (isset($_POST['period'])) { +if ($delete_module === false) { + if (isset($_POST['period']) === true) { $period = $_POST['period']; } - if ((isset($chunkdata) ) && ($chunkdata != '')) { + if ((isset($chunkdata) === true) && (empty($chunkdata) === false)) { $module_array = []; $weight_array = []; $agent_array = []; diff --git a/pandora_console/operation/reporting/graph_viewer.php b/pandora_console/operation/reporting/graph_viewer.php index 5e2de125e0..c35f450261 100644 --- a/pandora_console/operation/reporting/graph_viewer.php +++ b/pandora_console/operation/reporting/graph_viewer.php @@ -1,17 +1,32 @@ '', + 'label' => __('Reporting'), + ], + [ + 'link' => '', + 'label' => __('Custom graphs'), + ], + ] ); $width = null;