From 0e768e003f6c029c700d55c20a4906adc62f7e47 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Wed, 10 Sep 2014 17:49:17 +0200 Subject: [PATCH] Improved the autocomplete input for modules * pandora_console/include/ajax/module.php: Improved the module name search. * pandora_consle/include/functons_html.php: Improved the autocomplete input for modules. --- pandora_console/include/ajax/module.php | 2 +- pandora_console/include/functions_html.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 81ef02fc34..1f5235d7d8 100644 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -48,7 +48,7 @@ if ($get_plugin_macros) { if ($search_modules) { $id_agents = json_decode(io_safe_output(get_parameter('id_agents'))); - $filter = get_parameter('q', '') . '%'; + $filter = '%' . get_parameter('q', '') . '%'; $other_filter = json_decode(io_safe_output(get_parameter('other_filter')), true); $modules = agents_get_modules($id_agents, false, diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 62a43605a1..f52f73a838 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -2007,6 +2007,12 @@ function html_print_autocomplete_modules($name = 'module', } }); }, + change: function( event, ui ) { + if (!ui.item) + $("input[name='_hidden']") + .val(0); + return false; + }, select: function( event, ui ) { $("input[name='_hidden']") .val(ui.item.value);