Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
queue: Add Filtering To Queues
This adds the ability to use Qs instead of Queue Criteria to better filter Queues. This updates class Queue and adds two new functions `filter()` and `getFilters()`. `filter()` simply adds the Q(s) to the new `filters` property for later access. `getFilters()` simply returns all of the queue filters (if any). In addition, this updates the `AdhocSearch::load()` method to detect if the Queue's Config is an instanceof Q and if so we filter the queue by that Q else we will use the Queue Criteria (if any). Currently we can't search for tickets with the User's email address equal to `example@domain.com` **OR** Collaborator’s email address equal to `example@domain.com` as Queue Criteria is only seen as **AND** statements. The queue criteria for this would look like: ``` array( array('user__emails__address', 'equal', $user->getEmail()->email), array('thread__collaborators__user__emails__address', 'equal', $user->getEmail()->email), ) ``` With the new filter methods we could actually find those tickets with a Q like: ``` Q::any([ 'user__emails__address' => $user->getDefaultEmailAddress(), 'thread__collaborators__user__emails__address' => $user->getDefaultEmailAddress(), ]) ```
- Loading branch information
Showing
with
26 additions
and 7 deletions.
- +13 −0 include/class.queue.php
- +6 −1 include/class.search.php
- +7 −6 scp/tickets.php
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters