Changeset View
Changeset View
Standalone View
Standalone View
src/applications/herald/editor/HeraldRuleEditor.php
| Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | switch ($xaction->getTransactionType()) { | ||||
| case HeraldRuleTransaction::TYPE_EDIT: | case HeraldRuleTransaction::TYPE_EDIT: | ||||
| $object->saveConditions($object->getConditions()); | $object->saveConditions($object->getConditions()); | ||||
| $object->saveActions($object->getActions()); | $object->saveActions($object->getActions()); | ||||
| break; | break; | ||||
| } | } | ||||
| return; | return; | ||||
| } | } | ||||
| protected function shouldApplyHeraldRules( | |||||
| PhabricatorLiskDAO $object, | |||||
| array $xactions) { | |||||
| return true; | |||||
| } | |||||
| protected function buildHeraldAdapter( | |||||
| PhabricatorLiskDAO $object, | |||||
| array $xactions) { | |||||
| return id(new HeraldRuleAdapter()) | |||||
| ->setRule($object); | |||||
| } | |||||
| protected function shouldSendMail( | |||||
| PhabricatorLiskDAO $object, | |||||
| array $xactions) { | |||||
| return true; | |||||
| } | |||||
| protected function getMailTo(PhabricatorLiskDAO $object) { | |||||
| $phids = array(); | |||||
| $phids[] = $this->getActingAsPHID(); | |||||
| if ($object->isPersonalRule()) { | |||||
| $phids[] = $object->getAuthorPHID(); | |||||
| } | |||||
| return $phids; | |||||
| } | |||||
| protected function buildReplyHandler(PhabricatorLiskDAO $object) { | |||||
| return id(new HeraldRuleReplyHandler()) | |||||
| ->setMailReceiver($object); | |||||
| } | |||||
| protected function buildMailTemplate(PhabricatorLiskDAO $object) { | |||||
| $monogram = $object->getMonogram(); | |||||
| $name = $object->getName(); | |||||
| $subject = pht('%s: %s', $monogram, $name); | |||||
| return id(new PhabricatorMetaMTAMail()) | |||||
| ->setSubject($subject); | |||||
| } | |||||
| protected function getMailSubjectPrefix() { | |||||
| return pht('[Herald]'); | |||||
| } | |||||
| } | } | ||||