Remove deprecated parameter
This commit is contained in:
parent
434cf2e046
commit
5ec9a1ca7f
@ -72,7 +72,7 @@ $object = new Mailing($db);
|
||||
|
||||
if ($action == 'add')
|
||||
{
|
||||
$module=GETPOST("module");
|
||||
$module=GETPOST("module",'alpha');
|
||||
$result=-1;
|
||||
|
||||
foreach ($modulesdir as $dir)
|
||||
@ -89,14 +89,10 @@ if ($action == 'add')
|
||||
{
|
||||
require_once $file;
|
||||
|
||||
// We fill $filtersarray. Using this variable is now deprecated. Kept for backward compatibility.
|
||||
$filtersarray=array();
|
||||
if (isset($_POST["filter"])) $filtersarray[0]=$_POST["filter"];
|
||||
|
||||
// Add targets into database
|
||||
$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);
|
||||
}
|
||||
}
|
||||
if ($result > 0)
|
||||
|
||||
@ -331,10 +331,9 @@ class mailing_contacts1 extends MailingTargets
|
||||
* Ajoute destinataires dans table des cibles
|
||||
*
|
||||
* @param int $mailing_id Id of emailing
|
||||
* @param array $filtersarray Optional filter data (deprecated)
|
||||
* @return int <0 si erreur, nb ajout si ok
|
||||
*/
|
||||
function add_to_target($mailing_id,$filtersarray=array())
|
||||
function add_to_target($mailing_id)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
@ -61,10 +61,9 @@ class mailing_example extends MailingTargets
|
||||
* 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())
|
||||
function add_to_target($mailing_id)
|
||||
{
|
||||
// phpcs:enable
|
||||
$target = array();
|
||||
|
||||
@ -225,17 +225,11 @@ class mailing_fraise extends MailingTargets
|
||||
* Ajoute destinataires dans table des cibles
|
||||
*
|
||||
* @param int $mailing_id Id of emailing
|
||||
* @param array $filtersarray Param to filter sql request. Deprecated. Should use $_POST instead.
|
||||
* @return int < 0 si erreur, nb ajout si ok
|
||||
*/
|
||||
function add_to_target($mailing_id,$filtersarray=array())
|
||||
function add_to_target($mailing_id)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Deprecation warning
|
||||
if ($filtersarray) {
|
||||
dol_syslog(__METHOD__ . ": filtersarray parameter is deprecated", LOG_WARNING);
|
||||
}
|
||||
|
||||
global $langs,$_POST;
|
||||
|
||||
// Load translation files required by the page
|
||||
|
||||
@ -151,17 +151,11 @@ class mailing_pomme extends MailingTargets
|
||||
* Ajoute destinataires dans table des cibles
|
||||
*
|
||||
* @param int $mailing_id Id of emailing
|
||||
* @param array $filtersarray Requete sql de selection des destinataires
|
||||
* @return int < 0 si erreur, nb ajout si ok
|
||||
*/
|
||||
function add_to_target($mailing_id, $filtersarray=array())
|
||||
function add_to_target($mailing_id)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Deprecation warning
|
||||
if ($filtersarray) {
|
||||
dol_syslog(__METHOD__ . ": filtersarray parameter is deprecated", LOG_WARNING);
|
||||
}
|
||||
|
||||
global $conf, $langs;
|
||||
$langs->load("companies");
|
||||
|
||||
|
||||
@ -57,10 +57,9 @@ class mailing_thirdparties extends MailingTargets
|
||||
* 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())
|
||||
function add_to_target($mailing_id)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
@ -82,26 +82,26 @@ class mailing_thirdparties_services_expired extends MailingTargets
|
||||
* 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())
|
||||
function add_to_target($mailing_id)
|
||||
{
|
||||
// phpcs:enable
|
||||
$target = array();
|
||||
|
||||
// ----- Your code start here -----
|
||||
$key=GETPOST('filter','int');
|
||||
|
||||
$cibles = array();
|
||||
$j = 0;
|
||||
|
||||
$product='';
|
||||
foreach($filtersarray as $key)
|
||||
if ($key == '0')
|
||||
{
|
||||
if ($key == '0') return "Error: You must choose a filter";
|
||||
$product=$this->arrayofproducts[$key];
|
||||
$this->error = "Error: You must choose a filter";
|
||||
$this->errors[] = $this->error;
|
||||
return $this->error;
|
||||
}
|
||||
|
||||
$product=$this->arrayofproducts[$key];
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
// La requete doit retourner: id, email, name
|
||||
|
||||
@ -115,10 +115,9 @@ class mailing_xinputfile extends MailingTargets
|
||||
* Ajoute destinataires dans table des cibles
|
||||
*
|
||||
* @param int $mailing_id Id of emailing
|
||||
* @param array $filtersarray Requete sql de selection des destinataires
|
||||
* @return int < 0 si erreur, nb ajout si ok
|
||||
*/
|
||||
function add_to_target($mailing_id,$filtersarray=array())
|
||||
function add_to_target($mailing_id)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs,$_FILES;
|
||||
|
||||
@ -113,10 +113,9 @@ class mailing_xinputuser extends MailingTargets
|
||||
* Ajoute destinataires dans table des cibles
|
||||
*
|
||||
* @param int $mailing_id Id of emailing
|
||||
* @param array $filtersarray Requete sql de selection des destinataires
|
||||
* @return int < 0 si erreur, nb ajout si ok
|
||||
*/
|
||||
function add_to_target($mailing_id,$filtersarray=array())
|
||||
function add_to_target($mailing_id)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs,$_FILES;
|
||||
|
||||
@ -97,14 +97,12 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
|
||||
* This is the main function that returns the array of emails
|
||||
*
|
||||
* @param int $mailing_id Id of emailing
|
||||
* @param array $filtersarray Requete sql de selection des destinataires
|
||||
* @return int <0 if error, number of emails added if ok
|
||||
*/
|
||||
function add_to_target($mailing_id,$filtersarray=array())
|
||||
function add_to_target($mailing_id)
|
||||
{
|
||||
// phpcs:enable
|
||||
$target = array();
|
||||
$cibles = array();
|
||||
$j = 0;
|
||||
|
||||
|
||||
@ -114,7 +112,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
|
||||
if (! empty($_POST['filter']) && $_POST['filter'] != 'none') $sql.= " AND status = '".$this->db->escape($_POST['filter'])."'";
|
||||
$sql.= " ORDER BY email";
|
||||
|
||||
// Stocke destinataires dans cibles
|
||||
// Stocke destinataires dans target
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
@ -129,7 +127,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
|
||||
$obj = $this->db->fetch_object($result);
|
||||
if ($old <> $obj->email)
|
||||
{
|
||||
$cibles[$j] = array(
|
||||
$target[$j] = array(
|
||||
'email' => $obj->email,
|
||||
'name' => $obj->lastname,
|
||||
'id' => $obj->id,
|
||||
@ -162,7 +160,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets
|
||||
|
||||
// ----- Your code end here -----
|
||||
|
||||
return parent::add_to_target($mailing_id, $cibles);
|
||||
return parent::add_to_target($mailing_id, $target);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user