Page MenuHomePhabricator

D15533.id37447.diff
No OneTemporary

D15533.id37447.diff

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

Mime Type
text/plain
Expires
Wed, Oct 23, 8:47 PM (3 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6745089
Default Alt Text
D15533.id37447.diff (2 KB)

Event Timeline