From 5bcda40f5c67e3c36d2cd0d5724d6d5f61e91b4e Mon Sep 17 00:00:00 2001 From: tDidierjean Date: Wed, 11 Jan 2012 16:54:25 +0000 Subject: [PATCH] // Fix leftover _error --- classes/Tab.php | 2 +- .../admin/AdminCategoriesController.php | 2 +- .../admin/AdminEmployeesController.php | 24 +++++++++---------- controllers/admin/AdminFeaturesController.php | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/classes/Tab.php b/classes/Tab.php index 5f20b7a3a..107c3fc80 100644 --- a/classes/Tab.php +++ b/classes/Tab.php @@ -425,7 +425,7 @@ class TabCore extends ObjectModel if (isset($tabAccesses[(int)$id_tab]['view'])) return ($tabAccesses[(int)$id_tab]['view'] === '1'); return false; -} + } public static function recursiveTab($id_tab, $tabs) { diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php index 5fdc272ad..88177bf80 100644 --- a/controllers/admin/AdminCategoriesController.php +++ b/controllers/admin/AdminCategoriesController.php @@ -480,7 +480,7 @@ class AdminCategoriesControllerCore extends AdminController } else if ($this->delete_mode != 'delete') { - $this->_errors[] = Tools::displayError('Unknown delete mode:'.' '.$this->deleted); + $this->errors[] = Tools::displayError('Unknown delete mode:'.' '.$this->deleted); return; } diff --git a/controllers/admin/AdminEmployeesController.php b/controllers/admin/AdminEmployeesController.php index 1ad9f01ca..a10f35436 100644 --- a/controllers/admin/AdminEmployeesController.php +++ b/controllers/admin/AdminEmployeesController.php @@ -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(); } diff --git a/controllers/admin/AdminFeaturesController.php b/controllers/admin/AdminFeaturesController.php index ced19b52a..56a468d5f 100644 --- a/controllers/admin/AdminFeaturesController.php +++ b/controllers/admin/AdminFeaturesController.php @@ -350,7 +350,7 @@ class AdminFeaturesControllerCore extends AdminController if (Tools::isSubmit('deletefeature_value') || Tools::isSubmit('submitAddfeature_value')) { Hook::exec('displayFeatureValuePostProcess', - array('errors' => &$this->errors)); // send _errors as reference to allow displayFeatureValuePostProcess to stop saving process + array('errors' => &$this->errors)); // send errors as reference to allow displayFeatureValuePostProcess to stop saving process if (Tools::isSubmit('deletefeature_value')) { @@ -407,7 +407,7 @@ class AdminFeaturesControllerCore extends AdminController else { Hook::exec('displayFeaturePostProcess', - array('errors' => &$this->errors)); // send _errors as reference to allow displayFeaturePostProcess to stop saving process + array('errors' => &$this->errors)); // send errors as reference to allow displayFeaturePostProcess to stop saving process if (Tools::getValue('submitDel'.$this->table)) {