feat: selectable drop-offs for inbound bus travel
This commit is contained in:
@@ -197,6 +197,25 @@ class EditFieldStateProvider extends AbstractFieldStateProvider
|
||||
'readonly' => $pickupsMutabilityCondition,
|
||||
];
|
||||
|
||||
// Show differentDropOff checkbox only when BOTH outbound and inbound are BUS, readonly if pickups not mutable
|
||||
$this->fieldStateConditions['differentDropOff'] = [
|
||||
'hidden' => CompositeCondition::not(
|
||||
CompositeCondition::and(
|
||||
ServiceSubTypeCondition::equals('transportationOutbound', DirectionMapper::SUBTYPE_BUS_API),
|
||||
ServiceSubTypeCondition::equals('transportationInbound', DirectionMapper::SUBTYPE_BUS_API)
|
||||
)
|
||||
),
|
||||
'readonly' => $pickupsMutabilityCondition,
|
||||
];
|
||||
|
||||
// Show drop-off when inbound is BUS (options provider further gates on checkbox state in BUS+BUS)
|
||||
$this->fieldStateConditions['dropOff'] = [
|
||||
'hidden' => CompositeCondition::not(
|
||||
ServiceSubTypeCondition::equals('transportationInbound', DirectionMapper::SUBTYPE_BUS_API)
|
||||
),
|
||||
'readonly' => $pickupsMutabilityCondition,
|
||||
];
|
||||
|
||||
// Parking - shown only when outbound transportation is PKW AND participant is 18+, readonly if transportation not mutable
|
||||
// Participants under 18 cannot drive in Germany, so parking is not relevant for them
|
||||
$minimumDrivingAgeCondition = new AgeRangeCondition(18);
|
||||
|
||||
Reference in New Issue
Block a user