// Fix leftover _error

This commit is contained in:
tDidierjean
2012-01-11 16:54:25 +00:00
parent cb2c3e0ce6
commit 5bcda40f5c
4 changed files with 16 additions and 16 deletions
+12 -12
View File
@@ -50,7 +50,7 @@ class AdminEmployeesControllerCore extends AdminController
$profiles = Profile::getProfiles($this->context->language->id);
if (!$profiles)
$this->_errors[] = Tools::displayError('No profile');
$this->errors[] = Tools::displayError('No profile');
else
foreach ($profiles as $profile)
$this->profiles_array[$profile['name']] = $profile['name'];
@@ -119,7 +119,7 @@ class AdminEmployeesControllerCore extends AdminController
if ($obj->id_profile == _PS_ADMIN_PROFILE_ && $this->context->employee->id_profile != _PS_ADMIN_PROFILE_)
{
$this->_errors[] = Tools::displayError('You cannot edit SuperAdmin profile.');
$this->errors[] = Tools::displayError('You cannot edit SuperAdmin profile.');
return parent::renderForm();
}
@@ -287,9 +287,9 @@ class AdminEmployeesControllerCore extends AdminController
return false;
$email = $this->getFieldValue($obj, 'email');
if (!Validate::isEmail($email))
$this->_errors[] = Tools::displayError('Invalid e-mail');
$this->errors[] = Tools::displayError('Invalid e-mail');
else if (Employee::employeeExists($email) && !Tools::getValue('id_employee'))
$this->_errors[] = Tools::displayError('An account already exists for this e-mail address:').' '.$email;
$this->errors[] = Tools::displayError('An account already exists for this e-mail address:').' '.$email;
}
public function postProcess()
@@ -299,21 +299,21 @@ class AdminEmployeesControllerCore extends AdminController
/* PrestaShop demo mode */
if (_PS_MODE_DEMO_ && $id_employee = Tools::getValue('id_employee') && (int)$id_employee == _PS_DEMO_MAIN_BO_ACCOUNT_)
{
$this->_errors[] = Tools::displayError('This functionnality has been disabled.');
$this->errors[] = Tools::displayError('This functionnality has been disabled.');
return;
}
/* PrestaShop demo mode*/
if ($this->context->employee->id == Tools::getValue('id_employee'))
{
$this->_errors[] = Tools::displayError('You cannot disable or delete your own account.');
$this->errors[] = Tools::displayError('You cannot disable or delete your own account.');
return false;
}
$employee = new Employee(Tools::getValue('id_employee'));
if ($employee->isLastAdmin())
{
$this->_errors[] = Tools::displayError('You cannot disable or delete the last administrator account.');
$this->errors[] = Tools::displayError('You cannot disable or delete the last administrator account.');
return false;
}
@@ -321,7 +321,7 @@ class AdminEmployeesControllerCore extends AdminController
$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.');
$this->errors[] = Tools::displayError('You cannot delete this account since it manages warehouses. Check your warehouses first.');
return false;
}
}
@@ -335,20 +335,20 @@ class AdminEmployeesControllerCore extends AdminController
{
if (Tools::getValue('id_profile') != (int)_PS_ADMIN_PROFILE_)
{
$this->_errors[] = Tools::displayError('You should have at least one employee in the administrator group.');
$this->errors[] = Tools::displayError('You should have at least one employee in the administrator group.');
return false;
}
if (Tools::getvalue('active') == 0)
{
$this->_errors[] = Tools::displayError('You cannot disable or delete the last administrator account.');
$this->errors[] = Tools::displayError('You cannot disable or delete the last administrator account.');
return false;
}
}
if (!in_array(Tools::getValue('bo_theme'), $this->themes))
{
$this->_errors[] = Tools::displayError('Invalid theme.');
$this->errors[] = Tools::displayError('Invalid theme.');
return false;
}
@@ -356,7 +356,7 @@ class AdminEmployeesControllerCore extends AdminController
if (count($assos[0]) == 0 && $this->table = 'employee')
if (Shop::isFeatureActive() && _PS_ADMIN_PROFILE_ != $_POST['id_profile'])
$this->_errors[] = Tools::displayError('The employee must be associated with at least one shop');
$this->errors[] = Tools::displayError('The employee must be associated with at least one shop');
}
return parent::postProcess();
}