Merge branch '2973-La-paginación-en-la-vista-de-módulos-de-agente-no-funciona' into 'develop'

Fixed SQL query - #2973

See merge request artica/pandorafms!1931
This commit is contained in:
vgilc 2018-11-06 12:09:15 +01:00
commit 1435b196db
1 changed files with 6 additions and 3 deletions

View File

@ -602,12 +602,13 @@ if ($list_modules) {
AND delete_pending = 0
AND disabled = 0
AND $status_filter_sql
AND $status_module_group_filter
$tags_sql
AND tagente_estado.estado != $monitor_filter
GROUP BY tagente_modulo.id_agente_modulo
";
$count_modules = db_get_all_rows_sql('SELECT COUNT(*)' . $sql_condition);
$count_modules = db_get_all_rows_sql('SELECT COUNT(DISTINCT tagente_modulo.id_agente_modulo)' . $sql_condition);
if (isset($count_modules[0]))
$count_modules = reset($count_modules[0]);
else
@ -615,7 +616,9 @@ if ($list_modules) {
//Get monitors/modules
// Get all module from agent
$sql_modules_info = 'SELECT tagente_estado.*, tagente_modulo.*, tmodule_group.*' . $sql_condition;
$sql_modules_info = "SELECT tagente_estado.*, tagente_modulo.*, tmodule_group.*
$sql_condition
GROUP BY tagente_modulo.id_agente_modulo ORDER BY $order_sql";
if ($monitors_change_filter) {
$limit = " LIMIT " . $config['block_size'] . " OFFSET 0";