2
0
forked from Wavyzz/dolibarr

set a message

This commit is contained in:
De Coninck Laurent
2018-10-26 16:18:27 +02:00
parent 402bbbe839
commit d347cf3a85
2 changed files with 36 additions and 32 deletions

View File

@@ -634,12 +634,11 @@ if (empty($reshook))
$msg = $arraydefaultmessage->content;
}
if (empty($labeltouse)) {
if (empty($labeltouse) || (int)$labeltouse === -1) {
//fallback on the old configuration.
$subject = $conf->global->ADHERENT_MAIL_VALID_SUBJECT;
$msg = $conf->global->ADHERENT_MAIL_VALID;
}
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
$error++;
}else{
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
@@ -653,6 +652,9 @@ if (empty($reshook))
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
}
else
@@ -713,12 +715,11 @@ if (empty($reshook))
$msg = $arraydefaultmessage->content;
}
if (empty($labeltouse)) {
if (empty($labeltouse) || (int)$labeltouse === -1) {
//fallback on the old configuration.
$subject = $conf->global->ADHERENT_MAIL_RESIL_SUBJECT;
$msg = $conf->global->ADHERENT_MAIL_RESIL;
}
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
$error++;
}else{
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
@@ -727,13 +728,16 @@ if (empty($reshook))
$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
{
$error++;

View File

@@ -6555,7 +6555,7 @@ function get_htmloutput_errors($mesgstring='', $mesgarray='', $keepembedded=0)
* @see dol_htmloutput_errors
* @see setEventMessages
*/
function dol_htmloutput_mesg($mesgstring='',$mesgarray='', $style='ok', $keepembedded=0)
function dol_htmloutput_mesg($mesgstring = '',$mesgarray = [], $style = 'ok', $keepembedded=0)
{
if (empty($mesgstring) && (! is_array($mesgarray) || count($mesgarray) == 0)) return;