From aa1a21c7e416d33294e3e95706237a4214dec70b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Nov 2009 15:26:56 +0000 Subject: [PATCH] Fix: Errors with numberwords module --- htdocs/admin/mails.php | 4 ++-- htdocs/comm/mailing/fiche.php | 8 ++++---- htdocs/html.formmail.class.php | 4 ++-- htdocs/lib/functions.lib.php | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 5a8881b656d..d9a63424b83 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -146,8 +146,8 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'sendhtml') if ($_POST['action'] == 'sendhtml') $msgishtml=1; // Force message to HTML // Pratique les substitutions sur le sujet et message - $subject=make_substitutions($subject,$substitutionarrayfortest); - $body=make_substitutions($body,$substitutionarrayfortest); + $subject=make_substitutions($subject,$substitutionarrayfortest,$langs); + $body=make_substitutions($body,$substitutionarrayfortest,$langs); require_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php"); $mailfile = new CMailFile($subject,$sendto,$email_from,$body, diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index b281fd4a24d..c359986b6ca 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -184,8 +184,8 @@ if ($_POST["action"] == 'sendallconfirmed' && $_POST['confirm'] == 'yes') ); $substitutionisok=true; - $newsubject=make_substitutions($subject,$substitutionarray); - $newmessage=make_substitutions($message,$substitutionarray); + $newsubject=make_substitutions($subject,$substitutionarray,$langs); + $newmessage=make_substitutions($message,$substitutionarray,$langs); // Fabrication du mail $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, @@ -300,8 +300,8 @@ if ($_POST["action"] == 'send' && empty($_POST["cancel"])) if (preg_match('/[\s\t]*/i',$message)) $msgishtml=1; // Pratique les substitutions sur le sujet et message - $mil->sujet=make_substitutions($mil->sujet,$substitutionarrayfortest); - $mil->body=make_substitutions($mil->body,$substitutionarrayfortest); + $mil->sujet=make_substitutions($mil->sujet,$substitutionarrayfortest,$langs); + $mil->body=make_substitutions($mil->body,$substitutionarrayfortest,$langs); $mailfile = new CMailFile($mil->sujet,$mil->sendto,$mil->email_from,$mil->body, $arr_file,$arr_mime,$arr_name,'', '', 0, $msgishtml,$mil->email_errorsto,$arr_css); diff --git a/htdocs/html.formmail.class.php b/htdocs/html.formmail.class.php index 47a1da9d095..50f924d9da3 100644 --- a/htdocs/html.formmail.class.php +++ b/htdocs/html.formmail.class.php @@ -384,7 +384,7 @@ class FormMail // Topic if ($this->withtopic) { - $this->withtopic=make_substitutions($this->withtopic,$this->substit); + $this->withtopic=make_substitutions($this->withtopic,$this->substit,$langs); print ""; print "".$langs->trans("MailTopic").""; @@ -442,7 +442,7 @@ class FormMail if ($this->param["models"]=='propal_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendProposal"); } if ($this->param["models"]=='order_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendOrder"); } - $defaultmessage=make_substitutions($defaultmessage,$this->substit); + $defaultmessage=make_substitutions($defaultmessage,$this->substit,$langs); if (isset($_POST["message"])) $defaultmessage=$_POST["message"]; print ""; diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 228cc6101cc..33f36bfec7a 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -2892,7 +2892,7 @@ function dol_textishtml($msg,$option=0) * \param object If we want to add more substitution, we provide a source object * \return string Output string after subsitutions */ -function make_substitutions($chaine,$substitutionarray,$outputlangs='',$object='') +function make_substitutions($chaine,$substitutionarray,$outputlangs,$object='') { global $conf,$user;