3 final class DifferentialRevisionRejectTransaction
4 extends DifferentialRevisionReviewTransaction
{
6 const TRANSACTIONTYPE
= 'differential.revision.reject';
7 const ACTIONKEY
= 'reject';
9 protected function getRevisionActionLabel(
10 DifferentialRevision
$revision,
11 PhabricatorUser
$viewer) {
12 return pht('Request Changes');
15 protected function getRevisionActionDescription(
16 DifferentialRevision
$revision,
17 PhabricatorUser
$viewer) {
18 return pht('This revision will be returned to the author for updates.');
21 public function getIcon() {
22 return 'fa-times-circle-o';
25 public function getColor() {
29 protected function getRevisionActionOrder() {
33 public function getActionName() {
34 return pht('Requested Changes');
37 public function getCommandKeyword() {
41 public function getCommandAliases() {
47 public function getCommandSummary() {
48 return pht('Request changes to a revision.');
51 public function generateOldValue($object) {
52 $actor = $this->getActor();
53 return $this->isViewerFullyRejected($object, $actor);
56 public function applyExternalEffects($object, $value) {
57 $status = DifferentialReviewerStatus
::STATUS_REJECTED
;
58 $actor = $this->getActor();
59 $this->applyReviewerEffect($object, $actor, $value, $status);
62 protected function validateAction($object, PhabricatorUser
$viewer) {
63 if ($object->isClosed()) {
66 'You can not request changes to this revision because it has '.
67 'already been closed. You can only request changes to open '.
71 if ($this->isViewerRevisionAuthor($object, $viewer)) {
74 'You can not request changes to this revision because you are the '.
75 'revision author. You can only request changes to revisions you do '.
79 if ($object->isDraft() ||
!$object->getShouldBroadcast()) {
81 pht('You can not request changes to a draft revision.'));
84 if ($this->isViewerFullyRejected($object, $viewer)) {
87 'You can not request changes to this revision because you have '.
88 'already requested changes.'));
92 public function getTitle() {
94 '%s requested changes to this revision.',
95 $this->renderAuthor());
98 public function getTitleForFeed() {
100 '%s requested changes to %s.',
101 $this->renderAuthor(),
102 $this->renderObject());
105 public function getTransactionTypeForConduit($xaction) {
106 return 'request-changes';
109 public function getFieldValuesForConduit($object, $data) {