mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 14:52:41 +01:00
Update Slowvote poll status to use sensible string constants
Summary: Ref T13682. This prepares for modernizing Slowvote and exposing a more usable API. Test Plan: Ran migrations, opened and closed polls. Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam Maniphest Tasks: T13682 Differential Revision: https://secure.phabricator.com/D21848
This commit is contained in:
parent
c1887f0c1d
commit
809ae81752
12 changed files with 119 additions and 93 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
ALTER TABLE {$NAMESPACE}_slowvote.slowvote_poll
|
||||||
|
CHANGE isClosed status VARCHAR(32) NOT NULL COLLATE {$COLLATE_TEXT};
|
|
@ -0,0 +1,5 @@
|
||||||
|
UPDATE {$NAMESPACE}_slowvote.slowvote_poll
|
||||||
|
SET status = 'open' WHERE status = '0';
|
||||||
|
|
||||||
|
UPDATE {$NAMESPACE}_slowvote.slowvote_poll
|
||||||
|
SET status = 'closed' WHERE status = '1';
|
|
@ -0,0 +1,19 @@
|
||||||
|
UPDATE {$NAMESPACE}_slowvote.slowvote_transaction
|
||||||
|
SET transactionType = 'vote:status'
|
||||||
|
WHERE transactionType = 'vote:close';
|
||||||
|
|
||||||
|
UPDATE {$NAMESPACE}_slowvote.slowvote_transaction
|
||||||
|
SET oldValue = '"open"' WHERE
|
||||||
|
transactionType = 'vote:status' AND oldValue IN ('0', '"0"', 'false');
|
||||||
|
|
||||||
|
UPDATE {$NAMESPACE}_slowvote.slowvote_transaction
|
||||||
|
SET newValue = '"open"' WHERE
|
||||||
|
transactionType = 'vote:status' AND newValue IN ('0', '"0"', 'false');
|
||||||
|
|
||||||
|
UPDATE {$NAMESPACE}_slowvote.slowvote_transaction
|
||||||
|
SET oldValue = '"closed"' WHERE
|
||||||
|
transactionType = 'vote:status' AND oldValue IN ('1', '"1"', 'true');
|
||||||
|
|
||||||
|
UPDATE {$NAMESPACE}_slowvote.slowvote_transaction
|
||||||
|
SET newValue = '"closed"' WHERE
|
||||||
|
transactionType = 'vote:status' AND newValue IN ('1', '"1"', 'true');
|
|
@ -4833,7 +4833,6 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorSlowvoteApplication' => 'applications/slowvote/application/PhabricatorSlowvoteApplication.php',
|
'PhabricatorSlowvoteApplication' => 'applications/slowvote/application/PhabricatorSlowvoteApplication.php',
|
||||||
'PhabricatorSlowvoteChoice' => 'applications/slowvote/storage/PhabricatorSlowvoteChoice.php',
|
'PhabricatorSlowvoteChoice' => 'applications/slowvote/storage/PhabricatorSlowvoteChoice.php',
|
||||||
'PhabricatorSlowvoteCloseController' => 'applications/slowvote/controller/PhabricatorSlowvoteCloseController.php',
|
'PhabricatorSlowvoteCloseController' => 'applications/slowvote/controller/PhabricatorSlowvoteCloseController.php',
|
||||||
'PhabricatorSlowvoteCloseTransaction' => 'applications/slowvote/xaction/PhabricatorSlowvoteCloseTransaction.php',
|
|
||||||
'PhabricatorSlowvoteCommentController' => 'applications/slowvote/controller/PhabricatorSlowvoteCommentController.php',
|
'PhabricatorSlowvoteCommentController' => 'applications/slowvote/controller/PhabricatorSlowvoteCommentController.php',
|
||||||
'PhabricatorSlowvoteController' => 'applications/slowvote/controller/PhabricatorSlowvoteController.php',
|
'PhabricatorSlowvoteController' => 'applications/slowvote/controller/PhabricatorSlowvoteController.php',
|
||||||
'PhabricatorSlowvoteDAO' => 'applications/slowvote/storage/PhabricatorSlowvoteDAO.php',
|
'PhabricatorSlowvoteDAO' => 'applications/slowvote/storage/PhabricatorSlowvoteDAO.php',
|
||||||
|
@ -4854,6 +4853,7 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorSlowvoteSchemaSpec' => 'applications/slowvote/storage/PhabricatorSlowvoteSchemaSpec.php',
|
'PhabricatorSlowvoteSchemaSpec' => 'applications/slowvote/storage/PhabricatorSlowvoteSchemaSpec.php',
|
||||||
'PhabricatorSlowvoteSearchEngine' => 'applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php',
|
'PhabricatorSlowvoteSearchEngine' => 'applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php',
|
||||||
'PhabricatorSlowvoteShuffleTransaction' => 'applications/slowvote/xaction/PhabricatorSlowvoteShuffleTransaction.php',
|
'PhabricatorSlowvoteShuffleTransaction' => 'applications/slowvote/xaction/PhabricatorSlowvoteShuffleTransaction.php',
|
||||||
|
'PhabricatorSlowvoteStatusTransaction' => 'applications/slowvote/xaction/PhabricatorSlowvoteStatusTransaction.php',
|
||||||
'PhabricatorSlowvoteTransaction' => 'applications/slowvote/storage/PhabricatorSlowvoteTransaction.php',
|
'PhabricatorSlowvoteTransaction' => 'applications/slowvote/storage/PhabricatorSlowvoteTransaction.php',
|
||||||
'PhabricatorSlowvoteTransactionComment' => 'applications/slowvote/storage/PhabricatorSlowvoteTransactionComment.php',
|
'PhabricatorSlowvoteTransactionComment' => 'applications/slowvote/storage/PhabricatorSlowvoteTransactionComment.php',
|
||||||
'PhabricatorSlowvoteTransactionQuery' => 'applications/slowvote/query/PhabricatorSlowvoteTransactionQuery.php',
|
'PhabricatorSlowvoteTransactionQuery' => 'applications/slowvote/query/PhabricatorSlowvoteTransactionQuery.php',
|
||||||
|
@ -11539,7 +11539,6 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorSlowvoteApplication' => 'PhabricatorApplication',
|
'PhabricatorSlowvoteApplication' => 'PhabricatorApplication',
|
||||||
'PhabricatorSlowvoteChoice' => 'PhabricatorSlowvoteDAO',
|
'PhabricatorSlowvoteChoice' => 'PhabricatorSlowvoteDAO',
|
||||||
'PhabricatorSlowvoteCloseController' => 'PhabricatorSlowvoteController',
|
'PhabricatorSlowvoteCloseController' => 'PhabricatorSlowvoteController',
|
||||||
'PhabricatorSlowvoteCloseTransaction' => 'PhabricatorSlowvoteTransactionType',
|
|
||||||
'PhabricatorSlowvoteCommentController' => 'PhabricatorSlowvoteController',
|
'PhabricatorSlowvoteCommentController' => 'PhabricatorSlowvoteController',
|
||||||
'PhabricatorSlowvoteController' => 'PhabricatorController',
|
'PhabricatorSlowvoteController' => 'PhabricatorController',
|
||||||
'PhabricatorSlowvoteDAO' => 'PhabricatorLiskDAO',
|
'PhabricatorSlowvoteDAO' => 'PhabricatorLiskDAO',
|
||||||
|
@ -11571,6 +11570,7 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorSlowvoteSchemaSpec' => 'PhabricatorConfigSchemaSpec',
|
'PhabricatorSlowvoteSchemaSpec' => 'PhabricatorConfigSchemaSpec',
|
||||||
'PhabricatorSlowvoteSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
'PhabricatorSlowvoteSearchEngine' => 'PhabricatorApplicationSearchEngine',
|
||||||
'PhabricatorSlowvoteShuffleTransaction' => 'PhabricatorSlowvoteTransactionType',
|
'PhabricatorSlowvoteShuffleTransaction' => 'PhabricatorSlowvoteTransactionType',
|
||||||
|
'PhabricatorSlowvoteStatusTransaction' => 'PhabricatorSlowvoteTransactionType',
|
||||||
'PhabricatorSlowvoteTransaction' => 'PhabricatorModularTransaction',
|
'PhabricatorSlowvoteTransaction' => 'PhabricatorModularTransaction',
|
||||||
'PhabricatorSlowvoteTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
'PhabricatorSlowvoteTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
||||||
'PhabricatorSlowvoteTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
'PhabricatorSlowvoteTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
final class SlowvotePollStatus
|
final class SlowvotePollStatus
|
||||||
extends Phobject {
|
extends Phobject {
|
||||||
|
|
||||||
const STATUS_OPEN = 0;
|
const STATUS_OPEN = 'open';
|
||||||
const STATUS_CLOSED = 1;
|
const STATUS_CLOSED = 'closed';
|
||||||
|
|
||||||
private $key;
|
private $key;
|
||||||
|
|
||||||
|
@ -47,6 +47,10 @@ final class SlowvotePollStatus
|
||||||
return $this->getProperty('header.tag.color');
|
return $this->getProperty('header.tag.color');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getTransactionIcon() {
|
||||||
|
return $this->getProperty('transaction.icon');
|
||||||
|
}
|
||||||
|
|
||||||
private function getProperty($key, $default = null) {
|
private function getProperty($key, $default = null) {
|
||||||
$spec = idx(self::getMap(), $this->getKey(), array());
|
$spec = idx(self::getMap(), $this->getKey(), array());
|
||||||
return idx($spec, $key, $default);
|
return idx($spec, $key, $default);
|
||||||
|
@ -58,11 +62,13 @@ final class SlowvotePollStatus
|
||||||
'name' => pht('Open'),
|
'name' => pht('Open'),
|
||||||
'header.tag.icon' => 'fa-square-o',
|
'header.tag.icon' => 'fa-square-o',
|
||||||
'header.tag.color' => 'bluegrey',
|
'header.tag.color' => 'bluegrey',
|
||||||
|
'transaction.icon' => 'fa-pencil',
|
||||||
),
|
),
|
||||||
self::STATUS_CLOSED => array(
|
self::STATUS_CLOSED => array(
|
||||||
'name' => pht('Closed'),
|
'name' => pht('Closed'),
|
||||||
'header.tag.icon' => 'fa-ban',
|
'header.tag.icon' => 'fa-ban',
|
||||||
'header.tag.color' => 'indigo',
|
'header.tag.color' => 'indigo',
|
||||||
|
'transaction.icon' => 'fa-ban',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ final class PhabricatorSlowvoteCloseController
|
||||||
return new Aphront404Response();
|
return new Aphront404Response();
|
||||||
}
|
}
|
||||||
|
|
||||||
$close_uri = '/V'.$poll->getID();
|
$close_uri = $poll->getURI();
|
||||||
|
|
||||||
if ($request->isFormPost()) {
|
if ($request->isFormPost()) {
|
||||||
if ($poll->isClosed()) {
|
if ($poll->isClosed()) {
|
||||||
|
@ -33,7 +33,7 @@ final class PhabricatorSlowvoteCloseController
|
||||||
|
|
||||||
$xactions[] = id(new PhabricatorSlowvoteTransaction())
|
$xactions[] = id(new PhabricatorSlowvoteTransaction())
|
||||||
->setTransactionType(
|
->setTransactionType(
|
||||||
PhabricatorSlowvoteCloseTransaction::TRANSACTIONTYPE)
|
PhabricatorSlowvoteStatusTransaction::TRANSACTIONTYPE)
|
||||||
->setNewValue($new_status);
|
->setNewValue($new_status);
|
||||||
|
|
||||||
id(new PhabricatorSlowvoteEditor())
|
id(new PhabricatorSlowvoteEditor())
|
||||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorSlowvoteQuery
|
||||||
private $phids;
|
private $phids;
|
||||||
private $authorPHIDs;
|
private $authorPHIDs;
|
||||||
private $withVotesByViewer;
|
private $withVotesByViewer;
|
||||||
private $isClosed;
|
private $statuses;
|
||||||
|
|
||||||
private $needOptions;
|
private $needOptions;
|
||||||
private $needChoices;
|
private $needChoices;
|
||||||
|
@ -33,8 +33,8 @@ final class PhabricatorSlowvoteQuery
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function withIsClosed($with_closed) {
|
public function withStatuses(array $statuses) {
|
||||||
$this->isClosed = $with_closed;
|
$this->statuses = $statuses;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,12 +137,13 @@ final class PhabricatorSlowvoteQuery
|
||||||
$this->authorPHIDs);
|
$this->authorPHIDs);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->isClosed !== null) {
|
if ($this->statuses !== null) {
|
||||||
$where[] = qsprintf(
|
$where[] = qsprintf(
|
||||||
$conn,
|
$conn,
|
||||||
'p.isClosed = %d',
|
'p.status IN (%Ls)',
|
||||||
(int)$this->isClosed);
|
$this->statuses);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $where;
|
return $where;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,14 +26,8 @@ final class PhabricatorSlowvoteSearchEngine
|
||||||
$query->withAuthorPHIDs($map['authorPHIDs']);
|
$query->withAuthorPHIDs($map['authorPHIDs']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$statuses = $map['statuses'];
|
if ($map['statuses']) {
|
||||||
if (count($statuses) == 1) {
|
$query->withStatuses($map['statuses']);
|
||||||
$status = head($statuses);
|
|
||||||
if ($status == 'open') {
|
|
||||||
$query->withIsClosed(false);
|
|
||||||
} else {
|
|
||||||
$query->withIsClosed(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
|
@ -41,6 +35,9 @@ final class PhabricatorSlowvoteSearchEngine
|
||||||
|
|
||||||
protected function buildCustomSearchFields() {
|
protected function buildCustomSearchFields() {
|
||||||
|
|
||||||
|
$status_options = SlowvotePollStatus::getAll();
|
||||||
|
$status_options = mpull($status_options, 'getName');
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
id(new PhabricatorUsersSearchField())
|
id(new PhabricatorUsersSearchField())
|
||||||
->setKey('authorPHIDs')
|
->setKey('authorPHIDs')
|
||||||
|
@ -61,11 +58,7 @@ final class PhabricatorSlowvoteSearchEngine
|
||||||
id(new PhabricatorSearchCheckboxesField())
|
id(new PhabricatorSearchCheckboxesField())
|
||||||
->setKey('statuses')
|
->setKey('statuses')
|
||||||
->setLabel(pht('Statuses'))
|
->setLabel(pht('Statuses'))
|
||||||
->setOptions(
|
->setOptions($status_options),
|
||||||
array(
|
|
||||||
'open' => pht('Open'),
|
|
||||||
'closed' => pht('Closed'),
|
|
||||||
)),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,9 +130,9 @@ final class PhabricatorSlowvoteSearchEngine
|
||||||
$item = id(new PHUIObjectItemView())
|
$item = id(new PHUIObjectItemView())
|
||||||
->setUser($viewer)
|
->setUser($viewer)
|
||||||
->setObject($poll)
|
->setObject($poll)
|
||||||
->setObjectName('V'.$poll->getID())
|
->setObjectName($poll->getMonogram())
|
||||||
->setHeader($poll->getQuestion())
|
->setHeader($poll->getQuestion())
|
||||||
->setHref('/V'.$poll->getID())
|
->setHref($poll->getURI())
|
||||||
->addIcon('none', $date_created);
|
->addIcon('none', $date_created);
|
||||||
|
|
||||||
if ($poll->isClosed()) {
|
if ($poll->isClosed()) {
|
||||||
|
|
|
@ -20,7 +20,7 @@ final class PhabricatorSlowvotePoll
|
||||||
protected $shuffle = 0;
|
protected $shuffle = 0;
|
||||||
protected $method;
|
protected $method;
|
||||||
protected $viewPolicy;
|
protected $viewPolicy;
|
||||||
protected $isClosed;
|
protected $status;
|
||||||
protected $spacePHID;
|
protected $spacePHID;
|
||||||
|
|
||||||
private $options = self::ATTACHABLE;
|
private $options = self::ATTACHABLE;
|
||||||
|
@ -43,7 +43,7 @@ final class PhabricatorSlowvotePoll
|
||||||
->setAuthorPHID($actor->getPHID())
|
->setAuthorPHID($actor->getPHID())
|
||||||
->setViewPolicy($view_policy)
|
->setViewPolicy($view_policy)
|
||||||
->setSpacePHID($actor->getDefaultSpacePHID())
|
->setSpacePHID($actor->getDefaultSpacePHID())
|
||||||
->setIsClosed(SlowvotePollStatus::STATUS_OPEN)
|
->setStatus(SlowvotePollStatus::STATUS_OPEN)
|
||||||
->setMethod($default_method)
|
->setMethod($default_method)
|
||||||
->setResponseVisibility($default_responses);
|
->setResponseVisibility($default_responses);
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ final class PhabricatorSlowvotePoll
|
||||||
'shuffle' => 'bool',
|
'shuffle' => 'bool',
|
||||||
'method' => 'text32',
|
'method' => 'text32',
|
||||||
'description' => 'text',
|
'description' => 'text',
|
||||||
'isClosed' => 'bool',
|
'status' => 'text32',
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
),
|
),
|
||||||
|
@ -69,11 +69,11 @@ final class PhabricatorSlowvotePoll
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getStatusObject() {
|
public function getStatusObject() {
|
||||||
return SlowvotePollStatus::newStatusObject($this->getIsClosed());
|
return SlowvotePollStatus::newStatusObject($this->getStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isClosed() {
|
public function isClosed() {
|
||||||
return ($this->getIsClosed() == SlowvotePollStatus::STATUS_CLOSED);
|
return ($this->getStatus() == SlowvotePollStatus::STATUS_CLOSED);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOptions() {
|
public function getOptions() {
|
||||||
|
|
|
@ -30,7 +30,7 @@ final class PhabricatorSlowvoteTransaction
|
||||||
case PhabricatorSlowvoteQuestionTransaction::TRANSACTIONTYPE:
|
case PhabricatorSlowvoteQuestionTransaction::TRANSACTIONTYPE:
|
||||||
case PhabricatorSlowvoteDescriptionTransaction::TRANSACTIONTYPE:
|
case PhabricatorSlowvoteDescriptionTransaction::TRANSACTIONTYPE:
|
||||||
case PhabricatorSlowvoteShuffleTransaction::TRANSACTIONTYPE:
|
case PhabricatorSlowvoteShuffleTransaction::TRANSACTIONTYPE:
|
||||||
case PhabricatorSlowvoteCloseTransaction::TRANSACTIONTYPE:
|
case PhabricatorSlowvoteStatusTransaction::TRANSACTIONTYPE:
|
||||||
$tags[] = self::MAILTAG_DETAILS;
|
$tags[] = self::MAILTAG_DETAILS;
|
||||||
break;
|
break;
|
||||||
case PhabricatorSlowvoteResponsesTransaction::TRANSACTIONTYPE:
|
case PhabricatorSlowvoteResponsesTransaction::TRANSACTIONTYPE:
|
||||||
|
|
|
@ -1,60 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
final class PhabricatorSlowvoteCloseTransaction
|
|
||||||
extends PhabricatorSlowvoteTransactionType {
|
|
||||||
|
|
||||||
const TRANSACTIONTYPE = 'vote:close';
|
|
||||||
|
|
||||||
public function generateOldValue($object) {
|
|
||||||
return (bool)$object->getIsClosed();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function generateNewValue($object, $value) {
|
|
||||||
return (bool)$value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function applyInternalEffects($object, $value) {
|
|
||||||
$object->setIsClosed((int)$value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTitle() {
|
|
||||||
$new = $this->getNewValue();
|
|
||||||
|
|
||||||
if ($new) {
|
|
||||||
return pht(
|
|
||||||
'%s closed this poll.',
|
|
||||||
$this->renderAuthor());
|
|
||||||
} else {
|
|
||||||
return pht(
|
|
||||||
'%s reopened this poll.',
|
|
||||||
$this->renderAuthor());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTitleForFeed() {
|
|
||||||
$new = $this->getNewValue();
|
|
||||||
|
|
||||||
if ($new) {
|
|
||||||
return pht(
|
|
||||||
'%s closed %s.',
|
|
||||||
$this->renderAuthor(),
|
|
||||||
$this->renderObject());
|
|
||||||
} else {
|
|
||||||
return pht(
|
|
||||||
'%s reopened %s.',
|
|
||||||
$this->renderAuthor(),
|
|
||||||
$this->renderObject());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getIcon() {
|
|
||||||
$new = $this->getNewValue();
|
|
||||||
|
|
||||||
if ($new) {
|
|
||||||
return 'fa-ban';
|
|
||||||
} else {
|
|
||||||
return 'fa-pencil';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,60 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class PhabricatorSlowvoteStatusTransaction
|
||||||
|
extends PhabricatorSlowvoteTransactionType {
|
||||||
|
|
||||||
|
const TRANSACTIONTYPE = 'vote:status';
|
||||||
|
|
||||||
|
public function generateOldValue($object) {
|
||||||
|
return (string)$object->getStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function generateNewValue($object, $value) {
|
||||||
|
return (string)$value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function applyInternalEffects($object, $value) {
|
||||||
|
$object->setStatus($value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTitle() {
|
||||||
|
$old_name = $this->getOldStatusObject()->getName();
|
||||||
|
$new_name = $this->getNewStatusObject()->getName();
|
||||||
|
|
||||||
|
return pht(
|
||||||
|
'%s changed the status of this poll from %s to %s.',
|
||||||
|
$this->renderAuthor(),
|
||||||
|
$this->renderValue($old_name),
|
||||||
|
$this->renderValue($new_name));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTitleForFeed() {
|
||||||
|
$old_name = $this->getOldStatusObject()->getName();
|
||||||
|
$new_name = $this->getNewStatusObject()->getName();
|
||||||
|
|
||||||
|
|
||||||
|
return pht(
|
||||||
|
'%s changed the status of %s from %s to %s.',
|
||||||
|
$this->renderAuthor(),
|
||||||
|
$this->renderObject(),
|
||||||
|
$this->renderValue($old_name),
|
||||||
|
$this->renderValue($new_name));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getIcon() {
|
||||||
|
return $this->getNewStatusObject()->getTransactionIcon();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getOldStatusObject() {
|
||||||
|
return $this->newStatusObject($this->getOldValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getNewStatusObject() {
|
||||||
|
return $this->newStatusObject($this->getNewValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
private function newStatusObject($value) {
|
||||||
|
return SlowvotePollStatus::newStatusObject($value);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue