@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Separate email formatting options into a new panel

Summary:
Ref T5861. These two options are complex, rarely useful, and not directly related to controlling what mail you receive.

Move them to a separate panel to make way for more stuff on the preferences panel. We'll probably add an "HTML" option to this new panel eventually, too.

Test Plan:
{F189474}

- Used both panels.
- Tested with multiplexing off.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T5861

Differential Revision: https://secure.phabricator.com/D10236

+184 -89
+2
src/__phutil_library_map__.php
··· 2146 2146 'PhabricatorSettingsPanelDiffPreferences' => 'applications/settings/panel/PhabricatorSettingsPanelDiffPreferences.php', 2147 2147 'PhabricatorSettingsPanelDisplayPreferences' => 'applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php', 2148 2148 'PhabricatorSettingsPanelEmailAddresses' => 'applications/settings/panel/PhabricatorSettingsPanelEmailAddresses.php', 2149 + 'PhabricatorSettingsPanelEmailFormat' => 'applications/settings/panel/PhabricatorSettingsPanelEmailFormat.php', 2149 2150 'PhabricatorSettingsPanelEmailPreferences' => 'applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php', 2150 2151 'PhabricatorSettingsPanelExternalAccounts' => 'applications/settings/panel/PhabricatorSettingsPanelExternalAccounts.php', 2151 2152 'PhabricatorSettingsPanelHomePreferences' => 'applications/settings/panel/PhabricatorSettingsPanelHomePreferences.php', ··· 5018 5019 'PhabricatorSettingsPanelDiffPreferences' => 'PhabricatorSettingsPanel', 5019 5020 'PhabricatorSettingsPanelDisplayPreferences' => 'PhabricatorSettingsPanel', 5020 5021 'PhabricatorSettingsPanelEmailAddresses' => 'PhabricatorSettingsPanel', 5022 + 'PhabricatorSettingsPanelEmailFormat' => 'PhabricatorSettingsPanel', 5021 5023 'PhabricatorSettingsPanelEmailPreferences' => 'PhabricatorSettingsPanel', 5022 5024 'PhabricatorSettingsPanelExternalAccounts' => 'PhabricatorSettingsPanel', 5023 5025 'PhabricatorSettingsPanelHomePreferences' => 'PhabricatorSettingsPanel',
+182
src/applications/settings/panel/PhabricatorSettingsPanelEmailFormat.php
··· 1 + <?php 2 + 3 + final class PhabricatorSettingsPanelEmailFormat 4 + extends PhabricatorSettingsPanel { 5 + 6 + public function getPanelKey() { 7 + return 'emailformat'; 8 + } 9 + 10 + public function getPanelName() { 11 + return pht('Email Format'); 12 + } 13 + 14 + public function getPanelGroup() { 15 + return pht('Email'); 16 + } 17 + 18 + public function processRequest(AphrontRequest $request) { 19 + $user = $request->getUser(); 20 + 21 + $preferences = $user->loadPreferences(); 22 + 23 + $pref_re_prefix = PhabricatorUserPreferences::PREFERENCE_RE_PREFIX; 24 + $pref_vary = PhabricatorUserPreferences::PREFERENCE_VARY_SUBJECT; 25 + 26 + $errors = array(); 27 + if ($request->isFormPost()) { 28 + 29 + if (PhabricatorMetaMTAMail::shouldMultiplexAllMail()) { 30 + if ($request->getStr($pref_re_prefix) == 'default') { 31 + $preferences->unsetPreference($pref_re_prefix); 32 + } else { 33 + $preferences->setPreference( 34 + $pref_re_prefix, 35 + $request->getBool($pref_re_prefix)); 36 + } 37 + 38 + if ($request->getStr($pref_vary) == 'default') { 39 + $preferences->unsetPreference($pref_vary); 40 + } else { 41 + $preferences->setPreference( 42 + $pref_vary, 43 + $request->getBool($pref_vary)); 44 + } 45 + } 46 + 47 + $preferences->save(); 48 + 49 + return id(new AphrontRedirectResponse()) 50 + ->setURI($this->getPanelURI('?saved=true')); 51 + } 52 + 53 + $re_prefix_default = PhabricatorEnv::getEnvConfig('metamta.re-prefix') 54 + ? pht('Enabled') 55 + : pht('Disabled'); 56 + 57 + $vary_default = PhabricatorEnv::getEnvConfig('metamta.vary-subjects') 58 + ? pht('Vary') 59 + : pht('Do Not Vary'); 60 + 61 + $re_prefix_value = $preferences->getPreference($pref_re_prefix); 62 + if ($re_prefix_value === null) { 63 + $re_prefix_value = 'default'; 64 + } else { 65 + $re_prefix_value = $re_prefix_value 66 + ? 'true' 67 + : 'false'; 68 + } 69 + 70 + $vary_value = $preferences->getPreference($pref_vary); 71 + if ($vary_value === null) { 72 + $vary_value = 'default'; 73 + } else { 74 + $vary_value = $vary_value 75 + ? 'true' 76 + : 'false'; 77 + } 78 + 79 + $form = new AphrontFormView(); 80 + $form 81 + ->setUser($user); 82 + 83 + if (PhabricatorMetaMTAMail::shouldMultiplexAllMail()) { 84 + $re_control = id(new AphrontFormSelectControl()) 85 + ->setName($pref_re_prefix) 86 + ->setOptions( 87 + array( 88 + 'default' => pht('Use Server Default (%s)', $re_prefix_default), 89 + 'true' => pht('Enable "Re:" prefix'), 90 + 'false' => pht('Disable "Re:" prefix'), 91 + )) 92 + ->setValue($re_prefix_value); 93 + 94 + $vary_control = id(new AphrontFormSelectControl()) 95 + ->setName($pref_vary) 96 + ->setOptions( 97 + array( 98 + 'default' => pht('Use Server Default (%s)', $vary_default), 99 + 'true' => pht('Vary Subjects'), 100 + 'false' => pht('Do Not Vary Subjects'), 101 + )) 102 + ->setValue($vary_value); 103 + } else { 104 + $re_control = id(new AphrontFormStaticControl()) 105 + ->setValue('Server Default ('.$re_prefix_default.')'); 106 + 107 + $vary_control = id(new AphrontFormStaticControl()) 108 + ->setValue('Server Default ('.$vary_default.')'); 109 + } 110 + 111 + $form 112 + ->appendRemarkupInstructions( 113 + pht( 114 + 'These settings fine-tune some technical aspects of how email is '. 115 + 'formatted. You may be able to adjust them to make mail more '. 116 + 'useful or improve threading.')); 117 + 118 + if (!PhabricatorMetaMTAMail::shouldMultiplexAllMail()) { 119 + $form->appendRemarkupInstructions( 120 + pht( 121 + 'NOTE: This install of Phabricator is configured to send a '. 122 + 'single mail message to all recipients, so all settings are '. 123 + 'locked at the server default value.')); 124 + } 125 + 126 + $form 127 + ->appendRemarkupInstructions('') 128 + ->appendRemarkupInstructions( 129 + pht( 130 + 'The **Add "Re:" Prefix** setting adds "Re:" in front of all '. 131 + 'messages, even if they are not replies. If you use **Mail.app** on '. 132 + 'Mac OS X, this may improve mail threading.'. 133 + "\n\n". 134 + "| Setting | Example Mail Subject\n". 135 + "|------------------------|----------------\n". 136 + "| Enable \"Re:\" Prefix | ". 137 + "`Re: [Differential] [Accepted] D123: Example Revision`\n". 138 + "| Disable \"Re:\" Prefix | ". 139 + "`[Differential] [Accepted] D123: Example Revision`")) 140 + ->appendChild( 141 + $re_control 142 + ->setLabel(pht('Add "Re:" Prefix'))) 143 + ->appendRemarkupInstructions('') 144 + ->appendRemarkupInstructions( 145 + pht( 146 + 'With **Vary Subjects** enabled, most mail subject lines will '. 147 + 'include a brief description of their content, like **[Closed]** '. 148 + 'for a notification about someone closing a task.'. 149 + "\n\n". 150 + "| Setting | Example Mail Subject\n". 151 + "|----------------------|----------------\n". 152 + "| Vary Subjects | ". 153 + "`[Maniphest] [Closed] T123: Example Task`\n". 154 + "| Do Not Vary Subjects | ". 155 + "`[Maniphest] T123: Example Task`\n". 156 + "\n". 157 + 'This can make mail more useful, but some clients have difficulty '. 158 + 'threading these messages. Disabling this option may improve '. 159 + 'threading, at the cost of less useful subject lines.')) 160 + ->appendChild( 161 + $vary_control 162 + ->setLabel(pht('Vary Subjects'))); 163 + 164 + $form 165 + ->appendChild( 166 + id(new AphrontFormSubmitControl()) 167 + ->setValue(pht('Save Preferences'))); 168 + 169 + $form_box = id(new PHUIObjectBoxView()) 170 + ->setHeaderText(pht('Email Format')) 171 + ->setFormSaved($request->getStr('saved')) 172 + ->setFormErrors($errors) 173 + ->setForm($form); 174 + 175 + return id(new AphrontNullView()) 176 + ->appendChild( 177 + array( 178 + $form_box, 179 + )); 180 + } 181 + 182 + }
-89
src/applications/settings/panel/PhabricatorSettingsPanelEmailPreferences.php
··· 20 20 21 21 $preferences = $user->loadPreferences(); 22 22 23 - $pref_re_prefix = PhabricatorUserPreferences::PREFERENCE_RE_PREFIX; 24 - $pref_vary = PhabricatorUserPreferences::PREFERENCE_VARY_SUBJECT; 25 23 $pref_no_self_mail = PhabricatorUserPreferences::PREFERENCE_NO_SELF_MAIL; 26 24 27 25 $errors = array(); 28 26 if ($request->isFormPost()) { 29 - 30 - if (PhabricatorMetaMTAMail::shouldMultiplexAllMail()) { 31 - if ($request->getStr($pref_re_prefix) == 'default') { 32 - $preferences->unsetPreference($pref_re_prefix); 33 - } else { 34 - $preferences->setPreference( 35 - $pref_re_prefix, 36 - $request->getBool($pref_re_prefix)); 37 - } 38 - 39 - if ($request->getStr($pref_vary) == 'default') { 40 - $preferences->unsetPreference($pref_vary); 41 - } else { 42 - $preferences->setPreference( 43 - $pref_vary, 44 - $request->getBool($pref_vary)); 45 - } 46 - } 47 - 48 27 $preferences->setPreference( 49 28 $pref_no_self_mail, 50 29 $request->getStr($pref_no_self_mail)); ··· 74 53 ->setURI($this->getPanelURI('?saved=true')); 75 54 } 76 55 77 - $re_prefix_default = PhabricatorEnv::getEnvConfig('metamta.re-prefix') 78 - ? pht('Enabled') 79 - : pht('Disabled'); 80 - 81 - $vary_default = PhabricatorEnv::getEnvConfig('metamta.vary-subjects') 82 - ? pht('Vary') 83 - : pht('Do Not Vary'); 84 - 85 - $re_prefix_value = $preferences->getPreference($pref_re_prefix); 86 - if ($re_prefix_value === null) { 87 - $re_prefix_value = 'default'; 88 - } else { 89 - $re_prefix_value = $re_prefix_value 90 - ? 'true' 91 - : 'false'; 92 - } 93 - 94 - $vary_value = $preferences->getPreference($pref_vary); 95 - if ($vary_value === null) { 96 - $vary_value = 'default'; 97 - } else { 98 - $vary_value = $vary_value 99 - ? 'true' 100 - : 'false'; 101 - } 102 - 103 56 $form = new AphrontFormView(); 104 57 $form 105 58 ->setUser($user) ··· 114 67 )) 115 68 ->setCaption(pht('You can disable email about your own actions.')) 116 69 ->setValue($preferences->getPreference($pref_no_self_mail, 0))); 117 - 118 - if (PhabricatorMetaMTAMail::shouldMultiplexAllMail()) { 119 - $re_control = id(new AphrontFormSelectControl()) 120 - ->setName($pref_re_prefix) 121 - ->setOptions( 122 - array( 123 - 'default' => pht('Use Server Default (%s)', $re_prefix_default), 124 - 'true' => pht('Enable "Re:" prefix'), 125 - 'false' => pht('Disable "Re:" prefix'), 126 - )) 127 - ->setValue($re_prefix_value); 128 - 129 - $vary_control = id(new AphrontFormSelectControl()) 130 - ->setName($pref_vary) 131 - ->setOptions( 132 - array( 133 - 'default' => pht('Use Server Default (%s)', $vary_default), 134 - 'true' => pht('Vary Subjects'), 135 - 'false' => pht('Do Not Vary Subjects'), 136 - )) 137 - ->setValue($vary_value); 138 - } else { 139 - $re_control = id(new AphrontFormStaticControl()) 140 - ->setValue('Server Default ('.$re_prefix_default.')'); 141 - 142 - $vary_control = id(new AphrontFormStaticControl()) 143 - ->setValue('Server Default ('.$vary_default.')'); 144 - } 145 - 146 - $form 147 - ->appendChild( 148 - $re_control 149 - ->setLabel(pht('Add "Re:" Prefix')) 150 - ->setCaption( 151 - pht('Enable this option to fix threading in Mail.app on OS X Lion,'. 152 - ' or if you like "Re:" in your email subjects.'))) 153 - ->appendChild( 154 - $vary_control 155 - ->setLabel(pht('Vary Subjects')) 156 - ->setCaption( 157 - pht('This option adds more information to email subjects, but may '. 158 - 'break threading in some clients.'))); 159 70 160 71 $mailtags = $preferences->getPreference('mailtags', array()); 161 72