diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 18f6ded2c5f..f86936a7967 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -1303,6 +1303,8 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'relance') && ! $_POST['a
$mesg='
'.$langs->trans('ErrorFailedToReadEntity',$langs->trans("Invoice")).'
';
dol_syslog('Impossible de lire les données de la facture. Le fichier facture n\'a peut-être pas été généré.');
}
+
+ $_GET['action'] = 'presend';
}
/*
diff --git a/htdocs/html.formmail.class.php b/htdocs/html.formmail.class.php
index eab47db8d84..7501740fd37 100644
--- a/htdocs/html.formmail.class.php
+++ b/htdocs/html.formmail.class.php
@@ -284,11 +284,11 @@ class FormMail
}
else
{
- print "withto)?"30":"60")."\" name=\"sendto\" value=\"".(! is_array($this->withto) && ! is_numeric($this->withto)?$this->withto:"")."\">";
+ print "withto)?"30":"60")."\" name=\"sendto\" value=\"".(! is_array($this->withto) && ! is_numeric($this->withto)? (isset($_POST["sendto"])?$_POST["sendto"]:$this->withto) :"")."\">";
if (is_array($this->withto))
{
print " ".$langs->trans("or")." ";
- $form->select_array("receiver",$this->withto);
+ print $form->selectarray("receiver", isset($_POST["receiver"])?$_POST["receiver"]:$this->withto);
}
}
print "\n";
@@ -306,11 +306,11 @@ class FormMail
}
else
{
- print "withtocc)?"30":"60")."\" name=\"sendtocc\" value=\"".((! is_array($this->withtocc) && ! is_numeric($this->withtocc))?$this->withtocc:"")."\">";
+ print "withtocc)?"30":"60")."\" name=\"sendtocc\" value=\"".((! is_array($this->withtocc) && ! is_numeric($this->withtocc))? (isset($_POST["sendtocc"])?$_POST["sendtocc"]:$this->withtocc) : (isset($_POST["sendtocc"])?$_POST["sendtocc"]:"") )."\">";
if (is_array($this->withtocc))
{
print " ".$langs->trans("or")." ";
- $form->select_array("receivercc",$this->withtocc);
+ $form->select_array("receivercc", isset($_POST["receivercc"])?$_POST["receivercc"]:$this->withtocc);
}
}
print "\n";
@@ -328,11 +328,11 @@ class FormMail
}
else
{
- print "withtoccc)?"30":"60")."\" name=\"sendtoccc\" value=\"".((! is_array($this->withtoccc) && ! is_numeric($this->withtoccc))?$this->withtoccc:"")."\">";
+ print "withtoccc)?"30":"60")."\" name=\"sendtoccc\" value=\"".((! is_array($this->withtoccc) && ! is_numeric($this->withtoccc))? (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:$this->withtoccc) : (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:"") )."\">";
if (is_array($this->withtoccc))
{
print " ".$langs->trans("or")." ";
- $form->select_array("receiverccc",$this->withtoccc);
+ $form->select_array("receiverccc", isset($_POST["receiverccc"])?$_POST["receiverccc"]:$this->withtoccc);
}
}
print "\n";
@@ -349,7 +349,7 @@ class FormMail
}
else
{
- print $form->selectyesno('deliveryreceipt',0,1);
+ print $form->selectyesno('deliveryreceipt', (isset($_POST["deliveryreceipt"])?$_POST["deliveryreceipt"]:0) ,1);
}
print "\n";
@@ -370,7 +370,7 @@ class FormMail
}
else
{
- print "withtopic."\">";
+ print "withtopic) ."\">";
}
print "\n";
}
@@ -417,6 +417,7 @@ class FormMail
if ($this->param["models"]=='order_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendOrder"); }
$defaultmessage=make_substitutions($defaultmessage,$this->substit);
+ if (isset($_POST["message"])) $defaultmessage=$_POST["message"];
print "";
print "| ".$langs->trans("MailText")." | ";