Fix use setup of template for attached files in mass actions

This commit is contained in:
Laurent Destailleur 2018-10-29 00:55:55 +01:00
parent d800fe9256
commit 6e3822345c

View File

@ -845,6 +845,13 @@ class FormMail extends Form
$out.= '<td>'.$langs->trans("MailFile").'</td>';
$out.= '<td>';
// If a template was selected, we use setup of template to define if join file checkbox is selected or not.
if (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
{
$this->withmaindocfile = ($arraydefaultmessage->joinfiles ? -1 : 1);
}
if (! empty($this->withmaindocfile))
{
if ($this->withmaindocfile == 1)