add requires ifsg certificate
This commit is contained in:
parent
f345942e46
commit
8dd4af1bb6
|
@ -324,7 +324,7 @@ return [
|
|||
],
|
||||
|
||||
# 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', true),
|
||||
|
||||
// Available locales in /resources/lang/
|
||||
'locales' => [
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Engelsystem\Migrations;
|
||||
|
||||
use Engelsystem\Database\Migration\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class AddRequiresIfsgCerificateToAngeltypes extends Migration
|
||||
{
|
||||
use Reference;
|
||||
|
||||
/**
|
||||
* Run the migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$this->schema->table('angel_types', function (Blueprint $table): void {
|
||||
$table->boolean('requires_ifsg_certificate')->default(false)->after('requires_driver_license');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
$this->schema->table('angel_types', function (Blueprint $table): void {
|
||||
$table->dropColumn('requires_ifsg_certificate');
|
||||
});
|
||||
}
|
||||
}
|
|
@ -123,6 +123,7 @@ function angeltype_edit_controller()
|
|||
$angeltype->hide_register = $request->has('hide_register');
|
||||
|
||||
$angeltype->requires_driver_license = $request->has('requires_driver_license');
|
||||
$angeltype->requires_ifsg_certificate = $request->has('requires_ifsg_certificate');
|
||||
}
|
||||
|
||||
$angeltype->description = strip_request_item_nl('description', $angeltype->description);
|
||||
|
@ -139,6 +140,7 @@ function angeltype_edit_controller()
|
|||
'Saved angeltype: ' . $angeltype->name . ($angeltype->restricted ? ', restricted' : '')
|
||||
. ($angeltype->no_self_signup ? ', no_self_signup' : '')
|
||||
. ($angeltype->requires_driver_license ? ', requires driver license' : '') . ', '
|
||||
. ($angeltype->requires_ifsg_certificate ? ', requires ifsg certificate' : '') . ', '
|
||||
. $angeltype->contact_name . ', '
|
||||
. $angeltype->contact_dect . ', '
|
||||
. $angeltype->contact_email . ', '
|
||||
|
|
|
@ -111,6 +111,18 @@ function AngelType_edit_view(AngelType $angeltype, bool $supporter_mode)
|
|||
__('Requires driver license'),
|
||||
$angeltype->requires_driver_license
|
||||
),
|
||||
$supporter_mode && config('ifsg_enabled')?
|
||||
form_info(
|
||||
__('requires IfSG certificate'),
|
||||
$angeltype->requires_ifsg_certificate
|
||||
? __('Yes')
|
||||
: __('No')
|
||||
) :
|
||||
form_checkbox(
|
||||
'requires_ifsg_certificate',
|
||||
__('requires IfSG certificate'),
|
||||
$angeltype->requires_ifsg_certificate
|
||||
),
|
||||
$supporter_mode
|
||||
? form_info(__('Show on dashboard'), $angeltype->show_on_dashboard ? __('Yes') : __('No'))
|
||||
: form_checkbox('show_on_dashboard', __('Show on dashboard'), $angeltype->show_on_dashboard),
|
||||
|
@ -161,6 +173,12 @@ function AngelType_view_buttons(
|
|||
icon('person-vcard') . __('my driving license')
|
||||
);
|
||||
}
|
||||
if ($angeltype->requires_ifsg_certificate) {
|
||||
$buttons[] = button(
|
||||
user_driver_license_edit_link($user),
|
||||
icon('card-checklist') . __('my ifsg certificate')
|
||||
);
|
||||
}
|
||||
|
||||
if (is_null($user_angeltype)) {
|
||||
$buttons[] = button(
|
||||
|
@ -173,6 +191,10 @@ function AngelType_view_buttons(
|
|||
error(__('This angeltype requires a driver license. Please enter your driver license information!'));
|
||||
}
|
||||
|
||||
if ($angeltype->requires_ifsg_certificate && !$user->license->ifsg_certificate) {
|
||||
error(__('This angeltype requires an ifsg certificate. Please enter your ifsg certificate information!'));
|
||||
}
|
||||
|
||||
if ($angeltype->restricted && !$user_angeltype->confirm_user_id) {
|
||||
error(sprintf(
|
||||
__('You are unconfirmed for this angeltype. Please go to the introduction for %s to get confirmed.'),
|
||||
|
|
|
@ -534,6 +534,11 @@ function User_view(
|
|||
$needs_drivers_license = $needs_drivers_license || $angeltype->requires_driver_license;
|
||||
}
|
||||
|
||||
$needs_ifsg_certificate = false;
|
||||
foreach ($user_angeltypes as $angeltype) {
|
||||
$needs_ifsg_certificate = $needs_ifsg_certificate || $angeltype->requires_ifsg_certificate;
|
||||
}
|
||||
|
||||
return page_with_title(
|
||||
'<span class="icon-icon_angel"></span> '
|
||||
. (
|
||||
|
@ -560,6 +565,10 @@ function User_view(
|
|||
user_driver_license_edit_link($user_source),
|
||||
icon('person-vcard') . __('driving license')
|
||||
) : '',
|
||||
config('ifsg_enabled') && ($admin_user_privilege || ($its_me && $needs_drivers_license)) ? button(
|
||||
page_link_to('settings/certificates'),
|
||||
icon('card-checklist') . __('ifsg certificate')
|
||||
) : '',
|
||||
(($admin_user_privilege || $auth->can('admin_arrive')) && !$user_source->state->arrived) ?
|
||||
form([
|
||||
form_hidden('action', 'arrived'),
|
||||
|
|
|
@ -2207,21 +2207,33 @@ msgstr "Hier kannst Du Dein Theme ändern."
|
|||
msgid "settings.theme.success"
|
||||
msgstr "Theme wurde erfolgreich geändert."
|
||||
|
||||
msgid settings.certificates
|
||||
msgid "settings.certificates"
|
||||
msgstr "Zertifikate"
|
||||
|
||||
msgid settings.certificates.info
|
||||
msgid "settings.certificates.info"
|
||||
msgstr "Hier kannst du deine gemachte Gesundheitsbelehrung eintragen"
|
||||
|
||||
msgid settings.ifsg
|
||||
msgstr "Kleines Frikadellendiplom ()"
|
||||
msgid "settings.ifsg"
|
||||
msgstr "Frikadellendiplom light: Du wurdest von c3gelb vor Ort nach ISfG §43 belehrt."
|
||||
|
||||
msgid settings.ifsg_full
|
||||
msgstr "Großes Frikadellendiplom ()"
|
||||
msgid "settings.ifsg_full"
|
||||
msgstr "Frikadellendiplom: Du hast eine Belehrung nach §43 ISfG bei deinem Gesundheitsamt erhalten und innerhalb von 3 Monaten die Zweitbelehrung durch uns oder deinen Arbeitgeber/Koch/Verein bekommen. Zusätzlich ist die Zweibelehrung nicht älter als zwei Jahre."
|
||||
|
||||
msgid settings.certificates.success
|
||||
msgid "settings.certificates.success"
|
||||
msgstr "Gesundheitsbelehrung wurde erfolgreich geändert."
|
||||
|
||||
msgid "requires IfSG certificate"
|
||||
msgstr "benötigt eine Gesundheitsbelehrung"
|
||||
|
||||
msgid "ifsg certificate"
|
||||
msgstr "Gesundheitsbelehrung"
|
||||
|
||||
msgid "my ifsg certificate"
|
||||
msgstr "Meine Gesundheitsbelehrung"
|
||||
|
||||
msgid "This angeltype requires an ifsg certificate. Please enter your ifsg certificate information!"
|
||||
msgstr "Dieser Engeltyp benötigt eine Gesundheitsbelehrung. Bitte trage deine Gesundheitsbelehrung ein!"
|
||||
|
||||
msgid "settings.language"
|
||||
msgstr "Sprache"
|
||||
|
||||
|
|
|
@ -311,14 +311,29 @@ msgstr "Theme was changed successfully."
|
|||
msgid settings.certificates
|
||||
msgstr "Certificates"
|
||||
|
||||
msgid settings.certificates.info
|
||||
msgid "settings.certificates.info"
|
||||
msgstr "Here you can enter your health instruction"
|
||||
|
||||
msgid settings.ifsg
|
||||
msgid "settings.ifsg"
|
||||
msgstr "Frikadellendiplom light: You were instructed from c3gelb about ISfG §43 on site."
|
||||
|
||||
msgid settings.ifsg_full
|
||||
msgid "settings.ifsg_full"
|
||||
msgstr "Frikadellendiplom: You have gotten the instruction about §43 ISfG from your Health Department and a second instruction from us or your employer/chef/assosiation within 3 months. Additionally your second instruction is not older than 2 years."
|
||||
|
||||
msgid settings.certificates.success
|
||||
msgstr "IfSG certificate was changed successfully."
|
||||
msgid "settings.certificates.success"
|
||||
msgstr "Health instruction was changed successfully."
|
||||
|
||||
msgid "requires IfSG certificate"
|
||||
msgstr "requires health instruction"
|
||||
|
||||
msgid "ifsg certificate"
|
||||
msgstr "health instruction"
|
||||
|
||||
msgid "my ifsg certificate"
|
||||
msgstr "my health instruction"
|
||||
|
||||
msgid "This angeltype requires an ifsg certificate. Please enter your ifsg certificate information!"
|
||||
msgstr ""This angeltype requires a health instruction. Please enter your health instruction information!""
|
||||
|
||||
msgid "settings.language"
|
||||
msgstr "Language"
|
||||
|
|
|
@ -225,7 +225,7 @@ class SettingsController extends BaseController
|
|||
public function ifsgCertificate(): Response
|
||||
{
|
||||
$user = $this->auth->user();
|
||||
if (config('ifsg_enabled')) {
|
||||
if (!config('ifsg_enabled')) {
|
||||
throw new HttpNotFound('ifsg.disabled');
|
||||
}
|
||||
return $this->response->withView(
|
||||
|
@ -246,7 +246,7 @@ class SettingsController extends BaseController
|
|||
'ifsg_certificate_full' => 'optional|checked'
|
||||
]);
|
||||
|
||||
if (config('ifsg_enabled')) {
|
||||
if (!config('ifsg_enabled')) {
|
||||
throw new HttpNotFound('ifsg.disabled');
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ use Illuminate\Database\Query\Builder as QueryBuilder;
|
|||
* @property string $contact_email
|
||||
* @property boolean $restricted # If users need an introduction
|
||||
* @property boolean $requires_driver_license # If users must have a driver license
|
||||
* @property boolean $requires_ifsg_certificate # If users must have a ifsg certificate
|
||||
* @property boolean $no_self_signup # Users can sign up for shifts
|
||||
* @property boolean $show_on_dashboard # Show on public dashboard
|
||||
* @property boolean $hide_register # Hide from registration page
|
||||
|
@ -59,6 +60,7 @@ class AngelType extends BaseModel
|
|||
|
||||
'restricted',
|
||||
'requires_driver_license',
|
||||
'requires_ifsg_certificate',
|
||||
'no_self_signup',
|
||||
'show_on_dashboard',
|
||||
'hide_register',
|
||||
|
@ -66,11 +68,12 @@ class AngelType extends BaseModel
|
|||
|
||||
/** @var array<string, string> */
|
||||
protected $casts = [ // phpcs:ignore
|
||||
'restricted' => 'boolean',
|
||||
'requires_driver_license' => 'boolean',
|
||||
'no_self_signup' => 'boolean',
|
||||
'show_on_dashboard' => 'boolean',
|
||||
'hide_register' => 'boolean',
|
||||
'restricted' => 'boolean',
|
||||
'requires_driver_license' => 'boolean',
|
||||
'requires_ifsg_certificate' => 'boolean',
|
||||
'no_self_signup' => 'boolean',
|
||||
'show_on_dashboard' => 'boolean',
|
||||
'hide_register' => 'boolean',
|
||||
];
|
||||
|
||||
public function neededBy(): HasMany
|
||||
|
|
Loading…
Reference in New Issue