From 6e3822345cec2bc1f497a10a23e110fd0be6bb62 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Oct 2018 00:55:55 +0100 Subject: [PATCH] Fix use setup of template for attached files in mass actions --- htdocs/core/class/html.formmail.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 117bfb13769..6c74c1ca612 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -845,6 +845,13 @@ class FormMail extends Form $out.= ''.$langs->trans("MailFile").''; $out.= ''; + + // 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)