@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 date filtering to Maniphest "pro" search

Summary: Adds date created filtering. There's a task for this somewhere that I can't immediately find.

Test Plan: Filtered tasks.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

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

+50
+28
src/applications/maniphest/query/ManiphestTaskQuery.php
··· 20 20 private $anyProjectPHIDs = array(); 21 21 private $anyUserProjectPHIDs = array(); 22 22 private $includeNoProject = null; 23 + private $dateCreatedAfter; 24 + private $dateCreatedBefore; 23 25 24 26 private $fullTextSearch = ''; 25 27 ··· 183 185 return $this; 184 186 } 185 187 188 + public function withDateCreatedBefore($date_created_before) { 189 + $this->dateCreatedBefore = $date_created_before; 190 + return $this; 191 + } 192 + 193 + public function withDateCreatedAfter($date_created_after) { 194 + $this->dateCreatedAfter = $date_created_after; 195 + return $this; 196 + } 197 + 186 198 public function loadPage() { 187 199 188 200 // TODO: (T603) It is possible for a user to find the PHID of a project ··· 219 231 $where[] = $this->buildAnyUserProjectWhereClause($conn); 220 232 $where[] = $this->buildXProjectWhereClause($conn); 221 233 $where[] = $this->buildFullTextWhereClause($conn); 234 + 235 + // TODO: Add a key for this the next time we hit this table. 236 + 237 + if ($this->dateCreatedAfter) { 238 + $where[] = qsprintf( 239 + $conn, 240 + 'dateCreated >= %d', 241 + $this->dateCreatedAfter); 242 + } 243 + 244 + if ($this->dateCreatedBefore) { 245 + $where[] = qsprintf( 246 + $conn, 247 + 'dateCreated <= %d', 248 + $this->dateCreatedBefore); 249 + } 222 250 223 251 $where = $this->formatWhereClause($where); 224 252
+22
src/applications/maniphest/query/ManiphestTaskSearchEngine.php
··· 53 53 'userProjectPHIDs', 54 54 $this->readUsersFromRequest($request, 'userProjects')); 55 55 56 + $saved->setParameter('createdStart', $request->getStr('createdStart')); 57 + $saved->setParameter('createdEnd', $request->getStr('createdEnd')); 58 + 56 59 return $saved; 57 60 } 58 61 ··· 125 128 $user_project_phids = $saved->getParameter('userProjectPHIDs'); 126 129 if ($user_project_phids) { 127 130 $query->withAnyUserProjects($user_project_phids); 131 + } 132 + 133 + $start = $this->parseDateTime($saved->getParameter('createdStart')); 134 + $end = $this->parseDateTime($saved->getParameter('createdEnd')); 135 + 136 + if ($start) { 137 + $query->withDateCreatedAfter($start); 138 + } 139 + 140 + if ($end) { 141 + $query->withDateCreatedBefore($end); 128 142 } 129 143 130 144 return $query; ··· 273 287 ->setName('ids') 274 288 ->setLabel(pht('Task IDs')) 275 289 ->setValue(implode(', ', $ids))); 290 + 291 + $this->buildDateRange( 292 + $form, 293 + $saved, 294 + 'createdStart', 295 + pht('Created After'), 296 + 'createdEnd', 297 + pht('Created Before')); 276 298 } 277 299 278 300 protected function getURI($path) {