[-] FO : BugFix : #PSCFV-2896 : Every contacts from contact page are displayed, without shop restriction

This commit is contained in:
vChabot
2012-06-26 09:59:14 +00:00
parent efc81e2154
commit c1be0bca61
+3
View File
@@ -66,12 +66,15 @@ class ContactCore extends ObjectModel
*/
public static function getContacts($id_lang)
{
$shop_ids = Shop::getContextListShopID();
$sql = 'SELECT *
FROM `'._DB_PREFIX_.'contact` c
'.Shop::addSqlAssociation('contact', 'c', false).'
LEFT JOIN `'._DB_PREFIX_.'contact_lang` cl ON (c.`id_contact` = cl.`id_contact`)
WHERE cl.`id_lang` = '.(int)$id_lang.'
AND contact_shop.`id_shop` IN ('.implode(', ', array_map('intval', $shop_ids)).')
ORDER BY `name` ASC';
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
}