From fde9a6667f51a11989c824d8c2b86565fb067a7e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Dec 2021 15:46:08 +0100 Subject: [PATCH] Fix colspan --- htdocs/accountancy/admin/account.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index c2ac133069d..dd7ea5f6e74 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -404,6 +404,11 @@ if ($resql) { $moreforfilter = ''; + $accountstatic = new AccountingAccount($db); + $accountparent = new AccountingAccount($db); + $totalarray = array(); + $totalarray['nbfield'] = 0; + print '
'; print ''."\n"; @@ -466,11 +471,6 @@ if ($resql) { print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print "\n"; - $accountstatic = new AccountingAccount($db); - $accountparent = new AccountingAccount($db); - $totalarray = array(); - $totalarray['nbfield'] = 0; - $i = 0; while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); @@ -615,8 +615,13 @@ if ($resql) { } if ($num == 0) { - $totalarray['nbfield']++; - print ''; + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''; } print "
'.$langs->trans("None").'
'.$langs->trans("None").'
";