27 define(
'NOCSRFCHECK', 1);
29 require
'main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
33 $_GET[
'mainmenu'] =
GETPOST(
'mainmenu',
'aZ09') ?
GETPOST(
'mainmenu',
'aZ09') :
'home';
34 $action =
GETPOST(
'action',
'aZ09');
36 $hookmanager->initHooks(array(
'index'));
44 if (!isset($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_NOM))
46 header(
"Location: ".DOL_URL_ROOT.
"/admin/index.php?mainmenu=home&leftmenu=setup&mesg=setupnotcomplete");
49 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");
56 require_once DOL_DOCUMENT_ROOT.
'/core/class/infobox.class.php';
57 $zone =
GETPOST(
'areacode',
'aZ09');
58 $userid =
GETPOST(
'userid',
'int');
59 $boxorder =
GETPOST(
'boxorder',
'aZ09');
60 $boxorder .=
GETPOST(
'boxcombo',
'aZ09');
71 if (!isset($form) || !is_object($form)) $form =
new Form($db);
74 $title = $langs->trans(
"HomeArea").
' - Dolibarr '.DOL_VERSION;
75 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = $langs->trans(
"HomeArea").
' - '.$conf->global->MAIN_APPLICATION_TITLE;
85 if (!empty($conf->global->MAIN_MOTD))
87 $conf->global->MAIN_MOTD = preg_replace(
'/<br(\s[\sa-zA-Z_="]*)?\/?>/i',
'<br>', $conf->global->MAIN_MOTD);
88 if (!empty($conf->global->MAIN_MOTD))
92 $texttoshow =
make_substitutions($conf->global->MAIN_MOTD, $substitutionarray, $langs);
94 print "\n<!-- Start of welcome text -->\n";
95 print '<table width="100%" class="notopnoleftnoright"><tr><td>';
97 print '</td></tr></table><br>';
98 print "\n<!-- End of welcome text -->\n";
109 $boxstatItems = array();
110 $boxstatFromHook =
'';
113 $langs->loadLangs(array(
'commercial',
'bills',
'orders',
'contracts'));
116 if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
118 $object =
new stdClass();
119 $parameters = array();
121 $reshook = $hookmanager->executeHooks(
'addStatisticLine', $parameters, $object, $action);
122 $boxstatFromHook = $hookmanager->resPrint;
143 'supplier_proposals',
153 'users' => $user->rights->user->user->lire,
154 'members' => !empty($conf->adherent->enabled) && $user->rights->adherent->lire,
155 'customers' => !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS),
156 'prospects' => !empty($conf->societe->enabled) && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS),
157 'suppliers' => !empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS),
158 'contacts' => !empty($conf->societe->enabled) && $user->rights->societe->contact->lire,
159 'products' => !empty($conf->product->enabled) && $user->rights->produit->lire,
160 'services' => !empty($conf->service->enabled) && $user->rights->service->lire,
161 'proposals' => !empty($conf->propal->enabled) && $user->rights->propale->lire,
162 'orders' => !empty($conf->commande->enabled) && $user->rights->commande->lire,
163 'invoices' => !empty($conf->facture->enabled) && $user->rights->facture->lire,
164 'donations' => !empty($conf->don->enabled) && $user->rights->don->lire,
165 'contracts' => !empty($conf->contrat->enabled) && $user->rights->contrat->lire,
166 'interventions' => !empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire,
167 'supplier_orders' => !empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS),
168 'supplier_invoices' => !empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS),
169 'supplier_proposals' => !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS),
170 'projects' => !empty($conf->projet->enabled) && $user->rights->projet->lire,
171 'expensereports' => !empty($conf->expensereport->enabled) && $user->rights->expensereport->lire,
172 'holidays' => !empty($conf->holiday->enabled) && $user->rights->holiday->read,
173 'ticket' => !empty($conf->ticket->enabled) && $user->rights->ticket->read
177 'users' => DOL_DOCUMENT_ROOT.
"/user/class/user.class.php",
178 'members' => DOL_DOCUMENT_ROOT.
"/adherents/class/adherent.class.php",
179 'customers' => DOL_DOCUMENT_ROOT.
"/societe/class/client.class.php",
180 'prospects' => DOL_DOCUMENT_ROOT.
"/societe/class/client.class.php",
181 'suppliers' => DOL_DOCUMENT_ROOT.
"/fourn/class/fournisseur.class.php",
182 'contacts' => DOL_DOCUMENT_ROOT.
"/contact/class/contact.class.php",
183 'products' => DOL_DOCUMENT_ROOT.
"/product/class/product.class.php",
184 'services' => DOL_DOCUMENT_ROOT.
"/product/class/product.class.php",
185 'proposals' => DOL_DOCUMENT_ROOT.
"/comm/propal/class/propal.class.php",
186 'orders' => DOL_DOCUMENT_ROOT.
"/commande/class/commande.class.php",
187 'invoices' => DOL_DOCUMENT_ROOT.
"/compta/facture/class/facture.class.php",
188 'donations' => DOL_DOCUMENT_ROOT.
"/don/class/don.class.php",
189 'contracts' => DOL_DOCUMENT_ROOT.
"/contrat/class/contrat.class.php",
190 'interventions' => DOL_DOCUMENT_ROOT.
"/fichinter/class/fichinter.class.php",
191 'supplier_orders' => DOL_DOCUMENT_ROOT.
"/fourn/class/fournisseur.commande.class.php",
192 'supplier_invoices' => DOL_DOCUMENT_ROOT.
"/fourn/class/fournisseur.facture.class.php",
193 'supplier_proposals' => DOL_DOCUMENT_ROOT.
"/supplier_proposal/class/supplier_proposal.class.php",
194 'projects' => DOL_DOCUMENT_ROOT.
"/projet/class/project.class.php",
195 'expensereports' => DOL_DOCUMENT_ROOT.
"/expensereport/class/expensereport.class.php",
196 'holidays' => DOL_DOCUMENT_ROOT.
"/holiday/class/holiday.class.php",
197 'ticket' => DOL_DOCUMENT_ROOT.
"/ticket/class/ticket.class.php"
202 'members' =>
'Adherent',
203 'customers' =>
'Client',
204 'prospects' =>
'Client',
205 'suppliers' =>
'Fournisseur',
206 'contacts' =>
'Contact',
207 'products' =>
'Product',
208 'services' =>
'ProductService',
209 'proposals' =>
'Propal',
210 'orders' =>
'Commande',
211 'invoices' =>
'Facture',
212 'donations' =>
'Don',
213 'contracts' =>
'Contrat',
214 'interventions' =>
'Fichinter',
215 'supplier_orders' =>
'CommandeFournisseur',
216 'supplier_invoices' =>
'FactureFournisseur',
217 'supplier_proposals' =>
'SupplierProposal',
218 'projects' =>
'Project',
219 'expensereports' =>
'ExpenseReport',
220 'holidays' =>
'Holiday',
221 'ticket' =>
'Ticket',
226 'members' =>
"Members",
227 'customers' =>
"ThirdPartyCustomersStats",
228 'prospects' =>
"ThirdPartyProspectsStats",
229 'suppliers' =>
"Suppliers",
230 'contacts' =>
"Contacts",
231 'products' =>
"Products",
232 'services' =>
"Services",
233 'proposals' =>
"CommercialProposalsShort",
234 'orders' =>
"CustomersOrders",
235 'invoices' =>
"BillsCustomers",
236 'donations' =>
"Donations",
237 'contracts' =>
"Contracts",
238 'interventions' =>
"Interventions",
239 'supplier_orders' =>
"SuppliersOrders",
240 'supplier_invoices' =>
"SuppliersInvoices",
241 'supplier_proposals' =>
"SupplierProposalShort",
242 'projects' =>
"Projects",
243 'expensereports' =>
"ExpenseReports",
244 'holidays' =>
"Holidays",
245 'ticket' =>
"Ticket",
249 'users' => DOL_URL_ROOT.
'/user/list.php',
250 'members' => DOL_URL_ROOT.
'/adherents/list.php?statut=1&mainmenu=members',
251 'customers' => DOL_URL_ROOT.
'/societe/list.php?type=c&mainmenu=companies',
252 'prospects' => DOL_URL_ROOT.
'/societe/list.php?type=p&mainmenu=companies',
253 'suppliers' => DOL_URL_ROOT.
'/societe/list.php?type=f&mainmenu=companies',
254 'contacts' => DOL_URL_ROOT.
'/contact/list.php?mainmenu=companies',
255 'products' => DOL_URL_ROOT.
'/product/list.php?type=0&mainmenu=products',
256 'services' => DOL_URL_ROOT.
'/product/list.php?type=1&mainmenu=products',
257 'proposals' => DOL_URL_ROOT.
'/comm/propal/list.php?mainmenu=commercial&leftmenu=propals',
258 'orders' => DOL_URL_ROOT.
'/commande/list.php?mainmenu=commercial&leftmenu=orders',
259 'invoices' => DOL_URL_ROOT.
'/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills',
260 'donations' => DOL_URL_ROOT.
'/don/list.php?leftmenu=donations',
261 'contracts' => DOL_URL_ROOT.
'/contrat/list.php?mainmenu=commercial&leftmenu=contracts',
262 'interventions' => DOL_URL_ROOT.
'/fichinter/list.php?mainmenu=commercial&leftmenu=ficheinter',
263 'supplier_orders' => DOL_URL_ROOT.
'/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers',
264 'supplier_invoices' => DOL_URL_ROOT.
'/fourn/facture/list.php?mainmenu=billing&leftmenu=suppliers_bills',
265 'supplier_proposals' => DOL_URL_ROOT.
'/supplier_proposal/list.php?mainmenu=commercial&leftmenu=',
266 'projects' => DOL_URL_ROOT.
'/projet/list.php?mainmenu=project',
267 'expensereports' => DOL_URL_ROOT.
'/expensereport/list.php?mainmenu=hrm&leftmenu=expensereport',
268 'holidays' => DOL_URL_ROOT.
'/holiday/list.php?mainmenu=hrm&leftmenu=holiday',
269 'ticket' => DOL_URL_ROOT.
'/ticket/list.php?leftmenu=ticket'
273 'customers' =>
"companies",
274 'contacts' =>
"companies",
275 'services' =>
"products",
276 'proposals' =>
"propal",
277 'invoices' =>
"bills",
278 'supplier_orders' =>
"orders",
279 'supplier_invoices' =>
"bills",
280 'supplier_proposals' =>
'supplier_proposal',
281 'expensereports' =>
"trips",
282 'holidays' =>
"holiday",
287 $boardloaded = array();
288 foreach ($keys as $val)
290 if ($conditions[$val])
293 $class = $classes[$val];
295 $classkeyforcache = $class;
296 if ($classkeyforcache ==
'ProductService') $classkeyforcache =
'Product';
298 if (!isset($boardloaded[$classkeyforcache]) || !is_object($boardloaded[$classkeyforcache]))
300 include_once $includes[$val];
302 $board =
new $class($db);
303 $board->load_state_board();
304 $boardloaded[$class] = $board;
306 $board = $boardloaded[$classkeyforcache];
309 $langs->load(empty($langfile[$val]) ? $val : $langfile[$val]);
311 $text = $langs->trans($titres[$val]);
312 $boxstatItem .=
'<a href="'.$links[$val].
'" class="boxstatsindicator thumbstat nobold nounderline">';
313 $boxstatItem .=
'<div class="boxstats">';
314 $boxstatItem .=
'<span class="boxstatstext" title="'.dol_escape_htmltag($text).
'">'.$text.
'</span><br>';
315 $boxstatItem .=
'<span class="boxstatsindicator">'.img_object(
"", $board->picto,
'class="inline-block"').
' '.($board->nb[$val] ? $board->nb[$val] : 0).
'</span>';
316 $boxstatItem .=
'</div>';
317 $boxstatItem .=
'</a>';
319 $boxstatItems[$val] = $boxstatItem;
330 if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
331 $showweather = (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO == 2) ? 1 : 0;
334 $dashboardlines = array();
337 require_once DOL_DOCUMENT_ROOT.
'/core/class/workboardresponse.class.php';
340 if (!empty($conf->agenda->enabled) && $user->rights->agenda->myactions->read) {
341 include_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
343 $dashboardlines[$board->element] = $board->load_board($user);
347 if (!empty($conf->projet->enabled) && $user->rights->projet->lire) {
348 include_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
350 $dashboardlines[$board->element] = $board->load_board($user);
354 if (!empty($conf->projet->enabled) && empty($conf->global->PROJECT_HIDE_TASKS) && $user->rights->projet->lire) {
355 include_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
356 $board =
new Task($db);
357 $dashboardlines[$board->element] = $board->load_board($user);
361 if (!empty($conf->propal->enabled) && $user->rights->propale->lire) {
362 include_once DOL_DOCUMENT_ROOT.
'/comm/propal/class/propal.class.php';
364 $dashboardlines[$board->element.
'_opened'] = $board->load_board($user,
"opened");
366 $dashboardlines[$board->element.
'_signed'] = $board->load_board($user,
"signed");
370 if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) {
371 include_once DOL_DOCUMENT_ROOT.
'/supplier_proposal/class/supplier_proposal.class.php';
373 $dashboardlines[$board->element.
'_opened'] = $board->load_board($user,
"opened");
375 $dashboardlines[$board->element.
'_signed'] = $board->load_board($user,
"signed");
379 if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
380 include_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
382 $dashboardlines[$board->element] = $board->load_board($user);
386 if (!empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire) {
387 include_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.commande.class.php';
389 $dashboardlines[$board->element.
'_opened'] = $board->load_board($user,
"opened");
390 $dashboardlines[$board->element.
'_awaiting'] = $board->load_board($user,
'awaiting');
394 if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
395 include_once DOL_DOCUMENT_ROOT.
'/contrat/class/contrat.class.php';
397 $dashboardlines[$board->element.
'_inactive'] = $board->load_board($user,
"inactive");
399 $dashboardlines[$board->element.
'_active'] = $board->load_board($user,
"active");
403 if (!empty($conf->ticket->enabled) && $user->rights->ticket->read) {
404 include_once DOL_DOCUMENT_ROOT.
'/ticket/class/ticket.class.php';
406 $dashboardlines[$board->element.
'_opened'] = $board->load_board($user,
"opened");
412 if (!empty($conf->facture->enabled) && $user->rights->facture->lire) {
413 include_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
415 $dashboardlines[$board->element] = $board->load_board($user);
419 if (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->fournisseur->facture->lire)) {
420 include_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
422 $dashboardlines[$board->element] = $board->load_board($user);
426 if (!empty($conf->banque->enabled) && $user->rights->banque->lire && !$user->socid) {
427 include_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
429 $nb = $board->countAccountToReconcile();
431 $dashboardlines[$board->element] = $board->load_board($user);
436 if (!empty($conf->banque->enabled) && $user->rights->banque->lire && !$user->socid && empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT)) {
437 include_once DOL_DOCUMENT_ROOT.
'/compta/paiement/cheque/class/remisecheque.class.php';
439 $dashboardlines[$board->element] = $board->load_board($user);
443 if (!empty($conf->adherent->enabled) && $user->rights->adherent->lire && !$user->socid) {
444 include_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
446 $dashboardlines[$board->element.
'_shift'] = $board->load_board($user,
'shift');
447 $dashboardlines[$board->element.
'_expired'] = $board->load_board($user,
'expired');
451 if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->approve) {
452 include_once DOL_DOCUMENT_ROOT.
'/expensereport/class/expensereport.class.php';
454 $dashboardlines[$board->element.
'_toapprove'] = $board->load_board($user,
'toapprove');
458 if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->to_paid) {
459 include_once DOL_DOCUMENT_ROOT.
'/expensereport/class/expensereport.class.php';
461 $dashboardlines[$board->element.
'_topay'] = $board->load_board($user,
'topay');
465 if (!empty($conf->holiday->enabled) && $user->rights->holiday->approve) {
466 include_once DOL_DOCUMENT_ROOT.
'/holiday/class/holiday.class.php';
468 $dashboardlines[$board->element] = $board->load_board($user);
471 $object =
new stdClass();
472 $parameters = array();
474 $reshook = $hookmanager->executeHooks(
'addOpenElementsDashboardLine', $parameters, $object,
477 $dashboardlines = array_merge($dashboardlines, $hookmanager->resArray);
481 $dashboardgroup = array(
484 'groupName' =>
'Agenda',
485 'stats' => array(
'action'),
489 'groupName' =>
'Projects',
490 'globalStatsKey' =>
'projects',
491 'stats' => array(
'project',
'project_task'),
495 'groupName' =>
'Proposals',
496 'globalStatsKey' =>
'proposals',
498 array(
'propal_opened',
'propal_signed'),
502 'groupName' =>
'Orders',
503 'globalStatsKey' =>
'orders',
509 'groupName' =>
'Invoices',
510 'globalStatsKey' =>
'invoices',
514 'supplier_proposal' =>
516 'groupName' =>
'SupplierProposals',
517 'globalStatsKey' =>
'askprice',
519 array(
'supplier_proposal_opened',
'supplier_proposal_signed'),
523 'groupName' =>
'SuppliersOrders',
524 'globalStatsKey' =>
'supplier_orders',
526 array(
'order_supplier_opened',
'order_supplier_awaiting'),
528 'invoice_supplier' =>
530 'groupName' =>
'BillsSuppliers',
531 'globalStatsKey' =>
'supplier_invoices',
533 array(
'invoice_supplier'),
537 'groupName' =>
'Contracts',
538 'globalStatsKey' =>
'Contracts',
540 array(
'contrat_inactive',
'contrat_active'),
544 'groupName' =>
'Tickets',
545 'globalStatsKey' =>
'ticket',
547 array(
'ticket_opened'),
551 'groupName' =>
'BankAccount',
553 array(
'bank_account',
'chequereceipt'),
557 'groupName' =>
'Members',
558 'globalStatsKey' =>
'members',
560 array(
'member_shift',
'member_expired'),
564 'groupName' =>
'ExpenseReport',
565 'globalStatsKey' =>
'expensereports',
567 array(
'expensereport_toapprove',
'expensereport_topay'),
571 'groupName' =>
'Holidays',
572 'globalStatsKey' =>
'holidays',
578 $object =
new stdClass();
580 'dashboardgroup' => $dashboardgroup
582 $reshook = $hookmanager->executeHooks(
'addOpenElementsDashboardGroup', $parameters, $object, $action);
584 $dashboardgroup = array_merge($dashboardgroup, $hookmanager->resArray);
589 $totallate = $totaltodo = 0;
593 $valid_dashboardlines = array();
594 foreach ($dashboardlines as $workboardid => $tmp) {
596 $tmp->id = $workboardid;
597 $valid_dashboardlines[$workboardid] = $tmp;
602 foreach ($valid_dashboardlines as $board) {
603 if ($board->nbtodolate > 0) {
604 $totaltodo += $board->nbtodo;
605 $totallate += $board->nbtodolate;
609 $openedDashBoardSize =
'info-box-sm';
610 foreach ($dashboardgroup as $dashbordelement) {
611 if (is_array($dashbordelement[
'stats']) && count($dashbordelement[
'stats']) > 2) {
612 $openedDashBoardSize =
'';
617 $totalLateNumber = $totallate;
618 $totallatePercentage = ((!empty($totaltodo)) ? round($totallate / $totaltodo * 100, 2) : 0);
619 if (!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) {
620 $totallate = $totallatePercentage;
624 $boxwork .=
'<div class="box">';
625 $boxwork .=
'<table summary="'.dol_escape_htmltag($langs->trans(
"WorkingBoard")).
'" class="noborder boxtable boxtablenobottom boxworkingboard" width="100%">'.
"\n";
626 $boxwork .=
'<tr class="liste_titre">';
627 $boxwork .=
'<th class="liste_titre"><div class="inline-block valignmiddle">'.$langs->trans(
"DolibarrWorkBoard").
'</div>';
629 if ($totallate > 0) {
630 $text = $langs->transnoentitiesnoconv(
"WarningYouHaveAtLeastOneTaskLate").
' ('.$langs->transnoentitiesnoconv(
"NActionsLate",
631 $totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ?
'%' :
'')).
')';
633 $text = $langs->transnoentitiesnoconv(
"NoItemLate");
635 $text .=
'. '.$langs->transnoentitiesnoconv(
"LateDesc");
637 $options =
'height="24px" style="float: right"';
638 $boxwork .=
showWeather($totallate, $text, $options,
'inline-block valignmiddle');
641 $boxwork .=
'</tr>'.
"\n";
644 $nbworkboardempty = 0;
645 $isIntopOpenedDashBoard = $globalStatInTopOpenedDashBoard = array();
646 if (!empty($valid_dashboardlines)) {
647 $openedDashBoard =
'';
649 $boxwork .=
'<tr class="nobottom nohover"><td class="tdboxstats nohover flexcontainer centpercent"><div style="display: flex: flex-wrap: wrap">';
651 foreach ($dashboardgroup as $groupKey => $groupElement) {
653 if (empty($conf->global->MAIN_DISABLE_NEW_OPENED_DASH_BOARD)) {
654 foreach ($groupElement[
'stats'] as $infoKey) {
655 if (!empty($valid_dashboardlines[$infoKey])) {
656 $boards[] = $valid_dashboardlines[$infoKey];
657 $isIntopOpenedDashBoard[] = $infoKey;
662 if (!empty($boards)) {
663 $groupName = $langs->trans($groupElement[
'groupName']);
664 $groupKeyLowerCase = strtolower($groupKey);
665 $nbTotalForGroup = 0;
668 $globalStatsKey =
false;
669 if (!empty($groupElement[
'globalStatsKey']) && empty($groupElement[
'globalStats'])) {
670 $globalStatsKey = $groupElement[
'globalStatsKey'];
671 $groupElement[
'globalStats'] = array();
673 if (is_array($keys) && in_array($globalStatsKey, $keys))
676 $keyIndex = array_search($globalStatsKey, $keys);
678 $classe = $classes[$keyIndex];
679 if (isset($boardloaded[$classe]) && is_object($boardloaded[$classe]))
681 $groupElement[
'globalStats'][
'total'] = $boardloaded[$classe]->nb[$globalStatsKey] ? $boardloaded[$classe]->nb[$globalStatsKey] : 0;
682 $nbTotal = doubleval($groupElement[
'globalStats'][
'total']);
683 if ($nbTotal >= 10000) { $nbTotal = round($nbTotal / 1000, 2).
'k'; }
684 $groupElement[
'globalStats'][
'text'] = $langs->trans(
'Total').
' : '.$langs->trans($titres[$keyIndex]).
' ('.$groupElement[
'globalStats'][
'total'].
')';
685 $groupElement[
'globalStats'][
'total'] = $nbTotal;
686 $groupElement[
'globalStats'][
'link'] = $links[$keyIndex];
691 $openedDashBoard .=
'<div class="box-flex-item"><div class="box-flex-item-with-margin">'.
"\n";
692 $openedDashBoard .=
' <div class="info-box '.$openedDashBoardSize.
'">'.
"\n";
693 $openedDashBoard .=
' <span class="info-box-icon bg-infobox-'.$groupKeyLowerCase.
'">'.
"\n";
694 $openedDashBoard .=
' <i class="fa fa-dol-'.$groupKeyLowerCase.
'"></i>'.
"\n";
697 if (!empty($groupElement[
'globalStats'])) {
698 $globalStatInTopOpenedDashBoard[] = $globalStatsKey;
699 $openedDashBoard .=
'<span class="info-box-icon-text" title="'.$groupElement[
'globalStats'][
'text'].
'">'.$nbTotal.
'</span>';
702 $openedDashBoard .=
'</span>'.
"\n";
703 $openedDashBoard .=
'<div class="info-box-content">'.
"\n";
705 $openedDashBoard .=
'<div class="info-box-title" title="'.strip_tags($groupName).
'">'.$groupName.
'</div>'.
"\n";
706 $openedDashBoard .=
'<div class="info-box-lines">'.
"\n";
708 foreach ($boards as $board) {
709 $openedDashBoard .=
'<div class="info-box-line">';
711 if (!empty($board->labelShort)) {
712 $infoName =
'<span title="'.$board->label.
'">'.$board->labelShort.
'</span>';
714 $infoName = $board->label;
717 $textLateTitle = $langs->trans(
"NActionsLate", $board->nbtodolate);
718 $textLateTitle .=
' ('.$langs->trans(
"Late").
' = '.$langs->trans(
"DateReference").
' > '.$langs->trans(
"DateToday").
' '.(ceil($board->warning_delay) >= 0 ?
'+' :
'').ceil($board->warning_delay).
' '.$langs->trans(
"days").
')';
720 if ($board->id ==
'bank_account') {
721 $textLateTitle .=
'<br><span class="opacitymedium">'.$langs->trans(
"IfYouDontReconcileDisableProperty", $langs->transnoentitiesnoconv(
"Conciliable")).
'</span>';
725 if ($board->nbtodolate > 0) {
726 $textLate .=
'<span title="'.dol_escape_htmltag($textLateTitle).
'" class="classfortooltip badge badge-warning">';
727 $textLate .=
'<i class="fa fa-exclamation-triangle"></i> '.$board->nbtodolate;
728 $textLate .=
'</span>';
732 if ($board->nbtodo > 0) {
733 $nbtodClass =
'badge badge-info';
736 $openedDashBoard .=
' <a href="'.$board->url.
'" class="info-box-text info-box-text-a">'.$infoName.
' : <span class="'.$nbtodClass.
' classfortooltip" title="'.$board->label.
'" >'.$board->nbtodo.
'</span>';
738 if ($board->url_late) {
739 $openedDashBoard .=
'</a>';
740 $openedDashBoard .=
' <a href="'.$board->url_late.
'" class="info-box-text info-box-text-a paddingleft">';
742 $openedDashBoard .=
' ';
744 $openedDashBoard .= $textLate;
746 $openedDashBoard .=
'</a>'.
"\n";
748 if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) {
749 $openedDashBoard .=
'<a href="'.$board->url.
'" class="info-box-text">'.$langs->trans(
'Total').
' : '.
price($board->total).
'</a>';
751 $openedDashBoard .=
'</div>'.
"\n";
756 $openedDashBoard .=
' </div><!-- /.info-box-lines --></div><!-- /.info-box-content -->'.
"\n";
757 $openedDashBoard .=
' </div><!-- /.info-box -->'.
"\n";
758 $openedDashBoard .=
'</div><!-- /.box-flex-item-with-margin -->'.
"\n";
759 $openedDashBoard .=
'</div><!-- /.box-flex-item -->'.
"\n";
760 $openedDashBoard .=
"\n";
764 if ($showweather && !empty($isIntopOpenedDashBoard)) {
765 $appendClass = $conf->global->MAIN_DISABLE_METEO == 2 ?
' hideonsmartphone' :
'';
769 if ($totallate > 0) {
770 $text = $langs->transnoentitiesnoconv(
"WarningYouHaveAtLeastOneTaskLate").
' ('.$langs->transnoentitiesnoconv(
"NActionsLate",
771 $totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ?
'%' :
'')).
')';
773 $text = $langs->transnoentitiesnoconv(
"NoItemLate");
775 $text .=
'. '.$langs->transnoentitiesnoconv(
"LateDesc");
777 $weatherDashBoard =
'<div class="box-flex-item '.$appendClass.
'"><div class="box-flex-item-with-margin">'.
"\n";
778 $weatherDashBoard .=
' <div class="info-box '.$openedDashBoardSize.
' info-box-weather info-box-weather-level'.$weather->level.
'">'.
"\n";
779 $weatherDashBoard .=
' <span class="info-box-icon">';
780 $weatherDashBoard .=
img_weather(
'', $weather->level,
'', 0,
'valignmiddle width50');
781 $weatherDashBoard .=
' </span>'.
"\n";
782 $weatherDashBoard .=
' <div class="info-box-content">'.
"\n";
783 $weatherDashBoard .=
' <div class="info-box-title">'.$langs->trans(
'GlobalOpenedElemView').
'</div>'.
"\n";
785 if ($totallatePercentage > 0 && !empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) {
786 $weatherDashBoard .=
' <span class="info-box-number">'.$langs->transnoentitiesnoconv(
"NActionsLate",
787 price($totallatePercentage).
'%').
'</span>'.
"\n";
788 $weatherDashBoard .=
' <span class="progress-description">'.$langs->trans(
'NActionsLate',
789 $totalLateNumber).
'</span>'.
"\n";
791 $weatherDashBoard .=
' <span class="info-box-number">'.$langs->transnoentitiesnoconv(
"NActionsLate",
792 $totalLateNumber).
'</span>'.
"\n";
793 if ($totallatePercentage > 0) {
794 $weatherDashBoard .=
' <span class="progress-description">'.$langs->trans(
'NActionsLate',
795 price($totallatePercentage).
'%').
'</span>'.
"\n";
799 $weatherDashBoard .=
' </div><!-- /.info-box-content -->'.
"\n";
800 $weatherDashBoard .=
' </div><!-- /.info-box -->'.
"\n";
801 $weatherDashBoard .=
'</div><!-- /.box-flex-item-with-margin -->'.
"\n";
802 $weatherDashBoard .=
'</div><!-- /.box-flex-item -->'.
"\n";
803 $weatherDashBoard .=
"\n";
805 $openedDashBoard = $weatherDashBoard.$openedDashBoard;
808 if (!empty($isIntopOpenedDashBoard)) {
809 for ($i = 1; $i <= 10; $i++) {
810 $openedDashBoard .=
'<div class="box-flex-item filler"></div>';
814 $nbworkboardcount = 0;
815 foreach ($valid_dashboardlines as $infoKey => $board) {
816 if (in_array($infoKey, $isIntopOpenedDashBoard)) {
821 if (empty($board->nbtodo)) {
827 $textlate = $langs->trans(
"NActionsLate", $board->nbtodolate);
828 $textlate .=
' ('.$langs->trans(
"Late").
' = '.$langs->trans(
"DateReference").
' > '.$langs->trans(
"DateToday").
' '.(ceil($board->warning_delay) >= 0 ?
'+' :
'').ceil($board->warning_delay).
' '.$langs->trans(
"days").
')';
831 $boxwork .=
'<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats130 boxstatsborder">';
832 $boxwork .=
'<div class="boxstatscontent">';
833 $boxwork .=
'<span class="boxstatstext" title="'.dol_escape_htmltag($board->label).
'">'.$board->img.
' <span>'.$board->label.
'</span></span><br>';
834 $boxwork .=
'<a class="valignmiddle dashboardlineindicator" href="'.$board->url.
'"><span class="dashboardlineindicator'.(($board->nbtodo == 0) ?
' dashboardlineok' :
'').
'">'.$board->nbtodo.
'</span></a>';
835 if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) {
836 $boxwork .=
' / <a class="valignmiddle dashboardlineindicator" href="'.$board->url.
'"><span class="dashboardlineindicator'.(($board->nbtodo == 0) ?
' dashboardlineok' :
'').
'">'.
price($board->total).
'</span></a>';
838 $boxwork .=
'</div>';
839 if ($board->nbtodolate > 0) {
840 $boxwork .=
'<div class="dashboardlinelatecoin nowrap">';
841 $boxwork .=
'<a title="'.dol_escape_htmltag($textlate).
'" class="valignmiddle dashboardlineindicatorlate'.($board->nbtodolate > 0 ?
' dashboardlineko' :
' dashboardlineok').
'" href="'.((!$board->url_late) ? $board->url : $board->url_late).
'">';
843 $boxwork .=
img_picto($textlate,
"warning_white",
844 'class="inline-block hideonsmartphone valigntextbottom"').
'';
845 $boxwork .=
'<span class="dashboardlineindicatorlate'.($board->nbtodolate > 0 ?
' dashboardlineko' :
' dashboardlineok').
'">';
846 $boxwork .= $board->nbtodolate;
847 $boxwork .=
'</span>';
849 $boxwork .=
'</div>';
851 $boxwork .=
'</div></div>';
855 $boxwork .=
'<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
856 $boxwork .=
'<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
857 $boxwork .=
'<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
858 $boxwork .=
'<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
860 $boxwork .=
'</div>';
861 $boxwork .=
'</td></tr>';
863 $boxwork .=
'<tr class="nohover">';
864 $boxwork .=
'<td class="nohover valignmiddle opacitymedium">';
865 $boxwork .= $langs->trans(
"NoOpenedElementToProcess");
870 $boxwork .=
'</td></tr>';
872 $boxwork .=
'</table>';
873 $boxwork .=
'</div>';
875 if (!empty($isIntopOpenedDashBoard)) {
876 print '<div class="fichecenter">';
877 print '<div class="opened-dash-board-wrap"><div class="box-flex-container">'.$openedDashBoard.
'</div></div>';
883 print '<div class="clearboth"></div>';
885 print '<div class="fichecenter fichecenterbis">';
892 $boxlist .=
'<div class="twocolumns">';
894 $boxlist .=
'<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
895 if (!empty($nbworkboardcount))
897 $boxlist .= $boxwork;
900 $boxlist .= $resultboxes[
'boxlista'];
902 $boxlist .=
'</div>';
905 if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
908 if (!empty($conf->global->MAIN_INCLUDE_GLOBAL_STATS_IN_OPENED_DASHBOARD) && is_array($boxstatItems) && count($boxstatItems) > 0) {
909 foreach ($boxstatItems as $boxstatItemKey => $boxstatItemHtml) {
910 if (in_array($boxstatItemKey, $globalStatInTopOpenedDashBoard)) {
911 unset($boxstatItems[$boxstatItemKey]);
916 if (!empty($boxstatFromHook) || !empty($boxstatItems)) {
917 $boxstat .=
'<!-- Database statistics -->'.
"\n";
918 $boxstat .=
'<div class="box">';
919 $boxstat .=
'<table summary="'.dol_escape_htmltag($langs->trans(
"DolibarrStateBoard")).
'" class="noborder boxtable boxtablenobottom nohover widgetstats" width="100%">';
920 $boxstat .=
'<tr class="liste_titre box_titre">';
922 $boxstat .=
'<div class="inline-block valignmiddle">'.$langs->trans(
"DolibarrStateBoard").
'</div>';
925 $boxstat .=
'<tr class="nobottom nohover"><td class="tdboxstats nohover flexcontainer">';
927 $boxstat .= $boxstatFromHook;
929 if (is_array($boxstatItems) && count($boxstatItems) > 0)
931 $boxstat .= implode(
'', $boxstatItems);
934 $boxstat .=
'<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
935 $boxstat .=
'<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
936 $boxstat .=
'<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
937 $boxstat .=
'<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
938 $boxstat .=
'<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
939 $boxstat .=
'<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
940 $boxstat .=
'<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
941 $boxstat .=
'<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
943 $boxstat .=
'</td></tr>';
944 $boxstat .=
'</table>';
945 $boxstat .=
'</div>';
949 $boxlist .=
'<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
951 $boxlist .= $boxstat;
952 $boxlist .= $resultboxes[
'boxlistb'];
954 $boxlist .=
'</div>';
957 $boxlist .=
'</div>';
970 if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING))
975 $lockfile = DOL_DATA_ROOT.
'/install.lock';
976 if (!empty($lockfile) && !file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT.
"/install"))
978 $langs->load(
"errors");
980 $message .=
info_admin($langs->trans(
"WarningLockFileDoesNotExists", DOL_DATA_ROOT).
' '.$langs->trans(
"WarningUntilDirRemoved", DOL_DOCUMENT_ROOT.
"/install"), 0, 0,
'1',
'clearboth');
984 if (is_writable($conffile))
986 $langs->load(
"errors");
989 $message .=
info_admin($langs->transnoentities(
"WarningConfFileMustBeReadOnly").
' '.$langs->trans(
"WarningUntilDirRemoved", DOL_DOCUMENT_ROOT.
"/install"), 0, 0,
'1',
'clearboth');
1022 return img_weather($text, $weather->picto, $options, 0, $morecss);
1037 $weather =
new stdClass();
1038 $weather->picto =
'';
1043 $used_conf = !empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ?
'MAIN_METEO_PERCENTAGE_LEVEL' :
'MAIN_METEO_LEVEL';
1046 $weather->level = 0;
1047 if (!empty($conf->global->{$used_conf.
'0'})) {
1048 $level0 = $conf->global->{$used_conf.
'0'};
1050 $level1 = $offset + 1 * $factor;
1051 if (!empty($conf->global->{$used_conf.
'1'})) {
1052 $level1 = $conf->global->{$used_conf.
'1'};
1054 $level2 = $offset + 2 * $factor;
1055 if (!empty($conf->global->{$used_conf.
'2'})) {
1056 $level2 = $conf->global->{$used_conf.
'2'};
1058 $level3 = $offset + 3 * $factor;
1059 if (!empty($conf->global->{$used_conf.
'3'})) {
1060 $level3 = $conf->global->{$used_conf.
'3'};
1063 if ($totallate <= $level0) {
1064 $weather->picto =
'weather-clear.png';
1065 $weather->level = 0;
1067 elseif ($totallate <= $level1) {
1068 $weather->picto =
'weather-few-clouds.png';
1069 $weather->level = 1;
1071 elseif ($totallate <= $level2) {
1072 $weather->picto =
'weather-clouds.png';
1073 $weather->level = 2;
1075 elseif ($totallate <= $level3) {
1076 $weather->picto =
'weather-many-clouds.png';
1077 $weather->level = 3;
1080 $weather->picto =
'weather-storm.png';
1081 $weather->level = 4;
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class of the module paid holiday.
Class to manage agenda events (actions)
showWeather($totallate, $text, $options, $morecss= '')
Show weather logo.
img_weather($titlealt, $picto, $moreatt= '', $pictoisfullpath=0, $morecss= '')
Show weather picto.
Class to manage contracts.
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom= 'UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
Class to manage suppliers invoices.
Class to manage bank accounts.
price($amount, $form=0, $outlangs= '', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code= '')
Function to format a value into an amount for visual output Function used into PDF and HTML pages...
static saveboxorder($db, $zone, $boxorder, $userid=0)
Save order of boxes for area and user.
getWeatherStatus($totallate)
get weather level $conf->global->MAIN_METEO_LEVELx
getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $object=null)
Return array of possible common substitutions.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
Class to manage projects.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Class to manage customers orders.
Class to manage members of a foundation.
Class to manage Trips and Expenses.
Class to manage predefined suppliers products.
print
Draft customers invoices.
Class to manage price ask supplier.
make_substitutions($text, $substitutionarray, $outputlangs=null)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
Class to manage invoices.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin= '1', $morecss= '', $textfordropdown= '')
Show information for admin users or standard users.
Class to manage cheque delivery receipts.
Class to manage proposals.
complete_substitutions_array(&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray")
Complete the $substitutionarray with more entries coming from external module that had set the "subst...