From 32ec2c1debb0f54a9209b99a1119e6fedc43fa06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Thu, 2 Oct 2025 16:40:18 +0200 Subject: [PATCH] feat: make room selection fields read-only for single room type --- src/Form/Service/ParticipantFieldOptionsProvider.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Form/Service/ParticipantFieldOptionsProvider.php b/src/Form/Service/ParticipantFieldOptionsProvider.php index 805a8ee..3fc4a76 100644 --- a/src/Form/Service/ParticipantFieldOptionsProvider.php +++ b/src/Form/Service/ParticipantFieldOptionsProvider.php @@ -84,7 +84,7 @@ class ParticipantFieldOptionsProvider extends AbstractFieldOptionsProvider // Room assignment field provider (only available for create workflow) $this->fieldOptionProviders['assignedRoomId'] = fn (BookingDtoInterface $bookingDto, int $participantIndex, array $options = []) => [ 'label' => 'Zimmer', - 'placeholder' => 'Bitte wählen', + 'placeholder' => 'Nicht zugeordnet', // Use factory to create context-aware choice loader that: // - Shows only available rooms for this participant // - Excludes rooms already assigned to other participants @@ -96,6 +96,9 @@ class ParticipantFieldOptionsProvider extends AbstractFieldOptionsProvider $participantIndex ) : null, + // Make field read-only when only one room type is selected + // Room is auto-assigned, no user choice needed + 'disabled' => $bookingDto instanceof BookingCreateDto && 1 === count($bookingDto->getSelectedRooms()), ]; // Courses field provider - provides age-appropriate courses from travel data