@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
fork

Configure Feed

Select the types of activity you want to include in your feed.

Convert DrydockBlueprints to EditEngine

Summary:
Ref T10457. Fixes T10024. This primarily just modernizes blueprints to use EditEngine.

This also fixes T10024, which was an issue with stored properties not being flagged correctly.

Also slightly improves typeaheads for blueprints (more information, disabled state).

Test Plan:
- Created and edited various types of blueprints.
- Set and removed limits.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10024, T10457

Differential Revision: https://secure.phabricator.com/D15390

+272 -240
+4 -2
src/__phutil_library_map__.php
··· 867 867 'DrydockBlueprint' => 'applications/drydock/storage/DrydockBlueprint.php', 868 868 'DrydockBlueprintController' => 'applications/drydock/controller/DrydockBlueprintController.php', 869 869 'DrydockBlueprintCoreCustomField' => 'applications/drydock/customfield/DrydockBlueprintCoreCustomField.php', 870 - 'DrydockBlueprintCreateController' => 'applications/drydock/controller/DrydockBlueprintCreateController.php', 871 870 'DrydockBlueprintCustomField' => 'applications/drydock/customfield/DrydockBlueprintCustomField.php', 872 871 'DrydockBlueprintDatasource' => 'applications/drydock/typeahead/DrydockBlueprintDatasource.php', 873 872 'DrydockBlueprintDisableController' => 'applications/drydock/controller/DrydockBlueprintDisableController.php', 874 873 'DrydockBlueprintEditController' => 'applications/drydock/controller/DrydockBlueprintEditController.php', 874 + 'DrydockBlueprintEditEngine' => 'applications/drydock/editor/DrydockBlueprintEditEngine.php', 875 875 'DrydockBlueprintEditor' => 'applications/drydock/editor/DrydockBlueprintEditor.php', 876 876 'DrydockBlueprintImplementation' => 'applications/drydock/blueprint/DrydockBlueprintImplementation.php', 877 877 'DrydockBlueprintImplementationTestCase' => 'applications/drydock/blueprint/__tests__/DrydockBlueprintImplementationTestCase.php', ··· 3287 3287 'PhabricatorStandardCustomFieldUsers' => 'infrastructure/customfield/standard/PhabricatorStandardCustomFieldUsers.php', 3288 3288 'PhabricatorStandardPageView' => 'view/page/PhabricatorStandardPageView.php', 3289 3289 'PhabricatorStandardSelectCustomFieldDatasource' => 'infrastructure/customfield/datasource/PhabricatorStandardSelectCustomFieldDatasource.php', 3290 + 'PhabricatorStaticEditField' => 'applications/transactions/editfield/PhabricatorStaticEditField.php', 3290 3291 'PhabricatorStatusController' => 'applications/system/controller/PhabricatorStatusController.php', 3291 3292 'PhabricatorStatusUIExample' => 'applications/uiexample/examples/PhabricatorStatusUIExample.php', 3292 3293 'PhabricatorStorageFixtureScopeGuard' => 'infrastructure/testing/fixture/PhabricatorStorageFixtureScopeGuard.php', ··· 4980 4981 'DrydockBlueprintCustomField', 4981 4982 'PhabricatorStandardCustomFieldInterface', 4982 4983 ), 4983 - 'DrydockBlueprintCreateController' => 'DrydockBlueprintController', 4984 4984 'DrydockBlueprintCustomField' => 'PhabricatorCustomField', 4985 4985 'DrydockBlueprintDatasource' => 'PhabricatorTypeaheadDatasource', 4986 4986 'DrydockBlueprintDisableController' => 'DrydockBlueprintController', 4987 4987 'DrydockBlueprintEditController' => 'DrydockBlueprintController', 4988 + 'DrydockBlueprintEditEngine' => 'PhabricatorEditEngine', 4988 4989 'DrydockBlueprintEditor' => 'PhabricatorApplicationTransactionEditor', 4989 4990 'DrydockBlueprintImplementation' => 'Phobject', 4990 4991 'DrydockBlueprintImplementationTestCase' => 'PhabricatorTestCase', ··· 7834 7835 'AphrontResponseProducerInterface', 7835 7836 ), 7836 7837 'PhabricatorStandardSelectCustomFieldDatasource' => 'PhabricatorTypeaheadDatasource', 7838 + 'PhabricatorStaticEditField' => 'PhabricatorEditField', 7837 7839 'PhabricatorStatusController' => 'PhabricatorController', 7838 7840 'PhabricatorStatusUIExample' => 'PhabricatorUIExample', 7839 7841 'PhabricatorStorageFixtureScopeGuard' => 'Phobject',
+2 -2
src/applications/drydock/application/PhabricatorDrydockApplication.php
··· 60 60 'authorizations/(?:query/(?P<queryKey>[^/]+)/)?' => 61 61 'DrydockAuthorizationListController', 62 62 ), 63 - 'create/' => 'DrydockBlueprintCreateController', 64 - 'edit/(?:(?P<id>[1-9]\d*)/)?' => 'DrydockBlueprintEditController', 63 + $this->getEditRoutePattern('edit/') 64 + => 'DrydockBlueprintEditController', 65 65 ), 66 66 '(?P<type>resource)/' => array( 67 67 '(?:query/(?P<queryKey>[^/]+)/)?' => 'DrydockResourceListController',
+5 -11
src/applications/drydock/controller/DrydockBlueprintController.php
··· 3 3 abstract class DrydockBlueprintController 4 4 extends DrydockController { 5 5 6 - public function buildSideNavView() { 7 - $nav = new AphrontSideNavFilterView(); 8 - $nav->setBaseURI(new PhutilURI($this->getApplicationURI())); 9 - 10 - id(new DrydockBlueprintSearchEngine()) 11 - ->setViewer($this->getRequest()->getUser()) 12 - ->addNavigationItems($nav->getMenu()); 13 - 14 - $nav->selectFilter(null); 15 - 16 - return $nav; 6 + public function buildApplicationMenu() { 7 + return $this->newApplicationMenu() 8 + ->setSearchEngine(new DrydockBlueprintSearchEngine()); 17 9 } 18 10 19 11 protected function buildApplicationCrumbs() { 20 12 $crumbs = parent::buildApplicationCrumbs(); 13 + 21 14 $crumbs->addTextCrumb( 22 15 pht('Blueprints'), 23 16 $this->getApplicationURI('blueprint/')); 17 + 24 18 return $crumbs; 25 19 } 26 20
-79
src/applications/drydock/controller/DrydockBlueprintCreateController.php
··· 1 - <?php 2 - 3 - final class DrydockBlueprintCreateController 4 - extends DrydockBlueprintController { 5 - 6 - public function handleRequest(AphrontRequest $request) { 7 - $viewer = $request->getViewer(); 8 - 9 - $this->requireApplicationCapability( 10 - DrydockCreateBlueprintsCapability::CAPABILITY); 11 - 12 - $implementations = 13 - DrydockBlueprintImplementation::getAllBlueprintImplementations(); 14 - 15 - $errors = array(); 16 - $e_blueprint = null; 17 - 18 - if ($request->isFormPost()) { 19 - $class = $request->getStr('blueprint-type'); 20 - if (!isset($implementations[$class])) { 21 - $e_blueprint = pht('Required'); 22 - $errors[] = pht('You must choose a blueprint type.'); 23 - } 24 - 25 - if (!$errors) { 26 - $edit_uri = $this->getApplicationURI('blueprint/edit/?class='.$class); 27 - return id(new AphrontRedirectResponse())->setURI($edit_uri); 28 - } 29 - } 30 - 31 - $control = id(new AphrontFormRadioButtonControl()) 32 - ->setName('blueprint-type') 33 - ->setLabel(pht('Blueprint Type')) 34 - ->setError($e_blueprint); 35 - 36 - foreach ($implementations as $implementation_name => $implementation) { 37 - $disabled = !$implementation->isEnabled(); 38 - 39 - $control->addButton( 40 - $implementation_name, 41 - $implementation->getBlueprintName(), 42 - array( 43 - pht('Provides: %s', $implementation->getType()), 44 - phutil_tag('br'), 45 - phutil_tag('br'), 46 - $implementation->getDescription(), 47 - ), 48 - $disabled ? 'disabled' : null, 49 - $disabled); 50 - } 51 - 52 - $title = pht('Create New Blueprint'); 53 - $crumbs = $this->buildApplicationCrumbs(); 54 - $crumbs->addTextCrumb(pht('New Blueprint')); 55 - 56 - $form = id(new AphrontFormView()) 57 - ->setUser($viewer) 58 - ->appendChild($control) 59 - ->appendChild( 60 - id(new AphrontFormSubmitControl()) 61 - ->addCancelButton($this->getApplicationURI('blueprint/')) 62 - ->setValue(pht('Continue'))); 63 - 64 - $box = id(new PHUIObjectBoxView()) 65 - ->setFormErrors($errors) 66 - ->setHeaderText($title) 67 - ->setForm($form); 68 - 69 - return $this->buildApplicationPage( 70 - array( 71 - $crumbs, 72 - $box, 73 - ), 74 - array( 75 - 'title' => $title, 76 - )); 77 - } 78 - 79 - }
+54 -133
src/applications/drydock/controller/DrydockBlueprintEditController.php
··· 3 3 final class DrydockBlueprintEditController extends DrydockBlueprintController { 4 4 5 5 public function handleRequest(AphrontRequest $request) { 6 - $viewer = $request->getViewer(); 7 - $id = $request->getURIData('id'); 8 - 9 - if ($id) { 10 - $blueprint = id(new DrydockBlueprintQuery()) 11 - ->setViewer($viewer) 12 - ->withIDs(array($id)) 13 - ->requireCapabilities( 14 - array( 15 - PhabricatorPolicyCapability::CAN_VIEW, 16 - PhabricatorPolicyCapability::CAN_EDIT, 17 - )) 18 - ->executeOne(); 19 - if (!$blueprint) { 20 - return new Aphront404Response(); 21 - } 6 + $engine = id(new DrydockBlueprintEditEngine()) 7 + ->setController($this); 22 8 23 - $impl = $blueprint->getImplementation(); 24 - $cancel_uri = $this->getApplicationURI('blueprint/'.$id.'/'); 25 - } else { 9 + $id = $request->getURIData('id'); 10 + if (!$id) { 26 11 $this->requireApplicationCapability( 27 12 DrydockCreateBlueprintsCapability::CAPABILITY); 28 13 29 - $class = $request->getStr('class'); 14 + $type = $request->getStr('blueprintType'); 30 15 31 - $impl = DrydockBlueprintImplementation::getNamedImplementation($class); 16 + $impl = DrydockBlueprintImplementation::getNamedImplementation($type); 32 17 if (!$impl || !$impl->isEnabled()) { 33 - return new Aphront400Response(); 18 + return $this->buildTypeSelectionResponse(); 34 19 } 35 20 36 - $blueprint = DrydockBlueprint::initializeNewBlueprint($viewer) 37 - ->setClassName($class) 38 - ->attachImplementation($impl); 39 - 40 - $cancel_uri = $this->getApplicationURI('blueprint/'); 21 + $engine 22 + ->addContextParameter('blueprintType', $type) 23 + ->setBlueprintImplementation($impl); 41 24 } 42 25 43 - $field_list = PhabricatorCustomField::getObjectFields( 44 - $blueprint, 45 - PhabricatorCustomField::ROLE_EDIT); 46 - $field_list 47 - ->setViewer($viewer) 48 - ->readFieldsFromStorage($blueprint); 26 + return $engine->buildResponse(); 27 + } 49 28 50 - $v_name = $blueprint->getBlueprintName(); 51 - $e_name = true; 29 + private function buildTypeSelectionResponse() { 30 + $request = $this->getRequest(); 31 + $viewer = $this->getViewer(); 32 + 33 + $implementations = 34 + DrydockBlueprintImplementation::getAllBlueprintImplementations(); 35 + 52 36 $errors = array(); 53 - $validation_exception = null; 37 + $e_blueprint = null; 54 38 55 39 if ($request->isFormPost()) { 56 - $v_view_policy = $request->getStr('viewPolicy'); 57 - $v_edit_policy = $request->getStr('editPolicy'); 58 - $v_name = $request->getStr('name'); 59 - if (!strlen($v_name)) { 60 - $e_name = pht('Required'); 61 - $errors[] = pht('You must name this blueprint.'); 40 + $class = $request->getStr('blueprintType'); 41 + if (!isset($implementations[$class])) { 42 + $e_blueprint = pht('Required'); 43 + $errors[] = pht('You must choose a blueprint type.'); 62 44 } 45 + } 63 46 64 - if (!$errors) { 65 - $xactions = array(); 47 + $control = id(new AphrontFormRadioButtonControl()) 48 + ->setName('blueprintType') 49 + ->setLabel(pht('Blueprint Type')) 50 + ->setError($e_blueprint); 66 51 67 - $xactions = $field_list->buildFieldTransactionsFromRequest( 68 - new DrydockBlueprintTransaction(), 69 - $request); 52 + foreach ($implementations as $implementation_name => $implementation) { 53 + $disabled = !$implementation->isEnabled(); 70 54 71 - $xactions[] = id(new DrydockBlueprintTransaction()) 72 - ->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY) 73 - ->setNewValue($v_view_policy); 74 - 75 - $xactions[] = id(new DrydockBlueprintTransaction()) 76 - ->setTransactionType(PhabricatorTransactions::TYPE_EDIT_POLICY) 77 - ->setNewValue($v_edit_policy); 78 - 79 - $xactions[] = id(new DrydockBlueprintTransaction()) 80 - ->setTransactionType(DrydockBlueprintTransaction::TYPE_NAME) 81 - ->setNewValue($v_name); 82 - 83 - $editor = id(new DrydockBlueprintEditor()) 84 - ->setActor($viewer) 85 - ->setContentSourceFromRequest($request) 86 - ->setContinueOnNoEffect(true); 87 - 88 - try { 89 - $editor->applyTransactions($blueprint, $xactions); 90 - 91 - $id = $blueprint->getID(); 92 - $save_uri = $this->getApplicationURI("blueprint/{$id}/"); 93 - 94 - return id(new AphrontRedirectResponse())->setURI($save_uri); 95 - } catch (PhabricatorApplicationTransactionValidationException $ex) { 96 - $validation_exception = $ex; 97 - } 98 - } 55 + $control->addButton( 56 + $implementation_name, 57 + $implementation->getBlueprintName(), 58 + array( 59 + pht('Provides: %s', $implementation->getType()), 60 + phutil_tag('br'), 61 + phutil_tag('br'), 62 + $implementation->getDescription(), 63 + ), 64 + $disabled ? 'disabled' : null, 65 + $disabled); 99 66 } 100 67 101 - $policies = id(new PhabricatorPolicyQuery()) 102 - ->setViewer($viewer) 103 - ->setObject($blueprint) 104 - ->execute(); 68 + $title = pht('Create New Blueprint'); 69 + $crumbs = $this->buildApplicationCrumbs(); 70 + $crumbs->addTextCrumb(pht('New Blueprint')); 105 71 106 72 $form = id(new AphrontFormView()) 107 73 ->setUser($viewer) 108 - ->addHiddenInput('class', $request->getStr('class')) 74 + ->appendChild($control) 109 75 ->appendChild( 110 - id(new AphrontFormTextControl()) 111 - ->setLabel(pht('Name')) 112 - ->setName('name') 113 - ->setValue($v_name) 114 - ->setError($e_name)) 115 - ->appendChild( 116 - id(new AphrontFormStaticControl()) 117 - ->setLabel(pht('Blueprint Type')) 118 - ->setValue($impl->getBlueprintName())) 119 - ->appendChild( 120 - id(new AphrontFormPolicyControl()) 121 - ->setName('viewPolicy') 122 - ->setPolicyObject($blueprint) 123 - ->setCapability(PhabricatorPolicyCapability::CAN_VIEW) 124 - ->setPolicies($policies)) 125 - ->appendChild( 126 - id(new AphrontFormPolicyControl()) 127 - ->setName('editPolicy') 128 - ->setPolicyObject($blueprint) 129 - ->setCapability(PhabricatorPolicyCapability::CAN_EDIT) 130 - ->setPolicies($policies)); 131 - 132 - $field_list->appendFieldsToForm($form); 133 - 134 - $crumbs = $this->buildApplicationCrumbs(); 135 - 136 - if ($blueprint->getID()) { 137 - $title = pht('Edit Blueprint'); 138 - $header = pht('Edit Blueprint %d', $blueprint->getID()); 139 - $crumbs->addTextCrumb(pht('Blueprint %d', $blueprint->getID())); 140 - $crumbs->addTextCrumb(pht('Edit')); 141 - $submit = pht('Save Blueprint'); 142 - } else { 143 - $title = pht('New Blueprint'); 144 - $header = pht('New Blueprint'); 145 - $crumbs->addTextCrumb(pht('New Blueprint')); 146 - $submit = pht('Create Blueprint'); 147 - } 148 - 149 - $form->appendChild( 150 - id(new AphrontFormSubmitControl()) 151 - ->setValue($submit) 152 - ->addCancelButton($cancel_uri)); 76 + id(new AphrontFormSubmitControl()) 77 + ->addCancelButton($this->getApplicationURI('blueprint/')) 78 + ->setValue(pht('Continue'))); 153 79 154 80 $box = id(new PHUIObjectBoxView()) 155 - ->setHeaderText($header) 156 - ->setValidationException($validation_exception) 157 81 ->setFormErrors($errors) 82 + ->setHeaderText($title) 158 83 ->setForm($form); 159 84 160 - return $this->buildApplicationPage( 161 - array( 162 - $crumbs, 163 - $box, 164 - ), 165 - array( 166 - 'title' => $title, 167 - )); 85 + return $this->newPage() 86 + ->setTitle($title) 87 + ->setCrumbs($crumbs) 88 + ->appendChild($box); 168 89 } 169 90 170 91 }
+5 -10
src/applications/drydock/controller/DrydockBlueprintListController.php
··· 13 13 } 14 14 15 15 protected function buildApplicationCrumbs() { 16 - $can_create = $this->hasApplicationCapability( 17 - DrydockCreateBlueprintsCapability::CAPABILITY); 18 - 19 16 $crumbs = parent::buildApplicationCrumbs(); 20 - $crumbs->addAction( 21 - id(new PHUIListItemView()) 22 - ->setName(pht('New Blueprint')) 23 - ->setHref($this->getApplicationURI('/blueprint/create/')) 24 - ->setDisabled(!$can_create) 25 - ->setWorkflow(!$can_create) 26 - ->setIcon('fa-plus-square')); 17 + 18 + id(new DrydockBlueprintEditEngine()) 19 + ->setViewer($this->getViewer()) 20 + ->addActionToCrumbs($crumbs); 21 + 27 22 return $crumbs; 28 23 } 29 24
+1
src/applications/drydock/customfield/DrydockBlueprintCoreCustomField.php
··· 28 28 public function readValueFromObject(PhabricatorCustomFieldInterface $object) { 29 29 $key = $this->getProxy()->getRawStandardFieldKey(); 30 30 $this->setValueFromStorage($object->getDetail($key)); 31 + $this->didSetValueFromStorage(); 31 32 } 32 33 33 34 public function applyApplicationTransactionInternalEffects(
+115
src/applications/drydock/editor/DrydockBlueprintEditEngine.php
··· 1 + <?php 2 + 3 + final class DrydockBlueprintEditEngine 4 + extends PhabricatorEditEngine { 5 + 6 + private $blueprintImplementation; 7 + 8 + const ENGINECONST = 'drydock.blueprint'; 9 + 10 + public function isEngineConfigurable() { 11 + return false; 12 + } 13 + 14 + public function getEngineName() { 15 + return pht('Drydock Blueprints'); 16 + } 17 + 18 + public function getSummaryHeader() { 19 + return pht('Edit Drydock Blueprint Configurations'); 20 + } 21 + 22 + public function getSummaryText() { 23 + return pht('This engine is used to edit Drydock blueprints.'); 24 + } 25 + 26 + public function getEngineApplicationClass() { 27 + return 'PhabricatorDrydockApplication'; 28 + } 29 + 30 + public function setBlueprintImplementation( 31 + DrydockBlueprintImplementation $impl) { 32 + $this->blueprintImplementation = $impl; 33 + return $this; 34 + } 35 + 36 + public function getBlueprintImplementation() { 37 + return $this->blueprintImplementation; 38 + } 39 + 40 + protected function newEditableObject() { 41 + $viewer = $this->getViewer(); 42 + $blueprint = DrydockBlueprint::initializeNewBlueprint($viewer); 43 + 44 + $impl = $this->getBlueprintImplementation(); 45 + if ($impl) { 46 + $blueprint 47 + ->setClassName(get_class($impl)) 48 + ->attachImplementation(clone $impl); 49 + } 50 + 51 + return $blueprint; 52 + } 53 + 54 + protected function newObjectQuery() { 55 + return new DrydockBlueprintQuery(); 56 + } 57 + 58 + protected function getObjectCreateTitleText($object) { 59 + return pht('Create Blueprint'); 60 + } 61 + 62 + protected function getObjectCreateButtonText($object) { 63 + return pht('Create Blueprint'); 64 + } 65 + 66 + protected function getObjectEditTitleText($object) { 67 + return pht('Edit Blueprint: %s', $object->getBlueprintName()); 68 + } 69 + 70 + protected function getObjectEditShortText($object) { 71 + return pht('Edit Blueprint'); 72 + } 73 + 74 + protected function getObjectCreateShortText() { 75 + return pht('Create Blueprint'); 76 + } 77 + 78 + protected function getEditorURI() { 79 + return '/drydock/blueprint/edit/'; 80 + } 81 + 82 + protected function getObjectCreateCancelURI($object) { 83 + return '/drydock/blueprint/'; 84 + } 85 + 86 + protected function getObjectViewURI($object) { 87 + $id = $object->getID(); 88 + return "/drydock/blueprint/{$id}/"; 89 + } 90 + 91 + protected function getCreateNewObjectPolicy() { 92 + return $this->getApplication()->getPolicy( 93 + DrydockCreateBlueprintsCapability::CAPABILITY); 94 + } 95 + 96 + protected function buildCustomEditFields($object) { 97 + $impl = $object->getImplementation(); 98 + 99 + return array( 100 + id(new PhabricatorStaticEditField()) 101 + ->setKey('type') 102 + ->setLabel(pht('Blueprint Type')) 103 + ->setDescription(pht('Type of blueprint.')) 104 + ->setValue($impl->getBlueprintName()), 105 + id(new PhabricatorTextEditField()) 106 + ->setKey('name') 107 + ->setLabel(pht('Name')) 108 + ->setDescription(pht('Name of the blueprint.')) 109 + ->setTransactionType(DrydockBlueprintTransaction::TYPE_NAME) 110 + ->setIsRequired(true) 111 + ->setValue($object->getBlueprintName()), 112 + ); 113 + } 114 + 115 + }
+32
src/applications/drydock/editor/DrydockBlueprintEditor.php
··· 84 84 return parent::applyCustomExternalTransaction($object, $xaction); 85 85 } 86 86 87 + 88 + protected function validateTransaction( 89 + PhabricatorLiskDAO $object, 90 + $type, 91 + array $xactions) { 92 + 93 + $errors = parent::validateTransaction($object, $type, $xactions); 94 + 95 + switch ($type) { 96 + case DrydockBlueprintTransaction::TYPE_NAME: 97 + $missing = $this->validateIsEmptyTextField( 98 + $object->getBlueprintName(), 99 + $xactions); 100 + 101 + if ($missing) { 102 + $error = new PhabricatorApplicationTransactionValidationError( 103 + $type, 104 + pht('Required'), 105 + pht('You must choose a name for this blueprint.'), 106 + nonempty(last($xactions), null)); 107 + 108 + $error->setIsMissingFieldError(true); 109 + $errors[] = $error; 110 + continue; 111 + } 112 + 113 + break; 114 + } 115 + 116 + return $errors; 117 + } 118 + 87 119 }
+12 -3
src/applications/drydock/typeahead/DrydockBlueprintDatasource.php
··· 26 26 ->execute(); 27 27 28 28 $results = array(); 29 - foreach ($handles as $handle) { 30 - $results[] = id(new PhabricatorTypeaheadResult()) 31 - ->setName($handle->getName()) 29 + foreach ($blueprints as $blueprint) { 30 + $handle = $handles[$blueprint->getPHID()]; 31 + 32 + $result = id(new PhabricatorTypeaheadResult()) 33 + ->setName($handle->getFullName()) 32 34 ->setPHID($handle->getPHID()); 35 + 36 + if ($blueprint->getIsDisabled()) { 37 + $result->setClosed(pht('Disabled')); 38 + } 39 + 40 + $results[] = $result; 33 41 } 42 + 34 43 return $results; 35 44 } 36 45 }
+18
src/applications/transactions/editfield/PhabricatorStaticEditField.php
··· 1 + <?php 2 + 3 + final class PhabricatorStaticEditField 4 + extends PhabricatorEditField { 5 + 6 + protected function newControl() { 7 + return new AphrontFormMarkupControl(); 8 + } 9 + 10 + protected function newHTTPParameterType() { 11 + return null; 12 + } 13 + 14 + protected function newConduitParameterType() { 15 + return null; 16 + } 17 + 18 + }
+12
src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldCredential.php
··· 135 135 } 136 136 137 137 138 + protected function getHTTPParameterType() { 139 + return new AphrontPHIDHTTPParameterType(); 140 + } 141 + 142 + protected function newConduitSearchParameterType() { 143 + return new ConduitPHIDParameterType(); 144 + } 145 + 146 + protected function newConduitEditParameterType() { 147 + return new ConduitPHIDParameterType(); 148 + } 149 + 138 150 }
+12
src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldTokenizer.php
··· 52 52 return $this->getDatasource(); 53 53 } 54 54 55 + protected function getHTTPParameterType() { 56 + return new AphrontPHIDListHTTPParameterType(); 57 + } 58 + 59 + protected function newConduitSearchParameterType() { 60 + return new ConduitPHIDListParameterType(); 61 + } 62 + 63 + protected function newConduitEditParameterType() { 64 + return new ConduitPHIDListParameterType(); 65 + } 66 + 55 67 }