From 244c4d56d6f0b51926483094a3b17a7990373b02 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Fri, 4 Dec 2020 12:32:38 +0100 Subject: [PATCH] Fixed unit --- .../godmode/agentes/configurar_agente.php | 4 ++++ .../agentes/module_manager_editor_common.php | 22 +++++++++---------- pandora_console/include/functions_html.php | 1 - pandora_console/include/javascript/pandora.js | 6 +++-- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 422d4d0f13..81dfa9ffa6 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1404,6 +1404,10 @@ if ($update_module || $create_module) { $each_ff = (int) get_parameter('each_ff', $module['each_ff']); $ff_timeout = (int) get_parameter('ff_timeout'); $unit = (string) get_parameter('unit'); + if ($unit === '0') { + $unit = ''; + } + $id_tag = (array) get_parameter('id_tag_selected'); $serialize_ops = (string) get_parameter('serialize_ops'); $critical_instructions = (string) get_parameter('critical_instructions'); diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 64bb89a565..5fbe4343cb 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -548,17 +548,17 @@ $table_advanced->data[0][4] = html_print_input_text( $classdisabledBecauseInPolicy ); // $table_advanced->colspan[1][4] = 3; -// $table_advanced->data[0][4] = html_print_extended_select_for_unit( -// 'unit', -// $unit, -// '', -// '', -// '0', -// false, -// true, -// false, -// false -// ); +$table_advanced->data[0][4] = html_print_extended_select_for_unit( + 'unit', + $unit, + '', + 'none', + '0', + false, + true, + false, + false +); $table_advanced->colspan[0][4] = 3; $module_id_policy_module = 0; diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 3edbea17d3..fadc9c4cc7 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -1481,7 +1481,6 @@ function html_print_extended_select_for_unit( // $fields = post_process_get_custom_values(); $fields['_timeticks_'] = 'Timeticks'; - $fields['none'] = __('none'); $default_module_custom_units = get_custom_module_units(); diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index 04a8f5336e..52cf12992d 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -724,12 +724,14 @@ function post_process_select_init_unit(name, selected) { ); $("#text-" + name + "_text").val(""); } else { - $("#" + name + "_select option[value=none]").attr("selected", true); + $("#" + name + "_select option[value=0]").attr("selected", true); $("#" + name + "_default").hide(); $("#" + name + "_manual").show(); } } else { - $("#" + name + "_select option[value=none]").attr("selected", true); + $("#" + name + "_select option[value=0]").attr("selected", true); + $("#" + name + "_default").hide(); + $("#" + name + "_manual").show(); } $("#" + name + "_select").change(function() {