mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-09 14:21:02 +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:
parent
fb289a2c77
commit
c3dbbc5fbe
1 changed files with 10 additions and 3 deletions
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue