Kill pink unicorns

This commit is contained in:
m-lopez-f 2017-03-07 16:30:40 +01:00
parent ba423c93d8
commit e5ec0cb35a
3 changed files with 29 additions and 30 deletions

View File

@ -196,7 +196,6 @@ if ($create_agent) {
if($alias_as_name){
$sql = 'SELECT nombre FROM tagente WHERE nombre = "' . $alias . '"';
$exists_alias = db_get_row_sql($sql);
html_debug_print($exists_alias, true);
$nombre_agente = $alias;
}

View File

@ -2524,7 +2524,9 @@ function agents_get_agent_custom_field ($agent_id, $custom_field_name) {
return db_get_value_sql($sql);
}
function select_modules_for_agent_group($id_group, $id_agents, $selection, $return=true){
function select_modules_for_agent_group($id_group, $id_agents,
$selection, $return = true) {
$agents = implode(",", $id_agents);
$filter_group = "";

View File

@ -490,18 +490,15 @@ if (is_ajax ()) {
asort($result);
}
else {
if(implode(',', $idAgents) < 0){
if(implode(',', $idAgents) < 0) {
$sql = 'SELECT DISTINCT(nombre) FROM tagente_modulo
WHERE nombre IN (
SELECT nombre
FROM tagente_modulo
GROUP BY nombre
HAVING count(nombre) = (SELECT count(nombre) FROM tagente_modulo))';
WHERE nombre IN (
SELECT nombre
FROM tagente_modulo
GROUP BY nombre
HAVING count(nombre) = (SELECT count(nombre) FROM tagente_modulo))';
}
else{
else {
$sql = 'SELECT DISTINCT(nombre)
FROM tagente_modulo t1
WHERE ' . $filter . '
@ -515,7 +512,8 @@ HAVING count(nombre) = (SELECT count(nombre) FROM tagente_modulo))';
WHERE t2.delete_pending = 0
AND t1.nombre = t2.nombre
AND t2.id_agente IN (' . implode(',', $idAgents) . ')) = (' . count($idAgents) . ')';
}elseif ($selection_mode == 'unknown'){
}
elseif ($selection_mode == 'unknown') {
$sql .= 'AND t1.id_agente_modulo IN (SELECT id_agente_modulo FROM tagente_estado where estado = 3 OR estado = 4)';
}
}