Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/storage/DifferentialTransaction.php
| Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | switch ($this->getTransactionType()) { | ||||
| case self::TYPE_UPDATE: | case self::TYPE_UPDATE: | ||||
| $old = $this->getOldValue(); | $old = $this->getOldValue(); | ||||
| if ($old === null) { | if ($old === null) { | ||||
| $tags[] = self::MAILTAG_REVIEW_REQUEST; | $tags[] = self::MAILTAG_REVIEW_REQUEST; | ||||
| } else { | } else { | ||||
| $tags[] = self::MAILTAG_UPDATED; | $tags[] = self::MAILTAG_UPDATED; | ||||
| } | } | ||||
| break; | break; | ||||
| case PhabricatorTransactions::TYPE_EDGE: | |||||
| switch ($this->getMetadataValue('edge:type')) { | |||||
| case DifferentialRevisionHasReviewerEdgeType::EDGECONST: | |||||
| $tags[] = self::MAILTAG_REVIEWERS; | |||||
| break; | |||||
| } | |||||
| break; | |||||
| case PhabricatorTransactions::TYPE_COMMENT: | case PhabricatorTransactions::TYPE_COMMENT: | ||||
| case self::TYPE_INLINE: | case self::TYPE_INLINE: | ||||
| $tags[] = self::MAILTAG_COMMENT; | $tags[] = self::MAILTAG_COMMENT; | ||||
| break; | break; | ||||
| case DifferentialRevisionReviewersTransaction::TRANSACTIONTYPE: | case DifferentialRevisionReviewersTransaction::TRANSACTIONTYPE: | ||||
| $tags[] = self::MAILTAG_REVIEWERS; | $tags[] = self::MAILTAG_REVIEWERS; | ||||
| break; | break; | ||||
| case DifferentialRevisionCloseTransaction::TRANSACTIONTYPE: | case DifferentialRevisionCloseTransaction::TRANSACTIONTYPE: | ||||
| ▲ Show 20 Lines • Show All 363 Lines • ▼ Show 20 Lines | public function getColor() { | ||||
| } | } | ||||
| return parent::getColor(); | return parent::getColor(); | ||||
| } | } | ||||
| public function getNoEffectDescription() { | public function getNoEffectDescription() { | ||||
| switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
| case PhabricatorTransactions::TYPE_EDGE: | |||||
| switch ($this->getMetadataValue('edge:type')) { | |||||
| case DifferentialRevisionHasReviewerEdgeType::EDGECONST: | |||||
| return pht( | |||||
| 'The reviewers you are trying to add are already reviewing '. | |||||
| 'this revision.'); | |||||
| } | |||||
| break; | |||||
| case self::TYPE_ACTION: | case self::TYPE_ACTION: | ||||
| switch ($this->getNewValue()) { | switch ($this->getNewValue()) { | ||||
| case DifferentialAction::ACTION_CLOSE: | case DifferentialAction::ACTION_CLOSE: | ||||
| return pht('This revision is already closed.'); | return pht('This revision is already closed.'); | ||||
| case DifferentialAction::ACTION_ABANDON: | case DifferentialAction::ACTION_ABANDON: | ||||
| return pht('This revision has already been abandoned.'); | return pht('This revision has already been abandoned.'); | ||||
| case DifferentialAction::ACTION_RECLAIM: | case DifferentialAction::ACTION_RECLAIM: | ||||
| return pht( | return pht( | ||||
| 'You can not reclaim this revision because his revision is '. | 'You can not reclaim this revision because his revision is '. | ||||
| 'not abandoned.'); | 'not abandoned.'); | ||||
| case DifferentialAction::ACTION_REOPEN: | case DifferentialAction::ACTION_REOPEN: | ||||
| return pht( | return pht( | ||||
| 'You can not reopen this revision because this revision is '. | 'You can not reopen this revision because this revision is '. | ||||
| 'not closed.'); | 'not closed.'); | ||||
| case DifferentialAction::ACTION_RETHINK: | case DifferentialAction::ACTION_RETHINK: | ||||
| return pht('This revision already requires changes.'); | return pht('This revision already requires changes.'); | ||||
| case DifferentialAction::ACTION_REQUEST: | case DifferentialAction::ACTION_REQUEST: | ||||
| return pht('Review is already requested for this revision.'); | return pht('Review is already requested for this revision.'); | ||||
| case DifferentialAction::ACTION_RESIGN: | |||||
| return pht( | |||||
| 'You can not resign from this revision because you are not '. | |||||
| 'a reviewer.'); | |||||
| case DifferentialAction::ACTION_CLAIM: | case DifferentialAction::ACTION_CLAIM: | ||||
| return pht( | return pht( | ||||
| 'You can not commandeer this revision because you already own '. | 'You can not commandeer this revision because you already own '. | ||||
| 'it.'); | 'it.'); | ||||
| case DifferentialAction::ACTION_ACCEPT: | |||||
| return pht('You have already accepted this revision.'); | |||||
| case DifferentialAction::ACTION_REJECT: | |||||
| return pht('You have already requested changes to this revision.'); | |||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| return parent::getNoEffectDescription(); | return parent::getNoEffectDescription(); | ||||
| } | } | ||||
| public function renderAsTextForDoorkeeper( | public function renderAsTextForDoorkeeper( | ||||
| ▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines | |||||