From 42fca17c0619285825e57bf64f86d9aed41c3c70 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Feb 2004 18:11:56 +0000 Subject: [PATCH] =?UTF-8?q?On=20peut=20modifier=20le=20message=20d'accompa?= =?UTF-8?q?gnement=20propos=E9=20lors=20de=20l'envoi=20d'une=20facture=20p?= =?UTF-8?q?ar=20mail=20avec=20son=20propre=20message.=20Le=20style=20du=20?= =?UTF-8?q?lien=20"Emettre=20paiement"=20n'avait=20pas=20le=20nouveau=20st?= =?UTF-8?q?yle=20des=20boutons=20d'actions=20suite=20=E0=20une=20erreur=20?= =?UTF-8?q?de=20syntaxe=20dans=20le=20lien.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/facture.php | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 4ed3a3ad801..4fdfc7980c6 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -263,13 +263,21 @@ if ($action == 'send') if (is_readable($file)) { - $sendto = $soc->contact_get_email($HTTP_POST_VARS["destinataire"]); - $sendtoid = $HTTP_POST_VARS["destinataire"]; + if ($HTTP_POST_VARS["sendto"]) { + // Le destinataire a été fourni via le champ libre + $sendto = $HTTP_POST_VARS["sendto"]; + $sendtoid = 0; + } + else { + // Le destinataire a été fourni via la liste déroulante + $sendto = $soc->contact_get_email($HTTP_POST_VARS["destinataire"]); + $sendtoid = $HTTP_POST_VARS["destinataire"]; + } if (strlen($sendto)) { $subject = "Facture $fac->ref"; - $message = "Veuillez trouver ci-joint la facture $fac->ref\n\nCordialement\n\n"; + $message = $HTTP_POST_VARS["message"]; $filename = $fac->ref.".pdf"; $replyto = $HTTP_POST_VARS["replytoname"] . " <".$HTTP_POST_VARS["replytomail"] .">"; @@ -281,7 +289,7 @@ if ($action == 'send') $sendto = htmlentities($sendto); $sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm (datea,fk_action,fk_soc,note,fk_facture, fk_contact,fk_user_author, label, percent) VALUES (now(), '9' ,'$fac->socidp' ,'Envoyée à $sendto','$fac->id','$sendtoid','$user->id', 'Envoi Facture par mail',100);"; - + if (! $db->query($sql) ) { print $db->error(); @@ -980,7 +988,7 @@ else // Emettre paiement if ($fac->statut == 1 && $resteapayer > 0 && $user->rights->facture->paiement) { - print 'Emettre un paiement'; + print "id."&action=create\">Emettre un paiement"; } // Classer 'payé' @@ -1103,18 +1111,24 @@ else print ''; print "

Envoyer la facture par mail"; - print ""; - print ""; - print ""; - print '"; + + print '"; + + print "
Expéditeur$from_name$from_mail  
Reply-to$replytoname$replytomail  
Destinataire'; + print ""; + print ""; + print ""; + print '"; - print "
Expéditeur$from_name$from_mail  
Répondre à$replytoname$replytomail  
Destinataire'; $form = new Form($db); $form->select_array("destinataire",$soc->contact_email_array()); - print "email\">
"; + print " ou email\">
Message'; + print "

\n"; - print ""; + print "

\n"; } if ($action == 'prerelance')