All send email card works with model choice box
This commit is contained in:
parent
cc887ceff3
commit
b7191a541c
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -3733,6 +3733,10 @@ if ($action == 'create')
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
//Select mail models is same action as presend
|
||||
if (!empty(GETPOST('modelselected'))) {
|
||||
$action = 'presend';
|
||||
}
|
||||
if ($action != 'prerelance' && $action != 'presend')
|
||||
{
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -530,6 +530,9 @@ if ($resql)
|
||||
|
||||
print '<form id="form_unpaid" method="POST" action="'.$_SERVER["PHP_SELF"].'?sortfield='. $sortfield .'&sortorder='. $sortorder .'">';
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@ -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.= '<table class="nobordernopadding" width="100%"><tr><td width="20%">'."\n";
|
||||
$out.= $langs->trans('SelectMailModel').':'.$this->selectarray('modelmailselected', $modelmail_array,$model_id);
|
||||
$out.= '</td>';
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user