2012-09-10 Juan Manuel Ramon <juanmanuel.ramon@artica.es>

* include/functions_graph.php
	 include/functions_reporting.php: Fixed custom sql metaconsole
	 reports. 



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6946 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
juanmanuelr 2012-09-10 15:12:52 +00:00
parent 84c5345e2d
commit 50ae58aabd
3 changed files with 27 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2012-09-10 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php
include/functions_reporting.php: Fixed custom sql metaconsole
reports.
2012-09-10 Juan Manuel Ramon <juanmanuel.ramon@artica.es> 2012-09-10 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_reporting.php * include/functions_reporting.php

View File

@ -1763,8 +1763,24 @@ function graph_custom_sql_graph ($id, $width, $height, $type = 'sql_graph_vbar',
$sql = io_safe_output($sql['sql']); $sql = io_safe_output($sql['sql']);
} }
if (($config['metaconsole'] == 1) && defined('METACONSOLE')) {
$metaconsole_connection = enterprise_hook('metaconsole_get_connection', array($report_content['server_name']));
if ($metaconsole_connection === false) {
return false;
}
if (enterprise_hook('metaconsole_load_external_db', array($metaconsole_connection)) != NOERR) {
//ui_print_error_message ("Error connecting to ".$server_name);
return false;
}
}
$data_result = db_get_all_rows_sql ($sql); $data_result = db_get_all_rows_sql ($sql);
if (($config['metaconsole'] == 1) && defined('METACONSOLE'))
enterprise_hook('metaconsole_restore_db');
if ($data_result === false) if ($data_result === false)
$data_result = array (); $data_result = array ();
@ -1804,7 +1820,7 @@ function graph_custom_sql_graph ($id, $width, $height, $type = 'sql_graph_vbar',
break; break;
case 'sql_graph_hbar': // horizontal bar case 'sql_graph_hbar': // horizontal bar
return hbar_graph($flash_charts, $data, $width, $height, array(), return hbar_graph($flash_charts, $data, $width, $height, array(),
array(), "", "", $homeurl, array(), "", "", true, $homeurl,
$water_mark, $water_mark,
$config['fontpath'], $config['font_size'], false, $ttl); $config['fontpath'], $config['font_size'], false, $ttl);
break; break;

View File

@ -2852,6 +2852,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
case 'sql_graph_pie': case 'sql_graph_pie':
case 'sql_graph_vbar': case 'sql_graph_vbar':
case 'sql_graph_hbar': case 'sql_graph_hbar':
if ($config['metaconsole'] == 1 && defined('METACONSOLE'))
metaconsole_restore_db();
reporting_header_content($mini, $content, $report, $table, __('User defined graph') . " (".__($content["type"]) .")", reporting_header_content($mini, $content, $report, $table, __('User defined graph') . " (".__($content["type"]) .")",
"", ""); "", "");