Merge branch 'ent-4877-Grupos-secundarios-en-eventos' into 'develop'

Added secondary groups in event details

See merge request artica/pandorafms!2915
This commit is contained in:
Daniel Rodriguez 2019-12-11 12:35:27 +01:00
commit 6bdfe87bc0
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 metaconsole switch to node to get details and custom fields.
if ($meta) { if ($meta) {
$server = metaconsole_get_connection_by_id($server_id); $server = metaconsole_get_connection_by_id($server_id);
metaconsole_connect($server);
} else { } else {
$server = ''; $server = '';
} }
$details = events_page_details($event, $server); $details = events_page_details($event, $server);
if ($meta) {
metaconsole_restore_db();
}
if (events_has_extended_info($event['id_evento']) === true) { if (events_has_extended_info($event['id_evento']) === true) {
$related = events_page_related($event, $server); $related = events_page_related($event, $server);
} }
if ($meta) { if ($meta) {
$server = metaconsole_get_connection_by_id($server_id);
metaconsole_connect($server); 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>'; $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; return $details;
} }
@ -4395,6 +4399,15 @@ function events_page_general($event)
global $group_rep; 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. // General.
$table_general = new stdClass; $table_general = new stdClass;
$table_general->cellspacing = 0; $table_general->cellspacing = 0;
@ -4521,6 +4534,14 @@ function events_page_general($event)
$table_general->data[] = $data; $table_general->data[] = $data;
if (!empty($secondary_groups)) {
$data = [];
$data[0] = __('Secondary groups');
$data[1] = $secondary_groups;
$table_general->data[] = $data;
}
$data = []; $data = [];
$data[0] = __('Contact'); $data[0] = __('Contact');
$data[1] = ''; $data[1] = '';