From 4fd8364999264f6f2b988584bd0a5019e82a85d3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Feb 2005 22:58:20 +0000 Subject: [PATCH] Trad: Traduction du titre des mails d'envoi de facture et propal --- htdocs/comm/propal.php | 2 +- htdocs/compta/facture.php | 4 ++-- htdocs/html.formmail.class.php | 23 +++++++++++++++++++---- htdocs/langs/en_US/bills.lang | 3 ++- htdocs/langs/en_US/commercial.lang | 3 ++- htdocs/langs/fr_FR/bills.lang | 4 +++- htdocs/langs/fr_FR/commercial.lang | 1 + 7 files changed, 30 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index cd469c7bea9..c2c729e5592 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -802,7 +802,7 @@ if ($_GET["propalid"]) $formmail->withfrom=1; $formmail->withto=ucfirst(strtolower($obj->firstname)) . " " . ucfirst(strtolower($obj->name)) . " <$obj->email>"; $formmail->withcc=1; - $formmail->withtopic=1; + $formmail->withtopic=$langs->trans("SendPropalRef","__PROPREF__"); $formmail->withfile=1; $formmail->withbody=1; // Tableau des substitutions diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 211ce79811c..855ccf78861 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1403,7 +1403,7 @@ else $formmail->withfrom=1; $formmail->withto=$liste; $formmail->withcc=1; - $formmail->withtopic=1; + $formmail->withtopic=$langs->trans("SendBillRef","__FACREF__"); $formmail->withfile=1; $formmail->withbody=1; // Tableau des substitutions @@ -1437,7 +1437,7 @@ else $formmail->withfrom=1; $formmail->withto=$liste; $formmail->withcc=1; - $formmail->withtopic=1; + $formmail->withtopic=$langs->trans("SendReminderBillRef","__FACREF__"); $formmail->withfile=1; $formmail->withbody=1; // Tableau des substitutions diff --git a/htdocs/html.formmail.class.php b/htdocs/html.formmail.class.php index f482651ba3c..9ec7cb7d2ef 100644 --- a/htdocs/html.formmail.class.php +++ b/htdocs/html.formmail.class.php @@ -89,6 +89,20 @@ class FormMail } + /* + * \brief Effectue les substitutions des mots clés par les données en fonction du tableau $this->substit + * \param chaine chaine dans laquelle faire les substitutions + * \return string chaine avec les substitutions effectuées + */ + function make_substitutions($chaine) + { + foreach ($this->substit as $key=>$value) { + $chaine=ereg_replace($key,$value,$chaine); + } + return $chaine; + } + + /* * \brief Affiche la partie de formulaire pour saisie d'un mail en fonction des propriétés */ @@ -165,6 +179,8 @@ class FormMail // Topic if ($this->withtopic) { + $this->withtopic=$this->make_substitutions($this->withtopic); + print ""; print "".$langs->trans("MailTopic").""; print ""; @@ -197,11 +213,10 @@ class FormMail // \todo A partir du type, proposer liste de messages dans table llx_models if ($this->param["models"]=='body') { $defaultmessage=$this->withbody; } if ($this->param["models"]=='facture_send') { $defaultmessage="Veuillez trouver ci-joint la facture __FACREF__\n\nCordialement\n\n"; } - if ($this->param["models"]=='facture_relance') { $defaultmessage="Nous apportons à votre connaissance que la facture __FACREF__ ne semble toujours pas avoir été réglée. La voici donc, pour rappel, en pièce jointe.\n\nCordialement\n\n"; } + if ($this->param["models"]=='facture_relance') { $defaultmessage="Nous apportons à votre connaissance que la facture __FACREF__ ne semble pas avoir été réglée. La voici donc, pour rappel, en pièce jointe.\n\nCordialement\n\n"; } - foreach ($this->substit as $key=>$value) { - $defaultmessage=ereg_replace($key,$value,$defaultmessage); - } + $defaultmessage=$this->make_substitutions($defaultmessage); + print ""; print "".$langs->trans("MailText").""; print ""; diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 7bc53d782b7..be8680c2920 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -59,4 +59,5 @@ AlreadyPayed=Already payed RemainderToPay=Remainder to pay RemainderToTake=Remainder to take CreateDraft=Create draft - +SendBillRef=Send bill %s +SendReminderBillRef=Send bill %s (reminder) diff --git a/htdocs/langs/en_US/commercial.lang b/htdocs/langs/en_US/commercial.lang index b102854bb30..7edc29dbfc0 100644 --- a/htdocs/langs/en_US/commercial.lang +++ b/htdocs/langs/en_US/commercial.lang @@ -25,4 +25,5 @@ ListOfCustomers=List of customers LastDoneTasks=Last done tasks LastRecordedTasks=Last recorded tasks DoneAndToDoTasksFor=Done and To do tasks for -DoneAndToDoTasks=Done and To do tasks \ No newline at end of file +DoneAndToDoTasks=Done and To do tasks +SendPropalRef=Send commercial proposal %s \ No newline at end of file diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index fb2731f3530..c52aebc0437 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -58,4 +58,6 @@ ShowBill=Afficher facture AlreadyPayed=Déjà réglé RemainderToPay=Reste à payer RemainderToTake=Reste à encaisser -CreateDraft=Créer brouillon \ No newline at end of file +CreateDraft=Créer brouillon +SendBillRef=Envoi facture %s +SendReminderBillRef=Relance facture %s \ No newline at end of file diff --git a/htdocs/langs/fr_FR/commercial.lang b/htdocs/langs/fr_FR/commercial.lang index 75cbb863f4e..4732efd8ca5 100644 --- a/htdocs/langs/fr_FR/commercial.lang +++ b/htdocs/langs/fr_FR/commercial.lang @@ -26,3 +26,4 @@ LastDoneTasks=Derni LastRecordedTasks=Dernières actions enregistrées DoneAndToDoTasksFor=Liste des actions commerciales réalisées ou à faire pour DoneAndToDoTasks=Liste des actions commerciales réalisées ou à faire +SendPropalRef=Envoi proposition commerciale %s \ No newline at end of file