Path: blob/master/src/applications/herald/editor/HeraldRuleEditor.php
12256 views
<?php12final class HeraldRuleEditor3extends PhabricatorApplicationTransactionEditor {45public function getEditorApplicationClass() {6return 'PhabricatorHeraldApplication';7}89public function getEditorObjectsDescription() {10return pht('Herald Rules');11}1213protected function shouldApplyHeraldRules(14PhabricatorLiskDAO $object,15array $xactions) {16return true;17}1819protected function buildHeraldAdapter(20PhabricatorLiskDAO $object,21array $xactions) {22return id(new HeraldRuleAdapter())23->setRule($object);24}2526protected function shouldSendMail(27PhabricatorLiskDAO $object,28array $xactions) {29return true;30}3132public function getTransactionTypes() {33$types = parent::getTransactionTypes();34$types[] = PhabricatorTransactions::TYPE_EDGE;35return $types;36}3738protected function getMailTo(PhabricatorLiskDAO $object) {39$phids = array();4041$phids[] = $this->getActingAsPHID();4243if ($object->isPersonalRule()) {44$phids[] = $object->getAuthorPHID();45}4647return $phids;48}4950protected function buildReplyHandler(PhabricatorLiskDAO $object) {51return id(new HeraldRuleReplyHandler())52->setMailReceiver($object);53}5455protected function buildMailTemplate(PhabricatorLiskDAO $object) {56$monogram = $object->getMonogram();57$name = $object->getName();5859$subject = pht('%s: %s', $monogram, $name);6061return id(new PhabricatorMetaMTAMail())62->setSubject($subject);63}6465protected function getMailSubjectPrefix() {66return pht('[Herald]');67}6869protected function buildMailBody(70PhabricatorLiskDAO $object,71array $xactions) {7273$body = parent::buildMailBody($object, $xactions);7475$body->addLinkSection(76pht('RULE DETAIL'),77PhabricatorEnv::getProductionURI($object->getURI()));7879return $body;80}8182protected function supportsSearch() {83return true;84}8586}878889