Now when using the wizard the value macro are added only to the simple values as expected. Ticket #3751

(cherry picked from commit 650b42966f)
This commit is contained in:
Alejandro Gallardo Escobar 2016-06-01 12:00:45 +02:00
parent 8b650c12c5
commit bce76b5505
1 changed files with 8 additions and 9 deletions

View File

@ -1323,25 +1323,24 @@ function visual_map_process_wizard_add_modules ($id_modules, $image,
} }
$id_agent = modules_get_agentmodule_agent ($id_module); $id_agent = modules_get_agentmodule_agent ($id_module);
$value_label = '(_VALUE_)';
switch ($label_type) { switch ($label_type) {
case 'agent_module': case 'agent_module':
default: default:
$agent_label = ui_print_truncate_text(agents_get_name ($id_agent), 'agent_small', false, true, false, '…', false); $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); $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; break;
case 'module': case 'module':
$module_label = ui_print_truncate_text(modules_get_agentmodule_name($id_module), 'module_small', false, true, false, '…', false); $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; break;
case 'agent': case 'agent':
$agent_label = ui_print_truncate_text(agents_get_name ($id_agent), 'agent_small', false, true, false, '…', false); $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; break;
case 'none': case 'none':
$label = $value_label; $label = '';
break; break;
} }
$label = io_safe_input($label); $label = io_safe_input($label);
@ -1369,6 +1368,7 @@ function visual_map_process_wizard_add_modules ($id_modules, $image,
} }
break; break;
case SIMPLE_VALUE: case SIMPLE_VALUE:
$label = !empty($label) ? $label . ' (_VALUE_)' : '(_VALUE_)';
$value_image = ''; $value_image = '';
switch ($process_value) { switch ($process_value) {
case PROCESS_VALUE_NONE: case PROCESS_VALUE_NONE:
@ -1526,22 +1526,21 @@ function visual_map_process_wizard_add_agents ($id_agents, $image,
} }
} }
$value_label = '(_VALUE_)';
switch ($label_type) { switch ($label_type) {
case 'agent': case 'agent':
$agent_label = ui_print_truncate_text( $agent_label = ui_print_truncate_text(
agents_get_name($id_agent), agents_get_name($id_agent),
'agent_small', false, true, false, '…', false); 'agent_small', false, true, false, '…', false);
$label = $agent_label; $label = $agent_label;
if ($type === SIMPLE_VALUE) $label .= ' ' . $value_label;
break; break;
case 'none': case 'none':
$label = ($type === SIMPLE_VALUE) ? $value_label : ''; $label = '';
break; break;
} }
$label = io_safe_input($label); $label = io_safe_input($label);
if ($type === SIMPLE_VALUE) $label = !empty($label) ? $label . ' (_VALUE_)' : '(_VALUE_)';
//Restore db connection //Restore db connection
if ($id_server != 0) { if ($id_server != 0) {
metaconsole_restore_db(); metaconsole_restore_db();