Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / fund / editor / FundInitiativeEditor.php
blob9175156ffd31c594497a9b5aa1a84510ea61ecdf
1 <?php
3 final class FundInitiativeEditor
4 extends PhabricatorApplicationTransactionEditor {
6 public function getEditorApplicationClass() {
7 return 'PhabricatorFundApplication';
10 public function getEditorObjectsDescription() {
11 return pht('Fund Initiatives');
14 public function getCreateObjectTitle($author, $object) {
15 return pht('%s created this initiative.', $author);
18 public function getCreateObjectTitleForFeed($author, $object) {
19 return pht('%s created %s.', $author, $object);
22 public function getTransactionTypes() {
23 $types = parent::getTransactionTypes();
24 $types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
25 $types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;
26 $types[] = PhabricatorTransactions::TYPE_COMMENT;
28 return $types;
31 protected function shouldSendMail(
32 PhabricatorLiskDAO $object,
33 array $xactions) {
34 return true;
37 public function getMailTagsMap() {
38 return array(
39 FundInitiativeTransaction::MAILTAG_BACKER =>
40 pht('Someone backs an initiative.'),
41 FundInitiativeTransaction::MAILTAG_STATUS =>
42 pht("An initiative's status changes."),
43 FundInitiativeTransaction::MAILTAG_OTHER =>
44 pht('Other initiative activity not listed above occurs.'),
48 protected function buildMailTemplate(PhabricatorLiskDAO $object) {
49 $monogram = $object->getMonogram();
50 $name = $object->getName();
52 return id(new PhabricatorMetaMTAMail())
53 ->setSubject("{$monogram}: {$name}");
56 protected function buildMailBody(
57 PhabricatorLiskDAO $object,
58 array $xactions) {
60 $body = parent::buildMailBody($object, $xactions);
62 $body->addLinkSection(
63 pht('INITIATIVE DETAIL'),
64 PhabricatorEnv::getProductionURI('/'.$object->getMonogram()));
66 return $body;
69 protected function getMailTo(PhabricatorLiskDAO $object) {
70 return array($object->getOwnerPHID());
73 protected function getMailSubjectPrefix() {
74 return 'Fund';
77 protected function buildReplyHandler(PhabricatorLiskDAO $object) {
78 return id(new FundInitiativeReplyHandler())
79 ->setMailReceiver($object);
82 protected function shouldPublishFeedStory(
83 PhabricatorLiskDAO $object,
84 array $xactions) {
85 return true;
88 protected function supportsSearch() {
89 return true;