[-] BO : fixed bug #PSCFV-5230 - Employees skip permits on bulk delete category

This commit is contained in:
vAugagneur
2012-10-25 13:16:20 +00:00
parent 329ec2e272
commit 3b031d45cf
+18 -13
View File
@@ -565,23 +565,28 @@ class AdminCategoriesControllerCore extends AdminController
protected function processBulkDelete() protected function processBulkDelete()
{ {
$cats_ids = array(); if ($this->tabAccess['delete'] === '1')
foreach (Tools::getValue($this->table.'Box') as $id_category)
{ {
$category = new Category((int)$id_category); $cats_ids = array();
if (!$category->isRootCategoryForAShop()) foreach (Tools::getValue($this->table.'Box') as $id_category)
$cats_ids[$category->id] = $category->id_parent; {
} $category = new Category((int)$id_category);
if (!$category->isRootCategoryForAShop())
$cats_ids[$category->id] = $category->id_parent;
}
if (parent::processBulkDelete()) if (parent::processBulkDelete())
{ {
$this->setDeleteMode(); $this->setDeleteMode();
foreach ($cats_ids as $id => $id_parent) foreach ($cats_ids as $id => $id_parent)
$this->processFatherlessProducts((int)$id_parent); $this->processFatherlessProducts((int)$id_parent);
return true; return true;
}
else
return false;
} }
else else
return false; $this->errors[] = Tools::displayError('You do not have permission to delete here.');
} }
public function processDelete() public function processDelete()