From d98efb1bc2541e731a22f6c1480e1c8f680ae19c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Tue, 27 Feb 2024 16:04:46 +0100 Subject: [PATCH 1/3] fix: apply booking url template code to ajax rendered price tables --- .../ep_products/Classes/Controller/AjaxTableController.php | 5 +++-- .../Resources/Private/Templates/Hotel/DetailEvent.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/typo3conf/ext/ep_products/Classes/Controller/AjaxTableController.php b/public/typo3conf/ext/ep_products/Classes/Controller/AjaxTableController.php index 3bbc1ddd..b650aef6 100644 --- a/public/typo3conf/ext/ep_products/Classes/Controller/AjaxTableController.php +++ b/public/typo3conf/ext/ep_products/Classes/Controller/AjaxTableController.php @@ -226,7 +226,8 @@ class AjaxTableController extends ActionController Product $product, Hotel $hotel, Date $date, - bool $singleDate = false + bool $singleDate = false, + string $bookingUrlTemplateCode = 'base' ): void { $forcedConceptUids = GeneralUtility::trimExplode(',', $this->settings['forcedConceptUids'], true); $filterSettings = $this->filterService->getNormalizedFilterSettings([], $forcedConceptUids); @@ -236,7 +237,7 @@ class AjaxTableController extends ActionController 'hotel' => $hotel, 'filterSettings' => $filterSettings, 'date' => $date, - 'template' => $this->settings['bpnBookingUrlTemplateCode'], + 'template' => $bookingUrlTemplateCode, 'paCode' => GeneralUtility::_GET('pa'), ]); $hasSurchargeOrDiscount = $this->dateService->checkSurcharcheOrDiscount($priceTable); diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Hotel/DetailEvent.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Hotel/DetailEvent.html index 6a8ee2f5..37c3b9af 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Hotel/DetailEvent.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Hotel/DetailEvent.html @@ -21,7 +21,7 @@

Buchungsoptionen

