Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/editor/ManiphestTransactionEditor.php
| <?php | <?php | ||||
| final class ManiphestTransactionEditor | final class ManiphestTransactionEditor | ||||
| extends PhabricatorApplicationTransactionEditor { | extends PhabricatorApplicationTransactionEditor { | ||||
| private $heraldEmailPHIDs = array(); | private $heraldEmailPHIDs = array(); | ||||
| public function getEditorApplicationClass() { | public function getEditorApplicationClass() { | ||||
| return 'PhabricatorManiphestApplication'; | return 'PhabricatorManiphestApplication'; | ||||
| } | } | ||||
| public function getEditorObjectsDescription() { | public function getEditorObjectsDescription() { | ||||
| return pht('Maniphest Tasks'); | return pht('Maniphest Tasks'); | ||||
| } | } | ||||
| protected function getTransactionEmailWorkerClass() { | |||||
| return 'PhabricatorManiphestTransactionEmailWorker'; | |||||
| } | |||||
| public function getTransactionTypes() { | public function getTransactionTypes() { | ||||
| $types = parent::getTransactionTypes(); | $types = parent::getTransactionTypes(); | ||||
| $types[] = PhabricatorTransactions::TYPE_COMMENT; | $types[] = PhabricatorTransactions::TYPE_COMMENT; | ||||
| $types[] = PhabricatorTransactions::TYPE_EDGE; | $types[] = PhabricatorTransactions::TYPE_EDGE; | ||||
| $types[] = ManiphestTransaction::TYPE_PRIORITY; | $types[] = ManiphestTransaction::TYPE_PRIORITY; | ||||
| $types[] = ManiphestTransaction::TYPE_STATUS; | $types[] = ManiphestTransaction::TYPE_STATUS; | ||||
| $types[] = ManiphestTransaction::TYPE_TITLE; | $types[] = ManiphestTransaction::TYPE_TITLE; | ||||
| ▲ Show 20 Lines • Show All 377 Lines • ▼ Show 20 Lines | final class ManiphestTransactionEditor | ||||
| protected function shouldSendMail( | protected function shouldSendMail( | ||||
| PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
| array $xactions) { | array $xactions) { | ||||
| $xactions = mfilter($xactions, 'shouldHide', true); | $xactions = mfilter($xactions, 'shouldHide', true); | ||||
| return $xactions; | return $xactions; | ||||
| } | } | ||||
| protected function getMailSubjectPrefix() { | /* protected function getMailSubjectPrefix() { | ||||
| return PhabricatorEnv::getEnvConfig('metamta.maniphest.subject-prefix'); | return PhabricatorEnv::getEnvConfig('metamta.maniphest.subject-prefix'); | ||||
| } | } | ||||
| protected function getMailThreadID(PhabricatorLiskDAO $object) { | protected function getMailThreadID(PhabricatorLiskDAO $object) { | ||||
| return 'maniphest-task-'.$object->getPHID(); | return 'maniphest-task-'.$object->getPHID(); | ||||
| } | }*/ | ||||
| protected function getMailTo(PhabricatorLiskDAO $object) { | protected function getMailTo(PhabricatorLiskDAO $object) { | ||||
| return array( | return array( | ||||
| $object->getOwnerPHID(), | $object->getOwnerPHID(), | ||||
| $this->getActingAsPHID(), | $this->getActingAsPHID(), | ||||
| ); | ); | ||||
| } | } | ||||
| protected function getMailCC(PhabricatorLiskDAO $object) { | protected function getMailCC(PhabricatorLiskDAO $object) { | ||||
| $phids = array(); | $phids = array(); | ||||
| foreach (parent::getMailCC($object) as $phid) { | foreach (parent::getMailCC($object) as $phid) { | ||||
| $phids[] = $phid; | $phids[] = $phid; | ||||
| } | } | ||||
| foreach ($this->heraldEmailPHIDs as $phid) { | foreach ($this->heraldEmailPHIDs as $phid) { | ||||
| $phids[] = $phid; | $phids[] = $phid; | ||||
| } | } | ||||
| return $phids; | return $phids; | ||||
| } | } | ||||
| public function getMailTagsMap() { | /* public function getMailTagsMap() { | ||||
| return array( | return array( | ||||
| ManiphestTransaction::MAILTAG_STATUS => | ManiphestTransaction::MAILTAG_STATUS => | ||||
| pht("A task's status changes."), | pht("A task's status changes."), | ||||
| ManiphestTransaction::MAILTAG_OWNER => | ManiphestTransaction::MAILTAG_OWNER => | ||||
| pht("A task's owner changes."), | pht("A task's owner changes."), | ||||
| ManiphestTransaction::MAILTAG_PRIORITY => | ManiphestTransaction::MAILTAG_PRIORITY => | ||||
| pht("A task's priority changes."), | pht("A task's priority changes."), | ||||
| ManiphestTransaction::MAILTAG_CC => | ManiphestTransaction::MAILTAG_CC => | ||||
| pht("A task's subscribers change."), | pht("A task's subscribers change."), | ||||
| ManiphestTransaction::MAILTAG_PROJECTS => | ManiphestTransaction::MAILTAG_PROJECTS => | ||||
| pht("A task's associated projects change."), | pht("A task's associated projects change."), | ||||
| ManiphestTransaction::MAILTAG_UNBLOCK => | ManiphestTransaction::MAILTAG_UNBLOCK => | ||||
| pht('One of the tasks a task is blocked by changes status.'), | pht('One of the tasks a task is blocked by changes status.'), | ||||
| ManiphestTransaction::MAILTAG_COLUMN => | ManiphestTransaction::MAILTAG_COLUMN => | ||||
| pht('A task is moved between columns on a workboard.'), | pht('A task is moved between columns on a workboard.'), | ||||
| ManiphestTransaction::MAILTAG_COMMENT => | ManiphestTransaction::MAILTAG_COMMENT => | ||||
| pht('Someone comments on a task.'), | pht('Someone comments on a task.'), | ||||
| ManiphestTransaction::MAILTAG_OTHER => | ManiphestTransaction::MAILTAG_OTHER => | ||||
| pht('Other task activity not listed above occurs.'), | pht('Other task activity not listed above occurs.'), | ||||
| ); | ); | ||||
| } | }*/ | ||||
| protected function buildReplyHandler(PhabricatorLiskDAO $object) { | /* protected function buildReplyHandler(PhabricatorLiskDAO $object) { | ||||
| return id(new ManiphestReplyHandler()) | return id(new ManiphestReplyHandler()) | ||||
| ->setMailReceiver($object); | ->setMailReceiver($object); | ||||
| } | }*/ | ||||
| protected function buildMailTemplate(PhabricatorLiskDAO $object) { | /* protected function buildMailTemplate(PhabricatorLiskDAO $object) { | ||||
| $id = $object->getID(); | $id = $object->getID(); | ||||
| $title = $object->getTitle(); | $title = $object->getTitle(); | ||||
| return id(new PhabricatorMetaMTAMail()) | return id(new PhabricatorMetaMTAMail()) | ||||
| ->setSubject("T{$id}: {$title}") | ->setSubject("T{$id}: {$title}") | ||||
| ->addHeader('Thread-Topic', "T{$id}: ".$object->getOriginalTitle()); | ->addHeader('Thread-Topic', "T{$id}: ".$object->getOriginalTitle()); | ||||
| } | }*/ | ||||
| protected function buildMailBody( | /* protected function buildMailBody( | ||||
| PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
| array $xactions) { | array $xactions) { | ||||
| $body = parent::buildMailBody($object, $xactions); | $body = parent::buildMailBody($object, $xactions); | ||||
| if ($this->getIsNewObject()) { | if ($this->getIsNewObject()) { | ||||
| $body->addTextSection( | $body->addTextSection( | ||||
| pht('TASK DESCRIPTION'), | pht('TASK DESCRIPTION'), | ||||
| Show All 28 Lines | if ($board_phids) { | ||||
| pht('WORKBOARD'), | pht('WORKBOARD'), | ||||
| PhabricatorEnv::getProductionURI( | PhabricatorEnv::getProductionURI( | ||||
| '/project/board/'.$project->getID().'/')); | '/project/board/'.$project->getID().'/')); | ||||
| } | } | ||||
| } | } | ||||
| return $body; | return $body; | ||||
| } | }*/ | ||||
| protected function shouldPublishFeedStory( | protected function shouldPublishFeedStory( | ||||
| PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
| array $xactions) { | array $xactions) { | ||||
| return $this->shouldSendMail($object, $xactions); | return $this->shouldSendMail($object, $xactions); | ||||
| } | } | ||||
| protected function supportsSearch() { | protected function supportsSearch() { | ||||
| Show All 15 Lines | final class ManiphestTransactionEditor | ||||
| } | } | ||||
| protected function didApplyHeraldRules( | protected function didApplyHeraldRules( | ||||
| PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
| HeraldAdapter $adapter, | HeraldAdapter $adapter, | ||||
| HeraldTranscript $transcript) { | HeraldTranscript $transcript) { | ||||
| $this->heraldEmailPHIDs = $adapter->getEmailPHIDs(); | $this->heraldEmailPHIDs = $adapter->getEmailPHIDs(); | ||||
| $xactions = array(); | $xactions = array(); | ||||
| $cc_phids = $adapter->getCcPHIDs(); | $cc_phids = $adapter->getCcPHIDs(); | ||||
| if ($cc_phids) { | if ($cc_phids) { | ||||
| $xactions[] = id(new ManiphestTransaction()) | $xactions[] = id(new ManiphestTransaction()) | ||||
| ->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS) | ->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS) | ||||
| ->setNewValue(array('+' => $cc_phids)); | ->setNewValue(array('+' => $cc_phids)); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 137 Lines • Show Last 20 Lines | |||||