[-] BO: fix the checkbox of shop activation on modules configuration
This commit is contained in:
@@ -1576,6 +1576,18 @@ abstract class ModuleCore
|
|||||||
return Cache::retrieve('Module::isInstalled'.$module_name);
|
return Cache::retrieve('Module::isInstalled'.$module_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isEnabledForShopContext()
|
||||||
|
{
|
||||||
|
$shop_list = Shop::getContextListShopID();
|
||||||
|
return (bool)Db::getInstance()->getValue('
|
||||||
|
SELECT COUNT(*) n
|
||||||
|
FROM `'._DB_PREFIX_.'module_shop`
|
||||||
|
WHERE id_module='.(int)$this->id.' AND id_shop IN ('.implode(',', array_map('intval', Shop::getContextListShopID())).')
|
||||||
|
GROUP BY id_module
|
||||||
|
HAVING n='.(int)count(Shop::getContextListShopID())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public static function isEnabled($module_name)
|
public static function isEnabled($module_name)
|
||||||
{
|
{
|
||||||
if (!Cache::isStored('Module::isEnabled'.$module_name))
|
if (!Cache::isStored('Module::isEnabled'.$module_name))
|
||||||
|
|||||||
@@ -799,7 +799,7 @@ class ShopCore extends ObjectModel
|
|||||||
{
|
{
|
||||||
if (Shop::getContext() == Shop::CONTEXT_SHOP)
|
if (Shop::getContext() == Shop::CONTEXT_SHOP)
|
||||||
$list = ($share) ? Shop::getSharedShops(Shop::getContextShopID(), $share) : array(Shop::getContextShopID());
|
$list = ($share) ? Shop::getSharedShops(Shop::getContextShopID(), $share) : array(Shop::getContextShopID());
|
||||||
else if (Shop::getContext() == Shop::CONTEXT_GROUP)
|
elseif (Shop::getContext() == Shop::CONTEXT_GROUP)
|
||||||
$list = Shop::getShops(true, Shop::getContextShopGroupID(), true);
|
$list = Shop::getShops(true, Shop::getContextShopGroupID(), true);
|
||||||
else
|
else
|
||||||
$list = Shop::getShops(true, null, true);
|
$list = Shop::getShops(true, null, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user