3 final class PhabricatorPackagesVersionEditEngine
4 extends PhabricatorPackagesEditEngine
{
6 const ENGINECONST
= 'packages.version';
8 public function getEngineName() {
9 return pht('Package Versions');
12 public function getSummaryHeader() {
13 return pht('Edit Package Version Configurations');
16 public function getSummaryText() {
17 return pht('This engine is used to edit Packages versions.');
20 protected function newEditableObject() {
21 $viewer = $this->getViewer();
22 return PhabricatorPackagesVersion
::initializeNewVersion($viewer);
25 protected function newObjectQuery() {
26 return new PhabricatorPackagesVersionQuery();
29 protected function getObjectCreateTitleText($object) {
30 return pht('Create Version');
33 protected function getObjectCreateButtonText($object) {
34 return pht('Create Version');
37 protected function getObjectEditTitleText($object) {
38 return pht('Edit Version: %s', $object->getName());
41 protected function getObjectEditShortText($object) {
42 return pht('Edit Version');
45 protected function getObjectCreateShortText() {
46 return pht('Create Version');
49 protected function getObjectName() {
50 return pht('Version');
53 protected function getEditorURI() {
54 return '/packages/version/edit/';
57 protected function getObjectCreateCancelURI($object) {
58 return '/packages/version/';
61 protected function getObjectViewURI($object) {
62 return $object->getURI();
65 protected function buildCustomEditFields($object) {
68 if ($this->getIsCreate()) {
69 $fields[] = id(new PhabricatorDatasourceEditField())
71 ->setAliases(array('packagePHID'))
72 ->setLabel(pht('Package'))
73 ->setDescription(pht('Package for this version.'))
75 PhabricatorPackagesVersionPackageTransaction
::TRANSACTIONTYPE
)
77 ->setDatasource(new PhabricatorPackagesPackageDatasource())
78 ->setSingleValue($object->getPackagePHID());
80 $fields[] = id(new PhabricatorTextEditField())
82 ->setLabel(pht('Name'))
83 ->setDescription(pht('Name of the version.'))
85 PhabricatorPackagesVersionNameTransaction
::TRANSACTIONTYPE
)
87 ->setValue($object->getName());