@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class HarbormasterBuildEditEngine
4 extends PhabricatorEditEngine {
5
6 const ENGINECONST = 'harbormaster.build';
7
8 public function isEngineConfigurable() {
9 return false;
10 }
11
12 public function getEngineName() {
13 return pht('Harbormaster Builds');
14 }
15
16 public function getSummaryHeader() {
17 return pht('Edit Harbormaster Build Configurations');
18 }
19
20 public function getSummaryText() {
21 return pht('This engine is used to edit Harbormaster builds.');
22 }
23
24 public function getEngineApplicationClass() {
25 return PhabricatorHarbormasterApplication::class;
26 }
27
28 protected function newEditableObject() {
29 $viewer = $this->getViewer();
30 return HarbormasterBuild::initializeNewBuild($viewer);
31 }
32
33 protected function newObjectQuery() {
34 return new HarbormasterBuildQuery();
35 }
36
37 protected function newEditableObjectForDocumentation() {
38 $object = new DifferentialRevision();
39
40 $buildable = id(new HarbormasterBuildable())
41 ->attachBuildableObject($object);
42
43 return $this->newEditableObject()
44 ->attachBuildable($buildable);
45 }
46
47 protected function getObjectCreateTitleText($object) {
48 return pht('Create Build');
49 }
50
51 protected function getObjectCreateButtonText($object) {
52 return pht('Create Build');
53 }
54
55 protected function getObjectEditTitleText($object) {
56 return pht('Edit Build: %s', $object->getName());
57 }
58
59 protected function getObjectEditShortText($object) {
60 return pht('Edit Build');
61 }
62
63 protected function getObjectCreateShortText() {
64 return pht('Create Build');
65 }
66
67 protected function getObjectName() {
68 return pht('Build');
69 }
70
71 protected function getEditorURI() {
72 return '/harbormaster/build/edit/';
73 }
74
75 protected function getObjectCreateCancelURI($object) {
76 return '/harbormaster/';
77 }
78
79 protected function getObjectViewURI($object) {
80 return $object->getURI();
81 }
82
83 protected function buildCustomEditFields($object) {
84 return array();
85 }
86
87}