From 472d7b591eebc3134f404b9f2226bc1a7ba3e1b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Dec 2017 02:01:36 +0100 Subject: [PATCH] Fix hook for formmail and translation --- htdocs/core/class/html.formmail.class.php | 14 ++++++++++++-- htdocs/societe/class/societe.class.php | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index bd82d622e5a..6423d9709e9 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -521,9 +521,19 @@ class FormMail extends Form } } } + + // Set the default "From" + $defaultfrom=''; + $reshook=$hookmanager->executeHooks('getDefaultFromEmail', $parameters, $this); + if (empty($reshook)) + { + $defaultfrom = $this->fromtype; + } + if (! empty($hookmanager->resArray['defaultfrom'])) $defaultfrom=$hookmanager->resArray['defaultfrom']; + // Using combo here make the '' no more visible on list. - //$out.= ' '.$form->selectarray('fromtype', $liste, $this->fromtype, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth200onsmartphone', 1, '', $disablebademails); - $out.= ' '.$form->selectarray('fromtype', $liste, $this->fromtype, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth200onsmartphone', 0, '', $disablebademails); + //$out.= ' '.$form->selectarray('fromtype', $liste, $this->fromtype, 0, 0, 0, '', 0, 0, 0, '', 'fromforsendingprofile maxwidth200onsmartphone', 1, '', $disablebademails); + $out.= ' '.$form->selectarray('fromtype', $liste, $defaultfrom, 0, 0, 0, '', 0, 0, 0, '', 'fromforsendingprofile maxwidth200onsmartphone', 0, '', $disablebademails); } $out.= "\n"; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index f147aedc5a5..f8fe4a80123 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1959,7 +1959,7 @@ class Societe extends CommonObject if (! empty($this->country_code)) $label.= '
' . $langs->trans('Country') . ': '. $this->country_code; if (! empty($this->tva_intra)) - $label.= '
' . $langs->trans('VATNumber') . ': '. $this->tva_intra; + $label.= '
' . $langs->trans('VATIntra') . ': '. $this->tva_intra; if (! empty($this->code_client) && $this->client) $label.= '
' . $langs->trans('CustomerCode') . ': '. $this->code_client; if (! empty($this->code_fournisseur) && $this->fournisseur)