mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-12-04 14:13:52 +09:00
Fixed emails (#3189)
* Fix email settings form not toggling between input boxes * Fix deprecated call to $di['config']
This commit is contained in:
1 parent
9537c3b522
commit
9ce7ffe4bd
2 files changed
+26
-28
No files matched your search
@@ -125,7 +125,7 @@ class Service implements \FOSSBilling\InjectionAwareInterface
|
||||
|
||||
public function setVars($t, $vars): bool
|
||||
{
|
||||
$t->vars = $this->di['crypt']->encrypt(json_encode($vars), $this->di['config']['salt']);
|
||||
$t->vars = $this->di['crypt']->encrypt(json_encode($vars), Config::getProperty('info.salt'));
|
||||
$this->di['db']->store($t);
|
||||
|
||||
return true;
|
||||
@@ -136,7 +136,7 @@ class Service implements \FOSSBilling\InjectionAwareInterface
|
||||
*/
|
||||
public function getVars($t): array
|
||||
{
|
||||
$json = $this->di['crypt']->decrypt($t->vars, $this->di['config']['salt']);
|
||||
$json = $this->di['crypt']->decrypt($t->vars, Config::getProperty('info.salt'));
|
||||
|
||||
return is_string($json) ? json_decode($json, true) : [];
|
||||
}
|
||||
|
||||
@@ -406,36 +406,34 @@
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const mailerInputs = document.querySelectorAll('#mailer input');
|
||||
const mailerInputs = document.querySelectorAll('#mailer input');
|
||||
|
||||
mailerInputs.forEach(input => {
|
||||
input.addEventListener('click', function() {
|
||||
const smtpFieldset = document.querySelector('fieldset.smtp');
|
||||
const sendgridFieldset = document.querySelector('fieldset.sendgrid');
|
||||
const customFieldset = document.querySelector('fieldset.custom');
|
||||
mailerInputs.forEach(input => {
|
||||
input.addEventListener('click', function() {
|
||||
const smtpFieldset = document.querySelector('fieldset.smtp');
|
||||
const sendgridFieldset = document.querySelector('fieldset.sendgrid');
|
||||
const customFieldset = document.querySelector('fieldset.custom');
|
||||
|
||||
// Handle SMTP fieldset.
|
||||
if (this.value === 'smtp') {
|
||||
smtpFieldset.style.display = 'block';
|
||||
} else {
|
||||
smtpFieldset.style.display = 'none';
|
||||
}
|
||||
// Handle SMTP fieldset.
|
||||
if (this.value === 'smtp') {
|
||||
smtpFieldset.style.display = 'block';
|
||||
} else {
|
||||
smtpFieldset.style.display = 'none';
|
||||
}
|
||||
|
||||
// Handle SendGrid fieldset.
|
||||
if (this.value === 'sendgrid') {
|
||||
sendgridFieldset.style.display = 'block';
|
||||
} else {
|
||||
sendgridFieldset.style.display = 'none';
|
||||
}
|
||||
// Handle SendGrid fieldset.
|
||||
if (this.value === 'sendgrid') {
|
||||
sendgridFieldset.style.display = 'block';
|
||||
} else {
|
||||
sendgridFieldset.style.display = 'none';
|
||||
}
|
||||
|
||||
// Handle Custom fieldset.
|
||||
if (this.value === 'custom') {
|
||||
customFieldset.style.display = 'block';
|
||||
} else {
|
||||
customFieldset.style.display = 'none';
|
||||
}
|
||||
});
|
||||
// Handle Custom fieldset.
|
||||
if (this.value === 'custom') {
|
||||
customFieldset.style.display = 'block';
|
||||
} else {
|
||||
customFieldset.style.display = 'none';
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user