1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 12:00:55 +01:00

Add Project to quick create menu

Summary: Helpful shortcut, I make quite a few at least

Test Plan: Click on dropdown, then Project. Get to Project Create page

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D10893
This commit is contained in:
Chad Little 2014-11-22 12:49:16 -08:00
parent 32b1ffdf89
commit 12f3f6d3a9

View file

@ -92,6 +92,24 @@ final class PhabricatorProjectApplication extends PhabricatorApplication {
); );
} }
public function getQuickCreateItems(PhabricatorUser $viewer) {
$can_create = PhabricatorPolicyFilter::hasCapability(
$viewer,
$this,
ProjectCreateProjectsCapability::CAPABILITY);
$items = array();
if ($can_create) {
$item = id(new PHUIListItemView())
->setName(pht('Project'))
->setIcon('fa-briefcase')
->setHref($this->getBaseURI().'create/');
$items[] = $item;
}
return $items;
}
protected function getCustomCapabilities() { protected function getCustomCapabilities() {
return array( return array(
ProjectCreateProjectsCapability::CAPABILITY => array(), ProjectCreateProjectsCapability::CAPABILITY => array(),