[-] 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:
@@ -30,9 +30,6 @@ class AdminAccessControllerCore extends AdminController
|
|||||||
/* @var array : Black list of id_tab that do not have access */
|
/* @var array : Black list of id_tab that do not have access */
|
||||||
public $accesses_black_list = array();
|
public $accesses_black_list = array();
|
||||||
|
|
||||||
/* @var int : id tab of controller AdminAccess */
|
|
||||||
public $id_tab_access;
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->table = 'access';
|
$this->table = 'access';
|
||||||
@@ -44,9 +41,6 @@ class AdminAccessControllerCore extends AdminController
|
|||||||
// Blacklist AdminLogin
|
// Blacklist AdminLogin
|
||||||
$this->accesses_black_list[] = Tab::getIdFromClassName('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();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,8 +101,7 @@ class AdminAccessControllerCore extends AdminController
|
|||||||
'access_edit' => $this->tabAccess['edit'],
|
'access_edit' => $this->tabAccess['edit'],
|
||||||
'perms' => array('view', 'add', 'edit', 'delete'),
|
'perms' => array('view', 'add', 'edit', 'delete'),
|
||||||
'modules' => $modules,
|
'modules' => $modules,
|
||||||
'link' => $this->context->link,
|
'link' => $this->context->link
|
||||||
'id_tab_access' => (int)$this->id_tab_access
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return parent::renderForm();
|
return parent::renderForm();
|
||||||
|
|||||||
+2
-6
@@ -60,7 +60,7 @@ function check_for_all_accesses(tabsize, tabnumber)
|
|||||||
var right = 0;
|
var right = 0;
|
||||||
var rights = new Array('view', 'add', 'edit', 'delete', 'all');
|
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)
|
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);
|
$('#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')
|
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+' .delete').attr('checked', src.checked);
|
||||||
$(table+' .view').attr('checked', src.checked);
|
$(table+' .view').attr('checked', src.checked);
|
||||||
$(table+' .all').attr('checked', src.checked);
|
$(table+' .all').attr('checked', src.checked);
|
||||||
$(table+' .'+id_tab_access).attr('checked', "checked");
|
|
||||||
}
|
}
|
||||||
else if (action == 'all')
|
else if (action == 'all')
|
||||||
$(table+' .'+id_tab).attr('checked', src.checked);
|
$(table+' .'+id_tab).attr('checked', src.checked);
|
||||||
else if (id_tab == '-1')
|
else if (id_tab == '-1')
|
||||||
{
|
|
||||||
$(table+' .'+action).attr('checked', src.checked);
|
$(table+' .'+action).attr('checked', src.checked);
|
||||||
$(table+' #'+action+id_tab_access).attr('checked', "checked");
|
|
||||||
}
|
|
||||||
check_for_all_accesses(tabsize, tabnumber);
|
check_for_all_accesses(tabsize, tabnumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user