From 43e1dbb9efc8bb3c587b730aca0b7de0d6757be4 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 19 Mar 2021 11:27:31 +0100 Subject: [PATCH 1/6] FIX avoid php8 warning with multicompany --- htdocs/core/ajax/pingresult.php | 6 +++--- htdocs/core/boxes/box_services_contracts.php | 2 +- htdocs/main.inc.php | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/ajax/pingresult.php b/htdocs/core/ajax/pingresult.php index 4398a3e8d4c..fa7f4d0e68b 100644 --- a/htdocs/core/ajax/pingresult.php +++ b/htdocs/core/ajax/pingresult.php @@ -67,14 +67,14 @@ print ''."\n"; + print "\n".''."\n"; print "\n\n"; $url_for_ping = (empty($conf->global->MAIN_URL_FOR_PING) ? "https://ping.dolibarr.org/" : $conf->global->MAIN_URL_FOR_PING); // Try to guess the distrib used From 5978196e3bcbc91dddbffbba0321550caecfa279 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 19 Mar 2021 11:31:46 +0100 Subject: [PATCH 2/6] FIX missing current entity id --- htdocs/main.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 1001eccf78f..86ee87edb2a 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -3150,8 +3150,8 @@ if (!function_exists("llxFooter")) { $now = dol_now(); print "\n\n"; include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; - dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_DATE', dol_print_date($now, 'dayhourlog', 'gmt')); - dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_ID', 'disabled'); + dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_DATE', dol_print_date($now, 'dayhourlog', 'gmt'), 'chaine', 0, '', $conf->entity)); + dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_ID', 'disabled', 'chaine', 0, '', $conf->entity)); } } } From a8ecdc14dd0fe5bc7c1c5ca4a3451c725aaaebd0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 19 Mar 2021 11:46:57 +0100 Subject: [PATCH 3/6] FIX syntax error --- htdocs/main.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 86ee87edb2a..d3632605351 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -3150,8 +3150,8 @@ if (!function_exists("llxFooter")) { $now = dol_now(); print "\n\n"; include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; - dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_DATE', dol_print_date($now, 'dayhourlog', 'gmt'), 'chaine', 0, '', $conf->entity)); - dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_ID', 'disabled', 'chaine', 0, '', $conf->entity)); + dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_DATE', dol_print_date($now, 'dayhourlog', 'gmt'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_ID', 'disabled', 'chaine', 0, '', $conf->entity); } } } From 29e090b02560c0253afd2187f0734b09e19fa0c5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 20 Mar 2021 12:35:41 +0100 Subject: [PATCH 4/6] FIX force to entity 0 for all entities --- htdocs/core/ajax/pingresult.php | 6 +++--- htdocs/main.inc.php | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/ajax/pingresult.php b/htdocs/core/ajax/pingresult.php index fa7f4d0e68b..8c73ec23a13 100644 --- a/htdocs/core/ajax/pingresult.php +++ b/htdocs/core/ajax/pingresult.php @@ -67,14 +67,14 @@ print ''."\n"; + print "\n".''."\n"; print "\n\n"; $url_for_ping = (empty($conf->global->MAIN_URL_FOR_PING) ? "https://ping.dolibarr.org/" : $conf->global->MAIN_URL_FOR_PING); // Try to guess the distrib used @@ -3168,8 +3168,8 @@ if (!function_exists("llxFooter")) { $now = dol_now(); print "\n\n"; include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; - dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_DATE', dol_print_date($now, 'dayhourlog', 'gmt'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_ID', 'disabled', 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_DATE', dol_print_date($now, 'dayhourlog', 'gmt'), 'chaine', 0, '', 0); + dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_ID', 'disabled', 'chaine', 0, '', 0); } } } From 972380860aafbb404d6a5cd9d5d8292468db8000 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 20 Mar 2021 12:40:24 +0100 Subject: [PATCH 5/6] FIX use new function getDolGlobalInt() instead --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 2ddb9455a8e..2bae455383c 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1438,7 +1438,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr } $themeparam = '?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss', 'aZ09') ? '&optioncss='.GETPOST('optioncss', 'aZ09', 1) : '').'&userid='.$user->id.'&entity='.$conf->entity; - $themeparam .= ($ext ? '&'.$ext : '').'&revision='.(empty($conf->global->MAIN_IHM_PARAMS_REV) ? '0' : $conf->global->MAIN_IHM_PARAMS_REV); + $themeparam .= ($ext ? '&'.$ext : '').'&revision='.getDolGlobalInt("MAIN_IHM_PARAMS_REV"); if (!empty($_SESSION['dol_resetcache'])) { $themeparam .= '&dol_resetcache='.$_SESSION['dol_resetcache']; } From 625f72303b7a49c40c79c96dd846a83b058e221d Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 20 Mar 2021 11:43:13 +0000 Subject: [PATCH 6/6] Fixing style errors. --- htdocs/core/ajax/pingresult.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/ajax/pingresult.php b/htdocs/core/ajax/pingresult.php index 8c73ec23a13..3a98fba8e85 100644 --- a/htdocs/core/ajax/pingresult.php +++ b/htdocs/core/ajax/pingresult.php @@ -74,7 +74,7 @@ if ($action == 'firstpingok') { } elseif ($action == 'firstpingko') { // If ko // Note: pings are by installation, done on entity 1. - dolibarr_set_const($db, 'MAIN_LAST_PING_KO_DATE', dol_print_date($now, 'dayhourlog', 'gmt'), 'chaine', 0, '', 0); // erase last value + dolibarr_set_const($db, 'MAIN_LAST_PING_KO_DATE', dol_print_date($now, 'dayhourlog', 'gmt'), 'chaine', 0, '', 0); // erase last value print 'First ping KO saved for entity '.$conf->entity; } else { print 'Error action='.$action.' not supported';