Fix: Clean of filter of emailing targets was not working

This commit is contained in:
Laurent Destailleur 2008-04-04 11:31:52 +00:00
parent a9aa26f8ff
commit d08a56f5b3
2 changed files with 17 additions and 14 deletions

View File

@ -1,6 +1,6 @@
<?PHP <?PHP
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* 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 * 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 * it under the terms of the GNU General Public License as published by
@ -119,6 +119,12 @@ if ($_GET["action"] == 'delete')
} }
} }
if ($_POST["button_removefilter"])
{
$search_nom='';
$search_prenom='';
$search_email='';
}
/* /*
* Liste des destinataires * Liste des destinataires

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -17,16 +17,13 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* or see http://www.gnu.org/ * or see http://www.gnu.org/
*
* $Id$
* $Source$
*/ */
/** /**
\file htdocs/includes/modules/mailings/modules_mailings.php \file htdocs/includes/modules/mailings/modules_mailings.php
\ingroup mailing \ingroup mailing
\brief Fichier contenant la classe mère des classes de liste de destinataires mailing \brief Fichier contenant la classe mère des classes de liste de destinataires mailing
\version $Revision$ \version $Id$
*/ */
require_once(DOL_DOCUMENT_ROOT.'/lib/functions.inc.php'); require_once(DOL_DOCUMENT_ROOT.'/lib/functions.inc.php');
@ -144,15 +141,15 @@ class MailingTargets
for ($i = 0 ; $i < $num ; $i++) for ($i = 0 ; $i < $num ; $i++)
{ {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."mailing_cibles"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."mailing_cibles";
$sql .= " (fk_mailing, "; $sql .= " (fk_mailing,";
if ($cibles[$i]['fk_contact']) $sql .= "fk_contact, "; $sql .= " fk_contact,";
$sql .= "nom, prenom, email, url)"; $sql .= " nom, prenom, email, url)";
$sql .= " VALUES (".$mailing_id.","; $sql .= " VALUES (".$mailing_id.",";
if ($cibles[$i]['fk_contact']) $sql .= $cibles[$i]['fk_contact'] .","; $sql .= (empty($cibles[$i]['fk_contact']) ? '0' : "'".$cibles[$i]['fk_contact']."'") .",";
$sql .= "'".addslashes($cibles[$i]['name'])."',"; $sql .= "'".addslashes($cibles[$i]['name'])."',";
$sql .= "'".addslashes($cibles[$i]['firstname'])."',"; $sql .= "'".addslashes($cibles[$i]['firstname'])."',";
$sql .= "'".addslashes($cibles[$i]['email'])."',"; $sql .= "'".addslashes($cibles[$i]['email'])."',";
$sql .= "'".addslashes($cibles[$i]['url'])."')"; $sql .= "'".addslashes($cibles[$i]['url'])."')";
$result=$this->db->query($sql); $result=$this->db->query($sql);
if ($result) if ($result)