Skip to content
Snippets Groups Projects
Commit c50d2cea authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Can add a field errors-to to emailings

parent 824969bf
No related branches found
No related tags found
No related merge requests found
...@@ -4,18 +4,21 @@ English Dolibarr changelog ...@@ -4,18 +4,21 @@ English Dolibarr changelog
***** Changelog for 2.7 compared to 2.6 ***** ***** Changelog for 2.7 compared to 2.6 *****
For users: For users:
- New: Add an help and support center. - New: Add a help and support center.
- New: Can export commercial proposals. - New: Can export commercial proposals.
- New: Can use a cache for xcal exports. - New: Can use a cache for xcal exports.
- New: Option for faster confirmation process with one ajax popup. - New: Option for faster confirmation process with one ajax popup.
- New: Complete theme bluelagoon and rodolphe - New: Complete theme bluelagoon and rodolphe
- New: Can select third parties emails in emailing module for all - New: Can select third parties emails in emailing module for all
third parties with expired contract's lines. third parties with expired contract's lines.
- New: Can add a field errors-to in emailing.
- New: Can use inline images in emails.
- Fix: Customer code was not correct on PDF it if contains special - Fix: Customer code was not correct on PDF it if contains special
characters. characters.
- Fix: Can update price even with "NPR" VAT rates. - Fix: Can update price even with "NPR" VAT rates.
- Fix: When product type is missing, description is not lost when adding - Fix: When product type is missing, description is not lost when adding
new product lines. new product lines.
- Fix: CC and BCC in emails was not used if using SMTPS handler.
For translators: For translators:
- Update some language files. - Update some language files.
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
require_once(DOL_DOCUMENT_ROOT."/comm/mailing/mailing.class.php"); require_once(DOL_DOCUMENT_ROOT."/comm/mailing/mailing.class.php");
require_once(DOL_DOCUMENT_ROOT."/html.formother.class.php"); require_once(DOL_DOCUMENT_ROOT."/html.formother.class.php");
...@@ -87,7 +88,7 @@ if ($_POST["action"] == 'confirm_clone' && $_POST['confirm'] == 'yes') ...@@ -87,7 +88,7 @@ if ($_POST["action"] == 'confirm_clone' && $_POST['confirm'] == 'yes')
} }
} }
// Action envoi mailing pour tous // Action send emailing for everybody
if ($_POST["action"] == 'sendallconfirmed' && $_POST['confirm'] == 'yes') if ($_POST["action"] == 'sendallconfirmed' && $_POST['confirm'] == 'yes')
{ {
if (empty($conf->global->MAILING_LIMIT_SENDBYWEB)) if (empty($conf->global->MAILING_LIMIT_SENDBYWEB))
...@@ -272,7 +273,7 @@ if ($_POST["action"] == 'sendallconfirmed' && $_POST['confirm'] == 'yes') ...@@ -272,7 +273,7 @@ if ($_POST["action"] == 'sendallconfirmed' && $_POST['confirm'] == 'yes')
} }
} }
// Action envoi test mailing // Action send test emailing
if ($_POST["action"] == 'send' && ! $_POST["cancel"]) if ($_POST["action"] == 'send' && ! $_POST["cancel"])
{ {
$mil = new Mailing($db); $mil = new Mailing($db);
...@@ -320,7 +321,7 @@ if ($_POST["action"] == 'send' && ! $_POST["cancel"]) ...@@ -320,7 +321,7 @@ if ($_POST["action"] == 'send' && ! $_POST["cancel"])
} }
} }
// Action ajout mailing // Action add emailing
if ($_POST["action"] == 'add') if ($_POST["action"] == 'add')
{ {
$message=''; $message='';
...@@ -328,6 +329,8 @@ if ($_POST["action"] == 'add') ...@@ -328,6 +329,8 @@ if ($_POST["action"] == 'add')
$mil = new Mailing($db); $mil = new Mailing($db);
$mil->email_from = trim($_POST["from"]); $mil->email_from = trim($_POST["from"]);
$mil->email_replyto = trim($_POST["replyto"]);
$mil->email_errorsto = trim($_POST["errorsto"]);
$mil->titre = trim($_POST["titre"]); $mil->titre = trim($_POST["titre"]);
$mil->sujet = trim($_POST["sujet"]); $mil->sujet = trim($_POST["sujet"]);
$mil->body = trim($_POST["body"]); $mil->body = trim($_POST["body"]);
...@@ -351,22 +354,25 @@ if ($_POST["action"] == 'add') ...@@ -351,22 +354,25 @@ if ($_POST["action"] == 'add')
$_GET["action"]="create"; $_GET["action"]="create";
} }
// Action mise a jour mailing // Action update emailing
if ($_POST["action"] == 'update') if ($_POST["action"] == 'update')
{ {
$mil = new Mailing($db); $mil = new Mailing($db);
$mil->id = $_POST["id"]; $mil->id = $_POST["id"];
$mil->email_from = $_POST["from"]; $mil->email_from = trim($_POST["from"]);
$mil->titre = $_POST["titre"]; $mil->email_replyto = trim($_POST["replyto"]);
$mil->sujet = $_POST["sujet"]; $mil->email_errorsto = trim($_POST["errorsto"]);
$mil->body = $_POST["body"]; $mil->titre = trim($_POST["titre"]);
$mil->bgcolor = $_POST["bgcolor"]; $mil->sujet = trim($_POST["sujet"]);
$mil->bgimage = $_POST["bgimage"]; $mil->body = trim($_POST["body"]);
$mil->bgcolor = trim($_POST["bgcolor"]);
$mil->bgimage = trim($_POST["bgimage"]);
if ($mil->update()) if ($mil->update($user))
{ {
Header("Location: fiche.php?id=".$mil->id); Header("Location: fiche.php?id=".$mil->id);
exit;
} }
} }
...@@ -489,6 +495,7 @@ if ($_GET["action"] == 'create') ...@@ -489,6 +495,7 @@ if ($_GET["action"] == 'create')
print '<tr><td width="25%">'.$langs->trans("MailTitle").'</td><td><input class="flat" name="titre" size="40" value="'.$_POST['titre'].'"></td></tr>'; print '<tr><td width="25%">'.$langs->trans("MailTitle").'</td><td><input class="flat" name="titre" size="40" value="'.$_POST['titre'].'"></td></tr>';
print '<tr><td colspan="2">&nbsp;</td></tr>'; print '<tr><td colspan="2">&nbsp;</td></tr>';
print '<tr><td width="25%">'.$langs->trans("MailFrom").'</td><td><input class="flat" name="from" size="40" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>'; print '<tr><td width="25%">'.$langs->trans("MailFrom").'</td><td><input class="flat" name="from" size="40" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>';
print '<tr><td width="25%">'.$langs->trans("MailErrorsTo").'</td><td><input class="flat" name="errorsto" size="40" value="'.$conf->global->MAILING_EMAIL_ERRORSTO.'"></td></tr>';
print '<tr><td width="25%">'.$langs->trans("MailTopic").'</td><td><input class="flat" name="sujet" size="60" value="'.$_POST['sujet'].'"></td></tr>'; print '<tr><td width="25%">'.$langs->trans("MailTopic").'</td><td><input class="flat" name="sujet" size="60" value="'.$_POST['sujet'].'"></td></tr>';
print '<tr><td width="25%">'.$langs->trans("BackgroundColor").'</td><td colspan="3">'; print '<tr><td width="25%">'.$langs->trans("BackgroundColor").'</td><td colspan="3">';
$htmlother->select_color($_POST['bgcolor'],'bgcolor','new_mailing'); $htmlother->select_color($_POST['bgcolor'],'bgcolor','new_mailing');
...@@ -593,7 +600,12 @@ else ...@@ -593,7 +600,12 @@ else
print '</td></tr>'; print '</td></tr>';
print '<tr><td width="25%">'.$langs->trans("MailTitle").'</td><td colspan="3">'.$mil->titre.'</td></tr>'; print '<tr><td width="25%">'.$langs->trans("MailTitle").'</td><td colspan="3">'.$mil->titre.'</td></tr>';
print '<tr><td width="25%">'.$langs->trans("MailFrom").'</td><td colspan="3">'.htmlentities($mil->email_from).'</td></tr>'; print '<tr><td width="25%">'.$langs->trans("MailFrom").'</td><td colspan="3">'.htmlentities($mil->email_from);
if (! isValidEMail($mil->email_from)) print img_warning($langs->trans("BadEMail"));
print '</td></tr>';
print '<tr><td width="25%">'.$langs->trans("MailErrorsTo").'</td><td colspan="3">'.htmlentities($mil->email_errorsto);
if (! isValidEMail($mil->email_errorsto)) print img_warning($langs->trans("BadEMail"));
print '</td></tr>';
print '<tr><td width="25%">'.$langs->trans("Status").'</td><td colspan="3">'.$mil->getLibStatut(4).'</td></tr>'; print '<tr><td width="25%">'.$langs->trans("Status").'</td><td colspan="3">'.$mil->getLibStatut(4).'</td></tr>';
print '<tr><td width="25%">'.$langs->trans("TotalNbOfDistinctRecipients").'</td><td colspan="3">'.($mil->nbemail?$mil->nbemail:'<font class="error">'.$langs->trans("NoTargetYet").'</font>').'</td></tr>'; print '<tr><td width="25%">'.$langs->trans("TotalNbOfDistinctRecipients").'</td><td colspan="3">'.($mil->nbemail?$mil->nbemail:'<font class="error">'.$langs->trans("NoTargetYet").'</font>').'</td></tr>';
...@@ -761,6 +773,7 @@ else ...@@ -761,6 +773,7 @@ else
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">'.$mil->id.'</td></tr>'; print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">'.$mil->id.'</td></tr>';
print '<tr><td width="25%">'.$langs->trans("MailTitle").'</td><td colspan="3"><input class="flat" type="text" size=40 name="titre" value="'.$mil->titre.'"></td></tr>'; print '<tr><td width="25%">'.$langs->trans("MailTitle").'</td><td colspan="3"><input class="flat" type="text" size=40 name="titre" value="'.$mil->titre.'"></td></tr>';
print '<tr><td width="25%">'.$langs->trans("MailFrom").'</td><td colspan="3"><input class="flat" type="text" size=40 name="from" value="'.$mil->email_from.'"></td></tr>'; print '<tr><td width="25%">'.$langs->trans("MailFrom").'</td><td colspan="3"><input class="flat" type="text" size=40 name="from" value="'.$mil->email_from.'"></td></tr>';
print '<tr><td width="25%">'.$langs->trans("MailErrorsTo").'</td><td colspan="3"><input class="flat" type="text" size=40 name="errorsto" value="'.$mil->email_errorsto.'"></td></tr>';
print '<tr><td width="25%">'.$langs->trans("MailTopic").'</td><td colspan="3"><input class="flat" type="text" size=60 name="sujet" value="'.$mil->sujet.'"></td></tr>'; print '<tr><td width="25%">'.$langs->trans("MailTopic").'</td><td colspan="3"><input class="flat" type="text" size=60 name="sujet" value="'.$mil->sujet.'"></td></tr>';
print '<tr><td width="25%">'.$langs->trans("BackgroundColor").'</td><td colspan="3">'; print '<tr><td width="25%">'.$langs->trans("BackgroundColor").'</td><td colspan="3">';
$htmlother->select_color($mil->bgcolor,'bgcolor','edit_mailing'); $htmlother->select_color($mil->bgcolor,'bgcolor','edit_mailing');
......
...@@ -79,7 +79,7 @@ class Mailing extends CommonObject ...@@ -79,7 +79,7 @@ class Mailing extends CommonObject
/** /**
* \brief Create an EMailing * \brief Create an EMailing
* \param user object utilisateur qui cree * \param user Object of user making creation
* \return -1 if error, Id of created object if OK * \return -1 if error, Id of created object if OK
*/ */
function create($user) function create($user)
...@@ -134,16 +134,19 @@ class Mailing extends CommonObject ...@@ -134,16 +134,19 @@ class Mailing extends CommonObject
} }
/** /**
* \brief Update les infos du mailing * \brief Update emailing record
* \return < 0 si erreur, > 0 si ok * \param user Object of user making change
* \return < 0 if KO, > 0 if OK
*/ */
function update() function update($user)
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing "; $sql = "UPDATE ".MAIN_DB_PREFIX."mailing ";
$sql .= " SET titre = '".addslashes($this->titre)."'"; $sql .= " SET titre = '".addslashes($this->titre)."'";
$sql .= ", sujet = '".addslashes($this->sujet)."'"; $sql .= ", sujet = '".addslashes($this->sujet)."'";
$sql .= ", body = '".addslashes($this->body)."'"; $sql .= ", body = '".addslashes($this->body)."'";
$sql .= ", email_from = '".$this->email_from."'"; $sql .= ", email_from = '".$this->email_from."'";
$sql .= ", email_replyto = '".$this->email_replyto."'";
$sql .= ", email_errorsto = '".$this->email_errorsto."'";
$sql .= ", bgcolor = '".($this->bgcolor?$this->bgcolor:null)."'"; $sql .= ", bgcolor = '".($this->bgcolor?$this->bgcolor:null)."'";
$sql .= ", bgimage = '".($this->bgimage?$this->bgimage:null)."'"; $sql .= ", bgimage = '".($this->bgimage?$this->bgimage:null)."'";
$sql .= " WHERE rowid = ".$this->id; $sql .= " WHERE rowid = ".$this->id;
......
...@@ -61,6 +61,7 @@ YouCanAddYourOwnPredefindedListHere=To create your email selector module, see ht ...@@ -61,6 +61,7 @@ YouCanAddYourOwnPredefindedListHere=To create your email selector module, see ht
EMailTestSubstitutionReplacedByGenericValues=When using test mode, substitutions variables are replaced by generic values EMailTestSubstitutionReplacedByGenericValues=When using test mode, substitutions variables are replaced by generic values
MailingAddFile=Attach this file MailingAddFile=Attach this file
NoAttachedFiles=No attached files NoAttachedFiles=No attached files
BadEMail=Bad value for EMail
# Libelle des modules de liste de destinataires mailing # Libelle des modules de liste de destinataires mailing
MailingModuleDescContactCompanies=Contacts of all third parties (customer, prospect, supplier, ...) MailingModuleDescContactCompanies=Contacts of all third parties (customer, prospect, supplier, ...)
......
...@@ -61,6 +61,7 @@ YouCanAddYourOwnPredefindedListHere=Pour créer votre module sélection mails, v ...@@ -61,6 +61,7 @@ YouCanAddYourOwnPredefindedListHere=Pour créer votre module sélection mails, v
EMailTestSubstitutionReplacedByGenericValues=En mode test, les variables de substitution sont remplacées par des valeurs génériques EMailTestSubstitutionReplacedByGenericValues=En mode test, les variables de substitution sont remplacées par des valeurs génériques
MailingAddFile=Joindre ce fichier MailingAddFile=Joindre ce fichier
NoAttachedFiles=Aucun fichier joint NoAttachedFiles=Aucun fichier joint
BadEMail=EMail incorrect
# 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...)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment