[-] 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
This commit is contained in:
vAugagneur
2012-06-18 09:14:19 +00:00
parent 9ef9e6a7b6
commit c9ff52e949
2 changed files with 3 additions and 14 deletions

View File

@@ -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();

View File

@@ -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);
}