From f845a52b20b991ce29670b9102346a58f62042a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 30 Oct 2018 16:37:50 +0100 Subject: [PATCH] Fix phpcs --- htdocs/adherents/card.php | 76 +++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index f347c73192c..fee1848b925 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -644,27 +644,26 @@ if (empty($reshook)) $msg = $arraydefaultmessage->content; } - if (empty($labeltouse) || (int) $labeltouse === -1) { - //fallback on the old configuration. - setEventMessages('WarningMandatorySetupNotComplete', [], 'errors'); - $error++; - }else{ - $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); - complete_substitutions_array($substitutionarray, $outputlangs, $object); - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs); - - $moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n"; - - $result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader); - if ($result < 0) - { - $error++; - setEventMessages($object->error, $object->errors, 'errors'); - } - } + if (empty($labeltouse) || (int) $labeltouse === -1) { + //fallback on the old configuration. + setEventMessages('WarningMandatorySetupNotComplete', [], 'errors'); + $error++; + } + else { + $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs); + $moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n"; + $result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader); + if ($result < 0) + { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + } + } } } else @@ -726,28 +725,27 @@ if (empty($reshook)) $msg = $arraydefaultmessage->content; } - if (empty($labeltouse) || (int) $labeltouse === -1) { - //fallback on the old configuration. - setEventMessages('WarningMandatorySetupNotComplete', [], 'errors'); - $error++; - }else{ - $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); - complete_substitutions_array($substitutionarray, $outputlangs, $object); - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs); - - $moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n"; - - $result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader); - if ($result < 0) - { - $error++; - setEventMessages($object->error, $object->errors, 'errors'); - } - } - } + if (empty($labeltouse) || (int) $labeltouse === -1) { + //fallback on the old configuration. + setEventMessages('WarningMandatorySetupNotComplete', [], 'errors'); + $error++; + } + else { + $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs); + $moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n"; + $result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader); + if ($result < 0) + { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + } + } + } } else {