Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/harbormaster/editor/HarbormasterBuildStepEditEngine.php
12256 views
1
<?php
2
3
final class HarbormasterBuildStepEditEngine
4
extends PhabricatorEditEngine {
5
6
const ENGINECONST = 'harbormaster.buildstep';
7
8
private $buildPlan;
9
10
public function setBuildPlan(HarbormasterBuildPlan $build_plan) {
11
$this->buildPlan = $build_plan;
12
return $this;
13
}
14
15
public function getBuildPlan() {
16
if ($this->buildPlan === null) {
17
throw new PhutilInvalidStateException('setBuildPlan');
18
}
19
20
return $this->buildPlan;
21
}
22
23
public function isEngineConfigurable() {
24
return false;
25
}
26
27
public function getEngineName() {
28
return pht('Harbormaster Build Steps');
29
}
30
31
public function getSummaryHeader() {
32
return pht('Edit Harbormaster Build Step Configurations');
33
}
34
35
public function getSummaryText() {
36
return pht('This engine is used to edit Harbormaster build steps.');
37
}
38
39
public function getEngineApplicationClass() {
40
return 'PhabricatorHarbormasterApplication';
41
}
42
43
protected function newEditableObject() {
44
$viewer = $this->getViewer();
45
46
47
$plan = HarbormasterBuildPlan::initializeNewBuildPlan($viewer);
48
$this->setBuildPlan($plan);
49
50
$plan = $this->getBuildPlan();
51
52
$step = HarbormasterBuildStep::initializeNewStep($viewer);
53
54
$step->setBuildPlanPHID($plan->getPHID());
55
$step->attachBuildPlan($plan);
56
57
return $step;
58
}
59
60
protected function newObjectQuery() {
61
return new HarbormasterBuildStepQuery();
62
}
63
64
protected function getObjectCreateTitleText($object) {
65
return pht('Create Build Step');
66
}
67
68
protected function getObjectCreateButtonText($object) {
69
return pht('Create Build Step');
70
}
71
72
protected function getObjectEditTitleText($object) {
73
return pht('Edit Build Step: %s', $object->getName());
74
}
75
76
protected function getObjectEditShortText($object) {
77
return pht('Edit Build Step');
78
}
79
80
protected function getObjectCreateShortText() {
81
return pht('Create Build Step');
82
}
83
84
protected function getObjectName() {
85
return pht('Build Step');
86
}
87
88
protected function getEditorURI() {
89
return '/harbormaster/step/edit/';
90
}
91
92
protected function getObjectCreateCancelURI($object) {
93
return '/harbormaster/step/';
94
}
95
96
protected function getObjectViewURI($object) {
97
$id = $object->getID();
98
return "/harbormaster/step/{$id}/";
99
}
100
101
protected function buildCustomEditFields($object) {
102
$fields = array();
103
104
return $fields;
105
}
106
107
}
108
109