From ce8f293f4b4ed383c55855b65f92d4035eb74f8c Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Fri, 4 Nov 2011 12:03:13 +0000 Subject: [PATCH] 2011-11-04 Juan Manuel Ramon * include/functions_graph.php include/graphs/fgraph.php include/functions_reporting.php operation/agentes/ver_agente.php: Modules in 'top_n' reports are sorted and graphs are displayed. Fixes: #3422013 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5113 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 10 ++++++++++ pandora_console/include/functions_graph.php | 4 ++++ pandora_console/include/functions_reporting.php | 16 ++++++++-------- pandora_console/include/graphs/fgraph.php | 10 ++++++++-- pandora_console/operation/agentes/ver_agente.php | 3 ++- 5 files changed, 32 insertions(+), 11 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 1b609beaea..5b8e8e655c 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2011-11-04 Juan Manuel Ramon + + * include/functions_graph.php + include/graphs/fgraph.php + include/functions_reporting.php + operation/agentes/ver_agente.php: Modules in 'top_n' reports are + sorted and graphs are displayed. + + Fixes: #3422013 + 2011-11-03 Sancho Lerena * include/functions_html.php: Skip config.php loading after load diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index aa09c2680c..5c3d6b17c0 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1514,6 +1514,10 @@ function graph_custom_sql_graph ($id, $width, $height, $type = 'sql_graph_vbar', } $flash_charts = $config['flash_charts']; + + if ($flash_charts){ + include_flash_chart_script(); + } if ($only_image) { $flash_charts = false; diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index b7b64dfd34..7b60d87efc 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -3438,7 +3438,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f $data_pie_graph = array(); $data_hbar = array(); foreach ($data_top as $dt) { - $data_hbar[$agent_name[$i]]['g'] = $dt; + $data_hbar[$agent_name[$i]]['g'] = $dt; $data_pie_graph[$agent_name[$i]] = $dt; if ($show_graph == 0 || $show_graph == 1) { $data = array(); @@ -3449,12 +3449,12 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f } $i++; if ($i >= $top_n_value) break; - } + } } else if ($order_uptodown == 0 || $order_uptodown == 3) { $i = 0; $data_pie_graph = array(); - $data_hbar = array(); + $data_hbar = array(); foreach ($agent_name as $an) { $data_pie_graph[$an] = $data_top[$i]; $data_hbar[$an]['g'] = $data_top[$i]; @@ -3479,7 +3479,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f $table->colspan[3][0] = 3; $data = array(); - if ($show_graph == 1 || $show_graph == 2) { + if ($show_graph == 1 || $show_graph == 2) { $data[0] = pie3d_graph($config['flash_charts'], $data_pie_graph, 600, 150, __("other"),"", $config['homedir'] . "/images/logo_vertical_water.png", $config['fontpath'], $config['font_size']); @@ -3489,11 +3489,11 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f $table->colspan[4][0] = 3; $height = count($data_pie_graph)*20+35; $data = array(); - $data[0] = hbar_graph($config['flash_charts'], $data_hbar, 600, $height); - + $data[0] = hbar_graph($config['flash_charts'], $data_hbar, 600, $height, array(), array(), "", "", true, "", $config['homedir'] . "/images/logo_vertical_water.png", '', '', true, 1, true); + array_push ($table->data, $data); } - + if ($content['show_resume'] && count($data_top_values) > 0) { //Get the very first not null value $i=0; @@ -3772,7 +3772,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f $height = count($data_pie_graph)*20+35; $data = array(); - $data[0] = hbar_graph($config['flash_charts'], $data_hbar, 600, $height); + $data[0] = hbar_graph($config['flash_charts'], $data_hbar, 600, $height, array(), array(), "", "", true, "", $config['homedir'] . "/images/logo_vertical_water.png", '', '', true, 1, true); array_push ($table->data, $data); } diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index 1669f7d9a7..5d6aaed252 100755 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -341,9 +341,15 @@ function polar_graph($flash_chart, $chart_data, $width, $height, $no_data_image, function hbar_graph($flash_chart, $chart_data, $width, $height, $color = array(), $legend = array(), $xaxisname = "", $yaxisname = "", $force_height = true, - $homedir="", $water_mark = '', $font = '', $font_size = '', $force_steps = true, $ttl = 1) { + $homedir="", $water_mark = '', $font = '', $font_size = '', $force_steps = true, $ttl = 1, $return = false) { if($flash_chart) { - echo fs_2d_hcolumn_chart ($chart_data, $width, $height); + include_flash_chart_script(); + if ($return){ + return fs_2d_hcolumn_chart ($chart_data, $width, $height); + } + else{ + echo fs_2d_hcolumn_chart ($chart_data, $width, $height); + } } else { $graph = array(); diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 3693c99537..84da058a94 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -204,7 +204,8 @@ if (is_ajax ()) { SELECT count(nombre) FROM tagente_modulo t2 WHERE delete_pending = 0 AND t1.nombre = t2.nombre - AND id_agente IN (' . implode(',', $idAgents) . ')) = (' . count($idAgents) . ')'); + AND id_agente IN (' . implode(',', $idAgents) . ')) = (' . count($idAgents) . ') + ORDER BY nombre'); if ($nameModules == false) { $nameModules = array();