From 354ec084ebe407a1de929d02684db564d3a81a03 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 27 Nov 2022 12:14:14 +0100 Subject: [PATCH] Show driver's license button on user page when angeltype requires it --- includes/view/User_view.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/view/User_view.php b/includes/view/User_view.php index 9a1d319a..11556430 100644 --- a/includes/view/User_view.php +++ b/includes/view/User_view.php @@ -485,6 +485,11 @@ function User_view( } } + $needs_drivers_license = false; + foreach ($user_angeltypes as $angeltype) { + $needs_drivers_license = $needs_drivers_license || $angeltype['requires_driver_license']; + } + return page_with_title( ' ' . ( @@ -507,7 +512,7 @@ function User_view( page_link_to('admin_user', ['id' => $user_source->id]), icon('pencil-square') . __('edit') ) : '', - $admin_user_privilege ? button( + $admin_user_privilege || ($its_me && $needs_drivers_license) ? button( user_driver_license_edit_link($user_source), icon('wallet2') . __('driving license') ) : '',