From 28f9e152e7fc48409f03f15dfc47b138d20017b8 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Tue, 9 Oct 2018 10:56:02 +0200 Subject: [PATCH] [Tags performance] Fixed tags filter and removed unwanted code --- pandora_console/include/functions_tags.php | 4 +- pandora_console/include/javascript/pandora.js | 52 ------------------- .../operation/agentes/ver_agente.php | 1 - 3 files changed, 3 insertions(+), 54 deletions(-) diff --git a/pandora_console/include/functions_tags.php b/pandora_console/include/functions_tags.php index c2dac8a378..0bdf707646 100644 --- a/pandora_console/include/functions_tags.php +++ b/pandora_console/include/functions_tags.php @@ -2146,7 +2146,9 @@ function tags_get_user_groups_and_tags ($id_user = false, $access = 'AR', $stric $return = array(); foreach ($acls as $acl) { - $return[$acl["id_grupo"]] = implode(",",$acl["tags"][get_acl_column($access)]); + $return[$acl["id_grupo"]] = isset($acl["tags"][get_acl_column($access)]) + ? implode(",",$acl["tags"][get_acl_column($access)]) + : ""; } return $return; diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index 11157ed3ff..d8ce30714e 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -65,58 +65,6 @@ Array.prototype.in_array = function () { return false; }; -/** - * Fill up select box with id "module" with modules after agent has been selected - * - * @param event that has been triggered - * @param id_agent Agent ID that has been selected - * @param selected Which module(s) have to be selected - */ -function agent_changed (event, id_agent, selected) { - if (id_agent == undefined) - id_agent = this.value; - $('#module').attr ('disabled', 1); - $('#module').empty (); - $('#module').append ($('').html ("Loading...").attr ("value", 0)); - jQuery.post ('ajax.php', - {"page": "operation/agentes/ver_agente", - "get_agent_modules_json": 1, - "id_agent": id_agent - }, - function (data) { - - $('#module').empty (); - - if (typeof($(document).data('text_for_module')) != 'undefined') { - $('#module').append ($('').html ($(document).data('text_for_module')).attr("value", 0).prop('selected', true)); - } - else { - if (typeof(data['any_text']) != 'undefined') { - $('#module').append ($('').html (data['any_text']).attr ("value", 0).prop('selected', true)); - } - else { - var anyText = $("#any_text").html(); //Trick for catch the translate text. - - if (anyText == null) { - anyText = 'Any'; - } - - $('#module').append ($('').html (anyText).attr ("value", 0).prop('selected', true)); - } - } - jQuery.each (data, function (i, val) { - s = js_html_entity_decode (val['nombre']); - $('#module').append ($('').html (s).attr ("value", val['id_agente_modulo'])); - $('#module').fadeIn ('normal'); - }); - if (selected != undefined) - $('#module').attr ('value', selected); - $('#module').removeAttr('disabled'); - }, - "json" - ); -} - /** * Util for check is empty object * diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 5b660632d7..042185b5b6 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -720,7 +720,6 @@ if (is_ajax ()) { $id_agent = array_keys( agents_get_group_agents( array_keys (users_get_groups ()), $search, "none")); - // TODO TAGS agents_get_modules $agent_modules = agents_get_modules ($id_agent, $fields, $filter, $indexed, true, false, $tags); } // Restore db connection