Skip to content
Snippets Groups Projects
Commit 7a00c793 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: SQL syntax error

parent aadfca4b
No related branches found
No related tags found
No related merge requests found
......@@ -49,10 +49,11 @@ class mailing_framboise extends MailingTargets
/**
* \brief This is the main function that returns the array of emails
* \param mailing_id Id of mailing. No need to use it.
* \param filterarray If you used the formFilter function. Empty otherwise.
* \return int <0 if error, number of emails added if ok
* This is the main function that returns the array of emails.
*
* @param int $mailing_id Id of mailing. No need to use it.
* @param array $filtersarray If you used the formFilter function. Empty otherwise.
* @return int <0 if error, number of emails added if ok
*/
function add_to_target($mailing_id,$filtersarray=array())
{
......@@ -73,7 +74,7 @@ class mailing_framboise extends MailingTargets
}
$sql.= " WHERE s.email != ''";
$sql.= " AND s.entity = ".$conf->entity;
if ($_POST['filter']) $sql.= " AND ".MAIN_DB_PREFIX."categorie.rowid='".$_POST['filter']."'";
if ($_POST['filter']) $sql.= " AND c.rowid='".$_POST['filter']."'";
$sql.= " ORDER BY s.email";
// Stocke destinataires dans cibles
......@@ -138,11 +139,12 @@ class mailing_framboise extends MailingTargets
}
/*
* \brief Return here number of distinct emails returned by your selector.
/**
* 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.
* \return int
*
* @return int Nb of recipients
*/
function getNbOfRecipients()
{
......@@ -159,9 +161,10 @@ class mailing_framboise extends MailingTargets
}
/**
* \brief This is to add a form filter to provide variant of selector
* This is to add a form filter to provide variant of selector
* If used, the HTML select must be called "filter"
* \return string A html select zone
*
* @return string A html select zone
*/
function formFilter()
{
......@@ -212,9 +215,10 @@ class mailing_framboise extends MailingTargets
/**
* \brief Can include an URL link on each record provided by selector
* shown on target page.
* \return string Url link
* Can include an URL link on each record provided by selector shown on target page.
*
* @param int $id Id of member
* @return string Url link
*/
function url($id)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment