dolibarr 24.0.0-beta
index.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
6 * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
7 * Copyright (C) 2021-2025 Frédéric France <frederic.france@free.fr>
8 * Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
9 * Copyright (C) 2024-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <https://www.gnu.org/licenses/>.
23 */
24
31define('CSRFCHECK_WITH_TOKEN', 1); // We force need to use a token to login when making a POST
32
33require 'main.inc.php';
44require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
45
46// If not defined, we select menu "home"
47$_GET['mainmenu'] = GETPOST('mainmenu', 'aZ09') ? GETPOST('mainmenu', 'aZ09') : 'home'; // Keep this ?
48$action = GETPOST('action', 'aZ09');
49
50$hookmanager->initHooks(array('index'));
51
52require_once DOL_DOCUMENT_ROOT.'/core/redirect_if_setup_not_complete.inc.php';
53
54
55/*
56 * Actions
57 */
58
59if (GETPOST('addbox')) { // Add box (when submit is done from a form when ajax disabled)
60 require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
61 $zone = GETPOSTINT('areacode');
62 $userid = GETPOSTINT('userid');
63 $boxorder = GETPOST('boxorder', 'aZ09');
64 $boxorder .= GETPOST('boxcombo', 'aZ09');
65
66 $result = InfoBox::saveboxorder($db, $zone, $boxorder, $userid);
67 if ($result > 0) {
68 setEventMessages($langs->trans("BoxAdded"), null);
69 }
70}
71
72
73/*
74 * View
75 */
76
77if (!isset($form) || !is_object($form)) {
78 $form = new Form($db);
79}
80
81$appli = constant('DOL_APPLICATION_TITLE');
82$applicustom = getDolGlobalString('MAIN_APPLICATION_TITLE');
83if ($applicustom) {
84 $appli = (preg_match('/^\+/', $applicustom) ? $appli : '').$applicustom;
85} else {
86 $appli .= " ".DOL_VERSION;
87}
88
89// Title
90$title = $langs->trans("HomeArea").' - '.$appli;
91
92llxHeader('', $title);
93
94$boxwork = ''; // Ensure this is initialised
95
96$resultboxes = FormOther::getBoxesArea($user, "0"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb)
97
98
99// Show the user message of the day (MOTD)
100if (getDolGlobalString('MAIN_MOTD')) {
101 $motd = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>/i', '<br>', getDolGlobalString('MAIN_MOTD'));
102
103 $substitutionarray = getCommonSubstitutionArray($langs);
104 complete_substitutions_array($substitutionarray, $langs);
105 $texttoshow = make_substitutions($motd, $substitutionarray, $langs);
106
107 print "\n<!-- Start of welcome text -->\n";
108 print '<table class="centpercent notopnoleftnoright"><tr><td>';
109 print dol_htmlentitiesbr($texttoshow);
110 print '</td></tr></table><br>';
111 print "\n<!-- End of welcome text -->\n";
112}
113
114/*
115 * Show specific warnings
116 */
117
118// Specific warning for legal announcement
119if (getDolGlobalString('MAIN_FORCE_SYSTEM_MESSAGE')) {
120 $langs->loadLangs(array("other"));
121 $messagetoshow = $langs->trans(getDolGlobalString('MAIN_FORCE_SYSTEM_MESSAGE'));
122 $messagetoshow = info_admin($messagetoshow, 0, 0, 'warning', 'clearboth');
123
124 $tmpobject = new stdClass();
125 $parameters = array('type' => 'MAIN_FORCE_SYSTEM_MESSAGE');
126 $reshook = $hookmanager->executeHooks('messageOfTheDay', $parameters, $tmpobject, $action); // Note that $action and $object may have been modified by some hooks
127 if ($reshook == 0) {
128 $messagetoshow .= $hookmanager->resPrint;
129 }
130 if ($messagetoshow) { // $message is an HTML string.
131 print '<!-- show system message -->';
132 print dol_string_onlythesehtmltags($messagetoshow, 1, 0, 0, 0, array('a', 'div', 'span', 'b'));
133 }
134}
135
136// Specific warning to recommend upgrade
137if (getDolGlobalString('MAIN_FORCE_UPGRADE_MESSAGE') || getDolGlobalString('MAIN_FORCE_UPGRADE_URL')) {
138 $langs->loadLangs(array("other"));
139 if (is_numeric(getDolGlobalString('MAIN_FORCE_UPGRADE_MESSAGE'))) {
140 $messagetoshow = $langs->trans("YourInstallIsOldThanksToUpgrade");
141 } else {
142 $messagetoshow = $langs->trans(getDolGlobalString('MAIN_FORCE_UPGRADE_MESSAGE', "YourInstallIsOldThanksToUpgrade"));
143 }
144 if (getDolGlobalString('MAIN_FORCE_UPGRADE_URL')) {
145 $messagetoshow .= '<br><a href="'.getDolGlobalString('MAIN_FORCE_UPGRADE_URL').'" target="_blank">'.getDolGlobalString('MAIN_FORCE_UPGRADE_URL').'</a>';
146 }
147 $messagetoshow = info_admin($messagetoshow, 0, 0, 'warning', 'clearboth');
148 print dol_string_onlythesehtmltags($messagetoshow, 1, 0, 0, 0, array('div', 'span', 'b'));
149}
150
151// Specific warning to propose to upgrade invoice situation to progressive mode
152/*
153if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1) {
154 $langs->loadLangs(array("admin"));
155 print info_admin($langs->trans("WarningExperimentalFeatureInvoiceSituationNeedToUpgradeToProgressiveMode", 'https://partners.dolibarr.org'));
156 //print "<br>";
157}
158*/
159
160
161/*
162 * Show security warnings
163 */
164
165// Security warning if install.lock file is missing or if conf file is writable
166if (!getDolGlobalString('MAIN_REMOVE_INSTALL_WARNING')) {
167 $messagetoshow = '';
168
169 // Check if install lock file is present
170 $lockfile = DOL_DATA_ROOT.'/install.lock';
171 if (!empty($lockfile) && !file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT."/install")) {
172 $langs->load("errors");
173 //if (!empty($message)) $message.='<br>';
174 $messagetoshow .= info_admin($langs->transnoentities("WarningLockFileDoesNotExists", DOL_DATA_ROOT).' '.$langs->transnoentities("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, 'warning', 'clearboth');
175 }
176
177 // Conf files must be in read only mode
178 if (is_writable($conffile)) {
179 // Try to remove automatically write permission
180 $currentPerm = fileperms($conffile);
181 $newPerm = $currentPerm & ~0222;
182 //print $conffile.' '.decoct($currentPerm).' '.(string) decoct($newPerm).' '.substr(decoct($newPerm), -4);
183 dolChmod($conffile, decoct($newPerm));
184
185 // @phpstan-ignore-next-line
186 if (is_writable($conffile)) {
187 $langs->load("errors");
188 $messagetoshow .= info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly").' '.$langs->transnoentities("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, 'warning', 'clearboth');
189 }
190 }
191
192 $tmpobject = new stdClass();
193 $parameters = array('type' => 'MAIN_REMOVE_INSTALL_WARNING');
194 $reshook = $hookmanager->executeHooks('messageOfTheDay', $parameters, $tmpobject, $action); // Note that $action and $object may have been modified by some hooks
195 if ($reshook == 0) {
196 $messagetoshow .= $hookmanager->resPrint;
197 }
198 if ($messagetoshow) { // $message is an HTML string.
199 print '<!-- show security warning -->';
200 print dol_string_onlythesehtmltags($messagetoshow, 1, 0, 0, 0, array('div', 'span', 'b'));
201 }
202}
203
204/*
205 * Dashboard Dolibarr statistics
206 * Hidden for external users
207 */
208
209print load_fiche_titre('&nbsp;', $resultboxes['selectboxlist'], '', 0, '', 'titleforhome');
210
211// Load translation files required by page
212$langs->loadLangs(array('commercial', 'bills', 'orders', 'contracts'));
213
214// Dolibarr Working Board with weather
215if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_WORKBOARD') && getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) {
216 $showweather = (!getDolGlobalString('MAIN_DISABLE_METEO') || getDolGlobalInt('MAIN_DISABLE_METEO') == 2) ? 1 : 0;
217
218 // Array that contains all WorkboardResponse classes to process them
219 $dashboardlines = array();
220
221 // Do not include sections without management permission
222 require_once DOL_DOCUMENT_ROOT.'/core/class/workboardresponse.class.php';
223
224 // Number of actions to do (late)
225 if (isModEnabled('agenda') && !getDolGlobalString('MAIN_DISABLE_BLOCK_AGENDA') && $user->hasRight('agenda', 'myactions', 'read')) {
226 include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
227 $board = new ActionComm($db);
228 $dashboardlines[$board->element] = $board->load_board($user);
229 }
230
231 // Number of project opened
232 if (isModEnabled('project') && !getDolGlobalString('MAIN_DISABLE_BLOCK_PROJECT') && $user->hasRight('projet', 'lire')) {
233 include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
234 $board = new Project($db);
235 $dashboardlines[$board->element] = $board->load_board($user);
236 }
237
238 // Number of tasks to do (late)
239 if (isModEnabled('project') && !getDolGlobalString('MAIN_DISABLE_BLOCK_PROJECT') && !getDolGlobalString('PROJECT_HIDE_TASKS') && $user->hasRight('projet', 'lire')) {
240 include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
241 $board = new Task($db);
242 $dashboardlines[$board->element] = $board->load_board($user);
243 }
244
245 // Number of commercial customer proposals open (expired)
246 if (isModEnabled('propal') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CUSTOMER') && $user->hasRight('propal', 'read')) {
247 include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
248 $board = new Propal($db);
249 $dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened");
250 // Number of commercial proposals CLOSED signed (billed)
251 $dashboardlines[$board->element.'_signed'] = $board->load_board($user, "signed");
252 }
253
254 // Number of supplier proposals open (expired)
255 if (isModEnabled('supplier_proposal') && !getDolGlobalString('MAIN_DISABLE_BLOCK_SUPPLIER') && $user->hasRight('supplier_proposal', 'lire')) {
256 $langs->load("supplier_proposal");
257 include_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
258 $board = new SupplierProposal($db);
259 $dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened");
260 // Number of commercial proposals CLOSED signed (billed)
261 $dashboardlines[$board->element.'_signed'] = $board->load_board($user, "signed");
262 }
263
264 // Number of sales orders
265 if (isModEnabled('order') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CUSTOMER') && $user->hasRight('commande', 'lire')) {
266 include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
267 $board = new Commande($db);
268 // Number of customer orders to be shipped (validated and in progress)
269 $dashboardlines[$board->element.'_toship'] = $board->load_board($user, 'toship');
270 // Number of customer orders to be billed (not visible by default, does not match a lot of organization).
271 if (getDolGlobalInt('ORDER_BILL_AFTER_VALIDATION')) {
272 $dashboardlines[$board->element.'_tobill'] = $board->load_board($user, 'tobill');
273 }
274 // Number of customer orders to be billed (delivered but not billed)
275 $dashboardlines[$board->element.'_shippedtobill'] = $board->load_board($user, 'shippedtobill');
276 }
277
278 // Number of suppliers orders
279 if (isModEnabled('supplier_order') && !getDolGlobalString('MAIN_DISABLE_BLOCK_SUPPLIER') && $user->hasRight('fournisseur', 'commande', 'lire')) {
280 include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
281 $board = new CommandeFournisseur($db);
282 $dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened");
283 $dashboardlines[$board->element.'_awaiting'] = $board->load_board($user, 'awaiting');
284 }
285
286 // Number of contract / services enabled (delayed)
287 if (isModEnabled('contract') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CONTRACT') && $user->hasRight('contrat', 'lire')) {
288 include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
289 $board = new Contrat($db);
290 $dashboardlines[$board->element.'_inactive'] = $board->load_board($user, "inactive");
291 // Number of active services (expired)
292 $dashboardlines[$board->element.'_active'] = $board->load_board($user, "active");
293 }
294
295 // Number of tickets open
296 if (isModEnabled('ticket') && !getDolGlobalString('MAIN_DISABLE_BLOCK_TICKET') && $user->hasRight('ticket', 'read')) {
297 include_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
298 $board = new Ticket($db);
299 $dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened");
300 // Number of active services (expired)
301 //$dashboardlines[$board->element.'_active'] = $board->load_board($user, "active");
302 }
303
304 // Number of invoices customers (paid)
305 if (isModEnabled('invoice') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CUSTOMER') && $user->hasRight('facture', 'lire')) {
306 include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
307 $board = new Facture($db);
308 $dashboardlines[$board->element] = $board->load_board($user);
309 }
310
311 // Number of supplier invoices (paid)
312 if (isModEnabled('supplier_invoice') && !getDolGlobalString('MAIN_DISABLE_BLOCK_SUPPLIER') && $user->hasRight('fournisseur', 'facture', 'lire')) {
313 include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
314 $board = new FactureFournisseur($db);
315 $dashboardlines[$board->element] = $board->load_board($user);
316 }
317
318 // Number of transactions to conciliate
319 if (isModEnabled('bank') && !getDolGlobalString('MAIN_DISABLE_BLOCK_BANK') && $user->hasRight('banque', 'lire') && !$user->socid) {
320 include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
321 $board = new Account($db);
322 $nb = $board->countAccountToReconcile(); // Get nb of account to reconciliate
323 if ($nb > 0) {
324 $dashboardlines[$board->element] = $board->load_board($user);
325 }
326 }
327
328 // Number of cheque to send
329 if (isModEnabled('bank') && !getDolGlobalString('MAIN_DISABLE_BLOCK_BANK') && $user->hasRight('banque', 'lire') && !$user->socid) {
330 if (!getDolGlobalString('BANK_DISABLE_CHECK_DEPOSIT')) {
331 include_once DOL_DOCUMENT_ROOT . '/compta/paiement/cheque/class/remisecheque.class.php';
332 $board = new RemiseCheque($db);
333 $dashboardlines[$board->element] = $board->load_board($user); // board->element is 'withdraw'
334 }
335 if (isModEnabled('prelevement')) {
336 include_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
337 $board = new BonPrelevement($db);
338 $dashboardlines[$board->element . '_direct_debit'] = $board->load_board($user, 'direct-debit');
339 }
340 if (isModEnabled('paymentbybanktransfer')) {
341 include_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
342 $board = new BonPrelevement($db);
343 $dashboardlines[$board->element . '_credit_transfer'] = $board->load_board($user, 'credit-transfer');
344 }
345 }
346
347 // Number of foundation members
348 if (isModEnabled('member') && !getDolGlobalString('MAIN_DISABLE_BLOCK_ADHERENT') && $user->hasRight('adherent', 'lire') && !$user->socid) {
349 include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
350 $board = new Adherent($db);
351 $dashboardlines[$board->element.'_shift'] = $board->load_board($user, 'shift');
352 $dashboardlines[$board->element.'_expired'] = $board->load_board($user, 'expired');
353 }
354
355 // Number of expense reports to approve
356 if (isModEnabled('expensereport') && !getDolGlobalString('MAIN_DISABLE_BLOCK_EXPENSEREPORT') && $user->hasRight('expensereport', 'approve')) {
357 include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
358 $board = new ExpenseReport($db);
359 $dashboardlines[$board->element.'_toapprove'] = $board->load_board($user, 'toapprove');
360 }
361
362 // Number of expense reports to pay
363 if (isModEnabled('expensereport') && !getDolGlobalString('MAIN_DISABLE_BLOCK_EXPENSEREPORT') && $user->hasRight('expensereport', 'to_paid')) {
364 include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
365 $board = new ExpenseReport($db);
366 $dashboardlines[$board->element.'_topay'] = $board->load_board($user, 'topay');
367 }
368
369 // Number of holidays to approve
370 if (isModEnabled('holiday') && !getDolGlobalString('MAIN_DISABLE_BLOCK_HOLIDAY') && $user->hasRight('holiday', 'approve')) {
371 include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
372 $board = new Holiday($db);
373 $dashboardlines[$board->element] = $board->load_board($user);
374 }
375
376 if (isModEnabled('mrp') && !getDolGlobalString('MAIN_DISABLE_BLOCK_MRP')) {
377 include_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
378 $board = new Mo($db);
379 $dashboardlines[$board->element] = $board->load_board($user);
380 }
381
382 $object = new stdClass();
383 $parameters = array();
384 $action = '';
385 $reshook = $hookmanager->executeHooks(
386 'addOpenElementsDashboardLine',
387 $parameters,
388 $object,
389 $action
390 ); // Note that $action and $object may have been modified by some hooks
391 if ($reshook == 0) {
392 $dashboardlines = array_merge($dashboardlines, $hookmanager->resArray);
393 }
394 /* Open object dashboard */
395 $dashboardgroup = array(
396 'action' =>
397 array(
398 'groupName' => 'Agenda',
399 'stats' => array('action'),
400 ),
401 'project' =>
402 array(
403 'groupName' => 'Projects',
404 'globalStatsKey' => 'projects',
405 'stats' => array('project', 'project_task'),
406 ),
407 'propal' =>
408 array(
409 'groupName' => 'Proposals',
410 'globalStatsKey' => 'proposals',
411 'stats' =>
412 array('propal_opened', 'propal_signed'),
413 ),
414 'commande' =>
415 array(
416 'groupName' => 'Orders',
417 'globalStatsKey' => 'orders',
418 'stats' =>
419 array('commande_toship', 'commande_tobill', 'commande_shippedtobill'),
420 ),
421 'facture' =>
422 array(
423 'groupName' => 'Invoices',
424 'globalStatsKey' => 'invoices',
425 'stats' =>
426 array('facture'),
427 ),
428 'supplier_proposal' =>
429 array(
430 'lang' => 'supplier_proposal',
431 'groupName' => 'SupplierProposals',
432 'globalStatsKey' => 'askprice',
433 'stats' =>
434 array('supplier_proposal_opened', 'supplier_proposal_signed'),
435 ),
436 'order_supplier' =>
437 array(
438 'groupName' => 'SuppliersOrders',
439 'globalStatsKey' => 'supplier_orders',
440 'stats' =>
441 array('order_supplier_opened', 'order_supplier_awaiting'),
442 ),
443 'invoice_supplier' =>
444 array(
445 'groupName' => 'BillsSuppliers',
446 'globalStatsKey' => 'supplier_invoices',
447 'stats' =>
448 array('invoice_supplier'),
449 ),
450 'contrat' =>
451 array(
452 'groupName' => 'Contracts',
453 'globalStatsKey' => 'Contracts',
454 'stats' =>
455 array('contrat_inactive', 'contrat_active'),
456 ),
457 'ticket' =>
458 array(
459 'groupName' => 'Tickets',
460 'globalStatsKey' => 'ticket',
461 'stats' =>
462 array('ticket_opened'),
463 ),
464 'bank_account' =>
465 array(
466 'groupName' => 'BankAccount',
467 'stats' =>
468 array('bank_account', 'chequereceipt', 'widthdraw_direct_debit', 'widthdraw_credit_transfer'),
469 ),
470 'member' =>
471 array(
472 'groupName' => 'Members',
473 'globalStatsKey' => 'members',
474 'stats' =>
475 array('member_shift', 'member_expired'),
476 ),
477 'expensereport' =>
478 array(
479 'groupName' => 'ExpenseReport',
480 'globalStatsKey' => 'expensereports',
481 'stats' =>
482 array('expensereport_toapprove', 'expensereport_topay'),
483 ),
484 'holiday' =>
485 array(
486 'groupName' => 'Holidays',
487 'globalStatsKey' => 'holidays',
488 'stats' =>
489 array('holiday'),
490 ),
491 'cubes' =>
492 array(
493 'groupName' => 'Mo',
494 'globalStatsKey' => 'mrp',
495 'stats' =>
496 array('mo'),
497 ),
498 );
499 $object = new stdClass();
500 $parameters = array(
501 'dashboardgroup' => $dashboardgroup
502 );
503 $reshook = $hookmanager->executeHooks('addOpenElementsDashboardGroup', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
504 if ($reshook == 0) {
505 $dashboardgroup = array_merge($dashboardgroup, $hookmanager->resArray);
506 }
507
508
509 // Calculate total nb of late
510 $totallate = $totaltodo = 0;
511
512 //Remove any invalid response
513 //load_board can return an integer if failed, or WorkboardResponse if OK
514 $valid_dashboardlines = array();
515 foreach ($dashboardlines as $workboardid => $tmp) {
516 if ($tmp instanceof WorkboardResponse) {
517 $tmp->id = (string) $workboardid; // Complete the object to add its id into its name
518 $valid_dashboardlines[$workboardid] = $tmp;
519 }
520 }
521 // We calculate $totallate. Must be defined before start of next loop because it is show in first fetch on next loop
522 foreach ($valid_dashboardlines as $board) {
523 if (is_numeric($board->nbtodo) && is_numeric($board->nbtodolate) && $board->nbtodolate > 0) {
524 $totaltodo += $board->nbtodo;
525 $totallate += $board->nbtodolate;
526 }
527 }
528
529 $openedDashBoardSize = 'info-box-sm'; // use sm by default
530 foreach ($dashboardgroup as $dashbordelement) {
531 if (is_array($dashbordelement['stats']) && count($dashbordelement['stats']) > 2) {
532 $openedDashBoardSize = ''; // use default info box size : big
533 break;
534 }
535 }
536
537 $totalLateNumber = $totallate;
538 $totallatePercentage = ((!empty($totaltodo)) ? round($totallate / $totaltodo * 100, 2) : 0);
539 if (getDolGlobalString('MAIN_USE_METEO_WITH_PERCENTAGE')) {
540 $totallate = $totallatePercentage;
541 }
542
543 // Fill the content to show the tasks to do as a widget box (old version). Now this is no more used. Tasks to do ar in dedicated thumbs.
544 $boxwork = '';
545 $boxwork .= '<div class="box">';
546 $boxwork .= '<table summary="'.dol_escape_htmltag($langs->trans("WorkingBoard")).'" class="noborder boxtable boxtablenobottom boxworkingboard centpercent">'."\n";
547 $boxwork .= '<tr class="liste_titre">';
548 $boxwork .= '<th class="liste_titre"><div class="inline-block valignmiddle">'.$langs->trans("DolibarrWorkBoard").'</div>';
549 if ($showweather) {
550 if ($totallate > 0) {
551 $text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv(
552 "NActionsLate",
553 $totallate.(getDolGlobalString('MAIN_USE_METEO_WITH_PERCENTAGE') ? '%' : '')
554 ).')';
555 } else {
556 $text = $langs->transnoentitiesnoconv("NoItemLate");
557 }
558 $text .= '. '.$langs->transnoentitiesnoconv("LateDesc");
559 //$text.=$form->textwithpicto('',$langs->trans("LateDesc"));
560 $options = 'height="24px" style="float: right"';
561 $boxwork .= showWeather($totallate, $text, $options, 'inline-block valignmiddle');
562 }
563 $boxwork .= '</th>';
564 $boxwork .= '</tr>'."\n";
565
566 // Show dashboard
567 $nbworkboardempty = 0;
568 $isIntopOpenedDashBoard = array();
569 $openedDashBoard = '';
570 if (!empty($valid_dashboardlines)) {
571 $boxwork .= '<tr class="nobottom nohover"><td class="tdboxstats nohover flexcontainer centpercent"><div style="display: flex: flex-wrap: wrap">';
572 foreach ($dashboardgroup as $groupKey => $groupElement) {
573 $boards = array();
574
575 // Scan $groupElement and save the one with 'stats' that must be used for the open objects dashboard
576 if (!getDolGlobalString('MAIN_DISABLE_NEW_OPENED_DASH_BOARD')) {
577 foreach ($groupElement['stats'] as $infoKey) {
578 if (!empty($valid_dashboardlines[$infoKey])) {
579 $boards[] = $valid_dashboardlines[$infoKey];
580 $isIntopOpenedDashBoard[] = $infoKey;
581 }
582 }
583 }
584
585
586 if (!empty($boards)) {
587 if (!empty($groupElement['lang'])) {
588 $langs->load($groupElement['lang']);
589 }
590 // @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset
591 $groupName = $langs->trans($groupElement['groupName']);
592 $groupKeyLowerCase = strtolower($groupKey);
593
594 // global stats
595 $globalStatsKey = false;
596 if (!empty($groupElement['globalStatsKey']) && empty($groupElement['globalStats'])) { // can be filled by hook
597 $globalStatsKey = $groupElement['globalStatsKey'];
598 $groupElement['globalStats'] = array();
599 }
600
601 // Links
602 $arrayLinks = array(
603 'action' => dol_buildpath('/comm/action/card.php?action=create', 1),
604 'project' => dol_buildpath('/projet/card.php?action=create', 1),
605 'propal' => dol_buildpath('/comm/propal/card.php?action=create', 1),
606 'commande' => dol_buildpath('/commande/card.php?action=create', 1),
607 'facture' => dol_buildpath('/compta/facture/card.php?action=create', 1),
608 'supplier_proposal' => dol_buildpath('/supplier_proposal/card.php?action=create', 1),
609 'order_supplier' => dol_buildpath('/fourn/commande/card.php?action=create', 1),
610 'invoice_supplier' => dol_buildpath('/fourn/facture/card.php?action=create', 1),
611 'contrat' => dol_buildpath('/contrat/card.php?action=create', 1),
612 'ticket' => dol_buildpath('/ticket/card.php?action=create', 1),
613 'bank_account' => dol_buildpath('/compta/bank/card.php?action=create', 1),
614 'member' => dol_buildpath('/adherents/card.php?action=create', 1),
615 'expensereport' => dol_buildpath('/expensereport/card.php?action=create', 1),
616 'holiday' => dol_buildpath('/holiday/card.php?action=create', 1),
617 'cubes' => dol_buildpath('/mrp/mo_card.php?action=create', 1),
618
619 );
620 $infoboxMoreCss = '';
621 if (array_key_exists($groupKey, $arrayLinks)) {
622 $infoboxMoreCss = 'infobox-haslink';
623 }
624
625 $openedDashBoard .= '<div class="box-flex-item"><div class="box-flex-item-with-margin">'."\n";
626 $openedDashBoard .= ' <div class="info-box '.$openedDashBoardSize.' '.$infoboxMoreCss.'">'."\n";
627 $openedDashBoard .= ' <span class="info-box-icon bg-infobox-'.$groupKeyLowerCase.'">'."\n";
628 $openedDashBoard .= ' <i class="fa fa-dol-'.$groupKeyLowerCase.'"></i>'."\n";
629
630 // Show the span for the total of record. TODO This seems not used.
631 if (!empty($groupElement['globalStats'])) {
632 $openedDashBoard .= '<span class="info-box-icon-text" title="'.$groupElement['globalStats']['text'].'">'.$groupElement['globalStats']['nbTotal'].'</span>';
633 }
634
635 if (array_key_exists($groupKey, $arrayLinks)) {
636 $openedDashBoard .= ' <a href="'.$arrayLinks[$groupKey].'" class="info-box-createlink"><span class="fas fa-plus-circle"></span></a>'."\n";
637 }
638
639 $openedDashBoard .= '</span>'."\n";
640 $openedDashBoard .= '<div class="info-box-content">'."\n";
641
642 $openedDashBoard .= '<div class="info-box-title" title="'.dolPrintHTMLForAttribute($groupName).'">'.$groupName.'</div>'."\n";
643 $openedDashBoard .= '<div class="info-box-lines">'."\n";
644
645 foreach ($boards as $board) {
646 $openedDashBoard .= '<div class="info-box-line spanoverflow nowrap">';
647
648 if (!empty($board->labelShort)) {
649 $infoName = '<div class="marginrightonly inline-block valignmiddle info-box-line-text" title="'.$board->label.'">'.$board->labelShort.'</div>';
650 } else {
651 $infoName = '<div class="marginrightonly inline-block valignmiddle info-box-line-text">'.$board->label.'</div>';
652 }
653
654 $textLateTitle = $langs->trans("NActionsLate", $board->nbtodolate);
655
656 $dateOrder = '';
657 if ($board->id == 'mo') {
658 $dateOrder = $langs->trans("DateToday") . " > " . $langs->trans("DateReference");
659 } else {
660 $dateOrder = $langs->trans("DateReference") . " > " . $langs->trans("DateToday");
661 }
662 $warningDelay = ceil(empty($board->warning_delay) ? 0 : $board->warning_delay);
663 $sign = '';
664 if ($warningDelay >= 0) {
665 $sign = '+';
666 }
667
668 $textLateTitle .= " (" . $langs->trans("Late") . " = $dateOrder $sign$warningDelay " . $langs->trans("days") . ")";
669
670 if ($board->id == 'bank_account') {
671 $textLateTitle .= '<br><span class="opacitymedium">'.$langs->trans("IfYouDontReconcileDisableProperty", $langs->transnoentitiesnoconv("Conciliable")).'</span>';
672 }
673
674 $textLate = '';
675 if ($board->nbtodolate > 0) {
676 $textLate .= '<span title="'.dol_escape_htmltag($textLateTitle).'" class="classfortooltip badge badge-warning">';
677 $textLate .= '<i class="fa fa-exclamation-triangle hideonsmartphone"></i> '.$board->nbtodolate;
678 $textLate .= '</span>';
679 }
680
681 $nbtodClass = '';
682 if ($board->nbtodo > 0) {
683 $nbtodClass = 'badge badge-info';
684 } else {
685 $nbtodClass = 'opacitymedium';
686 }
687
688 // Forge the line to show into the open object box
689 $labeltoshow = $board->label.' ('.$board->nbtodo.')';
690 if ($board->total > 0) {
691 $labeltoshow .= ' - '.price($board->total, 0, $langs, 1, -1, -1, getDolCurrency());
692 }
693 $openedDashBoard .= '<a href="'.$board->url.'" class="info-box-text info-box-text-a">';
694 $openedDashBoard .= $infoName;
695 $openedDashBoard .= '</a>';
696 $openedDashBoard .= '<div class="inline-block nowraponall">';
697 $openedDashBoard .= '<a href="'.$board->url.'" class="info-box-text info-box-text-a">';
698 $openedDashBoard .= '<span class="classfortooltip'.($nbtodClass ? ' '.$nbtodClass : '').'" title="'.$labeltoshow.'">';
699 $openedDashBoard .= $board->nbtodo;
700 if ($board->total > 0 && getDolGlobalString('MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX')) {
701 $openedDashBoard .= ' : '.price($board->total, 0, $langs, 1, -1, -1, getDolCurrency());
702 }
703 $openedDashBoard .= '</span>';
704 $openedDashBoard .= '</a>';
705
706 if ($textLate) {
707 if ($board->url_late) {
708 $openedDashBoard .= '</div>';
709 $openedDashBoard .= ' <div class="inline-block"><a href="'.$board->url_late.'" class="info-box-text info-box-text-a paddingleft">';
710 } else {
711 $openedDashBoard .= ' <span class="info-box-text info-box-text-a displaycontents">';
712 }
713 $openedDashBoard .= $textLate;
714 if ($board->url_late) {
715 $openedDashBoard .= '</a>';
716 } else {
717 $openedDashBoard .= '</span>';
718 }
719 }
720 $openedDashBoard .= '</div>'."\n";
721 //$openedDashBoard .= '</div>';
722 $openedDashBoard .= '</div>'."\n"; // info-box-line
723 }
724
725 // TODO Add hook here to add more "info-box-line"
726
727 $openedDashBoard .= ' </div><!-- /.info-box-lines --></div><!-- /.info-box-content -->'."\n";
728 $openedDashBoard .= ' </div><!-- /.info-box -->'."\n";
729 $openedDashBoard .= '</div><!-- /.box-flex-item-with-margin -->'."\n";
730 $openedDashBoard .= '</div><!-- /.box-flex-item -->'."\n";
731 $openedDashBoard .= "\n";
732 }
733 }
734
735 if ($showweather && !empty($isIntopOpenedDashBoard)) {
736 $appendClass = (getDolGlobalInt('MAIN_DISABLE_METEO') == 2 ? ' hideonsmartphone' : '');
737 $weather = getWeatherStatus($totallate);
738
739 $text = '';
740 if ($totallate > 0) {
741 $text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv(
742 "NActionsLate",
743 $totallate.(getDolGlobalString('MAIN_USE_METEO_WITH_PERCENTAGE') ? '%' : '')
744 ).')';
745 } else {
746 $text = $langs->transnoentitiesnoconv("NoItemLate");
747 }
748 $text .= '. '.$langs->transnoentitiesnoconv("LateDesc");
749
750 $weatherDashBoard = '<div class="box-flex-item '.$appendClass.'"><div class="box-flex-item-with-margin">'."\n";
751 $weatherDashBoard .= ' <div class="info-box '.$openedDashBoardSize.' info-box-weather info-box-weather-level'.$weather->level.'">'."\n";
752 $weatherDashBoard .= ' <span class="info-box-icon">';
753 $weatherDashBoard .= img_weather('', $weather->level, '', 0, 'valignmiddle width50');
754 $weatherDashBoard .= ' </span>'."\n";
755 $weatherDashBoard .= ' <div class="info-box-content">'."\n";
756 $weatherDashBoard .= ' <div class="info-box-title">'.$langs->trans('GlobalOpenedElemView').'</div>'."\n";
757
758 if ($totallatePercentage > 0 && getDolGlobalString('MAIN_USE_METEO_WITH_PERCENTAGE')) {
759 $weatherDashBoard .= ' <span class="info-box-number">'.$langs->transnoentitiesnoconv(
760 "NActionsLate",
761 price($totallatePercentage).'%'
762 ).'</span>'."\n";
763 $weatherDashBoard .= ' <span class="progress-description">'.$langs->trans(
764 'NActionsLate',
765 $totalLateNumber
766 ).'</span>'."\n";
767 } else {
768 $weatherDashBoard .= ' <span class="info-box-number">'.$langs->transnoentitiesnoconv(
769 "NActionsLate",
770 (string) $totalLateNumber
771 ).'</span>'."\n";
772 if ($totallatePercentage > 0) {
773 $weatherDashBoard .= ' <span class="progress-description">'.$langs->trans(
774 'NActionsLate',
775 price($totallatePercentage).'%'
776 ).'</span>'."\n";
777 }
778 }
779
780 $weatherDashBoard .= ' </div><!-- /.info-box-content -->'."\n";
781 $weatherDashBoard .= ' </div><!-- /.info-box -->'."\n";
782 $weatherDashBoard .= '</div><!-- /.box-flex-item-with-margin -->'."\n";
783 $weatherDashBoard .= '</div><!-- /.box-flex-item -->'."\n";
784 $weatherDashBoard .= "\n";
785
786 $openedDashBoard = $weatherDashBoard.$openedDashBoard;
787 }
788
789 if (!empty($isIntopOpenedDashBoard)) {
790 for ($i = 1; $i <= 10; $i++) {
791 $openedDashBoard .= '<div class="box-flex-item filler"></div>';
792 }
793 }
794
795 $nbworkboardcount = 0;
796 foreach ($valid_dashboardlines as $infoKey => $board) {
797 if (in_array($infoKey, $isIntopOpenedDashBoard)) {
798 // skip if info is present on top
799 continue;
800 }
801
802 if (empty($board->nbtodo)) {
803 $nbworkboardempty++;
804 }
805 $nbworkboardcount++;
806
807
808 $textlate = $langs->trans("NActionsLate", $board->nbtodolate);
809 $textlate .= ' ('.$langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($board->warning_delay) >= 0 ? '+' : '').ceil($board->warning_delay).' '.$langs->trans("days").')';
810
811
812 $boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats130 boxstatsborder">';
813 $boxwork .= '<div class="boxstatscontent">';
814 $boxwork .= '<span class="boxstatstext" title="'.dol_escape_htmltag($board->label).'">'.$board->img.' <span>'.$board->label.'</span></span><br>';
815 $boxwork .= '<a class="valignmiddle dashboardlineindicator" href="'.$board->url.'"><span class="dashboardlineindicator'.(($board->nbtodo == 0) ? ' dashboardlineok' : '').'">'.$board->nbtodo.'</span></a>';
816 if ($board->total > 0 && getDolGlobalString('MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX')) {
817 $boxwork .= '&nbsp;/&nbsp;<a class="valignmiddle dashboardlineindicator" href="'.$board->url.'"><span class="dashboardlineindicator'.(($board->nbtodo == 0) ? ' dashboardlineok' : '').'">'.price($board->total).'</span></a>';
818 }
819 $boxwork .= '</div>';
820 if ($board->nbtodolate > 0) {
821 $boxwork .= '<div class="dashboardlinelatecoin nowrap">';
822 $boxwork .= '<a title="'.dol_escape_htmltag($textlate).'" class="valignmiddle dashboardlineindicatorlate'.($board->nbtodolate > 0 ? ' dashboardlineko' : ' dashboardlineok').'" href="'.((!$board->url_late) ? $board->url : $board->url_late).'">';
823 //$boxwork .= img_picto($textlate, "warning_white", 'class="valigntextbottom"');
824 $boxwork .= img_picto(
825 $textlate,
826 "warning_white",
827 'class="inline-block hideonsmartphone valigntextbottom"'
828 );
829 $boxwork .= '<span class="dashboardlineindicatorlate'.($board->nbtodolate > 0 ? ' dashboardlineko' : ' dashboardlineok').'">';
830 $boxwork .= $board->nbtodolate;
831 $boxwork .= '</span>';
832 $boxwork .= '</a>';
833 $boxwork .= '</div>';
834 }
835 $boxwork .= '</div></div>';
836 $boxwork .= "\n";
837 }
838
839 $boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
840 $boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
841 $boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
842 $boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
843
844 $boxwork .= '</div>';
845 $boxwork .= '</td></tr>';
846 } else {
847 $boxwork .= '<tr class="nohover">';
848 $boxwork .= '<td class="nohover valignmiddle opacitymedium">';
849 $boxwork .= $langs->trans("NoOpenedElementToProcess");
850 $boxwork .= '</td>';
851 $boxwork .= '</tr>';
852 }
853
854 $boxwork .= '</td></tr>';
855
856 $boxwork .= '</table>'; // End table array of working board
857 $boxwork .= '</div>';
858
859 if (!empty($isIntopOpenedDashBoard)) {
860 print '<div class="fichecenter">';
861 print '<div class="opened-dash-board-wrap"><div class="box-flex-container">'.$openedDashBoard.'</div></div>';
862 print '</div>';
863 }
864}
865
866
867print '<div class="clearboth"></div>';
868
869print '<div class="fichecenter fichecenterbis">';
870
871
872/*
873 * Show widgets (boxes)
874 */
875
876$boxlist = '<div class="twocolumns">';
877
878$boxlist .= '<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
879if (!empty($nbworkboardcount)) {
880 $boxlist .= $boxwork;
881}
882
883$boxlist .= $resultboxes['boxlista'];
884
885$boxlist .= '</div>';
886
887$boxlist .= '<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
888
889$boxlist .= $resultboxes['boxlistb'];
890
891$boxlist .= '</div>';
892$boxlist .= "\n";
893
894$boxlist .= '</div>';
895
896
897print $boxlist;
898
899print '</div>';
900
901//print 'mem='.memory_get_usage().' - '.memory_get_peak_usage();
902
903
904// End of page
905llxFooter();
906$db->close();
907
908
919function showWeather($totallate, $text, $options, $morecss = '')
920{
921 global $conf;
922
923 $weather = getWeatherStatus($totallate);
924 return img_weather($text, $weather->picto, $options, 0, $morecss);
925}
926
927
934function getWeatherStatus($totallate)
935{
936 $weather = new stdClass();
937 $weather->picto = '';
938
939 $offset = 0;
940 $factor = 10; // By default
941
942 $used_conf = (getDolGlobalString('MAIN_USE_METEO_WITH_PERCENTAGE') ? 'MAIN_METEO_PERCENTAGE_LEVEL' : 'MAIN_METEO_LEVEL');
943
944 $weather->level = 0;
945 $level0 = $offset;
946 $level0 = getDolGlobalString($used_conf.'0', $level0);
947 $level1 = $offset + $factor;
948 $level1 = getDolGlobalString($used_conf.'1', $level1);
949 $level2 = $offset + 2 * $factor;
950 $level2 = getDolGlobalString($used_conf.'2', $level2);
951 $level3 = $offset + 3 * $factor;
952 $level3 = getDolGlobalString($used_conf.'3', $level3);
953
954 if ($totallate <= $level0) {
955 $weather->picto = 'weather-clear.png';
956 $weather->level = 0;
957 } elseif ($totallate <= $level1) {
958 $weather->picto = 'weather-few-clouds.png';
959 $weather->level = 1;
960 } elseif ($totallate <= $level2) {
961 $weather->picto = 'weather-clouds.png';
962 $weather->level = 2;
963 } elseif ($totallate <= $level3) {
964 $weather->picto = 'weather-many-clouds.png';
965 $weather->level = 3;
966 } else {
967 $weather->picto = 'weather-storm.png';
968 $weather->level = 4;
969 }
970
971 return $weather;
972}
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
Class to manage bank accounts.
Class to manage agenda events (actions)
Class to manage members of a foundation.
Class to manage withdrawal receipts.
Class to manage predefined suppliers products.
Class to manage customers orders.
Class to manage Trips and Expenses.
Class to manage suppliers invoices.
Class to manage invoices.
Class to manage generation of HTML components Only common components must be here.
static getBoxesArea($user, $areacode)
Get array with HTML tabs with widgets/boxes of a particular area including personalized choices of us...
Class of the module paid holiday.
static saveboxorder($dbs, $zone, $boxorder, $userid=0)
Save order of boxes for area and user.
Class for Mo.
Definition mo.class.php:35
Class to manage projects.
Class to manage proposals.
Class to manage cheque delivery receipts.
Class to manage price ask supplier.
Class to manage tasks.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
$conffile
img_weather($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $morecss='')
Show weather picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='')
Show information in HTML for admin users or standard users.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
dolChmod($filepath, $newmask='')
Change mod of a file.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
getDolCurrency()
Return the main currency ('EUR', 'USD', ...)
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...
make_substitutions($text, $substitutionarray, $outputlangs=null, $converttextinhtmlifnecessary=0)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
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...
dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles=1, $removeclassattribute=1, $cleanalsojavascript=0, $allowiframe=0, $allowed_tags=array(), $allowlink=0, $allowscript=0, $allowstyle=0, $allowphp=0)
Clean a string to keep only desirable HTML tags.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
showWeather($totallate, $text, $options, $morecss='')
Show weather logo.
Definition index.php:919
getWeatherStatus($totallate)
get weather status for conf 'MAIN_METEO_LEVELx'
Definition index.php:934
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
Class to generate the form for creating a new ticket.