diff --git a/htdocs/comm/askpricesupplier/card.php b/htdocs/comm/askpricesupplier/card.php
index 3a3b283f8e9..3e6abe98b2d 100644
--- a/htdocs/comm/askpricesupplier/card.php
+++ b/htdocs/comm/askpricesupplier/card.php
@@ -1730,6 +1730,9 @@ if ($action == 'create')
/*
* Action presend
*/
+ if (!empty(GETPOST('modelselected'))) {
+ $action = 'presend';
+ }
if ($action == 'presend')
{
$object->fetch_projet();
@@ -1802,6 +1805,7 @@ if ($action == 'create')
// Tableau des parametres complementaires
$formmail->param['action'] = 'send';
$formmail->param['models'] = 'askpricesupplier_send';
+ $formmail->param['models_id']=GETPOST('modelmailselected','int');
$formmail->param['id'] = $object->id;
$formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
// Init list of files
diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index f0a4b6f1f79..e6876637dcf 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -2307,6 +2307,10 @@ if ($action == 'create')
/*
* Action presend
*/
+ //Select mail models is same action as presend
+ if (!empty(GETPOST('modelselected'))) {
+ $action = 'presend';
+ }
if ($action == 'presend')
{
$object->fetch_projet();
@@ -2401,6 +2405,7 @@ if ($action == 'create')
// Tableau des parametres complementaires
$formmail->param['action'] = 'send';
$formmail->param['models'] = 'propal_send';
+ $formmail->param['models_id']=GETPOST('modelmailselected','int');
$formmail->param['id'] = $object->id;
$formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
// Init list of files
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 294445705ed..0ffb3807467 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -2396,6 +2396,7 @@ if ($action == 'create' && $user->rights->commande->creer)
// Tableau des parametres complementaires
$formmail->param['action'] = 'send';
$formmail->param['models'] = 'order_send';
+ $formmail->param['models_id']=GETPOST('modelmailselected','int');
$formmail->param['orderid'] = $object->id;
$formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 4d8ed6007e3..169e499b619 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -3733,6 +3733,10 @@ if ($action == 'create')
}
print '
';
+ //Select mail models is same action as presend
+ if (!empty(GETPOST('modelselected'))) {
+ $action = 'presend';
+ }
if ($action != 'prerelance' && $action != 'presend')
{
print '