FIX Do not show check box if not applicable

This commit is contained in:
Laurent Destailleur 2018-10-29 02:27:51 +01:00
parent 553e984465
commit 04f80f0925
2 changed files with 11 additions and 8 deletions

View File

@ -93,7 +93,7 @@ if (! $error && $massaction == 'confirm_presend')
} }
// Check mandatory parameters // Check mandatory parameters
if (empty($user->email)) if (GETPOST('fromtype','alpha') === 'user' && empty($user->email))
{ {
$error++; $error++;
setEventMessages($langs->trans("NoSenderEmailDefined"), null, 'warnings'); setEventMessages($langs->trans("NoSenderEmailDefined"), null, 'warnings');

View File

@ -846,6 +846,8 @@ class FormMail extends Form
$out.= '<td>'; $out.= '<td>';
if ($this->withmaindocfile) // withmaindocfile is set to 1 or -1 to show the checkbox (-1 = checked or 1 = not checked)
{
if (GETPOSTISSET('sendmail')) if (GETPOSTISSET('sendmail'))
{ {
$this->withmaindocfile = (GETPOST('addmaindocfile', 'alpha') ? -1 : 1); $this->withmaindocfile = (GETPOST('addmaindocfile', 'alpha') ? -1 : 1);
@ -855,6 +857,7 @@ class FormMail extends Form
{ {
$this->withmaindocfile = ($arraydefaultmessage->joinfiles ? -1 : 1); $this->withmaindocfile = ($arraydefaultmessage->joinfiles ? -1 : 1);
} }
}
if (! empty($this->withmaindocfile)) if (! empty($this->withmaindocfile))
{ {