diff --git a/includes/controller/user_driver_licenses_controller.php b/includes/controller/user_driver_licenses_controller.php index 07909357..f74c33ac 100644 --- a/includes/controller/user_driver_licenses_controller.php +++ b/includes/controller/user_driver_licenses_controller.php @@ -41,7 +41,11 @@ function user_ifsg_certificate_required_hint() $angeltypes = $user->userAngelTypes; foreach ($angeltypes as $angeltype) { - if ($angeltype->requires_ifsg_certificate) { + if ( + $angeltype->requires_ifsg_certificate && !( + $user->license->ifsg_certificate || $user->license->ifsg_certificate_light + ) + ) { return sprintf( __('angeltype.ifsg.required.info.here'), '' . __('ifsg.info') . '' diff --git a/includes/view/AngelTypes_view.php b/includes/view/AngelTypes_view.php index f268f137..09d0265f 100644 --- a/includes/view/AngelTypes_view.php +++ b/includes/view/AngelTypes_view.php @@ -191,7 +191,11 @@ function AngelType_view_buttons( error(__('This angeltype requires a driver license. Please enter your driver license information!')); } - if (config('ifsg_enabled') && $angeltype->requires_ifsg_certificate && (!$user->license->ifsg_certificate_light || !$user->license->ifsg_certificate)) { + if ( + config('ifsg_enabled') && $angeltype->requires_ifsg_certificate && !( + $user->license->ifsg_certificate_light || $user->license->ifsg_certificate + ) + ) { error(__('angeltype.ifsg.required.info')); } @@ -251,6 +255,10 @@ function AngelType_view_members(AngelType $angeltype, $members, $admin_user_ange $member['has_license_12t_truck'] = icon_bool($member->license->drive_12t); $member['has_license_forklift'] = icon_bool($member->license->drive_forklift); } + if ($angeltype->requires_ifsg_certificate) { + $member['ifsg_certificate'] = icon_bool($member->license->ifsg_certificate); + $member['ifsg_certificate_light'] = icon_bool($member->license->ifsg_certificate_light); + } if ($angeltype->restricted && empty($member->pivot->confirm_user_id)) { $member['actions'] = table_buttons([ @@ -336,13 +344,14 @@ function AngelType_view_table_headers(AngelType $angeltype, $supporter, $admin_a { $headers = [ 'name' => __('Nick'), - 'dect' => __('DECT'), - 'actions' => '', ]; + + if (config('enable_dect')) { + $headers['dect'] = __('DECT'); + } + if ($angeltype->requires_driver_license && ($supporter || $admin_angeltypes)) { - $headers = [ - 'name' => __('Nick'), - 'dect' => __('DECT'), + $headers = array_merge($headers, [ 'wants_to_drive' => __('Driver'), 'has_car' => __('Has car'), 'has_license_car' => __('Car'), @@ -350,12 +359,16 @@ function AngelType_view_table_headers(AngelType $angeltype, $supporter, $admin_a 'has_license_7_5t_truck' => __('7,5t Truck'), 'has_license_12t_truck' => __('12t Truck'), 'has_license_forklift' => __('Forklift'), - 'actions' => '', - ]; + ]); } - if (!config('enable_dect')) { - unset($headers['dect']); + + if (config('ifsg_enabled') && $angeltype->requires_ifsg_certificate && ($supporter || $admin_angeltypes)) { + $headers['ifsg_certificate_light'] = __('ifsg.certificate_light'); + $headers['ifsg_certificate'] = __('ifsg.certificate'); } + + $headers['actions'] = ''; + return $headers; } diff --git a/resources/lang/de_DE/default.po b/resources/lang/de_DE/default.po index fb6cffa4..faab84d7 100644 --- a/resources/lang/de_DE/default.po +++ b/resources/lang/de_DE/default.po @@ -2233,6 +2233,9 @@ msgstr "Benötigt eine Gesundheitsbelehrung" msgid "ifsg.certificate" msgstr "Gesundheitsbelehrung" +msgid "ifsg.certificate_light" +msgstr "Gesundheitsbelehrung vor Ort" + msgid "angeltype.ifsg.own" msgstr "Meine Gesundheitsbelehrung" diff --git a/resources/lang/en_US/default.po b/resources/lang/en_US/default.po index 4569cd7f..2594f45c 100644 --- a/resources/lang/en_US/default.po +++ b/resources/lang/en_US/default.po @@ -331,6 +331,9 @@ msgstr "Requires health instruction" msgid "ifsg.certificate" msgstr "health instruction" +msgid "ifsg.certificate_light" +msgstr "health instruction on site" + msgid "angeltype.ifsg.own" msgstr "my health instruction" diff --git a/src/Models/User/License.php b/src/Models/User/License.php index 19aecbeb..383f9651 100644 --- a/src/Models/User/License.php +++ b/src/Models/User/License.php @@ -14,6 +14,8 @@ use Illuminate\Database\Query\Builder as QueryBuilder; * @property bool $drive_3_5t * @property bool $drive_7_5t * @property bool $drive_12t + * @property bool $ifsg_certificate_light + * @property bool $ifsg_certificate * * @method static QueryBuilder|License[] whereHasCar($value) * @method static QueryBuilder|License[] whereDriveForklift($value) @@ -21,6 +23,8 @@ use Illuminate\Database\Query\Builder as QueryBuilder; * @method static QueryBuilder|License[] whereDrive35T($value) * @method static QueryBuilder|License[] whereDrive75T($value) * @method static QueryBuilder|License[] whereDrive12T($value) + * @method static QueryBuilder|License[] whereIfsgCertificateLight($value) + * @method static QueryBuilder|License[] whereIfsgCertificate($value) */ class License extends HasUserModel {