Can add additionnal fields in emailings selectors
This commit is contained in:
parent
1820507ed4
commit
5b2b029f16
@ -1,6 +1,6 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2008 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 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
|
||||
@ -18,11 +18,11 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/comm/mailing/cibles.php
|
||||
\ingroup mailing
|
||||
\brief Page des cibles de mailing
|
||||
\version $Id$
|
||||
*/
|
||||
* \file htdocs/comm/mailing/cibles.php
|
||||
* \ingroup mailing
|
||||
* \brief Page des cibles de mailing
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
|
||||
@ -46,7 +46,7 @@ $offset = $conf->liste_limit * $_GET["page"] ;
|
||||
$pageprev = $_GET["page"] - 1;
|
||||
$pagenext = $_GET["page"] + 1;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="nom";
|
||||
if (! $sortfield) $sortfield="email";
|
||||
|
||||
$search_nom=isset($_GET["search_nom"])?$_GET["search_nom"]:$_POST["search_nom"];
|
||||
$search_prenom=isset($_GET["search_prenom"])?$_GET["search_prenom"]:$_POST["search_prenom"];
|
||||
@ -59,15 +59,15 @@ $search_email=isset($_GET["search_email"])?$_GET["search_email"]:$_POST["search_
|
||||
if ($_GET["action"] == 'add')
|
||||
{
|
||||
$modulename=$_GET["module"];
|
||||
|
||||
|
||||
// Chargement de la classe
|
||||
$file = $dirmod."/".$modulename.".modules.php";
|
||||
$classname = "mailing_".$modulename;
|
||||
require_once($file);
|
||||
|
||||
|
||||
$filtersarray=array();
|
||||
if (isset($_POST["filter"])) $filtersarray[0]=$_POST["filter"];
|
||||
|
||||
|
||||
$obj = new $classname($db);
|
||||
$result=$obj->add_to_target($_GET["rowid"],$filtersarray);
|
||||
|
||||
@ -79,11 +79,11 @@ if ($_GET["action"] == 'add')
|
||||
if ($result == 0)
|
||||
{
|
||||
$mesg='<div class="warning">'.$langs->trans("WarningNoEMailsAdded").'</div>';
|
||||
}
|
||||
}
|
||||
if ($result < 0)
|
||||
{
|
||||
$mesg='<div class="error">'.$obj->error.'</div>';
|
||||
}
|
||||
}
|
||||
$_REQUEST["id"]=$_GET["rowid"];
|
||||
}
|
||||
|
||||
@ -93,10 +93,10 @@ if ($_GET["action"] == 'clear')
|
||||
$file = $dirmod."/modules_mailings.php";
|
||||
$classname = "MailingTargets";
|
||||
require_once($file);
|
||||
|
||||
|
||||
$obj = new $classname($db);
|
||||
$obj->clear_target($_GET["rowid"]);
|
||||
|
||||
|
||||
Header("Location: cibles.php?id=".$_GET["rowid"]);
|
||||
exit;
|
||||
}
|
||||
@ -111,7 +111,7 @@ if ($_GET["action"] == 'delete')
|
||||
$file = $dirmod."/modules_mailings.php";
|
||||
$classname = "MailingTargets";
|
||||
require_once($file);
|
||||
|
||||
|
||||
$obj = new $classname($db);
|
||||
$obj->update_nb($_REQUEST["id"]);
|
||||
}
|
||||
@ -141,12 +141,12 @@ $mil = new Mailing($db);
|
||||
$html = new Form($db);
|
||||
if ($mil->fetch($_REQUEST["id"]) >= 0)
|
||||
{
|
||||
|
||||
|
||||
$h=0;
|
||||
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/fiche.php?id=".$mil->id;
|
||||
$head[$h][1] = $langs->trans("MailCard");
|
||||
$h++;
|
||||
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/cibles.php?id=".$mil->id;
|
||||
$head[$h][1] = $langs->trans("MailRecipients");
|
||||
$hselected = $h;
|
||||
@ -158,10 +158,10 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
|
||||
$h++;
|
||||
*/
|
||||
dolibarr_fiche_head($head, $hselected, $langs->trans("Mailing"));
|
||||
|
||||
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $html->showrefnav($mil,'id');
|
||||
@ -171,14 +171,14 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
|
||||
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:'0').'</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
print "</div>";
|
||||
|
||||
|
||||
if ($mesg) print "$mesg<br>\n";
|
||||
|
||||
$var=!$var;
|
||||
|
||||
// Affiche les listes de s<EFBFBD>lection
|
||||
// Affiche les listes de selection
|
||||
if ($mil->statut == 0)
|
||||
{
|
||||
print_titre($langs->trans("ToAddRecipientsChooseHere"));
|
||||
@ -191,19 +191,19 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
|
||||
print '<td align="left">'.$langs->trans("Filter").'</td>';
|
||||
print '<td align="center" width="120"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
clearstatcache();
|
||||
|
||||
$var=true;
|
||||
foreach ($conf->dol_document_root as $dirroot)
|
||||
{
|
||||
$dir=$dirroot."/includes/modules/mailings/";
|
||||
|
||||
|
||||
if (is_dir($dir))
|
||||
{
|
||||
$handle=opendir($dir);
|
||||
if ($handle)
|
||||
{
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
|
||||
@ -212,14 +212,14 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
|
||||
{
|
||||
$modulename=$reg[1];
|
||||
if ($modulename == 'example') continue;
|
||||
|
||||
|
||||
// Chargement de la classe
|
||||
$file = $dir.$modulename.".modules.php";
|
||||
$classname = "mailing_".$modulename;
|
||||
require_once($file);
|
||||
|
||||
|
||||
$obj = new $classname($db);
|
||||
|
||||
|
||||
$qualified=1;
|
||||
foreach ($obj->require_module as $key)
|
||||
{
|
||||
@ -230,20 +230,20 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Si le module mailing est qualifi<EFBFBD>
|
||||
|
||||
// Si le module mailing est qualifie
|
||||
if ($qualified)
|
||||
{
|
||||
$var = !$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
|
||||
|
||||
if ($mil->statut == 0) print '<form name="'.$modulename.'" action="cibles.php?action=add&rowid='.$mil->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';
|
||||
|
||||
|
||||
print '<td>';
|
||||
if (! $obj->picto) $obj->picto='generic';
|
||||
print img_object('',$obj->picto).' '.$obj->getDesc();
|
||||
print img_object($langs->trans("Module").': '.get_class($obj),$obj->picto).' '.$obj->getDesc();
|
||||
print '</td>';
|
||||
|
||||
|
||||
/*
|
||||
print '<td width=\"100\">';
|
||||
print $modulename;
|
||||
@ -260,13 +260,13 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
|
||||
print $langs->trans("Error").' '.img_error($obj->error);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td align="left">';
|
||||
$filter=$obj->formFilter();
|
||||
if ($filter) print $filter;
|
||||
else print $langs->trans("None");
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td align="right">';
|
||||
if ($mil->statut == 0)
|
||||
{
|
||||
@ -278,9 +278,9 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
|
||||
print " ";
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
if ($mil->statut == 0) print '</form>';
|
||||
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
@ -290,10 +290,10 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
|
||||
}
|
||||
}
|
||||
} // End foreach dir
|
||||
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<form action="cibles.php?action=clear&rowid='.$mil->id.'" method="POST">';
|
||||
print_titre($langs->trans("ToClearAllRecipientsClickHere"));
|
||||
print '<table class="noborder" width="100%">';
|
||||
@ -304,7 +304,7 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// List of selected targets
|
||||
@ -314,7 +314,7 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="id" value="'.$mil->id.'">';
|
||||
|
||||
$sql = "SELECT mc.rowid, mc.nom, mc.prenom, mc.email, mc.statut, mc.date_envoi, mc.url";
|
||||
$sql = "SELECT mc.rowid, mc.nom, mc.prenom, mc.email, mc.other, mc.statut, mc.date_envoi, mc.url";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
|
||||
$sql .= " WHERE mc.fk_mailing=".$mil->id;
|
||||
if ($search_nom) $sql.= " AND mc.nom like '%".addslashes($search_nom)."%'";
|
||||
@ -322,12 +322,12 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
|
||||
if ($search_email) $sql.= " AND mc.email like '%".addslashes($search_email)."%'";
|
||||
if ($sortfield) { $sql .= " ORDER BY $sortfield $sortorder"; }
|
||||
$sql .= $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
|
||||
$addu = "&id=".$mil->id;
|
||||
if ($search_nom) $addu.= "&search_nom=".urlencode($search_nom);
|
||||
if ($search_prenom) $addu.= "&search_prenom=".urlencode($search_prenom);
|
||||
@ -338,10 +338,11 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
|
||||
if ($page) $addu.= "&page=".$page;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"mc.email",$addu,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"mc.nom",$addu,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"mc.prenom",$addu,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"mc.email",$addu,"","",$sortfield,$sortorder);
|
||||
print '<td align="center"> </td>';
|
||||
print_liste_field_titre($langs->trans("OtherInformations"),$_SERVER["PHP_SELF"],"",$addu,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Source"),$_SERVER["PHP_SELF"],"",$addu,"",'align="center"',$sortfield,$sortorder);
|
||||
|
||||
// Date
|
||||
if ($mil->statut < 2)
|
||||
@ -351,7 +352,7 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
|
||||
else
|
||||
{
|
||||
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"mc.date_envoi",$addu,'','align="center"',$sortfield,$sortorder);
|
||||
}
|
||||
}
|
||||
|
||||
// Statut
|
||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"mc.statut",$addu,'','align="right"',$sortfield,$sortorder);
|
||||
@ -360,37 +361,46 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
|
||||
|
||||
// Ligne des champs de filtres
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_nom" size="12" value="'.$search_nom.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_prenom" size="10" value="'.$search_prenom.'">';
|
||||
print '</td>';
|
||||
// EMail
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_email" size="14" value="'.$search_email.'">';
|
||||
print '</td>';
|
||||
// Name
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_nom" size="12" value="'.$search_nom.'">';
|
||||
print '</td>';
|
||||
// Firstname
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" type="text" name="search_prenom" size="10" value="'.$search_prenom.'">';
|
||||
print '</td>';
|
||||
// Other
|
||||
print '<td class="liste_titre">';
|
||||
print ' ';
|
||||
print '</td>';
|
||||
// Url
|
||||
print '<td class="liste_titre" align="right" colspan="3">';
|
||||
print '<input type="image" value="button_search" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" name="button_search" alt="'.$langs->trans("Search").'">';
|
||||
print ' <input type="image" value="button_removefilter" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" name="button_removefilter" alt="'.$langs->trans("RemoveFilter").'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$var = true;
|
||||
$i = 0;
|
||||
|
||||
|
||||
if ($num)
|
||||
{
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>'.$obj->email.'</td>';
|
||||
print '<td>'.$obj->nom.'</td>';
|
||||
print '<td>'.$obj->prenom.'</td>';
|
||||
print '<td>'.$obj->email.'</td>';
|
||||
print '<td>'.$obj->url.'</td>';
|
||||
|
||||
print '<td>'.$obj->other.'</td>';
|
||||
print '<td align="center">'.$obj->url.'</td>';
|
||||
|
||||
// Statut pour l'email destinataire (Attentioon != statut du mailing)
|
||||
if ($obj->statut == 0)
|
||||
{
|
||||
@ -404,30 +414,30 @@ if ($mil->fetch($_REQUEST["id"]) >= 0)
|
||||
if ($obj->statut==-1) print $langs->trans("MailingStatusError").' '.img_error();
|
||||
if ($obj->statut==1) print $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6');
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr '.$bc[false].'><td colspan="6">'.$langs->trans("NoTargetYet").'</td></tr>';
|
||||
print '<tr '.$bc[false].'><td colspan="7">'.$langs->trans("NoTargetYet").'</td></tr>';
|
||||
}
|
||||
print "</table><br>";
|
||||
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
print '</form>';
|
||||
print "\n<!-- Fin liste destinataires selectionnes -->\n";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
@ -36,17 +36,23 @@ if (! $user->rights->mailing->lire || $user->societe_id > 0)
|
||||
$message = '';
|
||||
|
||||
// Tableau des substitutions possibles
|
||||
$substitutionarray=array(
|
||||
$substitutionarray=array(
|
||||
'__ID__' => 'IdRecord',
|
||||
'__EMAIL__' => 'EMail',
|
||||
'__LASTNAME__' => 'Lastname',
|
||||
'__FIRSTNAME__' => 'Firstname'
|
||||
'__FIRSTNAME__' => 'Firstname',
|
||||
'__OTHER1__' => 'Other1',
|
||||
'__OTHER2__' => 'Other2',
|
||||
'__OTHER3__' => 'Other3',
|
||||
);
|
||||
$substitutionarrayfortest=array(
|
||||
$substitutionarrayfortest=array(
|
||||
'__ID__' => 'TESTIdRecord',
|
||||
'__EMAIL__' => 'TESTEMail',
|
||||
'__LASTNAME__' => 'TESTLastname',
|
||||
'__FIRSTNAME__' => 'TESTFirstname'
|
||||
'__FIRSTNAME__' => 'TESTFirstname',
|
||||
'__OTHER1__' => 'TESTOther1',
|
||||
'__OTHER2__' => 'TESTOther2',
|
||||
'__OTHER3__' => 'TESTOther3'
|
||||
);
|
||||
|
||||
|
||||
@ -92,13 +98,13 @@ if ($_POST["action"] == 'sendallconfirmed')
|
||||
{
|
||||
$mil=new Mailing($db);
|
||||
$result=$mil->fetch($_GET['id']);
|
||||
|
||||
|
||||
if ($mil->statut == 0)
|
||||
{
|
||||
dolibarr_print_error('','ErrorMailIsNotValidated');
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$id = $mil->id;
|
||||
$subject = $mil->sujet;
|
||||
$message = $mil->body;
|
||||
@ -106,16 +112,16 @@ if ($_POST["action"] == 'sendallconfirmed')
|
||||
$errorsto = $mil->email_errorsto;
|
||||
// Le message est-il en html
|
||||
$msgishtml=-1; // Unknown by default
|
||||
if (eregi('[ \t]*<html>',$message)) $msgishtml=1;
|
||||
|
||||
if (eregi('[ \t]*<html>',$message)) $msgishtml=1;
|
||||
|
||||
// Warning, we must not use begin-commit transaction here
|
||||
// because we want to save update for each mail sent.
|
||||
|
||||
|
||||
$nbok=0; $nbko=0;
|
||||
|
||||
// On choisit les mails non deja envoyes pour ce mailing (statut=0)
|
||||
// ou envoyes en erreur (statut=-1)
|
||||
$sql = "SELECT mc.rowid, mc.nom, mc.prenom, mc.email";
|
||||
$sql = "SELECT mc.rowid, mc.nom, mc.prenom, mc.email, mc.other";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
|
||||
$sql .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$id;
|
||||
|
||||
@ -124,50 +130,57 @@ if ($_POST["action"] == 'sendallconfirmed')
|
||||
{
|
||||
$num = $db->num_rows($resql); // nb of possible recipients
|
||||
|
||||
if ($num)
|
||||
if ($num)
|
||||
{
|
||||
dolibarr_syslog("mailing-send: nb of targets = ".$num, LOG_DEBUG);
|
||||
|
||||
// Positionne date debut envoi
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."mailing SET date_envoi=SYSDATE() WHERE rowid=".$id;
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."mailing SET date_envoi=".$db->idate(gmmktime())." 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(
|
||||
$other=split(';',$obj->other);
|
||||
$other1=$other[0];
|
||||
$other2=$other[1];
|
||||
$other3=$other[3];
|
||||
$substitutionarray=array(
|
||||
'__ID__' => $obj->rowid,
|
||||
'__EMAIL__' => $obj->email,
|
||||
'__LASTNAME__' => $obj->nom,
|
||||
'__FIRSTNAME__' => $obj->prenom
|
||||
'__FIRSTNAME__' => $obj->prenom,
|
||||
'__OTHER1__' => $other1,
|
||||
'__OTHER2__' => $other2,
|
||||
'__OTHER3__' => $other3
|
||||
);
|
||||
|
||||
$substitutionisok=true;
|
||||
$newsubject=make_substitutions($subject,$substitutionarray);
|
||||
$newmessage=make_substitutions($message,$substitutionarray);
|
||||
|
||||
|
||||
// Fabrication du mail
|
||||
$mail = new CMailFile($newsubject, $sendto, $from, $newmessage,
|
||||
$mail = new CMailFile($newsubject, $sendto, $from, $newmessage,
|
||||
array(), array(), array(),
|
||||
'', '', 0, $msgishtml);
|
||||
$mail->errors_to = $errorsto;
|
||||
|
||||
|
||||
|
||||
|
||||
if ($mail->error)
|
||||
{
|
||||
$res=0;
|
||||
@ -183,38 +196,38 @@ if ($_POST["action"] == 'sendallconfirmed')
|
||||
{
|
||||
$res=$mail->sendfile();
|
||||
}
|
||||
|
||||
|
||||
if ($res)
|
||||
{
|
||||
// Mail envoye avec succes
|
||||
$nbok++;
|
||||
|
||||
|
||||
dolibarr_syslog("mailing-send: ok for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
|
||||
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
|
||||
$sql.=" SET statut=1, date_envoi=SYSDATE() WHERE rowid=".$obj->rowid;
|
||||
$sql.=" SET statut=1, date_envoi=".$db->idate(gmmktime())." WHERE rowid=".$obj->rowid;
|
||||
$resql2=$db->query($sql);
|
||||
if (! $resql2)
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Mail en echec
|
||||
$nbko++;
|
||||
|
||||
|
||||
dolibarr_syslog("mailing-send: error for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
|
||||
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
|
||||
$sql.=" SET statut=-1, date_envoi=SYSDATE() WHERE rowid=".$obj->rowid;
|
||||
$sql.=" SET statut=-1, date_envoi=".$db->idate(gmmktime())." WHERE rowid=".$obj->rowid;
|
||||
$resql2=$db->query($sql);
|
||||
if (! $resql2)
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
@ -224,10 +237,10 @@ if ($_POST["action"] == 'sendallconfirmed')
|
||||
{
|
||||
$statut=2; // Status 'sent partially' (because at least one error)
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
if ($nbok >= $num) $statut=3; // Send to everybody
|
||||
else $statut=2; // Status 'sent partially' (because not send to everybody)
|
||||
else $statut=2; // Status 'sent partially' (because not send to everybody)
|
||||
}
|
||||
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."mailing SET statut=".$statut." WHERE rowid=".$id;
|
||||
@ -244,7 +257,7 @@ if ($_POST["action"] == 'sendallconfirmed')
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
$message='';
|
||||
$_GET["action"] = '';
|
||||
$_GET["action"] = '';
|
||||
|
||||
}
|
||||
}
|
||||
@ -254,7 +267,7 @@ if ($_POST["action"] == 'send' && ! $_POST["cancel"])
|
||||
{
|
||||
$mil = new Mailing($db);
|
||||
$result=$mil->fetch($_POST["mailid"]);
|
||||
|
||||
|
||||
$mil->sendto = $_POST["sendto"];
|
||||
if (! $mil->sendto)
|
||||
{
|
||||
@ -268,12 +281,12 @@ if ($_POST["action"] == 'send' && ! $_POST["cancel"])
|
||||
|
||||
// Le message est-il en html
|
||||
$msgishtml=-1; // Inconnu par defaut
|
||||
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,
|
||||
$arr_file,$arr_mime,$arr_name,
|
||||
'', '', 0, $msgishtml);
|
||||
@ -297,7 +310,7 @@ if ($_POST["action"] == 'send' && ! $_POST["cancel"])
|
||||
if ($_POST["action"] == 'add')
|
||||
{
|
||||
$message='';
|
||||
|
||||
|
||||
$mil = new Mailing($db);
|
||||
|
||||
$mil->email_from = trim($_POST["from"]);
|
||||
@ -371,11 +384,11 @@ if ($_POST["action"] == 'confirm_approve')
|
||||
if ($_POST["confirm"] == 'yes')
|
||||
{
|
||||
$mil = new Mailing($db);
|
||||
|
||||
|
||||
if ($mil->fetch($_GET["id"]) >= 0)
|
||||
{
|
||||
$mil->approve($user);
|
||||
|
||||
|
||||
Header("Location: fiche.php?id=".$mil->id);
|
||||
exit;
|
||||
}
|
||||
@ -398,7 +411,7 @@ if ($_POST["action"] == 'confirm_delete')
|
||||
{
|
||||
$mil = new Mailing($db);
|
||||
$mil->id = $_GET["id"];
|
||||
|
||||
|
||||
if ($mil->delete($mil->id))
|
||||
{
|
||||
Header("Location: index.php");
|
||||
@ -430,14 +443,15 @@ if ($_GET["action"] == 'create')
|
||||
print '<form action="fiche.php" method="post">'."\n";
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
print_titre($langs->trans("NewMailing"));
|
||||
print_fiche_titre($langs->trans("NewMailing"));
|
||||
|
||||
if ($message) print "$message<br>";
|
||||
|
||||
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->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 colspan="2"> </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("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 '<br><i>'.$langs->trans("CommonSubstitutions").':<br>';
|
||||
@ -571,8 +585,8 @@ else
|
||||
print '</table>';
|
||||
|
||||
print "</div>";
|
||||
|
||||
|
||||
|
||||
|
||||
// Clone confirmation
|
||||
if ($_GET["action"] == 'clone')
|
||||
{
|
||||
@ -585,10 +599,10 @@ else
|
||||
// Paiement incomplet. On demande si motif = escompte ou autre
|
||||
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$mil->id,$langs->trans('CloneEMailing'),$langs->trans('ConfirmCloneEMailing',$mil->ref),'confirm_clone',$formquestion,'yes');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ($mesg) print $mesg;
|
||||
|
||||
|
||||
|
||||
if ($_GET["action"] == 'sendall')
|
||||
{
|
||||
@ -597,7 +611,7 @@ else
|
||||
$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>";
|
||||
|
||||
/*
|
||||
@ -643,10 +657,10 @@ else
|
||||
if ($_GET["action"] == 'test')
|
||||
{
|
||||
print_titre($langs->trans("TestMailing"));
|
||||
|
||||
|
||||
// Create l'objet formulaire mail
|
||||
include_once("../../html.formmail.class.php");
|
||||
$formmail = new FormMail($db);
|
||||
$formmail = new FormMail($db);
|
||||
$formmail->fromname = $mil->email_from;
|
||||
$formmail->frommail = $mil->email_from;
|
||||
$formmail->withsubstit=1;
|
||||
@ -667,15 +681,15 @@ else
|
||||
$formmail->param["models"]="body";
|
||||
$formmail->param["mailid"]=$mil->id;
|
||||
$formmail->param["returnurl"]=DOL_URL_ROOT."/comm/mailing/fiche.php?id=".$mil->id;
|
||||
|
||||
|
||||
// Init list of files
|
||||
if (! empty($_REQUEST["mode"]) && $_REQUEST["mode"]=='init')
|
||||
{
|
||||
$formmail->clear_attached_files();
|
||||
}
|
||||
|
||||
|
||||
$formmail->show_form();
|
||||
|
||||
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
@ -700,6 +714,7 @@ else
|
||||
print '__EMAIL__ = '.$langs->trans("EMail").'<br>';
|
||||
print '__LASTNAME__ = '.$langs->trans("Lastname").'<br>';
|
||||
print '__FIRSTNAME__ = '.$langs->trans("Firstname").'<br>';
|
||||
print '__OTHER1__ = '.$langs->trans("Other").'<br>';
|
||||
print '</i></td>';
|
||||
print '<td colspan="3">';
|
||||
// Editeur wysiwyg
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2005-2009 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
|
||||
@ -28,7 +28,7 @@ require("./pre.inc.php");
|
||||
if (!$user->rights->mailing->lire) accessforbidden();
|
||||
|
||||
// Sécurité accés client
|
||||
if ($user->societe_id > 0)
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socid = $user->societe_id;
|
||||
@ -42,11 +42,17 @@ if ($page == -1) { $page = 0 ; }
|
||||
$offset = $conf->liste_limit * $_GET["page"] ;
|
||||
$pageprev = $_GET["page"] - 1;
|
||||
$pagenext = $_GET["page"] + 1;
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="m.date_creat";
|
||||
|
||||
$sall=isset($_GET["sall"])?$_GET["sall"]:$_POST["sall"];
|
||||
$sref=isset($_GET["sref"])?$_GET["sref"]:$_POST["sref"];
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
|
||||
@ -67,7 +73,7 @@ if ($result)
|
||||
print_barre_liste($langs->trans("ListOfEMailings"), $page, "liste.php","",$sortfield,$sortorder,"",$num);
|
||||
|
||||
$i = 0;
|
||||
|
||||
|
||||
$addu = "&sall=".$sall;
|
||||
print '<table class="liste">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -91,22 +97,22 @@ if ($result)
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
print '</form>';
|
||||
|
||||
|
||||
$var=True;
|
||||
|
||||
$email=new Mailing($db);
|
||||
|
||||
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/mailing/fiche.php?id='.$obj->rowid.'">';
|
||||
print img_object($langs->trans("ShowEMail"),"email").' '.stripslashes($obj->rowid).'</a></td>';
|
||||
print '<td>'.$obj->titre.'</td>';
|
||||
print '<td align="center">'.dolibarr_print_date($obj->datec).'</td>';
|
||||
print '<td align="center">'.dolibarr_print_date($obj->datec,'day').'</td>';
|
||||
print '<td align="center">'.$obj->nbemail.'</td>';
|
||||
print '<td align="right">'.$email->LibStatut($obj->statut,5).'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2009 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
|
||||
@ -37,7 +37,7 @@ class Mailing extends CommonObject
|
||||
var $error;
|
||||
var $element='mailing';
|
||||
var $table_element='mailing';
|
||||
|
||||
|
||||
var $id;
|
||||
var $statut;
|
||||
var $titre;
|
||||
@ -225,9 +225,9 @@ class Mailing extends CommonObject
|
||||
function createFromClone($fromid,$option1,$option2)
|
||||
{
|
||||
global $user,$langs;
|
||||
|
||||
|
||||
$error=0;
|
||||
|
||||
|
||||
$object=new Mailing($this->db);
|
||||
|
||||
$this->db->begin();
|
||||
@ -243,7 +243,7 @@ class Mailing extends CommonObject
|
||||
// If no option copy content
|
||||
if (empty($option1))
|
||||
{
|
||||
// Clear values
|
||||
// Clear values
|
||||
$object->nbemail = 0;
|
||||
$object->titre = $langs->trans("Draft").' '.mktime();
|
||||
$object->sujet = '';
|
||||
@ -265,19 +265,19 @@ class Mailing extends CommonObject
|
||||
$result=$object->create($user);
|
||||
|
||||
// Other options
|
||||
if ($result < 0)
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$object->error;
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// End
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
@ -33,14 +33,14 @@ fill the $target PHP array with one record for each email your selector must ret
|
||||
|
||||
You can choose the way you get data: From a file, a database. You are free,
|
||||
the only requirement is that the $target array is filled by records that are
|
||||
themselves array of: ('email', 'name', 'firstname').
|
||||
themselves array of: ('email', 'name', 'firstname', 'other').
|
||||
|
||||
This is for example how you can fill the $target array:
|
||||
|
||||
// ----- Your code start here -----
|
||||
$target[0]=array('email'=>'email_0','name'=>'name_0','firstname'=>'firstname_0');
|
||||
$target[0]=array('email'=>'email_0','name'=>'name_0','firstname'=>'firstname_0', 'other'=>'other_0');
|
||||
...
|
||||
$target[n]=array('email'=>'email_n','name'=>'name_n','firstname'=>'firstname_n');
|
||||
$target[n]=array('email'=>'email_n','name'=>'name_n','firstname'=>'firstname_n', 'other'=>'other_n');
|
||||
// ----- Your code end here -----
|
||||
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ class mailing_example extends MailingTargets
|
||||
// CHANGE THIS: Put here a name not already used
|
||||
var $name='example';
|
||||
// CHANGE THIS: Put here a description of your selector module.
|
||||
// This label is used if no translation for MailingModuleDescXXX where XXX=name is found
|
||||
// This label is used if no translation is found for key MailingModuleDescXXX where XXX=name is found
|
||||
var $desc='Put here a description';
|
||||
// CHANGE THIS: Set to 1 if selector is available for admin users only
|
||||
var $require_admin=0;
|
||||
@ -37,7 +37,7 @@ class mailing_example extends MailingTargets
|
||||
var $require_module=array();
|
||||
var $picto='';
|
||||
var $db;
|
||||
|
||||
|
||||
|
||||
// CHANGE THIS: Constructor name must be called mailing_xxx with xxx=name of your selector
|
||||
function mailing_example($DB)
|
||||
@ -60,18 +60,18 @@ class mailing_example extends MailingTargets
|
||||
// ----- Your code start here -----
|
||||
|
||||
// You must fill the $target array with record like this
|
||||
// $target[0]=array('email'=>'email_0','name'=>'name_0','firstname'=>'firstname_0');
|
||||
// $target[0]=array('email'=>'email_0','name'=>'name_0','firstname'=>'firstname_0', 'other'=>'other_0');
|
||||
// ...
|
||||
// $target[n]=array('email'=>'email_n','name'=>'name_n','firstname'=>'firstname_n');
|
||||
// $target[n]=array('email'=>'email_n','name'=>'name_n','firstname'=>'firstname_n', 'other'=>'other_n');
|
||||
|
||||
// Example: $target[0]=array('email'=>'myemail@mydomain.com','name'=>'Doe','firstname'=>'John');
|
||||
// Example: $target[0]=array('email'=>'myemail@mydomain.com', 'name'=>'Doe', 'firstname'=>'John', 'other'=>'Other information');
|
||||
|
||||
// ----- Your code end here -----
|
||||
|
||||
|
||||
return parent::add_to_target($mailing_id, $target);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \brief On the main mailing area, there is a box with statistics.
|
||||
* If you want to add a line in this report you must provide an
|
||||
@ -82,7 +82,7 @@ class mailing_example extends MailingTargets
|
||||
function getSqlArrayForStats()
|
||||
{
|
||||
// CHANGE THIS: Optionnal
|
||||
|
||||
|
||||
//var $statssql=array();
|
||||
//$this->statssql[0]="SELECT field1 as label, count(distinct(email)) as nb FROM mytable WHERE email IS NOT NULL";
|
||||
return array();
|
||||
@ -101,9 +101,9 @@ class mailing_example extends MailingTargets
|
||||
|
||||
// Example: return parent::getNbOfRecipients("SELECT count(*) as nb from dolibarr_table");
|
||||
// Example: return 500;
|
||||
return '?';
|
||||
return '?';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief This is to add a form filter to provide variant of selector
|
||||
* If used, the HTML select must be called "filter"
|
||||
@ -116,8 +116,8 @@ class mailing_example extends MailingTargets
|
||||
$s='';
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \brief Can include an URL link on each record provided by selector
|
||||
* shown on target page.
|
||||
|
||||
@ -39,7 +39,7 @@ class mailing_fraise extends MailingTargets
|
||||
var $require_module=array('adherent'); // Module mailing actif si modules require_module actifs
|
||||
var $require_admin=0; // Module mailing actif pour user admin ou non
|
||||
var $picto='user';
|
||||
|
||||
|
||||
var $db;
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ class mailing_fraise extends MailingTargets
|
||||
{
|
||||
$this->db=$DB;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getSqlArrayForStats()
|
||||
{
|
||||
@ -78,10 +78,10 @@ class mailing_fraise extends MailingTargets
|
||||
|
||||
// La requete doit retourner un champ "nb" pour etre comprise
|
||||
// par parent::getNbOfRecipients
|
||||
return parent::getNbOfRecipients($sql);
|
||||
return parent::getNbOfRecipients($sql);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \brief Affiche formulaire de filtre qui apparait dans page de selection
|
||||
* des destinataires de mailings
|
||||
@ -91,7 +91,7 @@ class mailing_fraise extends MailingTargets
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("members");
|
||||
|
||||
|
||||
$s='';
|
||||
$s.='<select name="filter" class="flat">';
|
||||
$s.='<option value="-1">'.$langs->trans("MemberStatusDraft").'</option>';
|
||||
@ -101,8 +101,8 @@ class mailing_fraise extends MailingTargets
|
||||
$s.='</select>';
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \brief Renvoie url lien vers fiche de la source du destinataire du mailing
|
||||
* \return string Url lien
|
||||
@ -111,8 +111,8 @@ class mailing_fraise extends MailingTargets
|
||||
{
|
||||
return '<a href="'.DOL_URL_ROOT.'/adherents/fiche.php?rowid='.$id.'">'.img_object('',"user").'</a>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \brief Ajoute destinataires dans table des cibles
|
||||
* \param mailing_id Id du mailing concerné
|
||||
@ -121,10 +121,15 @@ class mailing_fraise extends MailingTargets
|
||||
*/
|
||||
function add_to_target($mailing_id,$filtersarray=array())
|
||||
{
|
||||
$cibles = array();
|
||||
global $langs;
|
||||
$langs->load("members");
|
||||
|
||||
$cibles = array();
|
||||
|
||||
// La requete doit retourner: id, email, fk_contact, name, firstname
|
||||
$sql = "SELECT a.rowid as id, a.email as email, null as fk_contact, a.nom as name, a.prenom as firstname";
|
||||
$sql = "SELECT a.rowid as id, a.email as email, null as fk_contact, ";
|
||||
$sql.= " a.nom as name, a.prenom as firstname,";
|
||||
$sql.= " a.datefin"; // Other fields
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
||||
$sql.= " WHERE a.email IS NOT NULL";
|
||||
foreach($filtersarray as $key)
|
||||
@ -157,6 +162,7 @@ class mailing_fraise extends MailingTargets
|
||||
'fk_contact' => $obj->fk_contact,
|
||||
'name' => $obj->name,
|
||||
'firstname' => $obj->firstname,
|
||||
'other' => $obj->datefin?($langs->transnoentities("DateEnd").'='.dolibarr_print_date($this->db->jdate($obj->datefin),'day')):'',
|
||||
'url' => $this->url($obj->id)
|
||||
);
|
||||
$old = $obj->email;
|
||||
|
||||
@ -18,26 +18,24 @@
|
||||
include_once DOL_DOCUMENT_ROOT.'/includes/modules/mailings/modules_mailings.php';
|
||||
|
||||
|
||||
// CHANGE THIS: Class name must be called mailing_xxx with xxx=name of your selector
|
||||
|
||||
/**
|
||||
\class mailing_kiwi
|
||||
\brief Class to manage a list of personalised recipients for mailing feature
|
||||
*/
|
||||
* \class mailing_kiwi
|
||||
* \brief Class to manage a list of personalised recipients for mailing feature
|
||||
*/
|
||||
class mailing_kiwi extends MailingTargets
|
||||
{
|
||||
// CHANGE THIS: Put here a name not already used
|
||||
var $name='ContactsCategories';
|
||||
// CHANGE THIS: Put here a description of your selector module.
|
||||
// This label is used if no translation for MailingModuleDescXXX where XXX=name is found
|
||||
var $desc="Contacts des tiers (par categorie)";
|
||||
// This label is used if no translation found for key MailingModuleDescXXX where XXX=name is found
|
||||
var $desc="Third parties (by categories)";
|
||||
// CHANGE THIS: Set to 1 if selector is available for admin users only
|
||||
var $require_admin=0;
|
||||
|
||||
var $require_module=array("categorie");
|
||||
var $picto='contact';
|
||||
var $picto='company';
|
||||
var $db;
|
||||
|
||||
|
||||
|
||||
// CHANGE THIS: Constructor name must be called mailing_xxx with xxx=name of your selector
|
||||
function mailing_categories($DB)
|
||||
@ -54,15 +52,21 @@ class mailing_kiwi extends MailingTargets
|
||||
*/
|
||||
function add_to_target($mailing_id,$filtersarray=array())
|
||||
{
|
||||
$cibles = array();
|
||||
global $langs;
|
||||
|
||||
$cibles = array();
|
||||
|
||||
// CHANGE THIS
|
||||
// Select the contacts from category
|
||||
$sql = "SELECT s.rowid as id, s.email as email, s.nom as name, llx_categorie.label, null as fk_contact, null as firstname
|
||||
FROM llx_societe as s
|
||||
LEFT JOIN llx_categorie_societe ON llx_categorie_societe.fk_societe=s.rowid
|
||||
LEFT JOIN llx_categorie ON llx_categorie.rowid = llx_categorie_societe.fk_categorie
|
||||
WHERE llx_categorie.rowid='".$_POST['filter']."'";
|
||||
$sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname,";
|
||||
if ($_POST['filter']) $sql.= " llx_categorie.label as label";
|
||||
else $sql.=" null as label";
|
||||
$sql.= " FROM llx_societe as s";
|
||||
if ($_POST['filter']) $sql.= " LEFT JOIN llx_categorie_societe ON llx_categorie_societe.fk_societe=s.rowid";
|
||||
if ($_POST['filter']) $sql.= " LEFT JOIN llx_categorie ON llx_categorie.rowid = llx_categorie_societe.fk_categorie";
|
||||
$sql.= " WHERE s.email != ''";
|
||||
if ($_POST['filter']) $sql.= " AND llx_categorie.rowid='".$_POST['filter']."'";
|
||||
$sql.= " ORDER BY s.email";
|
||||
|
||||
// Stocke destinataires dans cibles
|
||||
$result=$this->db->query($sql);
|
||||
@ -85,6 +89,7 @@ class mailing_kiwi extends MailingTargets
|
||||
'fk_contact' => $obj->fk_contact,
|
||||
'name' => $obj->name,
|
||||
'firstname' => $obj->firstname,
|
||||
'other' => ($obj->label?$langs->transnoentities("Category").'='.$obj->label:''),
|
||||
'url' => $this->url($obj->id)
|
||||
);
|
||||
$old = $obj->email;
|
||||
@ -101,11 +106,11 @@ class mailing_kiwi extends MailingTargets
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return parent::add_to_target($mailing_id, $cibles);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \brief On the main mailing area, there is a box with statistics.
|
||||
* If you want to add a line in this report you must provide an
|
||||
@ -116,7 +121,7 @@ class mailing_kiwi extends MailingTargets
|
||||
function getSqlArrayForStats()
|
||||
{
|
||||
// CHANGE THIS: Optionnal
|
||||
|
||||
|
||||
//var $statssql=array();
|
||||
//$this->statssql[0]="SELECT field1 as label, count(distinct(email)) as nb FROM mytable WHERE email IS NOT NULL";
|
||||
return array();
|
||||
@ -131,9 +136,15 @@ class mailing_kiwi extends MailingTargets
|
||||
*/
|
||||
function getNbOfRecipients()
|
||||
{
|
||||
return '?';
|
||||
$sql = "SELECT count(distinct(s.email)) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= " WHERE s.email != ''";
|
||||
|
||||
// La requete doit retourner un champ "nb" pour etre comprise
|
||||
// par parent::getNbOfRecipients
|
||||
return parent::getNbOfRecipients($sql);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief This is to add a form filter to provide variant of selector
|
||||
* If used, the HTML select must be called "filter"
|
||||
@ -142,10 +153,11 @@ class mailing_kiwi extends MailingTargets
|
||||
function formFilter()
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
||||
$s='';
|
||||
$s.='<select name="filter" class="flat">';
|
||||
|
||||
$s.='<option value="0">'.$langs->trans("ContactsAllShort").'</option>';
|
||||
|
||||
# Show categories
|
||||
$sql = "SELECT rowid, label, type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie";
|
||||
@ -175,8 +187,8 @@ class mailing_kiwi extends MailingTargets
|
||||
return $s;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \brief Can include an URL link on each record provided by selector
|
||||
* shown on target page.
|
||||
@ -184,9 +196,11 @@ class mailing_kiwi extends MailingTargets
|
||||
*/
|
||||
function url($id)
|
||||
{
|
||||
// CHANGE THIS: Optionnal
|
||||
|
||||
return '';
|
||||
//$companystatic=new Societe($this->db);
|
||||
//$companystatic->id=$id;
|
||||
//$companystatic->nom='';
|
||||
//return $companystatic->getNomUrl(1); // Url too long
|
||||
return '<a href="'.DOL_URL_ROOT.'/soc.php?socid='.$id.'">'.img_object('',"company").'</a>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ class MailingTargets
|
||||
{
|
||||
$this->db=$DB;
|
||||
}
|
||||
|
||||
|
||||
/** \brief Renvoi un exemple de numérotation
|
||||
* \return string Retourne la traduction de la clé MailingModuleDescXXX ou XXX nom du module, ou $this->desc si non trouvé
|
||||
*/
|
||||
@ -52,7 +52,7 @@ class MailingTargets
|
||||
global $langs;
|
||||
$langs->load("mails");
|
||||
$transstring="MailingModuleDesc".$this->name;
|
||||
if ($langs->trans($transstring) != $transstring) return $langs->trans($transstring);
|
||||
if ($langs->trans($transstring) != $transstring) return $langs->trans($transstring);
|
||||
else return $this->desc;
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ class MailingTargets
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Met a jour nombre de destinataires
|
||||
* \param mailing_id Id du mailing concerné
|
||||
@ -109,7 +109,7 @@ class MailingTargets
|
||||
{
|
||||
$obj=$this->db->fetch_object($result);
|
||||
$nb=$obj->nb;
|
||||
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing";
|
||||
$sql .= " SET nbemail = ".$nb." WHERE rowid = ".$mailing_id;
|
||||
if (!$this->db->query($sql))
|
||||
@ -133,9 +133,9 @@ class MailingTargets
|
||||
*/
|
||||
function add_to_target($mailing_id, $cibles)
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
// Insère destinataires de cibles dans table
|
||||
$this->db->begin();
|
||||
|
||||
// Insert emailing targest from array into database
|
||||
$j = 0;
|
||||
$num = sizeof($cibles);
|
||||
for ($i = 0 ; $i < $num ; $i++)
|
||||
@ -143,12 +143,13 @@ class MailingTargets
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."mailing_cibles";
|
||||
$sql .= " (fk_mailing,";
|
||||
$sql .= " fk_contact,";
|
||||
$sql .= " nom, prenom, email, url)";
|
||||
$sql .= " nom, prenom, email, other, url)";
|
||||
$sql .= " VALUES (".$mailing_id.",";
|
||||
$sql .= (empty($cibles[$i]['fk_contact']) ? '0' : "'".$cibles[$i]['fk_contact']."'") .",";
|
||||
$sql .= "'".addslashes($cibles[$i]['name'])."',";
|
||||
$sql .= "'".addslashes($cibles[$i]['firstname'])."',";
|
||||
$sql .= "'".addslashes($cibles[$i]['email'])."',";
|
||||
$sql .= "'".addslashes($cibles[$i]['other'])."',";
|
||||
$sql .= "'".addslashes($cibles[$i]['url'])."')";
|
||||
|
||||
$result=$this->db->query($sql);
|
||||
|
||||
@ -106,11 +106,11 @@ class mailing_peche extends MailingTargets
|
||||
function add_to_target($mailing_id,$filtersarray=array())
|
||||
{
|
||||
global $conf,$langs,$_FILES;
|
||||
|
||||
|
||||
$cibles = array();
|
||||
|
||||
$upload_dir=$conf->mailings->dir_temp;
|
||||
|
||||
|
||||
// Save file
|
||||
if (! is_dir($upload_dir)) create_exdir($upload_dir);
|
||||
|
||||
@ -120,16 +120,16 @@ class mailing_peche extends MailingTargets
|
||||
if ($result > 0)
|
||||
{
|
||||
$cpt=0;
|
||||
|
||||
|
||||
//$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
|
||||
//print_r($_FILES);
|
||||
$file=$upload_dir . "/" . $_FILES['username']['name'];
|
||||
$handle = @fopen($file, "r");
|
||||
if ($handle)
|
||||
if ($handle)
|
||||
{
|
||||
$i = 0;
|
||||
$j = 0;
|
||||
|
||||
|
||||
$old = '';
|
||||
while (!feof($handle))
|
||||
{
|
||||
@ -139,6 +139,7 @@ class mailing_peche extends MailingTargets
|
||||
$email=$tab[0];
|
||||
$name=$tab[1];
|
||||
$firstname=$tab[2];
|
||||
$other=$tab[3];
|
||||
if (! empty($buffer))
|
||||
{
|
||||
//print 'xx'.strlen($buffer).empty($buffer)."<br>\n";
|
||||
@ -151,13 +152,14 @@ class mailing_peche extends MailingTargets
|
||||
'email' => $email,
|
||||
'name' => $name,
|
||||
'firstname' => $firstname,
|
||||
'other' => $other,
|
||||
'url' => $this->url($id)
|
||||
);
|
||||
$old = $email;
|
||||
$j++;
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$i++;
|
||||
$langs->load("errors");
|
||||
@ -166,8 +168,8 @@ class mailing_peche extends MailingTargets
|
||||
}
|
||||
}
|
||||
fclose($handle);
|
||||
|
||||
if ($i > 0)
|
||||
|
||||
if ($i > 0)
|
||||
{
|
||||
return -$i;
|
||||
}
|
||||
@ -177,7 +179,7 @@ class mailing_peche extends MailingTargets
|
||||
$this->error = $langs->trans("ErrorFaildToOpenFile");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
dolibarr_syslog(get_class($this)."::add_to_target mailing ".$cpt." targets found");
|
||||
}
|
||||
else if ($result < 0)
|
||||
|
||||
@ -36,13 +36,13 @@ include_once DOL_DOCUMENT_ROOT.'/includes/modules/mailings/modules_mailings.php'
|
||||
class mailing_poire extends MailingTargets
|
||||
{
|
||||
var $name='ContactCompanies'; // Identifiant du module mailing
|
||||
var $desc='Contacts des societes'; // Libellé utilisé si aucune traduction pour MailingModuleDescXXX ou XXX=name trouvée
|
||||
var $desc='Contacts des tiers (prospects, clients, fournisseurs...)'; // Libellé utilisé si aucune traduction pour MailingModuleDescXXX ou XXX=name trouvée
|
||||
var $require_module=array("commercial"); // Module mailing actif si modules require_module actifs
|
||||
var $require_admin=0; // Module mailing actif pour user admin ou non
|
||||
var $picto='contact';
|
||||
|
||||
|
||||
var $db;
|
||||
|
||||
|
||||
|
||||
function mailing_poire($DB)
|
||||
{
|
||||
@ -61,8 +61,8 @@ class mailing_poire extends MailingTargets
|
||||
return $statssql;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
/**
|
||||
* \brief Return here number of distinct emails returned by your selector.
|
||||
* For example if this selector is used to extract 500 different
|
||||
* emails from a text file, this function must return 500.
|
||||
@ -78,10 +78,10 @@ class mailing_poire extends MailingTargets
|
||||
|
||||
// La requete doit retourner un champ "nb" pour etre comprise
|
||||
// par parent::getNbOfRecipients
|
||||
return parent::getNbOfRecipients($sql);
|
||||
return parent::getNbOfRecipients($sql);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \brief Affiche formulaire de filtre qui apparait dans page de selection
|
||||
* des destinataires de mailings
|
||||
@ -93,7 +93,7 @@ class mailing_poire extends MailingTargets
|
||||
$langs->load("companies");
|
||||
$langs->load("commercial");
|
||||
$langs->load("suppliers");
|
||||
|
||||
|
||||
$s='';
|
||||
$s.='<select name="filter" class="flat">';
|
||||
$s.='<option value="all">'.$langs->trans("ContactsAllShort").'</option>';
|
||||
@ -123,8 +123,8 @@ class mailing_poire extends MailingTargets
|
||||
$s.='</select>';
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \brief Renvoie url lien vers fiche de la source du destinataire du mailing
|
||||
* \return string Url lien
|
||||
@ -133,8 +133,8 @@ class mailing_poire extends MailingTargets
|
||||
{
|
||||
return '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$id.'">'.img_object('',"contact").'</a>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \brief Ajoute destinataires dans table des cibles
|
||||
* \param mailing_id Id du mailing concerné
|
||||
@ -143,7 +143,9 @@ class mailing_poire extends MailingTargets
|
||||
*/
|
||||
function add_to_target($mailing_id,$filtersarray=array())
|
||||
{
|
||||
$cibles = array();
|
||||
global $langs;
|
||||
|
||||
$cibles = array();
|
||||
|
||||
# List prospects levels
|
||||
$prospectlevel=array();
|
||||
@ -165,12 +167,14 @@ class mailing_poire extends MailingTargets
|
||||
}
|
||||
else dolibarr_print_error($this->db);
|
||||
|
||||
// La requete doit retourner: id, email, fk_contact, name, firstname
|
||||
$sql = "SELECT c.rowid as id, c.email as email, c.rowid as fk_contact, c.name as name, c.firstname as firstname";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= " WHERE s.rowid = c.fk_soc";
|
||||
$sql .= " AND c.email != ''";
|
||||
// La requete doit retourner: id, email, fk_contact, name, firstname, other
|
||||
$sql = "SELECT c.rowid as id, c.email as email, c.rowid as fk_contact,";
|
||||
$sql.= " c.name as name, c.firstname as firstname, c.civilite,";
|
||||
$sql.= " s.nom as companyname";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= " WHERE s.rowid = c.fk_soc";
|
||||
$sql.= " AND c.email != ''";
|
||||
foreach($filtersarray as $key)
|
||||
{
|
||||
if ($key == 'prospects') $sql.= " AND s.client=2";
|
||||
@ -179,7 +183,7 @@ class mailing_poire extends MailingTargets
|
||||
if ($key == 'customers') $sql.= " AND s.client=1";
|
||||
if ($key == 'suppliers') $sql.= " AND s.fournisseur=1";
|
||||
}
|
||||
$sql .= " ORDER BY c.email";
|
||||
$sql.= " ORDER BY c.email";
|
||||
//print "x".$sql;
|
||||
|
||||
// Stocke destinataires dans cibles
|
||||
@ -198,11 +202,15 @@ class mailing_poire extends MailingTargets
|
||||
$obj = $this->db->fetch_object($result);
|
||||
if ($old <> $obj->email)
|
||||
{
|
||||
$cibles[$j] = array(
|
||||
$other='';
|
||||
if ($obj->companyname) { if ($other) $other.=';'; $other.=$langs->transnoentities("ThirdParty").'='.$obj->companyname; }
|
||||
if ($obj->civilite) { if ($other) $other.=';'; $other.=$langs->transnoentities("Civility".$obj->civilite); }
|
||||
$cibles[$j] = array(
|
||||
'email' => $obj->email,
|
||||
'fk_contact' => $obj->fk_contact,
|
||||
'name' => $obj->name,
|
||||
'firstname' => $obj->firstname,
|
||||
'other' => $other,
|
||||
'url' => $this->url($obj->id)
|
||||
);
|
||||
$old = $obj->email;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2005-2009 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
|
||||
@ -62,7 +62,7 @@ class mailing_pomme extends MailingTargets
|
||||
return $statssql;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* \brief Return here number of distinct emails returned by your selector.
|
||||
* For example if this selector is used to extract 500 different
|
||||
@ -77,10 +77,10 @@ class mailing_pomme extends MailingTargets
|
||||
|
||||
// La requete doit retourner un champ "nb" pour etre comprise
|
||||
// par parent::getNbOfRecipients
|
||||
return parent::getNbOfRecipients($sql);
|
||||
return parent::getNbOfRecipients($sql);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \brief Renvoie url lien vers fiche de la source du destinataire du mailing
|
||||
* \return string Url lien
|
||||
@ -90,7 +90,7 @@ class mailing_pomme extends MailingTargets
|
||||
return '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$id.'">'.img_object('',"user").'</a>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \brief Ajoute destinataires dans table des cibles
|
||||
* \param mailing_id Id du mailing concerné
|
||||
@ -99,13 +99,16 @@ class mailing_pomme extends MailingTargets
|
||||
*/
|
||||
function add_to_target($mailing_id,$filtersarray=array())
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$cibles = array();
|
||||
|
||||
// La requete doit retourner: id, email, fk_contact, name, firstname
|
||||
$sql = "SELECT u.rowid as id, u.email as email, null as fk_contact, u.name as name, u.firstname as firstname";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql .= " WHERE u.email != ''"; // u.email IS NOT NULL est implicite dans ce test
|
||||
$sql .= " ORDER BY u.email";
|
||||
$sql = "SELECT u.rowid as id, u.email as email, null as fk_contact,";
|
||||
$sql.= " u.name as name, u.firstname as firstname, u.login, u.office_phone";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " WHERE u.email != ''"; // u.email IS NOT NULL est implicite dans ce test
|
||||
$sql.= " ORDER BY u.email";
|
||||
|
||||
// Stocke destinataires dans cibles
|
||||
$result=$this->db->query($sql);
|
||||
@ -128,6 +131,7 @@ class mailing_pomme extends MailingTargets
|
||||
'fk_contact' => $obj->fk_contact,
|
||||
'name' => $obj->name,
|
||||
'firstname' => $obj->firstname,
|
||||
'other' => $langs->transnoentities("Login").'='.$obj->login.';'.$langs->transnoentities("PhonePro").'='.$obj->office_phone,
|
||||
'url' => $this->url($obj->id)
|
||||
);
|
||||
$old = $obj->email;
|
||||
|
||||
@ -162,7 +162,7 @@ if (is_readable($conffile) && filesize($conffile) > 8)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Si non on le crée
|
||||
// Si non on le crée
|
||||
dolibarr_install_syslog("check: we try to creat conf file '$conffile'");
|
||||
$confexists=0;
|
||||
|
||||
@ -250,7 +250,7 @@ else
|
||||
print $langs->trans("ChooseYourSetupMode");
|
||||
|
||||
print '<table width="100%" cellspacing="1" cellpadding="4" border="1">';
|
||||
|
||||
|
||||
print '<tr><td nowrap="nowrap"><b>'.$langs->trans("FreshInstall").'</b></td><td>';
|
||||
print $langs->trans("FreshInstallDesc").'</td>';
|
||||
print '<td align="center">';
|
||||
@ -269,7 +269,7 @@ else
|
||||
array('from'=>'2.1.0', 'to'=>'2.2.0'),
|
||||
array('from'=>'2.2.0', 'to'=>'2.4.0'),
|
||||
array('from'=>'2.4.0', 'to'=>'2.5.0'),
|
||||
//array('from'=>'2.5.0', 'to'=>'2.6.0')
|
||||
array('from'=>'2.5.0', 'to'=>'2.6.0')
|
||||
);
|
||||
# Upgrade lines
|
||||
foreach ($migrationscript as $migarray)
|
||||
|
||||
@ -63,8 +63,8 @@ NoAttachedFiles=No attached files
|
||||
MailingModuleDescContactCompanies=Contacts of all third parties (customer, prospect, supplier, ...)
|
||||
MailingModuleDescDolibarrUsers=All Dolibarr users with emails
|
||||
MailingModuleDescFundationMembers=Fundation members with emails
|
||||
MailingModuleDescEmailsFromFile=EMails from a text file (email;name;surname)
|
||||
MailingModuleDescContactsCategories=Contacts of all third parties (by category)
|
||||
MailingModuleDescEmailsFromFile=EMails from a text file (email;name;surname;comments)
|
||||
MailingModuleDescContactsCategories=Third parties with emails (by category)
|
||||
|
||||
LineInFile=Line %s in file
|
||||
RecipientSelectionModules=Defined requests for recipients' selection
|
||||
|
||||
@ -304,6 +304,7 @@ and=and
|
||||
or=or
|
||||
Other=Other
|
||||
Others=Others
|
||||
OtherInformations=Other informations
|
||||
Quantity=Quantity
|
||||
Qty=Qty
|
||||
ChangedBy=Changed by
|
||||
|
||||
@ -63,8 +63,8 @@ NoAttachedFiles=Aucun fichier joint
|
||||
MailingModuleDescContactCompanies=Contacts des tiers (prospects, clients, fournisseurs...)
|
||||
MailingModuleDescDolibarrUsers=Utilisateurs de Dolibarr avec e-mail
|
||||
MailingModuleDescFundationMembers=Adhérents avec e-mail
|
||||
MailingModuleDescEmailsFromFile=EMails issus d'un fichier texte (email;nom;prenom)
|
||||
MailingModuleDescContactsCategories=Contacts des tiers (par categorie)
|
||||
MailingModuleDescEmailsFromFile=EMails issus d'un fichier texte (email;nom;prenom;divers)
|
||||
MailingModuleDescContactsCategories=Tiers avec e-mail (par categorie)
|
||||
|
||||
LineInFile=Ligne %s du fichier
|
||||
RecipientSelectionModules=Modules de sélection des destinataires
|
||||
|
||||
@ -305,6 +305,7 @@ and=et
|
||||
or=ou
|
||||
Other=Autre
|
||||
Others=Autres
|
||||
OtherInformations=Autres informations
|
||||
Quantity=Quantité
|
||||
Qty=Qté
|
||||
ChangedBy=Modifié par
|
||||
|
||||
@ -30,5 +30,7 @@ ALTER TABLE llx_bank ADD INDEX idx_bank_fk_account(fk_account);
|
||||
ALTER TABLE llx_bank ADD INDEX idx_bank_rappro(rappro);
|
||||
|
||||
|
||||
ALTER TABLE llx_mailing_cibles add column other varchar(255) NULL,
|
||||
ALTER TABLE llx_mailing_cibles add column other varchar(255) NULL;
|
||||
|
||||
ALTER TABLE llx_mailing_cibles ADD INDEX idx_mailing_cibles_email (email);
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
-- ===================================================================
|
||||
-- Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
-- Copyright (C) 2005-2009 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
|
||||
@ -20,3 +20,6 @@
|
||||
|
||||
|
||||
ALTER TABLE llx_mailing_cibles ADD UNIQUE uk_mailing_cibles (fk_mailing, email);
|
||||
|
||||
ALTER TABLE llx_mailing_cibles ADD INDEX idx_mailing_cibles_email (email);
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
-- ========================================================================
|
||||
-- Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
-- Copyright (C) 2009 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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user