3 final class DiffusionCommitConcernTransaction
4 extends DiffusionCommitAuditTransaction
{
6 const TRANSACTIONTYPE
= 'diffusion.commit.concern';
7 const ACTIONKEY
= 'concern';
9 protected function getCommitActionLabel() {
10 return pht('Raise Concern');
13 protected function getCommitActionDescription() {
14 return pht('This commit will be returned to the author for consideration.');
17 public function getIcon() {
18 return 'fa-times-circle-o';
21 public function getColor() {
25 protected function getCommitActionOrder() {
29 public function getActionName() {
30 return pht('Raised Concern');
33 public function applyInternalEffects($object, $value) {
34 // NOTE: We force the commit directly into "Concern Raised" so that we
35 // override a possible "Needs Verification" state.
36 $object->setAuditStatus(DiffusionCommitAuditStatus
::CONCERN_RAISED
);
39 public function applyExternalEffects($object, $value) {
40 $status = PhabricatorAuditRequestStatus
::CONCERNED
;
41 $actor = $this->getActor();
42 $this->applyAuditorEffect($object, $actor, $value, $status);
45 protected function validateAction($object, PhabricatorUser
$viewer) {
46 if ($this->isViewerCommitAuthor($object, $viewer)) {
49 'You can not raise a concern with this commit because you are '.
50 'the commit author. You can only raise concerns with commits '.
51 'you did not author.'));
54 // Even if you've already raised a concern, you can raise again as long
55 // as the author requested you verify.
56 if ($this->isViewerFullyRejected($object, $viewer)) {
57 if (!$object->isAuditStatusNeedsVerification()) {
60 'You can not raise a concern with this commit because you have '.
61 'already raised a concern with it.'));
66 public function getTitle() {
68 '%s raised a concern with this commit.',
69 $this->renderAuthor());
72 public function getTitleForFeed() {
74 '%s raised a concern with %s.',
75 $this->renderAuthor(),
76 $this->renderObject());
79 public function getTransactionTypeForConduit($xaction) {
83 public function getFieldValuesForConduit($object, $data) {