From 913f4d94cc3ccb466a0c494d2bda2226fa9d3776 Mon Sep 17 00:00:00 2001 From: lalaina rasamoelina Date: Tue, 9 Jul 2013 12:20:01 +0200 Subject: [PATCH] Put the ref_client in the subject mail --- htdocs/comm/propal.php | 12 +++++++++--- htdocs/commande/fiche.php | 10 +++++++++- htdocs/compta/facture.php | 10 +++++++++- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 155e2cc0e78..dd9f8edee71 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -2263,7 +2263,14 @@ else $formmail->withto=GETPOST("sendto")?GETPOST("sendto"):$liste; $formmail->withtocc=$liste; $formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false); - $formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__'); + if(empty($object->ref_client)) + { + $formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__'); + } + else if(!empty($object->ref_client)) + { + $formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__(__REFCLIENT__)'); + } $formmail->withfile=2; $formmail->withbody=1; $formmail->withdeliveryreceipt=1; @@ -2272,6 +2279,7 @@ else // Tableau des substitutions $formmail->substit['__PROPREF__']=$object->ref; $formmail->substit['__SIGNATURE__']=$user->signature; + $formmail->substit['__REFCLIENT__']=$object->ref_client; $formmail->substit['__PERSONALIZED__']=''; $formmail->substit['__CONTACTCIVNAME__']=''; @@ -2299,8 +2307,6 @@ else $formmail->param['models']='propal_send'; $formmail->param['id']=$object->id; $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; - - // Init list of files if (GETPOST("mode")=='init') { diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 74ed72d835c..89b2fe5181e 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -2566,7 +2566,14 @@ else $formmail->withto=GETPOST('sendto')?GETPOST('sendto'):$liste; $formmail->withtocc=$liste; $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC; - $formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__'); + if(empty($object->ref_client)) + { + $formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__'); + } + else if(!empty($object->ref_client)) + { + $formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__(__REFCLIENT__)'); + } $formmail->withfile=2; $formmail->withbody=1; $formmail->withdeliveryreceipt=1; @@ -2574,6 +2581,7 @@ else // Tableau des substitutions $formmail->substit['__ORDERREF__']=$object->ref; $formmail->substit['__SIGNATURE__']=$user->signature; + $formmail->substit['__REFCLIENT__']=$object->ref_client; $formmail->substit['__PERSONALIZED__']=''; $formmail->substit['__CONTACTCIVNAME__']=''; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index b8bc0b1ed10..21dc0852d9e 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3763,7 +3763,14 @@ else if ($id > 0 || ! empty($ref)) $formmail->withto=GETPOST('sendto')?GETPOST('sendto'):$liste; $formmail->withtocc=$liste; $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC; - $formmail->withtopic=$langs->transnoentities($topicmail,'__FACREF__'); + if(empty($object->ref_client)) + { + $formmail->withtopic=$langs->transnoentities($topicmail,'__FACREF__'); + } + else if(!empty($object->ref_client)) + { + $formmail->withtopic=$langs->transnoentities($topicmail,'__FACREF__(__REFCLIENT__)'); + } $formmail->withfile=2; $formmail->withbody=1; $formmail->withdeliveryreceipt=1; @@ -3771,6 +3778,7 @@ else if ($id > 0 || ! empty($ref)) // Tableau des substitutions $formmail->substit['__FACREF__']=$object->ref; $formmail->substit['__SIGNATURE__']=$user->signature; + $formmail->substit['__REFCLIENT__']=$object->ref_client; $formmail->substit['__PERSONALIZED__']=''; $formmail->substit['__CONTACTCIVNAME__']='';