Page MenuHomePhabricator

D10923.id26239.diff
No OneTemporary

D10923.id26239.diff

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 @@
<?php
-final class PhabricatorConfigEntry extends PhabricatorConfigEntryDAO
- implements PhabricatorPolicyInterface {
+final class PhabricatorConfigEntry
+ extends PhabricatorConfigEntryDAO
+ implements
+ PhabricatorApplicationTransactionInterface,
+ PhabricatorPolicyInterface {
protected $namespace;
protected $configKey;
@@ -50,6 +53,22 @@
}
+/* -( PhabricatorApplicationTransactionInterface )------------------------- */
+
+
+ public function getApplicationTransactionEditor() {
+ return new PhabricatorConfigEditor();
+ }
+
+ public function getApplicationTransactionObject() {
+ return $this;
+ }
+
+ public function getApplicationTransactionTemplate() {
+ return new PhabricatorConfigTransaction();
+ }
+
+
/* -( PhabricatorPolicyInterface )----------------------------------------- */
diff --git a/src/applications/pholio/controller/PholioMockViewController.php b/src/applications/pholio/controller/PholioMockViewController.php
--- a/src/applications/pholio/controller/PholioMockViewController.php
+++ b/src/applications/pholio/controller/PholioMockViewController.php
@@ -38,11 +38,6 @@
return new Aphront404Response();
}
- $xactions = id(new PholioTransactionQuery())
- ->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 )----------------------------------------- */

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 22, 1:23 AM (2 d, 11 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7475708
Default Alt Text
D10923.id26239.diff (9 KB)

Event Timeline