From 4cf2304b6746f5ee449b6c97e3491161e1f1d369 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Mon, 22 Jul 2013 14:04:06 +0000 Subject: [PATCH] 2013-07-22 Sergio Martin * include/functions_ui.php include/functions_treeview.php: Fixed bad link on agent info of the right side in treeview on metaconsole. And added access to node check to this link. For bug #2312 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8554 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 8 +++++++ .../include/functions_treeview.php | 12 ++++++++-- pandora_console/include/functions_ui.php | 22 ++++++++++++------- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index b09a090aeb..dbeca50384 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2013-07-22 Sergio Martin + + * include/functions_ui.php + include/functions_treeview.php: Fixed bad link on + agent info of the right side in treeview on metaconsole. + And added access to node check to this link. + For bug #2312 + 2013-07-22 Sergio Martin * operation/agentes/stat_win.php: Change the order of jquery diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index bee17c41ce..340020a805 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -298,12 +298,20 @@ function treeview_printTable($id_agente, $server_data = array()) { echo ''; //Agent name echo ''; + if ($agent['disabled']) { - $cellName = "" . ui_print_agent_name ($agent["id_agente"], true, 500, "text-transform: uppercase;", true) . ui_print_help_tip(__('Disabled'), true) . ""; + $cellName = ""; } else { - $cellName = ui_print_agent_name ($agent["id_agente"], true, 500, "text-transform: uppercase;", true); + $cellName = ''; } + + $cellName .= ui_print_agent_name ($agent["id_agente"], true, 500, "text-transform: uppercase;", true, $console_url, $url_hash, false, can_user_access_node ()); + + if ($agent['disabled']) { + $cellName .= ui_print_help_tip(__('Disabled'), true) . ""; + } + echo ''; //Addresses diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index d83c4b030e..789b7f5444 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -623,10 +623,11 @@ function ui_print_os_icon ($id_os, $name = true, $return = false, $apply_skin = * @param string server url to concatenate at the begin of the link * @param string extra parameters to concatenate in the link * @param string name of the agent to avoid the query in some cases + * @param bool if the agent will provided with link or not * * @return string HTML with agent name and link */ -function ui_print_agent_name ($id_agent, $return = false, $cutoff = 'agent_medium', $style = '', $cutname = false, $server_url = '', $extra_params = '', $known_agent_name = false) { +function ui_print_agent_name ($id_agent, $return = false, $cutoff = 'agent_medium', $style = '', $cutname = false, $server_url = '', $extra_params = '', $known_agent_name = false, $link = true) { if ($known_agent_name === false) { $agent_name = (string) agents_get_name ($id_agent); } @@ -639,13 +640,18 @@ function ui_print_agent_name ($id_agent, $return = false, $cutoff = 'agent_mediu $agent_name = ui_print_truncate_text($agent_name, $cutoff, true, true, true, '[…]', $style); } - $url = $server_url . 'index.php?sec=estado&'. - 'sec2=operation/agentes/ver_agente&' . - 'id_agente=' . $id_agent.$extra_params; - - $output = ''.$agent_name.''; + if ($link) { + $url = $server_url . 'index.php?sec=estado&'. + 'sec2=operation/agentes/ver_agente&' . + 'id_agente=' . $id_agent.$extra_params; + + $output = ''.$agent_name.''; + } + else { + $output = ''.$agent_name.''; + } //TODO: Add a pretty javascript (using jQuery) popup-box with agent details
'.__('Agent name').''.$cellName.'