Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phriction/storage/PhrictionTransaction.php
Show All 27 Lines | final class PhrictionTransaction | ||||
public function getRequiredHandlePHIDs() { | public function getRequiredHandlePHIDs() { | ||||
$phids = parent::getRequiredHandlePHIDs(); | $phids = parent::getRequiredHandlePHIDs(); | ||||
$new = $this->getNewValue(); | $new = $this->getNewValue(); | ||||
switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
case self::TYPE_MOVE_TO: | case self::TYPE_MOVE_TO: | ||||
case self::TYPE_MOVE_AWAY: | case self::TYPE_MOVE_AWAY: | ||||
$phids[] = $new['phid']; | $phids[] = $new['phid']; | ||||
break; | break; | ||||
case self::TYPE_TITLE: | |||||
if ($this->getMetadataValue('stub:create:phid')) { | |||||
$phids[] = $this->getMetadataValue('stub:create:phid'); | |||||
} | |||||
break; | |||||
} | } | ||||
return $phids; | return $phids; | ||||
} | } | ||||
public function getRemarkupBlocks() { | public function getRemarkupBlocks() { | ||||
$blocks = parent::getRemarkupBlocks(); | $blocks = parent::getRemarkupBlocks(); | ||||
Show All 21 Lines | public function shouldHide() { | ||||
return parent::shouldHide(); | return parent::shouldHide(); | ||||
} | } | ||||
public function shouldHideForMail(array $xactions) { | public function shouldHideForMail(array $xactions) { | ||||
switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
case self::TYPE_MOVE_TO: | case self::TYPE_MOVE_TO: | ||||
case self::TYPE_MOVE_AWAY: | case self::TYPE_MOVE_AWAY: | ||||
return true; | return true; | ||||
case self::TYPE_TITLE: | |||||
return $this->getMetadataValue('stub:create:phid', false); | |||||
} | } | ||||
return parent::shouldHideForMail($xactions); | return parent::shouldHideForMail($xactions); | ||||
} | } | ||||
public function shouldHideForFeed() { | public function shouldHideForFeed() { | ||||
switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
case self::TYPE_MOVE_TO: | case self::TYPE_MOVE_TO: | ||||
case self::TYPE_MOVE_AWAY: | case self::TYPE_MOVE_AWAY: | ||||
return true; | return true; | ||||
case self::TYPE_TITLE: | |||||
return $this->getMetadataValue('stub:create:phid', false); | |||||
} | } | ||||
return parent::shouldHideForFeed(); | return parent::shouldHideForFeed(); | ||||
} | } | ||||
public function getActionStrength() { | public function getActionStrength() { | ||||
switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
case self::TYPE_TITLE: | case self::TYPE_TITLE: | ||||
return 1.4; | return 1.4; | ||||
Show All 11 Lines | final class PhrictionTransaction | ||||
public function getActionName() { | public function getActionName() { | ||||
$old = $this->getOldValue(); | $old = $this->getOldValue(); | ||||
$new = $this->getNewValue(); | $new = $this->getNewValue(); | ||||
switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
case self::TYPE_TITLE: | case self::TYPE_TITLE: | ||||
if ($old === null) { | if ($old === null) { | ||||
if ($this->getMetadataValue('stub:create:phid')) { | |||||
return pht('Stubbed'); | |||||
} else { | |||||
return pht('Created'); | return pht('Created'); | ||||
} | } | ||||
} | |||||
return pht('Retitled'); | return pht('Retitled'); | ||||
case self::TYPE_CONTENT: | case self::TYPE_CONTENT: | ||||
return pht('Edited'); | return pht('Edited'); | ||||
case self::TYPE_DELETE: | case self::TYPE_DELETE: | ||||
return pht('Deleted'); | return pht('Deleted'); | ||||
Show All 32 Lines | public function getTitle() { | ||||
$author_phid = $this->getAuthorPHID(); | $author_phid = $this->getAuthorPHID(); | ||||
$old = $this->getOldValue(); | $old = $this->getOldValue(); | ||||
$new = $this->getNewValue(); | $new = $this->getNewValue(); | ||||
switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
case self::TYPE_TITLE: | case self::TYPE_TITLE: | ||||
if ($old === null) { | if ($old === null) { | ||||
if ($this->getMetadataValue('stub:create:phid')) { | |||||
return pht( | |||||
'%s stubbed out this document when creating %s.', | |||||
$this->renderHandleLink($author_phid), | |||||
$this->renderHandleLink( | |||||
$this->getMetadataValue('stub:create:phid'))); | |||||
} else { | |||||
return pht( | return pht( | ||||
'%s created this document.', | '%s created this document.', | ||||
$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".', | ||||
$this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
$old, | $old, | ||||
$new); | $new); | ||||
case self::TYPE_CONTENT: | case self::TYPE_CONTENT: | ||||
return pht( | return pht( | ||||
▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines |