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

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16132 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
vChabot
2012-06-26 09:59:14 +00:00
parent f0d03142f3
commit 23743b6561
+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);
}