// Warehouse: getWarehouseList is now getWarehouses. Employee: it is not possible to delete an employee if he manages warehouses, anymore.

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10103 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
bMancone
2011-11-14 14:28:30 +00:00
parent 9885ab5324
commit fdab7ebc70
7 changed files with 34 additions and 10 deletions
@@ -331,6 +331,14 @@ class AdminEmployeesControllerCore extends AdminController
$this->_errors[] = Tools::displayError('You cannot disable or delete the last administrator account.');
return false;
}
// It is not possible to delete an employee if he manages warehouses
$warehouses = Warehouse::getWarehousesByEmployee((int)Tools::getValue('id_employee'));
if (Tools::isSubmit('deleteemployee') && count($warehouses) > 0)
{
$this->_errors[] = Tools::displayError('You cannot delete this account since it manages warehouses. Check your warehouses first.');
return false;
}
}
else if (Tools::isSubmit('submitAddemployee'))
{