Page MenuHomePhabricator

D10924.diff
No OneTemporary

D10924.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
@@ -3649,6 +3649,7 @@
'DrydockApacheWebrootInterface' => 'DrydockWebrootInterface',
'DrydockBlueprint' => array(
'DrydockDAO',
+ 'PhabricatorApplicationTransactionInterface',
'PhabricatorPolicyInterface',
'PhabricatorCustomFieldInterface',
),
@@ -4240,6 +4241,7 @@
'PassphraseController' => 'PhabricatorController',
'PassphraseCredential' => array(
'PassphraseDAO',
+ 'PhabricatorApplicationTransactionInterface',
'PhabricatorPolicyInterface',
'PhabricatorDestructibleInterface',
),
@@ -4657,6 +4659,7 @@
'PhabricatorDaemonsApplication' => 'PhabricatorApplication',
'PhabricatorDashboard' => array(
'PhabricatorDashboardDAO',
+ 'PhabricatorApplicationTransactionInterface',
'PhabricatorPolicyInterface',
'PhabricatorDestructibleInterface',
),
@@ -4675,6 +4678,7 @@
'PhabricatorDashboardMovePanelController' => 'PhabricatorDashboardController',
'PhabricatorDashboardPanel' => array(
'PhabricatorDashboardDAO',
+ 'PhabricatorApplicationTransactionInterface',
'PhabricatorPolicyInterface',
'PhabricatorCustomFieldInterface',
'PhabricatorDestructibleInterface',
@@ -4808,6 +4812,7 @@
'PhabricatorFeedStoryTypeConstants' => 'PhabricatorFeedConstants',
'PhabricatorFile' => array(
'PhabricatorFileDAO',
+ 'PhabricatorApplicationTransactionInterface',
'PhabricatorTokenReceiverInterface',
'PhabricatorSubscribableInterface',
'PhabricatorFlaggableInterface',
@@ -5773,6 +5778,7 @@
'PhluxTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
'PhluxVariable' => array(
'PhluxDAO',
+ 'PhabricatorApplicationTransactionInterface',
'PhabricatorFlaggableInterface',
'PhabricatorPolicyInterface',
),
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardHistoryController.php b/src/applications/dashboard/controller/PhabricatorDashboardHistoryController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardHistoryController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardHistoryController.php
@@ -35,7 +35,10 @@
$dashboard_manage_uri);
$crumbs->addTextCrumb(pht('History'));
- $timeline = $this->buildTransactions($dashboard);
+ $timeline = $this->buildTransactionTimeline(
+ $dashboard,
+ new PhabricatorDashboardTransactionQuery());
+ $timeline->setShouldTerminate(true);
return $this->buildApplicationPage(
array(
@@ -47,21 +50,4 @@
));
}
- private function buildTransactions(PhabricatorDashboard $dashboard) {
- $viewer = $this->getRequest()->getUser();
-
- $xactions = id(new PhabricatorDashboardTransactionQuery())
- ->setViewer($viewer)
- ->withObjectPHIDs(array($dashboard->getPHID()))
- ->execute();
-
- $timeline = id(new PhabricatorApplicationTransactionView())
- ->setUser($viewer)
- ->setShouldTerminate(true)
- ->setObjectPHID($dashboard->getPHID())
- ->setTransactions($xactions);
-
- return $timeline;
- }
-
}
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardPanelViewController.php b/src/applications/dashboard/controller/PhabricatorDashboardPanelViewController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardPanelViewController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardPanelViewController.php
@@ -35,7 +35,10 @@
$header = $this->buildHeaderView($panel);
$actions = $this->buildActionView($panel);
$properties = $this->buildPropertyView($panel);
- $timeline = $this->buildTransactions($panel);
+ $timeline = $this->buildTransactionTimeline(
+ $panel,
+ new PhabricatorDashboardPanelTransactionQuery());
+ $timeline->setShouldTerminate(true);
$properties->setActionList($actions);
$box = id(new PHUIObjectBoxView())
@@ -167,24 +170,4 @@
return $properties;
}
- private function buildTransactions(PhabricatorDashboardPanel $panel) {
- $viewer = $this->getRequest()->getUser();
-
- $xactions = id(new PhabricatorDashboardPanelTransactionQuery())
- ->setViewer($viewer)
- ->withObjectPHIDs(array($panel->getPHID()))
- ->execute();
-
- $engine = id(new PhabricatorMarkupEngine())
- ->setViewer($viewer);
-
- $timeline = id(new PhabricatorApplicationTransactionView())
- ->setUser($viewer)
- ->setShouldTerminate(true)
- ->setObjectPHID($panel->getPHID())
- ->setTransactions($xactions);
-
- return $timeline;
- }
-
}
diff --git a/src/applications/dashboard/storage/PhabricatorDashboard.php b/src/applications/dashboard/storage/PhabricatorDashboard.php
--- a/src/applications/dashboard/storage/PhabricatorDashboard.php
+++ b/src/applications/dashboard/storage/PhabricatorDashboard.php
@@ -5,6 +5,7 @@
*/
final class PhabricatorDashboard extends PhabricatorDashboardDAO
implements
+ PhabricatorApplicationTransactionInterface,
PhabricatorPolicyInterface,
PhabricatorDestructibleInterface {
@@ -83,6 +84,22 @@
}
+/* -( PhabricatorApplicationTransactionInterface )------------------------- */
+
+
+ public function getApplicationTransactionEditor() {
+ return new PhabricatorDashboardTransactionEditor();
+ }
+
+ public function getApplicationTransactionObject() {
+ return $this;
+ }
+
+ public function getApplicationTransactionTemplate() {
+ return new PhabricatorDashboardTransaction();
+ }
+
+
/* -( PhabricatorPolicyInterface )----------------------------------------- */
diff --git a/src/applications/dashboard/storage/PhabricatorDashboardPanel.php b/src/applications/dashboard/storage/PhabricatorDashboardPanel.php
--- a/src/applications/dashboard/storage/PhabricatorDashboardPanel.php
+++ b/src/applications/dashboard/storage/PhabricatorDashboardPanel.php
@@ -6,6 +6,7 @@
final class PhabricatorDashboardPanel
extends PhabricatorDashboardDAO
implements
+ PhabricatorApplicationTransactionInterface,
PhabricatorPolicyInterface,
PhabricatorCustomFieldInterface,
PhabricatorDestructibleInterface {
@@ -89,6 +90,22 @@
}
+/* -( PhabricatorApplicationTransactionInterface )------------------------- */
+
+
+ public function getApplicationTransactionEditor() {
+ return new PhabricatorDashboardPanelTransactionEditor();
+ }
+
+ public function getApplicationTransactionObject() {
+ return $this;
+ }
+
+ public function getApplicationTransactionTemplate() {
+ return new PhabricatorDashboardPanelTransaction();
+ }
+
+
/* -( PhabricatorPolicyInterface )----------------------------------------- */
diff --git a/src/applications/drydock/controller/DrydockBlueprintViewController.php b/src/applications/drydock/controller/DrydockBlueprintViewController.php
--- a/src/applications/drydock/controller/DrydockBlueprintViewController.php
+++ b/src/applications/drydock/controller/DrydockBlueprintViewController.php
@@ -56,11 +56,6 @@
->setHeader($header)
->addPropertyList($properties);
- $xactions = id(new DrydockBlueprintTransactionQuery())
- ->setViewer($viewer)
- ->withObjectPHIDs(array($blueprint->getPHID()))
- ->execute();
-
$field_list = PhabricatorCustomField::getObjectFields(
$blueprint,
PhabricatorCustomField::ROLE_VIEW);
@@ -73,14 +68,10 @@
$viewer,
$properties);
- $engine = id(new PhabricatorMarkupEngine())
- ->setViewer($viewer);
-
- $timeline = id(new PhabricatorApplicationTransactionView())
- ->setUser($viewer)
- ->setObjectPHID($blueprint->getPHID())
- ->setTransactions($xactions)
- ->setMarkupEngine($engine);
+ $timeline = $this->buildTransactionTimeline(
+ $blueprint,
+ new DrydockBlueprintTransactionQuery());
+ $timeline->setShouldTerminate(true);
return $this->buildApplicationPage(
array(
diff --git a/src/applications/drydock/storage/DrydockBlueprint.php b/src/applications/drydock/storage/DrydockBlueprint.php
--- a/src/applications/drydock/storage/DrydockBlueprint.php
+++ b/src/applications/drydock/storage/DrydockBlueprint.php
@@ -2,6 +2,7 @@
final class DrydockBlueprint extends DrydockDAO
implements
+ PhabricatorApplicationTransactionInterface,
PhabricatorPolicyInterface,
PhabricatorCustomFieldInterface {
@@ -75,6 +76,22 @@
}
+/* -( PhabricatorApplicationTransactionInterface )------------------------- */
+
+
+ public function getApplicationTransactionEditor() {
+ return new DrydockBlueprintEditor();
+ }
+
+ public function getApplicationTransactionObject() {
+ return $this;
+ }
+
+ public function getApplicationTransactionTemplate() {
+ return new DrydockBlueprintTransaction();
+ }
+
+
/* -( PhabricatorPolicyInterface )----------------------------------------- */
diff --git a/src/applications/files/controller/PhabricatorFileInfoController.php b/src/applications/files/controller/PhabricatorFileInfoController.php
--- a/src/applications/files/controller/PhabricatorFileInfoController.php
+++ b/src/applications/files/controller/PhabricatorFileInfoController.php
@@ -38,10 +38,6 @@
}
$phid = $file->getPHID();
- $xactions = id(new PhabricatorFileTransactionQuery())
- ->setViewer($user)
- ->withObjectPHIDs(array($phid))
- ->execute();
$handle_phids = array_merge(
array($file->getAuthorPHID()),
@@ -62,7 +58,7 @@
}
$actions = $this->buildActionView($file);
- $timeline = $this->buildTransactionView($file, $xactions);
+ $timeline = $this->buildTransactionView($file);
$crumbs = $this->buildApplicationCrumbs();
$crumbs->setActionList($actions);
$crumbs->addTextCrumb(
@@ -86,27 +82,12 @@
));
}
- private function buildTransactionView(
- PhabricatorFile $file,
- array $xactions) {
-
+ private function buildTransactionView(PhabricatorFile $file) {
$user = $this->getRequest()->getUser();
- $engine = id(new PhabricatorMarkupEngine())
- ->setViewer($user);
- foreach ($xactions as $xaction) {
- if ($xaction->getComment()) {
- $engine->addObject(
- $xaction->getComment(),
- PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT);
- }
- }
- $engine->process();
- $timeline = id(new PhabricatorApplicationTransactionView())
- ->setUser($user)
- ->setObjectPHID($file->getPHID())
- ->setTransactions($xactions)
- ->setMarkupEngine($engine);
+ $timeline = $this->buildTransactionTimeline(
+ $file,
+ new PhabricatorFileTransactionQuery());
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php
--- a/src/applications/files/storage/PhabricatorFile.php
+++ b/src/applications/files/storage/PhabricatorFile.php
@@ -18,6 +18,7 @@
*/
final class PhabricatorFile extends PhabricatorFileDAO
implements
+ PhabricatorApplicationTransactionInterface,
PhabricatorTokenReceiverInterface,
PhabricatorSubscribableInterface,
PhabricatorFlaggableInterface,
@@ -1079,6 +1080,22 @@
}
+/* -( PhabricatorApplicationTransactionInterface )------------------------- */
+
+
+ public function getApplicationTransactionEditor() {
+ return new PhabricatorFileEditor();
+ }
+
+ public function getApplicationTransactionObject() {
+ return $this;
+ }
+
+ public function getApplicationTransactionTemplate() {
+ return new PhabricatorFileTransaction();
+ }
+
+
/* -( PhabricatorPolicyInterface Implementation )-------------------------- */
diff --git a/src/applications/macro/controller/PhabricatorMacroViewController.php b/src/applications/macro/controller/PhabricatorMacroViewController.php
--- a/src/applications/macro/controller/PhabricatorMacroViewController.php
+++ b/src/applications/macro/controller/PhabricatorMacroViewController.php
@@ -51,27 +51,9 @@
)));
}
- $xactions = id(new PhabricatorMacroTransactionQuery())
- ->setViewer($request->getUser())
- ->withObjectPHIDs(array($macro->getPHID()))
- ->execute();
-
- $engine = id(new PhabricatorMarkupEngine())
- ->setViewer($user);
- foreach ($xactions as $xaction) {
- if ($xaction->getComment()) {
- $engine->addObject(
- $xaction->getComment(),
- PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT);
- }
- }
- $engine->process();
-
- $timeline = id(new PhabricatorApplicationTransactionView())
- ->setUser($user)
- ->setObjectPHID($macro->getPHID())
- ->setTransactions($xactions)
- ->setMarkupEngine($engine);
+ $timeline = $this->buildTransactionTimeline(
+ $macro,
+ new PhabricatorMacroTransactionQuery());
$header = id(new PHUIHeaderView())
->setUser($user)
diff --git a/src/applications/passphrase/controller/PassphraseCredentialViewController.php b/src/applications/passphrase/controller/PassphraseCredentialViewController.php
--- a/src/applications/passphrase/controller/PassphraseCredentialViewController.php
+++ b/src/applications/passphrase/controller/PassphraseCredentialViewController.php
@@ -26,18 +26,10 @@
throw new Exception(pht('Credential has invalid type "%s"!', $type));
}
- $xactions = id(new PassphraseCredentialTransactionQuery())
- ->setViewer($viewer)
- ->withObjectPHIDs(array($credential->getPHID()))
- ->execute();
-
- $engine = id(new PhabricatorMarkupEngine())
- ->setViewer($viewer);
-
- $timeline = id(new PhabricatorApplicationTransactionView())
- ->setUser($viewer)
- ->setObjectPHID($credential->getPHID())
- ->setTransactions($xactions);
+ $timeline = $this->buildTransactionTimeline(
+ $credential,
+ new PassphraseCredentialTransactionQuery());
+ $timeline->setShouldTerminate(true);
$title = pht('%s %s', 'K'.$credential->getID(), $credential->getName());
$crumbs = $this->buildApplicationCrumbs();
diff --git a/src/applications/passphrase/storage/PassphraseCredential.php b/src/applications/passphrase/storage/PassphraseCredential.php
--- a/src/applications/passphrase/storage/PassphraseCredential.php
+++ b/src/applications/passphrase/storage/PassphraseCredential.php
@@ -1,8 +1,10 @@
<?php
final class PassphraseCredential extends PassphraseDAO
- implements PhabricatorPolicyInterface,
- PhabricatorDestructibleInterface {
+ implements
+ PhabricatorApplicationTransactionInterface,
+ PhabricatorPolicyInterface,
+ PhabricatorDestructibleInterface {
protected $name;
protected $credentialType;
@@ -81,6 +83,22 @@
}
+/* -( PhabricatorApplicationTransactionInterface )------------------------- */
+
+
+ public function getApplicationTransactionEditor() {
+ return new PassphraseCredentialTransactionEditor();
+ }
+
+ public function getApplicationTransactionObject() {
+ return $this;
+ }
+
+ public function getApplicationTransactionTemplate() {
+ return new PassphraseCredentialTransaction();
+ }
+
+
/* -( PhabricatorPolicyInterface )----------------------------------------- */
diff --git a/src/applications/paste/controller/PhabricatorPasteViewController.php b/src/applications/paste/controller/PhabricatorPasteViewController.php
--- a/src/applications/paste/controller/PhabricatorPasteViewController.php
+++ b/src/applications/paste/controller/PhabricatorPasteViewController.php
@@ -90,27 +90,9 @@
->setActionList($actions)
->addTextCrumb('P'.$paste->getID(), '/P'.$paste->getID());
- $xactions = id(new PhabricatorPasteTransactionQuery())
- ->setViewer($request->getUser())
- ->withObjectPHIDs(array($paste->getPHID()))
- ->execute();
-
- $engine = id(new PhabricatorMarkupEngine())
- ->setViewer($user);
- foreach ($xactions as $xaction) {
- if ($xaction->getComment()) {
- $engine->addObject(
- $xaction->getComment(),
- PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT);
- }
- }
- $engine->process();
-
- $timeline = id(new PhabricatorApplicationTransactionView())
- ->setUser($user)
- ->setObjectPHID($paste->getPHID())
- ->setTransactions($xactions)
- ->setMarkupEngine($engine);
+ $timeline = $this->buildTransactionTimeline(
+ $paste,
+ new PhabricatorPasteTransactionQuery());
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
diff --git a/src/applications/phlux/controller/PhluxViewController.php b/src/applications/phlux/controller/PhluxViewController.php
--- a/src/applications/phlux/controller/PhluxViewController.php
+++ b/src/applications/phlux/controller/PhluxViewController.php
@@ -58,19 +58,10 @@
->setActionList($actions)
->addProperty(pht('Value'), $display_value);
- $xactions = id(new PhluxTransactionQuery())
- ->setViewer($user)
- ->withObjectPHIDs(array($var->getPHID()))
- ->execute();
-
- $engine = id(new PhabricatorMarkupEngine())
- ->setViewer($user);
-
- $xaction_view = id(new PhabricatorApplicationTransactionView())
- ->setUser($user)
- ->setObjectPHID($var->getPHID())
- ->setTransactions($xactions)
- ->setMarkupEngine($engine);
+ $timeline = $this->buildTransactionTimeline(
+ $var,
+ new PhluxTransactionQuery());
+ $timeline->setShouldTerminate(true);
$object_box = id(new PHUIObjectBoxView())
->setHeader($header)
@@ -80,7 +71,7 @@
array(
$crumbs,
$object_box,
- $xaction_view,
+ $timeline,
),
array(
'title' => $title,
diff --git a/src/applications/phlux/storage/PhluxVariable.php b/src/applications/phlux/storage/PhluxVariable.php
--- a/src/applications/phlux/storage/PhluxVariable.php
+++ b/src/applications/phlux/storage/PhluxVariable.php
@@ -2,6 +2,7 @@
final class PhluxVariable extends PhluxDAO
implements
+ PhabricatorApplicationTransactionInterface,
PhabricatorFlaggableInterface,
PhabricatorPolicyInterface {
@@ -33,6 +34,22 @@
}
+/* -( PhabricatorApplicationTransactionInterface )------------------------- */
+
+
+ public function getApplicationTransactionEditor() {
+ return new PhluxVariableEditor();
+ }
+
+ public function getApplicationTransactionObject() {
+ return $this;
+ }
+
+ public function getApplicationTransactionTemplate() {
+ return new PhluxTransaction();
+ }
+
+
/* -( PhabricatorPolicyInterface )----------------------------------------- */

File Metadata

Mime Type
text/plain
Expires
May 20 2024, 4:26 AM (8 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6277669
Default Alt Text
D10924.diff (18 KB)

Event Timeline