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,14 +846,17 @@ class FormMail extends Form
|
|||||||
|
|
||||||
$out.= '<td>';
|
$out.= '<td>';
|
||||||
|
|
||||||
if (GETPOSTISSET('sendmail'))
|
if ($this->withmaindocfile) // withmaindocfile is set to 1 or -1 to show the checkbox (-1 = checked or 1 = not checked)
|
||||||
{
|
{
|
||||||
$this->withmaindocfile = (GETPOST('addmaindocfile', 'alpha') ? -1 : 1);
|
if (GETPOSTISSET('sendmail'))
|
||||||
}
|
{
|
||||||
// If a template was selected, we use setup of template to define if join file checkbox is selected or not.
|
$this->withmaindocfile = (GETPOST('addmaindocfile', 'alpha') ? -1 : 1);
|
||||||
elseif (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
|
}
|
||||||
{
|
// If a template was selected, we use setup of template to define if join file checkbox is selected or not.
|
||||||
$this->withmaindocfile = ($arraydefaultmessage->joinfiles ? -1 : 1);
|
elseif (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
|
||||||
|
{
|
||||||
|
$this->withmaindocfile = ($arraydefaultmessage->joinfiles ? -1 : 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($this->withmaindocfile))
|
if (! empty($this->withmaindocfile))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user