@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.

Add "IDs" and "Priority" to pro search

Summary: Ref T2625. Restore these, too.

Test Plan: Executed queries using these fields.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2625

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

+62 -1
+19
src/applications/maniphest/ManiphestTaskQuery.php
··· 36 36 private $statuses; 37 37 38 38 private $priority = null; 39 + private $priorities; 39 40 40 41 private $minPriority = null; 41 42 private $maxPriority = null; ··· 123 124 return $this; 124 125 } 125 126 127 + public function withPriorities(array $priorities) { 128 + $this->priorities = $priorities; 129 + return $this; 130 + } 131 + 126 132 public function withPrioritiesBetween($min, $max) { 127 133 $this->minPriority = $min; 128 134 $this->maxPriority = $max; ··· 197 203 $where[] = $this->buildStatusWhereClause($conn); 198 204 $where[] = $this->buildStatusesWhereClause($conn); 199 205 $where[] = $this->buildPriorityWhereClause($conn); 206 + $where[] = $this->buildPrioritiesWhereClause($conn); 200 207 $where[] = $this->buildAuthorWhereClause($conn); 201 208 $where[] = $this->buildOwnerWhereClause($conn); 202 209 $where[] = $this->buildSubscriberWhereClause($conn); ··· 365 372 366 373 return null; 367 374 } 375 + 376 + private function buildPrioritiesWhereClause(AphrontDatabaseConnection $conn) { 377 + if ($this->priorities) { 378 + return qsprintf( 379 + $conn, 380 + 'priority IN (%Ld)', 381 + $this->priorities); 382 + } 383 + 384 + return null; 385 + } 386 + 368 387 369 388 private function buildAuthorWhereClause(AphrontDatabaseConnection $conn) { 370 389 if (!$this->authorPHIDs) {
+43 -1
src/applications/maniphest/query/ManiphestTaskSearchEngine.php
··· 17 17 $this->readUsersFromRequest($request, 'authors')); 18 18 19 19 $saved->setParameter('statuses', $request->getArr('statuses')); 20 + $saved->setParameter('priorities', $request->getArr('priorities')); 20 21 $saved->setParameter('order', $request->getStr('order')); 21 22 23 + $ids = $request->getStrList('ids'); 24 + foreach ($ids as $key => $id) { 25 + $id = trim($id, ' Tt'); 26 + if (!$id || !is_numeric($id)) { 27 + unset($ids[$key]); 28 + } else { 29 + $ids[$key] = $id; 30 + } 31 + } 32 + $saved->setParameter('ids', $ids); 33 + 22 34 return $saved; 23 35 } 24 36 ··· 45 57 $query->withStatuses($statuses); 46 58 } 47 59 60 + $priorities = $saved->getParameter('priorities'); 61 + if ($priorities) { 62 + $query->withPriorities($priorities); 63 + } 64 + 48 65 $order = $saved->getParameter('order'); 49 66 $order = idx($this->getOrderValues(), $order); 50 67 if ($order) { 51 68 $query->setOrderBy($order); 52 69 } else { 53 70 $query->setOrderBy(head($this->getOrderValues())); 71 + } 72 + 73 + $ids = $saved->getParameter('ids'); 74 + if ($ids) { 75 + $query->withIDs($ids); 54 76 } 55 77 56 78 return $query; ··· 94 116 isset($statuses[$status])); 95 117 } 96 118 119 + $priorities = $saved->getParameter('priorities', array()); 120 + $priorities = array_fuse($priorities); 121 + $priority_control = id(new AphrontFormCheckboxControl()) 122 + ->setLabel(pht('Priority')); 123 + foreach (ManiphestTaskPriority::getTaskPriorityMap() as $pri => $name) { 124 + $priority_control->addCheckbox( 125 + 'priorities[]', 126 + $pri, 127 + $name, 128 + isset($priorities[$pri])); 129 + } 130 + 131 + $ids = $saved->getParameter('ids', array()); 132 + 97 133 $form 98 134 ->appendChild( 99 135 id(new AphrontFormTokenizerControl()) ··· 115 151 ->setLabel(pht('Authors')) 116 152 ->setValue($author_tokens)) 117 153 ->appendChild($status_control) 154 + ->appendChild($priority_control) 118 155 ->appendChild( 119 156 id(new AphrontFormSelectControl()) 120 157 ->setName('order') 121 158 ->setLabel(pht('Order')) 122 159 ->setValue($saved->getParameter('order')) 123 - ->setOptions($this->getOrderOptions())); 160 + ->setOptions($this->getOrderOptions())) 161 + ->appendChild( 162 + id(new AphrontFormTextControl()) 163 + ->setName('ids') 164 + ->setLabel(pht('Task IDs')) 165 + ->setValue(implode(', ', $ids))); 124 166 } 125 167 126 168 protected function getURI($path) {