add todo
This commit is contained in:
parent
bf0650900d
commit
8c607b8101
@ -638,12 +638,12 @@ if (is_object($db)) {
|
|||||||
$db->close();
|
$db->close();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* we send email to validator for current leave request (id)
|
* send email to validator for current leave represented by (id)
|
||||||
* @param $id
|
* @param $id
|
||||||
* @param $cancreate
|
* @param $cancreate
|
||||||
* @param $now
|
* @param $now
|
||||||
* @param $autoValidation
|
* @param $autoValidation
|
||||||
* @return void
|
* @return string|void
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
function sendMail ($id, $cancreate, $now, $autoValidation){
|
function sendMail ($id, $cancreate, $now, $autoValidation){
|
||||||
@ -670,6 +670,8 @@ function sendMail ($id, $cancreate, $now, $autoValidation){
|
|||||||
$destinataire->fetch($object->fk_validator);
|
$destinataire->fetch($object->fk_validator);
|
||||||
$emailTo = $destinataire->email;
|
$emailTo = $destinataire->email;
|
||||||
|
|
||||||
|
//@todo make object return errors
|
||||||
|
//@todo remove redisrection here !
|
||||||
if (!$emailTo) {
|
if (!$emailTo) {
|
||||||
dol_syslog("Expected validator has no email, so we redirect directly to finished page without sending email");
|
dol_syslog("Expected validator has no email, so we redirect directly to finished page without sending email");
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||||
@ -736,17 +738,23 @@ function sendMail ($id, $cancreate, $now, $autoValidation){
|
|||||||
setEventMessages($mail->error, $mail->errors, 'warnings');
|
setEventMessages($mail->error, $mail->errors, 'warnings');
|
||||||
$action = '';
|
$action = '';
|
||||||
} else {
|
} else {
|
||||||
|
//@todo make object return errors
|
||||||
|
//@todo remove redisrection here !
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
//@todo make object return errors
|
||||||
|
//@todo remove redisrection here !
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
//@todo make object return errors
|
||||||
|
//@todo remove redisrection here !
|
||||||
setEventMessage($langs->trans('ErrorloadUserOnSendingMail'),'warning');
|
setEventMessage($langs->trans('ErrorloadUserOnSendingMail'),'warning');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 'objerrors';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user