2013-01-17 Juan Manuel Ramon <juanmanuel.ramon@artica.es>

* include/functions_graph.php
	 include/functions_reporting.php: Merged fixes for string graphs.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7503 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
juanmanuelr 2013-01-17 19:17:12 +00:00
parent 074f5cf271
commit 157c526c29
3 changed files with 27 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2013-01-17 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php
include/functions_reporting.php: Merged fixes for string graphs.
2013-01-17 Ramon Novoa <rnovoa@artica.es>
* operation/netflow/nf_live_view.php: Style fix.

View File

@ -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++;
}

View File

@ -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':