// Some optimization #PI-121

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14723 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2012-04-18 09:57:19 +00:00
parent 2ae5cf56ab
commit ba4c5dbb18
8 changed files with 82 additions and 122 deletions
+2 -2
View File
@@ -272,7 +272,7 @@ class EmployeeCore extends ObjectModel
case Shop::CONTEXT_GROUP:
if ($context->shop->checkIfShopGroupExist(Shop::getContextShopGroupID()))
{
$shops = $context->shop->getIdShopsByIdShopGroup(Shop::getContextShopGroupID());
$shops = Shop::getShops(false, Shop::getContextShopGroupID(), true);
foreach ($shops as $shop)
if (!in_array($shop, Employee::getEmployeeShopById($id_employee)))
return false;
@@ -283,7 +283,7 @@ class EmployeeCore extends ObjectModel
case Shop::CONTEXT_ALL:
if ($context->employee->id_profile == _PS_ADMIN_PROFILE_ ||
$context->shop->getTotalShopsWhoExists() == Employee::getTotalEmployeeShopById($id_employee))
Shop::getTotalShops(false) == Employee::getTotalEmployeeShopById($id_employee))
return true;
else
return false;