// Context part 25

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7794 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-07-28 14:17:58 +00:00
parent a1a32714ab
commit d3b2ff2664
55 changed files with 432 additions and 535 deletions
+6 -7
View File
@@ -32,7 +32,7 @@ class AdminEmployees extends AdminTab
public function __construct()
{
$context = Context::getContext();
$this->context = Context::getContext();
$this->table = 'employee';
$this->className = 'Employee';
$this->lang = false;
@@ -40,9 +40,9 @@ class AdminEmployees extends AdminTab
$this->delete = true;
$this->_select = 'pl.`name` AS profile';
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'profile` p ON a.`id_profile` = p.`id_profile`
LEFT JOIN `'._DB_PREFIX_.'profile_lang` pl ON (pl.`id_profile` = p.`id_profile` AND pl.`id_lang` = '.(int)$context->language->id.')';
LEFT JOIN `'._DB_PREFIX_.'profile_lang` pl ON (pl.`id_profile` = p.`id_profile` AND pl.`id_lang` = '.(int)$this->context->language->id.')';
$profiles = Profile::getProfiles($context->language->id);
$profiles = Profile::getProfiles($this->context->language->id);
if (!$profiles)
$this->_errors[] = Tools::displayError('No profile');
else
@@ -82,12 +82,11 @@ class AdminEmployees extends AdminTab
public function displayForm($isMainTab = true)
{
$context = Context::getContext();
parent::displayForm();
if (!($obj = $this->loadObject(true)))
return;
$profiles = Profile::getProfiles($context->language->id);
$profiles = Profile::getProfiles($this->context->language->id);
echo '<script type="text/javascript" src="'._PS_JS_DIR_.'/jquery/jquery-colorpicker.js"></script>
<script type="text/javascript">
@@ -176,10 +175,10 @@ class AdminEmployees extends AdminTab
public function postProcess()
{
$context = Context::getContext();
$this->context = Context::getContext();
if (Tools::isSubmit('deleteemployee') OR Tools::isSubmit('status') OR Tools::isSubmit('statusemployee'))
{
if ($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.');
return false;