/i', '
', getDolGlobalString('MAIN_MOTD'));
$substitutionarray = getCommonSubstitutionArray($langs);
complete_substitutions_array($substitutionarray, $langs);
$texttoshow = make_substitutions(getDolGlobalString('MAIN_MOTD'), $substitutionarray, $langs);
print "\n\n";
print '
| '; print dol_htmlentitiesbr($texttoshow); print ' |
'.$langs->trans("DolibarrWorkBoard").' ';
if ($showweather) {
if ($totallate > 0) {
$text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv(
"NActionsLate",
$totallate.(getDolGlobalString('MAIN_USE_METEO_WITH_PERCENTAGE') ? '%' : '')
).')';
} else {
$text = $langs->transnoentitiesnoconv("NoItemLate");
}
$text .= '. '.$langs->transnoentitiesnoconv("LateDesc");
//$text.=$form->textwithpicto('',$langs->trans("LateDesc"));
$options = 'height="24px" style="float: right"';
$boxwork .= showWeather($totallate, $text, $options, 'inline-block valignmiddle');
}
$boxwork .= ' | ';
$boxwork .= '
|---|
';
foreach ($dashboardgroup as $groupKey => $groupElement) {
$boards = array();
// Scan $groupElement and save the one with 'stats' that must be used for the open objects dashboard
if (!getDolGlobalString('MAIN_DISABLE_NEW_OPENED_DASH_BOARD')) {
foreach ($groupElement['stats'] as $infoKey) {
if (!empty($valid_dashboardlines[$infoKey])) {
$boards[] = $valid_dashboardlines[$infoKey];
$isIntopOpenedDashBoard[] = $infoKey;
}
}
}
if (!empty($boards)) {
if (!empty($groupElement['lang'])) {
$langs->load($groupElement['lang']);
}
// @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset
$groupName = $langs->trans($groupElement['groupName']);
$groupKeyLowerCase = strtolower($groupKey);
// global stats
$globalStatsKey = false;
if (!empty($groupElement['globalStatsKey']) && empty($groupElement['globalStats'])) { // can be filled by hook
$globalStatsKey = $groupElement['globalStatsKey'];
$groupElement['globalStats'] = array();
}
$openedDashBoard .= ' '."\n";
$openedDashBoard .= "\n";
}
}
if ($showweather && !empty($isIntopOpenedDashBoard)) {
$appendClass = (getDolGlobalInt('MAIN_DISABLE_METEO') == 2 ? ' hideonsmartphone' : '');
$weather = getWeatherStatus($totallate);
$text = '';
if ($totallate > 0) {
$text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv(
"NActionsLate",
$totallate.(getDolGlobalString('MAIN_USE_METEO_WITH_PERCENTAGE') ? '%' : '')
).')';
} else {
$text = $langs->transnoentitiesnoconv("NoItemLate");
}
$text .= '. '.$langs->transnoentitiesnoconv("LateDesc");
$weatherDashBoard = ''."\n";
$openedDashBoard .= ' '."\n";
$openedDashBoard .= ''."\n";
$openedDashBoard .= ' '."\n";
$openedDashBoard .= ' '."\n";
$openedDashBoard .= ' '."\n";
$openedDashBoard .= ' '.$groupName.' '."\n";
$openedDashBoard .= ''."\n";
foreach ($boards as $board) {
$openedDashBoard .= ' '."\n"; // info-box-line
}
// TODO Add hook here to add more "info-box-line"
$openedDashBoard .= ' ';
if (!empty($board->labelShort)) {
$infoName = ' ';
$openedDashBoard .= ''.$board->labelShort.' ';
} else {
$infoName = ''.$board->label.' ';
}
$textLateTitle = $langs->trans("NActionsLate", $board->nbtodolate);
$dateOrder = '';
if ($board->id == 'mo') {
$dateOrder = $langs->trans("DateToday") . " > " . $langs->trans("DateReference");
} else {
$dateOrder = $langs->trans("DateReference") . " > " . $langs->trans("DateToday");
}
$warningDelay = ceil(empty($board->warning_delay) ? 0 : $board->warning_delay);
$sign = '';
if ($warningDelay >= 0) {
$sign = '+';
}
$textLateTitle .= " (" . $langs->trans("Late") . " = $dateOrder $sign$warningDelay " . $langs->trans("days") . ")";
if ($board->id == 'bank_account') {
$textLateTitle .= ''.$langs->trans("IfYouDontReconcileDisableProperty", $langs->transnoentitiesnoconv("Conciliable")).''; } $textLate = ''; if ($board->nbtodolate > 0) { $textLate .= ''; $textLate .= ' '.$board->nbtodolate; $textLate .= ''; } $nbtodClass = ''; if ($board->nbtodo > 0) { $nbtodClass = 'badge badge-info'; } else { $nbtodClass = 'opacitymedium'; } // Forge the line to show into the open object box $labeltoshow = $board->label.' ('.$board->nbtodo.')'; if ($board->total > 0) { $labeltoshow .= ' - '.price($board->total, 0, $langs, 1, -1, -1, $conf->currency); } $openedDashBoard .= ''; $openedDashBoard .= $infoName; $openedDashBoard .= ''; $openedDashBoard .= ' ';
$openedDashBoard .= '';
$openedDashBoard .= '';
$openedDashBoard .= $board->nbtodo;
if ($board->total > 0 && getDolGlobalString('MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX')) {
$openedDashBoard .= ' : '.price($board->total, 0, $langs, 1, -1, -1, $conf->currency);
}
$openedDashBoard .= '';
$openedDashBoard .= '';
if ($textLate) {
if ($board->url_late) {
$openedDashBoard .= ' ';
$openedDashBoard .= ' '."\n";
//$openedDashBoard .= ''."\n";
$weatherDashBoard .= ' '."\n";
$weatherDashBoard .= ''."\n";
$weatherDashBoard .= ' '."\n";
$weatherDashBoard .= ' '."\n";
$weatherDashBoard .= ''."\n";
$weatherDashBoard .= ' '."\n";
$weatherDashBoard .= ' '.$langs->trans('GlobalOpenedElemView').' '."\n";
if ($totallatePercentage > 0 && getDolGlobalString('MAIN_USE_METEO_WITH_PERCENTAGE')) {
$weatherDashBoard .= ' '.$langs->transnoentitiesnoconv(
"NActionsLate",
price($totallatePercentage).'%'
).''."\n";
$weatherDashBoard .= ' '.$langs->trans(
'NActionsLate',
$totalLateNumber
).''."\n";
} else {
$weatherDashBoard .= ' '.$langs->transnoentitiesnoconv(
"NActionsLate",
(string) $totalLateNumber
).''."\n";
if ($totallatePercentage > 0) {
$weatherDashBoard .= ' '.$langs->trans(
'NActionsLate',
price($totallatePercentage).'%'
).''."\n";
}
}
$weatherDashBoard .= ' ';
$boxwork .= ' ';
$boxwork .= ''.$board->img.' '.$board->label.' ';
if ($board->nbtodolate > 0) {
$boxwork .= ''; $boxwork .= ''.$board->nbtodo.''; if ($board->total > 0 && getDolGlobalString('MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX')) { $boxwork .= ' / '.price($board->total).''; } $boxwork .= ' ';
$boxwork .= '';
//$boxwork .= img_picto($textlate, "warning_white", 'class="valigntextbottom"');
$boxwork .= img_picto(
$textlate,
"warning_white",
'class="inline-block hideonsmartphone valigntextbottom"'
);
$boxwork .= '';
$boxwork .= $board->nbtodolate;
$boxwork .= '';
$boxwork .= '';
$boxwork .= ' ';
}
$boxwork .= '';
$boxwork .= ' ';
$boxwork .= ' ';
$boxwork .= ' ';
$boxwork .= '';
$boxwork .= ' |
| '; $boxwork .= $langs->trans("NoOpenedElementToProcess"); $boxwork .= ' | '; $boxwork .= '