mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-01-30 19:52:17 +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({
|
$elem = $elem.length ? $elem : (tmpl).octemplate({
|
||||||
id: shared.id,
|
id: shared.id,
|
||||||
type: 'shared',
|
type: 'shared',
|
||||||
num: response.data.shared.length,
|
num: shared.length,
|
||||||
name: shared.displayname
|
name: shared.displayname
|
||||||
});
|
});
|
||||||
$elem.find('.numcontacts').after(sharedindicator);
|
$elem.find('.numcontacts').after(sharedindicator);
|
||||||
|
@ -45,10 +45,17 @@ class GroupController extends Controller {
|
|||||||
|
|
||||||
$favorites = $this->tags->getFavorites();
|
$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(
|
$groups = array(
|
||||||
'categories' => $tags,
|
'categories' => $tags,
|
||||||
'favorites' => $favorites,
|
'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'),
|
'lastgroup' => \OCP\Config::getUserValue(\OCP\User::getUser(), 'contacts', 'lastgroup', 'all'),
|
||||||
'sortorder' => \OCP\Config::getUserValue(\OCP\User::getUser(), 'contacts', 'groupsort', ''),
|
'sortorder' => \OCP\Config::getUserValue(\OCP\User::getUser(), 'contacts', 'groupsort', ''),
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user