@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Allow transactions to specialize their mail headers for diff sections

Summary: Ref T7643. When we send mail about a change to a package description, allow it to say "CHANGES TO PACKAGE DESCRIPTION" instead of "EDIT DETAILS". Smooth!

Test Plan: {F1909417}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7643

Differential Revision: https://secure.phabricator.com/D16818

+35 -1
+4
src/applications/calendar/xaction/PhabricatorCalendarEventDescriptionTransaction.php
··· 30 30 return true; 31 31 } 32 32 33 + public function getMailDiffSectionHeader() { 34 + return pht('CHANGES TO EVENT DESCRIPTION'); 35 + } 36 + 33 37 public function newChangeDetailView() { 34 38 $viewer = $this->getViewer(); 35 39
+4
src/applications/owners/xaction/PhabricatorOwnersPackageDescriptionTransaction.php
··· 19 19 $this->renderAuthor()); 20 20 } 21 21 22 + public function getMailDiffSectionHeader() { 23 + return pht('CHANGES TO PACKAGE DESCRIPTION'); 24 + } 25 + 22 26 public function newChangeDetailView() { 23 27 return id(new PhabricatorApplicationTransactionTextDiffDetailView()) 24 28 ->setViewer($this->getViewer())
+4
src/applications/paste/xaction/PhabricatorPasteContentTransaction.php
··· 104 104 return true; 105 105 } 106 106 107 + public function getMailDiffSectionHeader() { 108 + return pht('CHANGES TO PASTE CONTENT'); 109 + } 110 + 107 111 public function newChangeDetailView() { 108 112 $viewer = $this->getViewer(); 109 113
+19 -1
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 1141 1141 PhabricatorLiskDAO $object, 1142 1142 array $xactions) { 1143 1143 1144 + $this->object = $object; 1145 + $this->xactions = $xactions; 1146 + 1144 1147 // Hook for edges or other properties that may need (re-)loading 1145 1148 $object = $this->willPublish($object, $xactions); 1149 + 1150 + // The object might have changed, so reassign it. 1151 + $this->object = $object; 1146 1152 1147 1153 $messages = array(); 1148 1154 if (!$this->getDisableEmail()) { ··· 2871 2877 foreach ($details as $xaction) { 2872 2878 $details = $xaction->renderChangeDetailsForMail($body->getViewer()); 2873 2879 if ($details !== null) { 2874 - $body->addHTMLSection(pht('EDIT DETAILS'), $details); 2880 + $label = $this->getMailDiffSectionHeader($xaction); 2881 + $body->addHTMLSection($label, $details); 2875 2882 } 2876 2883 } 2877 2884 2885 + } 2886 + 2887 + private function getMailDiffSectionHeader($xaction) { 2888 + $type = $xaction->getTransactionType(); 2889 + 2890 + $xtype = $this->getModularTransactionType($type); 2891 + if ($xtype) { 2892 + return $xtype->getMailDiffSectionHeader(); 2893 + } 2894 + 2895 + return pht('EDIT DETAILS'); 2878 2896 } 2879 2897 2880 2898 /**
+4
src/applications/transactions/storage/PhabricatorModularTransactionType.php
··· 67 67 throw new PhutilMethodNotImplementedException(); 68 68 } 69 69 70 + public function getMailDiffSectionHeader() { 71 + return pht('EDIT DETAILS'); 72 + } 73 + 70 74 public function newRemarkupChanges() { 71 75 return array(); 72 76 }