Add table for ifsg to angeltype
This commit is contained in:
parent
c63a671dc4
commit
80bec733bd
|
@ -41,7 +41,11 @@ function user_ifsg_certificate_required_hint()
|
||||||
|
|
||||||
$angeltypes = $user->userAngelTypes;
|
$angeltypes = $user->userAngelTypes;
|
||||||
foreach ($angeltypes as $angeltype) {
|
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(
|
return sprintf(
|
||||||
__('angeltype.ifsg.required.info.here'),
|
__('angeltype.ifsg.required.info.here'),
|
||||||
'<a href="' . url('/settings/certificates') . '">' . __('ifsg.info') . '</a>'
|
'<a href="' . url('/settings/certificates') . '">' . __('ifsg.info') . '</a>'
|
||||||
|
|
|
@ -191,7 +191,11 @@ function AngelType_view_buttons(
|
||||||
error(__('This angeltype requires a driver license. Please enter your driver license information!'));
|
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'));
|
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_12t_truck'] = icon_bool($member->license->drive_12t);
|
||||||
$member['has_license_forklift'] = icon_bool($member->license->drive_forklift);
|
$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)) {
|
if ($angeltype->restricted && empty($member->pivot->confirm_user_id)) {
|
||||||
$member['actions'] = table_buttons([
|
$member['actions'] = table_buttons([
|
||||||
|
@ -336,13 +344,14 @@ function AngelType_view_table_headers(AngelType $angeltype, $supporter, $admin_a
|
||||||
{
|
{
|
||||||
$headers = [
|
$headers = [
|
||||||
'name' => __('Nick'),
|
'name' => __('Nick'),
|
||||||
'dect' => __('DECT'),
|
|
||||||
'actions' => '',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (config('enable_dect')) {
|
||||||
|
$headers['dect'] = __('DECT');
|
||||||
|
}
|
||||||
|
|
||||||
if ($angeltype->requires_driver_license && ($supporter || $admin_angeltypes)) {
|
if ($angeltype->requires_driver_license && ($supporter || $admin_angeltypes)) {
|
||||||
$headers = [
|
$headers = array_merge($headers, [
|
||||||
'name' => __('Nick'),
|
|
||||||
'dect' => __('DECT'),
|
|
||||||
'wants_to_drive' => __('Driver'),
|
'wants_to_drive' => __('Driver'),
|
||||||
'has_car' => __('Has car'),
|
'has_car' => __('Has car'),
|
||||||
'has_license_car' => __('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_7_5t_truck' => __('7,5t Truck'),
|
||||||
'has_license_12t_truck' => __('12t Truck'),
|
'has_license_12t_truck' => __('12t Truck'),
|
||||||
'has_license_forklift' => __('Forklift'),
|
'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;
|
return $headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2233,6 +2233,9 @@ msgstr "Benötigt eine Gesundheitsbelehrung"
|
||||||
msgid "ifsg.certificate"
|
msgid "ifsg.certificate"
|
||||||
msgstr "Gesundheitsbelehrung"
|
msgstr "Gesundheitsbelehrung"
|
||||||
|
|
||||||
|
msgid "ifsg.certificate_light"
|
||||||
|
msgstr "Gesundheitsbelehrung vor Ort"
|
||||||
|
|
||||||
msgid "angeltype.ifsg.own"
|
msgid "angeltype.ifsg.own"
|
||||||
msgstr "Meine Gesundheitsbelehrung"
|
msgstr "Meine Gesundheitsbelehrung"
|
||||||
|
|
||||||
|
|
|
@ -331,6 +331,9 @@ msgstr "Requires health instruction"
|
||||||
msgid "ifsg.certificate"
|
msgid "ifsg.certificate"
|
||||||
msgstr "health instruction"
|
msgstr "health instruction"
|
||||||
|
|
||||||
|
msgid "ifsg.certificate_light"
|
||||||
|
msgstr "health instruction on site"
|
||||||
|
|
||||||
msgid "angeltype.ifsg.own"
|
msgid "angeltype.ifsg.own"
|
||||||
msgstr "my health instruction"
|
msgstr "my health instruction"
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,8 @@ use Illuminate\Database\Query\Builder as QueryBuilder;
|
||||||
* @property bool $drive_3_5t
|
* @property bool $drive_3_5t
|
||||||
* @property bool $drive_7_5t
|
* @property bool $drive_7_5t
|
||||||
* @property bool $drive_12t
|
* @property bool $drive_12t
|
||||||
|
* @property bool $ifsg_certificate_light
|
||||||
|
* @property bool $ifsg_certificate
|
||||||
*
|
*
|
||||||
* @method static QueryBuilder|License[] whereHasCar($value)
|
* @method static QueryBuilder|License[] whereHasCar($value)
|
||||||
* @method static QueryBuilder|License[] whereDriveForklift($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[] whereDrive35T($value)
|
||||||
* @method static QueryBuilder|License[] whereDrive75T($value)
|
* @method static QueryBuilder|License[] whereDrive75T($value)
|
||||||
* @method static QueryBuilder|License[] whereDrive12T($value)
|
* @method static QueryBuilder|License[] whereDrive12T($value)
|
||||||
|
* @method static QueryBuilder|License[] whereIfsgCertificateLight($value)
|
||||||
|
* @method static QueryBuilder|License[] whereIfsgCertificate($value)
|
||||||
*/
|
*/
|
||||||
class License extends HasUserModel
|
class License extends HasUserModel
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue