Message erreur plus detaillé sur fonction test mailing

This commit is contained in:
Laurent Destailleur 2006-11-01 15:50:17 +00:00
parent 736dca48c5
commit 7b94bf75d7
2 changed files with 13 additions and 6 deletions

View File

@ -63,6 +63,18 @@ if ($_POST["action"] == 'send')
$mil->sujet = $_POST["subject"]; $mil->sujet = $_POST["subject"];
$mil->body = $_POST["message"]; $mil->body = $_POST["message"];
if (! $mil->sendto)
{
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("MailTo")).'</div>';
}
if (! $mil->sujet)
{
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("MailTopic")).'</div>';
}
if (! $mil->body)
{
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("MailMessage")).'</div>';
}
if ($mil->sendto && $mil->sujet && $mil->body) if ($mil->sendto && $mil->sujet && $mil->body)
{ {
require_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php");
@ -96,11 +108,6 @@ if ($_POST["action"] == 'send')
$_GET["action"]=''; $_GET["action"]='';
$_GET["id"]=$mil->id; $_GET["id"]=$mil->id;
} }
else
{
$message='<div class="error">'.$langs->trans("ErrorUnknown").'</div>';
}
} }
// Action ajout mailing // Action ajout mailing

View File

@ -43,5 +43,5 @@ $target[n]=array('email'=>'email_n','name'=>'name_n','firstname'=>'firstname_n')
***** STEP 3 ***** ***** STEP 3 *****
Once this file has been edited, you can go to the Dolibarr emailing feature, Once this file has been edited, you can go to the Dolibarr emailing feature,
you will see a new line selector in the "target" editor of emailings. you will see a new line selector in the "targets" editor of emailing tool.