From 717ea523e971ecfc36565debdd1d94a4c80afdfb Mon Sep 17 00:00:00 2001 From: ATM john Date: Tue, 13 Aug 2019 15:54:32 +0200 Subject: [PATCH 1/2] Fix lang and add size control --- htdocs/index.php | 16 +++++++++++----- htdocs/theme/eldy/info-box.inc.php | 15 +++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index e56d9652c29..7daed2d4c7e 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -570,7 +570,7 @@ $dashboardgroup = array ( ), 'invoice_supplier' => array ( - 'groupName' => 'SupplierInvoices', + 'groupName' => 'BillsSuppliers', 'stats' => array ('invoice_supplier'), ), @@ -636,6 +636,13 @@ foreach($valid_dashboardlines as $board) } } +$openedDashBoardSize = 'info-box-sm'; // use sm by default +foreach ($dashboardgroup as $dashbordelement){ + if(is_array($dashbordelement['stats']) && count($dashbordelement['stats'])>2){ + $openedDashBoardSize = ''; // use default info box size : big + } +} + $totalLateNumber = $totallate; $totallatePercentage = !empty($totaltodo) ? round($totallate / $totaltodo * 100, 2) : 0; if(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $totallate = $totallatePercentage; @@ -681,7 +688,6 @@ if (!empty($valid_dashboardlines)) $boxwork.='
'; - foreach($dashboardgroup as $groupKey => $groupElement) { $boards = array(); @@ -703,7 +709,7 @@ if (!empty($valid_dashboardlines)) $groupKeyLowerCase = strtolower($groupKey); $openedDashBoard.= '
'."\n"; - $openedDashBoard.= '
'."\n"; + $openedDashBoard.= '
'."\n"; $openedDashBoard.= ' '."\n"; $openedDashBoard.= '
'."\n"; @@ -760,7 +766,7 @@ if (!empty($valid_dashboardlines)) $weatherDashBoard= '
'."\n"; - $weatherDashBoard.= '
'."\n"; + $weatherDashBoard.= '
'."\n"; $weatherDashBoard.= ' '."\n"; $weatherDashBoard.= '
'."\n"; $weatherDashBoard.= ' '.$langs->trans('GlobalOpenedElemView').'' . "\n"; @@ -858,7 +864,7 @@ $boxwork.='
'; if(!empty($isIntopOpenedDashBoard)) { print '
'; - print '
' . $openedDashBoard . '
'; + print '
' . $openedDashBoard . '
'; print '
'; } diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index f6a3b2027c0..7aa00c2fade 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -15,6 +15,11 @@ if (! defined('ISLOADEDBYSTEELSHEET'))  die('Must be call by steelsheet'); ?> border-radius: 2px; margin-bottom: 15px; } +.info-box.info-box-sm{ + min-height: 70px; + margin-bottom: 10px; +} + .info-box small { font-size: 14px; } @@ -57,6 +62,12 @@ if (! defined('ISLOADEDBYSTEELSHEET'))  die('Must be call by steelsheet'); ?> line-height: 90px; background: rgba(0, 0, 0, 0.2); } +.info-box-sm .info-box-icon{ + height: 70px; + width: 70px; + font-size: 25px; + line-height: 70px; +} .info-box-icon > img { max-width: 100%; } @@ -64,6 +75,10 @@ if (! defined('ISLOADEDBYSTEELSHEET'))  die('Must be call by steelsheet'); ?> padding: 5px 10px; margin-left: 90px; } + +.info-box-sm .info-box-content{ + margin-left: 70px; +} .info-box-number { display: block; font-weight: bold; From 2a068030e5557634f429fecc7aee2e604bd2ebff Mon Sep 17 00:00:00 2001 From: ATM john Date: Tue, 13 Aug 2019 16:01:15 +0200 Subject: [PATCH 2/2] Fix : foreach optimized --- htdocs/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/index.php b/htdocs/index.php index 7daed2d4c7e..b7eebe24063 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -640,6 +640,7 @@ $openedDashBoardSize = 'info-box-sm'; // use sm by default foreach ($dashboardgroup as $dashbordelement){ if(is_array($dashbordelement['stats']) && count($dashbordelement['stats'])>2){ $openedDashBoardSize = ''; // use default info box size : big + break; } }