Qual: Removed duplicate code
Qual: Removed deprecated warning
This commit is contained in:
parent
0fb126a7e3
commit
bd90d7979d
@ -591,19 +591,19 @@ else
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
// Warning 1
|
|
||||||
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
|
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
|
||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
/*
|
||||||
|
// Warning 1
|
||||||
if ($linuxlike)
|
if ($linuxlike)
|
||||||
{
|
{
|
||||||
$sendmailoption=ini_get('mail.force_extra_parameters');
|
$sendmailoption=ini_get('mail.force_extra_parameters');
|
||||||
//print 'x'.$sendmailoption;
|
|
||||||
if (empty($sendmailoption) || ! preg_match('/ba/',$sendmailoption))
|
if (empty($sendmailoption) || ! preg_match('/ba/',$sendmailoption))
|
||||||
{
|
{
|
||||||
print info_admin($langs->trans("SendmailOptionNotComplete"));
|
print info_admin($langs->trans("SendmailOptionNotComplete"));
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
// Warning 2
|
// Warning 2
|
||||||
print info_admin($langs->trans("SendmailOptionMayHurtBuggedMTA"));
|
print info_admin($langs->trans("SendmailOptionMayHurtBuggedMTA"));
|
||||||
}
|
}
|
||||||
@ -657,11 +657,11 @@ else
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affichage formulaire de TEST simple
|
// Show email send test form
|
||||||
if ($action == 'test')
|
if ($action == 'test' || $action == 'testhtml')
|
||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print_titre($langs->trans("DoTestSend"));
|
print_titre($action == 'testhtml'?$langs->trans("DoTestSendHTML"):$langs->trans("DoTestSend"));
|
||||||
|
|
||||||
// Cree l'objet formulaire mail
|
// Cree l'objet formulaire mail
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
@ -678,62 +678,16 @@ else
|
|||||||
$formmail->withtopic=(isset($_POST['subject'])?$_POST['subject']:$langs->trans("Test"));
|
$formmail->withtopic=(isset($_POST['subject'])?$_POST['subject']:$langs->trans("Test"));
|
||||||
$formmail->withtopicreadonly=0;
|
$formmail->withtopicreadonly=0;
|
||||||
$formmail->withfile=2;
|
$formmail->withfile=2;
|
||||||
$formmail->withbody=(isset($_POST['message'])?$_POST['message']:$langs->trans("PredefinedMailTest"));
|
$formmail->withbody=(isset($_POST['message'])?$_POST['message']:($action == 'testhtml'?$langs->trans("PredefinedMailTestHtml"):$langs->trans("PredefinedMailTest")));
|
||||||
$formmail->withbodyreadonly=0;
|
$formmail->withbodyreadonly=0;
|
||||||
$formmail->withcancel=1;
|
$formmail->withcancel=1;
|
||||||
$formmail->withdeliveryreceipt=1;
|
$formmail->withdeliveryreceipt=1;
|
||||||
$formmail->withfckeditor=0;
|
$formmail->withfckeditor=($action == 'testhtml'?1:0);
|
||||||
// Tableau des substitutions
|
|
||||||
$formmail->substit=$substitutionarrayfortest;
|
|
||||||
// Tableau des parametres complementaires du post
|
|
||||||
$formmail->param["action"]="send";
|
|
||||||
$formmail->param["models"]="body";
|
|
||||||
$formmail->param["mailid"]=0;
|
|
||||||
$formmail->param["returnurl"]=$_SERVER["PHP_SELF"];
|
|
||||||
|
|
||||||
// Init list of files
|
|
||||||
if (GETPOST("mode")=='init')
|
|
||||||
{
|
|
||||||
$formmail->clear_attached_files();
|
|
||||||
}
|
|
||||||
|
|
||||||
$formmail->show_form('addfile','removefile');
|
|
||||||
|
|
||||||
print '<br>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Affichage formulaire de TEST HTML
|
|
||||||
if ($action == 'testhtml')
|
|
||||||
{
|
|
||||||
print '<br>';
|
|
||||||
print_titre($langs->trans("DoTestSendHTML"));
|
|
||||||
|
|
||||||
// Cree l'objet formulaire mail
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
|
||||||
$formmail = new FormMail($db);
|
|
||||||
$formmail->fromname = (isset($_POST['fromname'])?$_POST['fromname']:$conf->global->MAIN_MAIL_EMAIL_FROM);
|
|
||||||
$formmail->frommail = (isset($_POST['frommail'])?$_POST['frommail']:$conf->global->MAIN_MAIL_EMAIL_FROM);
|
|
||||||
$formmail->withfromreadonly=0;
|
|
||||||
$formmail->withsubstit=0;
|
|
||||||
$formmail->withfrom=1;
|
|
||||||
$formmail->witherrorsto=1;
|
|
||||||
$formmail->withto=(! empty($_POST['sendto'])?$_POST['sendto']:($user->email?$user->email:1));
|
|
||||||
$formmail->withtocc=(! empty($_POST['sendtocc'])?$_POST['sendtocc']:1); // ! empty to keep field if empty
|
|
||||||
$formmail->withtoccc=(! empty($_POST['sendtoccc'])?$_POST['sendtoccc']:1); // ! empty to keep field if empty
|
|
||||||
$formmail->withtopic=(isset($_POST['subject'])?$_POST['subject']:$langs->trans("Test"));
|
|
||||||
$formmail->withtopicreadonly=0;
|
|
||||||
$formmail->withfile=2;
|
|
||||||
$formmail->withbody=(isset($_POST['message'])?$_POST['message']:$langs->trans("PredefinedMailTestHtml"));
|
|
||||||
//$formmail->withbody='Test <b>aaa</b> __LOGIN__';
|
|
||||||
$formmail->withbodyreadonly=0;
|
|
||||||
$formmail->withcancel=1;
|
|
||||||
$formmail->withdeliveryreceipt=1;
|
|
||||||
$formmail->withfckeditor=1;
|
|
||||||
$formmail->ckeditortoolbar='dolibarr_mailings';
|
$formmail->ckeditortoolbar='dolibarr_mailings';
|
||||||
// Tableau des substitutions
|
// Tableau des substitutions
|
||||||
$formmail->substit=$substitutionarrayfortest;
|
$formmail->substit=$substitutionarrayfortest;
|
||||||
// Tableau des parametres complementaires du post
|
// Tableau des parametres complementaires du post
|
||||||
$formmail->param["action"]="sendhtml";
|
$formmail->param["action"]=($action == 'testhtml'?"sendhtml":"send");
|
||||||
$formmail->param["models"]="body";
|
$formmail->param["models"]="body";
|
||||||
$formmail->param["mailid"]=0;
|
$formmail->param["mailid"]=0;
|
||||||
$formmail->param["returnurl"]=$_SERVER["PHP_SELF"];
|
$formmail->param["returnurl"]=$_SERVER["PHP_SELF"];
|
||||||
@ -744,7 +698,7 @@ else
|
|||||||
$formmail->clear_attached_files();
|
$formmail->clear_attached_files();
|
||||||
}
|
}
|
||||||
|
|
||||||
$formmail->show_form('addfilehtml','removefilehtml');
|
$formmail->show_form(($action == 'testhtml'?'addfilehtml':'addfile'),($action == 'testhtml'?'removefilehtml':'removefile'));
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user