From 0226f53098e15e4549fb3ca8ac37f81437584d6c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Aug 2015 05:09:26 +0200 Subject: [PATCH] Fix When selecting another email template, the topic was not replaced. --- htdocs/core/class/html.formmail.class.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 8310db730ab..08474776512 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -225,6 +225,7 @@ class FormMail extends Form /** * Get the form to input an email * this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files + * this->param: Contains more parameteres like email templates info * * @param string $addfileaction Name of action when posting file attachments * @param string $removefileaction Name of action when removing file attachments @@ -252,7 +253,7 @@ class FormMail extends Form return $hookmanager->resPrint; } else - { + { $out=''; // Define list of attached files @@ -281,14 +282,16 @@ class FormMail extends Form $model_id=$this->param["models_id"]; } $arraydefaultmessage=$this->getEMailTemplate($this->db, $this->param["models"], $user, $outputlangs, $model_id); + //var_dump($arraydefaultmessage); - $out.= "\n\n"; + $out.= "\n\n"; if ($this->withform == 1) { - $out.= '
'."\n"; + $out.= ''."\n"; $out.= ''; $out.= ''; $out.= ''; + $out.= ''; } foreach ($this->param as $key=>$value) { @@ -310,7 +313,7 @@ class FormMail extends Form if (count($modelmail_array)>0) { $out.= '
'."\n"; - $out.= $langs->trans('SelectMailModel').':'.$this->selectarray('modelmailselected', $modelmail_array,$model_id); + $out.= $langs->trans('SelectMailModel').': '.$this->selectarray('modelmailselected', $modelmail_array, 0, 1); if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); $out.= '   '; $out.= ''; @@ -330,7 +333,7 @@ class FormMail extends Form { $help.=$key.' -> '.$langs->trans($val).'
'; } - $out.= $form->textwithpicto($langs->trans("EMailTestSubstitutionReplacedByGenericValues"),$help); + $out.= $form->textwithpicto($langs->trans("EMailTestSubstitutionReplacedByGenericValues"), $help); $out.= "\n"; } @@ -569,7 +572,7 @@ class FormMail extends Form } else { - $out.= ''; + $out.= ''; } $out.= "\n"; } @@ -717,7 +720,7 @@ class FormMail extends Form if ($this->withform == 1) $out.= ''."\n"; - // Disable enter key if option MAIN_MAILFORM_DISABLE_ENTER is set + // Disable enter key if option MAIN_MAILFORM_DISABLE_ENTERKEY is set if (! empty($conf->global->MAIN_MAILFORM_DISABLE_ENTERKEY)) { $out.= ''; } - $out.= "\n"; + $out.= "\n"; return $out; }