From 44152c934324bbba791eff174bdb61ecaf4a0fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Oct 2020 00:00:37 +0100 Subject: [PATCH 1/2] undefined variable --- htdocs/datapolicy/class/datapolicy.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/datapolicy/class/datapolicy.class.php b/htdocs/datapolicy/class/datapolicy.class.php index ff9abcf5dce..411e5a46b34 100644 --- a/htdocs/datapolicy/class/datapolicy.class.php +++ b/htdocs/datapolicy/class/datapolicy.class.php @@ -167,6 +167,7 @@ class DataPolicy } else { $l = $langs->defaultlang; } + // TODO Use a dolibarr email template $s = "DATAPOLICIESSUBJECT_".$l; $ma = "DATAPOLICIESCONTENT_".$l; $la = 'TXTLINKDATAPOLICIESACCEPT_'.$l; @@ -242,6 +243,7 @@ class DataPolicy } else { $l = $langs->defaultlang; } + // TODO Use a dolibarr email template $s = "DATAPOLICIESSUBJECT_".$l; $ma = "DATAPOLICIESCONTENT_".$l; $la = 'TXTLINKDATAPOLICIESACCEPT_'.$l; @@ -310,9 +312,6 @@ class DataPolicy $sendto = $adherent->email; - // TODO Use a dolibarr email template - $s = 'TXTLINKDATAPOLICIESSUBJECT_'.$l; - $ma = 'TXTLINKDATAPOLICIESMESSAGE_'.$l; $code = md5($adherent->email); if (!empty($adherent->default_lang)) { @@ -320,6 +319,9 @@ class DataPolicy } else { $l = $langs->defaultlang; } + // TODO Use a dolibarr email template + $s = 'TXTLINKDATAPOLICIESSUBJECT_'.$l; + $ma = 'TXTLINKDATAPOLICIESMESSAGE_'.$l; $la = 'TXTLINKDATAPOLICIESACCEPT_'.$l; $lr = 'TXTLINKDATAPOLICIESREFUSE_'.$l; From c2b6ff969a630d5e21e51bda9ed9715c5a61c981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Oct 2020 00:05:43 +0100 Subject: [PATCH 2/2] Update datapolicy.class.php --- htdocs/datapolicy/class/datapolicy.class.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/htdocs/datapolicy/class/datapolicy.class.php b/htdocs/datapolicy/class/datapolicy.class.php index 411e5a46b34..24490b9fb19 100644 --- a/htdocs/datapolicy/class/datapolicy.class.php +++ b/htdocs/datapolicy/class/datapolicy.class.php @@ -152,7 +152,7 @@ class DataPolicy * @param mixed $contact Contact * @return void */ - public function sendMailDataPolicyContact($contact) + public static function sendMailDataPolicyContact($contact) { global $langs, $conf, $db, $user; @@ -227,7 +227,7 @@ class DataPolicy * @param Societe $societe Object societe * @return void */ - public function sendMailDataPolicyCompany($societe) + public static function sendMailDataPolicyCompany($societe) { global $langs, $conf, $db, $user; @@ -266,10 +266,8 @@ class DataPolicy $actiontypecode = 'AC_EMAIL'; $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto; - if ($message) - { - if ($sendtocc) - { + if ($message) { + if ($sendtocc) { $actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc').": ".$sendtocc); } $actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic').": ".$subject); @@ -302,7 +300,7 @@ class DataPolicy * @param Adherent $adherent Member * @return void */ - public function sendMailDataPolicyAdherent($adherent) + public static function sendMailDataPolicyAdherent($adherent) { global $langs, $conf, $db, $user;