Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/diffusion/xaction/DiffusionCommitVerifyTransaction.php
12241 views
1
<?php
2
3
final class DiffusionCommitVerifyTransaction
4
extends DiffusionCommitAuditTransaction {
5
6
const TRANSACTIONTYPE = 'diffusion.commit.verify';
7
const ACTIONKEY = 'verify';
8
9
protected function getCommitActionLabel() {
10
return pht('Request Verification');
11
}
12
13
protected function getCommitActionDescription() {
14
return pht(
15
'Auditors will be asked to verify that concerns have been addressed.');
16
}
17
18
protected function getCommitActionGroupKey() {
19
return DiffusionCommitEditEngine::ACTIONGROUP_COMMIT;
20
}
21
22
public function getIcon() {
23
return 'fa-refresh';
24
}
25
26
public function getColor() {
27
return 'indigo';
28
}
29
30
protected function getCommitActionOrder() {
31
return 600;
32
}
33
34
public function getActionName() {
35
return pht('Requested Verification');
36
}
37
38
public function applyInternalEffects($object, $value) {
39
$object->setAuditStatus(DiffusionCommitAuditStatus::NEEDS_VERIFICATION);
40
}
41
42
protected function validateAction($object, PhabricatorUser $viewer) {
43
if (!$this->isViewerCommitAuthor($object, $viewer)) {
44
throw new Exception(
45
pht(
46
'You can not request verification of this commit because you '.
47
'are not the author.'));
48
}
49
50
if (!$object->isAuditStatusConcernRaised()) {
51
throw new Exception(
52
pht(
53
'You can not request verification of this commit because no '.
54
'auditors have raised concerns with it.'));
55
}
56
}
57
58
public function getTitle() {
59
return pht(
60
'%s requested verification of this commit.',
61
$this->renderAuthor());
62
}
63
64
public function getTitleForFeed() {
65
return pht(
66
'%s requested verification of %s.',
67
$this->renderAuthor(),
68
$this->renderObject());
69
}
70
71
public function getTransactionTypeForConduit($xaction) {
72
return 'request-verification';
73
}
74
75
public function getFieldValuesForConduit($object, $data) {
76
return array();
77
}
78
79
}
80
81