Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/differential/xaction/DifferentialRevisionStatusTransaction.php b/src/applications/differential/xaction/DifferentialRevisionStatusTransaction.php
index 615ce38bcf..9c8b3767df 100644
--- a/src/applications/differential/xaction/DifferentialRevisionStatusTransaction.php
+++ b/src/applications/differential/xaction/DifferentialRevisionStatusTransaction.php
@@ -1,84 +1,84 @@
<?php
final class DifferentialRevisionStatusTransaction
extends DifferentialRevisionTransactionType {
const TRANSACTIONTYPE = 'differential.revision.status';
public function generateOldValue($object) {
return $object->getModernRevisionStatus();
}
public function applyInternalEffects($object, $value) {
$object->setModernRevisionStatus($value);
}
public function getTitle() {
$status = $this->newStatusObject();
if ($status->isAccepted()) {
return pht('This revision is now accepted and ready to land.');
}
if ($status->isNeedsRevision()) {
return pht('This revision now requires changes to proceed.');
}
if ($status->isNeedsReview()) {
return pht('This revision now requires review to proceed.');
}
return null;
}
public function getTitleForFeed() {
$status = $this->newStatusObject();
if ($status->isAccepted()) {
return pht(
'%s is now accepted and ready to land.',
$this->renderObject());
}
if ($status->isNeedsRevision()) {
return pht(
'%s now requires changes to proceed.',
$this->renderObject());
}
if ($status->isNeedsReview()) {
return pht(
'%s now requires review to proceed.',
$this->renderObject());
}
return null;
}
public function getIcon() {
$status = $this->newStatusObject();
return $status->getTimelineIcon();
}
public function getColor() {
$status = $this->newStatusObject();
return $status->getTimelineColor();
}
private function newStatusObject() {
$new = $this->getNewValue();
return DifferentialRevisionStatus::newForStatus($new);
}
public function getTransactionTypeForConduit($xaction) {
return 'status';
}
- public function getFieldValuesForConduit($object, $data) {
+ public function getFieldValuesForConduit($xaction, $data) {
return array(
- 'old' => $object->getOldValue(),
- 'new' => $object->getNewValue(),
+ 'old' => $xaction->getOldValue(),
+ 'new' => $xaction->getNewValue(),
);
}
}
diff --git a/src/applications/maniphest/xaction/ManiphestTaskDescriptionTransaction.php b/src/applications/maniphest/xaction/ManiphestTaskDescriptionTransaction.php
index 009327ed9b..fec1a87604 100644
--- a/src/applications/maniphest/xaction/ManiphestTaskDescriptionTransaction.php
+++ b/src/applications/maniphest/xaction/ManiphestTaskDescriptionTransaction.php
@@ -1,61 +1,71 @@
<?php
final class ManiphestTaskDescriptionTransaction
extends ManiphestTaskTransactionType {
const TRANSACTIONTYPE = 'description';
public function generateOldValue($object) {
return $object->getDescription();
}
public function applyInternalEffects($object, $value) {
$object->setDescription($value);
}
public function getActionName() {
return pht('Edited');
}
public function getTitle() {
return pht(
'%s updated the task description.',
$this->renderAuthor());
}
public function getTitleForFeed() {
return pht(
'%s updated the task description for %s.',
$this->renderAuthor(),
$this->renderObject());
}
public function hasChangeDetailView() {
return true;
}
public function getMailDiffSectionHeader() {
return pht('CHANGES TO TASK DESCRIPTION');
}
public function newChangeDetailView() {
$viewer = $this->getViewer();
return id(new PhabricatorApplicationTransactionTextDiffDetailView())
->setViewer($viewer)
->setOldText($this->getOldValue())
->setNewText($this->getNewValue());
}
public function newRemarkupChanges() {
$changes = array();
$changes[] = $this->newRemarkupChange()
->setOldValue($this->getOldValue())
->setNewValue($this->getNewValue());
return $changes;
}
+ public function getTransactionTypeForConduit($xaction) {
+ return 'description';
+ }
+
+ public function getFieldValuesForConduit($xaction, $data) {
+ return array(
+ 'old' => $xaction->getOldValue(),
+ 'new' => $xaction->getNewValue(),
+ );
+ }
}
diff --git a/src/applications/maniphest/xaction/ManiphestTaskOwnerTransaction.php b/src/applications/maniphest/xaction/ManiphestTaskOwnerTransaction.php
index d510fe8fbc..caaf84f542 100644
--- a/src/applications/maniphest/xaction/ManiphestTaskOwnerTransaction.php
+++ b/src/applications/maniphest/xaction/ManiphestTaskOwnerTransaction.php
@@ -1,158 +1,168 @@
<?php
final class ManiphestTaskOwnerTransaction
extends ManiphestTaskTransactionType {
const TRANSACTIONTYPE = 'reassign';
public function generateOldValue($object) {
return nonempty($object->getOwnerPHID(), null);
}
public function applyInternalEffects($object, $value) {
// Update the "ownerOrdering" column to contain the full name of the
// owner, if the task is assigned.
$handle = null;
if ($value) {
$handle = id(new PhabricatorHandleQuery())
->setViewer($this->getActor())
->withPHIDs(array($value))
->executeOne();
}
if ($handle) {
$object->setOwnerOrdering($handle->getName());
} else {
$object->setOwnerOrdering(null);
}
$object->setOwnerPHID($value);
}
public function getActionStrength() {
return 1.2;
}
public function getActionName() {
$old = $this->getOldValue();
$new = $this->getNewValue();
if ($this->getAuthorPHID() == $new) {
return pht('Claimed');
} else if (!$new) {
return pht('Unassigned');
} else if (!$old) {
return pht('Assigned');
} else {
return pht('Reassigned');
}
}
public function getTitle() {
$old = $this->getOldValue();
$new = $this->getNewValue();
if ($this->getAuthorPHID() == $new) {
return pht(
'%s claimed this task.',
$this->renderAuthor());
} else if (!$new) {
return pht(
'%s removed %s as the assignee of this task.',
$this->renderAuthor(),
$this->renderHandle($old));
} else if (!$old) {
return pht(
'%s assigned this task to %s.',
$this->renderAuthor(),
$this->renderHandle($new));
} else {
return pht(
'%s reassigned this task from %s to %s.',
$this->renderAuthor(),
$this->renderHandle($old),
$this->renderHandle($new));
}
}
public function getTitleForFeed() {
$old = $this->getOldValue();
$new = $this->getNewValue();
if ($this->getAuthorPHID() == $new) {
return pht(
'%s claimed %s.',
$this->renderAuthor(),
$this->renderObject());
} else if (!$new) {
return pht(
'%s placed %s up for grabs.',
$this->renderAuthor(),
$this->renderObject());
} else if (!$old) {
return pht(
'%s assigned %s to %s.',
$this->renderAuthor(),
$this->renderObject(),
$this->renderHandle($new));
} else {
return pht(
'%s reassigned %s from %s to %s.',
$this->renderAuthor(),
$this->renderObject(),
$this->renderHandle($old),
$this->renderHandle($new));
}
}
public function validateTransactions($object, array $xactions) {
$errors = array();
foreach ($xactions as $xaction) {
$old = $xaction->getOldValue();
$new = $xaction->getNewValue();
if (!strlen($new)) {
continue;
}
if ($new === $old) {
continue;
}
$assignee_list = id(new PhabricatorPeopleQuery())
->setViewer($this->getActor())
->withPHIDs(array($new))
->execute();
if (!$assignee_list) {
$errors[] = $this->newInvalidError(
pht('User "%s" is not a valid user.',
$new));
}
}
return $errors;
}
public function getIcon() {
return 'fa-user';
}
public function getColor() {
$old = $this->getOldValue();
$new = $this->getNewValue();
if ($this->getAuthorPHID() == $new) {
return 'green';
} else if (!$new) {
return 'black';
} else if (!$old) {
return 'green';
} else {
return 'green';
}
}
+ public function getTransactionTypeForConduit($xaction) {
+ return 'owner';
+ }
+
+ public function getFieldValuesForConduit($xaction, $data) {
+ return array(
+ 'old' => $xaction->getOldValue(),
+ 'new' => $xaction->getNewValue(),
+ );
+ }
}
diff --git a/src/applications/maniphest/xaction/ManiphestTaskPointsTransaction.php b/src/applications/maniphest/xaction/ManiphestTaskPointsTransaction.php
index 8953664f27..5a69199874 100644
--- a/src/applications/maniphest/xaction/ManiphestTaskPointsTransaction.php
+++ b/src/applications/maniphest/xaction/ManiphestTaskPointsTransaction.php
@@ -1,110 +1,122 @@
<?php
final class ManiphestTaskPointsTransaction
extends ManiphestTaskTransactionType {
const TRANSACTIONTYPE = 'points';
public function generateOldValue($object) {
return $this->getValueForPoints($object->getPoints());
}
public function generateNewValue($object, $value) {
return $this->getValueForPoints($value);
}
public function applyInternalEffects($object, $value) {
$object->setPoints($value);
}
public function shouldHide() {
if (!ManiphestTaskPoints::getIsEnabled()) {
return true;
}
return false;
}
public function getTitle() {
$old = $this->getOldValue();
$new = $this->getNewValue();
if ($old === null) {
return pht(
'%s set the point value for this task to %s.',
$this->renderAuthor(),
$this->renderNewValue());
} else if ($new === null) {
return pht(
'%s removed the point value for this task.',
$this->renderAuthor());
} else {
return pht(
'%s changed the point value for this task from %s to %s.',
$this->renderAuthor(),
$this->renderOldValue(),
$this->renderNewValue());
}
}
public function getTitleForFeed() {
$old = $this->getOldValue();
$new = $this->getNewValue();
if ($old === null) {
return pht(
'%s set the point value for %s to %s.',
$this->renderAuthor(),
$this->renderObject(),
$this->renderNewValue());
} else if ($new === null) {
return pht(
'%s removed the point value for %s.',
$this->renderAuthor(),
$this->renderObject());
} else {
return pht(
'%s changed the point value for %s from %s to %s.',
$this->renderAuthor(),
$this->renderObject(),
$this->renderOldValue(),
$this->renderNewValue());
}
}
public function validateTransactions($object, array $xactions) {
$errors = array();
foreach ($xactions as $xaction) {
$new = $xaction->getNewValue();
if (strlen($new) && !is_numeric($new)) {
$errors[] = $this->newInvalidError(
pht('Points value must be numeric or empty.'));
continue;
}
if ((double)$new < 0) {
$errors[] = $this->newInvalidError(
pht('Points value must be nonnegative.'));
continue;
}
}
return $errors;
}
public function getIcon() {
return 'fa-calculator';
}
private function getValueForPoints($value) {
if (!strlen($value)) {
$value = null;
}
if ($value !== null) {
$value = (double)$value;
}
return $value;
}
+ public function getTransactionTypeForConduit($xaction) {
+ return 'points';
+ }
+
+ public function getFieldValuesForConduit($xaction, $data) {
+ return array(
+ 'old' => $xaction->getOldValue(),
+ 'new' => $xaction->getNewValue(),
+ );
+ }
+
+
}
diff --git a/src/applications/maniphest/xaction/ManiphestTaskStatusTransaction.php b/src/applications/maniphest/xaction/ManiphestTaskStatusTransaction.php
index 5e1cd44611..a3780e81b9 100644
--- a/src/applications/maniphest/xaction/ManiphestTaskStatusTransaction.php
+++ b/src/applications/maniphest/xaction/ManiphestTaskStatusTransaction.php
@@ -1,232 +1,243 @@
<?php
final class ManiphestTaskStatusTransaction
extends ManiphestTaskTransactionType {
const TRANSACTIONTYPE = 'status';
public function generateOldValue($object) {
if ($this->isNewObject()) {
return null;
}
return $object->getStatus();
}
public function applyInternalEffects($object, $value) {
$object->setStatus($value);
}
public function shouldHide() {
if ($this->getOldValue() === null) {
return true;
} else {
return false;
}
}
public function getActionStrength() {
return 1.3;
}
public function getActionName() {
$old = $this->getOldValue();
$new = $this->getNewValue();
$action = ManiphestTaskStatus::getStatusActionName($new);
if ($action) {
return $action;
}
$old_closed = ManiphestTaskStatus::isClosedStatus($old);
$new_closed = ManiphestTaskStatus::isClosedStatus($new);
if ($new_closed && !$old_closed) {
return pht('Closed');
} else if (!$new_closed && $old_closed) {
return pht('Reopened');
} else {
return pht('Changed Status');
}
}
public function getTitle() {
$old = $this->getOldValue();
$new = $this->getNewValue();
$old_closed = ManiphestTaskStatus::isClosedStatus($old);
$new_closed = ManiphestTaskStatus::isClosedStatus($new);
$old_name = ManiphestTaskStatus::getTaskStatusName($old);
$new_name = ManiphestTaskStatus::getTaskStatusName($new);
$commit_phid = $this->getMetadataValue('commitPHID');
if ($new_closed && !$old_closed) {
if ($new == ManiphestTaskStatus::getDuplicateStatus()) {
if ($commit_phid) {
return pht(
'%s closed this task as a duplicate by committing %s.',
$this->renderAuthor(),
$this->renderHandle($commit_phid));
} else {
return pht(
'%s closed this task as a duplicate.',
$this->renderAuthor());
}
} else {
if ($commit_phid) {
return pht(
'%s closed this task as %s by committing %s.',
$this->renderAuthor(),
$this->renderValue($new_name),
$this->renderHandle($commit_phid));
} else {
return pht(
'%s closed this task as %s.',
$this->renderAuthor(),
$this->renderValue($new_name));
}
}
} else if (!$new_closed && $old_closed) {
if ($commit_phid) {
return pht(
'%s reopened this task as %s by committing %s.',
$this->renderAuthor(),
$this->renderValue($new_name),
$this->renderHandle($commit_phid));
} else {
return pht(
'%s reopened this task as %s.',
$this->renderAuthor(),
$this->renderValue($new_name));
}
} else {
if ($commit_phid) {
return pht(
'%s changed the task status from %s to %s by committing %s.',
$this->renderAuthor(),
$this->renderValue($old_name),
$this->renderValue($new_name),
$this->renderHandle($commit_phid));
} else {
return pht(
'%s changed the task status from %s to %s.',
$this->renderAuthor(),
$this->renderValue($old_name),
$this->renderValue($new_name));
}
}
}
public function getTitleForFeed() {
$old = $this->getOldValue();
$new = $this->getNewValue();
$old_closed = ManiphestTaskStatus::isClosedStatus($old);
$new_closed = ManiphestTaskStatus::isClosedStatus($new);
$old_name = ManiphestTaskStatus::getTaskStatusName($old);
$new_name = ManiphestTaskStatus::getTaskStatusName($new);
$commit_phid = $this->getMetadataValue('commitPHID');
if ($new_closed && !$old_closed) {
if ($new == ManiphestTaskStatus::getDuplicateStatus()) {
if ($commit_phid) {
return pht(
'%s closed %s as a duplicate by committing %s.',
$this->renderAuthor(),
$this->renderObject(),
$this->renderHandle($commit_phid));
} else {
return pht(
'%s closed %s as a duplicate.',
$this->renderAuthor(),
$this->renderObject());
}
} else {
if ($commit_phid) {
return pht(
'%s closed %s as %s by committing %s.',
$this->renderAuthor(),
$this->renderObject(),
$this->renderValue($new_name),
$this->renderHandle($commit_phid));
} else {
return pht(
'%s closed %s as %s.',
$this->renderAuthor(),
$this->renderObject(),
$this->renderValue($new_name));
}
}
} else if (!$new_closed && $old_closed) {
if ($commit_phid) {
return pht(
'%s reopened %s as %s by committing %s.',
$this->renderAuthor(),
$this->renderObject(),
$this->renderValue($new_name),
$this->renderHandle($commit_phid));
} else {
return pht(
'%s reopened %s as "%s".',
$this->renderAuthor(),
$this->renderObject(),
$new_name);
}
} else {
if ($commit_phid) {
return pht(
'%s changed the status of %s from %s to %s by committing %s.',
$this->renderAuthor(),
$this->renderObject(),
$this->renderValue($old_name),
$this->renderValue($new_name),
$this->renderHandle($commit_phid));
} else {
return pht(
'%s changed the status of %s from %s to %s.',
$this->renderAuthor(),
$this->renderObject(),
$this->renderValue($old_name),
$this->renderValue($new_name));
}
}
}
public function getIcon() {
$old = $this->getOldValue();
$new = $this->getNewValue();
$action = ManiphestTaskStatus::getStatusIcon($new);
if ($action !== null) {
return $action;
}
if (ManiphestTaskStatus::isClosedStatus($new)) {
return 'fa-check';
} else {
return 'fa-pencil';
}
}
public function getColor() {
$old = $this->getOldValue();
$new = $this->getNewValue();
$color = ManiphestTaskStatus::getStatusColor($new);
if ($color !== null) {
return $color;
}
if (ManiphestTaskStatus::isOpenStatus($new)) {
return 'green';
} else {
return 'indigo';
}
}
+ public function getTransactionTypeForConduit($xaction) {
+ return 'status';
+ }
+
+ public function getFieldValuesForConduit($xaction, $data) {
+ return array(
+ 'old' => $xaction->getOldValue(),
+ 'new' => $xaction->getNewValue(),
+ );
+ }
+
}
diff --git a/src/applications/maniphest/xaction/ManiphestTaskTitleTransaction.php b/src/applications/maniphest/xaction/ManiphestTaskTitleTransaction.php
index 506817b0fc..e4ec2a132f 100644
--- a/src/applications/maniphest/xaction/ManiphestTaskTitleTransaction.php
+++ b/src/applications/maniphest/xaction/ManiphestTaskTitleTransaction.php
@@ -1,75 +1,86 @@
<?php
final class ManiphestTaskTitleTransaction
extends ManiphestTaskTransactionType {
const TRANSACTIONTYPE = 'title';
public function generateOldValue($object) {
return $object->getTitle();
}
public function applyInternalEffects($object, $value) {
$object->setTitle($value);
}
public function getActionStrength() {
return 1.4;
}
public function getActionName() {
$old = $this->getOldValue();
if (!strlen($old)) {
return pht('Created');
}
return pht('Retitled');
}
public function getTitle() {
$old = $this->getOldValue();
if (!strlen($old)) {
return pht(
'%s created this task.',
$this->renderAuthor());
}
return pht(
'%s renamed this task from %s to %s.',
$this->renderAuthor(),
$this->renderOldValue(),
$this->renderNewValue());
}
public function getTitleForFeed() {
$old = $this->getOldValue();
if ($old === null) {
return pht(
'%s created %s.',
$this->renderAuthor(),
$this->renderObject());
}
return pht(
'%s renamed %s from %s to %s.',
$this->renderAuthor(),
$this->renderObject(),
$this->renderOldValue(),
$this->renderNewValue());
}
public function validateTransactions($object, array $xactions) {
$errors = array();
if ($this->isEmptyTextTransaction($object->getTitle(), $xactions)) {
$errors[] = $this->newRequiredError(
pht('Tasks must have a title.'));
}
return $errors;
}
+ public function getTransactionTypeForConduit($xaction) {
+ return 'title';
+ }
+
+ public function getFieldValuesForConduit($xaction, $data) {
+ return array(
+ 'old' => $xaction->getOldValue(),
+ 'new' => $xaction->getNewValue(),
+ );
+ }
+
}

File Metadata

Mime Type
text/x-diff
Expires
Wed, Apr 30, 2:33 AM (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
108523
Default Alt Text
(21 KB)

Event Timeline