Merge branch 'ent-4699-Revision-completa-de-informes-Wizard-en-Meta' into 'develop'
Fixed bug in meta serialize data See merge request artica/pandorafms!2773
This commit is contained in:
commit
bfe32a5aed
|
@ -124,8 +124,26 @@ function custom_graphs_get_user($id_user=0, $only_names=false, $returnAllGroup=t
|
|||
}
|
||||
|
||||
$groups = users_get_groups($id_user, $privileges, $returnAllGroup);
|
||||
$all_graphs = [];
|
||||
if (is_metaconsole()) {
|
||||
$servers = metaconsole_get_connection_names();
|
||||
foreach ($servers as $key => $server) {
|
||||
$connection = metaconsole_get_connection($server);
|
||||
if (metaconsole_connect($connection) != NOERR) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$all_graph = db_get_all_rows_in_table('tgraph', 'name');
|
||||
if ($all_graph !== false) {
|
||||
$all_graphs = array_merge($all_graphs, $all_graph);
|
||||
}
|
||||
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
} else {
|
||||
$all_graphs = db_get_all_rows_in_table('tgraph', 'name');
|
||||
}
|
||||
|
||||
if ($all_graphs === false) {
|
||||
return [];
|
||||
}
|
||||
|
|
|
@ -7503,10 +7503,12 @@ function reporting_custom_graph(
|
|||
|
||||
if ($type_report == 'custom_graph') {
|
||||
if (is_metaconsole()) {
|
||||
$id_meta = metaconsole_get_id_server($content['server_name']);
|
||||
$server = metaconsole_get_connection_by_id($id_meta);
|
||||
if (metaconsole_connect($server) != NOERR) {
|
||||
return false;
|
||||
$servers = metaconsole_get_connection_names();
|
||||
foreach ($servers as $server) {
|
||||
$connection = metaconsole_get_connection($server);
|
||||
if (metaconsole_connect($connection) != NOERR) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -251,6 +251,7 @@ function reporting_html_print_report($report, $mini=false, $report_info=1)
|
|||
reporting_html_sql($table, $item);
|
||||
break;
|
||||
|
||||
case 'simple_baseline_graph':
|
||||
case 'simple_graph':
|
||||
reporting_html_graph($table, $item);
|
||||
break;
|
||||
|
@ -316,10 +317,6 @@ function reporting_html_print_report($report, $mini=false, $report_info=1)
|
|||
reporting_html_prediction_date($table, $item, $mini);
|
||||
break;
|
||||
|
||||
case 'simple_baseline_graph':
|
||||
reporting_html_graph($table, $item);
|
||||
break;
|
||||
|
||||
case 'netflow_area':
|
||||
case 'netflow_data':
|
||||
case 'netflow_summary':
|
||||
|
@ -2208,12 +2205,15 @@ function reporting_html_database_serialized($table, $item, $pdf=0)
|
|||
{
|
||||
$table1 = new stdClass();
|
||||
$table1->width = '100%';
|
||||
$table1->head = [__('Date')];
|
||||
$table1->head = [
|
||||
__('Date'),
|
||||
__('Data'),
|
||||
];
|
||||
if (!empty($item['keys'])) {
|
||||
$table1->head = array_merge($table1->head, $item['keys']);
|
||||
}
|
||||
|
||||
$table1->style[0] = 'text-align: left';
|
||||
$table1->style[0] = 'text-align: center';
|
||||
|
||||
$table1->data = [];
|
||||
foreach ($item['data'] as $data) {
|
||||
|
|
Loading…
Reference in New Issue