1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 12:00:55 +01:00

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
This commit is contained in:
epriestley 2016-06-02 16:57:45 -07:00
parent 3849a69995
commit 57c2f61b75
3 changed files with 39 additions and 0 deletions

View file

@ -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',

View file

@ -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) {

View file

@ -0,0 +1,31 @@
<?php
final class PhabricatorConpherenceNotificationsSetting
extends PhabricatorSelectSetting {
const SETTINGKEY = 'conph-notifications';
const VALUE_CONPHERENCE_EMAIL = '0';
const VALUE_CONPHERENCE_NOTIFY = '1';
public function getSettingName() {
return pht('Conpherence Notifications');
}
protected function getControlInstructions() {
return pht(
'Choose the default notification behavior for Conpherence rooms.');
}
public function getSettingDefaultValue() {
return self::VALUE_CONPHERENCE_EMAIL;
}
protected function getSelectOptions() {
return array(
self::VALUE_CONPHERENCE_EMAIL => pht('Send Email'),
self::VALUE_CONPHERENCE_NOTIFY => pht('Send Notifications'),
);
}
}