Fix: add possibility to force mail errors-to to all mails sent
This commit is contained in:
parent
09fa95d701
commit
d87cbae6dc
@ -20,7 +20,7 @@
|
||||
/**
|
||||
* \file htdocs/admin/mails.php
|
||||
* \brief Page to setup emails sending
|
||||
* \version $Id: mails.php,v 1.71 2011/07/09 05:28:41 hregis Exp $
|
||||
* \version $Id: mails.php,v 1.72 2011/07/09 06:10:06 hregis Exp $
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
@ -63,6 +63,7 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update' && empty($_POST["can
|
||||
if (isset($_POST["MAIN_MAIL_EMAIL_TLS"])) dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", $_POST["MAIN_MAIL_EMAIL_TLS"],'chaine',0,'',0);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", $_POST["MAIN_MAIL_EMAIL_FROM"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", $_POST["MAIN_MAIL_ERRORS_TO"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"],'chaine',0,'',$conf->entity);
|
||||
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
||||
@ -467,6 +468,12 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).'</td>';
|
||||
print '<td><input class="flat" name="MAIN_MAIL_EMAIL_FROM" size="32" value="' . $conf->global->MAIN_MAIL_EMAIL_FROM;
|
||||
print '"></td></tr>';
|
||||
|
||||
// From
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("MAIN_MAIL_ERRORS_TO").'</td>';
|
||||
print '<td><input class="flat" name="MAIN_MAIL_ERRORS_TO" size="32" value="' . $conf->global->MAIN_MAIL_ERRORS_TO;
|
||||
print '"></td></tr>';
|
||||
|
||||
// Autocopy to
|
||||
$var=!$var;
|
||||
@ -567,6 +574,13 @@ else
|
||||
print '<td>'.$conf->global->MAIN_MAIL_EMAIL_FROM;
|
||||
if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail"));
|
||||
print '</td></tr>';
|
||||
|
||||
// Errors To
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("MAIN_MAIL_ERRORS_TO").'</td>';
|
||||
print '<td>'.$conf->global->MAIN_MAIL_ERRORS_TO;
|
||||
if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && ! isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) print img_warning($langs->trans("ErrorBadEMail"));
|
||||
print '</td></tr>';
|
||||
|
||||
// Autocopy to
|
||||
$var=!$var;
|
||||
@ -723,5 +737,5 @@ else
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date: 2011/07/09 05:28:41 $ - $Revision: 1.71 $');
|
||||
llxFooter('$Date: 2011/07/09 06:10:06 $ - $Revision: 1.72 $');
|
||||
?>
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -22,7 +21,7 @@
|
||||
* \file htdocs/core/class/html.formmail.class.php
|
||||
* \ingroup core
|
||||
* \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire
|
||||
* \version $Id: html.formmail.class.php,v 1.31 2011/07/10 20:03:41 eldy Exp $
|
||||
* \version $Id: html.formmail.class.php,v 1.29 2011/07/09 06:10:07 hregis Exp $
|
||||
*/
|
||||
require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php");
|
||||
|
||||
@ -124,9 +123,9 @@ class FormMail
|
||||
/**
|
||||
* Add a file into the list of attached files (stored in SECTION array)
|
||||
*
|
||||
* @param string $path Full absolute path on filesystem of file, including file name
|
||||
* @param string $file Only filename
|
||||
* @param string $type Mime type
|
||||
* @param $path
|
||||
* @param $file
|
||||
* @param $type
|
||||
*/
|
||||
function add_attached_files($path,$file,$type)
|
||||
{
|
||||
@ -505,27 +504,14 @@ class FormMail
|
||||
$out.= '<tr>';
|
||||
$out.= '<td width="180">'.$langs->trans("MailFile").'</td>';
|
||||
$out.= '<td>';
|
||||
// FIXME Trick to have param removedfile containing nb of image to delete. But this does not works without javascript
|
||||
$out.= '<input type="hidden" class="removedfilehidden" name="removedfile" value="">'."\n";
|
||||
$out.= '<script type="text/javascript" language="javascript">';
|
||||
$out.= 'jQuery(document).ready(function () {';
|
||||
$out.= ' jQuery(".removedfile").click(function() {';
|
||||
$out.= ' jQuery(".removedfilehidden").val(jQuery(this).val());';
|
||||
$out.= ' });';
|
||||
$out.= '})';
|
||||
$out.= '</script>'."\n";
|
||||
//print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
if (sizeof($listofpaths))
|
||||
{
|
||||
foreach($listofpaths as $key => $val)
|
||||
{
|
||||
$out.= '<div id="attachfile_'.$key.'">';
|
||||
$out.= img_mime($listofnames[$key]).' '.$listofnames[$key];
|
||||
if (! $this->withfilereadonly)
|
||||
{
|
||||
$out.= ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key+1).'" class="removedfile" id="removedfile_'.$key.'" name="removedfile_'.$key.'" />';
|
||||
//$out.= ' <a href="'.$_SERVER["PHP_SELF"].'?removedfile='.($key+1).' id="removedfile_'.$key.'">'.img_delete($langs->trans("Delete").'</a>';
|
||||
}
|
||||
$out.= '<br /></div>';
|
||||
$out.= img_mime($listofnames[$key]).' '.$listofnames[$key];
|
||||
if (! $this->withfilereadonly) $out.= ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key+1).'" id="removedfile" name="removedfile" />';
|
||||
$out.= '<br>';
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -534,9 +520,11 @@ class FormMail
|
||||
}
|
||||
if ($this->withfile == 2) // Can add other files
|
||||
{
|
||||
//print '<td><td align="right">';
|
||||
$out.= '<input type="file" class="flat" id="addedfile" name="addedfile" value="'.$langs->trans("Upload").'" />';
|
||||
$out.= ' ';
|
||||
$out.= '<input type="submit" class="button" id="'.$addfileaction.'" name="'.$addfileaction.'" value="'.$langs->trans("MailingAddFile").'" />';
|
||||
//print '</td></tr></table>';
|
||||
}
|
||||
$out.= "</td></tr>\n";
|
||||
}
|
||||
@ -556,7 +544,7 @@ class FormMail
|
||||
if ($this->param["models"]=='invoice_supplier_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); }
|
||||
if ($this->param["models"]=='shipping_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendShipping"); }
|
||||
if ($this->param["models"]=='fichinter_send') { $defaultmessage=$langs->transnoentities("PredefinedMailContentSendFichInter"); }
|
||||
|
||||
|
||||
if ($conf->paypal->enabled && $conf->global->PAYPAL_ADD_PAYMENT_URL)
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/paypal/lib/paypal.lib.php");
|
||||
|
||||
@ -229,6 +229,7 @@ MAIN_MAIL_SMTP_SERVER=SMTP/SMTPS Host (By default in php.ini: <b>%s</b>)
|
||||
MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=SMTP/SMTPS Port (Not defined into PHP on Unix like systems)
|
||||
MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=SMTP/SMTPS Host (Not defined into PHP on Unix like systems)
|
||||
MAIN_MAIL_EMAIL_FROM=Sender e-mail for automatic emails (By default in php.ini: <b>%s</b>)
|
||||
MAIN_MAIL_ERRORS_TO=Sender e-mail used for error returns emails sent
|
||||
MAIN_MAIL_AUTOCOPY_TO= Send systematically a hidden carbon-copy of all sent emails to
|
||||
MAIN_DISABLE_ALL_MAILS=Disable all e-mails sendings (for test purposes or demos)
|
||||
MAIN_MAIL_SENDMODE=Method to use to send EMails
|
||||
|
||||
@ -230,6 +230,7 @@ MAIN_MAIL_SMTP_SERVER= Nom host ou ip du serveur SMTP/SMTPS (Par défaut dans ph
|
||||
MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike= Port du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix)
|
||||
MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike= Nom host ou ip du serveur SMTP/SMTPS (Non défini dans le PHP sur les systèmes de type Unix)
|
||||
MAIN_MAIL_EMAIL_FROM= EMail émetteur pour envoi emails automatiques (Par défaut dans php.ini: <b>%s</b>)
|
||||
MAIN_MAIL_ERRORS_TO=EMail utilisé pour les retours d'erreurs des mails envoyés
|
||||
MAIN_MAIL_AUTOCOPY_TO= Envoyer systématiquement une copie cachée des mails envoyés à
|
||||
MAIN_DISABLE_ALL_MAILS= Désactiver globalement tout envoi de mails (pour mode test ou démos)
|
||||
MAIN_MAIL_SENDMODE= Méthode d'envoi des mails
|
||||
|
||||
Loading…
Reference in New Issue
Block a user