Skip to content

Commit

Permalink
Merge branch '2023.11' into 2024.11
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlabci committed Feb 26, 2025
2 parents 1fb59a7 + a504f2f commit b8155ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tine20/Addressbook/Controller/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,12 @@ public function get($_id, $_containerId = NULL, $_getRelatedData = TRUE, $_getDe
$listController = Addressbook_Controller_List::getInstance();
$groups = $listController->getMemberships($_id);
// we remove the list members, so we can do the search on the backend, its way more efficient
$contact->groups = $listController->getBackend()->search(Tinebase_Model_Filter_FilterGroup::getFilterForModel(Addressbook_Model_List::class, [
$filter = Tinebase_Model_Filter_FilterGroup::getFilterForModel(Addressbook_Model_List::class, [
['field' => 'id', 'operator' => 'in', 'value' => $groups]
]));
]);
$listController->checkFilterACL($filter);
$listController->addDefaultFilter($filter);
$contact->groups = $listController->getBackend()->search($filter);
$contact->groups->members = null;
}

Expand Down
5 changes: 5 additions & 0 deletions tine20/Addressbook/Controller/List.php
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,11 @@ protected function _getContactIds($_userIds)
return $contactIds;
}

public function addDefaultFilter(Tinebase_Model_Filter_FilterGroup $_filter): void
{
$this->_addDefaultFilter($_filter);
}

/**
* you can define default filters here
*
Expand Down

0 comments on commit b8155ef

Please sign in to comment.