Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / fund / xaction / FundInitiativeRisksTransaction.php
blob183f9caa6777533391ad23306aa120911dfd72ed
1 <?php
3 final class FundInitiativeRisksTransaction
4 extends FundInitiativeTransactionType {
6 const TRANSACTIONTYPE = 'fund:risks';
8 public function generateOldValue($object) {
9 return $object->getRisks();
12 public function applyInternalEffects($object, $value) {
13 $object->setRisks($value);
16 public function shouldHide() {
17 $old = $this->getOldValue();
18 $new = $this->getNewValue();
19 if (!strlen($old) && !strlen($new)) {
20 return true;
22 return false;
25 public function getTitle() {
26 $old = $this->getOldValue();
27 $new = $this->getNewValue();
29 if ($old === null) {
30 return pht(
31 '%s set the initiative risks/challenges.',
32 $this->renderAuthor());
33 } else {
34 return pht(
35 '%s updated the initiative risks/challenges.',
36 $this->renderAuthor());
41 public function getTitleForFeed() {
42 return pht(
43 '%s updated the initiative risks/challenges for %s.',
44 $this->renderAuthor(),
45 $this->renderObject());
48 public function hasChangeDetailView() {
49 return true;
52 public function getMailDiffSectionHeader() {
53 return pht('CHANGES TO INITIATIVE RISKS/CHALLENGES');
56 public function newChangeDetailView() {
57 $viewer = $this->getViewer();
59 return id(new PhabricatorApplicationTransactionTextDiffDetailView())
60 ->setViewer($viewer)
61 ->setOldText($this->getOldValue())
62 ->setNewText($this->getNewValue());
65 public function newRemarkupChanges() {
66 $changes = array();
68 $changes[] = $this->newRemarkupChange()
69 ->setOldValue($this->getOldValue())
70 ->setNewValue($this->getNewValue());
72 return $changes;
75 public function getIcon() {
76 return 'fa-ambulance';