2015-12-19 23:31:08 +01:00
|
|
|
<?php
|
|
|
|
|
2021-12-19 18:38:42 +01:00
|
|
|
use Engelsystem\Models\User\License;
|
2018-10-10 03:10:28 +02:00
|
|
|
use Engelsystem\Models\User\User;
|
|
|
|
|
2015-12-19 23:31:08 +01:00
|
|
|
/**
|
|
|
|
* Edit a user's driving license information.
|
2016-11-17 14:35:04 +01:00
|
|
|
*
|
2018-10-10 03:10:28 +02:00
|
|
|
* @param User $user_source The user
|
2021-12-19 18:38:42 +01:00
|
|
|
* @param License $user_driver_license The user driver license
|
2016-11-17 14:35:04 +01:00
|
|
|
* @return string
|
2015-12-19 23:31:08 +01:00
|
|
|
*/
|
2021-12-19 18:38:42 +01:00
|
|
|
function UserDriverLicense_edit_view($user_source, $user_driver_license)
|
2017-01-02 03:57:23 +01:00
|
|
|
{
|
2023-10-25 17:38:23 +02:00
|
|
|
$link = button(user_link($user_source->id), icon('chevron-left'), 'btn-sm');
|
|
|
|
return page_with_title(
|
|
|
|
$link . ' ' . sprintf(__('Edit %s driving license information'), User_Nick_render($user_source)),
|
|
|
|
[
|
|
|
|
msg(),
|
|
|
|
form([
|
|
|
|
form_info(__('Privacy'), __('Your driving license information is only visible for supporters and admins.')),
|
|
|
|
form_checkbox('wants_to_drive', __('I am willing to drive a car for the event'), $user_driver_license->wantsToDrive()),
|
|
|
|
div('m-3', [
|
|
|
|
form_checkbox(
|
|
|
|
'has_car',
|
|
|
|
__('I have my own car with me and am willing to use it for the event (You\'ll get reimbursed for fuel)'),
|
|
|
|
$user_driver_license->has_car
|
|
|
|
),
|
|
|
|
heading(__('driving license'), 3),
|
|
|
|
form_checkbox('has_license_car', __('Car'), $user_driver_license->drive_car),
|
|
|
|
form_checkbox(
|
|
|
|
'has_license_3_5t_transporter',
|
|
|
|
__('3.5t Transporter'),
|
|
|
|
$user_driver_license->drive_3_5t
|
|
|
|
),
|
|
|
|
form_checkbox(
|
|
|
|
'has_license_7_5t_truck',
|
|
|
|
__('7.5t Truck'),
|
|
|
|
$user_driver_license->drive_7_5t
|
|
|
|
),
|
|
|
|
form_checkbox(
|
|
|
|
'has_license_12t_truck',
|
|
|
|
__('12t Truck'),
|
|
|
|
$user_driver_license->drive_12t
|
|
|
|
),
|
|
|
|
form_checkbox(
|
|
|
|
'has_license_forklift',
|
|
|
|
__('Forklift'),
|
|
|
|
$user_driver_license->drive_forklift
|
|
|
|
),
|
|
|
|
], 'driving_license'),
|
|
|
|
form_submit('submit', __('form.save')),
|
|
|
|
]),
|
|
|
|
],
|
|
|
|
true
|
|
|
|
);
|
2015-12-19 23:31:08 +01:00
|
|
|
}
|