diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Concept.php b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Concept.php index 3eee78bd..4e19f9ec 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Concept.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Concept.php @@ -65,6 +65,11 @@ class Concept extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements */ protected $teaser = ''; + /** + * @var string + */ + protected $popupText = ''; + /** * @var string */ @@ -180,6 +185,18 @@ class Concept extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements $this->teaser = $teaser; } + public function getPopupText() + { + return $this->popupText; + } + + public function setPopupText($popupText) + { + $this->popupText = $popupText; + + return $this; + } + /** * @return string */ diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php b/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php index cd74d2a8..94bae688 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php @@ -59,6 +59,7 @@ class ProductRepository extends AbstractRepository ->select( 'date.concept as conceptUid', 'date.concept_name as conceptName', 'date.concept_code as conceptCode', 'date.concept_sorting as conceptSorting', + 'date.concept_popup_text as conceptPopupText', 'date.product as productUid', 'date.product_name as productName', 'date.product_detail_page as productDetailPage', 'date.product_feature as productFeature', 'date.daytrip as daytrip', 'date.country as countryUid','date.country_name as countryName', @@ -135,7 +136,7 @@ class ProductRepository extends AbstractRepository 'skipass_included as skipassIncluded', 'bus_included as busIncluded', 'earlybird', 'new', 'daytrip', 'hide_booking_button as hideBookingButton', 'low_contingent as lowContingent', 'concept_code as conceptCode', 'concept_name as conceptName', - 'board', 'new' + 'date.concept_popup_text as conceptPopupText', 'board', 'new' ) ->from('tx_epproducts_domain_model_date', 'date') ->where('date_start >= NOW()') diff --git a/public/typo3conf/ext/ep_products/Classes/Service/DateImportService.php b/public/typo3conf/ext/ep_products/Classes/Service/DateImportService.php index 05bac2ac..21af8780 100644 --- a/public/typo3conf/ext/ep_products/Classes/Service/DateImportService.php +++ b/public/typo3conf/ext/ep_products/Classes/Service/DateImportService.php @@ -238,7 +238,8 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface cnt.name country_name, cnt.code country_code, cnt.keywords country_keywords, r.name region_name, r.keywords region_keywords, r.feature region_feature, c.name city_name, c.keywords city_keywords, - con.name concept_name, con.code concept_code, con.sorting concept_sorting + con.name concept_name, con.code concept_code, con.sorting concept_sorting, + con.popup_text concept_popup_text FROM tx_epproducts_domain_model_product p INNER JOIN tx_epproducts_domain_model_country cnt ON p.country = cnt.uid INNER JOIN tx_epproducts_domain_model_region r ON p.region = r.uid @@ -357,6 +358,7 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface 'concept' => $product['concept'], 'concept_name' => $product['concept_name'], 'concept_code' => $product['concept_code'], + 'concept_popup_text' => $product['concept_popup_text'], 'concept_sorting' => $product['concept_sorting'], 'season' => empty($product['season']) ? 'w' : $product['season'], 'date_start' => $dateStart->format('Y-m-d'), diff --git a/public/typo3conf/ext/ep_products/Classes/Service/ProductDataService.php b/public/typo3conf/ext/ep_products/Classes/Service/ProductDataService.php index d71e9d9a..99302cae 100644 --- a/public/typo3conf/ext/ep_products/Classes/Service/ProductDataService.php +++ b/public/typo3conf/ext/ep_products/Classes/Service/ProductDataService.php @@ -205,6 +205,7 @@ class ProductDataService implements SingletonInterface 'concept' => [ 'name' => $teaserData['conceptName'], 'code' => $teaserData['conceptCode'], + 'popupText' => $teaserData['conceptPopupText'], ], 'hotel' => [ 'name' => $teaserData['hotelName'], diff --git a/public/typo3conf/ext/ep_products/Classes/Service/SearchResultService.php b/public/typo3conf/ext/ep_products/Classes/Service/SearchResultService.php index 02e59ec0..0045a31c 100644 --- a/public/typo3conf/ext/ep_products/Classes/Service/SearchResultService.php +++ b/public/typo3conf/ext/ep_products/Classes/Service/SearchResultService.php @@ -97,6 +97,7 @@ class SearchResultService implements SingletonInterface 'name' => $row['conceptName'], 'code' => $row['conceptCode'], 'sorting' => $row['conceptSorting'], + 'popupText' => $row['conceptPopupText'], ], 'items' => [], ]; diff --git a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_concept.php b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_concept.php index 57204032..0e5a3eec 100644 --- a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_concept.php +++ b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_concept.php @@ -24,7 +24,8 @@ return [ ], 'types' => [ '1' => [ - 'showitem' => '--palette--;;top, --palette--;;naming, --palette--;;header, teaser, description, description_extended, + 'showitem' => '--palette--;;top, --palette--;;naming, --palette--;;header, teaser, description, + description_extended, popup_text, --div--;Bilder/Dateien, teaser_images, header_images, images', ], ], @@ -215,6 +216,17 @@ return [ 'renderType' => 'inputLink', ] ], + 'popup_text' => [ + 'exclude' => 0, + 'label' => 'Popup Text', + 'description' => 'Wenn ausgefüllt, wird ein Popup mit diesem Text beim Anklicken eines Teasers angezeigt.', + 'config' => [ + 'type' => 'text', + 'cols' => 40, + 'rows' => 5, + 'eval' => 'trim', + ], + ], 'teaser_images' => [ 'exclude' => 0, 'label' => 'Teaserbild(er)', diff --git a/public/typo3conf/ext/ep_products/ext_tables.sql b/public/typo3conf/ext/ep_products/ext_tables.sql index 17827f32..ac45e807 100644 --- a/public/typo3conf/ext/ep_products/ext_tables.sql +++ b/public/typo3conf/ext/ep_products/ext_tables.sql @@ -142,6 +142,7 @@ CREATE TABLE tx_epproducts_domain_model_date concept_name varchar(255) DEFAULT '' NOT NULL, concept_code varchar(32) DEFAULT '' NOT NULL, concept_sorting int(11) DEFAULT '0' NOT NULL, + concept_popup_text text NOT NULL, country int(11) unsigned DEFAULT '0', country_name varchar(255) DEFAULT '' NOT NULL, country_code char(2) DEFAULT '' NOT NULL, @@ -526,6 +527,7 @@ CREATE TABLE tx_epproducts_domain_model_concept detail_page varchar(255) DEFAULT '' NOT NULL, products int(11) DEFAULT '0' NOT NULL, teaser text NOT NULL, + popup_text text NOT NULL, headline varchar(255) DEFAULT '' NOT NULL, header_title varchar(255) DEFAULT '' NOT NULL, header_subtitle varchar(255) DEFAULT '' NOT NULL, diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/teaser_popup_controller.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/teaser_popup_controller.js new file mode 100644 index 00000000..77193dd5 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/teaser_popup_controller.js @@ -0,0 +1,14 @@ +import { Controller } from '@hotwired/stimulus' + +export default class extends Controller { + + static values = { text: String } + + open(e) { + if (this.hasTextValue && confirm(this.textValue)) { + return + } + + e.preventDefault() + } +} diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/Teaser.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/Teaser.html index d11968e0..1e5cfaab 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/Teaser.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/Teaser.html @@ -14,6 +14,11 @@
+ data-controller="teaser-popup" + data-teaser-popup-text-value="{concept.popupText}" + data-action="teaser-popup#open" + title="{region.name} {product.name} Details und Buchen"> @@ -73,6 +78,11 @@ {f:variable(name: 'including', value: '{f:render(section: \'Including\', arguments: \'{_all}\') -> v:format.trim()}')} + data-controller="teaser-popup" + data-teaser-popup-text-value="{concept.popupText}" + data-action="teaser-popup#open" + title="{region.name} {product.name} Details und Buchen" class="flex-1 flex flex-col space-y-1 px-2 py-4 md:p-4">