Fix usage of filter into selection of email members into emailing.

This commit is contained in:
Laurent Destailleur 2016-02-10 23:48:18 +01:00
parent 6dbaba6973
commit e169cd3364
2 changed files with 3 additions and 2 deletions

View File

@ -95,6 +95,7 @@ if ($action == 'add')
// Add targets into database // Add targets into database
$obj = new $classname($db); $obj = new $classname($db);
dol_syslog("Call add_to_target on class ".$classname);
$result=$obj->add_to_target($id,$filtersarray); $result=$obj->add_to_target($id,$filtersarray);
} }
} }

View File

@ -123,7 +123,7 @@ class mailing_fraise extends MailingTargets
$s.='<option value="0">'.$langs->trans("MemberStatusResiliatedShort").'</option>'; $s.='<option value="0">'.$langs->trans("MemberStatusResiliatedShort").'</option>';
$s.='</select> '; $s.='</select> ';
$s.=$langs->trans("Type").': '; $s.=$langs->trans("Type").': ';
$s.='<select name="filter" class="flat">'; $s.='<select name="filtertype" class="flat">';
$sql = "SELECT rowid, libelle, statut"; $sql = "SELECT rowid, libelle, statut";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type";
$sql.= " WHERE entity = ".$conf->entity; $sql.= " WHERE entity = ".$conf->entity;
@ -212,7 +212,7 @@ class mailing_fraise extends MailingTargets
if ($dateendsubscriptionafter > 0) $sql.=" AND datefin > '".$this->db->idate($dateendsubscriptionafter)."'"; if ($dateendsubscriptionafter > 0) $sql.=" AND datefin > '".$this->db->idate($dateendsubscriptionafter)."'";
if ($dateendsubscriptionbefore > 0) $sql.=" AND datefin < '".$this->db->idate($dateendsubscriptionbefore)."'"; if ($dateendsubscriptionbefore > 0) $sql.=" AND datefin < '".$this->db->idate($dateendsubscriptionbefore)."'";
$sql.= " AND a.fk_adherent_type = ta.rowid"; $sql.= " AND a.fk_adherent_type = ta.rowid";
if ($_POST['filter']) $sql.= " AND ta.rowid='".$_POST['filter']."'"; if ($_POST['filtertype']) $sql.= " AND ta.rowid='".$_POST['filtertype']."'";
$sql.= " ORDER BY a.email"; $sql.= " ORDER BY a.email";
//print $sql; //print $sql;