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:
@@ -51,7 +51,11 @@ final class PhabricatorSettingsPanelEmailPreferences
|
|||||||
|
|
||||||
$new_tags = $request->getArr('mailtags');
|
$new_tags = $request->getArr('mailtags');
|
||||||
$mailtags = $preferences->getPreference('mailtags', array());
|
$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);
|
$mailtags[$key] = (bool)idx($new_tags, $key, false);
|
||||||
}
|
}
|
||||||
$preferences->setPreference('mailtags', $mailtags);
|
$preferences->setPreference('mailtags', $mailtags);
|
||||||
@@ -180,12 +184,15 @@ final class PhabricatorSettingsPanelEmailPreferences
|
|||||||
$this->buildMailTagCheckboxes(
|
$this->buildMailTagCheckboxes(
|
||||||
$this->getDifferentialMailTags(),
|
$this->getDifferentialMailTags(),
|
||||||
$mailtags)
|
$mailtags)
|
||||||
->setLabel('Differential'))
|
->setLabel('Differential'));
|
||||||
->appendChild(
|
|
||||||
|
if (PhabricatorEnv::getEnvConfig('maniphest.enabled')) {
|
||||||
|
$form->appendChild(
|
||||||
$this->buildMailTagCheckboxes(
|
$this->buildMailTagCheckboxes(
|
||||||
$this->getManiphestMailTags(),
|
$this->getManiphestMailTags(),
|
||||||
$mailtags)
|
$mailtags)
|
||||||
->setLabel('Maniphest'));
|
->setLabel('Maniphest'));
|
||||||
|
}
|
||||||
|
|
||||||
$form
|
$form
|
||||||
->appendChild(
|
->appendChild(
|
||||||
|
|||||||
Reference in New Issue
Block a user