disabled modules search in tree view

This commit is contained in:
daniel 2018-08-28 15:24:35 +02:00
parent 5079c59b88
commit 59e405c2b3

View File

@ -55,7 +55,7 @@ class Tree {
if (is_metaconsole()) enterprise_include_once("meta/include/functions_ui_meta.php"); if (is_metaconsole()) enterprise_include_once("meta/include/functions_ui_meta.php");
$this->strictACL = false; $this->strictACL = false;
$this->acltags = tags_get_user_groups_and_tags($config['id_user'], $this->access); $this->acltags = tags_get_user_groups_and_tags($config['id_user'], $this->access);
} }
@ -163,16 +163,15 @@ class Tree {
$agents_normal_count = "($agent_table $agents_normal_count = "($agent_table
$agent_normal_filter) AS total_normal_count"; $agent_normal_filter) AS total_normal_count";
// Not init // Not init
if($this->filter['show_not_init_agents']){
if($this->filter['show_not_init_agents']){ $agent_not_init_filter = $this->getAgentStatusFilter(AGENT_STATUS_NOT_INIT);
$agent_not_init_filter = $this->getAgentStatusFilter(AGENT_STATUS_NOT_INIT); $agents_not_init_count = "($agent_table
$agents_not_init_count = "($agent_table $agent_not_init_filter) AS total_not_init_count";
$agent_not_init_filter) AS total_not_init_count"; }
} else{
else{ $agent_not_init_filter = 0;
$agent_not_init_filter = 0; $agents_not_init_count = 0;
$agents_not_init_count = 0; }
}
// Alerts fired // Alerts fired
$agents_fired_count = "($agent_table $agents_fired_count = "($agent_table
@ -237,16 +236,7 @@ class Tree {
global $config; global $config;
$columns = $this->getAgentCounterColumnsSql($agent_table); $columns = $this->getAgentCounterColumnsSql($agent_table);
$columns = "SELECT $columns FROM dual LIMIT 1";
switch ($config["dbtype"]) {
case "mysql":
case "postgresql":
$columns = "SELECT $columns FROM dual LIMIT 1";
break;
case "oracle":
$columns = "SELECT $columns FROM dual WHERE rownum <= 1";
break;
}
return $columns; return $columns;
} }
@ -510,6 +500,7 @@ class Tree {
INNER JOIN tagente_estado tae INNER JOIN tagente_estado tae
ON tae.id_agente_modulo = tam.id_agente_modulo ON tae.id_agente_modulo = tam.id_agente_modulo
WHERE tam.nombre LIKE '%%%s%%' WHERE tam.nombre LIKE '%%%s%%'
AND tam.disabled = 0
AND tam.id_agente = ta.id_agente AND tam.id_agente = ta.id_agente
%s %s
GROUP BY tam.id_agente) AS filter_counters", GROUP BY tam.id_agente) AS filter_counters",
@ -2589,7 +2580,7 @@ class Tree {
ON ta.id_agente = tam.id_agente ON ta.id_agente = tam.id_agente
INNER JOIN tagente_estado tae INNER JOIN tagente_estado tae
ON tae.id_agente_modulo = tam.id_agente_modulo"; ON tae.id_agente_modulo = tam.id_agente_modulo";
$filters['module_search_condition'] = "AND tam.nombre LIKE '%" . $this->filter['searchModule'] . "%' " . $this->getModuleStatusFilterFromTestado(); $filters['module_search_condition'] = " AND tam.disabled = 0 AND tam.nombre LIKE '%" . $this->filter['searchModule'] . "%' " . $this->getModuleStatusFilterFromTestado();
} }
$table = is_metaconsole() ? "tmetaconsole_agent" : "tagente"; $table = is_metaconsole() ? "tmetaconsole_agent" : "tagente";