Page MenuHomePhabricator

D17065.id.diff
No OneTemporary

D17065.id.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -2572,6 +2572,7 @@
'PhabricatorEditEngineConfigurationViewController' => 'applications/transactions/controller/PhabricatorEditEngineConfigurationViewController.php',
'PhabricatorEditEngineController' => 'applications/transactions/controller/PhabricatorEditEngineController.php',
'PhabricatorEditEngineCreateQuickActions' => 'applications/settings/quickmenu/PhabricatorEditEngineCreateQuickActions.php',
+ 'PhabricatorEditEngineDatasource' => 'applications/transactions/typeahead/PhabricatorEditEngineDatasource.php',
'PhabricatorEditEngineExtension' => 'applications/transactions/engineextension/PhabricatorEditEngineExtension.php',
'PhabricatorEditEngineExtensionModule' => 'applications/transactions/engineextension/PhabricatorEditEngineExtensionModule.php',
'PhabricatorEditEngineListController' => 'applications/transactions/controller/PhabricatorEditEngineListController.php',
@@ -7551,6 +7552,7 @@
'PhabricatorEditEngineConfigurationViewController' => 'PhabricatorEditEngineController',
'PhabricatorEditEngineController' => 'PhabricatorApplicationTransactionController',
'PhabricatorEditEngineCreateQuickActions' => 'PhabricatorQuickActions',
+ 'PhabricatorEditEngineDatasource' => 'PhabricatorTypeaheadDatasource',
'PhabricatorEditEngineExtension' => 'Phobject',
'PhabricatorEditEngineExtensionModule' => 'PhabricatorConfigModule',
'PhabricatorEditEngineListController' => 'PhabricatorEditEngineController',
diff --git a/src/applications/transactions/typeahead/PhabricatorEditEngineDatasource.php b/src/applications/transactions/typeahead/PhabricatorEditEngineDatasource.php
new file mode 100644
--- /dev/null
+++ b/src/applications/transactions/typeahead/PhabricatorEditEngineDatasource.php
@@ -0,0 +1,39 @@
+<?php
+
+final class PhabricatorEditEngineDatasource
+ extends PhabricatorTypeaheadDatasource {
+
+ public function getBrowseTitle() {
+ return pht('Browse Forms');
+ }
+
+ public function getPlaceholderText() {
+ return pht('Type a form name...');
+ }
+
+ public function getDatasourceApplicationClass() {
+ return 'PhabricatorTransactionsApplication';
+ }
+
+ public function loadResults() {
+ $query = id(new PhabricatorEditEngineConfigurationQuery());
+
+ $forms = $this->executeQuery($query);
+ $results = array();
+ foreach ($forms as $form) {
+
+ $result = id(new PhabricatorTypeaheadResult())
+ ->setName($form->getName())
+ ->setPHID($form->getPHID());
+
+ if ($form->getIsDisabled()) {
+ $result->setClosed(pht('Archived'));
+ }
+
+ $results[] = $result;
+ }
+
+ return $this->filterResultsAgainstTokens($results);
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 7, 12:58 PM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6713389
Default Alt Text
D17065.id.diff (2 KB)

Event Timeline