phpcs fix

This commit is contained in:
Frédéric FRANCE 2019-02-24 23:40:32 +01:00 committed by GitHub
parent dfd6a0feaa
commit 461da700d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -219,68 +219,68 @@ Class DataPolicy
*/
function sendMailDataPolicyCompany($societe)
{
global $langs, $conf, $db, $user;
global $langs, $conf, $db, $user;
$error = 0;
$error = 0;
$from = $user->getFullName($langs) . ' <' . $user->email . '>';
$from = $user->getFullName($langs) . ' <' . $user->email . '>';
$sendto = $societe->email;
$sendto = $societe->email;
$code= md5($societe->email);
if (!empty($societe->default_lang)) {
$l = $societe->default_lang;
} else {
$l = $langs->defaultlang;
}
$s = "DATAPOLICIESSUBJECT_" . $l;
$ma = "DATAPOLICIESCONTENT_" . $l;
$la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
$lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
$code= md5($societe->email);
if (!empty($societe->default_lang)) {
$l = $societe->default_lang;
} else {
$l = $langs->defaultlang;
}
$s = "DATAPOLICIESSUBJECT_" . $l;
$ma = "DATAPOLICIESCONTENT_" . $l;
$la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
$lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
$subject = $conf->global->$s;
$message = $conf->global->$ma;
$linka = $conf->global->$la;
$linkr = $conf->global->$lr;
$sendtocc = $sendtobcc = '';
$filepath = $mimetype = $filename = array();
$deliveryreceipt = 0;
$subject = $conf->global->$s;
$message = $conf->global->$ma;
$linka = $conf->global->$la;
$linkr = $conf->global->$lr;
$sendtocc = $sendtobcc = '';
$filepath = $mimetype = $filename = array();
$deliveryreceipt = 0;
$substitutionarray = array(
$substitutionarray = array(
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&s='.$societe->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linka.'</a>',
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&s='.$societe->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linkr.'</a>',
);
$subject = make_substitutions($subject, $substitutionarray);
$message = make_substitutions($message, $substitutionarray);
);
$subject = make_substitutions($subject, $substitutionarray);
$message = make_substitutions($message, $substitutionarray);
$actiontypecode = 'AC_EMAIL';
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
if ($message) {
if ($sendtocc) {
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
$actiontypecode = 'AC_EMAIL';
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
if ($message) {
if ($sendtocc) {
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
}
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
$actionmsg .= dol_concatdesc($actionmsg, $message);
}
// Send mail
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
if ($mailfile->error) {
$resultmasssend .= '<div class="error">' . $mailfile->error . '</div>';
} else {
$result4 = $mailfile->sendfile();
// Send mail
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
if ($mailfile->error) {
$resultmasssend .= '<div class="error">' . $mailfile->error . '</div>';
} else {
$result4 = $mailfile->sendfile();
if (!$error) {
$resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "<br>";
$societe->array_options['options_datapolicy_send'] = date('Y-m-d', time());
$societe->update($societe->id);
} else {
dol_print_error($db);
}
}
setEventMessage($resultmasssend);
if (!$error) {
$resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "<br>";
$societe->array_options['options_datapolicy_send'] = date('Y-m-d', time());
$societe->update($societe->id);
} else {
dol_print_error($db);
}
}
setEventMessage($resultmasssend);
}
/**