diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -4551,6 +4551,7 @@ 'PhabricatorConfigEditor' => 'PhabricatorApplicationTransactionEditor', 'PhabricatorConfigEntry' => array( 'PhabricatorConfigEntryDAO', + 'PhabricatorApplicationTransactionInterface', 'PhabricatorPolicyInterface', ), 'PhabricatorConfigEntryDAO' => 'PhabricatorLiskDAO', @@ -5212,6 +5213,7 @@ 'PhabricatorPonderApplication' => 'PhabricatorApplication', 'PhabricatorProject' => array( 'PhabricatorProjectDAO', + 'PhabricatorApplicationTransactionInterface', 'PhabricatorFlaggableInterface', 'PhabricatorPolicyInterface', 'PhabricatorSubscribableInterface', @@ -5226,6 +5228,7 @@ 'PhabricatorProjectBoardViewController' => 'PhabricatorProjectBoardController', 'PhabricatorProjectColumn' => array( 'PhabricatorProjectDAO', + 'PhabricatorApplicationTransactionInterface', 'PhabricatorPolicyInterface', 'PhabricatorDestructibleInterface', ), diff --git a/src/applications/config/controller/PhabricatorConfigEditController.php b/src/applications/config/controller/PhabricatorConfigEditController.php --- a/src/applications/config/controller/PhabricatorConfigEditController.php +++ b/src/applications/config/controller/PhabricatorConfigEditController.php @@ -214,21 +214,16 @@ $crumbs->addTextCrumb($this->key, '/config/edit/'.$this->key); - $xactions = id(new PhabricatorConfigTransactionQuery()) - ->withObjectPHIDs(array($config_entry->getPHID())) - ->setViewer($user) - ->execute(); - - $xaction_view = id(new PhabricatorApplicationTransactionView()) - ->setUser($user) - ->setObjectPHID($config_entry->getPHID()) - ->setTransactions($xactions); + $timeline = $this->buildTransactionTimeline( + $config_entry, + new PhabricatorConfigTransactionQuery()); + $timeline->setShouldTerminate(true); return $this->buildApplicationPage( array( $crumbs, $form_box, - $xaction_view, + $timeline, ), array( 'title' => $title, diff --git a/src/applications/config/storage/PhabricatorConfigEntry.php b/src/applications/config/storage/PhabricatorConfigEntry.php --- a/src/applications/config/storage/PhabricatorConfigEntry.php +++ b/src/applications/config/storage/PhabricatorConfigEntry.php @@ -1,7 +1,10 @@ setViewer($user) - ->withObjectPHIDs(array($mock->getPHID())) - ->execute(); - $phids = PhabricatorEdgeQuery::loadDestinationPHIDs( $mock->getPHID(), PhabricatorEdgeConfig::TYPE_MOCK_HAS_TASK); @@ -53,14 +48,6 @@ $engine = id(new PhabricatorMarkupEngine()) ->setViewer($user); $engine->addObject($mock, PholioMock::MARKUP_FIELD_DESCRIPTION); - foreach ($xactions as $xaction) { - if ($xaction->getComment()) { - $engine->addObject( - $xaction->getComment(), - PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT); - } - } - $engine->process(); $title = $mock->getName(); @@ -80,6 +67,12 @@ ->setStatus($header_icon, $header_color, $header_name) ->setPolicyObject($mock); + $timeline = $this->buildTransactionTimeline( + $mock, + new PholioTransactionQuery(), + $engine); + $timeline->setMock($mock); + $actions = $this->buildActionView($mock); $properties = $this->buildPropertyView($mock, $engine, $actions); @@ -98,13 +91,6 @@ ->setHeaderText(pht('Image')) ->appendChild($output); - $xaction_view = id(new PholioTransactionView()) - ->setUser($this->getRequest()->getUser()) - ->setMock($mock) - ->setObjectPHID($mock->getPHID()) - ->setTransactions($xactions) - ->setMarkupEngine($engine); - $add_comment = $this->buildAddCommentView($mock, $comment_form_id); $crumbs = $this->buildApplicationCrumbs(); @@ -124,7 +110,7 @@ $object_box, $output, $thumb_grid, - $xaction_view, + $timeline, $add_comment, ); diff --git a/src/applications/project/controller/PhabricatorProjectColumnDetailController.php b/src/applications/project/controller/PhabricatorProjectColumnDetailController.php --- a/src/applications/project/controller/PhabricatorProjectColumnDetailController.php +++ b/src/applications/project/controller/PhabricatorProjectColumnDetailController.php @@ -41,18 +41,10 @@ return new Aphront404Response(); } - $xactions = id(new PhabricatorProjectColumnTransactionQuery()) - ->setViewer($viewer) - ->withObjectPHIDs(array($column->getPHID())) - ->execute(); - - $engine = id(new PhabricatorMarkupEngine()) - ->setViewer($viewer); - - $timeline = id(new PhabricatorApplicationTransactionView()) - ->setUser($viewer) - ->setObjectPHID($column->getPHID()) - ->setTransactions($xactions); + $timeline = $this->buildTransactionTimeline( + $column, + new PhabricatorProjectColumnTransactionQuery()); + $timeline->setShouldTerminate(true); $title = pht('%s', $column->getDisplayName()); $crumbs = $this->buildApplicationCrumbs(); diff --git a/src/applications/project/controller/PhabricatorProjectEditMainController.php b/src/applications/project/controller/PhabricatorProjectEditMainController.php --- a/src/applications/project/controller/PhabricatorProjectEditMainController.php +++ b/src/applications/project/controller/PhabricatorProjectEditMainController.php @@ -48,16 +48,10 @@ ->setHeader($header) ->addPropertyList($properties); - $xactions = id(new PhabricatorProjectTransactionQuery()) - ->setViewer($viewer) - ->withObjectPHIDs(array($project->getPHID())) - ->execute(); - - $timeline = id(new PhabricatorApplicationTransactionView()) - ->setUser($viewer) - ->setObjectPHID($project->getPHID()) - ->setShouldTerminate(true) - ->setTransactions($xactions); + $timeline = $this->buildTransactionTimeline( + $project, + new PhabricatorProjectTransactionQuery()); + $timeline->setShouldTerminate(true); return $this->buildApplicationPage( array( diff --git a/src/applications/project/storage/PhabricatorProject.php b/src/applications/project/storage/PhabricatorProject.php --- a/src/applications/project/storage/PhabricatorProject.php +++ b/src/applications/project/storage/PhabricatorProject.php @@ -2,6 +2,7 @@ final class PhabricatorProject extends PhabricatorProjectDAO implements + PhabricatorApplicationTransactionInterface, PhabricatorFlaggableInterface, PhabricatorPolicyInterface, PhabricatorSubscribableInterface, @@ -359,6 +360,22 @@ } +/* -( PhabricatorApplicationTransactionInterface )------------------------- */ + + + public function getApplicationTransactionEditor() { + return new PhabricatorProjectTransactionEditor(); + } + + public function getApplicationTransactionObject() { + return $this; + } + + public function getApplicationTransactionTemplate() { + return new PhabricatorProjectTransaction(); + } + + /* -( PhabricatorDestructibleInterface )----------------------------------- */ public function destroyObjectPermanently( diff --git a/src/applications/project/storage/PhabricatorProjectColumn.php b/src/applications/project/storage/PhabricatorProjectColumn.php --- a/src/applications/project/storage/PhabricatorProjectColumn.php +++ b/src/applications/project/storage/PhabricatorProjectColumn.php @@ -3,6 +3,7 @@ final class PhabricatorProjectColumn extends PhabricatorProjectDAO implements + PhabricatorApplicationTransactionInterface, PhabricatorPolicyInterface, PhabricatorDestructibleInterface { @@ -135,6 +136,22 @@ } +/* -( PhabricatorApplicationTransactionInterface )------------------------- */ + + + public function getApplicationTransactionEditor() { + return new PhabricatorProjectColumnTransactionEditor(); + } + + public function getApplicationTransactionObject() { + return $this; + } + + public function getApplicationTransactionTemplate() { + return new PhabricatorProjectColumnTransaction(); + } + + /* -( PhabricatorPolicyInterface )----------------------------------------- */