Fix global stats for holiday

This commit is contained in:
Laurent Destailleur 2020-01-26 19:38:19 +01:00
parent 4510ef488e
commit 68f5aee432

View File

@ -115,6 +115,7 @@ $boxstatFromHook = '';
// Load translation files required by page // Load translation files required by page
$langs->loadLangs(array('commercial', 'bills', 'orders', 'contracts')); $langs->loadLangs(array('commercial', 'bills', 'orders', 'contracts'));
// Load global statistics of objects
if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
{ {
$object = new stdClass(); $object = new stdClass();
@ -212,7 +213,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
'askprice', 'askprice',
'projects', 'projects',
'expensereports', 'expensereports',
'holiday', 'holidays',
'donations' 'donations'
); );
// Dashboard Icon lines // Dashboard Icon lines
@ -348,9 +349,8 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
/* // Dolibarr Working Board with weather
* Dolibarr Working Board with weather
*/
if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
$showweather = (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO == 2) ? 1 : 0; $showweather = (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO == 2) ? 1 : 0;
@ -701,6 +701,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
$openedDashBoard .= ' <span class="info-box-icon bg-infoxbox-'.$groupKeyLowerCase.'">'."\n"; $openedDashBoard .= ' <span class="info-box-icon bg-infoxbox-'.$groupKeyLowerCase.'">'."\n";
$openedDashBoard .= ' <i class="fa fa-dol-'.$groupKeyLowerCase.'"></i>'."\n"; $openedDashBoard .= ' <i class="fa fa-dol-'.$groupKeyLowerCase.'"></i>'."\n";
// Show the span for the total of record
if (!empty($groupElement['globalStats'])) { if (!empty($groupElement['globalStats'])) {
$globalStatInTopOpenedDashBoard[] = $globalStatsKey; $globalStatInTopOpenedDashBoard[] = $globalStatsKey;
$openedDashBoard .= ' <span class="info-box-icon-text" title="'.$groupElement['globalStats']['text'].'">'.$nbTotal.'</span>'."\n"; $openedDashBoard .= ' <span class="info-box-icon-text" title="'.$groupElement['globalStats']['text'].'">'.$nbTotal.'</span>'."\n";