Differential D18802 Diff 45116 src/applications/differential/xaction/DifferentialRevisionResignTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/xaction/DifferentialRevisionResignTransaction.php
| Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | final class DifferentialRevisionResignTransaction | ||||
| protected function validateAction($object, PhabricatorUser $viewer) { | protected function validateAction($object, PhabricatorUser $viewer) { | ||||
| if ($object->isClosed()) { | if ($object->isClosed()) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| 'You can not resign from this revision because it has already '. | 'You can not resign from this revision because it has already '. | ||||
| 'been closed. You can only resign from open revisions.')); | 'been closed. You can only resign from open revisions.')); | ||||
| } | } | ||||
| if ($object->isDraft()) { | |||||
| throw new Exception( | |||||
| pht('You can not resign from a draft revision.')); | |||||
| } | |||||
| $resigned = DifferentialReviewerStatus::STATUS_RESIGNED; | $resigned = DifferentialReviewerStatus::STATUS_RESIGNED; | ||||
| if ($this->getViewerReviewerStatus($object, $viewer) == $resigned) { | if ($this->getViewerReviewerStatus($object, $viewer) == $resigned) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| 'You can not resign from this revision because you have already '. | 'You can not resign from this revision because you have already '. | ||||
| 'resigned.')); | 'resigned.')); | ||||
| } | } | ||||
| Show All 22 Lines | |||||