diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index effd7aaaf8..3ca577db83 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2012-07-27 Juan Manuel Ramon + + * include/functions_groups.php:Removed trace. + + * include/javascript/pandora.js: Added modification to ajax call + when it's called form metaconsole. + 2012-07-27 Miguel de Dios * godmode/gis_maps/index.php, godmode/groups/group_list.php, diff --git a/pandora_console/include/functions_groups.php b/pandora_console/include/functions_groups.php index 0bf2389ce0..fcb1548991 100644 --- a/pandora_console/include/functions_groups.php +++ b/pandora_console/include/functions_groups.php @@ -1273,7 +1273,7 @@ function groups_total_agents ($group_array, $disabled = false) { if (!$disabled) $sql .= " AND disabled = 0"; - html_debug_print($sql, "/tmp/pp"); + return db_get_sql ($sql); } diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index d68392e7d5..dc76ec0d8a 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -563,12 +563,18 @@ function agent_module_autocomplete (id_agent_name, id_agent_id, id_agent_module_ * @param id_agent_name id of the agent name box * @param id_server_name id of the hidden field to store the server but if you put false don't save. * @param id_agent_id id of the hidden field to store the agent id + * @param metaconsole_exec If defined then path of ajax.php call will be modified */ -function agent_autocomplete (id_agent_name, id_server_name, id_agent_id ) { +function agent_autocomplete (id_agent_name, id_server_name, id_agent_id, metaconsole_exec ) { //Check exist the field with id in the var id_agent_name. if ($(id_agent_name).length == 0) return; - + + // Correction over ajax call for metaconsole + ajax_path = ''; + if (metaconsole_exec != undefined) + ajax_path = '../../'; + $(id_agent_name).autocomplete({ minLength: 2, source: function( request, response ) { @@ -582,7 +588,7 @@ function agent_autocomplete (id_agent_name, id_server_name, id_agent_id ) { data: data_params, async: false, type: 'POST', - url: action="ajax.php", + url: action= ajax_path + "ajax.php", timeout: 10000, dataType: 'json', success: function (data) {