diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index b3ddce70f6..63b27e3303 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -250,23 +250,32 @@ else { } //Removed web analysis and log4x from select - $sql = sprintf ('SELECT id_tipo, descripcion + $sql = sprintf ( + 'SELECT id_tipo, descripcion, nombre FROM ttipo_modulo WHERE categoria IN (%s) AND id_tipo NOT IN (24, 25) ORDER BY descripcion', - implode (',', $categories)); + implode (',', $categories) + ); - $table_simple->data[2][1] = html_print_select_from_sql ($sql, 'id_module_type', - $idModuleType, '', '', '', true, false, false, $disabledBecauseInPolicy, false, false, 100); - - // Store the relation between id and name of the types on a hidden field $type_names = db_get_all_rows_sql($sql); $type_names_hash = array(); - foreach ($type_names as $tn) { - $type_names_hash[$tn['id_tipo']] = $tn['nombre']; + $type_description_hash = array(); + if (isset($type_names) && is_array($type_names)) { + foreach ($type_names as $tn) { + $type_names_hash[$tn['id_tipo']] = $tn['nombre']; + $type_description_hash[$tn['id_tipo']] = $tn['descripcion']; + } } + $table_simple->data[2][1] = html_print_select ( + $type_description_hash, 'id_module_type', $idModuleType, + $disabledBecauseInPolicy, '', 0, true, + false, true, '', false, false, false, 100 + ); + + // Store the relation between id and name of the types on a hidden field $table_simple->data[2][1] .= html_print_input_hidden('type_names',base64_encode(io_json_mb_encode($type_names_hash)),true); } diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index d19dc7f513..06257a5457 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -735,8 +735,11 @@ function html_print_extended_select_for_post_process($name, $selected = '', $selected_float = (float)$selected; $found = false; - if (array_key_exists(number_format($selected, 14, '.', ','), $fields)) - $found = true; + if($selected){ + if (array_key_exists(number_format($selected, 14, '.', ','), $fields)) { + $found = true; + } + } if (!$found) { $fields[$selected] = floatval($selected);