+ data-ajax-content-uri-value="{ep:uri.ajax(action: 'pricetableHtml', controller: 'AjaxTable', pageUid: settings.defaultAjaxUid, arguments: '{product: product, hotel: hotel, bookingUrlTemplateCode: settings.bookingUrlTemplateCode}', format: 'html')}">
From 935c360ee0c80c046ccd68cfba268b3cb13b5f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Tue, 27 Feb 2024 16:05:13 +0100 Subject: [PATCH 2/3] chore: update project dependencies --- composer.lock | 96 +++++++++++++++++++++++++-------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/composer.lock b/composer.lock index eb875ee7..d0946ee2 100644 --- a/composer.lock +++ b/composer.lock @@ -2889,16 +2889,16 @@ }, { "name": "symfony/cache", - "version": "v5.4.35", + "version": "v5.4.36", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "db1adb004e2da984085d0178964eb6f319d3cba1" + "reference": "a30f316214d908cf5874f700f3f3fb29ceee91ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/db1adb004e2da984085d0178964eb6f319d3cba1", - "reference": "db1adb004e2da984085d0178964eb6f319d3cba1", + "url": "https://api.github.com/repos/symfony/cache/zipball/a30f316214d908cf5874f700f3f3fb29ceee91ba", + "reference": "a30f316214d908cf5874f700f3f3fb29ceee91ba", "shasum": "" }, "require": { @@ -2966,7 +2966,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v5.4.35" + "source": "https://github.com/symfony/cache/tree/v5.4.36" }, "funding": [ { @@ -2982,7 +2982,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-02-19T13:08:14+00:00" }, { "name": "symfony/cache-contracts", @@ -3065,16 +3065,16 @@ }, { "name": "symfony/config", - "version": "v5.4.35", + "version": "v5.4.36", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "6b763438a22a4f20885e994ad6702f6a3f25430e" + "reference": "0a4f363dc2f13d2f871f917cc563796d9ddc78d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/6b763438a22a4f20885e994ad6702f6a3f25430e", - "reference": "6b763438a22a4f20885e994ad6702f6a3f25430e", + "url": "https://api.github.com/repos/symfony/config/zipball/0a4f363dc2f13d2f871f917cc563796d9ddc78d1", + "reference": "0a4f363dc2f13d2f871f917cc563796d9ddc78d1", "shasum": "" }, "require": { @@ -3124,7 +3124,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v5.4.35" + "source": "https://github.com/symfony/config/tree/v5.4.36" }, "funding": [ { @@ -3140,20 +3140,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-02-23T16:13:23+00:00" }, { "name": "symfony/console", - "version": "v5.4.35", + "version": "v5.4.36", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "dbdf6adcb88d5f83790e1efb57ef4074309d3931" + "reference": "39f75d9d73d0c11952fdcecf4877b4d0f62a8f6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/dbdf6adcb88d5f83790e1efb57ef4074309d3931", - "reference": "dbdf6adcb88d5f83790e1efb57ef4074309d3931", + "url": "https://api.github.com/repos/symfony/console/zipball/39f75d9d73d0c11952fdcecf4877b4d0f62a8f6e", + "reference": "39f75d9d73d0c11952fdcecf4877b4d0f62a8f6e", "shasum": "" }, "require": { @@ -3223,7 +3223,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.35" + "source": "https://github.com/symfony/console/tree/v5.4.36" }, "funding": [ { @@ -3239,20 +3239,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:28:09+00:00" + "time": "2024-02-20T16:33:57+00:00" }, { "name": "symfony/dependency-injection", - "version": "v5.4.35", + "version": "v5.4.36", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "45474d527212ca67cdb93f6c5e6da68f4bc67118" + "reference": "cc1fb237cd0e6da33005062b13b8485deb6e4440" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/45474d527212ca67cdb93f6c5e6da68f4bc67118", - "reference": "45474d527212ca67cdb93f6c5e6da68f4bc67118", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/cc1fb237cd0e6da33005062b13b8485deb6e4440", + "reference": "cc1fb237cd0e6da33005062b13b8485deb6e4440", "shasum": "" }, "require": { @@ -3312,7 +3312,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v5.4.35" + "source": "https://github.com/symfony/dependency-injection/tree/v5.4.36" }, "funding": [ { @@ -3328,7 +3328,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:37:36+00:00" + "time": "2024-02-22T18:43:31+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4062,16 +4062,16 @@ }, { "name": "symfony/mailer", - "version": "v5.4.35", + "version": "v5.4.36", "source": { "type": "git", "url": "https://github.com/symfony/mailer.git", - "reference": "664724b0fb4646dee30859d0ed9131a2d7633320" + "reference": "b57d722f2bf6e1dc08df9c86efbfdcaaba89693b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailer/zipball/664724b0fb4646dee30859d0ed9131a2d7633320", - "reference": "664724b0fb4646dee30859d0ed9131a2d7633320", + "url": "https://api.github.com/repos/symfony/mailer/zipball/b57d722f2bf6e1dc08df9c86efbfdcaaba89693b", + "reference": "b57d722f2bf6e1dc08df9c86efbfdcaaba89693b", "shasum": "" }, "require": { @@ -4118,7 +4118,7 @@ "description": "Helps sending emails", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailer/tree/v5.4.35" + "source": "https://github.com/symfony/mailer/tree/v5.4.36" }, "funding": [ { @@ -4134,7 +4134,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T07:33:37+00:00" + "time": "2024-02-01T13:42:14+00:00" }, { "name": "symfony/mime", @@ -5079,16 +5079,16 @@ }, { "name": "symfony/process", - "version": "v5.4.35", + "version": "v5.4.36", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "cbc28e34015ad50166fc2f9c8962d28d0fe861eb" + "reference": "4fdf34004f149cc20b2f51d7d119aa500caad975" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/cbc28e34015ad50166fc2f9c8962d28d0fe861eb", - "reference": "cbc28e34015ad50166fc2f9c8962d28d0fe861eb", + "url": "https://api.github.com/repos/symfony/process/zipball/4fdf34004f149cc20b2f51d7d119aa500caad975", + "reference": "4fdf34004f149cc20b2f51d7d119aa500caad975", "shasum": "" }, "require": { @@ -5121,7 +5121,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.35" + "source": "https://github.com/symfony/process/tree/v5.4.36" }, "funding": [ { @@ -5137,7 +5137,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-02-12T15:49:53+00:00" }, { "name": "symfony/property-access", @@ -5579,16 +5579,16 @@ }, { "name": "symfony/string", - "version": "v5.4.35", + "version": "v5.4.36", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "c209c4d0559acce1c9a2067612cfb5d35756edc2" + "reference": "4e232c83622bd8cd32b794216aa29d0d266d353b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/c209c4d0559acce1c9a2067612cfb5d35756edc2", - "reference": "c209c4d0559acce1c9a2067612cfb5d35756edc2", + "url": "https://api.github.com/repos/symfony/string/zipball/4e232c83622bd8cd32b794216aa29d0d266d353b", + "reference": "4e232c83622bd8cd32b794216aa29d0d266d353b", "shasum": "" }, "require": { @@ -5645,7 +5645,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.35" + "source": "https://github.com/symfony/string/tree/v5.4.36" }, "funding": [ { @@ -5661,20 +5661,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-02-01T08:49:30+00:00" }, { "name": "symfony/var-dumper", - "version": "v5.4.35", + "version": "v5.4.36", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "ce4685b30e47d94dfc990c5566285ff99ddf012b" + "reference": "2e9c2b11267119d9c90d6b3fdce5e4e9f15e2e90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/ce4685b30e47d94dfc990c5566285ff99ddf012b", - "reference": "ce4685b30e47d94dfc990c5566285ff99ddf012b", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2e9c2b11267119d9c90d6b3fdce5e4e9f15e2e90", + "reference": "2e9c2b11267119d9c90d6b3fdce5e4e9f15e2e90", "shasum": "" }, "require": { @@ -5734,7 +5734,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.35" + "source": "https://github.com/symfony/var-dumper/tree/v5.4.36" }, "funding": [ { @@ -5750,7 +5750,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:28:09+00:00" + "time": "2024-02-15T11:19:14+00:00" }, { "name": "symfony/var-exporter", From 95b1157ce31f2cf844515c5ae459b2f0ec8fee0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Wed, 28 Feb 2024 15:27:18 +0100 Subject: [PATCH 3/3] fix: properly assign bpn template code to all templates --- .../Controller/AjaxTableController.php | 29 ++++++++++++++----- .../Templates/AjaxTable/Datestable.html | 8 ++++- .../Private/Templates/Product/Detail.html | 2 +- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/public/typo3conf/ext/ep_products/Classes/Controller/AjaxTableController.php b/public/typo3conf/ext/ep_products/Classes/Controller/AjaxTableController.php index b650aef6..1627f942 100644 --- a/public/typo3conf/ext/ep_products/Classes/Controller/AjaxTableController.php +++ b/public/typo3conf/ext/ep_products/Classes/Controller/AjaxTableController.php @@ -126,7 +126,8 @@ class AjaxTableController extends ActionController Product $product, Hotel $hotel, string $dateFrom = null, - string $dateTo = null + string $dateTo = null, + string $bpnBookingUrlTemplateCode = null ): void { $forcedConceptUids = GeneralUtility::trimExplode(',', $this->settings['forcedConceptUids'], true); $filterSettings = $this->filterService->getNormalizedFilterSettings([], $forcedConceptUids); @@ -156,6 +157,7 @@ class AjaxTableController extends ActionController 'date' => $date['dateUid'], 'paCode' => $paCode, 'singleDate' => true, + 'bpnBookingUrlTemplateCode' => $bpnBookingUrlTemplateCode ?? $this->settings['bpnBookingUrlTemplateCode'], ] ); } @@ -211,6 +213,7 @@ class AjaxTableController extends ActionController 'hasDiscount' => $hasSurchargeOrDiscount['discount'], 'isProductWithNoInfoConcept' => $isProductWithNoInfoConcept, 'nonBookableInfo' => $nonBookableInfo, + 'bpnBookingUrlTemplateCode' => $bpnBookingUrlTemplateCode, ]); } @@ -227,7 +230,7 @@ class AjaxTableController extends ActionController Hotel $hotel, Date $date, bool $singleDate = false, - string $bookingUrlTemplateCode = 'base' + string $bpnBookingUrlTemplateCode = null ): void { $forcedConceptUids = GeneralUtility::trimExplode(',', $this->settings['forcedConceptUids'], true); $filterSettings = $this->filterService->getNormalizedFilterSettings([], $forcedConceptUids); @@ -237,7 +240,7 @@ class AjaxTableController extends ActionController 'hotel' => $hotel, 'filterSettings' => $filterSettings, 'date' => $date, - 'template' => $bookingUrlTemplateCode, + 'template' => $bpnBookingUrlTemplateCode ?? $this->settings['bpnBookingUrlTemplateCode'], 'paCode' => GeneralUtility::_GET('pa'), ]); $hasSurchargeOrDiscount = $this->dateService->checkSurcharcheOrDiscount($priceTable); @@ -264,14 +267,16 @@ class AjaxTableController extends ActionController 'isProductWithNoInfoConcept' => $isProductWithNoInfoConcept, 'isSingleDate' => $singleDate, 'nonBookableInfo' => $nonBookableInfo, + 'bpnBookingUrlTemplateCode' => $bpnBookingUrlTemplateCode ?? $this->settings['bpnBookingUrlTemplateCode'], ]); } /** * @param Product $product * @param Hotel $hotel + * @param string $bpnBookingUrlTemplateCode */ - public function pricetableHtmlAction(Product $product, Hotel $hotel): void + public function pricetableHtmlAction(Product $product, Hotel $hotel, string $bpnBookingUrlTemplateCode = null): void { if ($reseller = $this->resellerDataService->getResellerForCurrentDomain()) { $paCode = $reseller['paCode']; @@ -291,12 +296,14 @@ class AjaxTableController extends ActionController $this->view->assign('pricetable', $pricetable); $this->view->assign('nonBookableInfo', $nonBookableInfo); + $this->view->assign('bpnBookingUrlTemplateCode', $bpnBookingUrlTemplateCode ?? $this->settings['bpnBookingUrlTemplateCode']); } /** * @param Product $product + * @param string $bpnBookingUrlTemplateCode */ - public function eventPricetableAction(Product $product): void + public function eventPricetableAction(Product $product, string $bpnBookingUrlTemplateCode = null): void { $roomTypes = GeneralUtility::trimExplode(',', $this->settings['priceTableRoomTypes']); $roomTypesPax = array_map(function ($type) { @@ -326,6 +333,7 @@ class AjaxTableController extends ActionController 'categories' => $categories, 'themekey' => $this->settings['themekey'], 'nonBookableInfo' => $nonBookableInfo, + 'bpnBookingUrlTemplateCode' => $bpnBookingUrlTemplateCode ?? $this->settings['bpnBookingUrlTemplateCode'], ]); } @@ -334,9 +342,15 @@ class AjaxTableController extends ActionController * @param Product $product * @param string $dateFrom * @param string $dateTo + * @param string $bpnBookingUrlTemplateCode */ - public function daytripRoomsAction(Hotel $hotel, Product $product, string $dateFrom, string $dateTo): void - { + public function daytripRoomsAction( + Hotel $hotel, + Product $product, + string $dateFrom, + string $dateTo, + string $bpnBookingUrlTemplateCode = null + ): void { $period = new Period($dateFrom, $dateTo); $nights = (int)$period->dateInterval()->format('%a') + 1; @@ -351,6 +365,7 @@ class AjaxTableController extends ActionController $this->view->assign('nights', $nights); $this->view->assign('rooms', $rooms); + $this->view->assign('bpnBookingUrlTemplateCode', $bpnBookingUrlTemplateCode ?? $this->settings['bpnBookingUrlTemplateCode']); } /** diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/Datestable.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/Datestable.html index 694b4b0a..b352b85d 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/Datestable.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/Datestable.html @@ -54,7 +54,13 @@ diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html index 8931472f..ae77f06a 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html @@ -14,7 +14,7 @@ data-controller="product-details" data-action="tabs:selected->product-details#switchView" - data-product-details-datestable-uri-value="{ep:uri.ajax(action: 'datestable', controller: 'AjaxTable', arguments: '{product: product, hotel: hotel}', format: 'html', pageUid: settings.defaultAjaxUid)}" + data-product-details-datestable-uri-value="{ep:uri.ajax(action: 'datestable', controller: 'AjaxTable', arguments: '{product: product, hotel: hotel, bpnBookingUrlTemplateCode: settings.bpnBookingUrlTemplateCode}', format: 'html', pageUid: settings.defaultAjaxUid)}" data-product-details-disable-tables-value="{f:if(condition: hotel.groupsPriceConfigs, then: 'true', else: 'false')}"