From 650b42966ff06afdc3ba885747e2a3837172eb06 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Wed, 1 Jun 2016 12:00:45 +0200 Subject: [PATCH] Now when using the wizard the value macro are added only to the simple values as expected. Ticket #3751 --- .../include/functions_visual_map.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index b704bcc8dd..18da5dd18f 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -1323,25 +1323,24 @@ function visual_map_process_wizard_add_modules ($id_modules, $image, } $id_agent = modules_get_agentmodule_agent ($id_module); - $value_label = '(_VALUE_)'; switch ($label_type) { case 'agent_module': default: $agent_label = ui_print_truncate_text(agents_get_name ($id_agent), 'agent_small', false, true, false, '…', false); $module_label = ui_print_truncate_text(modules_get_agentmodule_name($id_module), 'module_small', false, true, false, '…', false); - $label = $agent_label . " - " . $module_label . " " . $value_label; + $label = $agent_label . " - " . $module_label; break; case 'module': $module_label = ui_print_truncate_text(modules_get_agentmodule_name($id_module), 'module_small', false, true, false, '…', false); - $label = $module_label . " " . $value_label; + $label = $module_label; break; case 'agent': $agent_label = ui_print_truncate_text(agents_get_name ($id_agent), 'agent_small', false, true, false, '…', false); - $label = $agent_label . " " . $value_label; + $label = $agent_label; break; case 'none': - $label = $value_label; + $label = ''; break; } $label = io_safe_input($label); @@ -1369,6 +1368,7 @@ function visual_map_process_wizard_add_modules ($id_modules, $image, } break; case SIMPLE_VALUE: + $label = !empty($label) ? $label . ' (_VALUE_)' : '(_VALUE_)'; $value_image = ''; switch ($process_value) { case PROCESS_VALUE_NONE: @@ -1526,22 +1526,21 @@ function visual_map_process_wizard_add_agents ($id_agents, $image, } } - $value_label = '(_VALUE_)'; - switch ($label_type) { case 'agent': $agent_label = ui_print_truncate_text( agents_get_name($id_agent), 'agent_small', false, true, false, '…', false); $label = $agent_label; - if ($type === SIMPLE_VALUE) $label .= ' ' . $value_label; break; case 'none': - $label = ($type === SIMPLE_VALUE) ? $value_label : ''; + $label = ''; break; } $label = io_safe_input($label); + if ($type === SIMPLE_VALUE) $label = !empty($label) ? $label . ' (_VALUE_)' : '(_VALUE_)'; + //Restore db connection if ($id_server != 0) { metaconsole_restore_db();