diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index a86f0551bab29..02e4d63e5f047 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -951,11 +951,14 @@ public function setValues($db) } // conf->liste_limit = constant to limit size of lists + // This value can be overwritten by user choice in main.inc.php $this->liste_limit = getDolGlobalInt('MAIN_SIZE_LISTE_LIMIT', 15); if ((int) $this->liste_limit <= 0) { - // Mode automatic. + // Mode automatic. Similar code than into main.inc.php $this->liste_limit = 15; - if (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 910) { + if (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 700) { + $this->liste_limit = 8; + } elseif (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 910) { $this->liste_limit = 10; } elseif (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] > 1130) { $this->liste_limit = 20; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 24cb42110741a..53cdffdb1453f 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1405,9 +1405,11 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type, $stopcode = 1) $conf->liste_limit = getDolUserInt('MAIN_SIZE_LISTE_LIMIT'); // Can be 0 } if ((int) $conf->liste_limit <= 0) { - // Mode automatic. + // Mode automatic. Similar code than into conf.class.php $conf->liste_limit = 15; - if (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 910) { + if (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 700) { + $conf->liste_limit = 8; + } elseif (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 910) { $conf->liste_limit = 10; } elseif (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] > 1130) { $conf->liste_limit = 20;