diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php
index 7d4e382723c..01dcc3b5381 100644
--- a/htdocs/admin/mails.php
+++ b/htdocs/admin/mails.php
@@ -745,7 +745,7 @@ else
{
if (function_exists('fsockopen') && $port && $server)
{
- print ''.$langs->trans("DoTestServerAvailability").'';
+ print ''.$langs->trans("DoTestServerAvailability").'';
}
}
else
@@ -753,11 +753,11 @@ else
print ''.$langs->trans("DoTestServerAvailability").'';
}
- print ''.$langs->trans("DoTestSend").'';
+ print ''.$langs->trans("DoTestSend").'';
if (! empty($conf->fckeditor->enabled))
{
- print ''.$langs->trans("DoTestSendHTML").'';
+ print ''.$langs->trans("DoTestSendHTML").'';
}
print '';
@@ -834,7 +834,7 @@ else
$formmail->fromalsorobot=1;
$formmail->fromtype=(GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user'));
$formmail->withfromreadonly=1;
- $formmail->withsubstit=0;
+ $formmail->withsubstit=1;
$formmail->withfrom=1;
$formmail->witherrorsto=1;
$formmail->withto=(! empty($_POST['sendto'])?$_POST['sendto']:($user->email?$user->email:1));
diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php
index d0de3d2002f..89f3700c4f7 100644
--- a/htdocs/admin/mails_templates.php
+++ b/htdocs/admin/mails_templates.php
@@ -776,6 +776,7 @@ if ($resql)
}
if ($tmpfieldlist == 'content')
{
+ print $form->textwithpicto($langs->trans("Content"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '
';
$okforextended = true;
if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended = false;
$doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%');
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 4309c689b9e..b9043626c51 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -240,13 +240,13 @@ class FormMail extends Form
* Get the form to input an email
* this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files
* this->withfile
- * this->param: Contains more parameteres like email templates info
+ * this->param: Contains more parameters like email templates info
*
* @param string $addfileaction Name of action when posting file attachments
* @param string $removefileaction Name of action when removing file attachments
* @return string Form to show
*/
- function get_form($addfileaction='addfile',$removefileaction='removefile')
+ function get_form($addfileaction='addfile', $removefileaction='removefile')
{
global $conf, $langs, $user, $hookmanager, $form;
@@ -409,18 +409,19 @@ class FormMail extends Form
$out.= '
| ';
//$out.=' ';
- $help="";
- foreach($this->substit as $key => $val)
- {
- $help.=$key.' -> '.$langs->trans(dol_string_nohtmltag($val)).' '; - } - if (is_numeric($this->withsubstit)) $out.= $form->textwithpicto($langs->trans("EMailTestSubstitutionReplacedByGenericValues"), $help, 1, 'help', '', 0, 2, 'substittooltip'); // Old usage - else $out.= $form->textwithpicto($langs->trans('AvailableVariables'), $help, 1, 'help', '', 0, 2, 'substittooltip'); // New usage + if (is_numeric($this->withsubstit)) $out.= $form->textwithpicto($langs->trans("EMailTestSubstitutionReplacedByGenericValues"), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltip'); // Old usage + else $out.= $form->textwithpicto($langs->trans('AvailableVariables'), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltip'); // New usage $out.= " | ||
| '.$langs->trans("MailTopic").' | '; + $out.= ''; + $out.=$form->textwithpicto($langs->trans('MailTopic'), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltipfromtopic'); + $out.=' | '; $out.= ''; if ($this->withtopicreadonly) { @@ -917,7 +920,9 @@ class FormMail extends Form } $out.= ' |
| '.$langs->trans("MailText").' | '; + $out.= ''; + $out.=$form->textwithpicto($langs->trans('MailText'), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltipfrombody'); + $out.=' | '; $out.= '';
if ($this->withbodyreadonly)
{
diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php
index edeabc5865d..5baa70825d8 100644
--- a/htdocs/core/tpl/card_presend.tpl.php
+++ b/htdocs/core/tpl/card_presend.tpl.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2017-2018 Laurent Destailleur |