diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 6f39b544ab5..86fce072926 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -458,7 +458,7 @@ if ($_GET["id"]) print ''; print ''.$langs->trans("DateCreation").''.strftime('%d %B %Y %H:%M',$act->date).''; print ''.$langs->trans("Author").''.$act->author->fullname.''; - print ''.$langs->trans("PercentDone").'%'; + print ''.$langs->trans("PercentDone").'%'; if ($act->objet_url) { print ''.$langs->trans("LinkedObject").''; @@ -486,7 +486,7 @@ if ($_GET["id"]) print ''.$act->contact->fullname.''; print ''.$langs->trans("DateCreation").''.strftime('%d %B %Y %H:%M',$act->date).''; print ''.$langs->trans("Author").''.$act->author->fullname.''; - print ''.$langs->trans("PercentDone").''.$act->percent.' %'; + print ''.$langs->trans("PercentDone").''.$act->percent.' %'; if ($act->objet_url) { print ''.$langs->trans("LinkedObject").''; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 7c4e4489629..2274763d4b3 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -379,21 +379,29 @@ if ($_POST["action"] == 'send' || $_POST["action"] == 'relance') if (strlen($sendto)) { + $from = $_POST["fromname"] . " <" . $_POST["frommail"] .">"; + $replyto = $_POST["replytoname"]. " <" . $_POST["replytomail"].">"; + $message = $_POST["message"]; if ($_POST["action"] == 'send') { $subject = $langs->trans("Bill")." $fac->ref"; $actioncode=9; - $actionmsg="Envoyée à $sendto"; + $actionmsg ="Mail envoyé par $from à $sendto.
"; + if ($message) { + $actionmsg.="Texte utilisé dans le corps du message:
"; + $actionmsg.="$message"; + } $actionmsg2="Envoi Facture par mail"; } if ($_POST["action"] == 'relance') { $subject = "Relance facture $fac->ref"; $actioncode=10; - $actionmsg="Relance envoyée à $sendto"; + $actionmsg="Mail envoyé par $from à $sendto.
"; + if ($message) { + $actionmsg.="Texte utilisé dans le corps du message:
"; + $actionmsg.="$message"; + } $actionmsg2="Relance Facture par mail"; } - $message = $_POST["message"]; - $from = $_POST["fromname"] . " <" . $_POST["frommail"] .">"; - $replyto = $_POST["replytoname"]. " <" . $_POST["replytomail"].">"; $filepath[0] = $file; $filename[0] = $fac->ref.".pdf"; @@ -405,13 +413,15 @@ if ($_POST["action"] == 'send' || $_POST["action"] == 'relance') // Envoi de la facture $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath, $mimetype,$filename,$sendtocc); - if ( $mailfile->sendfile() ) + if (! $mailfile->sendfile()) { $msg='
'.$langs->trans("MailSuccessfulySent",$from,$sendto).'.
'; $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(), '$actioncode' ,'$fac->socidp' ,'$actionmsg','$fac->id','$sendtoid','$user->id', '$actionmsg2',100);"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm"; + $sql.= "(datea,fk_action,fk_soc,note,fk_facture,fk_contact,fk_user_author,label,percent)"; + $sql.= " VALUES (now(), '$actioncode' ,'$fac->socidp' ,'".addslashes($actionmsg)."','$fac->id','$sendtoid','$user->id', '$actionmsg2',100);"; if (! $db->query($sql) ) { @@ -1349,7 +1359,7 @@ else * Liste des actions propres à la facture * */ - $sql = "SELECT id, ".$db->pdate("a.datea")." as da, a.note, code"; + $sql = "SELECT id, ".$db->pdate("a.datea")." as da, a.label, a.note, code"; $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."user as u "; $sql .= " WHERE a.fk_user_author = u.rowid "; $sql .= " AND a.fk_action in (9,10) "; @@ -1377,7 +1387,7 @@ else print ""; print ''.img_object($langs->trans("ShowTask"),"task").' '.$objp->id.''; print ''.dolibarr_print_date($objp->da)."\n"; - print ''.stripslashes($objp->note).''; + print ''.stripslashes($objp->label).''; print ''.$objp->code.''; print "\n"; $i++;