Page MenuHomePhabricator

D12524.diff
No OneTemporary

D12524.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
@@ -2038,6 +2038,7 @@
'PhabricatorMetaMTAMailSection' => 'applications/metamta/view/PhabricatorMetaMTAMailSection.php',
'PhabricatorMetaMTAMailTestCase' => 'applications/metamta/storage/__tests__/PhabricatorMetaMTAMailTestCase.php',
'PhabricatorMetaMTAMailableDatasource' => 'applications/metamta/typeahead/PhabricatorMetaMTAMailableDatasource.php',
+ 'PhabricatorMetaMTAMailableFunctionDatasource' => 'applications/metamta/typeahead/PhabricatorMetaMTAMailableFunctionDatasource.php',
'PhabricatorMetaMTAMailgunReceiveController' => 'applications/metamta/controller/PhabricatorMetaMTAMailgunReceiveController.php',
'PhabricatorMetaMTAMailingList' => 'applications/mailinglists/storage/PhabricatorMetaMTAMailingList.php',
'PhabricatorMetaMTAMemberQuery' => 'applications/metamta/query/PhabricatorMetaMTAMemberQuery.php',
@@ -5392,6 +5393,7 @@
'PhabricatorMetaMTAMailBodyTestCase' => 'PhabricatorTestCase',
'PhabricatorMetaMTAMailTestCase' => 'PhabricatorTestCase',
'PhabricatorMetaMTAMailableDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
+ 'PhabricatorMetaMTAMailableFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
'PhabricatorMetaMTAMailgunReceiveController' => 'PhabricatorMetaMTAController',
'PhabricatorMetaMTAMailingList' => array(
'PhabricatorMetaMTADAO',
diff --git a/src/applications/metamta/typeahead/PhabricatorMetaMTAMailableFunctionDatasource.php b/src/applications/metamta/typeahead/PhabricatorMetaMTAMailableFunctionDatasource.php
new file mode 100644
--- /dev/null
+++ b/src/applications/metamta/typeahead/PhabricatorMetaMTAMailableFunctionDatasource.php
@@ -0,0 +1,28 @@
+<?php
+
+final class PhabricatorMetaMTAMailableFunctionDatasource
+ extends PhabricatorTypeaheadCompositeDatasource {
+
+ public function getBrowseTitle() {
+ return pht('Browse Subscribers');
+ }
+
+ public function getPlaceholderText() {
+ return pht('Type a username, project, mailing list, or function...');
+ }
+
+ public function getDatasourceApplicationClass() {
+ return 'PhabricatorMetaMTAApplication';
+ }
+
+ public function getComponentDatasources() {
+ return array(
+ new PhabricatorViewerDatasource(),
+ new PhabricatorPeopleDatasource(),
+ new PhabricatorProjectMembersDatasource(),
+ new PhabricatorProjectDatasource(),
+ new PhabricatorMailingListDatasource(),
+ );
+ }
+
+}
diff --git a/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php b/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
--- a/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
+++ b/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
@@ -32,7 +32,7 @@
$saved->setParameter(
'subscriberPHIDs',
- $this->readPHIDsFromRequest($request, 'subscriberPHIDs'));
+ $this->readSubscribersFromRequest($request, 'subscriberPHIDs'));
$saved->setParameter(
'projectPHIDs',
@@ -68,6 +68,14 @@
$author_phids = $datasource->evaluateTokens($author_phids);
$config->setParameter('authorPHIDs', $author_phids);
+
+ $datasource = id(new PhabricatorMetaMTAMailableFunctionDatasource())
+ ->setViewer($viewer);
+ $subscriber_phids = $config->getParameter('subscriberPHIDs', array());
+ $subscriber_phids = $datasource->evaluateTokens($subscriber_phids);
+ $config->setParameter('subscriberPHIDs', $subscriber_phids);
+
+
$query->withSavedQuery($config);
return $query;
@@ -146,7 +154,7 @@
id(new AphrontFormTokenizerControl())
->setName('subscriberPHIDs')
->setLabel('Subscribers')
- ->setDatasource(new PhabricatorMetaMTAMailableDatasource())
+ ->setDatasource(new PhabricatorMetaMTAMailableFunctionDatasource())
->setValue($subscriber_phids))
->appendControl(
id(new AphrontFormTokenizerControl())

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 26, 2:58 AM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6732105
Default Alt Text
D12524.diff (4 KB)

Event Timeline