diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 696a44cade..22e256acea 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2013-01-17 Juan Manuel Ramon + + * include/functions_graph.php + include/functions_reporting.php: Merged fixes for string graphs. + 2013-01-17 Ramon Novoa * operation/netflow/nf_live_view.php: Style fix. diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index b2c76ca684..c87da02ef1 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -2915,10 +2915,11 @@ function graph_netflow_aggregate_pie ($data, $aggregate, $ttl = 1, $only_image = */ function grafico_modulo_string ($agent_module_id, $period, $show_events, $width, $height , $title, $unit_name, $show_alerts, $avg_only = 0, $pure=0, - $date = 0, $only_image = false, $homeurl = '', $adapt_key) { + $date = 0, $only_image = false, $homeurl = '', $adapt_key, $ttl = 1) { global $config; global $graphic_type; - + global $max_value; + // Set variables if ($date == 0) $date = get_system_time(); @@ -3020,7 +3021,7 @@ function grafico_modulo_string ($agent_module_id, $period, $show_events, $count = 0; $total = 0; // Read data that falls in the current interval - while (isset ($data[$j]) !== null && $data[$j]['utimestamp'] >= $timestamp && $data[$j]['utimestamp'] <= ($timestamp + $interval)) { + while (isset($data[$j]) && isset ($data[$j]) !== null && $data[$j]['utimestamp'] >= $timestamp && $data[$j]['utimestamp'] <= ($timestamp + $interval)) { $count++; $j++; } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index b2086aa88b..da98ea6dc4 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2507,10 +2507,24 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f $data = array (); - $data[0] = grafico_modulo_sparse($content['id_agent_module'], $content['period'], - false, $sizgraph_w, $sizgraph_h, '', '', false, true, true, - $report["datetime"], '', 0, 0, true, true, ui_get_full_url(false) . '/'); - +$moduletype_name = modules_get_moduletype_name (modules_get_agentmodule_type ($content['id_agent_module'])); + + if (preg_match ("/string/", $moduletype_name)) { + + $urlImage = ui_get_full_url(false, false, false, false); + + $data[0] = grafico_modulo_string ($content['id_agent_module'], $content['period'], + false, $sizgraph_w, $sizgraph_h, '', '', false, 1, false, + $report["datetime"], true, $urlImage); + + } + else { + + $data[0] = grafico_modulo_sparse($content['id_agent_module'], $content['period'], + false, $sizgraph_w, $sizgraph_h, '', '', false, true, true, + $report["datetime"], '', 0, 0, true, true, ui_get_full_url(false) . '/'); + } + array_push ($table->data, $data); break; case 'projection_graph':