Fix pass parameter by reference

This commit is contained in:
Laurent Destailleur 2022-12-28 04:47:37 +01:00
parent c26747b15a
commit 90f93a60d6
2 changed files with 30 additions and 20 deletions

View File

@ -122,7 +122,11 @@ if ($company->id) {
} elseif (empty(trim($object->email))) { } elseif (empty(trim($object->email))) {
// when adherent e-mail is empty, use only company e-mail // when adherent e-mail is empty, use only company e-mail
$v->setEmail($company->email); $v->setEmail($company->email);
} elseif (strtolower(end(explode("@", $object->email))) == strtolower(end(explode("@", $company->email)))) { } else {
$tmpobject = explode("@", trim($object->email));
$tmpcompany = explode("@", trim($company->email));
if (strtolower(end($tmpobject)) == strtolower(end($tmpcompany))) {
// when e-mail domain of adherent and company are the same, use adherent e-mail at first (and company e-mail at second) // when e-mail domain of adherent and company are the same, use adherent e-mail at first (and company e-mail at second)
$v->setEmail($object->email); $v->setEmail($object->email);
@ -135,6 +139,7 @@ if ($company->id) {
// support by Microsoft Outlook (2019 and possible earlier) // support by Microsoft Outlook (2019 and possible earlier)
$v->setEmail($object->email, 'INTERNET'); $v->setEmail($object->email, 'INTERNET');
} }
}
// Si adherent lie a un tiers non de type "particulier" // Si adherent lie a un tiers non de type "particulier"
if ($company->typent_code != 'TE_PRIVATE') { if ($company->typent_code != 'TE_PRIVATE') {

View File

@ -92,7 +92,11 @@ if ($company->id) {
} elseif (empty(trim($contact->email))) { } elseif (empty(trim($contact->email))) {
// when contact e-mail is empty, use only company e-mail // when contact e-mail is empty, use only company e-mail
$v->setEmail($company->email); $v->setEmail($company->email);
} elseif (strtolower(end(explode("@", $contact->email))) == strtolower(end(explode("@", $company->email)))) { } else {
$tmpcontact = explode("@", trim($contact->email));
$tmpcompany = explode("@", trim($company->email));
if (strtolower(end($tmpcontact)) == strtolower(end($tmpcompany))) {
// when e-mail domain of contact and company are the same, use contact e-mail at first (and company e-mail at second) // when e-mail domain of contact and company are the same, use contact e-mail at first (and company e-mail at second)
$v->setEmail($contact->email); $v->setEmail($contact->email);
@ -105,6 +109,7 @@ if ($company->id) {
// support by Microsoft Outlook (2019 and possible earlier) // support by Microsoft Outlook (2019 and possible earlier)
$v->setEmail($contact->email, 'INTERNET'); $v->setEmail($contact->email, 'INTERNET');
} }
}
// Si contact lie a un tiers non de type "particulier" // Si contact lie a un tiers non de type "particulier"
if ($company->typent_code != 'TE_PRIVATE') { if ($company->typent_code != 'TE_PRIVATE') {