2
0
forked from Wavyzz/dolibarr

fix #20690: add lang filter for people

This commit is contained in:
Eric Seigne
2022-04-22 14:49:22 +02:00
parent 694357d48e
commit d2ec1efb42

View File

@@ -311,6 +311,13 @@ class mailing_contacts1 extends MailingTargets
else dol_print_error($this->db);
$s .= '</select>';
//Choose language
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin = new FormAdmin($this->db);
$s .= $langs->trans("DefaultLang").': ';
$s .= $formadmin->select_language($langs->getDefaultLang(1), 'filter_lang', 0, 0, 1, 0, 0, '', 0, 0, 0, null, 1);
return $s;
}
@@ -344,6 +351,7 @@ class mailing_contacts1 extends MailingTargets
$filter_category = GETPOST('filter_category', 'alpha');
$filter_category_customer = GETPOST('filter_category_customer', 'alpha');
$filter_category_supplier = GETPOST('filter_category_supplier', 'alpha');
$filter_lang = GETPOST('filter_lang', 'alpha');
$cibles = array();
@@ -391,6 +399,7 @@ class mailing_contacts1 extends MailingTargets
if ($filter_category_customer <> 'all') $sql .= " AND c2.label = '".$this->db->escape($filter_category_customer)."'";
if ($filter_category_supplier <> 'all') $sql .= " AND c3s.fk_categorie = c3.rowid AND c3s.fk_soc = sp.fk_soc";
if ($filter_category_supplier <> 'all') $sql .= " AND c3.label = '".$this->db->escape($filter_category_supplier)."'";
if ($filter_lang <> '') $sql .= " AND sp.default_lang = '".$this->db->escape($filter_lang)."'";
// Filter on nature
$key = $filter;
{
@@ -404,7 +413,7 @@ class mailing_contacts1 extends MailingTargets
$key = $filter_jobposition;
if (!empty($key) && $key != 'all') $sql .= " AND sp.poste ='".$this->db->escape($key)."'";
$sql .= " ORDER BY sp.email";
//print "wwwwwwx".$sql;
// print "wwwwwwx".$sql;
// Stocke destinataires dans cibles
$result = $this->db->query($sql);