Fix: Problème sur les substitutions en mode tests mailing
This commit is contained in:
parent
cc83f13634
commit
28d1b60604
@ -93,7 +93,7 @@ if ($_POST["action"] == 'cotisation' && ! $_POST["cancel"])
|
|||||||
|
|
||||||
if ($adht->cotisation)
|
if ($adht->cotisation)
|
||||||
{
|
{
|
||||||
if ($conf->global->ADHERENT_BANK_USE)
|
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE)
|
||||||
{
|
{
|
||||||
if (! $_POST["label"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label"));
|
if (! $_POST["label"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label"));
|
||||||
if (! $_POST["operation"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode"));
|
if (! $_POST["operation"]) $errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode"));
|
||||||
@ -371,11 +371,12 @@ if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer)
|
|||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("Amount").'</td><td><input type="text" name="cotisation" size="6" value="'.$_POST["cotisation"].'"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
print '<tr><td>'.$langs->trans("Amount").'</td><td><input type="text" name="cotisation" size="6" value="'.$_POST["cotisation"].'"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||||
|
|
||||||
if ($conf->global->ADHERENT_BANK_USE)
|
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE)
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("FinancialAccount").'</td><td>';
|
print '<tr><td>'.$langs->trans("FinancialAccount").'</td><td>';
|
||||||
$html->select_comptes($_POST["accountid"],'accountid',0,'',1);
|
$html->select_comptes($_POST["accountid"],'accountid',0,'',1);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
}
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("PaymentMode").'</td><td>';
|
print '<tr><td>'.$langs->trans("PaymentMode").'</td><td>';
|
||||||
$html->select_types_paiements($_POST["operation"],'operation');
|
$html->select_types_paiements($_POST["operation"],'operation');
|
||||||
@ -400,7 +401,6 @@ if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer)
|
|||||||
print '<td><input name="label" type="text" size="32" value="'.$langs->trans("Subscription").' ';
|
print '<td><input name="label" type="text" size="32" value="'.$langs->trans("Subscription").' ';
|
||||||
print strftime("%Y",($adh->datefin?$adh->datefin:time())).'" ></td></tr>';
|
print strftime("%Y",($adh->datefin?$adh->datefin:time())).'" ></td></tr>';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("SendAcknowledgementByMail").'</td>';
|
print '<tr><td>'.$langs->trans("SendAcknowledgementByMail").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|||||||
@ -142,7 +142,7 @@ if ($result)
|
|||||||
print_liste_field_titre($langs->trans("Ref"),"cotisations.php","c.rowid",$param,"","",$sortfield);
|
print_liste_field_titre($langs->trans("Ref"),"cotisations.php","c.rowid",$param,"","",$sortfield);
|
||||||
print_liste_field_titre($langs->trans("Date"),"cotisations.php","c.dateadh",$param,"","",$sortfield);
|
print_liste_field_titre($langs->trans("Date"),"cotisations.php","c.dateadh",$param,"","",$sortfield);
|
||||||
print_liste_field_titre($langs->trans("Name"),"cotisations.php","d.nom",$param,"","",$sortfield);
|
print_liste_field_titre($langs->trans("Name"),"cotisations.php","d.nom",$param,"","",$sortfield);
|
||||||
if ($conf->global->ADHERENT_BANK_USE)
|
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE)
|
||||||
{
|
{
|
||||||
print_liste_field_titre($langs->trans("Bank"),"cotisations.php","b.fk_account",$pram,"","",$sortfield);
|
print_liste_field_titre($langs->trans("Bank"),"cotisations.php","b.fk_account",$pram,"","",$sortfield);
|
||||||
}
|
}
|
||||||
@ -169,7 +169,7 @@ if ($result)
|
|||||||
print '<td>'.$cotisation->getNomUrl(1).'</td>';
|
print '<td>'.$cotisation->getNomUrl(1).'</td>';
|
||||||
print '<td>'.dolibarr_print_date($objp->dateadh)."</td>\n";
|
print '<td>'.dolibarr_print_date($objp->dateadh)."</td>\n";
|
||||||
print '<td>'.$adherent->getNomUrl(1).'</td>';
|
print '<td>'.$adherent->getNomUrl(1).'</td>';
|
||||||
if ($conf->global->ADHERENT_BANK_USE)
|
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE)
|
||||||
{
|
{
|
||||||
if ($objp->fk_account)
|
if ($objp->fk_account)
|
||||||
{
|
{
|
||||||
@ -206,7 +206,7 @@ if ($result)
|
|||||||
print "<td>".$langs->trans("Total")."</td>\n";
|
print "<td>".$langs->trans("Total")."</td>\n";
|
||||||
print "<td align=\"right\"> </td>\n";
|
print "<td align=\"right\"> </td>\n";
|
||||||
print "<td align=\"right\"> </td>\n";
|
print "<td align=\"right\"> </td>\n";
|
||||||
if ($conf->global->ADHERENT_BANK_USE)
|
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE)
|
||||||
{
|
{
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -136,20 +136,28 @@ print "</td></tr>\n";
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
// Insertion cotisations dans compte financier
|
// Insertion cotisations dans compte financier
|
||||||
if ($conf->banque->enabled)
|
|
||||||
{
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<form action="adherent.php" method="POST">';
|
print '<form action="adherent.php" method="POST">';
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||||
print '<input type="hidden" name="constname" value="ADHERENT_BANK_USE">';
|
print '<input type="hidden" name="constname" value="ADHERENT_BANK_USE">';
|
||||||
print "<tr $bc[$var] class=value><td>".$langs->trans("AddSubscriptionIntoAccount").'</td><td>';
|
print "<tr $bc[$var] class=value><td>".$langs->trans("AddSubscriptionIntoAccount").'</td>';
|
||||||
|
if ($conf->banque->enabled)
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
print $form->selectyesno('constvalue',$conf->global->ADHERENT_BANK_USE,1);
|
print $form->selectyesno('constvalue',$conf->global->ADHERENT_BANK_USE,1);
|
||||||
print '</td><td align="center" width="80">';
|
print '</td><td align="center" width="80">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||||
print "</td></tr>\n";
|
print '</td>';
|
||||||
print '</form>';
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td align="right" colspan="2">';
|
||||||
|
print $langs->trans("WarningModuleNotActive",$langs->transnoentities("Module85Name")).' '.img_warning("","");
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
print "</tr>\n";
|
||||||
|
print '</form>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
|
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -38,10 +38,10 @@ if (!$user->admin)
|
|||||||
// Constante et traduction de la description du module
|
// Constante et traduction de la description du module
|
||||||
$modules = array(
|
$modules = array(
|
||||||
'SOCIETE' => 'FCKeditorForCompany',
|
'SOCIETE' => 'FCKeditorForCompany',
|
||||||
'PRODUCTDESC' => 'FCKeditorForProductDescription',
|
'PRODUCTDESC' => 'FCKeditorForProduct',
|
||||||
'PRODUCTNOTE' => 'FCKeditorForProductNote',
|
|
||||||
'DETAILS' => 'FCKeditorForProductDetails',
|
'DETAILS' => 'FCKeditorForProductDetails',
|
||||||
'MAILING' => 'FCKeditorForMailing'
|
'MAILING' => 'FCKeditorForMailing',
|
||||||
|
'MEMBER' => 'FCKeditorForMembers'
|
||||||
);
|
);
|
||||||
// Conditions pour que l'option soit proposée
|
// Conditions pour que l'option soit proposée
|
||||||
$conditions = array(
|
$conditions = array(
|
||||||
@ -49,7 +49,16 @@ $conditions = array(
|
|||||||
'PRODUCTDESC' => ($conf->produit->enabled||$conf->service->enabled),
|
'PRODUCTDESC' => ($conf->produit->enabled||$conf->service->enabled),
|
||||||
'PRODUCTNOTE' => ($conf->produit->enabled||$conf->service->enabled),
|
'PRODUCTNOTE' => ($conf->produit->enabled||$conf->service->enabled),
|
||||||
'DETAILS' => ($conf->facture->enabled||$conf->propal->enabled||$conf->commande->enabled),
|
'DETAILS' => ($conf->facture->enabled||$conf->propal->enabled||$conf->commande->enabled),
|
||||||
'MAILING' => $conf->mailing->enabled
|
'MAILING' => $conf->mailing->enabled,
|
||||||
|
'MEMBER' => $conf->adherent->enabled
|
||||||
|
);
|
||||||
|
// Picto
|
||||||
|
$picto = array(
|
||||||
|
'SOCIETE' => 'company',
|
||||||
|
'PRODUCTDESC' => 'product',
|
||||||
|
'DETAILS' => 'generic',
|
||||||
|
'MAILING' => 'email',
|
||||||
|
'MEMBER' => 'user'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -105,7 +114,7 @@ $var=true;
|
|||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("ActivateFCKeditor").'</td>';
|
print '<td colspan="2">'.$langs->trans("ActivateFCKeditor").'</td>';
|
||||||
print '<td align="center" width="20"> </td>';
|
print '<td align="center" width="20"> </td>';
|
||||||
print '<td align="center" width="100">'.$langs->trans("Action").'</td>';
|
print '<td align="center" width="100">'.$langs->trans("Action").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
@ -118,6 +127,7 @@ foreach($modules as $const => $desc)
|
|||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
|
print '<td width="16">'.img_object("",$picto[$const]).'</td>';
|
||||||
print '<td>'.$langs->trans($desc).'</td>';
|
print '<td>'.$langs->trans($desc).'</td>';
|
||||||
print '<td align="center" width="20">';
|
print '<td align="center" width="20">';
|
||||||
|
|
||||||
|
|||||||
@ -36,9 +36,22 @@ $user->getrights("mailing");
|
|||||||
if (! $user->rights->mailing->lire || $user->societe_id > 0)
|
if (! $user->rights->mailing->lire || $user->societe_id > 0)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
$message = '';
|
$message = '';
|
||||||
|
|
||||||
|
// Tableau des substitutions possibles
|
||||||
|
$substitutionarray=array(
|
||||||
|
'__ID__' => 'IdRecord',
|
||||||
|
'__EMAIL__' => 'EMail',
|
||||||
|
'__LASTNAME__' => 'Lastname',
|
||||||
|
'__FIRSTNAME__' => 'Firstname'
|
||||||
|
);
|
||||||
|
$substitutionarrayfortest=array(
|
||||||
|
'__ID__' => 'TESTIdRecord',
|
||||||
|
'__EMAIL__' => 'TESTEMail',
|
||||||
|
'__LASTNAME__' => 'TESTLastname',
|
||||||
|
'__FIRSTNAME__' => 'TESTFirstname'
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// Action envoi mailing pour tous
|
// Action envoi mailing pour tous
|
||||||
if ($_GET["action"] == 'sendall')
|
if ($_GET["action"] == 'sendall')
|
||||||
@ -51,7 +64,7 @@ if ($_GET["action"] == 'sendall')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Action envoi test mailing
|
// Action envoi test mailing
|
||||||
if ($_POST["action"] == 'send')
|
if ($_POST["action"] == 'send' && ! $_POST["cancel"])
|
||||||
{
|
{
|
||||||
$mil = new Mailing($db);
|
$mil = new Mailing($db);
|
||||||
$result=$mil->fetch($_POST["mailid"]);
|
$result=$mil->fetch($_POST["mailid"]);
|
||||||
@ -74,6 +87,10 @@ if ($_POST["action"] == 'send')
|
|||||||
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING) $msgishtml=1;
|
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING) $msgishtml=1;
|
||||||
if (eregi('[ \t]*<html>',$message)) $msgishtml=1;
|
if (eregi('[ \t]*<html>',$message)) $msgishtml=1;
|
||||||
|
|
||||||
|
// Pratique les substitutions sur le sujet et message
|
||||||
|
$mil->sujet=make_substitutions($mil->sujet,$substitutionarrayfortest);
|
||||||
|
$mil->body=make_substitutions($mil->body,$substitutionarrayfortest);
|
||||||
|
|
||||||
$mailfile = new CMailFile($mil->sujet,$mil->sendto,$mil->email_from,$mil->body,
|
$mailfile = new CMailFile($mil->sujet,$mil->sendto,$mil->email_from,$mil->body,
|
||||||
$arr_file,$arr_mime,$arr_name,
|
$arr_file,$arr_mime,$arr_name,
|
||||||
'', '', 0, $msgishtml);
|
'', '', 0, $msgishtml);
|
||||||
@ -85,7 +102,7 @@ if ($_POST["action"] == 'send')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$message='<div class="error">'.$langs->trans("ResultKo").'<br>'.$mailfile->error.'</div>';
|
$message='<div class="error">'.$langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result.'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$_GET["action"]='';
|
$_GET["action"]='';
|
||||||
@ -239,10 +256,10 @@ if ($_GET["action"] == 'create')
|
|||||||
print '<tr><td width="25%">'.$langs->trans("MailTopic").'</td><td><input class="flat" name="sujet" size="60" value=""></td></tr>';
|
print '<tr><td width="25%">'.$langs->trans("MailTopic").'</td><td><input class="flat" name="sujet" size="60" value=""></td></tr>';
|
||||||
print '<tr><td width="25%" valign="top">'.$langs->trans("MailMessage").'<br>';
|
print '<tr><td width="25%" valign="top">'.$langs->trans("MailMessage").'<br>';
|
||||||
print '<br><i>'.$langs->trans("CommonSubstitutions").':<br>';
|
print '<br><i>'.$langs->trans("CommonSubstitutions").':<br>';
|
||||||
print '__ID__ = '.$langs->trans("IdRecord").'<br>';
|
foreach($substitutionarray as $key => $val)
|
||||||
print '__EMAIL__ = '.$langs->trans("EMail").'<br>';
|
{
|
||||||
print '__LASTNAME__ = '.$langs->trans("Lastname").'<br>';
|
print $key.' = '.$langs->trans($val).'<br>';
|
||||||
print '__FIRSTNAME__ = '.$langs->trans("Firstname").'<br>';
|
}
|
||||||
print '</i></td>';
|
print '</i></td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
// éditeur wysiwyg
|
// éditeur wysiwyg
|
||||||
@ -292,13 +309,6 @@ else
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Confirmation de l'approbation du mailing
|
|
||||||
if ($_GET["action"] == 'approve')
|
|
||||||
{
|
|
||||||
$html->form_confirm("fiche.php?id=".$mil->id,"Approuver le mailing","Confirmez-vous l'approbation du mailing ?","confirm_approve");
|
|
||||||
print '<br>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Confirmation de la suppression
|
// Confirmation de la suppression
|
||||||
if ($_GET["action"] == 'delete')
|
if ($_GET["action"] == 'delete')
|
||||||
{
|
{
|
||||||
@ -394,7 +404,7 @@ else
|
|||||||
print '<br /><br /></div>';
|
print '<br /><br /></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Affichage formulaire de TEST
|
||||||
if ($_GET["action"] == 'test')
|
if ($_GET["action"] == 'test')
|
||||||
{
|
{
|
||||||
print_titre($langs->trans("TestMailing"));
|
print_titre($langs->trans("TestMailing"));
|
||||||
@ -404,6 +414,7 @@ else
|
|||||||
$formmail = new FormMail($db);
|
$formmail = new FormMail($db);
|
||||||
$formmail->fromname = $mil->email_from;
|
$formmail->fromname = $mil->email_from;
|
||||||
$formmail->frommail = $mil->email_from;
|
$formmail->frommail = $mil->email_from;
|
||||||
|
$formmail->withsubstit=1;
|
||||||
$formmail->withfrom=0;
|
$formmail->withfrom=0;
|
||||||
$formmail->withto=$user->email?$user->email:1;
|
$formmail->withto=$user->email?$user->email:1;
|
||||||
$formmail->withcc=0;
|
$formmail->withcc=0;
|
||||||
@ -412,8 +423,9 @@ else
|
|||||||
$formmail->withfile=0;
|
$formmail->withfile=0;
|
||||||
$formmail->withbody=0;
|
$formmail->withbody=0;
|
||||||
$formmail->withbodyreadonly=1;
|
$formmail->withbodyreadonly=1;
|
||||||
|
$formmail->withcancel=1;
|
||||||
// Tableau des substitutions
|
// Tableau des substitutions
|
||||||
$formmail->substit["__FACREF__"]=$fac->ref;
|
$formmail->substit=$substitutionarrayfortest;
|
||||||
// Tableau des paramètres complémentaires du post
|
// Tableau des paramètres complémentaires du post
|
||||||
$formmail->param["action"]="send";
|
$formmail->param["action"]="send";
|
||||||
$formmail->param["models"]="body";
|
$formmail->param["models"]="body";
|
||||||
|
|||||||
@ -42,6 +42,8 @@ class Conf
|
|||||||
/** \public */
|
/** \public */
|
||||||
//! Objet des caractéristiques de connexions
|
//! Objet des caractéristiques de connexions
|
||||||
var $db;
|
var $db;
|
||||||
|
//! Charset for HTML output
|
||||||
|
var $character_set_client;
|
||||||
|
|
||||||
var $externalrss;
|
var $externalrss;
|
||||||
var $commande;
|
var $commande;
|
||||||
|
|||||||
@ -26,6 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/html.form.class.php");
|
require_once(DOL_DOCUMENT_ROOT ."/html.form.class.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT ."/lib/functions.inc.php");
|
||||||
|
|
||||||
|
|
||||||
/** \class FormMail
|
/** \class FormMail
|
||||||
@ -46,6 +47,7 @@ class FormMail
|
|||||||
var $toname;
|
var $toname;
|
||||||
var $tomail;
|
var $tomail;
|
||||||
|
|
||||||
|
var $withsubstit; // Show substitution array
|
||||||
var $withfrom;
|
var $withfrom;
|
||||||
var $withto;
|
var $withto;
|
||||||
var $withtocc;
|
var $withtocc;
|
||||||
@ -94,20 +96,6 @@ class FormMail
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* \brief Effectue les substitutions des mots clés par les données en fonction du tableau $this->substit
|
|
||||||
* \param chaine chaine dans laquelle faire les substitutions
|
|
||||||
* \return string chaine avec les substitutions effectuées
|
|
||||||
*/
|
|
||||||
function make_substitutions($chaine)
|
|
||||||
{
|
|
||||||
foreach ($this->substit as $key=>$value) {
|
|
||||||
$chaine=ereg_replace($key,$value,$chaine);
|
|
||||||
}
|
|
||||||
return $chaine;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* \brief Affiche la partie de formulaire pour saisie d'un mail en fonction des propriétés
|
* \brief Affiche la partie de formulaire pour saisie d'un mail en fonction des propriétés
|
||||||
*/
|
*/
|
||||||
@ -128,6 +116,19 @@ class FormMail
|
|||||||
}
|
}
|
||||||
print "<table class=\"border\" width=\"100%\">\n";
|
print "<table class=\"border\" width=\"100%\">\n";
|
||||||
|
|
||||||
|
// Substitution array
|
||||||
|
if ($this->withsubstit)
|
||||||
|
{
|
||||||
|
print "<tr><td colspan=\"2\">";
|
||||||
|
$help="";
|
||||||
|
foreach($this->substit as $key => $val)
|
||||||
|
{
|
||||||
|
$help.=$key.' -> '.$langs->trans($val).'<br>';
|
||||||
|
}
|
||||||
|
print $form->textwithhelp($langs->trans("EMailTestSubstitutionReplacedByGenericValues"),$help);
|
||||||
|
print "</td></tr>\n";
|
||||||
|
}
|
||||||
|
|
||||||
// From
|
// From
|
||||||
if ($this->withfrom)
|
if ($this->withfrom)
|
||||||
{
|
{
|
||||||
@ -212,7 +213,7 @@ class FormMail
|
|||||||
// Topic
|
// Topic
|
||||||
if ($this->withtopic)
|
if ($this->withtopic)
|
||||||
{
|
{
|
||||||
$this->withtopic=$this->make_substitutions($this->withtopic);
|
$this->withtopic=make_substitutions($this->withtopic,$this->substit);
|
||||||
|
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print "<td width=\"180\">".$langs->trans("MailTopic")."</td>";
|
print "<td width=\"180\">".$langs->trans("MailTopic")."</td>";
|
||||||
@ -251,7 +252,7 @@ class FormMail
|
|||||||
if ($this->param["models"]=='propal_send') { $defaultmessage="Veuillez trouver ci-joint la proposition commerciale __PROPREF__\n\nCordialement\n\n"; }
|
if ($this->param["models"]=='propal_send') { $defaultmessage="Veuillez trouver ci-joint la proposition commerciale __PROPREF__\n\nCordialement\n\n"; }
|
||||||
if ($this->param["models"]=='order_send') { $defaultmessage="Veuillez trouver ci-joint la commande __ORDERREF__\n\nCordialement\n\n"; }
|
if ($this->param["models"]=='order_send') { $defaultmessage="Veuillez trouver ci-joint la commande __ORDERREF__\n\nCordialement\n\n"; }
|
||||||
|
|
||||||
$defaultmessage=$this->make_substitutions($defaultmessage);
|
$defaultmessage=$this->make_substitutions($defaultmessage,$this->substit);
|
||||||
|
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print "<td width=\"180\" valign=\"top\">".$langs->trans("MailText")."</td>";
|
print "<td width=\"180\" valign=\"top\">".$langs->trans("MailText")."</td>";
|
||||||
|
|||||||
@ -3,6 +3,7 @@ Version=Version
|
|||||||
VersionExperimental=Experimental
|
VersionExperimental=Experimental
|
||||||
VersionDevelopment=Development
|
VersionDevelopment=Development
|
||||||
VersionUnknown=Unknown
|
VersionUnknown=Unknown
|
||||||
|
WarningModuleNotActive=Module <b>%s</b> must be enabled
|
||||||
DolibarrSetup=Dolibarr setup
|
DolibarrSetup=Dolibarr setup
|
||||||
DolibarrUser=Dolibarr user
|
DolibarrUser=Dolibarr user
|
||||||
InternalUser=Internal user
|
InternalUser=Internal user
|
||||||
|
|||||||
@ -51,6 +51,7 @@ AddRecipients=Add recipients
|
|||||||
RemoveRecipient=Remove recipient
|
RemoveRecipient=Remove recipient
|
||||||
CommonSubstitutions=Common substitutions
|
CommonSubstitutions=Common substitutions
|
||||||
YouCanAddYourOwnPredefindedListHere=You can add your own mails selector module here. For this take a look at the file htdocs/includes/modules/mailings/README.
|
YouCanAddYourOwnPredefindedListHere=You can add your own mails selector module here. For this take a look at the file htdocs/includes/modules/mailings/README.
|
||||||
|
EMailTestSubstitutionReplacedByGenericValues=When using test mode, substitutions variables are replaced by generic values
|
||||||
|
|
||||||
# Libelle des modules de liste de destinataires mailing
|
# Libelle des modules de liste de destinataires mailing
|
||||||
MailingModuleDescContactCompanies=Unique contacts of all third parties
|
MailingModuleDescContactCompanies=Unique contacts of all third parties
|
||||||
|
|||||||
@ -3,6 +3,7 @@ Version=Version
|
|||||||
VersionExperimental=Expérimental
|
VersionExperimental=Expérimental
|
||||||
VersionDevelopment=Développement
|
VersionDevelopment=Développement
|
||||||
VersionUnknown=Inconnue
|
VersionUnknown=Inconnue
|
||||||
|
WarningModuleNotActive=Module <b>%s</b> non actif
|
||||||
DolibarrSetup=Installation de Dolibarr
|
DolibarrSetup=Installation de Dolibarr
|
||||||
DolibarrUser=Utilisateur Dolibarr
|
DolibarrUser=Utilisateur Dolibarr
|
||||||
InternalUser=Utilisateur interne
|
InternalUser=Utilisateur interne
|
||||||
|
|||||||
@ -51,6 +51,7 @@ AddRecipients=Ajout de destinataires
|
|||||||
RemoveRecipient=Supprime destinataire
|
RemoveRecipient=Supprime destinataire
|
||||||
CommonSubstitutions=Substitutions communes
|
CommonSubstitutions=Substitutions communes
|
||||||
YouCanAddYourOwnPredefindedListHere=Vous pouvez ajouter votre propre module de sélection/import de mails. Pour cela, voir le fichier htdocs/includes/modules/mailings/README.
|
YouCanAddYourOwnPredefindedListHere=Vous pouvez ajouter votre propre module de sélection/import de mails. Pour cela, voir le fichier htdocs/includes/modules/mailings/README.
|
||||||
|
EMailTestSubstitutionReplacedByGenericValues=En mode test, les variables de substitution sont remplacées par des valeurs génériques
|
||||||
|
|
||||||
# Libelle des modules de liste de destinataires mailing
|
# Libelle des modules de liste de destinataires mailing
|
||||||
MailingModuleDescContactCompanies=Contacts des tiers (prospects, clients, fournisseurs...)
|
MailingModuleDescContactCompanies=Contacts des tiers (prospects, clients, fournisseurs...)
|
||||||
|
|||||||
@ -216,7 +216,8 @@ class CMailFile
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_syslog("CMailFile::sendfile: No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS");
|
$this->error='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS';
|
||||||
|
dolibarr_syslog("CMailFile::sendfile: ".$this->error);
|
||||||
}
|
}
|
||||||
|
|
||||||
error_reporting($errorlevel); // Réactive niveau erreur origine
|
error_reporting($errorlevel); // Réactive niveau erreur origine
|
||||||
@ -267,7 +268,7 @@ class CMailFile
|
|||||||
|
|
||||||
if ($this->msgishtml)
|
if ($this->msgishtml)
|
||||||
{
|
{
|
||||||
$out.= "Content-Type: text/html; charset=".$conf->charset_output.$this->eol;
|
$out.= "Content-Type: text/html; charset=".$conf->character_set_client.$this->eol;
|
||||||
$out.= "Content-Transfer-Encoding: 8bit".$this->eol;
|
$out.= "Content-Transfer-Encoding: 8bit".$this->eol;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -2723,4 +2723,20 @@ function dol_microtime_float()
|
|||||||
return ((float)$usec + (float)$sec);
|
return ((float)$usec + (float)$sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* \brief Effectue les substitutions des mots clés par les données en fonction du tableau
|
||||||
|
* \param chaine Chaine dans laquelle faire les substitutions
|
||||||
|
* \param substitutionarray Tableau clé substitution => valeur a mettre
|
||||||
|
* \return string Chaine avec les substitutions effectuées
|
||||||
|
*/
|
||||||
|
function make_substitutions($chaine,$substitutionarray)
|
||||||
|
{
|
||||||
|
foreach ($substitutionarray as $key => $value)
|
||||||
|
{
|
||||||
|
$chaine=ereg_replace($key,$value,$chaine);
|
||||||
|
}
|
||||||
|
return $chaine;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user