Differential D18626 Diff 44738 src/applications/differential/xaction/DifferentialRevisionRejectTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/xaction/DifferentialRevisionRejectTransaction.php
| <?php | <?php | ||||
| final class DifferentialRevisionRejectTransaction | final class DifferentialRevisionRejectTransaction | ||||
| extends DifferentialRevisionReviewTransaction { | extends DifferentialRevisionReviewTransaction { | ||||
| const TRANSACTIONTYPE = 'differential.revision.reject'; | const TRANSACTIONTYPE = 'differential.revision.reject'; | ||||
| const ACTIONKEY = 'reject'; | const ACTIONKEY = 'reject'; | ||||
| protected function getRevisionActionLabel() { | protected function getRevisionActionLabel() { | ||||
| return pht("Request Changes \xE2\x9C\x98"); | return pht("Request Changes \xE2\x9C\x98"); | ||||
| } | } | ||||
| protected function getRevisionActionDescription() { | protected function getRevisionActionDescription( | ||||
| DifferentialRevision $revision) { | |||||
| return pht('This revision will be returned to the author for updates.'); | return pht('This revision will be returned to the author for updates.'); | ||||
| } | } | ||||
| public function getIcon() { | public function getIcon() { | ||||
| return 'fa-times-circle-o'; | return 'fa-times-circle-o'; | ||||
| } | } | ||||
| public function getColor() { | public function getColor() { | ||||
| ▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | protected function validateAction($object, PhabricatorUser $viewer) { | ||||
| if ($this->isViewerRevisionAuthor($object, $viewer)) { | if ($this->isViewerRevisionAuthor($object, $viewer)) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| 'You can not request changes to this revision because you are the '. | 'You can not request changes to this revision because you are the '. | ||||
| 'revision author. You can only request changes to revisions you do '. | 'revision author. You can only request changes to revisions you do '. | ||||
| 'not own.')); | 'not own.')); | ||||
| } | } | ||||
| if ($object->isDraft()) { | |||||
| throw new Exception( | |||||
| pht('You can not request changes to a draft revision.')); | |||||
| } | |||||
| if ($this->isViewerFullyRejected($object, $viewer)) { | if ($this->isViewerFullyRejected($object, $viewer)) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| 'You can not request changes to this revision because you have '. | 'You can not request changes to this revision because you have '. | ||||
| 'already requested changes.')); | 'already requested changes.')); | ||||
| } | } | ||||
| } | } | ||||
| Show All 14 Lines | |||||