@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add email preferences to Pholio

Summary: Fixes T5386, adds a base set of email preferences to Pholio

Test Plan: Turned on, tested and got email, turned off, tested and saw notifications.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5386

Differential Revision: https://secure.phabricator.com/D9644

+75 -9
+5
src/applications/metamta/constants/MetaMTANotificationType.php
··· 19 19 const TYPE_MANIPHEST_COMMENT = 'maniphest-comment'; 20 20 const TYPE_MANIPHEST_OTHER = 'maniphest-other'; 21 21 22 + const TYPE_PHOLIO_STATUS = 'pholio-status'; 23 + const TYPE_PHOLIO_COMMENT = 'pholio-comment'; 24 + const TYPE_PHOLIO_UPDATED = 'pholio-updated'; 25 + const TYPE_PHOLIO_OTHER = 'pholio-other'; 26 + 22 27 }
+26
src/applications/pholio/storage/PholioTransaction.php
··· 79 79 return parent::getIcon(); 80 80 } 81 81 82 + public function getMailTags() { 83 + $tags = array(); 84 + switch ($this->getTransactionType()) { 85 + case PholioTransactionType::TYPE_INLINE: 86 + case PhabricatorTransactions::TYPE_COMMENT: 87 + $tags[] = MetaMTANotificationType::TYPE_PHOLIO_COMMENT; 88 + break; 89 + case PholioTransactionType::TYPE_STATUS: 90 + $tags[] = MetaMTANotificationType::TYPE_PHOLIO_STATUS; 91 + break; 92 + case PholioTransactionType::TYPE_NAME: 93 + case PholioTransactionType::TYPE_DESCRIPTION: 94 + case PholioTransactionType::TYPE_IMAGE_NAME: 95 + case PholioTransactionType::TYPE_IMAGE_DESCRIPTION: 96 + case PholioTransactionType::TYPE_IMAGE_SEQUENCE: 97 + case PholioTransactionType::TYPE_IMAGE_FILE: 98 + case PholioTransactionType::TYPE_IMAGE_REPLACE: 99 + $tags[] = MetaMTANotificationType::TYPE_PHOLIO_UPDATED; 100 + break; 101 + default: 102 + $tags[] = MetaMTANotificationType::TYPE_PHOLIO_OTHER; 103 + break; 104 + } 105 + return $tags; 106 + } 107 + 82 108 public function getTitle() { 83 109 $author_phid = $this->getAuthorPHID(); 84 110
+44 -9
src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php
··· 58 58 $all_tags = array_diff_key($all_tags, $this->getManiphestMailTags()); 59 59 } 60 60 61 + $pholio = 'PhabricatorApplicationPholio'; 62 + if (!PhabricatorApplication::isClassInstalled($pholio)) { 63 + $all_tags = array_diff_key($all_tags, $this->getPholioMailTags()); 64 + } 65 + 61 66 foreach ($all_tags as $key => $label) { 62 67 $mailtags[$key] = (bool)idx($new_tags, $key, false); 63 68 } ··· 180 185 "\n\n". 181 186 '**Phabricator will send an email to your primary account when:**')); 182 187 183 - $form 184 - ->appendChild( 188 + if (PhabricatorApplication::isClassInstalledForViewer( 189 + 'PhabricatorApplicationDifferential', $user)) { 190 + $form 191 + ->appendChild( 192 + $this->buildMailTagCheckboxes( 193 + $this->getDifferentialMailTags(), 194 + $mailtags) 195 + ->setLabel(pht('Differential'))); 196 + } 197 + 198 + if (PhabricatorApplication::isClassInstalledForViewer( 199 + 'PhabricatorApplicationManiphest', $user)) { 200 + $form->appendChild( 185 201 $this->buildMailTagCheckboxes( 186 - $this->getDifferentialMailTags(), 202 + $this->getManiphestMailTags(), 187 203 $mailtags) 188 - ->setLabel(pht('Differential'))); 204 + ->setLabel(pht('Maniphest'))); 205 + } 189 206 190 - $maniphest = 'PhabricatorApplicationManiphest'; 191 - if (PhabricatorApplication::isClassInstalled($maniphest)) { 207 + if (PhabricatorApplication::isClassInstalledForViewer( 208 + 'PhabricatorApplicationPholio', $user)) { 192 209 $form->appendChild( 193 210 $this->buildMailTagCheckboxes( 194 - $this->getManiphestMailTags(), 211 + $this->getPholioMailTags(), 195 212 $mailtags) 196 - ->setLabel(pht('Maniphest'))); 213 + ->setLabel(pht('Pholio'))); 197 214 } 198 215 199 216 $form ··· 244 261 pht("A task's associated projects change."), 245 262 MetaMTANotificationType::TYPE_MANIPHEST_OTHER => 246 263 pht('Other task activity not listed above occurs.'), 247 - 264 + MetaMTANotificationType::TYPE_PHOLIO_STATUS => 265 + pht("A mock's status changes."), 266 + MetaMTANotificationType::TYPE_PHOLIO_COMMENT => 267 + pht('Someone comments on a mock.'), 268 + MetaMTANotificationType::TYPE_PHOLIO_UPDATED => 269 + pht('Mock images or descriptions change.'), 270 + MetaMTANotificationType::TYPE_PHOLIO_OTHER => 271 + pht('Other mock activity not listed above occurs.'), 248 272 ); 249 273 } 250 274 ··· 273 297 MetaMTANotificationType::TYPE_DIFFERENTIAL_REVIEWERS, 274 298 MetaMTANotificationType::TYPE_DIFFERENTIAL_CC, 275 299 MetaMTANotificationType::TYPE_DIFFERENTIAL_OTHER, 300 + )); 301 + } 302 + 303 + private function getPholioMailTags() { 304 + return array_select_keys( 305 + $this->getMailTags(), 306 + array( 307 + MetaMTANotificationType::TYPE_PHOLIO_STATUS, 308 + MetaMTANotificationType::TYPE_PHOLIO_COMMENT, 309 + MetaMTANotificationType::TYPE_PHOLIO_UPDATED, 310 + MetaMTANotificationType::TYPE_PHOLIO_OTHER, 276 311 )); 277 312 } 278 313