From b4cc9906477c329005ef635b205753c507c1e971 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 27 Sep 2013 16:02:08 -0700 Subject: [PATCH] Add "Subscribers" to Maniphest application search Summary: Fixes T3883. This is already supported in the query, expose it in the UI. Test Plan: Ran some queries with and without subscribers. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T3883 Differential Revision: https://secure.phabricator.com/D7161 --- .../query/ManiphestTaskSearchEngine.php | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/applications/maniphest/query/ManiphestTaskSearchEngine.php b/src/applications/maniphest/query/ManiphestTaskSearchEngine.php index 3adfc8d7be..1a793e98c1 100644 --- a/src/applications/maniphest/query/ManiphestTaskSearchEngine.php +++ b/src/applications/maniphest/query/ManiphestTaskSearchEngine.php @@ -20,6 +20,10 @@ final class ManiphestTaskSearchEngine 'authorPHIDs', $this->readUsersFromRequest($request, 'authors')); + $saved->setParameter( + 'subscriberPHIDs', + $this->readUsersFromRequest($request, 'subscribers')); + $saved->setParameter('statuses', $request->getArr('statuses')); $saved->setParameter('priorities', $request->getArr('priorities')); $saved->setParameter('group', $request->getStr('group')); @@ -79,6 +83,11 @@ final class ManiphestTaskSearchEngine $query->withAuthors($author_phids); } + $subscriber_phids = $saved->getParameter('subscriberPHIDs'); + if ($subscriber_phids) { + $query->withSubscribers($subscriber_phids); + } + $with_unassigned = $saved->getParameter('withUnassigned'); if ($with_unassigned) { $query->withOwners(array(null)); @@ -184,6 +193,7 @@ final class ManiphestTaskSearchEngine $user_project_phids = $saved->getParameter( 'userProjectPHIDs', array()); + $subscriber_phids = $saved->getParameter('subscriberPHIDs', array()); $all_phids = array_merge( $assigned_phids, @@ -191,7 +201,8 @@ final class ManiphestTaskSearchEngine $all_project_phids, $any_project_phids, $exclude_project_phids, - $user_project_phids); + $user_project_phids, + $subscriber_phids); if ($all_phids) { $handles = id(new PhabricatorHandleQuery()) @@ -210,6 +221,7 @@ final class ManiphestTaskSearchEngine $handles, $exclude_project_phids); $user_project_handles = array_select_keys($handles, $user_project_phids); + $subscriber_handles = array_select_keys($handles, $subscriber_phids); $with_unassigned = $saved->getParameter('withUnassigned'); $with_no_projects = $saved->getParameter('withNoProject'); @@ -291,6 +303,12 @@ final class ManiphestTaskSearchEngine ->setName('authors') ->setLabel(pht('Authors')) ->setValue($author_handles)) + ->appendChild( + id(new AphrontFormTokenizerControl()) + ->setDatasource('/typeahead/common/accounts/') + ->setName('subscribers') + ->setLabel(pht('Subscribers')) + ->setValue($subscriber_handles)) ->appendChild($status_control) ->appendChild($priority_control) ->appendChild(