// Fix leftover _error
This commit is contained in:
+1
-1
@@ -425,7 +425,7 @@ class TabCore extends ObjectModel
|
|||||||
if (isset($tabAccesses[(int)$id_tab]['view']))
|
if (isset($tabAccesses[(int)$id_tab]['view']))
|
||||||
return ($tabAccesses[(int)$id_tab]['view'] === '1');
|
return ($tabAccesses[(int)$id_tab]['view'] === '1');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function recursiveTab($id_tab, $tabs)
|
public static function recursiveTab($id_tab, $tabs)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -480,7 +480,7 @@ class AdminCategoriesControllerCore extends AdminController
|
|||||||
}
|
}
|
||||||
else if ($this->delete_mode != 'delete')
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class AdminEmployeesControllerCore extends AdminController
|
|||||||
|
|
||||||
$profiles = Profile::getProfiles($this->context->language->id);
|
$profiles = Profile::getProfiles($this->context->language->id);
|
||||||
if (!$profiles)
|
if (!$profiles)
|
||||||
$this->_errors[] = Tools::displayError('No profile');
|
$this->errors[] = Tools::displayError('No profile');
|
||||||
else
|
else
|
||||||
foreach ($profiles as $profile)
|
foreach ($profiles as $profile)
|
||||||
$this->profiles_array[$profile['name']] = $profile['name'];
|
$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_)
|
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();
|
return parent::renderForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,9 +287,9 @@ class AdminEmployeesControllerCore extends AdminController
|
|||||||
return false;
|
return false;
|
||||||
$email = $this->getFieldValue($obj, 'email');
|
$email = $this->getFieldValue($obj, 'email');
|
||||||
if (!Validate::isEmail($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'))
|
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()
|
public function postProcess()
|
||||||
@@ -299,21 +299,21 @@ class AdminEmployeesControllerCore extends AdminController
|
|||||||
/* PrestaShop demo mode */
|
/* PrestaShop demo mode */
|
||||||
if (_PS_MODE_DEMO_ && $id_employee = Tools::getValue('id_employee') && (int)$id_employee == _PS_DEMO_MAIN_BO_ACCOUNT_)
|
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;
|
return;
|
||||||
}
|
}
|
||||||
/* PrestaShop demo mode*/
|
/* PrestaShop demo mode*/
|
||||||
|
|
||||||
if ($this->context->employee->id == Tools::getValue('id_employee'))
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$employee = new Employee(Tools::getValue('id_employee'));
|
$employee = new Employee(Tools::getValue('id_employee'));
|
||||||
if ($employee->isLastAdmin())
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -321,7 +321,7 @@ class AdminEmployeesControllerCore extends AdminController
|
|||||||
$warehouses = Warehouse::getWarehousesByEmployee((int)Tools::getValue('id_employee'));
|
$warehouses = Warehouse::getWarehousesByEmployee((int)Tools::getValue('id_employee'));
|
||||||
if (Tools::isSubmit('deleteemployee') && count($warehouses) > 0)
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -335,20 +335,20 @@ class AdminEmployeesControllerCore extends AdminController
|
|||||||
{
|
{
|
||||||
if (Tools::getValue('id_profile') != (int)_PS_ADMIN_PROFILE_)
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Tools::getvalue('active') == 0)
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!in_array(Tools::getValue('bo_theme'), $this->themes))
|
if (!in_array(Tools::getValue('bo_theme'), $this->themes))
|
||||||
{
|
{
|
||||||
$this->_errors[] = Tools::displayError('Invalid theme.');
|
$this->errors[] = Tools::displayError('Invalid theme.');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,7 +356,7 @@ class AdminEmployeesControllerCore extends AdminController
|
|||||||
|
|
||||||
if (count($assos[0]) == 0 && $this->table = 'employee')
|
if (count($assos[0]) == 0 && $this->table = 'employee')
|
||||||
if (Shop::isFeatureActive() && _PS_ADMIN_PROFILE_ != $_POST['id_profile'])
|
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();
|
return parent::postProcess();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -350,7 +350,7 @@ class AdminFeaturesControllerCore extends AdminController
|
|||||||
if (Tools::isSubmit('deletefeature_value') || Tools::isSubmit('submitAddfeature_value'))
|
if (Tools::isSubmit('deletefeature_value') || Tools::isSubmit('submitAddfeature_value'))
|
||||||
{
|
{
|
||||||
Hook::exec('displayFeatureValuePostProcess',
|
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'))
|
if (Tools::isSubmit('deletefeature_value'))
|
||||||
{
|
{
|
||||||
@@ -407,7 +407,7 @@ class AdminFeaturesControllerCore extends AdminController
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
Hook::exec('displayFeaturePostProcess',
|
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))
|
if (Tools::getValue('submitDel'.$this->table))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user