dolibarr 24.0.3
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 = $langs->trans("DateToday") . " > " . $langs->trans("DateReference");
657 $warningDelay = ceil(empty($board->warning_delay) ? 0 : $board->warning_delay);
658 $sign = '';
659 if ($warningDelay >= 0) {
660 $sign = '+';
661 }
662
663 $textLateTitle .= " (" . $langs->trans("Late") . " = $dateOrder $sign$warningDelay " . $langs->trans("days") . ")";
664
665 if ($board->id == 'bank_account') {
666 $textLateTitle .= '<br><span class="opacitymedium">'.$langs->trans("IfYouDontReconcileDisableProperty", $langs->transnoentitiesnoconv("Conciliable")).'</span>';
667 }
668
669 $textLate = '';
670 if ($board->nbtodolate > 0) {
671 $textLate .= '<span title="'.dol_escape_htmltag($textLateTitle).'" class="classfortooltip badge badge-warning">';
672 $textLate .= '<i class="fa fa-exclamation-triangle hideonsmartphone"></i> '.$board->nbtodolate;
673 $textLate .= '</span>';
674 }
675
676 $nbtodClass = '';
677 if ($board->nbtodo > 0) {
678 $nbtodClass = 'badge badge-info';
679 } else {
680 $nbtodClass = 'opacitymedium';
681 }
682
683 // Forge the line to show into the open object box
684 $labeltoshow = $board->label.' ('.$board->nbtodo.')';
685 if ($board->total > 0) {
686 $labeltoshow .= ' - '.price($board->total, 0, $langs, 1, -1, -1, getDolCurrency());
687 }
688 $openedDashBoard .= '<a href="'.$board->url.'" class="info-box-text info-box-text-a">';
689 $openedDashBoard .= $infoName;
690 $openedDashBoard .= '</a>';
691 $openedDashBoard .= '<div class="inline-block nowraponall">';
692 $openedDashBoard .= '<a href="'.$board->url.'" class="info-box-text info-box-text-a">';
693 $openedDashBoard .= '<span class="classfortooltip'.($nbtodClass ? ' '.$nbtodClass : '').'" title="'.$labeltoshow.'">';
694 $openedDashBoard .= $board->nbtodo;
695 if ($board->total > 0 && getDolGlobalString('MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX')) {
696 $openedDashBoard .= ' : '.price($board->total, 0, $langs, 1, -1, -1, getDolCurrency());
697 }
698 $openedDashBoard .= '</span>';
699 $openedDashBoard .= '</a>';
700
701 if ($textLate) {
702 if ($board->url_late) {
703 $openedDashBoard .= '</div>';
704 $openedDashBoard .= ' <div class="inline-block"><a href="'.$board->url_late.'" class="info-box-text info-box-text-a paddingleft">';
705 } else {
706 $openedDashBoard .= ' <span class="info-box-text info-box-text-a displaycontents">';
707 }
708 $openedDashBoard .= $textLate;
709 if ($board->url_late) {
710 $openedDashBoard .= '</a>';
711 } else {
712 $openedDashBoard .= '</span>';
713 }
714 }
715 $openedDashBoard .= '</div>'."\n";
716 //$openedDashBoard .= '</div>';
717 $openedDashBoard .= '</div>'."\n"; // info-box-line
718 }
719
720 // TODO Add hook here to add more "info-box-line"
721
722 $openedDashBoard .= ' </div><!-- /.info-box-lines --></div><!-- /.info-box-content -->'."\n";
723 $openedDashBoard .= ' </div><!-- /.info-box -->'."\n";
724 $openedDashBoard .= '</div><!-- /.box-flex-item-with-margin -->'."\n";
725 $openedDashBoard .= '</div><!-- /.box-flex-item -->'."\n";
726 $openedDashBoard .= "\n";
727 }
728 }
729
730 if ($showweather && !empty($isIntopOpenedDashBoard)) {
731 $appendClass = (getDolGlobalInt('MAIN_DISABLE_METEO') == 2 ? ' hideonsmartphone' : '');
732 $weather = getWeatherStatus($totallate);
733
734 $text = '';
735 if ($totallate > 0) {
736 $text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv(
737 "NActionsLate",
738 $totallate.(getDolGlobalString('MAIN_USE_METEO_WITH_PERCENTAGE') ? '%' : '')
739 ).')';
740 } else {
741 $text = $langs->transnoentitiesnoconv("NoItemLate");
742 }
743 $text .= '. '.$langs->transnoentitiesnoconv("LateDesc");
744
745 $weatherDashBoard = '<div class="box-flex-item '.$appendClass.'"><div class="box-flex-item-with-margin">'."\n";
746 $weatherDashBoard .= ' <div class="info-box '.$openedDashBoardSize.' info-box-weather info-box-weather-level'.$weather->level.'">'."\n";
747 $weatherDashBoard .= ' <span class="info-box-icon">';
748 $weatherDashBoard .= img_weather('', $weather->level, '', 0, 'valignmiddle width50');
749 $weatherDashBoard .= ' </span>'."\n";
750 $weatherDashBoard .= ' <div class="info-box-content">'."\n";
751 $weatherDashBoard .= ' <div class="info-box-title">'.$langs->trans('GlobalOpenedElemView').'</div>'."\n";
752
753 if ($totallatePercentage > 0 && getDolGlobalString('MAIN_USE_METEO_WITH_PERCENTAGE')) {
754 $weatherDashBoard .= ' <span class="info-box-number">'.$langs->transnoentitiesnoconv(
755 "NActionsLate",
756 price($totallatePercentage).'%'
757 ).'</span>'."\n";
758 $weatherDashBoard .= ' <span class="progress-description">'.$langs->trans(
759 'NActionsLate',
760 $totalLateNumber
761 ).'</span>'."\n";
762 } else {
763 $weatherDashBoard .= ' <span class="info-box-number">'.$langs->transnoentitiesnoconv(
764 "NActionsLate",
765 (string) $totalLateNumber
766 ).'</span>'."\n";
767 if ($totallatePercentage > 0) {
768 $weatherDashBoard .= ' <span class="progress-description">'.$langs->trans(
769 'NActionsLate',
770 price($totallatePercentage).'%'
771 ).'</span>'."\n";
772 }
773 }
774
775 $weatherDashBoard .= ' </div><!-- /.info-box-content -->'."\n";
776 $weatherDashBoard .= ' </div><!-- /.info-box -->'."\n";
777 $weatherDashBoard .= '</div><!-- /.box-flex-item-with-margin -->'."\n";
778 $weatherDashBoard .= '</div><!-- /.box-flex-item -->'."\n";
779 $weatherDashBoard .= "\n";
780
781 $openedDashBoard = $weatherDashBoard.$openedDashBoard;
782 }
783
784 if (!empty($isIntopOpenedDashBoard)) {
785 for ($i = 1; $i <= 10; $i++) {
786 $openedDashBoard .= '<div class="box-flex-item filler"></div>';
787 }
788 }
789
790 $nbworkboardcount = 0;
791 foreach ($valid_dashboardlines as $infoKey => $board) {
792 if (in_array($infoKey, $isIntopOpenedDashBoard)) {
793 // skip if info is present on top
794 continue;
795 }
796
797 if (empty($board->nbtodo)) {
798 $nbworkboardempty++;
799 }
800 $nbworkboardcount++;
801
802
803 $textlate = $langs->trans("NActionsLate", $board->nbtodolate);
804 $textlate .= ' ('.$langs->trans("Late").' = '.$langs->trans("DateToday").' > '.$langs->trans("DateReference").' '.(ceil($board->warning_delay) >= 0 ? '+' : '').ceil($board->warning_delay).' '.$langs->trans("days").')';
805
806
807 $boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats130 boxstatsborder">';
808 $boxwork .= '<div class="boxstatscontent">';
809 $boxwork .= '<span class="boxstatstext" title="'.dol_escape_htmltag($board->label).'">'.$board->img.' <span>'.$board->label.'</span></span><br>';
810 $boxwork .= '<a class="valignmiddle dashboardlineindicator" href="'.$board->url.'"><span class="dashboardlineindicator'.(($board->nbtodo == 0) ? ' dashboardlineok' : '').'">'.$board->nbtodo.'</span></a>';
811 if ($board->total > 0 && getDolGlobalString('MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX')) {
812 $boxwork .= '&nbsp;/&nbsp;<a class="valignmiddle dashboardlineindicator" href="'.$board->url.'"><span class="dashboardlineindicator'.(($board->nbtodo == 0) ? ' dashboardlineok' : '').'">'.price($board->total).'</span></a>';
813 }
814 $boxwork .= '</div>';
815 if ($board->nbtodolate > 0) {
816 $boxwork .= '<div class="dashboardlinelatecoin nowrap">';
817 $boxwork .= '<a title="'.dol_escape_htmltag($textlate).'" class="valignmiddle dashboardlineindicatorlate'.($board->nbtodolate > 0 ? ' dashboardlineko' : ' dashboardlineok').'" href="'.((!$board->url_late) ? $board->url : $board->url_late).'">';
818 //$boxwork .= img_picto($textlate, "warning_white", 'class="valigntextbottom"');
819 $boxwork .= img_picto(
820 $textlate,
821 "warning_white",
822 'class="inline-block hideonsmartphone valigntextbottom"'
823 );
824 $boxwork .= '<span class="dashboardlineindicatorlate'.($board->nbtodolate > 0 ? ' dashboardlineko' : ' dashboardlineok').'">';
825 $boxwork .= $board->nbtodolate;
826 $boxwork .= '</span>';
827 $boxwork .= '</a>';
828 $boxwork .= '</div>';
829 }
830 $boxwork .= '</div></div>';
831 $boxwork .= "\n";
832 }
833
834 $boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
835 $boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
836 $boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
837 $boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
838
839 $boxwork .= '</div>';
840 $boxwork .= '</td></tr>';
841 } else {
842 $boxwork .= '<tr class="nohover">';
843 $boxwork .= '<td class="nohover valignmiddle opacitymedium">';
844 $boxwork .= $langs->trans("NoOpenedElementToProcess");
845 $boxwork .= '</td>';
846 $boxwork .= '</tr>';
847 }
848
849 $boxwork .= '</td></tr>';
850
851 $boxwork .= '</table>'; // End table array of working board
852 $boxwork .= '</div>';
853
854 if (!empty($isIntopOpenedDashBoard)) {
855 print '<div class="fichecenter">';
856 print '<div class="opened-dash-board-wrap"><div class="box-flex-container">'.$openedDashBoard.'</div></div>';
857 print '</div>';
858 }
859}
860
861
862print '<div class="clearboth"></div>';
863
864print '<div class="fichecenter fichecenterbis">';
865
866
867/*
868 * Show widgets (boxes)
869 */
870
871$boxlist = '<div class="twocolumns">';
872
873$boxlist .= '<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
874if (!empty($nbworkboardcount)) {
875 $boxlist .= $boxwork;
876}
877
878$boxlist .= $resultboxes['boxlista'];
879
880$boxlist .= '</div>';
881
882$boxlist .= '<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
883
884$boxlist .= $resultboxes['boxlistb'];
885
886$boxlist .= '</div>';
887$boxlist .= "\n";
888
889$boxlist .= '</div>';
890
891
892print $boxlist;
893
894print '</div>';
895
896//print 'mem='.memory_get_usage().' - '.memory_get_peak_usage();
897
898
899// End of page
900llxFooter();
901$db->close();
902
903
914function showWeather($totallate, $text, $options, $morecss = '')
915{
916 global $conf;
917
918 $weather = getWeatherStatus($totallate);
919 return img_weather($text, $weather->picto, $options, 0, $morecss);
920}
921
922
929function getWeatherStatus($totallate)
930{
931 $weather = new stdClass();
932 $weather->picto = '';
933
934 $offset = 0;
935 $factor = 10; // By default
936
937 $used_conf = (getDolGlobalString('MAIN_USE_METEO_WITH_PERCENTAGE') ? 'MAIN_METEO_PERCENTAGE_LEVEL' : 'MAIN_METEO_LEVEL');
938
939 $weather->level = 0;
940 $level0 = $offset;
941 $level0 = getDolGlobalString($used_conf.'0', $level0);
942 $level1 = $offset + $factor;
943 $level1 = getDolGlobalString($used_conf.'1', $level1);
944 $level2 = $offset + 2 * $factor;
945 $level2 = getDolGlobalString($used_conf.'2', $level2);
946 $level3 = $offset + 3 * $factor;
947 $level3 = getDolGlobalString($used_conf.'3', $level3);
948
949 if ($totallate <= $level0) {
950 $weather->picto = 'weather-clear.png';
951 $weather->level = 0;
952 } elseif ($totallate <= $level1) {
953 $weather->picto = 'weather-few-clouds.png';
954 $weather->level = 1;
955 } elseif ($totallate <= $level2) {
956 $weather->picto = 'weather-clouds.png';
957 $weather->level = 2;
958 } elseif ($totallate <= $level3) {
959 $weather->picto = 'weather-many-clouds.png';
960 $weather->level = 3;
961 } else {
962 $weather->picto = 'weather-storm.png';
963 $weather->level = 4;
964 }
965
966 return $weather;
967}
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)
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
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...
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='', $cssfordropdown='info_admin')
Show information in HTML for admin users or standard users.
showWeather($totallate, $text, $options, $morecss='')
Show weather logo.
Definition index.php:914
getWeatherStatus($totallate)
get weather status for conf 'MAIN_METEO_LEVELx'
Definition index.php:929
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.