#12684 Fix tree view filter

This commit is contained in:
miguel angel rasteu 2023-12-26 13:22:24 +01:00
parent f901a52c05
commit d6363d37b7
2 changed files with 10 additions and 7 deletions

View File

@ -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;
}

View File

@ -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;
}
@ -1064,9 +1065,9 @@ class Tree
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();
ON tae.id_agente_modulo = tam.id_agente_modulo';
$module_search_filter = "AND tam.disabled = 0
AND tam.nombre LIKE '%%".$this->filter['searchModule']."%%' ".$this->getModuleStatusFilterFromTestado();
}
$sql_model = "SELECT %s FROM