diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 88cfa7d012..4551e4df70 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2011-07-15 Sergio Martin + + * include/javascript/pandora.js + operation/agentes/ver_agente.php: Add hack to send to the ajax + a custom condition of modules in the agent_changed_by_multiple_agents + 2011-07-15 Juan Manuel Ramon * include/functions_gis.php: Changed name of function safe_input to diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index c40de6724a..3db0cd2ddc 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -132,6 +132,14 @@ function isEmptyObject(obj) { * @param selected Which module(s) have to be selected */ function agent_changed_by_multiple_agents (event, id_agent, selected) { + // Hack to add custom condition + if($("#hidden-custom_condition").val() != undefined) { + custom_condition = $("#hidden-custom_condition").val(); + } + else { + custom_condition = ''; + } + var idAgents = Array(); jQuery.each ($("#id_agents option:selected"), function (i, val) { @@ -155,7 +163,8 @@ function agent_changed_by_multiple_agents (event, id_agent, selected) { {"page": "operation/agentes/ver_agente", "get_agent_modules_json_for_multiple_agents": 1, "id_agent[]": idAgents, - "all": find_modules + "all": find_modules, + "custom_condition": custom_condition }, function (data) { $('#module').empty (); diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 4eb8184966..e674293dbd 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -133,6 +133,7 @@ if (is_ajax ()) { if ($get_agent_modules_json_for_multiple_agents) { $idAgents = get_parameter('id_agent'); + $custom_condition = get_parameter('custom_condition', ''); $all = (string)get_parameter('all', 'all'); switch ($all) { default: @@ -191,7 +192,8 @@ if (is_ajax ()) { $nameModules = db_get_all_rows_sql('SELECT DISTINCT(nombre) FROM tagente_modulo t1 - WHERE ' . $enabled . ' + WHERE ' . $enabled . + io_safe_output($custom_condition) . ' AND delete_pending = 0 AND id_agente IN (' . implode(',', $idAgents) . ') AND ( SELECT count(nombre)