diff --git a/pandora_console/include/ajax/tree.ajax.php b/pandora_console/include/ajax/tree.ajax.php index 7b47fa8b42..309c314a90 100644 --- a/pandora_console/include/ajax/tree.ajax.php +++ b/pandora_console/include/ajax/tree.ajax.php @@ -214,7 +214,9 @@ if (is_ajax() === true) { $tree->setFilter($filter); ob_clean(); - echo json_encode(['success' => 1, 'tree' => $tree->getArray()]); + $tree_json = json_encode(['success' => 1, 'tree' => $tree->getArray()]); + + echo $tree_json; return; } diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index 96ced52e6f..99b4f5b039 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -126,11 +126,12 @@ class Tree public function setFilter($filter) { // There is not module filter in metaconsole. - /* - if (is_metaconsole()) { + if (is_metaconsole()) { + $filter['searchMetaconsoleModule'] = $filter['searchModule']; $filter['searchModule'] = ''; + $filter['statusMetaconsoleModule'] = $filter['statusModule']; $filter['statusModule'] = self::TV_DEFAULT_AGENT_STATUS; - }*/ + } $this->filter = $filter; } @@ -1067,11 +1068,9 @@ class Tree $module_search_filter = ''; if (!empty($this->filter['searchModule'])) { - $module_search_inner = ' - INNER JOIN tagente_estado tae - ON tae.id_agente_modulo = tam_inner.id_agente_modulo'; - $module_search_filter = "AND tam_inner.disabled = 0 - AND tam_inner.nombre LIKE '%%".$this->filter['searchModule']."%%' ".$this->getModuleStatusFilterFromTestado(); + $module_search_inner = ''; + $module_search_filter = "AND tam.disabled = 0 + AND tam.nombre LIKE '%%".$this->filter['searchModule']."%%' ".$this->getModuleStatusFilterFromTestado(); } $sql_model = "SELECT %s FROM