From 74016c928fea3a17769c18b83c5e4066853a5f4d Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Tue, 30 Oct 2018 10:20:31 +0100 Subject: [PATCH] fixed bug: failing load of post process and unit fields in plugin component in module creation --- .../agentes/module_manager_editor_common.php | 2 +- pandora_console/include/javascript/pandora.js | 43 ++++++++++++++++++- .../include/javascript/pandora_modules.js | 19 +++++++- 3 files changed, 59 insertions(+), 5 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 0527bea08d..19dcc94ffa 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -439,7 +439,7 @@ $table_advanced->data[2][1] .= html_print_input_hidden ('moduletype', $moduletyp $table_advanced->data[2][3] = __('Post process').' ' . ui_print_help_icon ('postprocess', true); $table_advanced->data[2][4] = html_print_extended_select_for_post_process('post_process', - $post_process, '', '', '0', false, true, false, true, + $post_process, '', '', '0', false, true, false, false, $disabledBecauseInPolicy); $table_advanced->colspan[2][4] = 3; diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index 2b323a55f1..1ca0759801 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -594,12 +594,51 @@ function post_process_select_init_unit(name,selected) { function post_process_select_events_unit(name,selected) { $('.' + name + '_toggler').click(function() { - $('#' + name + '_select option[value=none]').attr("selected",true); - $('#text-' + name + '_text').val(""); + var value = $('#text-' + name + '_text').val(); + + var count = $('#' + name + '_select option') + .filter(function(i, item) { + + if ($(item).val() == value) + return true; + else return false; + }) + .length; + + if (count != 1) { + $('#' + name + '_select') + .append($("