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

Transactions - introduce a buildTransactionTimeline function

Summary: ...way way down in PhabricatorController. Use it on ManiphestTaskDetailController to test it. Ref T4712. I think the pager logic to be added as part of T4712 can safely reside entirely within this method. As I said earlier, 5 parameters is a lot, so I don't really want to add more. Next diff would do the pagination logic and the diff after that would deploy it everywhere. If while deploying it everywhere I find something off, that will be a different diff.

Test Plan: viewed maniphest tasks and they looked as spiffy as ever.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T4712

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

+39 -20
+35
src/applications/base/controller/PhabricatorController.php
··· 526 526 ->setSubmitURI($submit_uri); 527 527 } 528 528 529 + protected function buildTransactionTimeline( 530 + PhabricatorLiskDAO $object, 531 + PhabricatorApplicationTransactionQuery $query, 532 + PhabricatorMarkupEngine $engine = null) { 533 + 534 + $viewer = $this->getRequest()->getUser(); 535 + $xaction = $object->getApplicationTransactionTemplate(); 536 + $view = $xaction->getApplicationTransactionViewObject(); 537 + 538 + $xactions = $query 539 + ->setViewer($viewer) 540 + ->withObjectPHIDs(array($object->getPHID())) 541 + ->needComments(true) 542 + ->execute(); 543 + 544 + if ($engine) { 545 + foreach ($xactions as $xaction) { 546 + if ($xaction->getComment()) { 547 + $engine->addObject( 548 + $xaction->getComment(), 549 + PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT); 550 + } 551 + } 552 + $engine->process(); 553 + $view->setMarkupEngine($engine); 554 + } 555 + 556 + $timeline = $view 557 + ->setUser($viewer) 558 + ->setObjectPHID($object->getPHID()) 559 + ->setTransactions($xactions); 560 + 561 + return $timeline; 562 + } 563 + 529 564 }
+4 -20
src/applications/maniphest/controller/ManiphestTaskDetailController.php
··· 37 37 ->executeOne(); 38 38 } 39 39 40 - $transactions = id(new ManiphestTransactionQuery()) 41 - ->setViewer($user) 42 - ->withObjectPHIDs(array($task->getPHID())) 43 - ->needComments(true) 44 - ->execute(); 45 - 46 40 $field_list = PhabricatorCustomField::getObjectFields( 47 41 $task, 48 42 PhabricatorCustomField::ROLE_VIEW); ··· 136 130 $engine = new PhabricatorMarkupEngine(); 137 131 $engine->setViewer($user); 138 132 $engine->addObject($task, ManiphestTask::MARKUP_FIELD_DESCRIPTION); 139 - foreach ($transactions as $modern_xaction) { 140 - if ($modern_xaction->getComment()) { 141 - $engine->addObject( 142 - $modern_xaction->getComment(), 143 - PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT); 144 - } 145 - } 146 133 147 - $engine->process(); 134 + $timeline = $this->buildTransactionTimeline( 135 + $task, 136 + new ManiphestTransactionQuery(), 137 + $engine); 148 138 149 139 $resolution_types = ManiphestTaskStatus::getTaskStatusMap(); 150 140 ··· 336 326 phutil_tag_div( 337 327 'aphront-panel-preview-loading-text', 338 328 pht('Loading preview...')))); 339 - 340 - $timeline = id(new PhabricatorApplicationTransactionView()) 341 - ->setUser($user) 342 - ->setObjectPHID($task->getPHID()) 343 - ->setTransactions($transactions) 344 - ->setMarkupEngine($engine); 345 329 346 330 $object_name = 'T'.$task->getID(); 347 331 $actions = $this->buildActionView($task);