29 define(
'CSRFCHECK_WITH_TOKEN', 1);
31 require
'main.inc.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
35 $_GET[
'mainmenu'] =
GETPOST(
'mainmenu',
'aZ09') ?
GETPOST(
'mainmenu',
'aZ09') :
'home';
36 $action =
GETPOST(
'action',
'aZ09');
38 $hookmanager->initHooks(array(
'index'));
46 if (!isset($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_NOM)) {
47 header(
"Location: ".DOL_URL_ROOT.
"/admin/index.php?mainmenu=home&leftmenu=setup&mesg=setupnotcomplete");
50 if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) {
51 header(
"Location: ".DOL_URL_ROOT.
"/admin/index.php?mainmenu=home&leftmenu=setup&mesg=setupnotcomplete");
55 require_once DOL_DOCUMENT_ROOT.
'/core/class/infobox.class.php';
56 $zone =
GETPOST(
'areacode',
'int');
57 $userid =
GETPOST(
'userid',
'int');
58 $boxorder =
GETPOST(
'boxorder',
'aZ09');
59 $boxorder .=
GETPOST(
'boxcombo',
'aZ09');
77 $title = $langs->trans(
"HomeArea").
' - Dolibarr '.DOL_VERSION;
78 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
79 $title = $langs->trans(
"HomeArea").
' - '.$conf->global->MAIN_APPLICATION_TITLE;
88 print
load_fiche_titre(
' ', $resultboxes[
'selectboxlist'],
'', 0,
'',
'titleforhome');
90 if (!empty($conf->global->MAIN_MOTD)) {
91 $conf->global->MAIN_MOTD = preg_replace(
'/<br(\s[\sa-zA-Z_="]*)?\/?>/i',
'<br>', $conf->global->MAIN_MOTD);
92 if (!empty($conf->global->MAIN_MOTD)) {
95 $texttoshow =
make_substitutions($conf->global->MAIN_MOTD, $substitutionarray, $langs);
97 print
"\n<!-- Start of welcome text -->\n";
98 print
'<table width="100%" class="notopnoleftnoright"><tr><td>';
100 print
'</td></tr></table><br>';
101 print
"\n<!-- End of welcome text -->\n";
110 if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) {
114 $lockfile = DOL_DATA_ROOT.
'/install.lock';
115 if (!empty($lockfile) && !file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT.
"/install")) {
116 $langs->load(
"errors");
118 $message .=
info_admin($langs->trans(
"WarningLockFileDoesNotExists", DOL_DATA_ROOT).
' '.$langs->trans(
"WarningUntilDirRemoved", DOL_DOCUMENT_ROOT.
"/install"), 0, 0,
'1',
'clearboth');
122 if (is_writable($conffile)) {
123 $langs->load(
"errors");
126 $message .=
info_admin($langs->transnoentities(
"WarningConfFileMustBeReadOnly").
' '.$langs->trans(
"WarningUntilDirRemoved", DOL_DOCUMENT_ROOT.
"/install"), 0, 0,
'1',
'clearboth');
141 $boxstatItems = array();
142 $boxstatFromHook =
'';
145 $langs->loadLangs(array(
'commercial',
'bills',
'orders',
'contracts'));
148 if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
149 $showweather = (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO == 2) ? 1 : 0;
152 $dashboardlines = array();
155 require_once DOL_DOCUMENT_ROOT.
'/core/class/workboardresponse.class.php';
158 if (
isModEnabled(
'agenda') && empty($conf->global->MAIN_DISABLE_BLOCK_AGENDA) && $user->hasRight(
'agenda',
'myactions',
'read')) {
159 include_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
161 $dashboardlines[$board->element] = $board->load_board($user);
165 if (
isModEnabled(
'project') && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && $user->hasRight(
'projet',
'lire')) {
166 include_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
168 $dashboardlines[$board->element] = $board->load_board($user);
172 if (
isModEnabled(
'project') && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && empty($conf->global->PROJECT_HIDE_TASKS) && $user->hasRight(
'projet',
'lire')) {
173 include_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
174 $board =
new Task($db);
175 $dashboardlines[$board->element] = $board->load_board($user);
179 if (
isModEnabled(
'propal') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight(
'propal',
'lire')) {
180 include_once DOL_DOCUMENT_ROOT.
'/comm/propal/class/propal.class.php';
182 $dashboardlines[$board->element.
'_opened'] = $board->load_board($user,
"opened");
184 $dashboardlines[$board->element.
'_signed'] = $board->load_board($user,
"signed");
188 if (
isModEnabled(
'supplier_proposal') && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && $user->hasRight(
'supplier_proposal',
'lire')) {
189 $langs->load(
"supplier_proposal");
190 include_once DOL_DOCUMENT_ROOT.
'/supplier_proposal/class/supplier_proposal.class.php';
192 $dashboardlines[$board->element.
'_opened'] = $board->load_board($user,
"opened");
194 $dashboardlines[$board->element.
'_signed'] = $board->load_board($user,
"signed");
198 if (
isModEnabled(
'commande') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight(
'commande',
'lire')) {
199 include_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
201 $dashboardlines[$board->element] = $board->load_board($user);
205 if (
isModEnabled(
'supplier_order') && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && $user->hasRight(
'fournisseur',
'commande',
'lire')) {
206 include_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
208 $dashboardlines[$board->element.
'_opened'] = $board->load_board($user,
"opened");
209 $dashboardlines[$board->element.
'_awaiting'] = $board->load_board($user,
'awaiting');
213 if (
isModEnabled(
'contrat') && empty($conf->global->MAIN_DISABLE_BLOCK_CONTRACT) && $user->hasRight(
'contrat',
'lire')) {
214 include_once DOL_DOCUMENT_ROOT.
'/contrat/class/contrat.class.php';
216 $dashboardlines[$board->element.
'_inactive'] = $board->load_board($user,
"inactive");
218 $dashboardlines[$board->element.
'_active'] = $board->load_board($user,
"active");
222 if (
isModEnabled(
'ticket') && empty($conf->global->MAIN_DISABLE_BLOCK_TICKET) && $user->hasRight(
'ticket',
'read')) {
223 include_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
225 $dashboardlines[$board->element.
'_opened'] = $board->load_board($user,
"opened");
231 if (
isModEnabled(
'facture') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight(
'facture',
'lire')) {
232 include_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
234 $dashboardlines[$board->element] = $board->load_board($user);
238 if (
isModEnabled(
'supplier_invoice') && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && $user->hasRight(
'fournisseur',
'facture',
'lire')) {
239 include_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
241 $dashboardlines[$board->element] = $board->load_board($user);
245 if (
isModEnabled(
'banque') && empty($conf->global->MAIN_DISABLE_BLOCK_BANK) && $user->hasRight(
'banque',
'lire') && !$user->socid) {
246 include_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
248 $nb = $board->countAccountToReconcile();
250 $dashboardlines[$board->element] = $board->load_board($user);
256 if (
isModEnabled(
'banque') && empty($conf->global->MAIN_DISABLE_BLOCK_BANK) && $user->hasRight(
'banque',
'lire') && !$user->socid) {
257 if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT)) {
258 include_once DOL_DOCUMENT_ROOT.
'/compta/paiement/cheque/class/remisecheque.class.php';
260 $dashboardlines[$board->element] = $board->load_board($user);
262 if (!empty($conf->prelevement->enabled)) {
263 include_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/bonprelevement.class.php';
265 $dashboardlines[$board->element.
'_direct_debit'] = $board->load_board($user,
'direct_debit');
267 if (!empty($conf->paymentbybanktransfer->enabled)) {
268 include_once DOL_DOCUMENT_ROOT.
'/compta/prelevement/class/bonprelevement.class.php';
270 $dashboardlines[$board->element.
'_credit_transfer'] = $board->load_board($user,
'credit_transfer');
275 if (
isModEnabled(
'adherent') && empty($conf->global->MAIN_DISABLE_BLOCK_ADHERENT) && $user->hasRight(
'adherent',
'lire') && !$user->socid) {
276 include_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
278 $dashboardlines[$board->element.
'_shift'] = $board->load_board($user,
'shift');
279 $dashboardlines[$board->element.
'_expired'] = $board->load_board($user,
'expired');
283 if (
isModEnabled(
'expensereport') && empty($conf->global->MAIN_DISABLE_BLOCK_EXPENSEREPORT) && $user->hasRight(
'expensereport',
'approve')) {
284 include_once DOL_DOCUMENT_ROOT.
'/expensereport/class/expensereport.class.php';
286 $dashboardlines[$board->element.
'_toapprove'] = $board->load_board($user,
'toapprove');
290 if (
isModEnabled(
'expensereport') && empty($conf->global->MAIN_DISABLE_BLOCK_EXPENSEREPORT) && $user->hasRight(
'expensereport',
'to_paid')) {
291 include_once DOL_DOCUMENT_ROOT.
'/expensereport/class/expensereport.class.php';
293 $dashboardlines[$board->element.
'_topay'] = $board->load_board($user,
'topay');
297 if (
isModEnabled(
'holiday') && empty($conf->global->MAIN_DISABLE_BLOCK_HOLIDAY) && $user->hasRight(
'holiday',
'approve')) {
298 include_once DOL_DOCUMENT_ROOT.
'/holiday/class/holiday.class.php';
300 $dashboardlines[$board->element] = $board->load_board($user);
303 $object =
new stdClass();
304 $parameters = array();
306 $reshook = $hookmanager->executeHooks(
307 'addOpenElementsDashboardLine',
313 $dashboardlines = array_merge($dashboardlines, $hookmanager->resArray);
317 $dashboardgroup = array(
320 'groupName' =>
'Agenda',
321 'stats' => array(
'action'),
325 'groupName' =>
'Projects',
326 'globalStatsKey' =>
'projects',
327 'stats' => array(
'project',
'project_task'),
331 'groupName' =>
'Proposals',
332 'globalStatsKey' =>
'proposals',
334 array(
'propal_opened',
'propal_signed'),
338 'groupName' =>
'Orders',
339 'globalStatsKey' =>
'orders',
345 'groupName' =>
'Invoices',
346 'globalStatsKey' =>
'invoices',
350 'supplier_proposal' =>
352 'lang' =>
'supplier_proposal',
353 'groupName' =>
'SupplierProposals',
354 'globalStatsKey' =>
'askprice',
356 array(
'supplier_proposal_opened',
'supplier_proposal_signed'),
360 'groupName' =>
'SuppliersOrders',
361 'globalStatsKey' =>
'supplier_orders',
363 array(
'order_supplier_opened',
'order_supplier_awaiting'),
365 'invoice_supplier' =>
367 'groupName' =>
'BillsSuppliers',
368 'globalStatsKey' =>
'supplier_invoices',
370 array(
'invoice_supplier'),
374 'groupName' =>
'Contracts',
375 'globalStatsKey' =>
'Contracts',
377 array(
'contrat_inactive',
'contrat_active'),
381 'groupName' =>
'Tickets',
382 'globalStatsKey' =>
'ticket',
384 array(
'ticket_opened'),
388 'groupName' =>
'BankAccount',
390 array(
'bank_account',
'chequereceipt',
'widthdraw_direct_debit',
'widthdraw_credit_transfer'),
394 'groupName' =>
'Members',
395 'globalStatsKey' =>
'members',
397 array(
'member_shift',
'member_expired'),
401 'groupName' =>
'ExpenseReport',
402 'globalStatsKey' =>
'expensereports',
404 array(
'expensereport_toapprove',
'expensereport_topay'),
408 'groupName' =>
'Holidays',
409 'globalStatsKey' =>
'holidays',
415 $object =
new stdClass();
417 'dashboardgroup' => $dashboardgroup
419 $reshook = $hookmanager->executeHooks(
'addOpenElementsDashboardGroup', $parameters, $object, $action);
421 $dashboardgroup = array_merge($dashboardgroup, $hookmanager->resArray);
426 $totallate = $totaltodo = 0;
430 $valid_dashboardlines = array();
431 foreach ($dashboardlines as $workboardid => $tmp) {
433 $tmp->id = $workboardid;
434 $valid_dashboardlines[$workboardid] = $tmp;
439 foreach ($valid_dashboardlines as $board) {
440 if ($board->nbtodolate > 0) {
441 $totaltodo += $board->nbtodo;
442 $totallate += $board->nbtodolate;
446 $openedDashBoardSize =
'info-box-sm';
447 foreach ($dashboardgroup as $dashbordelement) {
448 if (is_array($dashbordelement[
'stats']) && count($dashbordelement[
'stats']) > 2) {
449 $openedDashBoardSize =
'';
454 $totalLateNumber = $totallate;
455 $totallatePercentage = ((!empty($totaltodo)) ? round($totallate / $totaltodo * 100, 2) : 0);
456 if (!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) {
457 $totallate = $totallatePercentage;
461 $boxwork .=
'<div class="box">';
462 $boxwork .=
'<table summary="'.dol_escape_htmltag($langs->trans(
"WorkingBoard")).
'" class="noborder boxtable boxtablenobottom boxworkingboard centpercent">'.
"\n";
463 $boxwork .=
'<tr class="liste_titre">';
464 $boxwork .=
'<th class="liste_titre"><div class="inline-block valignmiddle">'.$langs->trans(
"DolibarrWorkBoard").
'</div>';
466 if ($totallate > 0) {
467 $text = $langs->transnoentitiesnoconv(
"WarningYouHaveAtLeastOneTaskLate").
' ('.$langs->transnoentitiesnoconv(
469 $totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ?
'%' :
'')
472 $text = $langs->transnoentitiesnoconv(
"NoItemLate");
474 $text .=
'. '.$langs->transnoentitiesnoconv(
"LateDesc");
476 $options =
'height="24px" style="float: right"';
477 $boxwork .=
showWeather($totallate, $text, $options,
'inline-block valignmiddle');
480 $boxwork .=
'</tr>'.
"\n";
483 $nbworkboardempty = 0;
484 $isIntopOpenedDashBoard = $globalStatInTopOpenedDashBoard = array();
485 if (!empty($valid_dashboardlines)) {
486 $openedDashBoard =
'';
488 $boxwork .=
'<tr class="nobottom nohover"><td class="tdboxstats nohover flexcontainer centpercent"><div style="display: flex: flex-wrap: wrap">';
490 foreach ($dashboardgroup as $groupKey => $groupElement) {
494 if (empty($conf->global->MAIN_DISABLE_NEW_OPENED_DASH_BOARD)) {
495 foreach ($groupElement[
'stats'] as $infoKey) {
496 if (!empty($valid_dashboardlines[$infoKey])) {
497 $boards[] = $valid_dashboardlines[$infoKey];
498 $isIntopOpenedDashBoard[] = $infoKey;
503 if (!empty($boards)) {
504 if (!empty($groupElement[
'lang'])) {
505 $langs->load($groupElement[
'lang']);
507 $groupName = $langs->trans($groupElement[
'groupName']);
508 $groupKeyLowerCase = strtolower($groupKey);
511 $globalStatsKey =
false;
512 if (!empty($groupElement[
'globalStatsKey']) && empty($groupElement[
'globalStats'])) {
513 $globalStatsKey = $groupElement[
'globalStatsKey'];
514 $groupElement[
'globalStats'] = array();
516 if (isset($keys) && is_array($keys) && in_array($globalStatsKey, $keys)) {
518 $keyIndex = array_search($globalStatsKey, $keys);
520 $classe = (!empty($classes[$keyIndex]) ? $classes[$keyIndex] :
'');
521 if (isset($boardloaded[$classe]) && is_object($boardloaded[$classe])) {
522 $groupElement[
'globalStats'][
'total'] = $boardloaded[$classe]->nb[$globalStatsKey] ? $boardloaded[$classe]->nb[$globalStatsKey] : 0;
523 $nbTotal = floatval($groupElement[
'globalStats'][
'total']);
524 if ($nbTotal >= 10000) {
525 $nbTotal = round($nbTotal / 1000, 2).
'k';
527 $groupElement[
'globalStats'][
'text'] = $langs->trans(
'Total').
' : '.$langs->trans($titres[$keyIndex]).
' ('.$groupElement[
'globalStats'][
'total'].
')';
528 $groupElement[
'globalStats'][
'total'] = $nbTotal;
534 $openedDashBoard .=
'<div class="box-flex-item"><div class="box-flex-item-with-margin">'.
"\n";
535 $openedDashBoard .=
' <div class="info-box '.$openedDashBoardSize.
'">'.
"\n";
536 $openedDashBoard .=
' <span class="info-box-icon bg-infobox-'.$groupKeyLowerCase.
'">'.
"\n";
537 $openedDashBoard .=
' <i class="fa fa-dol-'.$groupKeyLowerCase.
'"></i>'.
"\n";
540 if (!empty($groupElement[
'globalStats'])) {
541 $globalStatInTopOpenedDashBoard[] = $globalStatsKey;
542 $openedDashBoard .=
'<span class="info-box-icon-text" title="'.$groupElement[
'globalStats'][
'text'].
'">'.$nbTotal.
'</span>';
545 $openedDashBoard .=
'</span>'.
"\n";
546 $openedDashBoard .=
'<div class="info-box-content">'.
"\n";
548 $openedDashBoard .=
'<div class="info-box-title" title="'.strip_tags($groupName).
'">'.$groupName.
'</div>'.
"\n";
549 $openedDashBoard .=
'<div class="info-box-lines">'.
"\n";
551 foreach ($boards as $board) {
552 $openedDashBoard .=
'<div class="info-box-line">';
554 if (!empty($board->labelShort)) {
555 $infoName =
'<span class="marginrightonly" title="'.$board->label.
'">'.$board->labelShort.
'</span>';
557 $infoName =
'<span class="marginrightonly">'.$board->label.
'</span>';
560 $textLateTitle = $langs->trans(
"NActionsLate", $board->nbtodolate);
561 $textLateTitle .=
' ('.$langs->trans(
"Late").
' = '.$langs->trans(
"DateReference").
' > '.$langs->trans(
"DateToday").
' '.(ceil($board->warning_delay) >= 0 ?
'+' :
'').ceil($board->warning_delay).
' '.$langs->trans(
"days").
')';
563 if ($board->id ==
'bank_account') {
564 $textLateTitle .=
'<br><span class="opacitymedium">'.$langs->trans(
"IfYouDontReconcileDisableProperty", $langs->transnoentitiesnoconv(
"Conciliable")).
'</span>';
568 if ($board->nbtodolate > 0) {
569 $textLate .=
'<span title="'.dol_escape_htmltag($textLateTitle).
'" class="classfortooltip badge badge-warning">';
570 $textLate .=
'<i class="fa fa-exclamation-triangle"></i> '.$board->nbtodolate;
571 $textLate .=
'</span>';
575 if ($board->nbtodo > 0) {
576 $nbtodClass =
'badge badge-info';
578 $nbtodClass =
'opacitymedium';
582 $labeltoshow = $board->label.
' ('.$board->nbtodo.
')';
583 if ($board->total > 0) {
584 $labeltoshow .=
' - '.price($board->total, 0, $langs, 1, -1, -1, $conf->currency);
586 $openedDashBoard .=
'<a href="'.$board->url.
'" class="info-box-text info-box-text-a">'.$infoName.
'<span class="classfortooltip'.($nbtodClass ?
' '.$nbtodClass :
'').
'" title="'.$labeltoshow.
'" >';
587 $openedDashBoard .= $board->nbtodo;
588 if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) {
589 $openedDashBoard .=
' : '.price($board->total, 0, $langs, 1, -1, -1, $conf->currency);
591 $openedDashBoard .=
'</span>';
593 if ($board->url_late) {
594 $openedDashBoard .=
'</a>';
595 $openedDashBoard .=
' <a href="'.$board->url_late.
'" class="info-box-text info-box-text-a paddingleft">';
597 $openedDashBoard .=
' ';
599 $openedDashBoard .= $textLate;
601 $openedDashBoard .=
'</a>'.
"\n";
602 $openedDashBoard .=
'</div>'.
"\n";
607 $openedDashBoard .=
' </div><!-- /.info-box-lines --></div><!-- /.info-box-content -->'.
"\n";
608 $openedDashBoard .=
' </div><!-- /.info-box -->'.
"\n";
609 $openedDashBoard .=
'</div><!-- /.box-flex-item-with-margin -->'.
"\n";
610 $openedDashBoard .=
'</div><!-- /.box-flex-item -->'.
"\n";
611 $openedDashBoard .=
"\n";
615 if ($showweather && !empty($isIntopOpenedDashBoard)) {
616 $appendClass = (!empty($conf->global->MAIN_DISABLE_METEO) && $conf->global->MAIN_DISABLE_METEO == 2 ?
' hideonsmartphone' :
'');
620 if ($totallate > 0) {
621 $text = $langs->transnoentitiesnoconv(
"WarningYouHaveAtLeastOneTaskLate").
' ('.$langs->transnoentitiesnoconv(
623 $totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ?
'%' :
'')
626 $text = $langs->transnoentitiesnoconv(
"NoItemLate");
628 $text .=
'. '.$langs->transnoentitiesnoconv(
"LateDesc");
630 $weatherDashBoard =
'<div class="box-flex-item '.$appendClass.
'"><div class="box-flex-item-with-margin">'.
"\n";
631 $weatherDashBoard .=
' <div class="info-box '.$openedDashBoardSize.
' info-box-weather info-box-weather-level'.$weather->level.
'">'.
"\n";
632 $weatherDashBoard .=
' <span class="info-box-icon">';
633 $weatherDashBoard .=
img_weather(
'', $weather->level,
'', 0,
'valignmiddle width50');
634 $weatherDashBoard .=
' </span>'.
"\n";
635 $weatherDashBoard .=
' <div class="info-box-content">'.
"\n";
636 $weatherDashBoard .=
' <div class="info-box-title">'.$langs->trans(
'GlobalOpenedElemView').
'</div>'.
"\n";
638 if ($totallatePercentage > 0 && !empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) {
639 $weatherDashBoard .=
' <span class="info-box-number">'.$langs->transnoentitiesnoconv(
641 price($totallatePercentage).
'%'
643 $weatherDashBoard .=
' <span class="progress-description">'.$langs->trans(
648 $weatherDashBoard .=
' <span class="info-box-number">'.$langs->transnoentitiesnoconv(
652 if ($totallatePercentage > 0) {
653 $weatherDashBoard .=
' <span class="progress-description">'.$langs->trans(
655 price($totallatePercentage).
'%'
660 $weatherDashBoard .=
' </div><!-- /.info-box-content -->'.
"\n";
661 $weatherDashBoard .=
' </div><!-- /.info-box -->'.
"\n";
662 $weatherDashBoard .=
'</div><!-- /.box-flex-item-with-margin -->'.
"\n";
663 $weatherDashBoard .=
'</div><!-- /.box-flex-item -->'.
"\n";
664 $weatherDashBoard .=
"\n";
666 $openedDashBoard = $weatherDashBoard.$openedDashBoard;
669 if (!empty($isIntopOpenedDashBoard)) {
670 for ($i = 1; $i <= 10; $i++) {
671 $openedDashBoard .=
'<div class="box-flex-item filler"></div>';
675 $nbworkboardcount = 0;
676 foreach ($valid_dashboardlines as $infoKey => $board) {
677 if (in_array($infoKey, $isIntopOpenedDashBoard)) {
682 if (empty($board->nbtodo)) {
688 $textlate = $langs->trans(
"NActionsLate", $board->nbtodolate);
689 $textlate .=
' ('.$langs->trans(
"Late").
' = '.$langs->trans(
"DateReference").
' > '.$langs->trans(
"DateToday").
' '.(ceil($board->warning_delay) >= 0 ?
'+' :
'').ceil($board->warning_delay).
' '.$langs->trans(
"days").
')';
692 $boxwork .=
'<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats130 boxstatsborder">';
693 $boxwork .=
'<div class="boxstatscontent">';
694 $boxwork .=
'<span class="boxstatstext" title="'.dol_escape_htmltag($board->label).
'">'.$board->img.
' <span>'.$board->label.
'</span></span><br>';
695 $boxwork .=
'<a class="valignmiddle dashboardlineindicator" href="'.$board->url.
'"><span class="dashboardlineindicator'.(($board->nbtodo == 0) ?
' dashboardlineok' :
'').
'">'.$board->nbtodo.
'</span></a>';
696 if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) {
697 $boxwork .=
' / <a class="valignmiddle dashboardlineindicator" href="'.$board->url.
'"><span class="dashboardlineindicator'.(($board->nbtodo == 0) ?
' dashboardlineok' :
'').
'">'.
price($board->total).
'</span></a>';
699 $boxwork .=
'</div>';
700 if ($board->nbtodolate > 0) {
701 $boxwork .=
'<div class="dashboardlinelatecoin nowrap">';
702 $boxwork .=
'<a title="'.dol_escape_htmltag($textlate).
'" class="valignmiddle dashboardlineindicatorlate'.($board->nbtodolate > 0 ?
' dashboardlineko' :
' dashboardlineok').
'" href="'.((!$board->url_late) ? $board->url : $board->url_late).
'">';
707 'class="inline-block hideonsmartphone valigntextbottom"'
709 $boxwork .=
'<span class="dashboardlineindicatorlate'.($board->nbtodolate > 0 ?
' dashboardlineko' :
' dashboardlineok').
'">';
710 $boxwork .= $board->nbtodolate;
711 $boxwork .=
'</span>';
713 $boxwork .=
'</div>';
715 $boxwork .=
'</div></div>';
719 $boxwork .=
'<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
720 $boxwork .=
'<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
721 $boxwork .=
'<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
722 $boxwork .=
'<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
724 $boxwork .=
'</div>';
725 $boxwork .=
'</td></tr>';
727 $boxwork .=
'<tr class="nohover">';
728 $boxwork .=
'<td class="nohover valignmiddle opacitymedium">';
729 $boxwork .= $langs->trans(
"NoOpenedElementToProcess");
734 $boxwork .=
'</td></tr>';
736 $boxwork .=
'</table>';
737 $boxwork .=
'</div>';
739 if (!empty($isIntopOpenedDashBoard)) {
740 print
'<div class="fichecenter">';
741 print
'<div class="opened-dash-board-wrap"><div class="box-flex-container">'.$openedDashBoard.
'</div></div>';
747 print
'<div class="clearboth"></div>';
749 print
'<div class="fichecenter fichecenterbis">';
756 $boxlist =
'<div class="twocolumns">';
758 $boxlist .=
'<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
759 if (!empty($nbworkboardcount)) {
760 $boxlist .= $boxwork;
763 $boxlist .= $resultboxes[
'boxlista'];
765 $boxlist .=
'</div>';
767 $boxlist .=
'<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
769 $boxlist .= $resultboxes[
'boxlistb'];
771 $boxlist .=
'</div>';
774 $boxlist .=
'</div>';
803 return img_weather($text, $weather->picto, $options, 0, $morecss);
818 $weather =
new stdClass();
819 $weather->picto =
'';
824 $used_conf = empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ?
'MAIN_METEO_LEVEL' :
'MAIN_METEO_PERCENTAGE_LEVEL';
828 if (!empty($conf->global->{$used_conf.
'0'})) {
829 $level0 = $conf->global->{$used_conf.
'0'};
831 $level1 = $offset + 1 * $factor;
832 if (!empty($conf->global->{$used_conf.
'1'})) {
833 $level1 = $conf->global->{$used_conf.
'1'};
835 $level2 = $offset + 2 * $factor;
836 if (!empty($conf->global->{$used_conf.
'2'})) {
837 $level2 = $conf->global->{$used_conf.
'2'};
839 $level3 = $offset + 3 * $factor;
840 if (!empty($conf->global->{$used_conf.
'3'})) {
841 $level3 = $conf->global->{$used_conf.
'3'};
844 if ($totallate <= $level0) {
845 $weather->picto =
'weather-clear.png';
847 } elseif ($totallate <= $level1) {
848 $weather->picto =
'weather-few-clouds.png';
850 } elseif ($totallate <= $level2) {
851 $weather->picto =
'weather-clouds.png';
853 } elseif ($totallate <= $level3) {
854 $weather->picto =
'weather-many-clouds.png';
857 $weather->picto =
'weather-storm.png';