mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 20:10:55 +01:00
Add addLinkSection to MailBody to properly format URIs
Summary: Fixes T6343. Grepped for all callsites and added addLinkSection where needed. Test Plan: Tested Differential, Maniphest, Conpherence, Ponder and Macro. Inspect HTML mail for anchor tags. Inspect text mails for non-disruption. Reviewers: epriestley, btrahan Reviewed By: btrahan Subscribers: talshiri, Korvin, epriestley Maniphest Tasks: T6343 Differential Revision: https://secure.phabricator.com/D10762
This commit is contained in:
parent
a9fc343d9e
commit
1ac84c1b59
17 changed files with 23 additions and 18 deletions
|
@ -678,7 +678,7 @@ final class PhabricatorAuditEditor
|
|||
$monogram = $object->getRepository()->formatCommitName(
|
||||
$object->getCommitIdentifier());
|
||||
|
||||
$body->addTextSection(
|
||||
$body->addLinkSection(
|
||||
pht('COMMIT'),
|
||||
PhabricatorEnv::getProductionURI('/'.$monogram));
|
||||
|
||||
|
|
|
@ -405,7 +405,7 @@ final class ConpherenceEditor extends PhabricatorApplicationTransactionEditor {
|
|||
array $xactions) {
|
||||
|
||||
$body = parent::buildMailBody($object, $xactions);
|
||||
$body->addTextSection(
|
||||
$body->addLinkSection(
|
||||
pht('CONPHERENCE DETAIL'),
|
||||
PhabricatorEnv::getProductionURI('/conpherence/'.$object->getID().'/'));
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ final class DifferentialChangesSinceLastUpdateField
|
|||
$uri = '/'.$revision->getMonogram().'?vs='.$old_id.'&id='.$new_id;
|
||||
$uri = PhabricatorEnv::getProductionURI($uri);
|
||||
|
||||
$body->addTextSection(pht('CHANGES SINCE LAST UPDATE'), $uri);
|
||||
$body->addLinkSection(pht('CHANGES SINCE LAST UPDATE'), $uri);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1140,7 +1140,7 @@ final class DifferentialTransactionEditor
|
|||
|
||||
$changed_uri = $this->getChangedPriorToCommitURI();
|
||||
if ($changed_uri) {
|
||||
$body->addTextSection(
|
||||
$body->addLinkSection(
|
||||
pht('CHANGED PRIOR TO COMMIT'),
|
||||
$changed_uri);
|
||||
}
|
||||
|
@ -1151,7 +1151,7 @@ final class DifferentialTransactionEditor
|
|||
$this->renderInlineCommentsForMail($object, $inlines));
|
||||
}
|
||||
|
||||
$body->addTextSection(
|
||||
$body->addLinkSection(
|
||||
pht('REVISION DETAIL'),
|
||||
PhabricatorEnv::getProductionURI('/D'.$object->getID()));
|
||||
|
||||
|
|
|
@ -267,7 +267,7 @@ final class FundInitiativeEditor
|
|||
|
||||
$body = parent::buildMailBody($object, $xactions);
|
||||
|
||||
$body->addTextSection(
|
||||
$body->addLinkSection(
|
||||
pht('INITIATIVE DETAIL'),
|
||||
PhabricatorEnv::getProductionURI('/'.$object->getMonogram()));
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ final class LegalpadDocumentEditor
|
|||
|
||||
$body = parent::buildMailBody($object, $xactions);
|
||||
|
||||
$body->addTextSection(
|
||||
$body->addLinkSection(
|
||||
pht('DOCUMENT DETAIL'),
|
||||
PhabricatorEnv::getProductionURI('/legalpad/view/'.$object->getID().'/'));
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ final class PhabricatorMacroEditor
|
|||
array $xactions) {
|
||||
|
||||
$body = parent::buildMailBody($object, $xactions);
|
||||
$body->addTextSection(
|
||||
$body->addLinkSection(
|
||||
pht('MACRO DETAIL'),
|
||||
PhabricatorEnv::getProductionURI('/macro/view/'.$object->getID().'/'));
|
||||
|
||||
|
|
|
@ -497,7 +497,7 @@ final class ManiphestTransactionEditor
|
|||
$object->getDescription());
|
||||
}
|
||||
|
||||
$body->addTextSection(
|
||||
$body->addLinkSection(
|
||||
pht('TASK DETAIL'),
|
||||
PhabricatorEnv::getProductionURI('/T'.$object->getID()));
|
||||
|
||||
|
|
|
@ -82,7 +82,13 @@ final class PhabricatorMetaMTAMailBody {
|
|||
phutil_tag('div', array('style' => 'font-weight:800;'), $header),
|
||||
$html_fragment,
|
||||
);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addLinkSection($header, $link) {
|
||||
$html = phutil_tag('a', array('href' => $link), $link);
|
||||
$this->addPlaintextSection($header, $link);
|
||||
$this->addHTMLSection($header, $html);
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -98,7 +104,7 @@ final class PhabricatorMetaMTAMailBody {
|
|||
return $this;
|
||||
}
|
||||
|
||||
$this->addTextSection(
|
||||
$this->addLinkSection(
|
||||
pht('WHY DID I GET THIS EMAIL?'),
|
||||
PhabricatorEnv::getProductionURI($xscript_uri));
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ final class PhabricatorMetaMTAMailSection {
|
|||
public function addHTMLFragment($fragment) {
|
||||
$this->htmlFragments[] = $fragment;
|
||||
return $this;
|
||||
|
||||
}
|
||||
|
||||
public function addPlaintextFragment($fragment) {
|
||||
|
|
|
@ -167,7 +167,7 @@ final class PhabricatorPasteEditor
|
|||
|
||||
$body = parent::buildMailBody($object, $xactions);
|
||||
|
||||
$body->addTextSection(
|
||||
$body->addLinkSection(
|
||||
pht('PASTE DETAIL'),
|
||||
PhabricatorEnv::getProductionURI('/P'.$object->getID()));
|
||||
|
||||
|
|
|
@ -409,7 +409,7 @@ final class PholioMockEditor extends PhabricatorApplicationTransactionEditor {
|
|||
}
|
||||
}
|
||||
|
||||
$body->addTextSection(
|
||||
$body->addLinkSection(
|
||||
pht('MOCK DETAIL'),
|
||||
PhabricatorEnv::getProductionURI('/M'.$object->getID()));
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ final class PhortuneCartEditor
|
|||
|
||||
$body->addTextSection(pht('ORDER CONTENTS'), implode("\n", $items));
|
||||
|
||||
$body->addTextSection(
|
||||
$body->addLinkSection(
|
||||
pht('ORDER DETAIL'),
|
||||
PhabricatorEnv::getProductionURI('/phortune/cart/'.$object->getID().'/'));
|
||||
|
||||
|
|
|
@ -242,7 +242,7 @@ final class PhrictionTransactionEditor
|
|||
$object->getContent()->getContent());
|
||||
}
|
||||
|
||||
$body->addTextSection(
|
||||
$body->addLinkSection(
|
||||
pht('DOCUMENT DETAIL'),
|
||||
PhabricatorEnv::getProductionURI(
|
||||
PhrictionDocument::getSlugURI($object->getSlug())));
|
||||
|
|
|
@ -98,7 +98,7 @@ final class PonderAnswerEditor extends PonderEditor {
|
|||
}
|
||||
}
|
||||
|
||||
$body->addTextSection(
|
||||
$body->addLinkSection(
|
||||
pht('ANSWER DETAIL'),
|
||||
PhabricatorEnv::getProductionURI($object->getURI()));
|
||||
|
||||
|
|
|
@ -243,7 +243,7 @@ final class PonderQuestionEditor
|
|||
}
|
||||
}
|
||||
|
||||
$body->addTextSection(
|
||||
$body->addLinkSection(
|
||||
$header,
|
||||
PhabricatorEnv::getProductionURI($uri));
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ final class PhabricatorRepositoryPushMailWorker
|
|||
$body = new PhabricatorMetaMTAMailBody();
|
||||
$body->addRawSection($overview);
|
||||
|
||||
$body->addTextSection(pht('DETAILS'), $details_uri);
|
||||
$body->addLinkSection(pht('DETAILS'), $details_uri);
|
||||
|
||||
if ($commit_lines) {
|
||||
$body->addTextSection(pht('COMMITS'), implode("\n", $commit_lines));
|
||||
|
|
Loading…
Reference in a new issue