forked from phacility/phabricator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPhabricatorRepositoryIdentityEditEngine.php
91 lines (69 loc) · 2.2 KB
/
PhabricatorRepositoryIdentityEditEngine.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
final class PhabricatorRepositoryIdentityEditEngine
extends PhabricatorEditEngine {
const ENGINECONST = 'repository.identity';
public function isEngineConfigurable() {
return false;
}
public function getEngineName() {
return pht('Repository Identities');
}
public function getSummaryHeader() {
return pht('Edit Repository Identity Configurations');
}
public function getSummaryText() {
return pht('This engine is used to edit Repository identities.');
}
public function getEngineApplicationClass() {
return 'PhabricatorDiffusionApplication';
}
protected function newEditableObject() {
return new PhabricatorRepositoryIdentity();
}
protected function newObjectQuery() {
return new PhabricatorRepositoryIdentityQuery();
}
protected function getObjectCreateTitleText($object) {
return pht('Create Identity');
}
protected function getObjectCreateButtonText($object) {
return pht('Create Identity');
}
protected function getObjectEditTitleText($object) {
return pht('Edit Identity: %s', $object->getIdentityShortName());
}
protected function getObjectEditShortText($object) {
return pht('Edit Identity');
}
protected function getObjectCreateShortText() {
return pht('Create Identity');
}
protected function getObjectName() {
return pht('Identity');
}
protected function getEditorURI() {
return '/diffusion/identity/edit/';
}
protected function getObjectCreateCancelURI($object) {
return '/diffusion/identity/';
}
protected function getObjectViewURI($object) {
return $object->getURI();
}
protected function getCreateNewObjectPolicy() {
return PhabricatorPolicies::POLICY_USER;
}
protected function buildCustomEditFields($object) {
return array(
id(new DiffusionIdentityAssigneeEditField())
->setKey('manuallySetUserPHID')
->setLabel(pht('Assigned To'))
->setDescription(pht('Override this identity\'s assignment.'))
->setTransactionType(
PhabricatorRepositoryIdentityAssignTransaction::TRANSACTIONTYPE)
->setIsCopyable(true)
->setIsNullable(true)
->setSingleValue($object->getManuallySetUserPHID()),
);
}
}