From e35c763b078942c8308ea053cc427cea3cd302e7 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Fri, 27 Jul 2012 10:09:04 +0000 Subject: [PATCH] 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. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6824 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 +++++++ pandora_console/include/functions_groups.php | 2 +- pandora_console/include/javascript/pandora.js | 12 +++++++++--- 3 files changed, 17 insertions(+), 4 deletions(-) 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) {