]> source.dussan.org Git - nextcloud-server.git/commitdiff
increment group counters when a user is created
authorArthur Schiwon <blizzz@owncloud.com>
Fri, 4 Jul 2014 23:21:18 +0000 (01:21 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Wed, 9 Jul 2014 12:30:39 +0000 (14:30 +0200)
settings/js/users/groups.js
settings/js/users/users.js
settings/templates/users/part.grouplist.php

index dcaf593b886035fb677d7e381292070d71836486..c3e3d1a50c9afa085ea55ee425adef5768aa7f7d 100644 (file)
@@ -34,6 +34,10 @@ GroupList = {
                $groupLiElement.find('.usercount').text(usercount);
        },
 
+       getUserCount: function ($groupLiElement) {
+               return parseInt($groupLiElement.data('usercount'), 10);
+       },
+
        getCurrentGID: function () {
                return GroupList.activeGID;
        },
index f84d67b75bc6d6338169bc02f9472b4634375eb1..170a4bd89da1b4656691981bc764dda325e902bf 100644 (file)
@@ -91,8 +91,8 @@ var UserList = {
                }
                $tdLastLogin = $tr.find('td.lastLogin');
                $tdLastLogin.text(lastLoginRel);
-               //tooltip makes it complicated … to not insert new HTML, we adjust the 
-               //original title. We use a temporary div to get back the html that we 
+               //tooltip makes it complicated … to not insert new HTML, we adjust the
+               //original title. We use a temporary div to get back the html that we
                //can pass later. It is also required to initialise tipsy.
                var tooltip = $('<div>').html($($tdLastLogin.attr('original-title')).text(lastLoginAbs)).html();
                $tdLastLogin.tipsy({gravity:'s', fade:true, html:true});
@@ -602,6 +602,12 @@ $(document).ready(function () {
                                        if (result.data.groups) {
                                                var addedGroups = result.data.groups;
                                                UserList.availableGroups = $.unique($.merge(UserList.availableGroups, addedGroups));
+                                               for (i in result.data.groups) {
+                                                       var gid = result.data.groups[i];
+                                                       $li = GroupList.getGroupLI(gid);
+                                                       userCount = GroupList.getUserCount($li);
+                                                       GroupList.setUserCount($li, userCount + 1);
+                                               }
                                        }
                                        if (result.data.homeExists){
                                                OC.Notification.hide();
index 28f2236b1d7d45b01d5ae928da5d800c7d832ae8..588c2e6202cef8209681e0259d5a3050bb2c1e9a 100644 (file)
@@ -27,7 +27,7 @@
 
        <!-- The Admin Group -->
        <?php foreach($_["adminGroup"] as $adminGroup): ?>
-               <li data-gid="admin" class="isgroup">
+               <li data-gid="admin" data-usercount="<?php if($adminGroup['usercount'] > 0) { p($adminGroup['usercount']); } ?>" class="isgroup">
                        <a href="#"><span class="groupname"><?php p($l->t('Admins')); ?></span></a>
                        <span class="utils">
                                <span class="usercount"><?php if($adminGroup['usercount'] > 0) { p($adminGroup['usercount']); } ?></span>