Fix phpcs

This commit is contained in:
Laurent Destailleur 2022-04-29 19:31:05 +02:00
parent 316ef3371d
commit 89d8fdde8d
2 changed files with 8 additions and 9 deletions

View File

@ -390,7 +390,7 @@ class mailing_contacts1 extends MailingTargets
// Exclude unsubscribed email adresses
$sql .= " AND sp.statut = 1";
$sql .= " AND sp.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".((int) $mailing_id).")";
// Filter on category
if ($filter_category != 'all' && $filter_category != '-1') {
$sql .= " AND cs.fk_categorie = c.rowid AND cs.fk_socpeople = sp.rowid";
@ -404,12 +404,12 @@ class mailing_contacts1 extends MailingTargets
$sql .= " AND c3s.fk_categorie = c3.rowid AND c3s.fk_soc = sp.fk_soc";
$sql .= " AND c3.label = '".$this->db->escape($filter_category_supplier)."'";
}
// Filter on language
if ($filter_lang != '') {
$sql .= " AND sp.default_lang = '".$this->db->escape($filter_lang)."'";
}
// Filter on nature
$key = $filter;

View File

@ -79,9 +79,8 @@ class mailing_thirdparties extends MailingTargets
$sql .= " AND s.entity IN (".getEntity('societe').")";
$sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".((int) $mailing_id).")";
if (GETPOST('default_lang', 'alpha')) {
$sql .= " AND s.default_lang LIKE '".$this->db->escape(GETPOST('default_lang', 'alpha'))."%'";
$sql .= " AND s.default_lang LIKE '".$this->db->escape(GETPOST('default_lang', 'alpha'))."%'";
}
} else {
$addFilter = "";
if (GETPOSTISSET("filter_client") && GETPOST("filter_client") <> '-1') {
@ -112,11 +111,11 @@ class mailing_thirdparties extends MailingTargets
$addDescription .= $langs->trans("Disabled");
}
}
if (GETPOST('default_lang', 'alpha')) {
if (GETPOST('default_lang', 'alpha')) {
$addFilter .= " AND s.default_lang LIKE '".$this->db->escape(GETPOST('default_lang', 'alpha'))."%'";
$addDescription = $langs->trans('DefaultLang')."=";
}
$sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname, c.label as label";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."categorie_societe as cs, ".MAIN_DB_PREFIX."categorie as c";
$sql .= " WHERE s.email <> ''";
@ -311,13 +310,13 @@ class mailing_thirdparties extends MailingTargets
$s .= '<option value="0">'.$langs->trans("Disabled").'</option>';
$s .= '</select>';
$s .= ajax_combobox("filter_status_thirdparties");
// 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;
}