Added secondary groups in event details

This commit is contained in:
Daniel Maya 2019-12-11 12:35:27 +01:00 committed by Daniel Rodriguez
parent 9a21710cd5
commit bb4fce07a1
2 changed files with 22 additions and 7 deletions

View File

@ -1304,23 +1304,17 @@ if ($get_extended_event) {
// If metaconsole switch to node to get details and custom fields.
if ($meta) {
$server = metaconsole_get_connection_by_id($server_id);
metaconsole_connect($server);
} else {
$server = '';
}
$details = events_page_details($event, $server);
if ($meta) {
metaconsole_restore_db();
}
if (events_has_extended_info($event['id_evento']) === true) {
$related = events_page_related($event, $server);
}
if ($meta) {
$server = metaconsole_get_connection_by_id($server_id);
metaconsole_connect($server);
}

View File

@ -4222,6 +4222,10 @@ function events_page_details($event, $server='')
$details = '<div id="extended_event_details_page" class="extended_event_pages">'.html_print_table($table_details, true).'</div>';
if (!empty($server) && is_metaconsole()) {
metaconsole_restore_db();
}
return $details;
}
@ -4395,6 +4399,15 @@ function events_page_general($event)
global $group_rep;
$secondary_groups = '';
if (isset($event['id_agente']) && $event['id_agente'] > 0) {
enterprise_include_once('include/functions_agents.php');
$secondary_groups_selected = enterprise_hook('agents_get_secondary_groups', [$event['id_agente'], is_metaconsole()]);
if (!empty($secondary_groups_selected)) {
$secondary_groups = implode(', ', $secondary_groups_selected['for_select']);
}
}
// General.
$table_general = new stdClass;
$table_general->cellspacing = 0;
@ -4521,6 +4534,14 @@ function events_page_general($event)
$table_general->data[] = $data;
if (!empty($secondary_groups)) {
$data = [];
$data[0] = __('Secondary groups');
$data[1] = $secondary_groups;
$table_general->data[] = $data;
}
$data = [];
$data[0] = __('Contact');
$data[1] = '';