FIX Do not show check box if not applicable
This commit is contained in:
parent
553e984465
commit
04f80f0925
@ -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');
|
||||||
|
|||||||
@ -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))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user