From c3dbbc5fbe8d3ff358cadb212beec561207ff772 Mon Sep 17 00:00:00 2001 From: vrana Date: Tue, 4 Dec 2012 14:25:32 -0800 Subject: [PATCH] Hide disabled Maniphest from e-mail preferences Test Plan: Disabled Maniphest, didn't see it, saved, enabled, saw it. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4081 --- .../PhabricatorSettingsPanelEmailPreferences.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php b/src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php index c4224e3edc..7209f263bd 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php @@ -51,7 +51,11 @@ final class PhabricatorSettingsPanelEmailPreferences $new_tags = $request->getArr('mailtags'); $mailtags = $preferences->getPreference('mailtags', array()); - foreach ($this->getMailTags() as $key => $label) { + $all_tags = $this->getMailTags(); + if (!PhabricatorEnv::getEnvConfig('maniphest.enabled')) { + $all_tags = array_diff_key($all_tags, $this->getManiphestMailTags()); + } + foreach ($all_tags as $key => $label) { $mailtags[$key] = (bool)idx($new_tags, $key, false); } $preferences->setPreference('mailtags', $mailtags); @@ -180,12 +184,15 @@ final class PhabricatorSettingsPanelEmailPreferences $this->buildMailTagCheckboxes( $this->getDifferentialMailTags(), $mailtags) - ->setLabel('Differential')) - ->appendChild( + ->setLabel('Differential')); + + if (PhabricatorEnv::getEnvConfig('maniphest.enabled')) { + $form->appendChild( $this->buildMailTagCheckboxes( $this->getManiphestMailTags(), $mailtags) ->setLabel('Maniphest')); + } $form ->appendChild(