@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Allow ordering of badges by quality

Summary: Ref T9007

Test Plan: Navigate to "Advanced Search" in Badges, order by rarity, then by commonality. Rarest and most common badges should be ordered, respectively.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Maniphest Tasks: T9007

Differential Revision: https://secure.phabricator.com/D15555

+32
+32
src/applications/badges/query/PhabricatorBadgesQuery.php
··· 105 105 return 'PhabricatorBadgesApplication'; 106 106 } 107 107 108 + public function getBuiltinOrders() { 109 + return array( 110 + 'quality' => array( 111 + 'vector' => array('quality', 'id'), 112 + 'name' => pht('Rarity (Rarest First)'), 113 + ), 114 + 'shoddiness' => array( 115 + 'vector' => array('-quality', '-id'), 116 + 'name' => pht('Rarity (Most Common First)'), 117 + ), 118 + ) + parent::getBuiltinOrders(); 119 + } 120 + 121 + public function getOrderableColumns() { 122 + return array( 123 + 'quality' => array( 124 + 'table' => $this->getPrimaryTableAlias(), 125 + 'column' => 'quality', 126 + 'reverse' => true, 127 + 'type' => 'int', 128 + ), 129 + ) + parent::getOrderableColumns(); 130 + } 131 + 132 + protected function getPagingValueMap($cursor, array $keys) { 133 + $badge = $this->loadCursorObject($cursor); 134 + return array( 135 + 'quality' => $badge->getQuality(), 136 + 'id' => $badge->getID(), 137 + ); 138 + } 139 + 108 140 }