[*] BO : A new method in Employee class has been written "getEmployeesByProfile". it returns an array of employees who has the given profile.

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12787 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mBertholino
2012-01-30 10:16:09 +00:00
parent 2c688050b6
commit 8b74487eac
2 changed files with 22 additions and 0 deletions
@@ -47,6 +47,19 @@ class AdminEmployeesControllerCore extends AdminController
$this->context = Context::getContext();
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
/*
check if there are more than one superAdmin
if it's the case then we can delete a superAdmin
*/
$superAdmin = Employee::countProfile(1, true);
if ($superAdmin == 1)
{
$superAdmin_array = Employee::getEmployeesByProfile(1, true);
$superAdmin_id = array();
foreach ($superAdmin_array as $key => $val)
$superAdmin_id[] = $val['id_employee'];
$this->addRowActionSkipList('delete', $superAdmin_id);
}
$profiles = Profile::getProfiles($this->context->language->id);
if (!$profiles)