Fix the automatic nb of list

This commit is contained in:
Laurent Destailleur 2024-11-16 23:23:14 +01:00
parent e866f90b12
commit cbdda5d1a8
2 changed files with 9 additions and 4 deletions

View file

@ -951,11 +951,14 @@ class Conf extends stdClass
}
// 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;

View file

@ -1405,9 +1405,11 @@ if (!defined('NOLOGIN')) {
$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;