3 final class DifferentialRevisionReopenTransaction
4 extends DifferentialRevisionActionTransaction
{
6 const TRANSACTIONTYPE
= 'differential.revision.reopen';
7 const ACTIONKEY
= 'reopen';
9 protected function getRevisionActionLabel(
10 DifferentialRevision
$revision,
11 PhabricatorUser
$viewer) {
12 return pht('Reopen Revision');
15 protected function getRevisionActionDescription(
16 DifferentialRevision
$revision,
17 PhabricatorUser
$viewer) {
18 return pht('This revision will be reopened for review.');
21 public function getIcon() {
25 public function getColor() {
29 protected function getRevisionActionOrder() {
33 public function getActionName() {
34 return pht('Reopened');
37 public function generateOldValue($object) {
38 return !$object->isClosed();
41 public function applyInternalEffects($object, $value) {
42 $status_review = DifferentialRevisionStatus
::NEEDS_REVIEW
;
43 $object->setModernRevisionStatus($status_review);
46 protected function validateAction($object, PhabricatorUser
$viewer) {
47 if (!$object->isPublished()) {
50 'You can not reopen this revision because it is not closed. '.
51 'Only closed revisions can be reopened.'));
54 $config_key = 'differential.allow-reopen';
55 if (!PhabricatorEnv
::getEnvConfig($config_key)) {
58 'You can not reopen this revision because configuration prevents '.
59 'any revision from being reopened. You can change this behavior '.
60 'by adjusting the "%s" setting in Config.',
65 public function getTitle() {
67 '%s reopened this revision.',
68 $this->renderAuthor());
71 public function getTitleForFeed() {
74 $this->renderAuthor(),
75 $this->renderObject());
78 public function getTransactionTypeForConduit($xaction) {
82 public function getFieldValuesForConduit($object, $data) {