fix a subadmin UI bug

This commit is contained in:
Georg Ehrke 2012-08-01 18:03:08 +02:00
parent 98f37b93f6
commit 8766b3286b
2 changed files with 11 additions and 1 deletions

View File

@ -304,9 +304,13 @@ $(document).ready(function(){
tr.attr('data-uid',username);
tr.find('td.name').text(username);
var select=$('<select multiple="multiple" class="groupsselect" data-placehoder="Groups" title="Groups">');
var subadminselect=$('<select multiple="multiple" class="subadminsselect" data-placehoder="Groups" title="' + t('files', 'SubAdmin') + '">');
select.data('username',username);
select.data('userGroups',groups);
subadminselect.data('username',username);
subadminselect.data('userGroups',groups);
tr.find('td.groups').empty();
tr.find('td.subadmins').empty();
var allGroups=$('#content table').data('groups').split(', ');
for(var i=0;i<groups.length;i++){
if(allGroups.indexOf(groups[i])==-1){
@ -315,12 +319,18 @@ $(document).ready(function(){
}
$.each(allGroups,function(i,group){
select.append($('<option value="'+group+'">'+group+'</option>'));
if(group != 'admin'){
subadminselect.append($('<option value="'+group+'">'+group+'</option>'));
}
});
tr.find('td.groups').append(select);
tr.find('td.subadmins').append(subadminselect);
if(tr.find('td.remove img').length==0){
tr.find('td.remove').append($('<img alt="Delete" title="'+t('settings','Delete')+'" class="svg action" src="'+OC.imagePath('core','actions/delete')+'"/>'));
}
applyMultiplySelect(select);
applyMultiplySelect(subadminselect);
$('#content table tbody').last().append(tr);
tr.find('select.quota-user option').attr('selected',null);

View File

@ -109,7 +109,7 @@ var isadmin = <?php echo $_['isadmin']?'true':'false'; ?>;
class="subadminsselect"
data-username="<?php echo $user['name'] ;?>"
data-subadmin="<?php echo $user['subadmin'] ;?>"
data-placeholder="subadmins" title="<?php echo $l->t('SubAdmin for ...')?>"
data-placeholder="subadmins" title="<?php echo $l->t('SubAdmin')?>"
multiple="multiple">
<?php foreach($_["subadmingroups"] as $group): ?>
<option value="<?php echo $group;?>">