diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 642bd2f81a..f06bbfde74 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2012-09-10 Juan Manuel Ramon + + * include/functions_graph.php + include/functions_reporting.php: Fixed custom sql metaconsole + reports. + 2012-09-10 Juan Manuel Ramon * include/functions_reporting.php diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 20e2ef71f7..7acadc237c 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1763,7 +1763,23 @@ function graph_custom_sql_graph ($id, $width, $height, $type = 'sql_graph_vbar', $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); + + if (($config['metaconsole'] == 1) && defined('METACONSOLE')) + enterprise_hook('metaconsole_restore_db'); if ($data_result === false) $data_result = array (); @@ -1804,7 +1820,7 @@ function graph_custom_sql_graph ($id, $width, $height, $type = 'sql_graph_vbar', break; case 'sql_graph_hbar': // horizontal bar return hbar_graph($flash_charts, $data, $width, $height, array(), - array(), "", "", $homeurl, + array(), "", "", true, $homeurl, $water_mark, $config['fontpath'], $config['font_size'], false, $ttl); break; diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 16ea39b3bb..eb8160b386 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -2852,6 +2852,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f case 'sql_graph_pie': case 'sql_graph_vbar': 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"]) .")", "", "");