mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-01-19 08:52:22 +01:00
Merge pull request #686 from owncloud/issue-654
Display correct number of contacts in shared addressbooks.
This commit is contained in:
commit
0e170091e4
@ -751,7 +751,7 @@ OC.Contacts = OC.Contacts || {};
|
||||
$elem = $elem.length ? $elem : (tmpl).octemplate({
|
||||
id: shared.id,
|
||||
type: 'shared',
|
||||
num: response.data.shared.length,
|
||||
num: shared.length,
|
||||
name: shared.displayname
|
||||
});
|
||||
$elem.find('.numcontacts').after(sharedindicator);
|
||||
|
@ -45,10 +45,17 @@ class GroupController extends Controller {
|
||||
|
||||
$favorites = $this->tags->getFavorites();
|
||||
|
||||
$shares = \OCP\Share::getItemsSharedWith('addressbook', \OCA\Contacts\Share\Addressbook::FORMAT_ADDRESSBOOKS);
|
||||
$addressbookShare = new \OCA\Contacts\Share\Addressbook();
|
||||
foreach ($shares as $key => $share) {
|
||||
$children = $addressbookShare->getChildren($share['id']); // FIXME: This should be cheaper!
|
||||
$shares[$key]['length'] = count($children);
|
||||
}
|
||||
|
||||
$groups = array(
|
||||
'categories' => $tags,
|
||||
'favorites' => $favorites,
|
||||
'shared' => \OCP\Share::getItemsSharedWith('addressbook', \OCA\Contacts\Share\Addressbook::FORMAT_ADDRESSBOOKS),
|
||||
'shared' => $shares,
|
||||
'lastgroup' => \OCP\Config::getUserValue(\OCP\User::getUser(), 'contacts', 'lastgroup', 'all'),
|
||||
'sortorder' => \OCP\Config::getUserValue(\OCP\User::getUser(), 'contacts', 'groupsort', ''),
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user