From a300ca578624904b80808b38e7cdcbd84173d6fd Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 14 Oct 2021 11:33:06 +0200 Subject: [PATCH] #8098 Fixed pagination --- pandora_console/extensions/agents_alerts.php | 2 +- pandora_console/include/class/AgentsAlerts.class.php | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pandora_console/extensions/agents_alerts.php b/pandora_console/extensions/agents_alerts.php index 58ec82c259..d7101d7e9e 100755 --- a/pandora_console/extensions/agents_alerts.php +++ b/pandora_console/extensions/agents_alerts.php @@ -31,7 +31,7 @@ global $config; // Require needed class. require_once $config['homedir'].'/include/class/AgentsAlerts.class.php'; // Get the parameter. -$sec2 = get_parameter_get('sec2'); +$sec2 = get_parameter_get('sec2'); // Add operation menu option. extensions_add_operation_menu_option( __('Agents/Alerts view'), diff --git a/pandora_console/include/class/AgentsAlerts.class.php b/pandora_console/include/class/AgentsAlerts.class.php index 5e0861ed6c..0b8b8ab3f6 100644 --- a/pandora_console/include/class/AgentsAlerts.class.php +++ b/pandora_console/include/class/AgentsAlerts.class.php @@ -133,7 +133,9 @@ class AgentsAlerts extends HTML // Refresh rate. $this->refreshSelectedRate = (string) get_parameter('refresh-rate', '30'); // Show Modules without alerts table. - $this->showWithoutAlertModules = isset($_POST['show-modules-without-alerts']); + $this->showWithoutAlertModules = (isset($_POST['show-modules-without-alerts'])) + ? true + : isset($_GET['show-modules-without-alerts']); // Selected group. $this->groupId = (int) get_parameter('group-id', 0); // Create alert token. @@ -200,6 +202,8 @@ class AgentsAlerts extends HTML */ private function createAlertTable() { + global $config; + $table = new stdClass(); if ($this->groupId > 0) { @@ -219,7 +223,7 @@ class AgentsAlerts extends HTML $sql = 'SELECT tagente.alias, tagente_modulo.nombre, tagente_modulo.id_agente_modulo FROM tagente_modulo INNER JOIN tagente ON tagente.id_agente = tagente_modulo.id_agente - WHERE id_agente_modulo NOT IN (SELECT id_agent_module FROM talert_template_modules) '.$grupo.' LIMIT 20 OFFSET '.$offset_modules; + WHERE id_agente_modulo NOT IN (SELECT id_agent_module FROM talert_template_modules) '.$grupo.' LIMIT '.$config['block_size'].' OFFSET '.$offset_modules; $agent_modules = db_get_all_rows_sql($sql); @@ -227,7 +231,7 @@ class AgentsAlerts extends HTML $count_agent_module[0]['COUNT(tagente_modulo.nombre)'], ui_get_url_refresh(), 0, - 0, + false, false, 'offset', true,