From 57c2f61b75973fda9463bd550611a85badf69ba5 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 2 Jun 2016 16:57:45 -0700 Subject: [PATCH] Modularize Conpherence notification preferences Summary: Ref T4103. This is a weird standalone setting that I didn't clean up earlier. Also fix an issue with the PronounSetting and the Editor not interacting properly. Test Plan: Edited using new EditEngine UI. Reviewers: chad Reviewed By: chad Maniphest Tasks: T4103 Differential Revision: https://secure.phabricator.com/D16014 --- src/__phutil_library_map__.php | 2 ++ .../PhabricatorUserPreferencesEditor.php | 6 ++++ ...ricatorConpherenceNotificationsSetting.php | 31 +++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 src/applications/settings/setting/PhabricatorConpherenceNotificationsSetting.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 2533344e43..fd7426ce7d 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2145,6 +2145,7 @@ phutil_register_library_map(array( 'PhabricatorConfigVersionsModule' => 'applications/config/module/PhabricatorConfigVersionsModule.php', 'PhabricatorConfigWelcomeController' => 'applications/config/controller/PhabricatorConfigWelcomeController.php', 'PhabricatorConpherenceApplication' => 'applications/conpherence/application/PhabricatorConpherenceApplication.php', + 'PhabricatorConpherenceNotificationsSetting' => 'applications/settings/setting/PhabricatorConpherenceNotificationsSetting.php', 'PhabricatorConpherencePreferencesSettingsPanel' => 'applications/settings/panel/PhabricatorConpherencePreferencesSettingsPanel.php', 'PhabricatorConpherenceThreadPHIDType' => 'applications/conpherence/phid/PhabricatorConpherenceThreadPHIDType.php', 'PhabricatorConsoleApplication' => 'applications/console/application/PhabricatorConsoleApplication.php', @@ -6676,6 +6677,7 @@ phutil_register_library_map(array( 'PhabricatorConfigVersionsModule' => 'PhabricatorConfigModule', 'PhabricatorConfigWelcomeController' => 'PhabricatorConfigController', 'PhabricatorConpherenceApplication' => 'PhabricatorApplication', + 'PhabricatorConpherenceNotificationsSetting' => 'PhabricatorSelectSetting', 'PhabricatorConpherencePreferencesSettingsPanel' => 'PhabricatorSettingsPanel', 'PhabricatorConpherenceThreadPHIDType' => 'PhabricatorPHIDType', 'PhabricatorConsoleApplication' => 'PhabricatorApplication', diff --git a/src/applications/settings/editor/PhabricatorUserPreferencesEditor.php b/src/applications/settings/editor/PhabricatorUserPreferencesEditor.php index bbb469eb01..d320391091 100644 --- a/src/applications/settings/editor/PhabricatorUserPreferencesEditor.php +++ b/src/applications/settings/editor/PhabricatorUserPreferencesEditor.php @@ -99,6 +99,12 @@ final class PhabricatorUserPreferencesEditor $actor = $this->getActor(); $settings = PhabricatorSetting::getAllEnabledSettings($actor); + foreach ($settings as $key => $setting) { + $setting = clone $setting; + $setting->setViewer($actor); + $settings[$key] = $setting; + } + switch ($type) { case PhabricatorUserPreferencesTransaction::TYPE_SETTING: foreach ($xactions as $xaction) { diff --git a/src/applications/settings/setting/PhabricatorConpherenceNotificationsSetting.php b/src/applications/settings/setting/PhabricatorConpherenceNotificationsSetting.php new file mode 100644 index 0000000000..7009fbcdc1 --- /dev/null +++ b/src/applications/settings/setting/PhabricatorConpherenceNotificationsSetting.php @@ -0,0 +1,31 @@ + pht('Send Email'), + self::VALUE_CONPHERENCE_NOTIFY => pht('Send Notifications'), + ); + } + +}