@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.

at upstream/main 96 lines 2.5 kB view raw
1<?php 2 3final class PhabricatorCountdownEditor 4 extends PhabricatorApplicationTransactionEditor { 5 6 public function getEditorApplicationClass() { 7 return PhabricatorCountdownApplication::class; 8 } 9 10 public function getEditorObjectsDescription() { 11 return pht('Countdown'); 12 } 13 14 public function getTransactionTypes() { 15 $types = parent::getTransactionTypes(); 16 17 $types[] = PhabricatorTransactions::TYPE_EDGE; 18 $types[] = PhabricatorTransactions::TYPE_SPACE; 19 $types[] = PhabricatorTransactions::TYPE_VIEW_POLICY; 20 $types[] = PhabricatorTransactions::TYPE_EDIT_POLICY; 21 $types[] = PhabricatorTransactions::TYPE_COMMENT; 22 23 return $types; 24 } 25 26 protected function shouldSendMail( 27 PhabricatorLiskDAO $object, 28 array $xactions) { 29 return true; 30 } 31 32 public function getMailTagsMap() { 33 return array( 34 PhabricatorCountdownTransaction::MAILTAG_DETAILS => 35 pht('Someone changes the countdown details.'), 36 PhabricatorCountdownTransaction::MAILTAG_COMMENT => 37 pht('Someone comments on a countdown.'), 38 PhabricatorCountdownTransaction::MAILTAG_OTHER => 39 pht('Other countdown activity not listed above occurs.'), 40 ); 41 } 42 43 protected function buildMailTemplate(PhabricatorLiskDAO $object) { 44 $monogram = $object->getMonogram(); 45 $name = $object->getTitle(); 46 47 return id(new PhabricatorMetaMTAMail()) 48 ->setSubject("{$monogram}: {$name}"); 49 } 50 51 protected function buildMailBody( 52 PhabricatorLiskDAO $object, 53 array $xactions) { 54 55 $body = parent::buildMailBody($object, $xactions); 56 $description = $object->getDescription(); 57 58 if (strlen($description)) { 59 $body->addRemarkupSection( 60 pht('COUNTDOWN DESCRIPTION'), 61 $object->getDescription()); 62 } 63 64 $body->addLinkSection( 65 pht('COUNTDOWN DETAIL'), 66 PhabricatorEnv::getProductionURI('/'.$object->getMonogram())); 67 68 return $body; 69 } 70 71 protected function getMailTo(PhabricatorLiskDAO $object) { 72 return array( 73 $object->getAuthorPHID(), 74 $this->requireActor()->getPHID(), 75 ); 76 } 77 protected function getMailSubjectPrefix() { 78 return '[Countdown]'; 79 } 80 81 protected function buildReplyHandler(PhabricatorLiskDAO $object) { 82 return id(new PhabricatorCountdownReplyHandler()) 83 ->setMailReceiver($object); 84 } 85 86 protected function shouldPublishFeedStory( 87 PhabricatorLiskDAO $object, 88 array $xactions) { 89 return true; 90 } 91 92 protected function supportsSearch() { 93 return true; 94 } 95 96}