2005-01-04 17:24:44 +01:00
|
|
|
|
<?PHP
|
|
|
|
|
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
|
|
|
|
*
|
|
|
|
|
|
* 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
|
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
|
*
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
*
|
|
|
|
|
|
* 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$
|
|
|
|
|
|
*
|
|
|
|
|
|
*
|
|
|
|
|
|
* Export simple des contacts
|
|
|
|
|
|
*
|
|
|
|
|
|
* L'utilisation d'adresses de courriers <EFBFBD>lectroniques dans les op<EFBFBD>rations
|
|
|
|
|
|
* de prospection commerciale est subordonn<EFBFBD>e au recueil du consentement
|
|
|
|
|
|
* pr<EFBFBD>alable des personnes concern<EFBFBD>es.
|
|
|
|
|
|
*
|
|
|
|
|
|
* Le dispositif juridique applicable a <EFBFBD>t<EFBFBD> introduit par l'article 22 de
|
|
|
|
|
|
* la loi du 21 juin 2004 pour la confiance dans l'<EFBFBD>conomie num<EFBFBD>rique.
|
|
|
|
|
|
*
|
|
|
|
|
|
* Les dispositions applicables sont d<EFBFBD>finies par les articles L. 34-5 du
|
|
|
|
|
|
* code des postes et des t<EFBFBD>l<EFBFBD>communications et L. 121-20-5 du code de la
|
|
|
|
|
|
* consommation. L'application du principe du consentement pr<EFBFBD>alable en
|
|
|
|
|
|
* droit fran<EFBFBD>ais r<EFBFBD>sulte de la transposition de l'article 13 de la Directive
|
|
|
|
|
|
* europ<EFBFBD>enne du 12 juillet 2002 <EFBFBD> Vie priv<EFBFBD>e et communications <EFBFBD>lectroniques <EFBFBD>.
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
require ("../htdocs/master.inc.php");
|
|
|
|
|
|
|
|
|
|
|
|
$error = 0;
|
|
|
|
|
|
|
|
|
|
|
|
$sql = "SELECT m.rowid, m.cible";
|
|
|
|
|
|
$sql .= " FROM ".MAIN_DB_PREFIX."mailing as m";
|
|
|
|
|
|
$sql .= " WHERE m.statut in (0,1)";
|
|
|
|
|
|
|
|
|
|
|
|
if ( $db->query($sql) )
|
|
|
|
|
|
{
|
|
|
|
|
|
$num = $db->num_rows();
|
|
|
|
|
|
$i = 0;
|
|
|
|
|
|
|
|
|
|
|
|
while ($i < $num)
|
|
|
|
|
|
{
|
|
|
|
|
|
$row = $db->fetch_row();
|
|
|
|
|
|
|
|
|
|
|
|
dolibarr_syslog("mailing-prepare: mailing $row[0]");
|
|
|
|
|
|
dolibarr_syslog("mailing-prepare: mailing module $row[1]");
|
|
|
|
|
|
|
2005-02-12 00:41:42 +01:00
|
|
|
|
require DOL_DOCUMENT_ROOT.'/includes/modules/mailings/'.$row[1].'.modules.php';
|
2005-01-04 17:24:44 +01:00
|
|
|
|
|
|
|
|
|
|
$classname = "mailing_".$row[1];
|
|
|
|
|
|
|
2005-02-12 00:41:42 +01:00
|
|
|
|
$obj = new $classname($db);
|
|
|
|
|
|
$obj->add_to_target($row[0]);
|
2005-01-04 17:24:44 +01:00
|
|
|
|
|
|
|
|
|
|
$i++;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
?>
|