From 3dc5ffa871226cf4a263aa6923a124e4a6711707 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Wed, 13 May 2015 18:05:26 +0200 Subject: [PATCH 1/2] FIX send mail, copy sendto don't read the list of contact --- htdocs/comm/propal.php | 5 ++++- htdocs/compta/facture.php | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 3a6f3a7ceff..ce86b84a846 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -434,7 +434,10 @@ if (empty($reshook)) { $from = $_POST ['fromname'] . ' <' . $_POST ['frommail'] . '>'; $replyto = $_POST ['replytoname'] . ' <' . $_POST ['replytomail'] . '>'; $message = $_POST ['message']; - $sendtocc = $_POST ['sendtocc']; + + $receivercc = GETPOST('receivercc'); + $sendtocc = ($receivercc!=='') ? $receivercc : $_POST ['sendtocc']; + $deliveryreceipt = $_POST ['deliveryreceipt']; if (dol_strlen($_POST ['subject'])) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 4a2b13b0069..b9805822149 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1571,7 +1571,8 @@ if (empty($reshook)) { $from = $_POST['fromname'] . ' <' . $_POST['frommail'] . '>'; $replyto = $_POST['replytoname'] . ' <' . $_POST['replytomail'] . '>'; $message = $_POST['message']; - $sendtocc = $_POST['sendtocc']; + $receivercc = GETPOST('receivercc'); + $sendtocc = ($receivercc!=='') ? $receivercc : $_POST ['sendtocc']; $deliveryreceipt = $_POST['deliveryreceipt']; if ($action == 'send') { From a4031a3680241275ac3404ba3d4835a3c6ba3701 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Mon, 18 May 2015 18:33:17 +0200 Subject: [PATCH 2/2] if contact in sellist, it's an Id --- htdocs/comm/propal.php | 8 +++++++- htdocs/compta/facture.php | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index ce86b84a846..99119414971 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -436,7 +436,13 @@ if (empty($reshook)) { $message = $_POST ['message']; $receivercc = GETPOST('receivercc'); - $sendtocc = ($receivercc!=='') ? $receivercc : $_POST ['sendtocc']; + if($_POST ['sendtocc']!=='') { + $sendtocc = $_POST ['sendtocc'] ; + } + elseif($receivercc!=-1) { + $sendtocc = $object->client->contact_get_property($receivercc, 'email'); + } + $deliveryreceipt = $_POST ['deliveryreceipt']; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index b9805822149..af28d80b9e9 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1571,8 +1571,15 @@ if (empty($reshook)) { $from = $_POST['fromname'] . ' <' . $_POST['frommail'] . '>'; $replyto = $_POST['replytoname'] . ' <' . $_POST['replytomail'] . '>'; $message = $_POST['message']; + $receivercc = GETPOST('receivercc'); - $sendtocc = ($receivercc!=='') ? $receivercc : $_POST ['sendtocc']; + if($_POST ['sendtocc']!=='') { + $sendtocc = $_POST ['sendtocc'] ; + } + elseif($receivercc!=-1) { + $sendtocc = $object->client->contact_get_property($receivercc, 'email'); + } + $deliveryreceipt = $_POST['deliveryreceipt']; if ($action == 'send') {