Merge branch '2938-Problema-con-tags-en-el-wizard-y-la-vista-de-informes-return-dev' into 'develop'

Fixed issue with secondary group

See merge request 

Former-commit-id: a15d60276ecf0e0e782907a1036741e68aa577ef
This commit is contained in:
vgilc 2018-12-07 11:35:05 +01:00
commit b901e1db0f
1 changed files with 7 additions and 6 deletions
pandora_console/operation/agentes

View File

@ -343,7 +343,8 @@ if (is_ajax ()) {
'module_condition', 'AND', 'tagente_modulo', false, array(), true); 'module_condition', 'AND', 'tagente_modulo', false, array(), true);
$sql_tags_join = "INNER JOIN tagente ON tagente.id_agente = t1.id_agente $sql_tags_join = "INNER JOIN tagente ON tagente.id_agente = t1.id_agente
INNER JOIN ttag_module ON ttag_module.id_agente_modulo = t1.id_agente_modulo"; INNER JOIN ttag_module ON ttag_module.id_agente_modulo = t1.id_agente_modulo
LEFT JOIN tagent_secondary_group tasg ON tagente.id_agente = tasg.id_agent";
} }
if (is_metaconsole()) { if (is_metaconsole()) {
@ -478,17 +479,17 @@ if (is_ajax ()) {
ON tj.num_names = $agent_total AND tj.nombre = t1.nombre %s %s", ON tj.num_names = $agent_total AND tj.nombre = t1.nombre %s %s",
$sql_tags_join, (empty($where_tags)) ? "" : " WHERE 1=1 $where_tags"); $sql_tags_join, (empty($where_tags)) ? "" : " WHERE 1=1 $where_tags");
} else { } else {
$sql = sprintf('SELECT t1.nombre, t1.id_agente_modulo FROM tagente_modulo t1 %s %s', $sql = sprintf('SELECT t1.nombre, t1.id_agente_modulo FROM tagente_modulo t1 %s %s',
$sql_tags_join, (empty($where_tags)) ? "" : " WHERE 1=1 $where_tags"); $sql_tags_join, (empty($where_tags)) ? "" : " WHERE 1=1 $where_tags");
} }
} }
else { else {
$sql = sprintf ( $sql = sprintf (
'SELECT DISTINCT t1.nombre, t1.id_agente_modulo FROM tagente_modulo t1 'SELECT DISTINCT t1.nombre, t1.id_agente_modulo FROM tagente_modulo t1
INNER JOIN tagente_estado t2 ON t1.id_agente_modulo = t2.id_agente_modulo INNER JOIN tagente_estado t2 ON t1.id_agente_modulo = t2.id_agente_modulo
%s WHERE %s AND t1.delete_pending = 0 %s WHERE %s AND t1.delete_pending = 0
AND t1.id_agente IN ('. implode(',', $idAgents) .') AND t1.id_agente IN ('. implode(',', $idAgents) .')
%s %s', %s %s',
$sql_tags_join, $filter, ' AND t2.datos NOT LIKE "%image%"', $where_tags); $sql_tags_join, $filter, ' AND t2.datos NOT LIKE "%image%"', $where_tags);
if ($selection_mode == 'common') { if ($selection_mode == 'common') {