2004-10-20 23:06:45 +02:00
< ? php
2017-06-06 07:57:03 +02:00
/* Copyright ( C ) 2001 - 2004 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
2020-04-28 01:04:37 +02:00
* Copyright ( C ) 2004 - 2020 Laurent Destailleur < eldy @ users . sourceforge . net >
2018-10-27 14:43:12 +02:00
* Copyright ( C ) 2005 - 2017 Regis Houssin < regis . houssin @ inodbox . com >
2017-06-06 07:57:03 +02:00
* Copyright ( C ) 2011 - 2012 Juanjo Menent < jmenent @ 2 byte . es >
* Copyright ( C ) 2015 Marcos García < marcosgdf @ gmail . com >
2024-10-15 15:39:29 +02:00
* Copyright ( C ) 2021 - 2024 Frédéric France < frederic . france @ free . fr >
2025-02-03 14:28:54 +01:00
* Copyright ( C ) 2024 - 2025 MDW < mdeweerd @ users . noreply . github . com >
2024-06-22 15:34:31 +02:00
* Copyright ( C ) 2024 Alexandre Spangaro < alexandre @ inovea - conseil . com >
2002-04-29 21:47:03 +02:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
2013-01-16 15:36:08 +01:00
* the Free Software Foundation ; either version 3 of the License , or
2002-04-29 21:47:03 +02:00
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2019-09-23 21:55:30 +02:00
* along with this program . If not , see < https :// www . gnu . org / licenses />.
2002-04-29 19:53:37 +02:00
*/
2005-01-03 20:21:51 +01:00
/**
2008-11-19 19:19:51 +01:00
* \file htdocs / index . php
2008-12-07 16:55:40 +01:00
* \brief Dolibarr home page
2008-11-16 19:55:00 +01:00
*/
2005-01-03 20:21:51 +01:00
2021-03-16 11:58:03 +01:00
2021-10-25 22:07:31 +02:00
define ( 'CSRFCHECK_WITH_TOKEN' , 1 ); // We force need to use a token to login when making a POST
2009-05-16 08:31:59 +02:00
2012-08-23 01:43:44 +02:00
require 'main.inc.php' ;
2012-08-22 23:11:24 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php' ;
2002-04-29 19:53:37 +02:00
2024-11-04 23:53:20 +01:00
/**
* @ var Conf $conf
* @ var DoliDB $db
* @ var HookManager $hookmanager
* @ var Translate $langs
* @ var User $user
*/
2008-12-07 16:55:40 +01:00
// If not defined, we select menu "home"
2024-03-28 20:19:28 +01:00
$_GET [ 'mainmenu' ] = GETPOST ( 'mainmenu' , 'aZ09' ) ? GETPOST ( 'mainmenu' , 'aZ09' ) : 'home' ; // Keep this ?
2019-11-14 12:09:46 +01:00
$action = GETPOST ( 'action' , 'aZ09' );
2005-01-03 20:21:51 +01:00
2012-03-02 14:51:16 +01:00
$hookmanager -> initHooks ( array ( 'index' ));
2011-12-06 23:38:54 +01:00
2011-02-19 18:21:29 +01:00
2008-12-07 16:55:40 +01:00
/*
* Actions
*/
2006-11-01 16:15:14 +01:00
2024-06-19 18:21:19 +02:00
// Define $nbmodulesnotautoenabled - TODO This code is at different places
2023-02-09 00:47:33 +01:00
$nbmodulesnotautoenabled = count ( $conf -> modules );
2024-06-19 18:21:19 +02:00
$listofmodulesautoenabled = array ( 'agenda' , 'fckeditor' , 'export' , 'import' );
foreach ( $listofmodulesautoenabled as $moduleautoenable ) {
if ( in_array ( $moduleautoenable , $conf -> modules )) {
$nbmodulesnotautoenabled -- ;
}
2024-04-09 23:21:28 +02:00
}
2023-02-09 00:47:33 +01:00
2011-02-19 18:21:29 +01:00
// Check if company name is defined (first install)
2024-04-02 23:06:29 +02:00
if ( ! getDolGlobalString ( 'MAIN_INFO_SOCIETE_NOM' ) || ! getDolGlobalString ( 'MAIN_INFO_SOCIETE_COUNTRY' )) {
2020-09-07 10:18:17 +02:00
header ( " Location: " . DOL_URL_ROOT . " /admin/index.php?mainmenu=home&leftmenu=setup&mesg=setupnotcomplete " );
exit ;
2011-02-19 18:21:29 +01:00
}
2024-06-19 18:22:12 +02:00
if ( $nbmodulesnotautoenabled <= getDolGlobalInt ( 'MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING' , 1 )) { // If only autoenabled modules (property ->enabled_bydefault in modules) are activated
2020-09-07 10:18:17 +02:00
header ( " Location: " . DOL_URL_ROOT . " /admin/index.php?mainmenu=home&leftmenu=setup&mesg=setupnotcomplete " );
exit ;
2016-07-23 13:20:34 +02:00
}
2021-01-02 20:04:40 +01:00
if ( GETPOST ( 'addbox' )) { // Add box (when submit is done from a form when ajax disabled)
2014-07-29 00:50:57 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php' ;
Fix: GETPOST(...,'int') to GETPOSTINT(...) (#28448)
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: Update spelling exceptions
* Qual: Ignore Phan Notice
2024-02-27 14:05:53 +01:00
$zone = GETPOSTINT ( 'areacode' );
$userid = GETPOSTINT ( 'userid' );
2019-11-14 12:09:46 +01:00
$boxorder = GETPOST ( 'boxorder' , 'aZ09' );
$boxorder .= GETPOST ( 'boxcombo' , 'aZ09' );
2014-07-29 00:50:57 +02:00
2019-11-14 12:09:46 +01:00
$result = InfoBox :: saveboxorder ( $db , $zone , $boxorder , $userid );
2021-01-02 20:04:40 +01:00
if ( $result > 0 ) {
setEventMessages ( $langs -> trans ( " BoxAdded " ), null );
}
2014-07-29 00:50:57 +02:00
}
2006-11-01 16:15:14 +01:00
/*
2008-12-07 16:55:40 +01:00
* View
2008-11-16 19:55:00 +01:00
*/
2005-01-03 20:21:51 +01:00
2021-01-02 20:04:40 +01:00
if ( ! isset ( $form ) || ! is_object ( $form )) {
$form = new Form ( $db );
}
2016-03-01 00:59:42 +01:00
2014-01-26 18:30:45 +01:00
// Title
2019-11-14 12:09:46 +01:00
$title = $langs -> trans ( " HomeArea " ) . ' - Dolibarr ' . DOL_VERSION ;
2023-11-27 13:26:44 +01:00
if ( getDolGlobalString ( 'MAIN_APPLICATION_TITLE' )) {
$title = $langs -> trans ( " HomeArea " ) . ' - ' . getDolGlobalString ( 'MAIN_APPLICATION_TITLE' );
2021-01-02 20:04:40 +01:00
}
2014-01-26 18:30:45 +01:00
2019-01-27 11:55:16 +01:00
llxHeader ( '' , $title );
2003-02-11 14:24:02 +01:00
2017-06-01 01:53:55 +02:00
2019-11-14 12:09:46 +01:00
$resultboxes = FormOther :: getBoxesArea ( $user , " 0 " ); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb)
2016-01-18 11:35:45 +01:00
2023-11-27 13:26:44 +01:00
if ( getDolGlobalString ( 'MAIN_MOTD' )) {
2024-03-12 01:55:26 +01:00
$conf -> global -> MAIN_MOTD = preg_replace ( '/<br(\s[\sa-zA-Z_="]*)?\/?>/i' , '<br>' , getDolGlobalString ( 'MAIN_MOTD' ));
2023-11-27 13:26:44 +01:00
if ( getDolGlobalString ( 'MAIN_MOTD' )) {
2020-09-07 10:18:17 +02:00
$substitutionarray = getCommonSubstitutionArray ( $langs );
complete_substitutions_array ( $substitutionarray , $langs );
2023-12-13 15:20:53 +01:00
$texttoshow = make_substitutions ( getDolGlobalString ( 'MAIN_MOTD' ), $substitutionarray , $langs );
2020-09-07 10:18:17 +02:00
print " \n <!-- Start of welcome text --> \n " ;
2024-03-12 01:55:26 +01:00
print '<table class="centpercent notopnoleftnoright"><tr><td>' ;
2020-09-07 10:18:17 +02:00
print dol_htmlentitiesbr ( $texttoshow );
print '</td></tr></table><br>' ;
print " \n <!-- End of welcome text --> \n " ;
}
2004-07-26 16:38:34 +02:00
}
2024-06-22 15:34:31 +02:00
/*
* Show specific warnings
*/
// Specific warning to propose to upgrade invoice situation to progressive mode
2024-06-29 19:37:35 +02:00
if ( getDolGlobalInt ( 'INVOICE_USE_SITUATION' ) == 1 ) {
$langs -> loadLangs ( array ( " admin " ));
print info_admin ( $langs -> trans ( " WarningExperimentalFeatureInvoiceSituationNeedToUpgradeToProgressiveMode " , 'https://partners.dolibarr.org' ));
2024-07-01 03:47:01 +02:00
//print "<br>";
2024-06-22 15:34:31 +02:00
}
2021-06-21 10:42:20 +02:00
/*
* Show security warnings
*/
2022-11-22 23:53:00 +01:00
// Security warning if install.lock file is missing or if conf file is writable
2023-11-27 13:26:44 +01:00
if ( ! getDolGlobalString ( 'MAIN_REMOVE_INSTALL_WARNING' )) {
2021-06-21 10:42:20 +02:00
$message = '' ;
2005-08-12 00:57:29 +02:00
2021-06-21 10:42:20 +02:00
// Check if install lock file is present
$lockfile = DOL_DATA_ROOT . '/install.lock' ;
if ( ! empty ( $lockfile ) && ! file_exists ( $lockfile ) && is_dir ( DOL_DOCUMENT_ROOT . " /install " )) {
$langs -> load ( " errors " );
2022-08-31 22:14:20 +02:00
//if (!empty($message)) $message.='<br>';
2024-02-17 20:53:56 +01:00
$message .= info_admin ( $langs -> transnoentities ( " WarningLockFileDoesNotExists " , DOL_DATA_ROOT ) . ' ' . $langs -> transnoentities ( " WarningUntilDirRemoved " , DOL_DOCUMENT_ROOT . " /install " ), 0 , 0 , '1' , 'clearboth' );
2021-06-21 10:42:20 +02:00
}
// Conf files must be in read only mode
2022-12-31 17:19:05 +01:00
if ( is_writable ( $conffile )) { // $conffile is defined into filefunc.inc.php
2021-06-21 10:42:20 +02:00
$langs -> load ( " errors " );
//$langs->load("other");
2022-08-31 22:14:20 +02:00
//if (!empty($message)) $message.='<br>';
2024-02-17 20:53:56 +01:00
$message .= info_admin ( $langs -> transnoentities ( " WarningConfFileMustBeReadOnly " ) . ' ' . $langs -> transnoentities ( " WarningUntilDirRemoved " , DOL_DOCUMENT_ROOT . " /install " ), 0 , 0 , '1' , 'clearboth' );
2021-06-21 10:42:20 +02:00
}
2023-06-03 15:33:46 +02:00
$object = new stdClass ();
$parameters = array ();
$reshook = $hookmanager -> executeHooks ( 'infoadmin' , $parameters , $object , $action ); // Note that $action and $object may have been modified by some hooks
2023-05-05 18:02:49 +02:00
if ( $reshook == 0 ) {
$message .= $hookmanager -> resPrint ;
}
2024-02-17 20:53:56 +01:00
if ( $message ) { // $message is an HTML string.
2024-09-10 14:06:37 +02:00
print '<!-- show security warning -->' ;
2024-02-17 20:53:56 +01:00
print dol_string_onlythesehtmltags ( $message , 1 , 0 , 0 , 0 , array ( 'div' , 'span' , 'b' ));
2024-09-10 14:06:37 +02:00
//print '<br>';
2021-06-21 10:42:20 +02:00
//print info_admin($langs->trans("WarningUntilDirRemoved",DOL_DOCUMENT_ROOT."/install"));
}
}
2019-07-29 17:12:41 +02:00
2005-08-12 23:45:18 +02:00
/*
2024-03-12 01:55:26 +01:00
* Dashboard Dolibarr statistics
2009-08-23 02:15:30 +02:00
* Hidden for external users
2005-08-12 23:45:18 +02:00
*/
2019-09-22 20:59:28 +02:00
2024-09-10 14:06:37 +02:00
print load_fiche_titre ( ' ' , $resultboxes [ 'selectboxlist' ], '' , 0 , '' , 'titleforhome' );
2016-02-07 13:10:36 +01:00
2018-05-26 16:03:19 +02:00
// Load translation files required by page
2018-05-26 15:41:32 +02:00
$langs -> loadLangs ( array ( 'commercial' , 'bills' , 'orders' , 'contracts' ));
2010-12-01 22:28:08 +01:00
2020-01-26 19:38:19 +01:00
// Dolibarr Working Board with weather
2024-03-12 01:55:26 +01:00
if ( ! getDolGlobalString ( 'MAIN_DISABLE_GLOBAL_WORKBOARD' ) && getDolGlobalInt ( 'MAIN_OPTIMIZEFORTEXTBROWSER' ) < 2 ) {
2023-11-27 13:26:44 +01:00
$showweather = ( ! getDolGlobalString ( 'MAIN_DISABLE_METEO' ) || getDolGlobalInt ( 'MAIN_DISABLE_METEO' ) == 2 ) ? 1 : 0 ;
2020-09-07 10:18:17 +02:00
2024-10-15 15:39:29 +02:00
// Array that contains all WorkboardResponse classes to process them
2020-09-07 10:18:17 +02:00
$dashboardlines = array ();
// Do not include sections without management permission
require_once DOL_DOCUMENT_ROOT . '/core/class/workboardresponse.class.php' ;
// Number of actions to do (late)
2023-11-27 13:26:44 +01:00
if ( isModEnabled ( 'agenda' ) && ! getDolGlobalString ( 'MAIN_DISABLE_BLOCK_AGENDA' ) && $user -> hasRight ( 'agenda' , 'myactions' , 'read' )) {
2020-09-07 10:18:17 +02:00
include_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php' ;
$board = new ActionComm ( $db );
$dashboardlines [ $board -> element ] = $board -> load_board ( $user );
}
2022-08-09 11:06:20 +02:00
2020-09-07 10:18:17 +02:00
// Number of project opened
2023-11-27 13:26:44 +01:00
if ( isModEnabled ( 'project' ) && ! getDolGlobalString ( 'MAIN_DISABLE_BLOCK_PROJECT' ) && $user -> hasRight ( 'projet' , 'lire' )) {
2020-09-07 10:18:17 +02:00
include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php' ;
$board = new Project ( $db );
$dashboardlines [ $board -> element ] = $board -> load_board ( $user );
}
// Number of tasks to do (late)
2023-11-27 13:26:44 +01:00
if ( isModEnabled ( 'project' ) && ! getDolGlobalString ( 'MAIN_DISABLE_BLOCK_PROJECT' ) && ! getDolGlobalString ( 'PROJECT_HIDE_TASKS' ) && $user -> hasRight ( 'projet' , 'lire' )) {
2020-09-07 10:18:17 +02:00
include_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php' ;
$board = new Task ( $db );
$dashboardlines [ $board -> element ] = $board -> load_board ( $user );
}
2021-08-22 05:25:13 +02:00
// Number of commercial customer proposals open (expired)
2023-11-27 13:26:44 +01:00
if ( isModEnabled ( 'propal' ) && ! getDolGlobalString ( 'MAIN_DISABLE_BLOCK_CUSTOMER' ) && $user -> hasRight ( 'propal' , 'read' )) {
2020-09-07 10:18:17 +02:00
include_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php' ;
$board = new Propal ( $db );
$dashboardlines [ $board -> element . '_opened' ] = $board -> load_board ( $user , " opened " );
// Number of commercial proposals CLOSED signed (billed)
$dashboardlines [ $board -> element . '_signed' ] = $board -> load_board ( $user , " signed " );
}
2021-09-05 01:14:42 +02:00
// Number of supplier proposals open (expired)
2023-11-27 13:26:44 +01:00
if ( isModEnabled ( 'supplier_proposal' ) && ! getDolGlobalString ( 'MAIN_DISABLE_BLOCK_SUPPLIER' ) && $user -> hasRight ( 'supplier_proposal' , 'lire' )) {
2021-09-05 01:14:42 +02:00
$langs -> load ( " supplier_proposal " );
2020-09-07 10:18:17 +02:00
include_once DOL_DOCUMENT_ROOT . '/supplier_proposal/class/supplier_proposal.class.php' ;
$board = new SupplierProposal ( $db );
$dashboardlines [ $board -> element . '_opened' ] = $board -> load_board ( $user , " opened " );
// Number of commercial proposals CLOSED signed (billed)
$dashboardlines [ $board -> element . '_signed' ] = $board -> load_board ( $user , " signed " );
}
2023-11-15 23:52:48 +01:00
// Number of sales orders
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'order' ) && ! getDolGlobalString ( 'MAIN_DISABLE_BLOCK_CUSTOMER' ) && $user -> hasRight ( 'commande' , 'lire' )) {
2020-09-07 10:18:17 +02:00
include_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php' ;
$board = new Commande ( $db );
2023-07-31 02:36:10 +02:00
// Number of customer orders to be shipped (validated and in progress)
$dashboardlines [ $board -> element . '_toship' ] = $board -> load_board ( $user , 'toship' );
2023-07-31 03:00:05 +02:00
// Number of customer orders to be billed (not visible by default, does not match a lot of organization).
if ( getDolGlobalInt ( 'ORDER_BILL_AFTER_VALIDATION' )) {
$dashboardlines [ $board -> element . '_tobill' ] = $board -> load_board ( $user , 'tobill' );
}
2023-07-31 02:36:10 +02:00
// Number of customer orders to be billed (delivered but not billed)
$dashboardlines [ $board -> element . '_shippedtobill' ] = $board -> load_board ( $user , 'shippedtobill' );
2020-09-07 10:18:17 +02:00
}
2023-11-15 23:52:48 +01:00
// Number of suppliers orders
2023-11-27 13:26:44 +01:00
if ( isModEnabled ( 'supplier_order' ) && ! getDolGlobalString ( 'MAIN_DISABLE_BLOCK_SUPPLIER' ) && $user -> hasRight ( 'fournisseur' , 'commande' , 'lire' )) {
2020-09-07 10:18:17 +02:00
include_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php' ;
$board = new CommandeFournisseur ( $db );
$dashboardlines [ $board -> element . '_opened' ] = $board -> load_board ( $user , " opened " );
$dashboardlines [ $board -> element . '_awaiting' ] = $board -> load_board ( $user , 'awaiting' );
}
2022-08-09 11:06:20 +02:00
2020-09-07 10:18:17 +02:00
// Number of contract / services enabled (delayed)
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'contract' ) && ! getDolGlobalString ( 'MAIN_DISABLE_BLOCK_CONTRACT' ) && $user -> hasRight ( 'contrat' , 'lire' )) {
2020-09-07 10:18:17 +02:00
include_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php' ;
$board = new Contrat ( $db );
$dashboardlines [ $board -> element . '_inactive' ] = $board -> load_board ( $user , " inactive " );
// Number of active services (expired)
$dashboardlines [ $board -> element . '_active' ] = $board -> load_board ( $user , " active " );
}
// Number of tickets open
2023-11-27 13:26:44 +01:00
if ( isModEnabled ( 'ticket' ) && ! getDolGlobalString ( 'MAIN_DISABLE_BLOCK_TICKET' ) && $user -> hasRight ( 'ticket' , 'read' )) {
2020-09-07 10:18:17 +02:00
include_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php' ;
$board = new Ticket ( $db );
$dashboardlines [ $board -> element . '_opened' ] = $board -> load_board ( $user , " opened " );
// Number of active services (expired)
//$dashboardlines[$board->element.'_active'] = $board->load_board($user, "active");
}
// Number of invoices customers (paid)
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'invoice' ) && ! getDolGlobalString ( 'MAIN_DISABLE_BLOCK_CUSTOMER' ) && $user -> hasRight ( 'facture' , 'lire' )) {
2020-09-07 10:18:17 +02:00
include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php' ;
$board = new Facture ( $db );
$dashboardlines [ $board -> element ] = $board -> load_board ( $user );
}
// Number of supplier invoices (paid)
2023-11-27 13:26:44 +01:00
if ( isModEnabled ( 'supplier_invoice' ) && ! getDolGlobalString ( 'MAIN_DISABLE_BLOCK_SUPPLIER' ) && $user -> hasRight ( 'fournisseur' , 'facture' , 'lire' )) {
2020-09-07 10:18:17 +02:00
include_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php' ;
$board = new FactureFournisseur ( $db );
$dashboardlines [ $board -> element ] = $board -> load_board ( $user );
}
2022-08-09 11:06:20 +02:00
2020-09-07 10:18:17 +02:00
// Number of transactions to conciliate
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'bank' ) && ! getDolGlobalString ( 'MAIN_DISABLE_BLOCK_BANK' ) && $user -> hasRight ( 'banque' , 'lire' ) && ! $user -> socid ) {
2020-09-07 10:18:17 +02:00
include_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php' ;
$board = new Account ( $db );
2020-09-19 23:30:29 +02:00
$nb = $board -> countAccountToReconcile (); // Get nb of account to reconciliate
2020-09-07 10:18:17 +02:00
if ( $nb > 0 ) {
$dashboardlines [ $board -> element ] = $board -> load_board ( $user );
}
}
2022-01-09 19:48:38 +01:00
2020-09-07 10:18:17 +02:00
// Number of cheque to send
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'bank' ) && ! getDolGlobalString ( 'MAIN_DISABLE_BLOCK_BANK' ) && $user -> hasRight ( 'banque' , 'lire' ) && ! $user -> socid ) {
2023-11-27 13:26:44 +01:00
if ( ! getDolGlobalString ( 'BANK_DISABLE_CHECK_DEPOSIT' )) {
2022-08-16 16:57:52 +02:00
include_once DOL_DOCUMENT_ROOT . '/compta/paiement/cheque/class/remisecheque.class.php' ;
2022-01-09 19:48:38 +01:00
$board = new RemiseCheque ( $db );
$dashboardlines [ $board -> element ] = $board -> load_board ( $user );
}
2022-08-17 22:17:38 +02:00
if ( isModEnabled ( 'prelevement' )) {
2022-01-09 19:48:38 +01:00
include_once DOL_DOCUMENT_ROOT . '/compta/prelevement/class/bonprelevement.class.php' ;
$board = new BonPrelevement ( $db );
2022-08-16 16:57:52 +02:00
$dashboardlines [ $board -> element . '_direct_debit' ] = $board -> load_board ( $user , 'direct_debit' );
2022-01-09 19:48:38 +01:00
}
2022-08-17 22:17:38 +02:00
if ( isModEnabled ( 'paymentbybanktransfer' )) {
2022-01-09 19:48:38 +01:00
include_once DOL_DOCUMENT_ROOT . '/compta/prelevement/class/bonprelevement.class.php' ;
$board = new BonPrelevement ( $db );
2022-08-16 16:57:52 +02:00
$dashboardlines [ $board -> element . '_credit_transfer' ] = $board -> load_board ( $user , 'credit_transfer' );
2022-01-09 19:48:38 +01:00
}
2020-09-07 10:18:17 +02:00
}
// Number of foundation members
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'member' ) && ! getDolGlobalString ( 'MAIN_DISABLE_BLOCK_ADHERENT' ) && $user -> hasRight ( 'adherent' , 'lire' ) && ! $user -> socid ) {
2020-09-07 10:18:17 +02:00
include_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php' ;
$board = new Adherent ( $db );
$dashboardlines [ $board -> element . '_shift' ] = $board -> load_board ( $user , 'shift' );
$dashboardlines [ $board -> element . '_expired' ] = $board -> load_board ( $user , 'expired' );
}
// Number of expense reports to approve
2023-11-27 13:26:44 +01:00
if ( isModEnabled ( 'expensereport' ) && ! getDolGlobalString ( 'MAIN_DISABLE_BLOCK_EXPENSEREPORT' ) && $user -> hasRight ( 'expensereport' , 'approve' )) {
2020-09-07 10:18:17 +02:00
include_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php' ;
$board = new ExpenseReport ( $db );
2020-09-08 21:27:28 +02:00
$dashboardlines [ $board -> element . '_toapprove' ] = $board -> load_board ( $user , 'toapprove' );
2020-09-07 10:18:17 +02:00
}
// Number of expense reports to pay
2023-11-27 13:26:44 +01:00
if ( isModEnabled ( 'expensereport' ) && ! getDolGlobalString ( 'MAIN_DISABLE_BLOCK_EXPENSEREPORT' ) && $user -> hasRight ( 'expensereport' , 'to_paid' )) {
2020-09-07 10:18:17 +02:00
include_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php' ;
$board = new ExpenseReport ( $db );
2020-09-08 21:27:28 +02:00
$dashboardlines [ $board -> element . '_topay' ] = $board -> load_board ( $user , 'topay' );
2020-09-07 10:18:17 +02:00
}
// Number of holidays to approve
2023-11-27 13:26:44 +01:00
if ( isModEnabled ( 'holiday' ) && ! getDolGlobalString ( 'MAIN_DISABLE_BLOCK_HOLIDAY' ) && $user -> hasRight ( 'holiday' , 'approve' )) {
2020-09-07 10:18:17 +02:00
include_once DOL_DOCUMENT_ROOT . '/holiday/class/holiday.class.php' ;
$board = new Holiday ( $db );
$dashboardlines [ $board -> element ] = $board -> load_board ( $user );
}
$object = new stdClass ();
$parameters = array ();
$action = '' ;
2021-01-02 20:04:40 +01:00
$reshook = $hookmanager -> executeHooks (
'addOpenElementsDashboardLine' ,
$parameters ,
$object ,
$action
); // Note that $action and $object may have been modified by some hooks
2020-09-07 10:18:17 +02:00
if ( $reshook == 0 ) {
$dashboardlines = array_merge ( $dashboardlines , $hookmanager -> resArray );
}
/* Open object dashboard */
$dashboardgroup = array (
'action' =>
array (
'groupName' => 'Agenda' ,
'stats' => array ( 'action' ),
),
'project' =>
array (
'groupName' => 'Projects' ,
'globalStatsKey' => 'projects' ,
'stats' => array ( 'project' , 'project_task' ),
),
'propal' =>
array (
'groupName' => 'Proposals' ,
'globalStatsKey' => 'proposals' ,
'stats' =>
array ( 'propal_opened' , 'propal_signed' ),
),
'commande' =>
array (
'groupName' => 'Orders' ,
'globalStatsKey' => 'orders' ,
'stats' =>
2023-07-31 02:36:10 +02:00
array ( 'commande_toship' , 'commande_tobill' , 'commande_shippedtobill' ),
2020-09-07 10:18:17 +02:00
),
'facture' =>
array (
'groupName' => 'Invoices' ,
'globalStatsKey' => 'invoices' ,
'stats' =>
array ( 'facture' ),
),
'supplier_proposal' =>
array (
2021-09-29 17:14:37 +02:00
'lang' => 'supplier_proposal' ,
2020-09-07 10:18:17 +02:00
'groupName' => 'SupplierProposals' ,
'globalStatsKey' => 'askprice' ,
'stats' =>
array ( 'supplier_proposal_opened' , 'supplier_proposal_signed' ),
),
'order_supplier' =>
array (
'groupName' => 'SuppliersOrders' ,
'globalStatsKey' => 'supplier_orders' ,
'stats' =>
array ( 'order_supplier_opened' , 'order_supplier_awaiting' ),
),
'invoice_supplier' =>
array (
'groupName' => 'BillsSuppliers' ,
'globalStatsKey' => 'supplier_invoices' ,
'stats' =>
array ( 'invoice_supplier' ),
),
'contrat' =>
array (
'groupName' => 'Contracts' ,
'globalStatsKey' => 'Contracts' ,
'stats' =>
array ( 'contrat_inactive' , 'contrat_active' ),
),
'ticket' =>
array (
'groupName' => 'Tickets' ,
'globalStatsKey' => 'ticket' ,
'stats' =>
array ( 'ticket_opened' ),
),
'bank_account' =>
array (
'groupName' => 'BankAccount' ,
'stats' =>
2022-01-09 19:48:38 +01:00
array ( 'bank_account' , 'chequereceipt' , 'widthdraw_direct_debit' , 'widthdraw_credit_transfer' ),
2020-09-07 10:18:17 +02:00
),
'member' =>
array (
'groupName' => 'Members' ,
'globalStatsKey' => 'members' ,
'stats' =>
array ( 'member_shift' , 'member_expired' ),
),
'expensereport' =>
array (
'groupName' => 'ExpenseReport' ,
'globalStatsKey' => 'expensereports' ,
'stats' =>
array ( 'expensereport_toapprove' , 'expensereport_topay' ),
),
'holiday' =>
array (
'groupName' => 'Holidays' ,
'globalStatsKey' => 'holidays' ,
'stats' =>
array ( 'holiday' ),
),
);
$object = new stdClass ();
$parameters = array (
'dashboardgroup' => $dashboardgroup
);
$reshook = $hookmanager -> executeHooks ( 'addOpenElementsDashboardGroup' , $parameters , $object , $action ); // Note that $action and $object may have been modified by some hooks
if ( $reshook == 0 ) {
$dashboardgroup = array_merge ( $dashboardgroup , $hookmanager -> resArray );
}
// Calculate total nb of late
$totallate = $totaltodo = 0 ;
//Remove any invalid response
2022-01-09 19:48:38 +01:00
//load_board can return an integer if failed, or WorkboardResponse if OK
2020-09-07 10:18:17 +02:00
$valid_dashboardlines = array ();
2020-11-28 18:34:13 +01:00
foreach ( $dashboardlines as $workboardid => $tmp ) {
2020-09-07 10:18:17 +02:00
if ( $tmp instanceof WorkboardResponse ) {
2020-12-01 02:41:19 +01:00
$tmp -> id = $workboardid ; // Complete the object to add its id into its name
2020-11-28 18:34:13 +01:00
$valid_dashboardlines [ $workboardid ] = $tmp ;
2020-09-07 10:18:17 +02:00
}
}
// We calculate $totallate. Must be defined before start of next loop because it is show in first fetch on next loop
foreach ( $valid_dashboardlines as $board ) {
2023-08-30 10:47:59 +02:00
if ( is_numeric ( $board -> nbtodo ) && is_numeric ( $board -> nbtodolate ) && $board -> nbtodolate > 0 ) {
2020-09-07 10:18:17 +02:00
$totaltodo += $board -> nbtodo ;
$totallate += $board -> nbtodolate ;
}
}
$openedDashBoardSize = 'info-box-sm' ; // use sm by default
foreach ( $dashboardgroup as $dashbordelement ) {
if ( is_array ( $dashbordelement [ 'stats' ]) && count ( $dashbordelement [ 'stats' ]) > 2 ) {
$openedDashBoardSize = '' ; // use default info box size : big
break ;
}
}
$totalLateNumber = $totallate ;
$totallatePercentage = (( ! empty ( $totaltodo )) ? round ( $totallate / $totaltodo * 100 , 2 ) : 0 );
2023-11-27 13:26:44 +01:00
if ( getDolGlobalString ( 'MAIN_USE_METEO_WITH_PERCENTAGE' )) {
2020-09-07 10:18:17 +02:00
$totallate = $totallatePercentage ;
}
2024-09-10 14:06:37 +02:00
// 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.
2020-09-07 10:18:17 +02:00
$boxwork = '' ;
$boxwork .= '<div class="box">' ;
2021-06-11 14:54:18 +02:00
$boxwork .= '<table summary="' . dol_escape_htmltag ( $langs -> trans ( " WorkingBoard " )) . '" class="noborder boxtable boxtablenobottom boxworkingboard centpercent">' . " \n " ;
2020-09-07 10:18:17 +02:00
$boxwork .= '<tr class="liste_titre">' ;
$boxwork .= '<th class="liste_titre"><div class="inline-block valignmiddle">' . $langs -> trans ( " DolibarrWorkBoard " ) . '</div>' ;
if ( $showweather ) {
if ( $totallate > 0 ) {
2021-01-02 20:04:40 +01:00
$text = $langs -> transnoentitiesnoconv ( " WarningYouHaveAtLeastOneTaskLate " ) . ' (' . $langs -> transnoentitiesnoconv (
" NActionsLate " ,
2023-11-27 13:26:44 +01:00
$totallate . ( getDolGlobalString ( 'MAIN_USE_METEO_WITH_PERCENTAGE' ) ? '%' : '' )
2021-01-02 20:04:40 +01:00
) . ')' ;
2020-09-07 10:18:17 +02:00
} else {
$text = $langs -> transnoentitiesnoconv ( " NoItemLate " );
}
$text .= '. ' . $langs -> transnoentitiesnoconv ( " LateDesc " );
//$text.=$form->textwithpicto('',$langs->trans("LateDesc"));
$options = 'height="24px" style="float: right"' ;
$boxwork .= showWeather ( $totallate , $text , $options , 'inline-block valignmiddle' );
}
$boxwork .= '</th>' ;
$boxwork .= '</tr>' . " \n " ;
// Show dashboard
$nbworkboardempty = 0 ;
$isIntopOpenedDashBoard = $globalStatInTopOpenedDashBoard = array ();
2024-10-13 16:45:42 +02:00
$openedDashBoard = '' ;
2020-09-07 10:18:17 +02:00
if ( ! empty ( $valid_dashboardlines )) {
$boxwork .= '<tr class="nobottom nohover"><td class="tdboxstats nohover flexcontainer centpercent"><div style="display: flex: flex-wrap: wrap">' ;
foreach ( $dashboardgroup as $groupKey => $groupElement ) {
$boards = array ();
2022-01-09 19:48:38 +01:00
2023-01-06 19:34:45 +01:00
// Scan $groupElement and save the one with 'stats' that must be used for the open objects dashboard
2023-11-27 13:26:44 +01:00
if ( ! getDolGlobalString ( 'MAIN_DISABLE_NEW_OPENED_DASH_BOARD' )) {
2020-09-07 10:18:17 +02:00
foreach ( $groupElement [ 'stats' ] as $infoKey ) {
if ( ! empty ( $valid_dashboardlines [ $infoKey ])) {
$boards [] = $valid_dashboardlines [ $infoKey ];
$isIntopOpenedDashBoard [] = $infoKey ;
}
}
}
if ( ! empty ( $boards )) {
2021-09-29 17:14:37 +02:00
if ( ! empty ( $groupElement [ 'lang' ])) {
$langs -> load ( $groupElement [ 'lang' ]);
}
2024-04-09 23:21:28 +02:00
// @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset
2020-09-07 10:18:17 +02:00
$groupName = $langs -> trans ( $groupElement [ 'groupName' ]);
$groupKeyLowerCase = strtolower ( $groupKey );
// global stats
$globalStatsKey = false ;
if ( ! empty ( $groupElement [ 'globalStatsKey' ]) && empty ( $groupElement [ 'globalStats' ])) { // can be filled by hook
$globalStatsKey = $groupElement [ 'globalStatsKey' ];
$groupElement [ 'globalStats' ] = array ();
}
$openedDashBoard .= '<div class="box-flex-item"><div class="box-flex-item-with-margin">' . " \n " ;
$openedDashBoard .= ' <div class="info-box ' . $openedDashBoardSize . '">' . " \n " ;
$openedDashBoard .= ' <span class="info-box-icon bg-infobox-' . $groupKeyLowerCase . '">' . " \n " ;
$openedDashBoard .= ' <i class="fa fa-dol-' . $groupKeyLowerCase . '"></i>' . " \n " ;
2023-01-06 19:34:45 +01:00
// Show the span for the total of record. TODO This seems not used.
2020-09-07 10:18:17 +02:00
if ( ! empty ( $groupElement [ 'globalStats' ])) {
$globalStatInTopOpenedDashBoard [] = $globalStatsKey ;
2023-01-06 19:34:45 +01:00
$openedDashBoard .= '<span class="info-box-icon-text" title="' . $groupElement [ 'globalStats' ][ 'text' ] . '">' . $groupElement [ 'globalStats' ][ 'nbTotal' ] . '</span>' ;
2020-09-07 10:18:17 +02:00
}
2020-10-22 22:45:27 +02:00
$openedDashBoard .= '</span>' . " \n " ;
$openedDashBoard .= '<div class="info-box-content">' . " \n " ;
2020-09-07 10:18:17 +02:00
2025-02-20 19:12:03 +01:00
$openedDashBoard .= '<div class="info-box-title" title="' . dolPrintHTMLForAttribute ( $groupName ) . '">' . $groupName . '</div>' . " \n " ;
2020-10-22 22:45:27 +02:00
$openedDashBoard .= '<div class="info-box-lines">' . " \n " ;
2020-09-07 10:18:17 +02:00
foreach ( $boards as $board ) {
2023-04-10 02:05:26 +02:00
$openedDashBoard .= '<div class="info-box-line spanoverflow nowrap">' ;
2020-10-22 22:45:27 +02:00
2020-09-07 10:18:17 +02:00
if ( ! empty ( $board -> labelShort )) {
2023-10-18 17:23:49 +02:00
$infoName = '<div class="marginrightonly inline-block valignmiddle info-box-line-text" title="' . $board -> label . '">' . $board -> labelShort . '</div>' ;
2020-09-07 10:18:17 +02:00
} else {
2023-10-18 17:23:49 +02:00
$infoName = '<div class="marginrightonly inline-block valignmiddle info-box-line-text">' . $board -> label . '</div>' ;
2020-09-07 10:18:17 +02:00
}
$textLateTitle = $langs -> trans ( " NActionsLate " , $board -> nbtodolate );
2022-10-10 16:06:19 +02:00
$textLateTitle .= ' (' . $langs -> trans ( " Late " ) . ' = ' . $langs -> trans ( " DateReference " ) . ' > ' . $langs -> trans ( " DateToday " ) . ' ' . ( ceil ( empty ( $board -> warning_delay ) ? 0 : $board -> warning_delay ) >= 0 ? '+' : '' ) . ceil ( empty ( $board -> warning_delay ) ? 0 : $board -> warning_delay ) . ' ' . $langs -> trans ( " days " ) . ')' ;
2020-09-07 10:18:17 +02:00
2020-11-28 18:34:13 +01:00
if ( $board -> id == 'bank_account' ) {
$textLateTitle .= '<br><span class="opacitymedium">' . $langs -> trans ( " IfYouDontReconcileDisableProperty " , $langs -> transnoentitiesnoconv ( " Conciliable " )) . '</span>' ;
}
2020-09-07 10:18:17 +02:00
$textLate = '' ;
if ( $board -> nbtodolate > 0 ) {
2020-11-28 18:34:13 +01:00
$textLate .= '<span title="' . dol_escape_htmltag ( $textLateTitle ) . '" class="classfortooltip badge badge-warning">' ;
2025-02-20 19:12:03 +01:00
$textLate .= '<i class="fa fa-exclamation-triangle hideonsmartphone"></i> ' . $board -> nbtodolate ;
2020-09-07 10:18:17 +02:00
$textLate .= '</span>' ;
}
$nbtodClass = '' ;
if ( $board -> nbtodo > 0 ) {
$nbtodClass = 'badge badge-info' ;
2021-11-08 14:01:15 +01:00
} else {
$nbtodClass = 'opacitymedium' ;
2020-09-07 10:18:17 +02:00
}
2022-01-09 19:48:38 +01:00
// Forge the line to show into the open object box
$labeltoshow = $board -> label . ' (' . $board -> nbtodo . ')' ;
if ( $board -> total > 0 ) {
$labeltoshow .= ' - ' . price ( $board -> total , 0 , $langs , 1 , - 1 , - 1 , $conf -> currency );
}
2023-10-18 23:55:54 +02:00
$openedDashBoard .= '<a href="' . $board -> url . '" class="info-box-text info-box-text-a">' ;
$openedDashBoard .= $infoName ;
$openedDashBoard .= '<div class="inline-block nowraponall">' ;
$openedDashBoard .= '<span class="classfortooltip' . ( $nbtodClass ? ' ' . $nbtodClass : '' ) . '" title="' . $labeltoshow . '">' ;
2022-01-09 19:48:38 +01:00
$openedDashBoard .= $board -> nbtodo ;
2023-11-27 13:26:44 +01:00
if ( $board -> total > 0 && getDolGlobalString ( 'MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX' )) {
2022-01-09 19:48:38 +01:00
$openedDashBoard .= ' : ' . price ( $board -> total , 0 , $langs , 1 , - 1 , - 1 , $conf -> currency );
}
$openedDashBoard .= '</span>' ;
2023-10-18 23:55:54 +02:00
2020-09-07 10:18:17 +02:00
if ( $textLate ) {
if ( $board -> url_late ) {
2023-10-18 23:55:54 +02:00
$openedDashBoard .= '</div></a>' ;
$openedDashBoard .= ' <div class="inline-block"><a href="' . $board -> url_late . '" class="info-box-text info-box-text-a paddingleft">' ;
2020-09-07 10:18:17 +02:00
} else {
$openedDashBoard .= ' ' ;
}
$openedDashBoard .= $textLate ;
}
$openedDashBoard .= '</a>' . " \n " ;
2023-10-18 23:55:54 +02:00
$openedDashBoard .= '</div>' ;
2020-10-22 22:45:27 +02:00
$openedDashBoard .= '</div>' . " \n " ;
2020-09-07 10:18:17 +02:00
}
2020-10-22 22:45:27 +02:00
// TODO Add hook here to add more "info-box-line"
$openedDashBoard .= ' </div><!-- /.info-box-lines --></div><!-- /.info-box-content -->' . " \n " ;
2020-09-07 10:18:17 +02:00
$openedDashBoard .= ' </div><!-- /.info-box -->' . " \n " ;
$openedDashBoard .= '</div><!-- /.box-flex-item-with-margin -->' . " \n " ;
$openedDashBoard .= '</div><!-- /.box-flex-item -->' . " \n " ;
$openedDashBoard .= " \n " ;
}
}
if ( $showweather && ! empty ( $isIntopOpenedDashBoard )) {
2023-10-08 23:19:49 +02:00
$appendClass = ( getDolGlobalInt ( 'MAIN_DISABLE_METEO' ) == 2 ? ' hideonsmartphone' : '' );
2020-09-07 10:18:17 +02:00
$weather = getWeatherStatus ( $totallate );
$text = '' ;
if ( $totallate > 0 ) {
2021-01-02 20:04:40 +01:00
$text = $langs -> transnoentitiesnoconv ( " WarningYouHaveAtLeastOneTaskLate " ) . ' (' . $langs -> transnoentitiesnoconv (
" NActionsLate " ,
2023-11-27 13:26:44 +01:00
$totallate . ( getDolGlobalString ( 'MAIN_USE_METEO_WITH_PERCENTAGE' ) ? '%' : '' )
2021-01-02 20:04:40 +01:00
) . ')' ;
2020-09-07 10:18:17 +02:00
} else {
$text = $langs -> transnoentitiesnoconv ( " NoItemLate " );
}
$text .= '. ' . $langs -> transnoentitiesnoconv ( " LateDesc " );
$weatherDashBoard = '<div class="box-flex-item ' . $appendClass . '"><div class="box-flex-item-with-margin">' . " \n " ;
$weatherDashBoard .= ' <div class="info-box ' . $openedDashBoardSize . ' info-box-weather info-box-weather-level' . $weather -> level . '">' . " \n " ;
$weatherDashBoard .= ' <span class="info-box-icon">' ;
$weatherDashBoard .= img_weather ( '' , $weather -> level , '' , 0 , 'valignmiddle width50' );
$weatherDashBoard .= ' </span>' . " \n " ;
$weatherDashBoard .= ' <div class="info-box-content">' . " \n " ;
2020-10-22 22:45:27 +02:00
$weatherDashBoard .= ' <div class="info-box-title">' . $langs -> trans ( 'GlobalOpenedElemView' ) . '</div>' . " \n " ;
2020-09-07 10:18:17 +02:00
2023-11-27 13:26:44 +01:00
if ( $totallatePercentage > 0 && getDolGlobalString ( 'MAIN_USE_METEO_WITH_PERCENTAGE' )) {
2021-01-02 20:04:40 +01:00
$weatherDashBoard .= ' <span class="info-box-number">' . $langs -> transnoentitiesnoconv (
" NActionsLate " ,
price ( $totallatePercentage ) . '%'
) . '</span>' . " \n " ;
$weatherDashBoard .= ' <span class="progress-description">' . $langs -> trans (
'NActionsLate' ,
$totalLateNumber
) . '</span>' . " \n " ;
2020-09-07 10:18:17 +02:00
} else {
2021-01-02 20:04:40 +01:00
$weatherDashBoard .= ' <span class="info-box-number">' . $langs -> transnoentitiesnoconv (
" NActionsLate " ,
2025-02-03 14:28:54 +01:00
( string ) $totalLateNumber
2021-01-02 20:04:40 +01:00
) . '</span>' . " \n " ;
2020-09-07 10:18:17 +02:00
if ( $totallatePercentage > 0 ) {
2021-01-02 20:04:40 +01:00
$weatherDashBoard .= ' <span class="progress-description">' . $langs -> trans (
'NActionsLate' ,
price ( $totallatePercentage ) . '%'
) . '</span>' . " \n " ;
2020-09-07 10:18:17 +02:00
}
}
$weatherDashBoard .= ' </div><!-- /.info-box-content -->' . " \n " ;
$weatherDashBoard .= ' </div><!-- /.info-box -->' . " \n " ;
$weatherDashBoard .= '</div><!-- /.box-flex-item-with-margin -->' . " \n " ;
$weatherDashBoard .= '</div><!-- /.box-flex-item -->' . " \n " ;
$weatherDashBoard .= " \n " ;
$openedDashBoard = $weatherDashBoard . $openedDashBoard ;
}
if ( ! empty ( $isIntopOpenedDashBoard )) {
for ( $i = 1 ; $i <= 10 ; $i ++ ) {
$openedDashBoard .= '<div class="box-flex-item filler"></div>' ;
}
}
$nbworkboardcount = 0 ;
foreach ( $valid_dashboardlines as $infoKey => $board ) {
if ( in_array ( $infoKey , $isIntopOpenedDashBoard )) {
// skip if info is present on top
continue ;
}
if ( empty ( $board -> nbtodo )) {
$nbworkboardempty ++ ;
}
$nbworkboardcount ++ ;
$textlate = $langs -> trans ( " NActionsLate " , $board -> nbtodolate );
$textlate .= ' (' . $langs -> trans ( " Late " ) . ' = ' . $langs -> trans ( " DateReference " ) . ' > ' . $langs -> trans ( " DateToday " ) . ' ' . ( ceil ( $board -> warning_delay ) >= 0 ? '+' : '' ) . ceil ( $board -> warning_delay ) . ' ' . $langs -> trans ( " days " ) . ')' ;
$boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats130 boxstatsborder">' ;
$boxwork .= '<div class="boxstatscontent">' ;
2020-09-21 12:55:06 +02:00
$boxwork .= '<span class="boxstatstext" title="' . dol_escape_htmltag ( $board -> label ) . '">' . $board -> img . ' <span>' . $board -> label . '</span></span><br>' ;
2020-09-07 10:18:17 +02:00
$boxwork .= '<a class="valignmiddle dashboardlineindicator" href="' . $board -> url . '"><span class="dashboardlineindicator' . (( $board -> nbtodo == 0 ) ? ' dashboardlineok' : '' ) . '">' . $board -> nbtodo . '</span></a>' ;
2023-11-27 13:26:44 +01:00
if ( $board -> total > 0 && getDolGlobalString ( 'MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX' )) {
2020-09-07 10:18:17 +02:00
$boxwork .= ' / <a class="valignmiddle dashboardlineindicator" href="' . $board -> url . '"><span class="dashboardlineindicator' . (( $board -> nbtodo == 0 ) ? ' dashboardlineok' : '' ) . '">' . price ( $board -> total ) . '</span></a>' ;
}
$boxwork .= '</div>' ;
if ( $board -> nbtodolate > 0 ) {
$boxwork .= '<div class="dashboardlinelatecoin nowrap">' ;
$boxwork .= '<a title="' . dol_escape_htmltag ( $textlate ) . '" class="valignmiddle dashboardlineindicatorlate' . ( $board -> nbtodolate > 0 ? ' dashboardlineko' : ' dashboardlineok' ) . '" href="' . (( ! $board -> url_late ) ? $board -> url : $board -> url_late ) . '">' ;
2022-12-28 13:27:13 +01:00
//$boxwork .= img_picto($textlate, "warning_white", 'class="valigntextbottom"');
2021-01-02 20:04:40 +01:00
$boxwork .= img_picto (
$textlate ,
" warning_white " ,
'class="inline-block hideonsmartphone valigntextbottom"'
2022-12-28 13:27:13 +01:00
);
2020-09-07 10:18:17 +02:00
$boxwork .= '<span class="dashboardlineindicatorlate' . ( $board -> nbtodolate > 0 ? ' dashboardlineko' : ' dashboardlineok' ) . '">' ;
$boxwork .= $board -> nbtodolate ;
$boxwork .= '</span>' ;
$boxwork .= '</a>' ;
$boxwork .= '</div>' ;
}
$boxwork .= '</div></div>' ;
$boxwork .= " \n " ;
}
$boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>' ;
$boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>' ;
$boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>' ;
$boxwork .= '<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>' ;
$boxwork .= '</div>' ;
$boxwork .= '</td></tr>' ;
} else {
$boxwork .= '<tr class="nohover">' ;
$boxwork .= '<td class="nohover valignmiddle opacitymedium">' ;
$boxwork .= $langs -> trans ( " NoOpenedElementToProcess " );
$boxwork .= '</td>' ;
$boxwork .= '</tr>' ;
}
$boxwork .= '</td></tr>' ;
$boxwork .= '</table>' ; // End table array of working board
$boxwork .= '</div>' ;
if ( ! empty ( $isIntopOpenedDashBoard )) {
print '<div class="fichecenter">' ;
print '<div class="opened-dash-board-wrap"><div class="box-flex-container">' . $openedDashBoard . '</div></div>' ;
print '</div>' ;
}
2019-08-02 14:51:32 +02:00
}
2019-07-29 17:12:41 +02:00
2019-08-29 14:12:07 +02:00
2019-07-29 17:12:41 +02:00
print '<div class="clearboth"></div>' ;
2010-11-13 17:59:53 +01:00
2016-02-07 13:10:36 +01:00
print '<div class="fichecenter fichecenterbis">' ;
2010-11-13 17:59:53 +01:00
2002-04-29 19:53:37 +02:00
2003-02-13 17:58:48 +01:00
/*
2020-12-02 15:16:20 +01:00
* Show widgets ( boxes )
2003-02-13 17:58:48 +01:00
*/
2008-12-07 16:55:40 +01:00
2020-12-29 15:59:39 +01:00
$boxlist = '<div class="twocolumns">' ;
2016-02-07 13:10:36 +01:00
2020-02-02 19:34:09 +01:00
$boxlist .= '<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">' ;
2021-01-02 20:04:40 +01:00
if ( ! empty ( $nbworkboardcount )) {
2020-02-02 19:34:09 +01:00
$boxlist .= $boxwork ;
2019-08-01 15:18:42 +02:00
}
2016-02-07 13:10:36 +01:00
2020-02-02 19:34:09 +01:00
$boxlist .= $resultboxes [ 'boxlista' ];
2016-02-07 13:10:36 +01:00
2020-02-02 19:34:09 +01:00
$boxlist .= '</div>' ;
2018-01-16 16:15:49 +01:00
2019-11-14 12:09:46 +01:00
$boxlist .= '<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">' ;
2016-02-07 13:10:36 +01:00
2019-11-14 12:09:46 +01:00
$boxlist .= $resultboxes [ 'boxlistb' ];
2016-02-07 13:10:36 +01:00
2019-11-14 12:09:46 +01:00
$boxlist .= '</div>' ;
$boxlist .= " \n " ;
2016-02-07 13:10:36 +01:00
2019-11-14 12:09:46 +01:00
$boxlist .= '</div>' ;
2018-01-16 16:15:49 +01:00
2016-02-07 13:10:36 +01:00
print $boxlist ;
2005-02-27 17:45:59 +01:00
2011-08-18 00:13:26 +02:00
print '</div>' ;
2009-08-24 21:29:52 +02:00
2013-01-16 15:54:07 +01:00
//print 'mem='.memory_get_usage().' - '.memory_get_peak_usage();
2013-01-15 17:06:53 +01:00
2018-08-04 15:58:05 +02:00
// End of page
2011-12-12 01:39:55 +01:00
llxFooter ();
2003-02-13 17:58:48 +01:00
$db -> close ();
2002-04-29 19:53:37 +02:00
2010-11-13 17:59:53 +01:00
/**
* Show weather logo . Logo to show depends on $totallate and values for
2024-01-05 03:41:22 +01:00
* conf 'MAIN_METEO_LEVELx'
2011-07-08 17:35:08 +02:00
*
* @ param int $totallate Nb of element late
* @ param string $text Text to show on logo
* @ param string $options More parameters on img tag
2019-02-20 06:01:13 +01:00
* @ param string $morecss More CSS
2011-07-08 17:35:08 +02:00
* @ return string Return img tag of weather
2010-11-13 17:59:53 +01:00
*/
2019-02-20 06:01:13 +01:00
function showWeather ( $totallate , $text , $options , $morecss = '' )
2010-11-13 17:59:53 +01:00
{
2020-09-07 10:18:17 +02:00
global $conf ;
2010-11-13 17:59:53 +01:00
2020-09-07 10:18:17 +02:00
$weather = getWeatherStatus ( $totallate );
return img_weather ( $text , $weather -> picto , $options , 0 , $morecss );
2019-08-02 12:22:26 +02:00
}
2017-06-01 01:53:55 +02:00
2017-10-26 13:09:11 +02:00
2019-08-02 12:22:26 +02:00
/**
2024-01-05 03:41:22 +01:00
* get weather status for conf 'MAIN_METEO_LEVELx'
2019-08-02 12:22:26 +02:00
*
* @ param int $totallate Nb of element late
2021-01-02 16:23:09 +01:00
* @ return stdClass Return img tag of weather
2019-08-02 12:22:26 +02:00
*/
function getWeatherStatus ( $totallate )
{
$weather = new stdClass ();
$weather -> picto = '' ;
2019-11-14 12:09:46 +01:00
$offset = 0 ;
$factor = 10 ; // By default
2019-08-02 12:22:26 +02:00
2024-01-05 03:41:22 +01:00
$used_conf = ( getDolGlobalString ( 'MAIN_USE_METEO_WITH_PERCENTAGE' ) ? 'MAIN_METEO_PERCENTAGE_LEVEL' : 'MAIN_METEO_LEVEL' );
2019-08-02 12:22:26 +02:00
2019-11-14 12:09:46 +01:00
$weather -> level = 0 ;
2022-12-30 18:43:43 +01:00
$level0 = $offset ;
$level0 = getDolGlobalString ( $used_conf . '0' , $level0 );
2023-01-03 17:09:08 +01:00
$level1 = $offset + $factor ;
2022-12-30 18:43:43 +01:00
$level1 = getDolGlobalString ( $used_conf . '1' , $level1 );
2019-11-14 12:09:46 +01:00
$level2 = $offset + 2 * $factor ;
2022-12-30 18:43:43 +01:00
$level2 = getDolGlobalString ( $used_conf . '2' , $level2 );
2019-11-14 12:09:46 +01:00
$level3 = $offset + 3 * $factor ;
2022-12-30 18:43:43 +01:00
$level3 = getDolGlobalString ( $used_conf . '3' , $level3 );
2019-08-02 12:22:26 +02:00
2019-11-14 12:09:46 +01:00
if ( $totallate <= $level0 ) {
2019-08-02 12:22:26 +02:00
$weather -> picto = 'weather-clear.png' ;
2019-11-14 12:09:46 +01:00
$weather -> level = 0 ;
2021-01-02 20:04:40 +01:00
} elseif ( $totallate <= $level1 ) {
2019-08-02 12:22:26 +02:00
$weather -> picto = 'weather-few-clouds.png' ;
2019-11-14 12:09:46 +01:00
$weather -> level = 1 ;
2021-01-02 20:04:40 +01:00
} elseif ( $totallate <= $level2 ) {
2019-08-02 12:22:26 +02:00
$weather -> picto = 'weather-clouds.png' ;
2019-11-14 12:09:46 +01:00
$weather -> level = 2 ;
2021-01-02 20:04:40 +01:00
} elseif ( $totallate <= $level3 ) {
2019-08-02 12:22:26 +02:00
$weather -> picto = 'weather-many-clouds.png' ;
2019-11-14 12:09:46 +01:00
$weather -> level = 3 ;
2021-01-02 20:04:40 +01:00
} else {
2019-08-02 12:22:26 +02:00
$weather -> picto = 'weather-storm.png' ;
2019-11-14 12:09:46 +01:00
$weather -> level = 4 ;
2019-08-02 12:22:26 +02:00
}
2010-11-13 17:59:53 +01:00
2019-08-02 12:22:26 +02:00
return $weather ;
2010-11-13 17:59:53 +01:00
}