Changeset View
Changeset View
Standalone View
Standalone View
src/applications/release/editor/ReleaseChangeRequestEditor.php
- This file was added.
<?php | |||||
final class ReleaseChangeRequestEditor | |||||
extends PhabricatorApplicationTransactionEditor { | |||||
private $modularTypes; | |||||
public function getEditorApplicationClass() { | |||||
return 'PhabricatorReleaseApplication'; | |||||
} | |||||
public function getEditorObjectsDescription() { | |||||
return pht('Release Change Request'); | |||||
} | |||||
public function getCreateObjectTitle($author, $object) { | |||||
return pht( | |||||
'%s requested this change to be included in a Release.', | |||||
$author); | |||||
} | |||||
public function getCreateObjectTitleForFeed($author, $object) { | |||||
return pht( | |||||
'%s requested %s to be included in a Release.', | |||||
$author, | |||||
$object); | |||||
} | |||||
protected function applyInitialEffects( | |||||
PhabricatorLiskDAO $object, | |||||
array $xactions) {} | |||||
public function getTransactionTypes() { | |||||
$types = parent::getTransactionTypes(); | |||||
return $types; | |||||
} | |||||
protected function shouldApplyInitialEffects( | |||||
PhabricatorLiskDAO $object, | |||||
array $xactions) { | |||||
return true; | |||||
} | |||||
protected function shouldSendMail( | |||||
PhabricatorLiskDAO $object, | |||||
array $xactions) { | |||||
return true; | |||||
} | |||||
protected function getMailCC(PhabricatorLiskDAO $object) { | |||||
// TODO | |||||
return array(); | |||||
} | |||||
protected function getMailSubjectPrefix() { | |||||
return '[Release Change Request]'; | |||||
} | |||||
public function getMailTagsMap() { | |||||
return array( | |||||
ReleaseChangeRequestTransaction::MAILTAG_OTHER => | |||||
pht('Other activity not listed above occurs.'), | |||||
); | |||||
} | |||||
protected function buildReplyHandler(PhabricatorLiskDAO $object) { | |||||
return id(new PhabricatorReleaseReleaseReplyHandler()) | |||||
->setMailReceiver($object); | |||||
} | |||||
protected function buildMailTemplate(PhabricatorLiskDAO $object) { | |||||
$id = $object->getID(); | |||||
$name = $object->getName(); | |||||
return id(new PhabricatorMetaMTAMail()) | |||||
->setSubject("Y{$id} {$name}") | |||||
->addHeader('Thread-Topic', "Change Request {$id}"); | |||||
} | |||||
protected function shouldPublishFeedStory( | |||||
PhabricatorLiskDAO $object, | |||||
array $xactions) { | |||||
return true; | |||||
} | |||||
protected function supportsSearch() { | |||||
return false; | |||||
} | |||||
protected function expandTransaction( | |||||
PhabricatorLiskDAO $release, | |||||
PhabricatorApplicationTransaction $xaction) { | |||||
$xactions = parent::expandTransaction($release, $xaction); | |||||
return $xactions; | |||||
} | |||||
protected function getMailTo(PhabricatorLiskDAO $object) { | |||||
$tos = array(); | |||||
return $tos; | |||||
} | |||||
protected function buildMailBody( | |||||
PhabricatorLiskDAO $object, | |||||
array $xactions) { | |||||
$body = parent::buildMailBody($object, $xactions); | |||||
foreach ($xactions as $xaction) { | |||||
$type = $xaction->getTransactionType(); | |||||
$new = $xaction->getNewValue(); | |||||
} | |||||
$body->addLinkSection( | |||||
pht('REQUEST DETAILS'), | |||||
PhabricatorEnv::getProductionURI($object->getURI())); | |||||
return $body; | |||||
} | |||||
} |