2013-01-14 Dario Rodriguez <dario.rodriguez@artica.es>

* include/functions_treeview.php: Now agents appear
        ordered by name.

        PORTER FROM 4.0.3



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7466 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
darode 2013-01-14 16:23:54 +00:00
parent 4c6e58922a
commit 812474e436
2 changed files with 23 additions and 9 deletions

View File

@ -1,3 +1,10 @@
2013-01-14 Dario Rodriguez <dario.rodriguez@artica.es>
* include/functions_treeview.php: Now agents appear
ordered by name.
PORTER FROM 4.0.3
2013-01-14 Sergio Martin <sergio.martin@artica.es>
* godmode/alerts/alert_list.list.php

View File

@ -843,34 +843,31 @@ function treeview_getFirstBranchSQL ($type, $id, $avariableGroupsIds, $statusSel
}
}
$sql = agents_get_agents(array (
'order' => 'nombre COLLATE utf8_general_ci ASC',
$sql = agents_get_agents(array (
'id_grupo' => $id,
'disabled' => 0,
'status' => $statusSel,
'search' => $search_sql),
array ('*'),
'AR',
false,
array('field' => 'nombre COLLATE utf8_general_ci', 'order' => ' ASC'),
true);
break;
case 'os':
$sql = agents_get_agents(array (
'order' => 'nombre COLLATE utf8_general_ci ASC',
'id_os' => $id,
'disabled' => 0,
'status' => $statusSel,
'search' => $search_sql),
array ('*'),
'AR',
false,
array('field' => 'nombre COLLATE utf8_general_ci', 'order' => ' ASC'),
true);
break;
case 'module_group':
$sql = agents_get_agents(array (
'order' => 'nombre COLLATE utf8_general_ci ASC',
'disabled' => 0,
'status' => $statusSel,
'search' => $search_sql),
@ -884,11 +881,13 @@ function treeview_getFirstBranchSQL ($type, $id, $avariableGroupsIds, $statusSel
(SELECT DISTINCT (id_agente)
FROM tagente_modulo
WHERE id_module_group = ' . $id . ')';
$sql .= 'ORDER BY nombre COLLATE utf8_general_ci ASC';
break;
case 'policies':
$sql = agents_get_agents(array (
'order' => 'nombre COLLATE utf8_general_ci ASC',
'disabled' => 0,
'search' => $search_sql),
@ -921,6 +920,9 @@ function treeview_getFirstBranchSQL ($type, $id, $avariableGroupsIds, $statusSel
AND tagente.id_agente NOT IN (SELECT tagente_estado.id_agente
FROM tagente_estado)";
}
$sql .= 'ORDER BY nombre COLLATE utf8_general_ci ASC';
break;
case 'module':
//Replace separator token "articapandora_32_pandoraartica_" for " "
@ -932,7 +934,6 @@ function treeview_getFirstBranchSQL ($type, $id, $avariableGroupsIds, $statusSel
$name = io_safe_input(io_safe_output($name));
$sql = agents_get_agents(array (
'order' => 'nombre COLLATE utf8_general_ci ASC',
'disabled' => 0,
'status' => $statusSel,
'search' => $search_sql),
@ -948,6 +949,8 @@ function treeview_getFirstBranchSQL ($type, $id, $avariableGroupsIds, $statusSel
)
', $name);
$sql .= 'ORDER BY nombre COLLATE utf8_general_ci ASC';
break;
case 'tag':
if (defined ('METACONSOLE')) {
@ -974,6 +977,11 @@ function treeview_getFirstBranchSQL ($type, $id, $avariableGroupsIds, $statusSel
AND tagente_modulo.id_agente_modulo = ttag_module.id_agente_modulo
AND ttag_module.id_tag = " . $id . $groups_condition;
$sql .= tags_get_acl_tags($config['id_user'], 0, 'AR', 'module_condition', 'AND', 'tagente_modulo');
$sql .= ' AND tagente.disabled = 0'. $search_sql;
$sql .= ' ORDER BY tagente.nombre COLLATE utf8_general_ci ASC';
break;
}
@ -981,7 +989,6 @@ function treeview_getFirstBranchSQL ($type, $id, $avariableGroupsIds, $statusSel
return false;
}
$sql .= ' AND tagente.disabled = 0'. $search_sql;
return $sql;
}