Differential D11146 Diff 26758 src/applications/transactions/storage/PhabricatorApplicationTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/storage/PhabricatorApplicationTransaction.php
| Show First 20 Lines • Show All 722 Lines • ▼ Show 20 Lines | switch ($this->getTransactionType()) { | ||||
| default: | default: | ||||
| return pht( | return pht( | ||||
| '%s edited this %s.', | '%s edited this %s.', | ||||
| $this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
| $this->getApplicationObjectTypeName()); | $this->getApplicationObjectTypeName()); | ||||
| } | } | ||||
| } | } | ||||
| public function getTitleForFeed(PhabricatorFeedStory $story) { | public function getTitleForFeed() { | ||||
| $author_phid = $this->getAuthorPHID(); | $author_phid = $this->getAuthorPHID(); | ||||
| $object_phid = $this->getObjectPHID(); | $object_phid = $this->getObjectPHID(); | ||||
| $old = $this->getOldValue(); | $old = $this->getOldValue(); | ||||
| $new = $this->getNewValue(); | $new = $this->getNewValue(); | ||||
| switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
| case PhabricatorTransactions::TYPE_COMMENT: | case PhabricatorTransactions::TYPE_COMMENT: | ||||
| ▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | switch ($this->getTransactionType()) { | ||||
| '%s edited edge metadata for %s.', | '%s edited edge metadata for %s.', | ||||
| $this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
| $this->renderHandleLink($object_phid)); | $this->renderHandleLink($object_phid)); | ||||
| } | } | ||||
| case PhabricatorTransactions::TYPE_CUSTOMFIELD: | case PhabricatorTransactions::TYPE_CUSTOMFIELD: | ||||
| $field = $this->getTransactionCustomField(); | $field = $this->getTransactionCustomField(); | ||||
| if ($field) { | if ($field) { | ||||
| return $field->getApplicationTransactionTitleForFeed($this, $story); | return $field->getApplicationTransactionTitleForFeed($this); | ||||
| } else { | } else { | ||||
| return pht( | return pht( | ||||
| '%s edited a custom field on %s.', | '%s edited a custom field on %s.', | ||||
| $this->renderHandleLink($author_phid), | $this->renderHandleLink($author_phid), | ||||
| $this->renderHandleLink($object_phid)); | $this->renderHandleLink($object_phid)); | ||||
| } | } | ||||
| case PhabricatorTransactions::TYPE_BUILDABLE: | case PhabricatorTransactions::TYPE_BUILDABLE: | ||||
| switch ($this->getNewValue()) { | switch ($this->getNewValue()) { | ||||
| ▲ Show 20 Lines • Show All 283 Lines • ▼ Show 20 Lines | foreach ($xactions as $xaction) { | ||||
| $old_target = $xaction->getRenderingTarget(); | $old_target = $xaction->getRenderingTarget(); | ||||
| $new_target = PhabricatorApplicationTransaction::TARGET_TEXT; | $new_target = PhabricatorApplicationTransaction::TARGET_TEXT; | ||||
| $xaction->setRenderingTarget($new_target); | $xaction->setRenderingTarget($new_target); | ||||
| if ($publisher->getRenderWithImpliedContext()) { | if ($publisher->getRenderWithImpliedContext()) { | ||||
| $text[] = $xaction->getTitle(); | $text[] = $xaction->getTitle(); | ||||
| } else { | } else { | ||||
| $text[] = $xaction->getTitleForFeed($story); | $text[] = $xaction->getTitleForFeed(); | ||||
| } | } | ||||
| $xaction->setRenderingTarget($old_target); | $xaction->setRenderingTarget($old_target); | ||||
| } | } | ||||
| $text = implode("\n", $text); | $text = implode("\n", $text); | ||||
| $body = implode("\n\n", $body); | $body = implode("\n\n", $body); | ||||
| ▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines | |||||