[-] 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
+19 -14
View File
@@ -565,23 +565,28 @@ class AdminCategoriesControllerCore extends AdminController
protected function processBulkDelete()
{
$cats_ids = array();
foreach (Tools::getValue($this->table.'Box') as $id_category)
if ($this->tabAccess['delete'] === '1')
{
$category = new Category((int)$id_category);
if (!$category->isRootCategoryForAShop())
$cats_ids[$category->id] = $category->id_parent;
}
if (parent::processBulkDelete())
{
$this->setDeleteMode();
foreach ($cats_ids as $id => $id_parent)
$this->processFatherlessProducts((int)$id_parent);
return true;
$cats_ids = array();
foreach (Tools::getValue($this->table.'Box') as $id_category)
{
$category = new Category((int)$id_category);
if (!$category->isRootCategoryForAShop())
$cats_ids[$category->id] = $category->id_parent;
}
if (parent::processBulkDelete())
{
$this->setDeleteMode();
foreach ($cats_ids as $id => $id_parent)
$this->processFatherlessProducts((int)$id_parent);
return true;
}
else
return false;
}
else
return false;
$this->errors[] = Tools::displayError('You do not have permission to delete here.');
}
public function processDelete()