Merge branch 'ent-6340-Ventana-info-agente-tree-view-Metaconsola' into 'develop'

fix dialog tree view meta

See merge request artica/pandorafms!3653
This commit is contained in:
Daniel Rodriguez 2020-12-17 16:53:42 +01:00
commit aaaabc518f

View File

@ -529,16 +529,16 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
} }
} }
// Get the agent info // Get the agent info.
$agent = db_get_row('tagente', 'id_agente', $id_agente); $agent = db_get_row('tagente', 'id_agente', $id_agente);
if ($agent == false) { if ($agent == false) {
return; return;
} }
// Check all groups // Check all groups.
$groups = agents_get_all_groups_agent($id_agente, $agent['id_grupo']); $groups = agents_get_all_groups_agent($id_agente, $agent['id_grupo']);
if (is_metaconsole()) { if (is_metaconsole() === true) {
if (! check_acl_one_of_groups($config['id_user'], $groups, 'AR', false) if (! check_acl_one_of_groups($config['id_user'], $groups, 'AR', false)
&& ! check_acl_one_of_groups($config['id_user'], $groups, 'AW', false) && ! check_acl_one_of_groups($config['id_user'], $groups, 'AW', false)
) { ) {
@ -548,7 +548,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
} }
} }
if (is_metaconsole()) { if (is_metaconsole() === true) {
metaconsole_restore_db(); metaconsole_restore_db();
} }
@ -565,6 +565,12 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
return; return;
} }
if (is_metaconsole()) {
if (metaconsole_connect($server_data) != NOERR) {
return;
}
}
if ($agent === false) { if ($agent === false) {
ui_print_error_message(__('There was a problem loading agent')); ui_print_error_message(__('There was a problem loading agent'));
if (!empty($server_data) && is_metaconsole()) { if (!empty($server_data) && is_metaconsole()) {