diff --git a/htdocs/index.php b/htdocs/index.php index 45c7e1509e2..bce3b9dc083 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -107,27 +107,21 @@ if (! empty($conf->global->MAIN_MOTD)) * Dashboard Dolibarr states (statistics) * Hidden for external users */ -$boxstat=''; + + +$boxstatItems = array(); +$boxstatFromHook = ''; // Load translation files required by page $langs->loadLangs(array('commercial', 'bills', 'orders', 'contracts')); if (empty($user->societe_id) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) { - $boxstat.='
| ';
- $boxstat.=' '.$langs->trans("DolibarrStateBoard").' ';
- $boxstat.=' | ';
- $boxstat.='
|---|
| ';
-
$object=new stdClass();
$parameters=array();
$action='';
$reshook=$hookmanager->executeHooks('addStatisticLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
- $boxstat.=$hookmanager->resPrint;
+ $boxstatFromHook=$hookmanager->resPrint;
if (empty($reshook))
{
@@ -318,6 +312,7 @@ if (empty($user->societe_id) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTAT
{
if ($conditions[$key])
{
+ $boxstatItem = '';
$classe=$classes[$key];
// Search in cache if load_state_board is already realized
if (! isset($boardloaded[$classe]) || ! is_object($boardloaded[$classe]))
@@ -336,28 +331,17 @@ if (empty($user->societe_id) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTAT
if (!empty($langfile[$key])) $langs->load($langfile[$key]);
$text=$langs->trans($titres[$key]);
- $boxstat.='';
- $boxstat.=' ';
- $boxstat.=''.$text.' ';
- $boxstat.='';
+ $boxstatItem.='';
+ $boxstatItem.=''; - $boxstat.=''.img_object("", $icons[$key], 'class="inline-block"').' '.($board->nb[$val]?$board->nb[$val]:0).''; - $boxstat.=' ';
+ $boxstatItem.=''.$text.' ';
+ $boxstatItem.='';
+
+ $boxstatItems[$val] = $boxstatItem;
}
}
}
-
- $boxstat.='';
- $boxstat.='';
- $boxstat.='';
- $boxstat.='';
- $boxstat.='';
- $boxstat.='';
- $boxstat.='';
- $boxstat.='';
-
- $boxstat.=''; + $boxstatItem.=''.img_object("", $icons[$key], 'class="inline-block"').' '.($board->nb[$val]?$board->nb[$val]:0).''; + $boxstatItem.=' |