@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 phids to maniphest.query

Summary: requires add withTaskPHIDs to maniphest query class.

Test Plan: queried via conduit by task id and task phid -- respective success!

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2017

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

+49 -19
+16 -4
src/applications/conduit/method/maniphest/ConduitAPI_maniphest_query_Method.php
··· 53 53 $orders = implode(', ', $orders); 54 54 55 55 return array( 56 - 'ownerPHIDs' => 'optional list', 57 - 'authorPHIDs' => 'optional list', 58 - 'projectPHIDs' => 'optional list', 59 - 'ccPHIDs' => 'optional list', 56 + 'ids' => 'optional list<uint>', 57 + 'phids' => 'optional list<phid>', 58 + 'ownerPHIDs' => 'optional list<phid>', 59 + 'authorPHIDs' => 'optional list<phid>', 60 + 'projectPHIDs' => 'optional list<phid>', 61 + 'ccPHIDs' => 'optional list<phid>', 60 62 'fullText' => 'optional string', 61 63 62 64 'status' => 'optional enum<'.$statuses.'>', ··· 78 80 79 81 protected function execute(ConduitAPIRequest $request) { 80 82 $query = new ManiphestTaskQuery(); 83 + 84 + $task_ids = $request->getValue('ids'); 85 + if ($task_ids) { 86 + $query->withTaskIDs($task_ids); 87 + } 88 + 89 + $task_phids = $request->getValue('phids'); 90 + if ($task_phids) { 91 + $query->withTaskPHIDs($task_phids); 92 + } 81 93 82 94 $owners = $request->getValue('ownerPHIDs'); 83 95 if ($owners) {
+33 -15
src/applications/maniphest/ManiphestTaskQuery.php
··· 25 25 final class ManiphestTaskQuery extends PhabricatorQuery { 26 26 27 27 private $taskIDs = array(); 28 + private $taskPHIDs = array(); 28 29 private $authorPHIDs = array(); 29 30 private $ownerPHIDs = array(); 30 31 private $includeUnowned = null; ··· 82 83 83 84 public function withTaskIDs(array $ids) { 84 85 $this->taskIDs = $ids; 86 + return $this; 87 + } 88 + 89 + public function withTaskPHIDs(array $phids) { 90 + $this->taskPHIDs = $phids; 85 91 return $this; 86 92 } 87 93 ··· 197 203 198 204 $where = array(); 199 205 $where[] = $this->buildTaskIDsWhereClause($conn); 206 + $where[] = $this->buildTaskPHIDsWhereClause($conn); 200 207 $where[] = $this->buildStatusWhereClause($conn); 201 208 $where[] = $this->buildPriorityWhereClause($conn); 202 209 $where[] = $this->buildAuthorWhereClause($conn); ··· 288 295 return $tasks; 289 296 } 290 297 291 - private function buildTaskIDsWhereClause($conn) { 298 + private function buildTaskIDsWhereClause(AphrontDatabaseConnection $conn) { 292 299 if (!$this->taskIDs) { 293 300 return null; 294 301 } ··· 299 306 $this->taskIDs); 300 307 } 301 308 302 - private function buildStatusWhereClause($conn) { 309 + private function buildTaskPHIDsWhereClause(AphrontDatabaseConnection $conn) { 310 + if (!$this->taskPHIDs) { 311 + return null; 312 + } 313 + 314 + return qsprintf( 315 + $conn, 316 + 'phid in (%Ls)', 317 + $this->taskPHIDs); 318 + } 319 + 320 + private function buildStatusWhereClause(AphrontDatabaseConnection $conn) { 303 321 304 322 static $map = array( 305 323 self::STATUS_RESOLVED => ManiphestTaskStatus::STATUS_CLOSED_RESOLVED, ··· 328 346 } 329 347 } 330 348 331 - private function buildPriorityWhereClause($conn) { 349 + private function buildPriorityWhereClause(AphrontDatabaseConnection $conn) { 332 350 if ($this->priority !== null) { 333 351 return qsprintf( 334 352 $conn, ··· 345 363 return null; 346 364 } 347 365 348 - private function buildAuthorWhereClause($conn) { 366 + private function buildAuthorWhereClause(AphrontDatabaseConnection $conn) { 349 367 if (!$this->authorPHIDs) { 350 368 return null; 351 369 } ··· 356 374 $this->authorPHIDs); 357 375 } 358 376 359 - private function buildOwnerWhereClause($conn) { 377 + private function buildOwnerWhereClause(AphrontDatabaseConnection $conn) { 360 378 if (!$this->ownerPHIDs) { 361 379 if ($this->includeUnowned === null) { 362 380 return null; ··· 384 402 } 385 403 } 386 404 387 - private function buildFullTextWhereClause($conn) { 405 + private function buildFullTextWhereClause(AphrontDatabaseConnection $conn) { 388 406 if (!$this->fullTextSearch) { 389 407 return null; 390 408 } ··· 408 426 $fulltext_results); 409 427 } 410 428 411 - private function buildSubscriberWhereClause($conn) { 429 + private function buildSubscriberWhereClause(AphrontDatabaseConnection $conn) { 412 430 if (!$this->subscriberPHIDs) { 413 431 return null; 414 432 } ··· 419 437 $this->subscriberPHIDs); 420 438 } 421 439 422 - private function buildProjectWhereClause($conn) { 440 + private function buildProjectWhereClause(AphrontDatabaseConnection $conn) { 423 441 if (!$this->projectPHIDs && !$this->includeNoProject) { 424 442 return null; 425 443 } ··· 440 458 return '('.implode(') OR (', $parts).')'; 441 459 } 442 460 443 - private function buildProjectJoinClause($conn) { 461 + private function buildProjectJoinClause(AphrontDatabaseConnection $conn) { 444 462 if (!$this->projectPHIDs && !$this->includeNoProject) { 445 463 return null; 446 464 } ··· 453 471 $project_dao->getTableName()); 454 472 } 455 473 456 - private function buildAnyProjectWhereClause($conn) { 474 + private function buildAnyProjectWhereClause(AphrontDatabaseConnection $conn) { 457 475 if (!$this->anyProjectPHIDs) { 458 476 return null; 459 477 } ··· 464 482 $this->anyProjectPHIDs); 465 483 } 466 484 467 - private function buildAnyProjectJoinClause($conn) { 485 + private function buildAnyProjectJoinClause(AphrontDatabaseConnection $conn) { 468 486 if (!$this->anyProjectPHIDs) { 469 487 return null; 470 488 } ··· 476 494 $project_dao->getTableName()); 477 495 } 478 496 479 - private function buildXProjectWhereClause($conn) { 497 + private function buildXProjectWhereClause(AphrontDatabaseConnection $conn) { 480 498 if (!$this->xprojectPHIDs) { 481 499 return null; 482 500 } ··· 486 504 'xproject.projectPHID IS NULL'); 487 505 } 488 506 489 - private function buildXProjectJoinClause($conn) { 507 + private function buildXProjectJoinClause(AphrontDatabaseConnection $conn) { 490 508 if (!$this->xprojectPHIDs) { 491 509 return null; 492 510 } ··· 500 518 $this->xprojectPHIDs); 501 519 } 502 520 503 - private function buildSubscriberJoinClause($conn) { 521 + private function buildSubscriberJoinClause(AphrontDatabaseConnection $conn) { 504 522 if (!$this->subscriberPHIDs) { 505 523 return null; 506 524 } ··· 512 530 $subscriber_dao->getTableName()); 513 531 } 514 532 515 - private function buildOrderClause($conn) { 533 + private function buildOrderClause(AphrontDatabaseConnection $conn) { 516 534 $order = array(); 517 535 518 536 switch ($this->groupBy) {