[-] BO : BugFix : #PSTEST-1054 : Employees and permission updated

This commit is contained in:
vChabot
2012-04-02 10:05:24 +00:00
parent 98d06975d5
commit fe77cac02f
5 changed files with 117 additions and 10 deletions
@@ -59,8 +59,34 @@
$(document).ready(function(){
$('select[name=id_profile]').change(function(){
ifSuperAdmin($(this));
});
$.ajax({
url: "{$link->getAdminLink('AdminEmployees')}",
cache: false,
data : {
ajax : '1',
action : 'getTabByIdProfile',
id_profile : $(this).val()
},
dataType : 'json',
success : function(resp,textStatus,jqXHR)
{
if (resp != false)
{
$('select[name=default_tab]').html('');
$.each(resp, function(key, r){
if (r.id_parent == 0)
{
$('select[name=default_tab]').append('<optgroup label="'+r.name+'"></optgroup>');
$.each(r.children, function(k, value){
$('select[name=default_tab]').append('<option value="'+r.id_tab+'">'+value.name+'</option>')
});
}
});
}
}
});
});
ifSuperAdmin($('select[name=id_profile]'));
});