From 69f06387cb84dc4540ce625b8819eb2aa4a17e82 Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Thu, 5 Feb 2015 12:26:54 -0800 Subject: [PATCH] People - add back "add new user" ui Summary: This got clobbered in D11547. Revive the code but move it up from the base class to the PeopleList controller which is presumably all the main "admin" views. Fixes T7181. Test Plan: Saw the button once more on /people/...! Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7181 Differential Revision: https://secure.phabricator.com/D11698 --- .../PhabricatorPeopleListController.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/applications/people/controller/PhabricatorPeopleListController.php b/src/applications/people/controller/PhabricatorPeopleListController.php index 3888ddfa8a..a4d23cc856 100644 --- a/src/applications/people/controller/PhabricatorPeopleListController.php +++ b/src/applications/people/controller/PhabricatorPeopleListController.php @@ -29,4 +29,21 @@ final class PhabricatorPeopleListController return $this->delegateToController($controller); } + protected function buildApplicationCrumbs() { + $crumbs = parent::buildApplicationCrumbs(); + $viewer = $this->getRequest()->getUser(); + + $can_create = $this->hasApplicationCapability( + PeopleCreateUsersCapability::CAPABILITY); + $crumbs->addAction( + id(new PHUIListItemView()) + ->setName(pht('Create New User')) + ->setHref($this->getApplicationURI('create/')) + ->setDisabled(!$can_create) + ->setIcon('fa-plus-square')); + + return $crumbs; + } + + }