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 '
'; @@ -3953,6 +3957,7 @@ if ($action == 'create') // Tableau des parametres complementaires du post $formmail->param['action'] = $action; $formmail->param['models'] = $modelmail; + $formmail->param['models_id']=GETPOST('modelmailselected','int'); $formmail->param['facid'] = $object->id; $formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id; diff --git a/htdocs/compta/facture/mergepdftool.php b/htdocs/compta/facture/mergepdftool.php index dfa1207e423..efe16af1fb9 100644 --- a/htdocs/compta/facture/mergepdftool.php +++ b/htdocs/compta/facture/mergepdftool.php @@ -530,6 +530,9 @@ if ($resql) print '
'; + if (!empty(GETPOST('modelselected'))) { + $action = 'presend'; + } if (! empty($mode) && $action == 'presend') { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; @@ -572,6 +575,7 @@ if ($resql) // Tableau des parametres complementaires du post $formmail->param['action']=$action; $formmail->param['models']=$modelmail; + $formmail->param['models_id']=GETPOST('modelmailselected','int'); $formmail->param['facid']=$object->id; $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 5e38dd10531..e9220bad08f 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -291,8 +291,8 @@ class FormMail extends Form foreach($this->lines_model as $line) { $modelmail_array[$line->id]=$line->label; } - var_dump($modelmail_array); - if (count($modelmail_array>0)) { + + if (count($modelmail_array)>0) { $out.= ''; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index fa451f74f1c..c937d5a3621 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1513,6 +1513,10 @@ else if ($id || $ref) /* * Action presend */ + //Select mail models is same action as presend + if (!empty(GETPOST('modelselected'))) { + $action = 'presend'; + } if ($action == 'presend') { $ref = dol_sanitizeFileName($object->ref); @@ -1611,6 +1615,7 @@ else if ($id || $ref) // Tableau des parametres complementaires $formmail->param['action']='send'; $formmail->param['models']='shipping_send'; + $formmail->param['models_id']=GETPOST('modelmailselected','int'); $formmail->param['shippingid']=$object->id; $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index e95b14398a2..d1fb92a33ab 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1732,6 +1732,9 @@ else if ($id > 0 || ! empty($ref)) /* * Action presend */ + if (!empty(GETPOST('modelselected'))) { + $action = 'presend'; + } if ($action == 'presend') { $ref = dol_sanitizeFileName($object->ref); @@ -1819,6 +1822,7 @@ else if ($id > 0 || ! empty($ref)) // Tableau des parametres complementaires $formmail->param['action']='send'; $formmail->param['models']='fichinter_send'; + $formmail->param['models_id']=GETPOST('modelmailselected','int'); $formmail->param['fichinter_id']=$object->id; $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index e50095a6048..fd6c076ecf7 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2246,6 +2246,9 @@ elseif (! empty($object->id)) /* * Action presend */ + if (!empty(GETPOST('modelselected'))) { + $action = 'presend'; + } if ($action == 'presend') { $ref = dol_sanitizeFileName($object->ref); @@ -2338,6 +2341,7 @@ elseif (! empty($object->id)) // Tableau des parametres complementaires $formmail->param['action']='send'; $formmail->param['models']='order_supplier_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/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 1691efc78a5..1de0e1f2e7e 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2501,6 +2501,9 @@ else /* * Show mail form */ + if (!empty(GETPOST('modelselected'))) { + $action = 'presend'; + } if ($action == 'presend') { $ref = dol_sanitizeFileName($object->ref); @@ -2587,6 +2590,7 @@ else // Tableau des parametres complementaires $formmail->param['action']='send'; $formmail->param['models']='invoice_supplier_send'; + $formmail->param['models_id']=GETPOST('modelmailselected','int'); $formmail->param['facid']=$object->id; $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
'."\n"; $out.= $langs->trans('SelectMailModel').':'.$this->selectarray('modelmailselected', $modelmail_array,$model_id); $out.= '