1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

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
This commit is contained in:
vrana 2012-12-04 14:25:32 -08:00
parent fb289a2c77
commit c3dbbc5fbe

View file

@ -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(