From e6251256b320046ba41f9c1f10bcf1c4305f2652 Mon Sep 17 00:00:00 2001 From: Xu Date: Fri, 29 Mar 2024 09:14:17 +0100 Subject: [PATCH] fix certificates button on AngelTypes_view, add id to location change log --- includes/view/AngelTypes_view.php | 12 ++++++++++-- src/Controllers/Admin/LocationsController.php | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/includes/view/AngelTypes_view.php b/includes/view/AngelTypes_view.php index a755a052..5750df13 100644 --- a/includes/view/AngelTypes_view.php +++ b/includes/view/AngelTypes_view.php @@ -202,13 +202,21 @@ function AngelType_view_buttons( $user_license, $user ) { - if (config('driving_license_enabled') && $angeltype->requires_driver_license) { + if ( + config('driving_license_enabled') + && $angeltype->requires_driver_license + && $user_angeltype + ) { $buttons[] = button( url('/settings/certificates'), icon('person-vcard') . __('My driving license') ); } - if (config('ifsg_enabled') && $angeltype->requires_ifsg_certificate) { + if ( + config('ifsg_enabled') + && $angeltype->requires_ifsg_certificate + && $user_angeltype + ) { $buttons[] = button( url('/settings/certificates'), icon('card-checklist') . __('angeltype.ifsg.own') diff --git a/src/Controllers/Admin/LocationsController.php b/src/Controllers/Admin/LocationsController.php index a012f19b..1229dc82 100644 --- a/src/Controllers/Admin/LocationsController.php +++ b/src/Controllers/Admin/LocationsController.php @@ -117,8 +117,9 @@ class LocationsController extends BaseController } $this->log->info( - 'Updated location "{name}": {description} {dect} {map_url} {angels}', + 'Updated location "{name}" ({id}): {description} {dect} {map_url} {angels}', [ + 'id' => $location->id, 'name' => $location->name, 'description' => $location->description, 'dect' => $location->dect,