@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.

Adding basic transaction titles to awarding/revoking badges

Summary: Ref T10677, awarding/revoking a badge should create timeline entries with titles that are more clear (excludes homepage feed stories)

Test Plan: Award/revoke a badge to single or multiple users. See timeline entries that reflect those actions.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Maniphest Tasks: T10677

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

+54
+40
src/applications/badges/storage/PhabricatorBadgesTransaction.php
··· 109 109 $qual_new); 110 110 } 111 111 break; 112 + case self::TYPE_AWARD: 113 + if (!is_array($new)) { 114 + $new = array(); 115 + } 116 + $handles = $this->renderHandleList($new); 117 + return pht( 118 + '%s awarded this badge to %s recipient(s): %s.', 119 + $this->renderHandleLink($author_phid), 120 + new PhutilNumber(count($new)), 121 + $handles); 122 + case self::TYPE_REVOKE: 123 + if (!is_array($new)) { 124 + $new = array(); 125 + } 126 + $handles = $this->renderHandleList($new); 127 + return pht( 128 + '%s revoked this badge from %s recipient(s): %s.', 129 + $this->renderHandleLink($author_phid), 130 + new PhutilNumber(count($new)), 131 + $handles); 112 132 } 113 133 114 134 return parent::getTitle(); ··· 222 242 $viewer, 223 243 $this->getOldValue(), 224 244 $this->getNewValue()); 245 + } 246 + 247 + public function getRequiredHandlePHIDs() { 248 + $phids = parent::getRequiredHandlePHIDs(); 249 + 250 + $type = $this->getTransactionType(); 251 + switch ($type) { 252 + case self::TYPE_AWARD: 253 + case self::TYPE_REVOKE: 254 + $new = $this->getNewValue(); 255 + if (!is_array($new)) { 256 + $new = array(); 257 + } 258 + foreach ($new as $phid) { 259 + $phids[] = $phid; 260 + } 261 + break; 262 + } 263 + 264 + return $phids; 225 265 } 226 266 }
+14
src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php
··· 1528 1528 '%s removed watchers for %3$s: %4$s.', 1529 1529 ), 1530 1530 ), 1531 + 1532 + '%s awarded this badge to %s recipient(s): %s.' => array( 1533 + array( 1534 + '%s awarded this badge to recipient: %3$s.', 1535 + '%s awarded this badge to recipients: %3$s.', 1536 + ), 1537 + ), 1538 + 1539 + '%s revoked this badge from %s recipient(s): %s.' => array( 1540 + array( 1541 + '%s revoked this badge from recipient: %3$s.', 1542 + '%s revoked this badge from recipients: %3$s.', 1543 + ), 1544 + ), 1531 1545 ); 1532 1546 } 1533 1547