@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Expose "withAnyProjects()" in the UI

Summary:
Add an "Any Projects" field to the custom search UI.

This is starting to get ugly but we'll do a design pass on it before toooo long.

Test Plan: {F20423}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1610

Differential Revision: https://secure.phabricator.com/D3632

+28 -2
+28 -2
src/applications/maniphest/controller/ManiphestTaskListController.php
··· 58 58 $uri = $request->getRequestURI() 59 59 ->alter('users', $this->getArrToStrList('set_users')) 60 60 ->alter('projects', $this->getArrToStrList('set_projects')) 61 + ->alter('aprojects', $this->getArrToStrList('set_aprojects')) 61 62 ->alter('xprojects', $this->getArrToStrList('set_xprojects')) 62 63 ->alter('owners', $this->getArrToStrList('set_owners')) 63 64 ->alter('authors', $this->getArrToStrList('set_authors')) ··· 118 119 $owner_phids = $query->getParameter('ownerPHIDs', array()); 119 120 $author_phids = $query->getParameter('authorPHIDs', array()); 120 121 $project_phids = $query->getParameter('projectPHIDs', array()); 122 + $any_project_phids = $query->getParameter( 123 + 'anyProjectPHIDs', 124 + array()); 121 125 $exclude_project_phids = $query->getParameter( 122 126 'excludeProjectPHIDs', 123 127 array()); ··· 201 205 $tokens[$phid] = $handles[$phid]->getFullName(); 202 206 } 203 207 if ($this->view != 'projectall' && $this->view != 'projecttriage') { 208 + 209 + $caption = null; 210 + if ($this->view == 'custom') { 211 + $caption = 'Find tasks in ALL of these projects ("AND" query).'; 212 + } 213 + 204 214 $form->appendChild( 205 215 id(new AphrontFormTokenizerControl()) 206 216 ->setDatasource('/typeahead/common/searchproject/') 207 217 ->setName('set_projects') 208 218 ->setLabel('Projects') 219 + ->setCaption($caption) 209 220 ->setValue($tokens)); 210 221 } 211 222 212 223 if ($this->view == 'custom') { 224 + $atokens = array(); 225 + foreach ($any_project_phids as $phid) { 226 + $atokens[$phid] = $handles[$phid]->getFullName(); 227 + } 228 + $form->appendChild( 229 + id(new AphrontFormTokenizerControl()) 230 + ->setDatasource('/typeahead/common/projects/') 231 + ->setName('set_aprojects') 232 + ->setLabel('Any Projects') 233 + ->setCaption('Find tasks in ANY of these projects ("OR" query).') 234 + ->setValue($atokens)); 235 + 213 236 $tokens = array(); 214 237 foreach ($exclude_project_phids as $phid) { 215 238 $tokens[$phid] = $handles[$phid]->getFullName(); ··· 219 242 ->setDatasource('/typeahead/common/projects/') 220 243 ->setName('set_xprojects') 221 244 ->setLabel('Exclude Projects') 245 + ->setCaption('Find tasks NOT in any of these projects.') 222 246 ->setValue($tokens)); 223 247 224 248 $priority = ManiphestTaskPriority::getLowestPriority(); ··· 435 459 $query->withoutProjects($xproject_phids); 436 460 } 437 461 462 + if ($any_project_phids) { 463 + $query->withAnyProjects($any_project_phids); 464 + } 465 + 438 466 if ($owner_phids) { 439 467 $query->withOwners($owner_phids); 440 468 } ··· 473 501 break; 474 502 case 'projecttriage': 475 503 $query->withPriority(ManiphestTaskPriority::PRIORITY_TRIAGE); 476 - $query->withAnyProjects($any_project_phids); 477 504 break; 478 505 case 'projectall': 479 - $query->withAnyProjects($any_project_phids); 480 506 break; 481 507 case 'custom': 482 508 $query->withPrioritiesBetween($low_priority, $high_priority);