From 9955ff7df9526f6127652834114bb17ce51ea6f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Tue, 6 Jan 2026 11:56:03 +0100 Subject: [PATCH] feat: link terms in confirmation checkbox label --- .env | 1 + config/services.yaml | 2 ++ src/Form/BookingCreateStep4Type.php | 13 ++++++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 6934981..33b8056 100644 --- a/.env +++ b/.env @@ -50,6 +50,7 @@ APP_BPN_STREAM_TIMEOUT=30 APP_BPN_TOTAL_TIMEOUT=45 APP_TRAVEL_INFO_BASE_URL="https://www.ep-reisen.de/reiseinformationen/" +APP_TERMS_AND_CONDITIONS_URL="https://www.ep-reisen.de/skireisen/infos/allgemeine-infos/agb/" APP_CMS_API_BASE_URL="https://www.ep-reisen.de/" APP_WEBSITE_BASE_URL="https://www.ep-reisen.de/" diff --git a/config/services.yaml b/config/services.yaml index 1fc099b..5230898 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -5,6 +5,7 @@ # https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration parameters: travel_info_base_url: '%env(APP_TRAVEL_INFO_BASE_URL)%' + terms_and_conditions_url: '%env(APP_TERMS_AND_CONDITIONS_URL)%' path_to_keys: '%kernel.project_dir%/config/secret' # Body dimensions choices for BodyDimensionsType @@ -38,6 +39,7 @@ services: $xmlDump: '@xml_dump.storage' $jsonExport: '@json_export.storage' $travelInfoBaseUrl: '%env(APP_TRAVEL_INFO_BASE_URL)%' + $termsAndConditionsUrl: '%terms_and_conditions_url%' $logger: '@monolog.logger.core' $environment: '%kernel.environment%' diff --git a/src/Form/BookingCreateStep4Type.php b/src/Form/BookingCreateStep4Type.php index 45f279b..f20f98c 100644 --- a/src/Form/BookingCreateStep4Type.php +++ b/src/Form/BookingCreateStep4Type.php @@ -13,8 +13,18 @@ use Symfony\Component\Validator\Constraints as Assert; class BookingCreateStep4Type extends AbstractType { + public function __construct( + private readonly string $termsAndConditionsUrl, + ) { + } + public function buildForm(FormBuilderInterface $builder, array $options): void { + $termsLink = sprintf( + 'AGB', + htmlspecialchars($this->termsAndConditionsUrl, ENT_QUOTES, 'UTF-8') + ); + $builder ->add('confirmationAccepted', CheckboxType::class, [ 'label' => 'Ich bestätige, dass alle Angaben korrekt sind und möchte verbindlich buchen.', @@ -26,7 +36,8 @@ class BookingCreateStep4Type extends AbstractType ], ]) ->add('termsAccepted', CheckboxType::class, [ - 'label' => 'Ich bestätige, dass ich die AGB akzeptiere', + 'label' => sprintf('Ich bestätige, dass ich die %s akzeptiere', $termsLink), + 'label_html' => true, 'mapped' => false, 'constraints' => [ new Assert\IsTrue(