// Improve multishop API

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13566 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2012-02-23 15:39:44 +00:00
parent ec8f05c3ca
commit b24dcffc9c
71 changed files with 377 additions and 425 deletions
+7 -7
View File
@@ -254,10 +254,10 @@ class EmployeeCore extends ObjectModel
{
$context = Context::getContext();
switch ($type = $context->shop->getContextType())
switch (Shop::getContext())
{
case 1:
if ($context->shop->checkIfShopExist($context->shop->id))
case Shop::CONTEXT_SHOP:
if ($context->shop->checkIfShopExist(Shop::getContextShopID()))
{
if (!in_array($context->shop->id, Employee::getEmployeeShopById($id_employee)))
return false;
@@ -266,10 +266,10 @@ class EmployeeCore extends ObjectModel
return false;
break;
case 2:
if ($context->shop->checkIfGroupShopExist($context->shop->getGroupID()))
case Shop::CONTEXT_GROUP:
if ($context->shop->checkIfGroupShopExist(Shop::getContextGroupShopID()))
{
$shops = $context->shop->getIdShopsByIdGroupShop($context->shop->getGroupID());
$shops = $context->shop->getIdShopsByIdGroupShop(Shop::getContextGroupShopID());
foreach ($shops as $shop)
if (!in_array($shop, Employee::getEmployeeShopById($id_employee)))
return false;
@@ -278,7 +278,7 @@ class EmployeeCore extends ObjectModel
return false;
break;
case 3:
case Shop::CONTEXT_ALL:
if ($context->employee->id_profile == _PS_ADMIN_PROFILE_ ||
$context->shop->getTotalShopsWhoExists() == Employee::getTotalEmployeeShopById($id_employee))
return true;