From ce367bfa31a3e1a622f4c75e81db96b1998b93d9 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Tue, 17 Nov 2015 14:42:34 +0100 Subject: [PATCH] bad limittoshow usage the value selected in MAIN_MAXTABS_IN_CARD is not well used (particulary when the active tab is present on tabcollector --- htdocs/core/lib/functions.lib.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5685a2fbb92..e9251da148e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -738,6 +738,15 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi $displaytab=0; $nbintab=0; $popuptab=0; + for ($i = 0 ; $i <= $maxkey ; $i++) + { + if ((is_numeric($active) && $i == $active) || (! empty($links[$i][2]) && ! is_numeric($active) && $active == $links[$i][2])) + { + // si l'active est présent dans la box + if ($i >= $limittoshow) + $limittoshow--; + } + } for ($i = 0 ; $i <= $maxkey ; $i++) { @@ -745,13 +754,11 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi { $isactive=true; $bactive=true; - if ($i <=$limittoshow) - $limittoshow++; } else $isactive=false; - if ($i <= $limittoshow || $isactive) + if ($i < $limittoshow || $isactive) { $out.='
'; if (isset($links[$i][2]) && $links[$i][2] == 'image')