summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorraghunayyar <me@iraghu.com>2014-03-06 13:27:29 +0530
committerArthur Schiwon <blizzz@owncloud.com>2014-06-02 12:53:55 +0200
commitd3cee79b5a75f6257250e124b975ea046f396703 (patch)
treee57143fd4ea400a238acb4cb8eb880c4a13387ab
parente159f7e4a96d26548066b532d600198a67557b61 (diff)
downloadnextcloud-server-d3cee79b5a75f6257250e124b975ea046f396703.tar.gz
nextcloud-server-d3cee79b5a75f6257250e124b975ea046f396703.zip
Enhancement: Adding Group on the Sidebar updates the multiselect on the Userlist.
-rw-r--r--settings/js/users/groups.js15
-rw-r--r--settings/templates/users/part.createuser.php14
-rw-r--r--settings/templates/users/part.userlist.php50
3 files changed, 48 insertions, 31 deletions
diff --git a/settings/js/users/groups.js b/settings/js/users/groups.js
index b666ad5e74b..0180cb64898 100644
--- a/settings/js/users/groups.js
+++ b/settings/js/users/groups.js
@@ -55,6 +55,19 @@
var addedGroups = result.data.groupname;
UserList.availableGroups = $.unique($.merge(UserList.availableGroups, addedGroups));
GroupList.addGroup(result.data.groupname);
+
+ $('#newusergroups').children().first().attr('value', result.data.groupname);
+ $('#newusergroups').children().first().text(result.data.groupname);
+
+ $('.groupsselect').each( function (index, element) {
+ $(element).children().first().attr('value', result.data.groupname);
+ $(element).children().first().text(result.data.groupname);
+ });
+
+ $('.subadminsselect').each( function (index, element) {
+ $(element).children().first().attr('value', result.data.groupname);
+ $(element).children().first().text(result.data.groupname);
+ });
}
GroupList.toggleAddGroup();
}
@@ -124,7 +137,7 @@
initDeleteHandling: function() {
//set up handler
GroupDeleteHandler = new DeleteHandler('removegroup.php', 'groupname',
- GroupList.hide, GroupList.remove);
+ GroupList.hide, GroupList.remove);
//configure undo
OC.Notification.hide();
diff --git a/settings/templates/users/part.createuser.php b/settings/templates/users/part.createuser.php
index e52f0da0b36..73799ff5d5b 100644
--- a/settings/templates/users/part.createuser.php
+++ b/settings/templates/users/part.createuser.php
@@ -1,16 +1,18 @@
<div id="user-controls">
<form id="newuser" autocomplete="off">
- <input id="newusername" type="text" placeholder="<?php p($l->t('Login Name'))?>" /> <input
+ <input id="newusername" type="text" placeholder="<?php p($l->t('Login Name'))?>" />
+ <input
type="password" id="newuserpassword"
- placeholder="<?php p($l->t('Password'))?>" /> <select
- class="groupsselect"
- id="newusergroups" data-placeholder="groups"
+ placeholder="<?php p($l->t('Password'))?>"
+ />
+ <select
+ class="groupsselect" id="newusergroups" data-placeholder="groups"
title="<?php p($l->t('Groups'))?>" multiple="multiple">
<?php foreach($_["adminGroup"] as $adminGroup): ?>
- <option value="<?php p($adminGroup['name']);?>"><?php p($adminGroup['name']); ?></option>
+ <option value="<?php p($adminGroup['name']);?>"><?php p($adminGroup['name']); ?></option>
<?php endforeach; ?>
<?php foreach($_["groups"] as $group): ?>
- <option value="<?php p($group['name']);?>"><?php p($group['name']);?></option>
+ <option value="<?php p($group['name']);?>"><?php p($group['name']);?></option>
<?php endforeach;?>
</select>
<input type="submit" class="button" value="<?php p($l->t('Create'))?>" />
diff --git a/settings/templates/users/part.userlist.php b/settings/templates/users/part.userlist.php
index 989d5f362c4..17105b6e59d 100644
--- a/settings/templates/users/part.userlist.php
+++ b/settings/templates/users/part.userlist.php
@@ -33,32 +33,34 @@
src="<?php print_unescaped(image_path('core', 'actions/rename.svg'))?>"
alt="<?php p($l->t("set new password"))?>" title="<?php p($l->t("set new password"))?>"/>
</td>
- <td class="groups"><select
- class="groupsselect"
- data-username="<?php p($user['name']) ;?>"
- data-user-groups="<?php p(json_encode($user['groups'])) ;?>"
- data-placeholder="groups" title="<?php p($l->t('Groups'))?>"
- multiple="multiple">
- <?php foreach($_["adminGroup"] as $adminGroup): ?>
- <option value="<?php p($adminGroup['name']);?>"><?php p($adminGroup['name']); ?></option>
- <?php endforeach; ?>
- <?php foreach($_["groups"] as $group): ?>
- <option value="<?php p($group['name']);?>"><?php p($group['name']);?></option>
- <?php endforeach;?>
- </select>
+ <td class="groups">
+ <select
+ class="groupsselect"
+ data-username="<?php p($user['name']) ;?>"
+ data-user-groups="<?php p(json_encode($user['groups'])) ;?>"
+ data-placeholder="groups" title="<?php p($l->t('Groups'))?>"
+ multiple="multiple">
+ <?php foreach($_["adminGroup"] as $adminGroup): ?>
+ <option value="<?php p($adminGroup['name']);?>"><?php p($adminGroup['name']); ?></option>
+ <?php endforeach; ?>
+ <?php foreach($_["groups"] as $group): ?>
+ <option value="<?php p($group['name']);?>"><?php p($group['name']);?></option>
+ <?php endforeach;?>
+ </select>
</td>
<?php if(is_array($_['subadmins']) || $_['subadmins']): ?>
- <td class="subadmins"><select
- class="subadminsselect"
- data-username="<?php p($user['name']) ;?>"
- data-subadmin="<?php p(json_encode($user['subadmin']));?>"
- data-placeholder="subadmins" title="<?php p($l->t('Group Admin'))?>"
- multiple="multiple">
- <?php foreach($_["subadmingroups"] as $group): ?>
- <option value="<?php p($group);?>"><?php p($group);?></option>
- <?php endforeach;?>
- </select>
- </td>
+ <td class="subadmins">
+ <select
+ class="subadminsselect"
+ data-username="<?php p($user['name']) ;?>"
+ data-subadmin="<?php p(json_encode($user['subadmin']));?>"
+ data-placeholder="subadmins" title="<?php p($l->t('Group Admin'))?>"
+ multiple="multiple">
+ <?php foreach($_["subadmingroups"] as $group): ?>
+ <option value="<?php p($group);?>"><?php p($group);?></option>
+ <?php endforeach;?>
+ </select>
+ </td>
<?php endif;?>
<td class="quota">
<select class='quota-user' data-inputtitle="<?php p($l->t('Please enter storage quota (ex: "512 MB" or "12 GB")')) ?>">