Fixed the MySQL error in the policies tree. Ticket #1340

This commit is contained in:
mdtrooper 2014-09-24 16:56:40 +02:00
parent 146e693285
commit 490abfecf7
2 changed files with 12 additions and 6 deletions

View File

@ -889,7 +889,7 @@ function treeview_getData ($type) {
array_push($list, array('id' => 0, 'name' => 'No policy'));
}
else {
$list = db_get_all_rows_sql("SELECT DISTINCT tpolicies.id,
$sql = "SELECT DISTINCT tpolicies.id,
tpolicies.name
FROM tpolicies, tpolicy_modules, tagente_estado,
tagente, tagente_modulo
@ -904,7 +904,12 @@ function treeview_getData ($type) {
tagente.id_grupo IN ($groups) AND
tagente.disabled = 0 AND
tagente_modulo.disabled = 0
ORDER BY tpolicies.name ' . $order_collate . ' ASC");
ORDER BY tpolicies.name " . $order_collate . " ASC";
$list = db_get_all_rows_sql($sql);
if ($list === false)
$list = array();
$element = 0;
switch ($select_status) {

View File

@ -26,14 +26,15 @@ require_once ($config['homedir'] . '/include/functions_treeview.php');
if (defined ('METACONSOLE')) {
// For each server defined:
$servers = db_get_all_rows_sql ("SELECT * FROM tmetaconsole_setup WHERE disabled = 0");
$servers = db_get_all_rows_sql ("SELECT *
FROM tmetaconsole_setup
WHERE disabled = 0");
if ($servers === false) {
$servers = array();
}
}
if (is_ajax ())
{
if (is_ajax ()) {
require_once ($config['homedir'] . '/include/functions_reporting.php');
require_once ($config['homedir'] . '/include/functions_users.php');
require_once ($config['homedir'] . '/include/functions_servers.php');
@ -453,7 +454,7 @@ if (is_ajax ())
echo " ";
}
echo "<a style='vertical-align: middle;' onfocus='JavaScript: this.blur()' href='javascript: loadModuleTable(" . $row["id_agente_modulo"] . ", \"" . $server_name . "\"". "," . $id.")'>";
echo "<a style='vertical-align: middle;' onfocus='JavaScript: this.blur()' href='javascript: loadModuleTable(" . $row["id_agente_modulo"] . ", \"" . $server_name . "\"". "," . $id.")'>";
echo ui_print_truncate_text(io_safe_output($row['nombre']), 40, true);
echo "</a>";
if ($row['quiet']) {