From 557a9c199fc20a9b6f93afdd1674c066d5f5a633 Mon Sep 17 00:00:00 2001 From: erics Date: Sat, 6 Nov 2004 08:59:26 +0000 Subject: [PATCH] =?UTF-8?q?ajout=20de=20copie=20=E0=20et=20envoyer=20un=20?= =?UTF-8?q?autre=20fichier=20joint=20=E0=20l'envoi=20des=20factures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/facture.php | 86 ++++++++++++++++++++++++--------------- 1 file changed, 53 insertions(+), 33 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 9dea49b1b90..8160f798db3 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -358,13 +358,19 @@ if ($_POST["action"] == 'send' || $_POST["action"] == 'relance') $actionmsg2="Relance Facture par mail"; } $message = $_POST["message"]; - $filename = $fac->ref.".pdf"; - $replyto = $_POST["replytoname"] . " <".$_POST["replytomail"] .">"; - + + $filepath[0] = $file; + $filename[0] = $fac->ref.".pdf"; + $mimetype[0] = "application/pdf"; + $filepath[1] = $_FILES['addedfile']['tmp_name']; + $filename[1] = $_FILES['addedfile']['name']; + $mimetype[1] = $_FILES['addedfile']['type']; + $replyto = $_POST["replytoname"]. " <".$_POST["replytomail"].">"; + // Envoi de la facture - $mailfile = new CMailFile($subject,$sendto,$replyto,$message,array ($file),array ("application/pdf"),array ($filename)); - + $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath, $mimetype,$filename,$sendtocc); + if ( $mailfile->sendfile() ) { $sendto = htmlentities($sendto); @@ -1291,27 +1297,34 @@ else $replytomail = $user->email; $from_mail = $replytomail; - $form = new Form($db); + $form = new Form($db); - print "
\n"; + print "\n"; print ''; print ''; print ''; print ''; - print '
'; + print "
\n"; // From - print ""; - print ""; - print ""; - print "
".$langs->trans("MailFrom")."$from_name".($from_mail?" <$from_mail>":"")."
".$langs->trans("MailReply")."$replytoname".($replytomail?" <$replytomail>":""); - print "
"; + print "\n"; + print " \n"; + print " \n"; // To - print "
".$langs->trans("MailFrom")."$from_name".($from_mail?" <$from_mail>":"")."
".$langs->trans("MailReply")."$replytoname".($replytomail?" <$replytomail>":""); + print "
"; - print '"; + print " ".$langs->trans("or")." email\">\n"; + + // CC + print ' \n"; + + // File + print " \n"; + + print "
'.$langs->trans("MailTo").''; + print '
'.$langs->trans("MailTo").''; $form->select_array("receiver",$soc->contact_email_array()); - print " ".$langs->trans("or")." email\">
'.$langs->trans("MailCC").''; + print "
" . $langs->trans("MailFile"). "
"; // Topic + Message $defaultmessage="Veuillez trouver ci-joint la facture $fac->ref\n\nCordialement\n\n"; @@ -1319,7 +1332,7 @@ else print "
trans("Send")."\">
\n"; - print "
\n"; + print "\n"; } if ($_GET["action"] == 'prerelance') @@ -1336,7 +1349,7 @@ else $form = new Form($db); - print "
\n"; + print "\n"; print ''; print ''; print ''; @@ -1344,25 +1357,32 @@ else print '
'; // From - print ""; - print ""; - print ""; - print "
".$langs->trans("MailFrom")."$from_name".($from_mail?" <$from_mail>":"")."
".$langs->trans("MailReply")."$replytoname".($replytomail?" <$replytomail>":""); - print "
"; + print "\n"; + print " \n"; + print " \n"; // To - print "
".$langs->trans("MailFrom")."$from_name".($from_mail?" <$from_mail>":"")."
".$langs->trans("MailReply")."$replytoname".($replytomail?" <$replytomail>":""); + print "
"; - print '"; - - // Affiche la partie mail topic + message + file + print " ".$langs->trans("or")." email\">\n"; + + // CC + print ' \n"; + + // File + print " \n"; + + print "
'.$langs->trans("MailTo").''; + print '
'.$langs->trans("MailTo").''; $form->select_array("receiver",$soc->contact_email_array()); - print " ".$langs->trans("or")." email\">
'.$langs->trans("MailCC").''; + print "
" . $langs->trans("MailFile"). "
"; + + // Topic + Message $defaultmessage="Nous apportons à votre connaissance que la facture ".$fac->ref." ne semble toujours pas avoir été réglée. La voici donc, pour rappel, en pièce jointe.\n\nCordialement\n\n"; - $form->mail_topicmessagefile(0,1,0,$defaultmessage); - - print "
trans("Send")."\">
\n"; - - print "mail_topicmessagefile(0,1,0,$defaultmessage); + + print "
trans("Send")."\">
\n"; + + print "