diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index 05c994df9e..778a56afbc 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -41,6 +41,8 @@ class Tree { protected $L2conditionInside = ''; protected $L2inner = ''; + protected $L3forceTagCondition = false; + const TV_DEFAULT_AGENT_STATUS = -1; public function __construct($type, $rootType = '', $id = -1, $rootID = -1, $serverID = false, $childrenMethod = "on_demand", $access = 'AR') { @@ -891,7 +893,9 @@ class Tree { $module_status_filter = $this->getModuleStatusFilterFromTestado(); $agent_filter = "AND ta.id_agente = " . $this->id; $tag_condition = $this->getTagCondition(); - $tag_join = empty($tag_condition) ? '' : $this->getTagJoin(); + $tag_join = empty($tag_condition) && (!$this->L3forceTagCondition) + ? '' + : $this->getTagJoin(); $condition = $this->L2condition; $inner = $this->L2inner; @@ -922,6 +926,8 @@ class Tree { $module_search_filter $tag_condition ORDER BY tam.nombre ASC, tam.id_agente_modulo ASC"; + html_debug($sql, true); + html_debug($sql, true, true); return $sql; } diff --git a/pandora_console/include/class/TreeTag.class.php b/pandora_console/include/class/TreeTag.class.php index c02fb7ba4a..374945005c 100644 --- a/pandora_console/include/class/TreeTag.class.php +++ b/pandora_console/include/class/TreeTag.class.php @@ -37,6 +37,8 @@ class TreeTag extends Tree { $this->L2condition = "AND ttm.id_tag = " . $this->rootID; $this->L2inner = $this->L1innerInside; + + $this->L3forceTagCondition = true; } protected function getData() { @@ -52,10 +54,6 @@ class TreeTag extends Tree { protected function getTagJoin () { return ''; } - - protected function getTagCondition () { - return ''; - } } ?>