From 041a3af4019a8ce468ea1025fde3e8d4b5e75203 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Tue, 10 Apr 2012 16:32:40 +0000 Subject: [PATCH] 2012-04-10 Juan Manuel Ramon * godmode/groups/group_list.php godmode/reporting/graphs.php: Several fixes in custom graph editor with metaconsole activated. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5928 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++ pandora_console/godmode/groups/group_list.php | 33 ++++++++++++++++++- pandora_console/godmode/reporting/graphs.php | 4 +-- 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3dfe2f373c..b7a65f70e8 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2012-04-10 Juan Manuel Ramon + + * godmode/groups/group_list.php + godmode/reporting/graphs.php: Several fixes in custom graph editor + with metaconsole activated. + 2012-04-10 Dario Rodriguez *operation/menu.php, diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index 2088737532..b27b9507cd 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -85,8 +85,39 @@ if (is_ajax ()) { if($search != '') { $filter['string'] = $search; } + + if ($config['metaconsole'] == 1) { + enterprise_include_once('include/functions_metaconsole.php'); - $agents = agents_get_group_agents ($id_group, $filter, "none", false, $recursion); + $connection_names = enterprise_hook('metaconsole_get_connection_names'); + if ($connection_names === false) + $connection_names = array(); + + $agents_tmp = array(); + $agents = array(); + foreach ($connection_names as $connection) { + $connection_data = enterprise_hook('metaconsole_get_connection', array($connection)); + + $connection_result = enterprise_hook('metaconsole_load_external_db', array($connection_data)); + + if ($connection_result) { + $agents_tmp = agents_get_group_agents ($id_group, $filter, "none", false, $recursion); + + if ($agents_tmp === false) + $agents_tmp = array(); + + foreach ($agents_tmp as $agent_key => $agent_name) { + $agents[$connection_data['server_name'] . '|' . $agent_key] = $agent_name; + } + } + + enterprise_hook('metaconsole_restore_db'); + } + } + else { + $agents = agents_get_group_agents ($id_group, $filter, "none", false, $recursion); + } + echo json_encode ($agents); return; } diff --git a/pandora_console/godmode/reporting/graphs.php b/pandora_console/godmode/reporting/graphs.php index 760c02618f..3e10439463 100644 --- a/pandora_console/godmode/reporting/graphs.php +++ b/pandora_console/godmode/reporting/graphs.php @@ -146,14 +146,14 @@ if (! empty ($graphs)) { $table->head[1] = __('Description'); $table->head[2] = __('Number of Graphs'); $table->head[3] = __('Group'); - $table->size[2] = '125px'; + $table->size[2] = '80px'; $table->size[3] = '50px'; $table->align[2] = 'center'; $table->align[3] = 'center'; if (check_acl ($config['id_user'], 0, "AW")) { $table->align[4] = 'center'; $table->head[4] = __('Op.'); - $table->size[4] = '50px'; + $table->size[4] = '70px'; } $table->data = array ();