From 5ed01f67336769d867de5a900200e6cbcdb5ebb6 Mon Sep 17 00:00:00 2001 From: Givriz Date: Sat, 3 Apr 2021 17:09:14 +0200 Subject: [PATCH 1/7] Fix errors phpv8 --- htdocs/admin/company.php | 2 +- htdocs/admin/delais.php | 2 +- htdocs/admin/mails.php | 36 ++++++++++--------- .../core/boxes/box_dolibarr_state_board.php | 2 +- htdocs/core/lib/admin.lib.php | 4 +-- htdocs/core/modules/modDataPolicy.class.php | 2 +- 6 files changed, 25 insertions(+), 23 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index d8af6ac1b4f..15f4a27c8c7 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -666,7 +666,7 @@ print ''.$langs->trans("FiscalYearInformation").'\n"; print ''; -print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START, 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').''; +print (isset($conf->global->SOCIETE_FISCAL_MONTH_START) ? $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START, 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100') : '').''; print ""; print '
'; diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 4fe21a8460b..71783b2a319 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -289,7 +289,7 @@ if ($action == 'edit') { print '
'; -if ($conf->global->MAIN_DISABLE_METEO != 1) { +if (isset($conf->global->MAIN_DISABLE_METEO) && $conf->global->MAIN_DISABLE_METEO != 1) { // Show logo for weather print ''.$langs->trans("DescWeather").' '; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 72d16569b25..ac23480bd4d 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -48,7 +48,7 @@ $substitutionarrayfortest = array( '__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT, '__ID__' => 'RecipientIdRecord', //'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails - '__CHECK_READ__' => (is_object($object) && is_object($object->thirdparty)) ? '' : '', + '__CHECK_READ__' => (isset($object->thirdparty) && is_object($object) && is_object($object->thirdparty)) ? '' : '', '__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails '__LOGIN__' => 'RecipientLogin', '__LASTNAME__' => 'RecipientLastname', @@ -554,7 +554,7 @@ if ($action == 'edit') { print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; // Disable - print ''.$langs->trans("MAIN_DISABLE_ALL_MAILS").''.yn($conf->global->MAIN_DISABLE_ALL_MAILS); + print ''.$langs->trans("MAIN_DISABLE_ALL_MAILS").''.(isset($conf->global->MAIN_DISABLE_ALL_MAILS) ? yn($conf->global->MAIN_DISABLE_ALL_MAILS) : ''); if (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { print img_warning($langs->trans("Disabled")); } @@ -737,26 +737,28 @@ if ($action == 'edit') { print ''.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; print ''; - if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'robot') { - print $langs->trans('RobotEmail'); - } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user') { - print $langs->trans('UserEmail'); - } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company') { - print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>'); - } else { - $id = preg_replace('/senderprofile_/', '', $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE); - if ($id > 0) { - include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php'; - $emailsenderprofile = new EmailSenderProfile($db); - $emailsenderprofile->fetch($id); - print $emailsenderprofile->label.' '.dol_escape_htmltag('<'.$emailsenderprofile->email.'>'); + if (isset($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)) { + if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'robot') { + print $langs->trans('RobotEmail'); + } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user') { + print $langs->trans('UserEmail'); + } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company') { + print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>'); + } else { + $id = preg_replace('/senderprofile_/', '', $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE); + if ($id > 0) { + include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php'; + $emailsenderprofile = new EmailSenderProfile($db); + $emailsenderprofile->fetch($id); + print $emailsenderprofile->label.' '.dol_escape_htmltag('<'.$emailsenderprofile->email.'>'); + } } } print ''; // Errors To print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; - print ''.$conf->global->MAIN_MAIL_ERRORS_TO; + print ''.(isset($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : ''); if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && !isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) { print img_warning($langs->trans("ErrorBadEMail")); } @@ -776,7 +778,7 @@ if ($action == 'edit') { print ''; //Add user to select destinaries list - print ''.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''.yn($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT).''; + print ''.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''.(isset($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT) ? yn($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT) : '').''; print ''; print ''; diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index 7d4a290f0bc..0d2356c00ac 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -66,7 +66,7 @@ class box_dolibarr_state_board extends ModeleBoxes $this->enabled = 0; // disabled by this option } - $this->hidden = !($user->rights->societe->lire && empty($user->socid)); + $this->hidden = !(isset($user->rights->societe->lire) && empty($user->socid)); } /** diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 3088db079e3..6769fa9ccad 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1885,14 +1885,14 @@ function email_admin_prepare_head() $head[$h][2] = 'common'; $h++; - if ($conf->mailing->enabled) { + if (isset($conf->mailing->enabled)) { $head[$h][0] = DOL_URL_ROOT."/admin/mails_emailing.php"; $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("EMailing")); $head[$h][2] = 'common_emailing'; $h++; } - if ($conf->ticket->enabled) { + if (isset($conf->ticket->enabled)) { $head[$h][0] = DOL_URL_ROOT."/admin/mails_ticket.php"; $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("Ticket")); $head[$h][2] = 'common_ticket'; diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index 0e2027494e7..05eaf9920bd 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -132,7 +132,7 @@ class modDataPolicy extends DolibarrModules { array('DATAPOLICY_ADHERENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0), ); - $country = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); + if (isset($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $country = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); // Some keys to add into the overwriting translation tables /* $this->overwrite_translation = array( From 1bac38eef29f1688572df63648fe99ab6c9d1b7d Mon Sep 17 00:00:00 2001 From: Damien BENOIT <48482664+Givriz@users.noreply.github.com> Date: Sun, 4 Apr 2021 18:24:58 +0200 Subject: [PATCH 2/7] Update company.php --- htdocs/admin/company.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 15f4a27c8c7..138cfdad4e0 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -666,7 +666,7 @@ print ''.$langs->trans("FiscalYearInformation").'\n"; print ''; -print (isset($conf->global->SOCIETE_FISCAL_MONTH_START) ? $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START, 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100') : '').''; +print $formother->select_month(isset($conf->global->SOCIETE_FISCAL_MONTH_START) ? $conf->global->SOCIETE_FISCAL_MONTH_START : '', 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').''; print ""; print '
'; From ac2cca51c0b41098d8b1d7493a287a8a09038f3d Mon Sep 17 00:00:00 2001 From: Damien BENOIT <48482664+Givriz@users.noreply.github.com> Date: Wed, 7 Apr 2021 19:37:17 +0200 Subject: [PATCH 3/7] Update delais.php --- htdocs/admin/delais.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 71783b2a319..b0c1cc5398b 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -289,7 +289,7 @@ if ($action == 'edit') { print '
'; -if (isset($conf->global->MAIN_DISABLE_METEO) && $conf->global->MAIN_DISABLE_METEO != 1) { +if (!isset($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO != 1) { // Show logo for weather print ''.$langs->trans("DescWeather").' '; From 7a54e5d346de63526518c3f0c331d4e5304f2980 Mon Sep 17 00:00:00 2001 From: Givriz Date: Mon, 12 Apr 2021 16:03:56 +0200 Subject: [PATCH 4/7] Using empty instead of isset I used empty instead of isset, and I fixed some problems of my previous pull request --- htdocs/admin/company.php | 2 +- htdocs/admin/delais.php | 4 +-- htdocs/admin/mails.php | 36 +++++++++---------- .../core/boxes/box_dolibarr_state_board.php | 2 +- htdocs/core/lib/admin.lib.php | 4 +-- htdocs/core/modules/modDataPolicy.class.php | 3 +- 6 files changed, 25 insertions(+), 26 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 138cfdad4e0..0c6da346285 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -666,7 +666,7 @@ print ''.$langs->trans("FiscalYearInformation").'\n"; print ''; -print $formother->select_month(isset($conf->global->SOCIETE_FISCAL_MONTH_START) ? $conf->global->SOCIETE_FISCAL_MONTH_START : '', 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').''; +print $formother->select_month(!empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? $conf->global->SOCIETE_FISCAL_MONTH_START : '', 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').''; print ""; print '
'; diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index b0c1cc5398b..00f05152a86 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -289,7 +289,7 @@ if ($action == 'edit') { print '
'; -if (!isset($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO != 1) { +if (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO != 1) { // Show logo for weather print ''.$langs->trans("DescWeather").' '; @@ -302,7 +302,7 @@ if (!isset($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_MET $str_mode_enabled = $str_mode_percentage; } print ''.$str_mode_enabled.''; - print ''; + print ''; print '

'; } else { diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index ac23480bd4d..78b4012a6a2 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -48,7 +48,7 @@ $substitutionarrayfortest = array( '__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT, '__ID__' => 'RecipientIdRecord', //'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails - '__CHECK_READ__' => (isset($object->thirdparty) && is_object($object) && is_object($object->thirdparty)) ? '' : '', + '__CHECK_READ__' => (is_object($object) && !empty($object->thirdparty) && is_object($object->thirdparty)) ? '' : '', '__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails '__LOGIN__' => 'RecipientLogin', '__LASTNAME__' => 'RecipientLastname', @@ -554,7 +554,7 @@ if ($action == 'edit') { print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; // Disable - print ''.$langs->trans("MAIN_DISABLE_ALL_MAILS").''.(isset($conf->global->MAIN_DISABLE_ALL_MAILS) ? yn($conf->global->MAIN_DISABLE_ALL_MAILS) : ''); + print ''.$langs->trans("MAIN_DISABLE_ALL_MAILS").''.yn(!empty($conf->global->MAIN_DISABLE_ALL_MAILS)); if (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { print img_warning($langs->trans("Disabled")); } @@ -737,28 +737,26 @@ if ($action == 'edit') { print ''.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; print ''; - if (isset($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)) { - if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'robot') { - print $langs->trans('RobotEmail'); - } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user') { - print $langs->trans('UserEmail'); - } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company') { - print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>'); - } else { - $id = preg_replace('/senderprofile_/', '', $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE); - if ($id > 0) { - include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php'; - $emailsenderprofile = new EmailSenderProfile($db); - $emailsenderprofile->fetch($id); - print $emailsenderprofile->label.' '.dol_escape_htmltag('<'.$emailsenderprofile->email.'>'); - } + if (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) === 'robot') { + print $langs->trans('RobotEmail'); + } elseif (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) === 'user') { + print $langs->trans('UserEmail'); + } elseif (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) === 'company') { + print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>'); + } else { + $id = preg_replace('/senderprofile_/', '', !empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : ''); + if ($id > 0) { + include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php'; + $emailsenderprofile = new EmailSenderProfile($db); + $emailsenderprofile->fetch($id); + print $emailsenderprofile->label.' '.dol_escape_htmltag('<'.$emailsenderprofile->email.'>'); } } print ''; // Errors To print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; - print ''.(isset($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : ''); + print ''.(!empty($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : ''); if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && !isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) { print img_warning($langs->trans("ErrorBadEMail")); } @@ -778,7 +776,7 @@ if ($action == 'edit') { print ''; //Add user to select destinaries list - print ''.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''.(isset($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT) ? yn($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT) : '').''; + print ''.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''.yn(!empty($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT)).''; print ''; print ''; diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index 0d2356c00ac..3ff31a0df96 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -66,7 +66,7 @@ class box_dolibarr_state_board extends ModeleBoxes $this->enabled = 0; // disabled by this option } - $this->hidden = !(isset($user->rights->societe->lire) && empty($user->socid)); + $this->hidden = !(!empty($user->rights->societe->lire) && empty($user->socid)); } /** diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 6769fa9ccad..93d09fa2255 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1885,14 +1885,14 @@ function email_admin_prepare_head() $head[$h][2] = 'common'; $h++; - if (isset($conf->mailing->enabled)) { + if (!empty($conf->mailing->enabled)) { $head[$h][0] = DOL_URL_ROOT."/admin/mails_emailing.php"; $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("EMailing")); $head[$h][2] = 'common_emailing'; $h++; } - if (isset($conf->ticket->enabled)) { + if (!empty($conf->ticket->enabled)) { $head[$h][0] = DOL_URL_ROOT."/admin/mails_ticket.php"; $head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("Ticket")); $head[$h][2] = 'common_ticket'; diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index 05eaf9920bd..34388540831 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -132,7 +132,8 @@ class modDataPolicy extends DolibarrModules { array('DATAPOLICY_ADHERENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0), ); - if (isset($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $country = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); + $country = array(); + if (!empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $country = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); // Some keys to add into the overwriting translation tables /* $this->overwrite_translation = array( From 9abc7a5b0dfc5431c14450cb788c2c057a35849f Mon Sep 17 00:00:00 2001 From: Damien BENOIT <48482664+Givriz@users.noreply.github.com> Date: Mon, 12 Apr 2021 16:16:48 +0200 Subject: [PATCH 5/7] Update modDataPolicy.class.php --- htdocs/core/modules/modDataPolicy.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index 34388540831..adccd49ba37 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -132,8 +132,7 @@ class modDataPolicy extends DolibarrModules { array('DATAPOLICY_ADHERENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0), ); - $country = array(); - if (!empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $country = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY); + if (!empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $country = explode(":", !empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY) ? $conf->global->MAIN_INFO_SOCIETE_COUNTRY : ''); // Some keys to add into the overwriting translation tables /* $this->overwrite_translation = array( From 32d401bed4d194b47ce49f04d0f68579fd76f64a Mon Sep 17 00:00:00 2001 From: Givriz Date: Wed, 14 Apr 2021 15:26:18 +0200 Subject: [PATCH 6/7] Update mails.php --- htdocs/admin/mails.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 78b4012a6a2..0252f149d10 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -737,11 +737,11 @@ if ($action == 'edit') { print ''.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; print ''; - if (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) === 'robot') { + if (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) && $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'robot') { print $langs->trans('RobotEmail'); - } elseif (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) === 'user') { + } elseif (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) && $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user') { print $langs->trans('UserEmail'); - } elseif (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) === 'company') { + } elseif (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) && $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company') { print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>'); } else { $id = preg_replace('/senderprofile_/', '', !empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : ''); From 598156de0459b02266dd2f3de8897793cb544c79 Mon Sep 17 00:00:00 2001 From: Givriz Date: Wed, 14 Apr 2021 17:58:46 +0200 Subject: [PATCH 7/7] Update modDataPolicy.class.php There was useless condition --- htdocs/core/modules/modDataPolicy.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index adccd49ba37..047ff2b5a8d 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -132,7 +132,7 @@ class modDataPolicy extends DolibarrModules { array('DATAPOLICY_ADHERENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0), ); - if (!empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $country = explode(":", !empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY) ? $conf->global->MAIN_INFO_SOCIETE_COUNTRY : ''); + $country = explode(":", empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY) ? '' : $conf->global->MAIN_INFO_SOCIETE_COUNTRY); // Some keys to add into the overwriting translation tables /* $this->overwrite_translation = array(