From 667d73f8a5a5e97494850f6448e6b14e8b24d891 Mon Sep 17 00:00:00 2001 From: vgilc Date: Fri, 23 May 2014 07:29:47 +0000 Subject: [PATCH] 2014-05-23 Vanessa Gil * godmode/agentes/module_manager.php: Added optional module pagination. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9993 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 ++++ .../godmode/agentes/module_manager.php | 25 ++++++++++++++----- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index ffd135a543..45bc2a785e 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2014-05-23 Vanessa Gil + + * godmode/agentes/module_manager.php: Added optional + module pagination. + 2014-05-23 Vanessa Gil * include/functions_forecast.php: Fixed division by zero. diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 93d8a2105c..3221b1655c 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -427,10 +427,18 @@ $where_tags = tags_get_acl_tags($config['id_user'], 0, 'AR', 'module_condition', switch ($config["dbtype"]) { case "postgresql": - $limit_sql = " LIMIT $limit OFFSET $offset "; + if ($config['paginate_module']) { + $limit_sql = " LIMIT $limit OFFSET $offset "; + } else { + $limit_sql = ''; + } case "mysql": - if(!isset($limit_sql)) { - $limit_sql = " LIMIT $offset, $limit "; + if ($config['paginate_module']) { + if(!isset($limit_sql)) { + $limit_sql = " LIMIT $offset, $limit "; + } + } else { + $limit_sql = ''; } $sql = sprintf("SELECT %s FROM tagente_modulo @@ -441,8 +449,10 @@ switch ($config["dbtype"]) { break; case "oracle": $set = array(); - $set['limit'] = $limit; - $set['offset'] = $offset; + if ($config['paginate_module']) { + $set['limit'] = $limit; + $set['offset'] = $offset; + } $sql = sprintf("SELECT %s FROM tagente_modulo WHERE %s %s %s %s", @@ -473,7 +483,10 @@ $url = "?" . "sort_field=" . $sortField ."&" . "&sort=" . $sort . "&" . "search_string=" . urlencode($search_string); -ui_pagination($total_modules, $url); + +if ($config['paginate_module']) { + ui_pagination($total_modules, $url); +} $table->width = '98%'; $table->head = array ();