Differential D19541 Diff 46728 src/applications/differential/editor/DifferentialTransactionEditor.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/editor/DifferentialTransactionEditor.php
Show First 20 Lines • Show All 618 Lines • ▼ Show 20 Lines | protected function buildMailBody( | ||||
PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
array $xactions) { | array $xactions) { | ||||
$viewer = $this->requireActor(); | $viewer = $this->requireActor(); | ||||
$body = new PhabricatorMetaMTAMailBody(); | $body = new PhabricatorMetaMTAMailBody(); | ||||
$body->setViewer($this->requireActor()); | $body->setViewer($this->requireActor()); | ||||
$revision_uri = PhabricatorEnv::getProductionURI('/D'.$object->getID()); | $revision_uri = $object->getURI(); | ||||
$revision_uri = PhabricatorEnv::getProductionURI($revision_uri); | |||||
$new_uri = $revision_uri.'/new/'; | |||||
$this->addHeadersAndCommentsToMailBody( | $this->addHeadersAndCommentsToMailBody( | ||||
$body, | $body, | ||||
$xactions, | $xactions, | ||||
pht('View Revision'), | pht('View Revision'), | ||||
$revision_uri); | $revision_uri); | ||||
$type_inline = DifferentialTransaction::TYPE_INLINE; | $type_inline = DifferentialTransaction::TYPE_INLINE; | ||||
$inlines = array(); | $inlines = array(); | ||||
foreach ($xactions as $xaction) { | foreach ($xactions as $xaction) { | ||||
if ($xaction->getTransactionType() == $type_inline) { | if ($xaction->getTransactionType() == $type_inline) { | ||||
$inlines[] = $xaction; | $inlines[] = $xaction; | ||||
} | } | ||||
} | } | ||||
if ($inlines) { | if ($inlines) { | ||||
$this->appendInlineCommentsForMail($object, $inlines, $body); | $this->appendInlineCommentsForMail($object, $inlines, $body); | ||||
} | } | ||||
$update_xaction = null; | |||||
foreach ($xactions as $xaction) { | |||||
switch ($xaction->getTransactionType()) { | |||||
case DifferentialRevisionUpdateTransaction::TRANSACTIONTYPE: | |||||
$update_xaction = $xaction; | |||||
break; | |||||
} | |||||
} | |||||
if ($update_xaction) { | |||||
$diff = $this->requireDiff($update_xaction->getNewValue(), true); | |||||
} else { | |||||
$diff = null; | |||||
} | |||||
$changed_uri = $this->getChangedPriorToCommitURI(); | $changed_uri = $this->getChangedPriorToCommitURI(); | ||||
if ($changed_uri) { | if ($changed_uri) { | ||||
$body->addLinkSection( | $body->addLinkSection( | ||||
pht('CHANGED PRIOR TO COMMIT'), | pht('CHANGED PRIOR TO COMMIT'), | ||||
$changed_uri); | $changed_uri); | ||||
} | } | ||||
$this->addCustomFieldsToMailBody($body, $object, $xactions); | $this->addCustomFieldsToMailBody($body, $object, $xactions); | ||||
if (!$this->getIsNewObject()) { | |||||
$body->addLinkSection(pht('CHANGES SINCE LAST ACTION'), $new_uri); | |||||
} | |||||
$body->addLinkSection( | $body->addLinkSection( | ||||
pht('REVISION DETAIL'), | pht('REVISION DETAIL'), | ||||
$revision_uri); | $revision_uri); | ||||
$update_xaction = null; | |||||
foreach ($xactions as $xaction) { | |||||
switch ($xaction->getTransactionType()) { | |||||
case DifferentialRevisionUpdateTransaction::TRANSACTIONTYPE: | |||||
$update_xaction = $xaction; | |||||
break; | |||||
} | |||||
} | |||||
if ($update_xaction) { | if ($update_xaction) { | ||||
$diff = $this->requireDiff($update_xaction->getNewValue(), true); | |||||
$body->addTextSection( | $body->addTextSection( | ||||
pht('AFFECTED FILES'), | pht('AFFECTED FILES'), | ||||
$this->renderAffectedFilesForMail($diff)); | $this->renderAffectedFilesForMail($diff)); | ||||
$config_key_inline = 'metamta.differential.inline-patches'; | $config_key_inline = 'metamta.differential.inline-patches'; | ||||
$config_inline = PhabricatorEnv::getEnvConfig($config_key_inline); | $config_inline = PhabricatorEnv::getEnvConfig($config_key_inline); | ||||
$config_key_attach = 'metamta.differential.attach-patches'; | $config_key_attach = 'metamta.differential.attach-patches'; | ||||
▲ Show 20 Lines • Show All 1,033 Lines • Show Last 20 Lines |