diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index bd4300ea71d..1450fe75b8c 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -311,6 +311,13 @@ class mailing_contacts1 extends MailingTargets else dol_print_error($this->db); $s .= ''; + + //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);