diff --git a/pandora_console/godmode/reporting/graph_builder.graph_editor.php b/pandora_console/godmode/reporting/graph_builder.graph_editor.php index 33cacc9bab..d69729eac9 100644 --- a/pandora_console/godmode/reporting/graph_builder.graph_editor.php +++ b/pandora_console/godmode/reporting/graph_builder.graph_editor.php @@ -59,52 +59,36 @@ switch ($action) { $resultOperationDB = false; } else if (!empty($ids_serialize)) { $ids = explode('|', $ids_serialize); - - switch ($config['dbtype']) { - case 'mysql': - $items = db_get_all_rows_sql( - ' - SELECT id_gs, `field_order` - FROM tgraph_source - WHERE id_graph = '.$id_graph.' - ORDER BY `field_order`' - ); - break; - } + $items = db_get_all_rows_sql( + 'SELECT id_gs, `field_order` + FROM tgraph_source + WHERE id_graph = '.$id_graph.' + ORDER BY `field_order`' + ); if ($items === false) { $items = []; } - // Clean the repeated order values + // Clean the repeated order values. $order_temp = 1; foreach ($items as $item) { - switch ($config['dbtype']) { - case 'mysql': - db_process_sql_update( - 'tgraph_source', - ['`field_order`' => $order_temp], - ['id_gs' => $item['id_rc']] - ); - break; - } + db_process_sql_update( + 'tgraph_source', + ['`field_order`' => $order_temp], + ['id_gs' => $item['id_rc']] + ); $order_temp++; } - - switch ($config['dbtype']) { - case 'mysql': - $items = db_get_all_rows_sql( - ' - SELECT id_gs, `field_order` - FROM tgraph_source - WHERE id_graph = '.$id_graph.' - ORDER BY `field_order`' - ); - break; - } + $items = db_get_all_rows_sql( + 'SELECT id_gs, `field_order` + FROM tgraph_source + WHERE id_graph = '.$id_graph.' + ORDER BY `field_order`' + ); if ($items === false) { $items = []; @@ -116,7 +100,7 @@ switch ($action) { $temp = []; foreach ($items as $item) { - // Remove the contents from the block to sort + // Remove the contents from the block to sort. if (array_search($item['id_gs'], $ids) === false) { $temp[$item['field_order']] = $item['id_gs']; } @@ -150,16 +134,11 @@ switch ($action) { foreach ($items as $order => $id) { - switch ($config['dbtype']) { - case 'mysql': - - db_process_sql_update( - 'tgraph_source', - ['`field_order`' => ($order + 1)], - ['id_gs' => $id] - ); - break; - } + db_process_sql_update( + 'tgraph_source', + ['`field_order`' => ($order + 1)], + ['id_gs' => $id] + ); } $resultOperationDB = true; @@ -211,7 +190,7 @@ if ($editGraph) { $weights = implode(',', $weight_array); } -// Modules table +// Modules table. if (count($module_array) > 0) { echo "
'.__('Sort').' | '; $color = 0; for ($a = 0; $a < count($module_array); $a++) { - // Calculate table line color + // Calculate table line color. if ($color == 1) { $tdcolor = 'datos'; $color = 0; @@ -332,7 +311,7 @@ echo ''; echo '|||
---|---|---|---|
".__('Agents').' | '; +echo "".__('Agents').ui_print_help_tip(__('If you select several agents, only the common modules will be displayed'), true).' | '; echo ''; echo " | ".__('Modules').' | '; echo '