2010-10-28 Sergio Martin <sergio.martin@artica.es>
* include/functions_custom_graphs.php godmode/reporting/graph_builder.preview.php: Fixed various bugs when you try to render a custom graph without modules for bug 3096434 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3476 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
419d35fb54
commit
86209e7fea
|
@ -1,3 +1,9 @@
|
|||
2010-10-28 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_custom_graphs.php
|
||||
godmode/reporting/graph_builder.preview.php: Fixed various bugs when
|
||||
you try to render a custom graph without modules for bug 3096434
|
||||
|
||||
2010-10-28 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_io.php
|
||||
|
|
|
@ -96,11 +96,17 @@ $weights = implode(',', $weight_array);
|
|||
$graph_width = get_db_sql ("SELECT width FROM tgraph WHERE id_graph = ".$id);
|
||||
$graph_height= get_db_sql ("SELECT height FROM tgraph WHERE id_graph = ".$id);
|
||||
|
||||
if ($config['flash_charts']) {
|
||||
echo graphic_combined_module (explode (',', $modules), explode (',', $weights), $period, $graph_width, $graph_height,
|
||||
'Combined%20Sample%20Graph', '', $events, 0, 0, $stacked);
|
||||
} else {
|
||||
echo "<img src='include/fgraph.php?tipo=combined&id=$modules&weight_l=$weights&label=Combined%20Sample%20Graph&height=$height&width=$width&stacked=$stacked&period=$period' border=1 alt=''>";
|
||||
if(!empty($modules)) {
|
||||
if ($config['flash_charts']) {
|
||||
echo graphic_combined_module (explode (',', $modules), explode (',', $weights), $period, $graph_width, $graph_height,
|
||||
'Combined%20Sample%20Graph', '', $events, 0, 0, $stacked);
|
||||
} else {
|
||||
echo "<img src='include/fgraph.php?tipo=combined&id=$modules&weight_l=$weights&label=Combined%20Sample%20Graph&height=$height&width=$width&stacked=$stacked&period=$period' border=1 alt=''>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo "<div class='nf'>".__('Empty graph')."</div>";
|
||||
}
|
||||
|
||||
echo "</td></tr></table>";
|
||||
|
||||
|
|
|
@ -89,6 +89,12 @@ function print_custom_graph ($id_graph, $height, $width, $period, $stacked, $ret
|
|||
$sources = get_db_all_rows_field_filter ('tgraph_source', 'id_graph', $id_graph);
|
||||
$modules = array ();
|
||||
$weights = array ();
|
||||
|
||||
if($sources === false) {
|
||||
echo "<div class='nf'>".__('Empty graph')."</div>";
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($sources as $source) {
|
||||
array_push ($modules, $source['id_agent_module']);
|
||||
array_push ($weights, $source['weight']);
|
||||
|
|
Loading…
Reference in New Issue