From c9ff52e9499cfb69d6bb92ab0301beffe2f31271 Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Mon, 18 Jun 2012 09:14:19 +0000 Subject: [PATCH] [-] BO : fixed bug #PSCFV-2859 - In my preferences, user can change his her profile git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16044 b9a71923-0436-4b27-9f14-aed3839534dd --- controllers/admin/AdminAccessController.php | 9 +-------- js/ajax.js | 8 ++------ 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/controllers/admin/AdminAccessController.php b/controllers/admin/AdminAccessController.php index 294bb39f9..1d35b9905 100644 --- a/controllers/admin/AdminAccessController.php +++ b/controllers/admin/AdminAccessController.php @@ -30,9 +30,6 @@ class AdminAccessControllerCore extends AdminController /* @var array : Black list of id_tab that do not have access */ public $accesses_black_list = array(); - /* @var int : id tab of controller AdminAccess */ - public $id_tab_access; - public function __construct() { $this->table = 'access'; @@ -44,9 +41,6 @@ class AdminAccessControllerCore extends AdminController // Blacklist AdminLogin $this->accesses_black_list[] = Tab::getIdFromClassName('AdminLogin'); - // Get id tab of controller AdminAccess - $this->id_tab_access = (int)Db::getInstance()->getValue('SELECT `id_tab` FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = "AdminAccess"'); - parent::__construct(); } @@ -107,8 +101,7 @@ class AdminAccessControllerCore extends AdminController 'access_edit' => $this->tabAccess['edit'], 'perms' => array('view', 'add', 'edit', 'delete'), 'modules' => $modules, - 'link' => $this->context->link, - 'id_tab_access' => (int)$this->id_tab_access + 'link' => $this->context->link ); return parent::renderForm(); diff --git a/js/ajax.js b/js/ajax.js index fac3d8a1d..be8e33a61 100644 --- a/js/ajax.js +++ b/js/ajax.js @@ -60,7 +60,7 @@ function check_for_all_accesses(tabsize, tabnumber) var right = 0; var rights = new Array('view', 'add', 'edit', 'delete', 'all'); - while (i != tabsize + 1) + while (i != parseInt(tabsize) + 1) { if ($('#view'+i).prop('checked') == false || $('#edit'+i).prop('checked') == false || $('#add'+i).prop('checked') == false || $('#delete'+i).prop('checked') == false) $('#all'+i).attr('checked', false); @@ -87,7 +87,7 @@ function check_for_all_accesses(tabsize, tabnumber) } } -function perfect_access_js_gestion(src, action, id_tab, tabsize, tabnumber, table, id_tab_access) +function perfect_access_js_gestion(src, action, id_tab, tabsize, tabnumber, table) { if (id_tab == '-1' && action == 'all') { @@ -96,15 +96,11 @@ function perfect_access_js_gestion(src, action, id_tab, tabsize, tabnumber, tabl $(table+' .delete').attr('checked', src.checked); $(table+' .view').attr('checked', src.checked); $(table+' .all').attr('checked', src.checked); - $(table+' .'+id_tab_access).attr('checked', "checked"); } else if (action == 'all') $(table+' .'+id_tab).attr('checked', src.checked); else if (id_tab == '-1') - { $(table+' .'+action).attr('checked', src.checked); - $(table+' #'+action+id_tab_access).attr('checked', "checked"); - } check_for_all_accesses(tabsize, tabnumber); }