From 20724efd44641698ee42d4691c0397f90579ca3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 11 May 2021 00:04:11 +0200 Subject: [PATCH] fix $mysoc not defined (php8 warning) --- htdocs/main.inc.php | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 4231160b64f..0c3679adac5 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1960,7 +1960,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead */ function top_menu_user($hideloginname = 0, $urllogout = '') { - global $langs, $conf, $db, $hookmanager, $user; + global $langs, $conf, $db, $hookmanager, $user, $mysoc; global $dolibarr_main_authentication, $dolibarr_main_demo; global $menumanager; @@ -1985,13 +1985,27 @@ function top_menu_user($hideloginname = 0, $urllogout = '') $dropdownBody .= ' '.$langs->trans("ShowCompanyInfos").''; $dropdownBody .= '
'; - if (!empty($conf->global->MAIN_INFO_SIREN)) $dropdownBody .= '
'.$langs->transcountry("ProfId1Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIREN).''; - if (!empty($conf->global->MAIN_INFO_SIRET)) $dropdownBody .= '
'.$langs->transcountry("ProfId2Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIRET).''; - if (!empty($conf->global->MAIN_INFO_APE)) $dropdownBody .= '
'.$langs->transcountry("ProfId3Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_APE).''; - if (!empty($conf->global->MAIN_INFO_RCS)) $dropdownBody .= '
'.$langs->transcountry("ProfId4Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_RCS).''; - if (!empty($conf->global->MAIN_INFO_PROFID5)) $dropdownBody .= '
'.$langs->transcountry("ProfId5Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID5).''; - if (!empty($conf->global->MAIN_INFO_PROFID6)) $dropdownBody .= '
'.$langs->transcountry("ProfId6Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID6).''; - if (!empty($conf->global->MAIN_INFO_TVAINTRA)) $dropdownBody .= '
'.$langs->trans("VATIntraShort").': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_TVAINTRA).''; + if (!empty($conf->global->MAIN_INFO_SIREN)) { + $dropdownBody .= '
'.$langs->transcountry("ProfId1Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIREN).''; + } + if (!empty($conf->global->MAIN_INFO_SIRET)) { + $dropdownBody .= '
'.$langs->transcountry("ProfId2Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIRET).''; + } + if (!empty($conf->global->MAIN_INFO_APE)) { + $dropdownBody .= '
'.$langs->transcountry("ProfId3Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_APE).''; + } + if (!empty($conf->global->MAIN_INFO_RCS)) { + $dropdownBody .= '
'.$langs->transcountry("ProfId4Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_RCS).''; + } + if (!empty($conf->global->MAIN_INFO_PROFID5)) { + $dropdownBody .= '
'.$langs->transcountry("ProfId5Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID5).''; + } + if (!empty($conf->global->MAIN_INFO_PROFID6)) { + $dropdownBody .= '
'.$langs->transcountry("ProfId6Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID6).''; + } + if (!empty($conf->global->MAIN_INFO_TVAINTRA)) { + $dropdownBody .= '
'.$langs->trans("VATIntraShort").': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_TVAINTRA).''; + } $dropdownBody .= '
';