2
0
forked from Wavyzz/dolibarr

Merge pull request #21942 from ptibogxiv/patch-43

NEW manage no email with thirdparties (better for GDPR)
This commit is contained in:
Laurent Destailleur
2022-09-07 14:24:52 +02:00
committed by GitHub
4 changed files with 254 additions and 5 deletions

View File

@@ -226,7 +226,7 @@ class mailing_thirdparties extends MailingTargets
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE s.email <> ''";
$sql .= " AND s.entity IN (".getEntity('societe').")";
$sql .= " AND NOT EXISTS (SELECT rowid FROM ".MAIN_DB_PREFIX."mailing_unsubscribe as mu WHERE mu.email = s.email and mu.entity = ".((int) $conf->entity).")";
// La requete doit retourner un champ "nb" pour etre comprise par parent::getNbOfRecipients
return parent::getNbOfRecipients($sql);
}
@@ -316,11 +316,13 @@ class mailing_thirdparties extends MailingTargets
$s .= '</select>';
$s .= ajax_combobox("filter_status_thirdparties");
if (!empty($conf->global->MAIN_MULTILANGS)) {
// Choose language
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($this->db);
$s .= '<span class="opacitymedium">'.$langs->trans("DefaultLang").':</span> ';
$s .= $formadmin->select_language($langs->getDefaultLang(1), 'filter_lang_thirdparties', 0, null, 1, 0, 0, '', 0, 0, 0, null, 1);
}
return $s;
}