2017-05-04 20:16:21 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorSlowvoteDescriptionTransaction
|
|
|
|
extends PhabricatorSlowvoteTransactionType {
|
|
|
|
|
|
|
|
const TRANSACTIONTYPE = 'vote:description';
|
|
|
|
|
|
|
|
public function generateOldValue($object) {
|
|
|
|
return $object->getDescription();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function applyInternalEffects($object, $value) {
|
|
|
|
$object->setDescription($value);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getTitle() {
|
|
|
|
return pht(
|
|
|
|
'%s updated the description for this poll.',
|
|
|
|
$this->renderAuthor());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getTitleForFeed() {
|
|
|
|
$old = $this->getOldValue();
|
|
|
|
|
|
|
|
if ($old === null) {
|
|
|
|
return pht(
|
|
|
|
'%s set the description of %s.',
|
|
|
|
$this->renderAuthor(),
|
|
|
|
$this->renderObject());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
return pht(
|
|
|
|
'%s edited the description of %s.',
|
|
|
|
$this->renderAuthor(),
|
|
|
|
$this->renderObject());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-05-08 14:00:26 -07:00
|
|
|
public function hasChangeDetailView() {
|
2017-05-04 20:16:21 -07:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2017-05-08 14:00:26 -07:00
|
|
|
public function getMailDiffSectionHeader() {
|
|
|
|
return pht('CHANGES TO POLL DESCRIPTION');
|
|
|
|
}
|
|
|
|
|
2017-05-04 20:16:21 -07:00
|
|
|
public function newChangeDetailView() {
|
2017-05-08 14:00:26 -07:00
|
|
|
$viewer = $this->getViewer();
|
|
|
|
|
|
|
|
return id(new PhabricatorApplicationTransactionTextDiffDetailView())
|
|
|
|
->setViewer($viewer)
|
|
|
|
->setOldText($this->getOldValue())
|
|
|
|
->setNewText($this->getNewValue());
|
2017-05-04 20:16:21 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public function newRemarkupChanges() {
|
|
|
|
$changes = array();
|
|
|
|
|
|
|
|
$changes[] = $this->newRemarkupChange()
|
|
|
|
->setOldValue($this->getOldValue())
|
|
|
|
->setNewValue($this->getNewValue());
|
|
|
|
|
|
|
|
return $changes;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|