From 7f72a089e091ea33037c51826dea90721c059be0 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Thu, 5 May 2016 18:32:34 +0200 Subject: [PATCH] More work on the visualization section of the eHorus integration --- pandora_console/operation/agentes/ehorus.php | 2 +- .../operation/agentes/ver_agente.php | 55 ++++++++++--------- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/pandora_console/operation/agentes/ehorus.php b/pandora_console/operation/agentes/ehorus.php index a0fe2c75b1..bb25f1b94c 100644 --- a/pandora_console/operation/agentes/ehorus.php +++ b/pandora_console/operation/agentes/ehorus.php @@ -39,7 +39,7 @@ if (empty($agent_id)) { return; } -$ehorus_agent_id = agents_get_agent_custom_field($agent_id, 'eHorus ID'); +$ehorus_agent_id = agents_get_agent_custom_field($agent_id, $config['ehorus_custom_field']); if (empty($ehorus_agent_id)) { ui_print_error_message(__('Missing ehorus agent id')); diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index d36b49a9aa..2a9ea2ad42 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -925,31 +925,34 @@ if (enterprise_installed() && $config['log_collector']) { } /* eHorus tab */ -if ($config['ehorus_enabled']) { - $ehorus_tab['text'] = '' - . html_print_image ('images/operation.png', true, array ( 'title' => __('eHorus'))) - . ''; - - // Hidden subtab layer - // $ehorus_tab['sub_menu'] = ''; - - $ehorus_tab['active'] = $tab == 'ehorus'; +if ($config['ehorus_enabled'] && !empty($config['ehorus_custom_field'])) { + $ehorus_agent_id = agents_get_agent_custom_field($id_agente, $config['ehorus_custom_field']); + if (!empty($ehorus_agent_id)) { + $ehorus_tab['text'] = '' + . html_print_image ('images/operation.png', true, array ( 'title' => __('eHorus'))) + . ''; + + // Hidden subtab layer + // $ehorus_tab['sub_menu'] = ''; + + $ehorus_tab['active'] = $tab == 'ehorus'; + } } $onheader = array('manage' => $managetab, @@ -975,7 +978,7 @@ if (isset($log_viewer_tab) && !empty($log_viewer_tab)) { $onheader['log_viewer'] = $log_viewer_tab; } // If the ehorus id exists -if ($config['ehorus_enabled']) { +if (isset($ehorus_tab) && !empty($ehorus_tab)) { $onheader['ehorus'] = $ehorus_tab; }