Skip to content

Commit

Permalink
Merge pull request #16774 from mattwire/settingssmtpfreezeoutboundoption
Browse files Browse the repository at this point in the history
Fix setting outBound_option readonly in UI
  • Loading branch information
colemanw authored Mar 17, 2020
2 parents 501d220 + fc6b10e commit 79c79f4
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions CRM/Admin/Form/Setting/Smtp.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,7 @@ class CRM_Admin_Form_Setting_Smtp extends CRM_Admin_Form_Setting {
* Build the form object.
*/
public function buildQuickForm() {

$outBoundOption = [
CRM_Mailing_Config::OUTBOUND_OPTION_MAIL => ts('mail()'),
CRM_Mailing_Config::OUTBOUND_OPTION_SMTP => ts('SMTP'),
CRM_Mailing_Config::OUTBOUND_OPTION_SENDMAIL => ts('Sendmail'),
CRM_Mailing_Config::OUTBOUND_OPTION_DISABLED => ts('Disable Outbound Email'),
CRM_Mailing_Config::OUTBOUND_OPTION_REDIRECT_TO_DB => ts('Redirect to Database'),
];
$this->addRadio('outBound_option', ts('Select Mailer'), $outBoundOption);

$props = array();
$props = [];
$settings = Civi::settings()->getMandatory('mailing_backend') ?? [];
//Load input as readonly whose values are overridden in civicrm.settings.php.
foreach ($settings as $setting => $value) {
Expand All @@ -48,6 +38,15 @@ public function buildQuickForm() {
}
}

$outBoundOption = [
CRM_Mailing_Config::OUTBOUND_OPTION_MAIL => ts('mail()'),
CRM_Mailing_Config::OUTBOUND_OPTION_SMTP => ts('SMTP'),
CRM_Mailing_Config::OUTBOUND_OPTION_SENDMAIL => ts('Sendmail'),
CRM_Mailing_Config::OUTBOUND_OPTION_DISABLED => ts('Disable Outbound Email'),
CRM_Mailing_Config::OUTBOUND_OPTION_REDIRECT_TO_DB => ts('Redirect to Database'),
];
$this->addRadio('outBound_option', ts('Select Mailer'), $outBoundOption, $props['outBound_option'] ?? []);

CRM_Utils_System::setTitle(ts('Settings - Outbound Mail'));
$this->add('text', 'sendmail_path', ts('Sendmail Path'));
$this->add('text', 'sendmail_args', ts('Sendmail Argument'));
Expand Down

0 comments on commit 79c79f4

Please sign in to comment.