2012-08-05 14:12:43 -07:00
|
|
|
<?php
|
|
|
|
|
2014-07-23 10:03:09 +10:00
|
|
|
final class PhabricatorPeopleApplication extends PhabricatorApplication {
|
2012-08-05 14:12:43 -07:00
|
|
|
|
2014-07-23 23:52:50 +10:00
|
|
|
public function getName() {
|
|
|
|
return pht('People');
|
|
|
|
}
|
|
|
|
|
2012-08-05 14:12:43 -07:00
|
|
|
public function getShortDescription() {
|
2014-05-29 12:17:54 -07:00
|
|
|
return pht('User Accounts and Profiles');
|
2012-08-05 14:12:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getBaseURI() {
|
|
|
|
return '/people/';
|
|
|
|
}
|
|
|
|
|
2012-08-13 15:27:21 -07:00
|
|
|
public function getTitleGlyph() {
|
|
|
|
return "\xE2\x99\x9F";
|
|
|
|
}
|
|
|
|
|
2016-01-28 08:40:22 -08:00
|
|
|
public function getIcon() {
|
2015-01-24 23:41:43 -08:00
|
|
|
return 'fa-users';
|
|
|
|
}
|
|
|
|
|
(Redesign) Clean up older "Tile" code
Summary:
This does some backend cleanup of the tile stuff, and some general cleanup of other application things:
- Users who haven't customized preferences get a small, specific set of pinned applications: Differential, Maniphest, Diffusion, Audit, Phriction, Projects (and, for administrators, Auth, Config and People).
- Old tile size methods are replaced with `isPinnnedByDefault()`.
- Shortened some short descriptions.
- `shouldAppearInLaunchView()` replaced by less ambiguous `isLaunchable()`.
- Added a marker for third-party / extension applications.
Test Plan: Faked away my preferences and viewed the home page, saw a smaller set of default pins.
Reviewers: chad
Reviewed By: chad
Subscribers: epriestley
Differential Revision: https://secure.phabricator.com/D9358
2014-06-03 15:47:27 -07:00
|
|
|
public function isPinnedByDefault(PhabricatorUser $viewer) {
|
|
|
|
return $viewer->getIsAdmin();
|
|
|
|
}
|
|
|
|
|
2012-10-03 15:16:26 -07:00
|
|
|
public function getFlavorText() {
|
|
|
|
return pht('Sort of a social utility.');
|
|
|
|
}
|
|
|
|
|
2016-08-11 20:04:25 -07:00
|
|
|
public function getApplicationGroup() {
|
|
|
|
return self::GROUP_UTILITIES;
|
|
|
|
}
|
|
|
|
|
2013-01-29 09:14:03 -08:00
|
|
|
public function canUninstall() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-08-05 14:12:43 -07:00
|
|
|
public function getRoutes() {
|
|
|
|
return array(
|
|
|
|
'/people/' => array(
|
2018-01-25 17:48:42 -08:00
|
|
|
$this->getQueryRoutePattern() => 'PhabricatorPeopleListController',
|
2018-01-30 06:27:36 -08:00
|
|
|
'logs/' => array(
|
|
|
|
$this->getQueryRoutePattern() => 'PhabricatorPeopleLogsController',
|
2019-07-19 15:24:37 -07:00
|
|
|
'(?P<id>\d+)/' => 'PhabricatorPeopleLogViewController',
|
2018-01-30 06:27:36 -08:00
|
|
|
),
|
2015-02-11 06:05:53 -08:00
|
|
|
'invite/' => array(
|
|
|
|
'(?:query/(?P<queryKey>[^/]+)/)?'
|
|
|
|
=> 'PhabricatorPeopleInviteListController',
|
|
|
|
'send/'
|
|
|
|
=> 'PhabricatorPeopleInviteSendController',
|
|
|
|
),
|
2019-02-07 07:06:16 -08:00
|
|
|
'approve/(?P<id>[1-9]\d*)/(?:via/(?P<via>[^/]+)/)?'
|
|
|
|
=> 'PhabricatorPeopleApproveController',
|
2014-04-02 12:05:49 -07:00
|
|
|
'(?P<via>disapprove)/(?P<id>[1-9]\d*)/'
|
|
|
|
=> 'PhabricatorPeopleDisableController',
|
|
|
|
'(?P<via>disable)/(?P<id>[1-9]\d*)/'
|
|
|
|
=> 'PhabricatorPeopleDisableController',
|
|
|
|
'empower/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleEmpowerController',
|
2014-04-02 12:05:07 -07:00
|
|
|
'delete/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleDeleteController',
|
2014-04-02 12:05:19 -07:00
|
|
|
'rename/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleRenameController',
|
2014-04-02 12:06:17 -07:00
|
|
|
'welcome/(?P<id>[1-9]\d*)/' => 'PhabricatorPeopleWelcomeController',
|
2014-04-02 12:06:27 -07:00
|
|
|
'create/' => 'PhabricatorPeopleCreateController',
|
|
|
|
'new/(?P<type>[^/]+)/' => 'PhabricatorPeopleNewController',
|
2013-06-07 09:55:55 -07:00
|
|
|
'editprofile/(?P<id>[1-9]\d*)/' =>
|
|
|
|
'PhabricatorPeopleProfileEditController',
|
2017-02-24 13:15:30 -08:00
|
|
|
'badges/(?P<id>[1-9]\d*)/' =>
|
|
|
|
'PhabricatorPeopleProfileBadgesController',
|
2017-03-06 09:54:34 -08:00
|
|
|
'tasks/(?P<id>[1-9]\d*)/' =>
|
|
|
|
'PhabricatorPeopleProfileTasksController',
|
|
|
|
'commits/(?P<id>[1-9]\d*)/' =>
|
|
|
|
'PhabricatorPeopleProfileCommitsController',
|
2017-05-21 09:24:26 -07:00
|
|
|
'revisions/(?P<id>[1-9]\d*)/' =>
|
|
|
|
'PhabricatorPeopleProfileRevisionsController',
|
2013-07-09 16:23:54 -07:00
|
|
|
'picture/(?P<id>[1-9]\d*)/' =>
|
|
|
|
'PhabricatorPeopleProfilePictureController',
|
2016-01-24 07:07:17 -08:00
|
|
|
'manage/(?P<id>[1-9]\d*)/' =>
|
|
|
|
'PhabricatorPeopleProfileManageController',
|
2018-01-25 17:48:42 -08:00
|
|
|
),
|
2016-01-14 06:47:06 -08:00
|
|
|
'/p/(?P<username>[\w._-]+)/' => array(
|
|
|
|
'' => 'PhabricatorPeopleProfileViewController',
|
|
|
|
),
|
2012-08-05 14:12:43 -07:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2013-07-09 16:23:33 -07:00
|
|
|
public function getRemarkupRules() {
|
|
|
|
return array(
|
2014-08-05 00:55:43 +10:00
|
|
|
new PhabricatorMentionRemarkupRule(),
|
2013-07-09 16:23:33 -07:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2014-01-30 11:53:49 -08:00
|
|
|
protected function getCustomCapabilities() {
|
|
|
|
return array(
|
2015-01-12 15:18:16 -08:00
|
|
|
PeopleCreateUsersCapability::CAPABILITY => array(
|
|
|
|
'default' => PhabricatorPolicies::POLICY_ADMIN,
|
|
|
|
),
|
2018-08-14 08:50:32 -07:00
|
|
|
PeopleDisableUsersCapability::CAPABILITY => array(
|
|
|
|
'default' => PhabricatorPolicies::POLICY_ADMIN,
|
|
|
|
),
|
2014-07-25 08:20:39 +10:00
|
|
|
PeopleBrowseUserDirectoryCapability::CAPABILITY => array(),
|
2014-01-30 11:53:49 -08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
Implement a scope selector for the global search
Summary:
See M1433. Fixes T7266. Fixes T4475. Ref T7314.
Future work/notes/etc:
- Write the User Guide (see TODO).
- This might needs some design tweaks -- I think it's functionally almost-equivalent to the mock, but the UI isn't quite the same.
- (Mobile design is a touch off-looking I think?)
- When you use a custom query, the duplicate "magnifying glass" icons are a little weird. Maybe change one or the other.
- Maybe worth adding an "Open Documents in Current Application" option? Planning to wait for feedback on that.
- Need a Quicksand integration to change the current application at some point.
- Searching in "Current Application" from, e.g., the 404 page just searches all documents. Current plan is to just document this behavior, since the icon is a pretty good callout and it seems plausible that this is intuitive enough that users won't have a hard time with it.
Test Plan:
New dropdown:
{F379150}
Device-ish:
{F379151}
Normal search (current application, from maniphest, selects tasks):
{F379153}
Application search from non-application:
{F379154}
Reviewers: btrahan, chad
Reviewed By: chad
Subscribers: johnny-bit, epriestley
Maniphest Tasks: T7266, T7314, T4475
Differential Revision: https://secure.phabricator.com/D12509
2015-04-22 14:31:36 -07:00
|
|
|
public function getApplicationSearchDocumentTypes() {
|
|
|
|
return array(
|
|
|
|
PhabricatorPeopleUserPHIDType::TYPECONST,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2012-08-05 14:12:43 -07:00
|
|
|
}
|