From 12bf37700adeaa4457fcb588839825161ebbebfa Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 18 Jun 2011 06:23:32 +0000 Subject: [PATCH] Fix: function show_form enhancement --- htdocs/core/class/html.formmail.class.php | 30 +++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 90f14fa27ff..bbef7fbd882 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -326,11 +326,37 @@ class FormMail if ($this->withto || is_array($this->withto)) { $out.= ''; - $out.= $form->textwithpicto($langs->trans("MailTo"),$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); + if ($this->withtofree) $out.= $form->textwithpicto($langs->trans("MailTo"),$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); + else $out.= $langs->trans("MailTo"); $out.= ''; if ($this->withtoreadonly) { - $out.= (! is_array($this->withto) && ! is_numeric($this->withto))?$this->withto:""; + if (! empty($this->toname) && ! empty($this->tomail)) + { + $out.= ''; + $out.= ''; + if ($this->totype == 'thirdparty') + { + $soc=new Societe($this->db); + $soc->fetch($this->toid); + $out.= $soc->getNomUrl(1); + } + if ($this->totype == 'contact') + { + $contact=new Contact($this->db); + $contact->fetch($this->toid); + $out.= $contact->getNomUrl(1); + } + else + { + $out.= $this->toname; + } + $out.= ' <'.$this->tomail.'>'; + } + else + { + $out.= (! is_array($this->withto) && ! is_numeric($this->withto))?$this->withto:""; + } } else {