forked from Wavyzz/dolibarr
set a message
This commit is contained in:
@@ -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++;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user