Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/storage/ManiphestTransaction.php
Show First 20 Lines • Show All 398 Lines • ▼ Show 20 Lines | public function getTitle() { | ||||
$old = $this->getOldValue(); | $old = $this->getOldValue(); | ||||
$new = $this->getNewValue(); | $new = $this->getNewValue(); | ||||
switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
case PhabricatorTransactions::TYPE_CREATE: | case PhabricatorTransactions::TYPE_CREATE: | ||||
return pht( | return pht( | ||||
'%s created this task.', | '%s created this task.', | ||||
$this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
case PhabricatorTransactions::TYPE_SUBTYPE: | |||||
return pht( | |||||
'%s changed the subtype of this task from "%s" to "%s".', | |||||
$this->renderHandleLink($author_phid), | |||||
$this->renderSubtypeName($old), | |||||
$this->renderSubtypeName($new)); | |||||
case self::TYPE_TITLE: | case self::TYPE_TITLE: | ||||
if ($old === null) { | if ($old === null) { | ||||
return pht( | return pht( | ||||
'%s created this task.', | '%s created this task.', | ||||
$this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
} | } | ||||
return pht( | return pht( | ||||
'%s changed the title from "%s" to "%s".', | '%s changed the title from "%s" to "%s".', | ||||
▲ Show 20 Lines • Show All 455 Lines • ▼ Show 20 Lines | switch ($this->getTransactionType()) { | ||||
case self::TYPE_MERGED_FROM: | case self::TYPE_MERGED_FROM: | ||||
return pht( | return pht( | ||||
'%s merged %s task(s) %s into %s.', | '%s merged %s task(s) %s into %s.', | ||||
$this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
phutil_count($new), | phutil_count($new), | ||||
$this->renderHandleList($new), | $this->renderHandleList($new), | ||||
$this->renderHandleLink($object_phid)); | $this->renderHandleLink($object_phid)); | ||||
case PhabricatorTransactions::TYPE_SUBTYPE: | |||||
return pht( | |||||
'%s changed the subtype of %s from "%s" to "%s".', | |||||
$this->renderHandleLink($author_phid), | |||||
$this->renderHandleLink($object_phid), | |||||
$this->renderSubtypeName($old), | |||||
$this->renderSubtypeName($new)); | |||||
} | } | ||||
return parent::getTitleForFeed(); | return parent::getTitleForFeed(); | ||||
} | } | ||||
private function renderSubtypeName($value) { | |||||
$object = $this->getObject(); | |||||
$map = $object->newEditEngineSubtypeMap(); | |||||
if (!isset($map[$value])) { | |||||
return $value; | |||||
} | |||||
return $map[$value]->getName(); | |||||
} | |||||
public function hasChangeDetails() { | public function hasChangeDetails() { | ||||
switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
case self::TYPE_DESCRIPTION: | case self::TYPE_DESCRIPTION: | ||||
return true; | return true; | ||||
} | } | ||||
return parent::hasChangeDetails(); | return parent::hasChangeDetails(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |