Remove needBadges from PhabricatorUser
Summary: Ref T12270. We don't really need these, timeline does it's own thing, badges is now a profile page, and hovercards have been removed. Test Plan: Visit timeline, still see badges, visit my profile page, bask in the warmth of fake awards. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T12270 Differential Revision: https://secure.phabricator.com/D17448
This commit is contained in:
@@ -13,7 +13,6 @@ final class PhabricatorPeopleProfileBadgesController
|
|||||||
->needProfile(true)
|
->needProfile(true)
|
||||||
->needProfileImage(true)
|
->needProfileImage(true)
|
||||||
->needAvailability(true)
|
->needAvailability(true)
|
||||||
->needBadges(true)
|
|
||||||
->requireCapabilities(
|
->requireCapabilities(
|
||||||
array(
|
array(
|
||||||
PhabricatorPolicyCapability::CAN_VIEW,
|
PhabricatorPolicyCapability::CAN_VIEW,
|
||||||
@@ -82,9 +81,6 @@ final class PhabricatorPeopleProfileBadgesController
|
|||||||
private function buildBadgesView(PhabricatorUser $user) {
|
private function buildBadgesView(PhabricatorUser $user) {
|
||||||
$viewer = $this->getViewer();
|
$viewer = $this->getViewer();
|
||||||
|
|
||||||
$awards = array();
|
|
||||||
$badges = array();
|
|
||||||
if ($user->getBadgePHIDs()) {
|
|
||||||
$awards = id(new PhabricatorBadgesAwardQuery())
|
$awards = id(new PhabricatorBadgesAwardQuery())
|
||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
->withRecipientPHIDs(array($user->getPHID()))
|
->withRecipientPHIDs(array($user->getPHID()))
|
||||||
@@ -98,7 +94,6 @@ final class PhabricatorPeopleProfileBadgesController
|
|||||||
$badges[$award->getBadgePHID()] = $badge;
|
$badges[$award->getBadgePHID()] = $badge;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (count($badges)) {
|
if (count($badges)) {
|
||||||
$flex = new PHUIBadgeBoxView();
|
$flex = new PHUIBadgeBoxView();
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ final class PhabricatorPeopleQuery
|
|||||||
private $needProfile;
|
private $needProfile;
|
||||||
private $needProfileImage;
|
private $needProfileImage;
|
||||||
private $needAvailability;
|
private $needAvailability;
|
||||||
private $needBadges;
|
|
||||||
private $cacheKeys = array();
|
private $cacheKeys = array();
|
||||||
|
|
||||||
public function withIDs(array $ids) {
|
public function withIDs(array $ids) {
|
||||||
@@ -128,11 +127,6 @@ final class PhabricatorPeopleQuery
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function needBadges($need) {
|
|
||||||
$this->needBadges = $need;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function needUserSettings($need) {
|
public function needUserSettings($need) {
|
||||||
$cache_key = PhabricatorUserPreferencesCacheType::KEY_PREFERENCES;
|
$cache_key = PhabricatorUserPreferencesCacheType::KEY_PREFERENCES;
|
||||||
|
|
||||||
@@ -180,21 +174,6 @@ final class PhabricatorPeopleQuery
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->needBadges) {
|
|
||||||
$awards = id(new PhabricatorBadgesAwardQuery())
|
|
||||||
->setViewer($this->getViewer())
|
|
||||||
->withRecipientPHIDs(mpull($users, 'getPHID'))
|
|
||||||
->execute();
|
|
||||||
|
|
||||||
$awards = mgroup($awards, 'getRecipientPHID');
|
|
||||||
|
|
||||||
foreach ($users as $user) {
|
|
||||||
$user_awards = idx($awards, $user->getPHID(), array());
|
|
||||||
$badge_phids = mpull($user_awards, 'getBadgePHID');
|
|
||||||
$user->attachBadgePHIDs($badge_phids);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->needAvailability) {
|
if ($this->needAvailability) {
|
||||||
$rebuild = array();
|
$rebuild = array();
|
||||||
foreach ($users as $user) {
|
foreach ($users as $user) {
|
||||||
|
|||||||
Reference in New Issue
Block a user