2005-03-15 09:51:03 +01:00
|
|
|
|
<?php
|
|
|
|
|
|
/* Copyright (C) 2005 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
|
|
|
|
|
|
* 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.
|
|
|
|
|
|
* or see http://www.gnu.org/
|
|
|
|
|
|
*
|
|
|
|
|
|
* $Id$
|
|
|
|
|
|
* $Source$
|
|
|
|
|
|
*
|
|
|
|
|
|
*
|
|
|
|
|
|
* 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>.
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
\file htdocs/includes/modules/mailings/fraise.modules.php
|
|
|
|
|
|
\ingroup mailing
|
|
|
|
|
|
\brief Fichier de la classe permettant de g<EFBFBD>n<EFBFBD>rer la liste de destinataires Fraise
|
|
|
|
|
|
\version $Revision$
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
include_once DOL_DOCUMENT_ROOT.'/includes/modules/mailings/modules_mailings.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
\class mailing_fraise
|
|
|
|
|
|
\brief Classe permettant de g<EFBFBD>n<EFBFBD>rer la liste des destinataires Fraise
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
class mailing_fraise extends MailingTargets
|
|
|
|
|
|
{
|
|
|
|
|
|
var $name='MembersValidated'; // Identifiant du module mailing
|
|
|
|
|
|
var $desc='Tous les membres <20> jour'; // Libell<6C> utilis<69> si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv<75>e
|
|
|
|
|
|
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;
|
|
|
|
|
|
var $statssql=array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function mailing_fraise($DB)
|
|
|
|
|
|
{
|
|
|
|
|
|
global $langs;
|
|
|
|
|
|
$langs->load("members");
|
|
|
|
|
|
|
|
|
|
|
|
$this->db=$DB;
|
|
|
|
|
|
|
|
|
|
|
|
// Liste des tableaux des stats espace mailing
|
2005-04-07 01:23:48 +02:00
|
|
|
|
$this->statssql[0]="SELECT '".$langs->trans("MembersStatusValidated")."' as label, count(*) as nb FROM ".MAIN_DB_PREFIX."adherent where statut = 1";
|
2005-03-15 09:51:03 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getNbOfRecipients()
|
|
|
|
|
|
{
|
|
|
|
|
|
// La requete doit retourner: nb
|
2005-04-07 01:23:48 +02:00
|
|
|
|
$sql = "SELECT count(distinct(a.email)) as nb";
|
2005-03-15 09:51:03 +01:00
|
|
|
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
|
|
|
|
|
$sql .= " WHERE a.email IS NOT NULL and statut=1";
|
|
|
|
|
|
|
|
|
|
|
|
return parent::getNbOfRecipients($sql);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function add_to_target($mailing_id)
|
|
|
|
|
|
{
|
|
|
|
|
|
// La requete doit retourner: email, fk_contact, name, firstname
|
2005-04-07 01:23:48 +02:00
|
|
|
|
$sql = "SELECT a.email as email, null as fk_contact, a.nom as name, a.prenom as firstname";
|
2005-03-15 09:51:03 +01:00
|
|
|
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
|
|
|
|
|
$sql .= " WHERE a.email IS NOT NULL AND a.statut=1";
|
|
|
|
|
|
$sql .= " ORDER BY a.email";
|
|
|
|
|
|
|
|
|
|
|
|
return parent::add_to_target($mailing_id, $sql);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
?>
|