Merge pull request #9381 from annando/group-number

Display number of group members in contact widget
This commit is contained in:
Tobias Diekershoff 2020-10-07 09:38:39 +02:00 committed by GitHub
commit ad316447b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -505,10 +505,17 @@ class Group
$groupedit = null; $groupedit = null;
} }
if ($each == 'group') {
$count = DBA::count('group_member', ['gid' => $group['id']]);
$group_name = sprintf('%s (%d)', $group['name'], $count);
} else {
$group_name = $group['name'];
}
$display_groups[] = [ $display_groups[] = [
'id' => $group['id'], 'id' => $group['id'],
'cid' => $cid, 'cid' => $cid,
'text' => $group['name'], 'text' => $group_name,
'href' => $each . '/' . $group['id'], 'href' => $each . '/' . $group['id'],
'edit' => $groupedit, 'edit' => $groupedit,
'selected' => $selected, 'selected' => $selected,