diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index b6ebbf93d32..93ab2365139 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -813,8 +813,13 @@ class Conf extends stdClass // conf->liste_limit = constant to limit size of lists $this->liste_limit = getDolGlobalInt('MAIN_SIZE_LISTE_LIMIT', 15); if ((int) $this->liste_limit <= 0) { - // Mode automatic. TODO Define a value according to height + // Mode automatic. $this->liste_limit = 15; + if (!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; + } } // Set PRODUIT_LIMIT_SIZE if never defined diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 55c25b17f5c..94d0677b202 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6211,7 +6211,7 @@ function load_fiche_titre($title, $morehtmlright = '', $picto = 'generic', $pict */ function print_barre_liste($title, $page, $file, $options = '', $sortfield = '', $sortorder = '', $morehtmlcenter = '', $num = -1, $totalnboflines = '', $picto = 'generic', $pictoisfullpath = 0, $morehtmlright = '', $morecss = '', $limit = -1, $hideselectlimit = 0, $hidenavigation = 0, $pagenavastextinput = 0, $morehtmlrightbeforearrow = '') { - global $conf; + global $conf, $langs; $savlimit = $limit; $savtotalnboflines = $totalnboflines; @@ -6252,7 +6252,7 @@ function print_barre_liste($title, $page, $file, $options = '', $sortfield = '', print '