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 '
'; print $title; // $title may contains HTML if (!empty($title) && $savtotalnboflines >= 0 && (string) $savtotalnboflines != '') { - print '('.$totalnboflines.')'; + print '('.$totalnboflines.')'; } print '
'; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index eeeb5365677..18dc30a2c5f 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1298,3 +1298,4 @@ EntityNameNotDefined=No entity name AllEntities=All entities TranslationOfKey=Translation of the key AnyTranslationKey SignedStatus=Signed status +NbRecordQualified=Number of qualified records diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index d4c1532c9d1..42550cf702e 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1347,8 +1347,13 @@ if (!defined('NOLOGIN')) { $conf->liste_limit = getDolUserInt('MAIN_SIZE_LISTE_LIMIT'); // Can be 0 } if ((int) $conf->liste_limit <= 0) { - // Mode automatic. TODO Define a value according to height + // Mode automatic. $conf->liste_limit = 15; + if (!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; + } } // Replace conf->css by personalized value if theme not forced