From f67a4d90ae125b06d7ecc6df8ed4a0729b287391 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Mon, 25 Sep 2017 14:51:45 +0200 Subject: [PATCH] Dynamic unit in massive edit modules --- .../godmode/massive/massive_edit_modules.php | 11 +++++++++-- pandora_console/include/functions_html.php | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index dfafbb7559..e510ba5aad 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -565,7 +565,7 @@ foreach ($targets2 as $t) { $table->data['edit6'][1] = html_print_select ($targets, 'id_export', '','', __('No change'), '', true, false, false); $table->data['edit6'][2] = __('Unit'); -$table->data['edit6'][3] = html_print_input_text ('unit', '', '', 15, 60, true); +$table->data['edit6'][3] = html_print_extended_select_for_unit('unit','', '', '', '0', '15', true, false, false); /* FF stands for Flip-flop */ @@ -1127,7 +1127,7 @@ function process_manage_edit ($module_name, $agents_select = null, $module_statu /* List of fields which can be updated */ $fields = array ('dynamic_interval', 'dynamic_max', 'dynamic_min', 'dynamic_two_tailed', 'min_warning', 'max_warning', 'str_warning', 'min_critical', 'max_critical', 'str_critical', 'min_ff_event', - 'module_interval', 'disabled', 'post_process', 'unit', + 'module_interval', 'disabled', 'post_process', 'unit_select', 'snmp_community', 'tcp_send', 'custom_string_1', 'plugin_parameter', 'custom_string_2', 'custom_string_3', 'min', 'max', 'id_module_group', 'plugin_user', 'plugin_pass', @@ -1159,6 +1159,13 @@ function process_manage_edit ($module_name, $agents_select = null, $module_statu $values['post_process'] = $value; } break; + case 'unit_select': + if($value == "none"){ + $values['unit'] = (string) get_parameter('unit_text'); + } else { + $values['unit'] = $value; + } + break; default: if ($value != '') { $values[$field] = $value; diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 7a3f911c0d..f1b8a5b161 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -630,7 +630,7 @@ function html_print_extended_select_for_unit($name, $selected = '', // $fields = post_process_get_custom_values(); - $fields['_timeticks_'] = 'timeticks'; + $fields['_timeticks_'] = 'Timeticks'; $fields['none'] = __('none'); if($no_change != 0){ @@ -653,7 +653,7 @@ function html_print_extended_select_for_unit($name, $selected = '', else { $uniq_name = $name; } - html_debug($selected); + ob_start(); echo '
';