New: Enhancement on sending email.
This commit is contained in:
parent
8cd4e2cedf
commit
65fcfcf69f
@ -52,7 +52,9 @@ class ActionComm
|
||||
var $datef; // Date action planifie fin (datep2)
|
||||
var $date; // Date action realise debut (datea)
|
||||
var $dateend; // Date action realise fin (datea2)
|
||||
var $priority;
|
||||
var $durationp = -1;
|
||||
var $durationa = -1;
|
||||
var $priority;
|
||||
|
||||
var $usertodo; // User that must do action
|
||||
var $userdone; // User that did action
|
||||
@ -90,12 +92,12 @@ class ActionComm
|
||||
function add($author,$notrigger=0)
|
||||
{
|
||||
global $langs,$conf;
|
||||
|
||||
if (! $this->percentage) $this->percentage = 0;
|
||||
if (! $this->priority) $this->priority = 0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Clean parameters
|
||||
if (! $this->percentage) $this->percentage = 0;
|
||||
if (! $this->priority) $this->priority = 0;
|
||||
if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date;
|
||||
$now=time();
|
||||
if (! $this->type_id && $this->type_code)
|
||||
{
|
||||
# Get id from code
|
||||
@ -108,21 +110,30 @@ class ActionComm
|
||||
else
|
||||
{
|
||||
$this->error=$cactioncomm->error;
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->datep && $this->datef) $this->durationp=($this->datef - $this->datep);
|
||||
if ($this->date && $this->dateend) $this->durationa=($this->dateend - $this->date);
|
||||
|
||||
// Check parameters
|
||||
if (! $this->type_id)
|
||||
{
|
||||
$this->error="ErrorWrongParameters";
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm";
|
||||
$sql.= "(datec,";
|
||||
if ($this->datep) $sql.= "datep,";
|
||||
if ($this->date) $sql.= "datea,";
|
||||
$sql.= "datep,";
|
||||
$sql.= "datep2,";
|
||||
$sql.= "datea,";
|
||||
$sql.= "datea2,";
|
||||
$sql.= "durationp,";
|
||||
$sql.= "durationa,";
|
||||
$sql.= "fk_action,fk_soc,note,";
|
||||
$sql.= "fk_contact,";
|
||||
$sql.= "fk_user_author,";
|
||||
@ -130,9 +141,14 @@ class ActionComm
|
||||
$sql.= "fk_user_done,";
|
||||
$sql.= "label,percent,priority,";
|
||||
$sql.= "fk_facture,propalrowid,fk_commande)";
|
||||
$sql.= " VALUES (now(),";
|
||||
if ($this->datep) $sql.= "'".$this->db->idate($this->datep)."',";
|
||||
if ($this->date) $sql.= "'".$this->db->idate($this->date)."',";
|
||||
$sql.= " VALUES (";
|
||||
$sql.= "'".$this->db->idate($now)."',";
|
||||
$sql.= ($this->datep?"'".$this->db->idate($this->datep)."'":"null").",";
|
||||
$sql.= ($this->datef?"'".$this->db->idate($this->datef)."'":"null").",";
|
||||
$sql.= ($this->date?"'".$this->db->idate($this->date)."'":"null").",";
|
||||
$sql.= ($this->dateend?"'".$this->db->idate($this->dateend)."'":"null").",";
|
||||
$sql.= ($this->durationp >= 0?"'".$this->durationp."'":"null").",";
|
||||
$sql.= ($this->durationa >= 0?"'".$this->durationa."'":"null").",";
|
||||
$sql.= "'".$this->type_id."', '".$this->societe->id."' ,'".addslashes($this->note)."',";
|
||||
$sql.= ($this->contact->id > 0?"'".$this->contact->id."'":"null").",";
|
||||
$sql.= "'".$author->id."',";
|
||||
|
||||
@ -207,7 +207,7 @@ else
|
||||
$formmail->withfrom=1;
|
||||
$formmail->witherrorsto=1;
|
||||
$formmail->withto=$user->email?$user->email:1;
|
||||
$formmail->withcc=0;
|
||||
$formmail->withtocc=1;
|
||||
$formmail->withtopic=$langs->trans("Test");
|
||||
$formmail->withtopicreadonly=0;
|
||||
$formmail->withfile=1;
|
||||
|
||||
@ -28,6 +28,13 @@ require_once("./pre.inc.php");
|
||||
if (! $user->admin)
|
||||
accessforbidden();
|
||||
|
||||
// Sécurité accés client
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
|
||||
$langs->load("companies");
|
||||
|
||||
$page=$_GET["page"];
|
||||
@ -42,27 +49,22 @@ $pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
|
||||
llxHeader();
|
||||
|
||||
// Sécurité accés client
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Mode Liste
|
||||
*
|
||||
*/
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
$userstatic=new User($db);
|
||||
|
||||
$sql = "SELECT e.rowid, e.type, ".$db->pdate("e.dateevent")." as dateevent,";
|
||||
$sql.= " e.fk_user, e.label, e.description";
|
||||
$sql.= " e.fk_user, e.label, e.description,";
|
||||
$sql.= " u.login";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."events as e";
|
||||
|
||||
$sql .= " ORDER BY $sortfield $sortorder";
|
||||
$sql .= $db->plimit($conf->liste_limit+1, $offset);
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = e.fk_user";
|
||||
$sql.= " ORDER BY $sortfield $sortorder";
|
||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
@ -76,7 +78,7 @@ if ($result)
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"e.dateevent","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"e.type","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("User"),$_SERVER["PHP_SELF"],"e.fk_user","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("User"),$_SERVER["PHP_SELF"],"u.login","","",'align="left"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"e.label","","",'align="left"',$sortfield,$sortorder);
|
||||
print '<td> </td>';
|
||||
print "</tr>\n";
|
||||
@ -116,7 +118,9 @@ if ($result)
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td align="left" nowrap="nowrap">'.dolibarr_print_date($obj->dateevent,'dayhour').'</td>';
|
||||
print '<td>'.$obj->type.'</td>';
|
||||
print '<td>'.$obj->fk_user.'</td>';
|
||||
$userstatic->id=$obj->fk_user;
|
||||
$userstatic->login=$obj->login;
|
||||
print '<td>'.$userstatic->getLoginUrl(1).'</td>';
|
||||
print '<td>'.$obj->label.'</td>';
|
||||
// print '<td>'.$obj->description.'</td>';
|
||||
print '<td> </td>';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2006 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
* Copyright (C) 2005-2008 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -15,19 +15,17 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/comm/mailing/fiche.php
|
||||
\ingroup mailing
|
||||
\brief Fiche mailing, onglet général
|
||||
\version $Revision$
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php");
|
||||
|
||||
$langs->load("mails");
|
||||
|
||||
@ -52,13 +50,186 @@ $substitutionarrayfortest=array(
|
||||
|
||||
|
||||
// Action envoi mailing pour tous
|
||||
if ($_GET["action"] == 'sendall')
|
||||
if ($_POST["action"] == 'sendallconfirmed')
|
||||
{
|
||||
// Pour des raisons de sécurité, on ne permet pas cette fonction via l'IHM,
|
||||
// on affiche donc juste un message
|
||||
$message='<div class="warning">'.$langs->trans("MailingNeedCommand").'</div>';
|
||||
$message.='<br><textarea cols="50" rows="'.ROWS_2.'" wrap="soft">php ./scripts/mailing/mailing-send.php '.$_GET["id"].'</textarea>';
|
||||
$_GET["action"]='';
|
||||
if (empty($conf->global->MAILING_LIMIT_SENDBYWEB))
|
||||
{
|
||||
// Pour des raisons de sécurité, on ne permet pas cette fonction via l'IHM,
|
||||
// on affiche donc juste un message
|
||||
$message='<div class="warning">'.$langs->trans("MailingNeedCommand").'</div>';
|
||||
$message.='<br><textarea cols="70" rows="'.ROWS_2.'" wrap="soft">php ./scripts/mailing/mailing-send.php '.$_GET["id"].'</textarea>';
|
||||
$message.='<br><br><div class="warning">'.$langs->trans("MailingNeedCommand2").'</div>';
|
||||
$_GET["action"]='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$id=$_GET['id'];
|
||||
|
||||
$error = 0;
|
||||
|
||||
// On récupére données du mail
|
||||
$sql = "SELECT m.rowid, m.titre, m.sujet, m.body";
|
||||
$sql .= " , m.email_from, m.email_replyto, m.email_errorsto";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."mailing as m";
|
||||
$sql .= " WHERE m.statut >= 1";
|
||||
$sql .= " AND m.rowid= ".$id;
|
||||
$sql .= " LIMIT 1";
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
if ($num == 1)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
dolibarr_syslog("mailing-send: mailing ".$id);
|
||||
|
||||
$id = $obj->rowid;
|
||||
$subject = $obj->sujet;
|
||||
$message = $obj->body;
|
||||
$from = $obj->email_from;
|
||||
$errorsto = $obj->email_errorsto;
|
||||
|
||||
// Le message est-il en html
|
||||
$msgishtml=0; // Non par defaut
|
||||
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING) $msgishtml=1;
|
||||
if (eregi('[ \t]*<html>',$message)) $msgishtml=1;
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$nbok=0; $nbko=0;
|
||||
|
||||
// On choisit les mails non déjà envoyés pour ce mailing (statut=0)
|
||||
// ou envoyés en erreur (statut=-1)
|
||||
$sql = "SELECT mc.rowid, mc.nom, mc.prenom, mc.email";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
|
||||
$sql .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$id;
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
if ($num)
|
||||
{
|
||||
dolibarr_syslog("mailing-send: target number = $num");
|
||||
// Positionne date debut envoi
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."mailing SET date_envoi=SYSDATE() WHERE rowid=".$id;
|
||||
$resql2=$db->query($sql);
|
||||
if (! $resql2)
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
// Boucle sur chaque adresse et envoie le mail
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num && $i < $conf->global->MAILING_LIMIT_SENDBYWEB)
|
||||
{
|
||||
|
||||
$res=1;
|
||||
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
// sendto en RFC2822
|
||||
$sendto = $obj->prenom." ".$obj->nom." <".$obj->email.">";
|
||||
|
||||
// Pratique les substitutions sur le sujet et message
|
||||
$substitutionarray=array(
|
||||
'__ID__' => $obj->rowid,
|
||||
'__EMAIL__' => $obj->email,
|
||||
'__LASTNAME__' => $obj->nom,
|
||||
'__FIRSTNAME__' => $obj->prenom
|
||||
);
|
||||
|
||||
$substitutionisok=true;
|
||||
$subject2=make_substitutions($subject,$substitutionarray);
|
||||
$message2=make_substitutions($message,$substitutionarray);
|
||||
|
||||
// Fabrication du mail
|
||||
$mail = new CMailFile($subject2, $sendto, $from, $message2,
|
||||
array(), array(), array(),
|
||||
'', '', 0, $msgishtml);
|
||||
$mail->errors_to = $errorsto;
|
||||
|
||||
|
||||
if ($mail->error)
|
||||
{
|
||||
$res=0;
|
||||
}
|
||||
if (! $substitutionisok)
|
||||
{
|
||||
$mail->error='Some substitution failed';
|
||||
$res=0;
|
||||
}
|
||||
|
||||
// Envoi du mail
|
||||
if ($res)
|
||||
{
|
||||
$res=$mail->sendfile();
|
||||
}
|
||||
|
||||
if ($res)
|
||||
{
|
||||
// Mail envoye avec succes
|
||||
$nbok++;
|
||||
|
||||
dolibarr_syslog("mailing-send: ok for #".$i.' - '.$mail->error);
|
||||
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
|
||||
$sql.=" SET statut=1, date_envoi=SYSDATE() WHERE rowid=".$obj->rowid;
|
||||
$resql2=$db->query($sql);
|
||||
if (! $resql2)
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Mail en echec
|
||||
$nbko++;
|
||||
|
||||
dolibarr_syslog("mailing-send: error for #".$i.' - '.$mail->error);
|
||||
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
|
||||
$sql.=" SET statut=-1, date_envoi=SYSDATE() WHERE rowid=".$obj->rowid;
|
||||
$resql2=$db->query($sql);
|
||||
if (! $resql2)
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
// Loop finished, set global statut of mail
|
||||
$statut=2; // By default status with error
|
||||
if (! $nbko) $statut=3;
|
||||
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."mailing SET statut=".$statut." WHERE rowid=".$id;
|
||||
dolibarr_syslog("mailing-send: update global status sql=".$sql);
|
||||
$resql2=$db->query($sql);
|
||||
if (! $resql2)
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_syslog($db->error());
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
$message='';
|
||||
$_GET["action"] = '';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Action envoi test mailing
|
||||
@ -248,7 +419,7 @@ if ($_GET["action"] == 'create')
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="25%">'.$langs->trans("MailFrom").'</td><td><input class="flat" name="from" size="40" value="'.$conf->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("MailTitle").'</td><td><input class="flat" name="titre" size="40" 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>';
|
||||
@ -320,6 +491,24 @@ else
|
||||
* Mailing en mode visu
|
||||
*
|
||||
*/
|
||||
if ($_GET["action"] == 'sendall')
|
||||
{
|
||||
if (empty($conf->global->MAILING_LIMIT_SENDBYWEB))
|
||||
{
|
||||
// Pour des raisons de sécurité, on ne permet pas cette fonction via l'IHM,
|
||||
// on affiche donc juste un message
|
||||
$message='<div class="warning">'.$langs->trans("MailingNeedCommand").'</div>';
|
||||
$message.='<br><textarea cols="50" rows="'.ROWS_2.'" wrap="soft">php ./scripts/mailing/mailing-send.php '.$_GET["id"].'</textarea>';
|
||||
$message.='<br><br><div class="warning">'.$langs->trans("MailingNeedCommand2").'</div>';
|
||||
$_GET["action"]='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$text=$langs->trans('ConfirmSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
|
||||
$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$_REQUEST['id'],$langs->trans('SendMailing'),$text,'sendallconfirmed');
|
||||
print '<br />';
|
||||
}
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
@ -365,6 +554,14 @@ else
|
||||
|
||||
print "</div>";
|
||||
|
||||
if ($_GET["action"] == 'sendall')
|
||||
{
|
||||
// Pour des raisons de sécurité, on ne permet pas cette fonction via l'IHM,
|
||||
// on affiche donc juste un message
|
||||
$message='<div class="warning">'.$langs->trans("MailingNeedCommand").'</div>';
|
||||
$message.='<br><textarea cols="70" rows="'.ROWS_2.'" wrap="soft">php ./scripts/mailing/mailing-send.php '.$_GET["id"].'</textarea>';
|
||||
}
|
||||
|
||||
if ($message) print "$message<br>";
|
||||
|
||||
/*
|
||||
@ -388,7 +585,7 @@ else
|
||||
print '<a class="butAction" href="fiche.php?action=valide&id='.$mil->id.'">'.$langs->trans("ValidMailing").'</a>';
|
||||
}
|
||||
|
||||
if ($mil->statut == 1 && $mil->nbemail > 0 && $user->rights->mailing->valider)
|
||||
if (($mil->statut == 1 || $mil->statut == 2) && $mil->nbemail > 0 && $user->rights->mailing->valider)
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?action=sendall&id='.$mil->id.'">'.$langs->trans("SendMailing").'</a>';
|
||||
}
|
||||
@ -414,7 +611,7 @@ else
|
||||
$formmail->withsubstit=1;
|
||||
$formmail->withfrom=0;
|
||||
$formmail->withto=$user->email?$user->email:1;
|
||||
$formmail->withcc=0;
|
||||
$formmail->withtocc=0;
|
||||
$formmail->withtopic=0;
|
||||
$formmail->withtopicreadonly=1;
|
||||
$formmail->withfile=0;
|
||||
|
||||
@ -1771,7 +1771,7 @@ if ($_GET['propalid'] > 0)
|
||||
$formmail->frommail = $user->email;
|
||||
$formmail->withfrom=1;
|
||||
$formmail->withto=$liste;
|
||||
$formmail->withcc=1;
|
||||
$formmail->withtocc=1;
|
||||
$formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__');
|
||||
$formmail->withfile=1;
|
||||
$formmail->withbody=1;
|
||||
|
||||
@ -1942,7 +1942,7 @@ else
|
||||
$formmail->frommail = $user->email;
|
||||
$formmail->withfrom=1;
|
||||
$formmail->withto=$liste;
|
||||
$formmail->withcc=1;
|
||||
$formmail->withtocc=1;
|
||||
$formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__');
|
||||
$formmail->withfile=1;
|
||||
$formmail->withbody=1;
|
||||
|
||||
@ -3055,7 +3055,8 @@ else
|
||||
$formmail->frommail = $user->email;
|
||||
$formmail->withfrom=1;
|
||||
$formmail->withto=$liste;
|
||||
$formmail->withcc=1;
|
||||
$formmail->withtocc=1;
|
||||
$formmail->withtoccc=$conf->global->FACTURE_EMAIL_USECCC;
|
||||
$formmail->withtopic=$langs->trans('SendBillRef','__FACREF__');
|
||||
$formmail->withfile=1;
|
||||
$formmail->withbody=1;
|
||||
@ -3111,7 +3112,7 @@ else
|
||||
$formmail->frommail = $user->email;
|
||||
$formmail->withfrom=1;
|
||||
$formmail->withto=$liste;
|
||||
$formmail->withcc=1;
|
||||
$formmail->withtocc=1;
|
||||
$formmail->withtopic=$langs->trans('SendReminderBillRef','__FACREF__');
|
||||
$formmail->withfile=1;
|
||||
$formmail->withbody=1;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2005-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -14,14 +14,12 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/html.formmail.class.php
|
||||
\brief Fichier de la classe permettant la génération du formulaire html d'envoi de mail unitaire
|
||||
\version $Revision$
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT ."/html.form.class.php");
|
||||
@ -79,6 +77,7 @@ class FormMail
|
||||
$this->withfrom=1;
|
||||
$this->withto=1;
|
||||
$this->withtocc=1;
|
||||
$this->withtoccc=0;
|
||||
$this->witherrorsto=0;
|
||||
$this->withtopic=1;
|
||||
$this->withfile=0;
|
||||
@ -219,7 +218,7 @@ class FormMail
|
||||
}
|
||||
|
||||
// CC
|
||||
if ($this->withcc)
|
||||
if ($this->withtocc || is_array($this->withtocc))
|
||||
{
|
||||
print '<tr><td width="180">'.$langs->trans("MailCC").'</td><td>';
|
||||
if ($this->withtoccreadonly)
|
||||
@ -238,6 +237,26 @@ class FormMail
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
// CC
|
||||
if ($this->withtoccc || is_array($this->withtoccc))
|
||||
{
|
||||
print '<tr><td width="180">'.$langs->trans("MailCCC").'</td><td>';
|
||||
if ($this->withtocccreadonly)
|
||||
{
|
||||
print (! is_array($this->withtoccc) && ! is_numeric($this->withtoccc))?$this->withtoccc:"";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<input size=\"30\" name=\"sendtocc\" value=\"".((! is_array($this->withtoccc) && ! is_numeric($this->withtoccc))?$this->withtoccc:"")."\">";
|
||||
if (is_array($this->withtoccc))
|
||||
{
|
||||
print " ".$langs->trans("or")." ";
|
||||
$form->select_array("receiverccc",$this->withtoccc);
|
||||
}
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
// Accusé réception
|
||||
if ($this->withdeliveryreceipt)
|
||||
{
|
||||
|
||||
@ -48,7 +48,7 @@ NbOfRecipients=Number of recipients
|
||||
NbOfUniqueEMails=Nb of unique emails
|
||||
NbOfEMails=Nb of EMails
|
||||
TotalNbOfDistinctRecipients=Number of distinct recipients
|
||||
NoTargetYet=No recipients defined yet
|
||||
NoTargetYet=No recipients defined yet (Go on tab 'Recipients')
|
||||
AddRecipients=Add recipients
|
||||
RemoveRecipient=Remove recipient
|
||||
CommonSubstitutions=Common substitutions
|
||||
@ -72,6 +72,8 @@ SendMailing=Send emailing
|
||||
SendMail=Send email
|
||||
SentBy=Sent by
|
||||
MailingNeedCommand=For securities reason, sending an emailing can only be performed from command line. Ask your administrator to launch the following command to send the emailing to all recipients:
|
||||
MailingNeedCommand2=You can however send them online by adding parameter MAILING_LIMIT_SENDBYWEB with value of max number of emails you want to send by session.
|
||||
ConfirmSendingEmailing=Are you sure you want to send mailing ?<br>On line sending of emailings are limited for security reason to <b>%s</b> recipients by sending session.
|
||||
TargetsReset=Clear list
|
||||
ToClearAllRecipientsClickHere=To clear recipients' list for this emailing, click button
|
||||
ToAddRecipientsChooseHere=To add recipients, choose in those lists
|
||||
|
||||
@ -48,7 +48,7 @@ NbOfRecipients=Nombre de destinataires
|
||||
NbOfUniqueEMails=Nb d'e-mails uniques
|
||||
NbOfEMails=Nbre d'EMails
|
||||
TotalNbOfDistinctRecipients=Nombre de destinataires uniques
|
||||
NoTargetYet=Aucun destinataire défini
|
||||
NoTargetYet=Aucun destinataire défini (Aller sur l'onglet Destinataires)
|
||||
AddRecipients=Ajout de destinataires
|
||||
RemoveRecipient=Supprime destinataire
|
||||
CommonSubstitutions=Substitutions communes
|
||||
@ -68,10 +68,12 @@ TargetsStatistics=Statistiques destinataires
|
||||
NbOfCompaniesContacts=Contacts uniques des sociétés
|
||||
MailNoChangePossible=Destinataires d'un mailing validé non modifiables
|
||||
SearchAMailing=Rechercher un mailing
|
||||
SendMailing=Envoi mailing
|
||||
SendMailing=Envoi emailing
|
||||
SendMail=Envoi mail
|
||||
SentBy=Envoyé par
|
||||
MailingNeedCommand=Pour des raisons de sécurité, l'envoi d'un mailing de masse ne peut être réalisé qu'en ligne de commande. Demandez à votre administrateur de lancer la commande suivante pour envoyer le mailing à tous les destinataires :
|
||||
MailingNeedCommand=Pour des raisons de sécurité, il est recommandé de faire les envois d'un mailing de masse depuis une ligne de commande. Demandez à votre administrateur de lancer la commande suivante pour envoyer le mailing à tous les destinataires :
|
||||
MailingNeedCommand2=Vous pouvez toutefois quand même les envoyer en ligne en ajoutant le parametre MAILING_LIMIT_SENDBYWEB avec la valeur du nombre max de mails envoyés par session d'envoi.
|
||||
ConfirmSendingEmailing=Confirmez-vous l'envoi de l'emailing ?<br>L'envoi en ligne des mailings sont limités par sécurité à <b>%s</b> destinataires par session d'envoi.
|
||||
TargetsReset=Vider liste
|
||||
ToClearAllRecipientsClickHere=Pour vider la liste des destinataires de ce mailing, cliquer le bouton
|
||||
ToAddRecipientsChooseHere=Pour ajouter des destinataires, choisir dans les listes ci-dessous
|
||||
|
||||
@ -675,7 +675,7 @@ if ($_GET["facid"] > 0)
|
||||
$formmail->frommail = $user->email;
|
||||
$formmail->withfrom=1;
|
||||
$formmail->withto=$liste;
|
||||
$formmail->withcc=1;
|
||||
$formmail->withtocc=1;
|
||||
$formmail->withtopic=$langs->trans("SendBillRef","__FACREF__");
|
||||
$formmail->withfile=1;
|
||||
$formmail->withbody=1;
|
||||
@ -710,7 +710,7 @@ if ($_GET["facid"] > 0)
|
||||
$formmail->frommail = $user->email;
|
||||
$formmail->withfrom=1;
|
||||
$formmail->withto=$liste;
|
||||
$formmail->withcc=1;
|
||||
$formmail->withtocc=1;
|
||||
$formmail->withtopic=$langs->trans("SendReminderBillRef","__FACREF__");
|
||||
$formmail->withfile=1;
|
||||
$formmail->withbody=1;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user