From 12f3f6d3a9ef9c7731051815846810cb3c4cd248 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Sat, 22 Nov 2014 12:49:16 -0800 Subject: [PATCH] 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 --- .../PhabricatorProjectApplication.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/applications/project/application/PhabricatorProjectApplication.php b/src/applications/project/application/PhabricatorProjectApplication.php index 4d84b2af4e..568d25d944 100644 --- a/src/applications/project/application/PhabricatorProjectApplication.php +++ b/src/applications/project/application/PhabricatorProjectApplication.php @@ -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() { return array( ProjectCreateProjectsCapability::CAPABILITY => array(),