add config option for ifsg_light
This commit is contained in:
parent
d1d0acf622
commit
6b273288bd
|
@ -326,6 +326,10 @@ return [
|
||||||
# Instruction in accordance with § 43 Para. 1 of the German Infection Protection Act (IfSG)
|
# Instruction in accordance with § 43 Para. 1 of the German Infection Protection Act (IfSG)
|
||||||
'ifsg_enabled' => (bool) env('IFSG_ENABLED', false),
|
'ifsg_enabled' => (bool) env('IFSG_ENABLED', false),
|
||||||
|
|
||||||
|
# Instruction only onsite in accordance with § 43 Para. 1 of the German Infection Protection Act (IfSG)
|
||||||
|
'ifsg_light_enabled' => (bool) env('IFSG_LIGHT_ENABLED', false)
|
||||||
|
&& env('IFSG_ENABLED', false),
|
||||||
|
|
||||||
// Available locales in /resources/lang/
|
// Available locales in /resources/lang/
|
||||||
'locales' => [
|
'locales' => [
|
||||||
'de_DE' => 'Deutsch',
|
'de_DE' => 'Deutsch',
|
||||||
|
|
|
@ -11,9 +11,11 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
{{ m.info(__('settings.certificates.info')) }}
|
{{ m.info(__('settings.certificates.info')) }}
|
||||||
{{ f.checkbox('ifsg_certificate_light', __('settings.ifsg_light'), {
|
{% if config('ifsg_light_enabled') %}
|
||||||
'checked': ifsg_certificate_light,
|
{{ f.checkbox('ifsg_certificate_light', __('settings.ifsg_light'), {
|
||||||
}) }}
|
'checked': ifsg_certificate_light,
|
||||||
|
}) }}
|
||||||
|
{% endif %}
|
||||||
{{ f.checkbox('ifsg_certificate', __('settings.ifsg'), {
|
{{ f.checkbox('ifsg_certificate', __('settings.ifsg'), {
|
||||||
'checked': ifsg_certificate,
|
'checked': ifsg_certificate,
|
||||||
}) }}
|
}) }}
|
||||||
|
|
|
@ -233,9 +233,9 @@ class SettingsController extends BaseController
|
||||||
return $this->response->withView(
|
return $this->response->withView(
|
||||||
'pages/settings/certificates',
|
'pages/settings/certificates',
|
||||||
[
|
[
|
||||||
'settings_menu' => $this->settingsMenu(),
|
'settings_menu' => $this->settingsMenu(),
|
||||||
'ifsg_certificate_light' => $user->license->ifsg_certificate_light,
|
'ifsg_certificate_light' => $user->license->ifsg_certificate_light,
|
||||||
'ifsg_certificate' => $user->license->ifsg_certificate,
|
'ifsg_certificate' => $user->license->ifsg_certificate,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -252,7 +252,9 @@ class SettingsController extends BaseController
|
||||||
throw new HttpNotFound('ifsg.disabled');
|
throw new HttpNotFound('ifsg.disabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
$user->license->ifsg_certificate_light = !$data['ifsg_certificate'] && $data['ifsg_certificate_light'];
|
if (config('ifsg_light_enabled')) {
|
||||||
|
$user->license->ifsg_certificate_light = !$data['ifsg_certificate'] && $data['ifsg_certificate_light'];
|
||||||
|
}
|
||||||
$user->license->ifsg_certificate = (bool) $data['ifsg_certificate'];
|
$user->license->ifsg_certificate = (bool) $data['ifsg_certificate'];
|
||||||
$user->license->save();
|
$user->license->save();
|
||||||
|
|
||||||
|
|
|
@ -583,6 +583,7 @@ class SettingsControllerTest extends ControllerTest
|
||||||
public function testIfsgCertificate(): void
|
public function testIfsgCertificate(): void
|
||||||
{
|
{
|
||||||
config(['ifsg_enabled' => true]);
|
config(['ifsg_enabled' => true]);
|
||||||
|
config(['ifsg_light_enabled' => true]);
|
||||||
$this->setExpects($this->auth, 'user', null, $this->user, $this->once());
|
$this->setExpects($this->auth, 'user', null, $this->user, $this->once());
|
||||||
|
|
||||||
$this->response->expects($this->once())
|
$this->response->expects($this->once())
|
||||||
|
@ -629,6 +630,7 @@ class SettingsControllerTest extends ControllerTest
|
||||||
public function testSaveIfsgCertificateLight(): void
|
public function testSaveIfsgCertificateLight(): void
|
||||||
{
|
{
|
||||||
config(['ifsg_enabled' => true]);
|
config(['ifsg_enabled' => true]);
|
||||||
|
config(['ifsg_light_enabled' => true]);
|
||||||
$this->setExpects($this->auth, 'user', null, $this->user, $this->once());
|
$this->setExpects($this->auth, 'user', null, $this->user, $this->once());
|
||||||
|
|
||||||
$body = [
|
$body = [
|
||||||
|
|
Loading…
Reference in New Issue