Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14014876
D15533.id37447.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D15533.id37447.diff
View Options
diff --git a/src/applications/badges/storage/PhabricatorBadgesTransaction.php b/src/applications/badges/storage/PhabricatorBadgesTransaction.php
--- a/src/applications/badges/storage/PhabricatorBadgesTransaction.php
+++ b/src/applications/badges/storage/PhabricatorBadgesTransaction.php
@@ -109,6 +109,26 @@
$qual_new);
}
break;
+ case self::TYPE_AWARD:
+ if (!is_array($new)) {
+ $new = array();
+ }
+ $handles = $this->renderHandleList($new);
+ return pht(
+ '%s awarded %s recipient(s): %s.',
+ $this->renderHandleLink($author_phid),
+ new PhutilNumber(count($new)),
+ $handles);
+ case self::TYPE_REVOKE:
+ if (!is_array($new)) {
+ $new = array();
+ }
+ $handles = $this->renderHandleList($new);
+ return pht(
+ '%s revoked badge of %s recipient(s): %s.',
+ $this->renderHandleLink($author_phid),
+ new PhutilNumber(count($new)),
+ $handles);
}
return parent::getTitle();
@@ -223,4 +243,24 @@
$this->getOldValue(),
$this->getNewValue());
}
+
+ public function getRequiredHandlePHIDs() {
+ $phids = parent::getRequiredHandlePHIDs();
+
+ $type = $this->getTransactionType();
+ switch ($type) {
+ case self::TYPE_AWARD:
+ case self::TYPE_REVOKE:
+ $new = $this->getNewValue();
+ if (!is_array($new)) {
+ $new = array();
+ }
+ foreach ($new as $phid) {
+ $phids[] = $phid;
+ }
+ break;
+ }
+
+ return $phids;
+ }
}
diff --git a/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php b/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php
--- a/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php
+++ b/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php
@@ -1528,6 +1528,20 @@
'%s removed watchers for %3$s: %4$s.',
),
),
+
+ '%s awarded %s recipient(s): %s.' => array(
+ array(
+ '%s awarded recipient: %3$s.',
+ '%s awarded recipients: %3$s.',
+ ),
+ ),
+
+ '%s revoked badge of %s recipient(s): %s.' => array(
+ array(
+ '%s revoked badge of recipient: %3$s.',
+ '%s revoked badge of recipients: %3$s.',
+ ),
+ ),
);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 4, 9:09 AM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6745089
Default Alt Text
D15533.id37447.diff (2 KB)
Attached To
Mode
D15533: Adding basic transaction titles to awarding/revoking badges
Attached
Detach File
Event Timeline
Log In to Comment