diff --git a/pandora_console/godmode/admin_access_logs.php b/pandora_console/godmode/admin_access_logs.php index 96ce639fe9..10b4da04aa 100644 --- a/pandora_console/godmode/admin_access_logs.php +++ b/pandora_console/godmode/admin_access_logs.php @@ -17,10 +17,6 @@ global $config; -if ($config['flash_charts']) { - require_once ("include/fgraph.php"); -} - require_once ($config["homedir"] . '/include/functions_graph.php'); check_login (); @@ -79,13 +75,7 @@ echo ''; echo '
'; echo graphic_user_activity2(300, 140); -/* -if ($config['flash_charts']) { - echo graphic_user_activity (300, 140); -} -else { - echo ''; -}*/ + echo '
'; echo '
 
'; echo ''; diff --git a/pandora_console/include/functions_custom_graphs.php b/pandora_console/include/functions_custom_graphs.php index 0e36421496..7f4110def4 100644 --- a/pandora_console/include/functions_custom_graphs.php +++ b/pandora_console/include/functions_custom_graphs.php @@ -24,9 +24,6 @@ * @global array Contents all var configs for the local instalation. */ global $config; -if ($config['flash_charts']) { - require_once ('include/fgraph.php'); -} require_once ($config["homedir"] . '/include/functions_graph.php'); @@ -111,17 +108,6 @@ function custom_graphs_print ($id_graph, $height, $width, $period, $stacked, $re $output = graphic_combined_module2($modules, $weights, $period, $width, $height, '', '', 0, 0, 0, $stacked, $date); - - /* - if ($config['flash_charts']) { - $output = graphic_combined_module ($modules, $weights, $period, $width, $height, - '', '', 0, 0, 0, $stacked, $date); - } else { - $modules = implode (',', $modules); - $weights = implode (',', $weights); - $output = ''; - } - */ if ($return) return $output; diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 177db560f2..18b8e7f1b6 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -25,7 +25,8 @@ define("GRAPH_STACKED_LINE", 3); function grafico_modulo_sparse2 ($agent_module_id, $period, $show_events, $width, $height , $title = '', $unit_name = null, $show_alerts = false, $avg_only = 0, $pure = false, - $date = 0, $baseline = 0, $return_data = 0, $show_title = true, $only_image = false) { + $date = 0, $baseline = 0, $return_data = 0, $show_title = true, + $only_image = false, $homeurl = '') { global $config; global $graphic_type; @@ -295,7 +296,8 @@ function grafico_modulo_sparse2 ($agent_module_id, $period, $show_events, $flash_chart = false; } - return area_graph($flash_chart, $chart, $width, $height, $color,$legend, $long_index, "images/image_problem.opaque.png"); + return area_graph($flash_chart, $chart, $width, $height, $color,$legend, + $long_index, "images/image_problem.opaque.png", "", "", $homeurl); } /** @@ -316,7 +318,8 @@ function grafico_modulo_sparse2 ($agent_module_id, $period, $show_events, * @return Mixed */ function graphic_combined_module2 ($module_list, $weight_list, $period, $width, $height, - $title, $unit_name, $show_events = 0, $show_alerts = 0, $pure = 0, $stacked = 0, $date = 0, $only_image = false) { + $title, $unit_name, $show_events = 0, $show_alerts = 0, $pure = 0, + $stacked = 0, $date = 0, $only_image = false, $homeurl = '') { global $config; global $graphic_type; @@ -621,7 +624,8 @@ function graphic_combined_module2 ($module_list, $weight_list, $period, $width, case GRAPH_AREA: $color = null; return area_graph($flash_charts, $graph_values, $width, $height, - $color, $module_name_list, $long_index, "images/image_problem.opaque.png"); + $color, $module_name_list, $long_index, "images/image_problem.opaque.png", + "", "", $homeurl); break; default: case GRAPH_STACKED_AREA: @@ -1232,7 +1236,7 @@ function grafico_eventos_usuario2 ($width, $height) { * @param integer width graph width * @param integer Graph type 1 vbar, 2 hbar, 3 pie */ -function graph_custom_sql_graph2 ($id, $width, $height, $type = 'sql_graph_vbar', $only_image = false, $homedir) { +function graph_custom_sql_graph2 ($id, $width, $height, $type = 'sql_graph_vbar', $only_image = false, $homeurl = '') { global $config; $report_content = get_db_row ('treport_content', 'id_rc', $id); @@ -1275,13 +1279,13 @@ function graph_custom_sql_graph2 ($id, $width, $height, $type = 'sql_graph_vbar' switch ($type) { case 'sql_graph_vbar': // vertical bar - return hbar_graph($flash_charts, $data, $width, $height, array(), array(), "", "", false, $homedir); + return hbar_graph($flash_charts, $data, $width, $height, array(), array(), "", "", false, $homeurl); break; case 'sql_graph_hbar': // horizontal bar - return vbar_graph($flash_charts, $data, $width, $height, array(), array(), "", "", $homedir); + return vbar_graph($flash_charts, $data, $width, $height, array(), array(), "", "", $homeurl); break; case 'sql_graph_pie': // Pie - return pie3d_graph($flash_charts, $data, $width, $height, __("other"), $homedir); + return pie3d_graph($flash_charts, $data, $width, $height, __("other"), $homeurl); break; } } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 3c80d673f9..9c1cb59052 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -1883,7 +1883,7 @@ function render_report_html_item ($content, $table, $report, $mini = false) { else { $agent_name = get_agent_name($content['id_agent']); } - + switch ($content["type"]) { case 1: case 'simple_graph': @@ -1905,7 +1905,7 @@ function render_report_html_item ($content, $table, $report, $mini = false) { $data = array (); - $data[0] = grafico_modulo_sparse2($layout_data['id_agente_modulo'], $content['period'], + $data[0] = grafico_modulo_sparse2($content['id_agent_module'], $content['period'], false, $sizgraph_w, $sizgraph_h, '', '', false, true, true, $report["datetime"], 0, 0, true, true); @@ -1973,7 +1973,7 @@ function render_report_html_item ($content, $table, $report, $mini = false) { $table->colspan[1][0] = 3; $data = array (); - //$data[0] = ''; + require_once ($config["homedir"] . '/include/functions_graph.php'); $data[0] = graphic_combined_module2( $modules, @@ -2106,14 +2106,8 @@ function render_report_html_item ($content, $table, $report, $mini = false) { $data = array(); $data_pie_graph = json_encode ($data_graph); if (($show_graph == 1 || $show_graph == 2) && !empty($slas)) { - if($config['flash_charts']) { - $data[0] = fs_3d_pie_chart ($data_graph, 370, 180); - } - else { - //Display pie graph - $data[0] = ""; - } + $data[0] = pie3d_graph($config['flash_charts'], $data_graph, + 500, 150, __("other")); array_push ($table->data, $data); //Display horizontal bar graphs @@ -2130,10 +2124,12 @@ function render_report_html_item ($content, $table, $report, $mini = false) { $data[0] = printSmallFont(get_agentmodule_agent_name ($sla['id_agent_module'])); $data[0] .= "
"; $data[0] .= printSmallFont(get_agentmodule_name ($sla['id_agent_module'])); + $data[1] = ""; + array_push ($table2->data, $data); } $table->colspan[4][0] = 3; @@ -3064,21 +3060,15 @@ function render_report_html_item ($content, $table, $report, $mini = false) { $table->colspan[3][0] = 3; $data = array(); if ($show_graph == 1 || $show_graph == 2) { - if($config['flash_charts']) { - $data[0] = fs_3d_pie_chart ($data_pie_graph, 370, 180); - } - else { - $data_graph = json_encode ($data_pie_graph); - //Display pie graph - $data[0] = ""; - } + $data[0] = pie3d_graph($config['flash_charts'], $data_pie_graph, + 600, 150, __("other")); + array_push ($table->data, $data); //Display bars graph $table->colspan[4][0] = 3; $height = count($data_pie_graph)*20+35; $data = array(); - $data[0] = ""; array_push ($table->data, $data); } @@ -3318,15 +3308,8 @@ function render_report_html_item ($content, $table, $report, $mini = false) { $table->colspan[3][0] = 3; $data = array(); if ($show_graph == 1 || $show_graph == 2) { - if($config['flash_charts']) { - $data[0] = fs_3d_pie_chart ($data_pie_graph, 370, 180); - } - else { - $data_graph = json_encode ($data_pie_graph); - //Display pie graph - $data[0] = ""; - } + $data[0] = pie3d_graph($config['flash_charts'], $data_graph, + 600, 150, __("other")); array_push ($table->data, $data); //Display bars graph $table->colspan[4][0] = 3; diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index 07dad1b0f0..8535188060 100755 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -10,6 +10,7 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. + // If is called from index if(file_exists('include/functions.php')) { include_once('include/functions.php'); @@ -135,7 +136,8 @@ function threshold_graph($flash_chart, $chart_data, $width, $height) { } } -function area_graph($flash_chart, $chart_data, $width, $height, $color, $legend, $long_index, $no_data_image, $xaxisname = "", $yaxisname = "") { +function area_graph($flash_chart, $chart_data, $width, $height, $color, $legend, + $long_index, $no_data_image, $xaxisname = "", $yaxisname = "", $homedir="") { if (empty($chart_data)) { return ''; } @@ -155,7 +157,7 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color, $legend, $id_graph = serialize_in_temp($graph); - return ""; + return ""; } } diff --git a/pandora_console/include/graphs/functions_pchart.php b/pandora_console/include/graphs/functions_pchart.php index 509b645a99..2e0428b3a9 100755 --- a/pandora_console/include/graphs/functions_pchart.php +++ b/pandora_console/include/graphs/functions_pchart.php @@ -60,15 +60,17 @@ if (!isset($graph)) { $data = $graph['data']; $width = $graph['width']; $height = $graph['height']; -if (isset($graph['color'])) { +$colors = null; +if (isset($graph['color'])) $colors = $graph['color']; -} -if (isset($graph['legend'])) { +$legend = null; +if (isset($graph['legend'])) $legend = $graph['legend']; -} +$xaxisname = ''; if(isset($graph['xaxisname'])) { $xaxisname = $graph['xaxisname']; } +$yaxisname = ''; if(isset($graph['yaxisname'])) { $yaxisname = $graph['yaxisname']; } @@ -745,4 +747,4 @@ function pch_threshold_graph ($graph_type, $index, $data, $width, $height, $font /* Render the picture */ $myPicture->stroke(); } -?> +?> \ No newline at end of file diff --git a/pandora_console/operation/reporting/reporting_xml.php b/pandora_console/operation/reporting/reporting_xml.php index a54ddc1496..00090965b8 100644 --- a/pandora_console/operation/reporting/reporting_xml.php +++ b/pandora_console/operation/reporting/reporting_xml.php @@ -334,27 +334,6 @@ foreach ($contents as $content) { $data["objdata"] = format_numeric ($data["objdata"]); } break; -// case 11: -// case 'general_group_report': -// $data["title"] = __('Group'); -// $data["objdata"] = ""; -// break; -// case 12: -// case 'monitor_health': -// $data["title"] = __('Monitor health'); -// $data["objdata"] = ""; -// break; -// case 13: -// case 'agents_detailed': -// $data["title"] = __('Agents detailed view'); -// $data["objdata"] = ""; -// break; case 'agent_detailed_event': case 'event_report_agent': $data["title"] = __('Agent detailed event');