Page MenuHomePhabricator

D10844.id26031.diff
No OneTemporary

D10844.id26031.diff

diff --git a/src/applications/base/controller/PhabricatorController.php b/src/applications/base/controller/PhabricatorController.php
--- a/src/applications/base/controller/PhabricatorController.php
+++ b/src/applications/base/controller/PhabricatorController.php
@@ -526,4 +526,35 @@
->setSubmitURI($submit_uri);
}
+ protected function buildTransactionTimeline(
+ PhabricatorUser $viewer,
+ PhabricatorLiskDAO $object,
+ PhabricatorApplicationTransactionQuery $query,
+ PhabricatorApplicationTransactionView $view,
+ PhabricatorMarkupEngine $engine) {
+
+ $xactions = $query
+ ->setViewer($viewer)
+ ->withObjectPHIDs(array($object->getPHID()))
+ ->needComments(true)
+ ->execute();
+
+ foreach ($xactions as $xaction) {
+ if ($xaction->getComment()) {
+ $engine->addObject(
+ $xaction->getComment(),
+ PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT);
+ }
+ }
+ $engine->process();
+
+ $timeline = id(new PhabricatorApplicationTransactionView())
+ ->setUser($viewer)
+ ->setObjectPHID($object->getPHID())
+ ->setTransactions($xactions)
+ ->setMarkupEngine($engine);
+
+ return $timeline;
+ }
+
}
diff --git a/src/applications/maniphest/controller/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
--- a/src/applications/maniphest/controller/ManiphestTaskDetailController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
@@ -37,12 +37,6 @@
->executeOne();
}
- $transactions = id(new ManiphestTransactionQuery())
- ->setViewer($user)
- ->withObjectPHIDs(array($task->getPHID()))
- ->needComments(true)
- ->execute();
-
$field_list = PhabricatorCustomField::getObjectFields(
$task,
PhabricatorCustomField::ROLE_VIEW);
@@ -136,15 +130,13 @@
$engine = new PhabricatorMarkupEngine();
$engine->setViewer($user);
$engine->addObject($task, ManiphestTask::MARKUP_FIELD_DESCRIPTION);
- foreach ($transactions as $modern_xaction) {
- if ($modern_xaction->getComment()) {
- $engine->addObject(
- $modern_xaction->getComment(),
- PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT);
- }
- }
- $engine->process();
+ $timeline = $this->buildTransactionTimeline(
+ $user,
+ $task,
+ new ManiphestTransactionQuery(),
+ new PhabricatorApplicationTransactionView(),
+ $engine);
$resolution_types = ManiphestTaskStatus::getTaskStatusMap();
@@ -337,12 +329,6 @@
'aphront-panel-preview-loading-text',
pht('Loading preview...'))));
- $timeline = id(new PhabricatorApplicationTransactionView())
- ->setUser($user)
- ->setObjectPHID($task->getPHID())
- ->setTransactions($transactions)
- ->setMarkupEngine($engine);
-
$object_name = 'T'.$task->getID();
$actions = $this->buildActionView($task);

File Metadata

Mime Type
text/plain
Expires
Fri, Jan 24, 6:24 PM (16 h, 47 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7042450
Default Alt Text
D10844.id26031.diff (2 KB)

Event Timeline