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 4611b96da8
commit f8a49edf78

View File

@ -880,6 +880,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)