1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 06:20:56 +01:00
phorge-phorge/src/applications/fund/xaction/FundInitiativeStatusTransaction.php
Chad Little f717e4b563 Clean up some Fund language
Summary: Ref T12685. Cleans up various Fund language nits.

Test Plan: Read carefully.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T12685

Differential Revision: https://secure.phabricator.com/D17856
2017-05-08 21:11:45 -07:00

51 lines
1.1 KiB
PHP

<?php
final class FundInitiativeStatusTransaction
extends FundInitiativeTransactionType {
const TRANSACTIONTYPE = 'fund:status';
public function generateOldValue($object) {
return $object->getStatus();
}
public function applyInternalEffects($object, $value) {
$object->setStatus($value);
}
public function getTitle() {
if ($this->getNewValue() == FundInitiative::STATUS_CLOSED) {
return pht(
'%s closed this initiative.',
$this->renderAuthor());
} else {
return pht(
'%s reopened this initiative.',
$this->renderAuthor());
}
}
public function getTitleForFeed() {
if ($this->getNewValue() == FundInitiative::STATUS_CLOSED) {
return pht(
'%s closed %s.',
$this->renderAuthor(),
$this->renderObject());
} else {
return pht(
'%s reopened %s.',
$this->renderAuthor(),
$this->renderObject());
}
}
public function getIcon() {
if ($this->getNewValue() == FundInitiative::STATUS_CLOSED) {
return 'fa-ban';
} else {
return 'fa-check';
}
}
}