Page MenuHomePhabricator

D18935.diff
No OneTemporary

D18935.diff

diff --git a/src/applications/base/PhabricatorApplication.php b/src/applications/base/PhabricatorApplication.php
--- a/src/applications/base/PhabricatorApplication.php
+++ b/src/applications/base/PhabricatorApplication.php
@@ -623,7 +623,7 @@
}
protected function getQueryRoutePattern($base = null) {
- return $base.'(?:query/(?P<queryKey>[^/]+)/(?:(?P<queryAction>[^/]+)/))?';
+ return $base.'(?:query/(?P<queryKey>[^/]+)/(?:(?P<queryAction>[^/]+)/)?)?';
}
protected function getProfileMenuRouting($controller) {
diff --git a/src/applications/people/application/PhabricatorPeopleApplication.php b/src/applications/people/application/PhabricatorPeopleApplication.php
--- a/src/applications/people/application/PhabricatorPeopleApplication.php
+++ b/src/applications/people/application/PhabricatorPeopleApplication.php
@@ -41,7 +41,7 @@
public function getRoutes() {
return array(
'/people/' => array(
- '(query/(?P<key>[^/]+)/)?' => 'PhabricatorPeopleListController',
+ $this->getQueryRoutePattern() => 'PhabricatorPeopleListController',
'logs/(?:query/(?P<queryKey>[^/]+)/)?'
=> 'PhabricatorPeopleLogsController',
'invite/' => array(
@@ -76,7 +76,7 @@
'PhabricatorPeopleProfilePictureController',
'manage/(?P<id>[1-9]\d*)/' =>
'PhabricatorPeopleProfileManageController',
- ),
+ ),
'/p/(?P<username>[\w._-]+)/' => array(
'' => 'PhabricatorPeopleProfileViewController',
'item/' => $this->getProfileMenuRouting(
diff --git a/src/applications/people/controller/PhabricatorPeopleListController.php b/src/applications/people/controller/PhabricatorPeopleListController.php
--- a/src/applications/people/controller/PhabricatorPeopleListController.php
+++ b/src/applications/people/controller/PhabricatorPeopleListController.php
@@ -16,7 +16,7 @@
PeopleBrowseUserDirectoryCapability::CAPABILITY);
$controller = id(new PhabricatorApplicationSearchController())
- ->setQueryKey($request->getURIData('key'))
+ ->setQueryKey($request->getURIData('queryKey'))
->setSearchEngine(new PhabricatorPeopleSearchEngine())
->setNavigation($this->buildSideNavView());
diff --git a/src/applications/people/query/PhabricatorPeopleSearchEngine.php b/src/applications/people/query/PhabricatorPeopleSearchEngine.php
--- a/src/applications/people/query/PhabricatorPeopleSearchEngine.php
+++ b/src/applications/people/query/PhabricatorPeopleSearchEngine.php
@@ -320,4 +320,41 @@
return $result;
}
+ protected function newExportFields() {
+ return array(
+ id(new PhabricatorIDExportField())
+ ->setKey('id')
+ ->setLabel(pht('ID')),
+ id(new PhabricatorPHIDExportField())
+ ->setKey('phid')
+ ->setLabel(pht('PHID')),
+ id(new PhabricatorStringExportField())
+ ->setKey('username')
+ ->setLabel(pht('Username')),
+ id(new PhabricatorStringExportField())
+ ->setKey('realName')
+ ->setLabel(pht('Real Name')),
+ id(new PhabricatorEpochExportField())
+ ->setKey('created')
+ ->setLabel(pht('Date Created')),
+ );
+ }
+
+ public function newExport(array $users) {
+ $viewer = $this->requireViewer();
+
+ $export = array();
+ foreach ($users as $user) {
+ $export[] = array(
+ 'id' => $user->getID(),
+ 'phid' => $user->getPHID(),
+ 'username' => $user->getUsername(),
+ 'realName' => $user->getRealName(),
+ 'created' => $user->getDateCreated(),
+ );
+ }
+
+ return $export;
+ }
+
}
diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php
--- a/src/applications/search/controller/PhabricatorApplicationSearchController.php
+++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php
@@ -396,9 +396,12 @@
->setViewer($viewer)
->withQueryKeys(array($query_key))
->executeOne();
- if (!$saved_query) {
- return new Aphront404Response();
- }
+ } else {
+ $saved_query = null;
+ }
+
+ if (!$saved_query) {
+ return new Aphront404Response();
}
$cancel_uri = $engine->getQueryResultsPageURI($query_key);

File Metadata

Mime Type
text/plain
Expires
Thu, May 9, 8:05 PM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6276339
Default Alt Text
D18935.diff (4 KB)

Event Timeline