From 2afed48aba2475bbd4e82029b1faeed209cab78f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 24 Mar 2025 16:08:36 +0100 Subject: [PATCH] feat: move tour link and thumbnail to product entity addresses #8697w9zwr --- .../Classes/Domain/Model/Hotel.php | 30 ----------- .../Classes/Domain/Model/Product.php | 32 +++++++++++ .../TCA/tx_epproducts_domain_model_hotel.php | 54 +------------------ .../tx_epproducts_domain_model_product.php | 53 +++++++++++++++++- .../typo3conf/ext/ep_products/ext_tables.sql | 4 +- .../Private/Templates/Product/Detail.html | 8 +-- 6 files changed, 92 insertions(+), 89 deletions(-) diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php index d1c4bba4..e3c8aad2 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php @@ -174,11 +174,6 @@ class Hotel extends AbstractEntity implements TeaserInterface */ protected $images; - /** - * @var FileReference - */ - protected $tourThumbnail; - /** * @var ObjectStorage */ @@ -250,11 +245,6 @@ class Hotel extends AbstractEntity implements TeaserInterface */ protected $externalLink; - /** - * @var string - */ - protected $tourLink; - /** * @var string */ @@ -1064,26 +1054,6 @@ class Hotel extends AbstractEntity implements TeaserInterface $this->groupsPriceBoards = $groupsPriceBoards; } - public function getTourThumbnail() - { - return $this->tourThumbnail; - } - - public function setTourThumbnail(FileReference $tourThumbnail) - { - $this->tourThumbnail = $tourThumbnail; - } - - public function getTourLink() - { - return $this->tourLink; - } - - public function setTourLink(string $tourLink) - { - $this->tourLink = $tourLink; - } - public function getMainSeasonFrom() { return $this->mainSeasonFrom; diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Product.php b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Product.php index 5a2d9deb..486bfde6 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Product.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Product.php @@ -2,6 +2,8 @@ namespace EP\EpProducts\Domain\Model; +use TYPO3\CMS\Extbase\Domain\Model\FileReference; + /*************************************************************** * * Copyright notice @@ -70,6 +72,11 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements */ protected $externalLink = ''; + /** + * @var string + */ + protected $tourLink; + /** * @var string */ @@ -200,6 +207,11 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements */ protected $headerImages; + /** + * @var FileReference + */ + protected $tourThumbnail; + /** * @var \EP\EpProducts\Domain\Model\Concept */ @@ -1174,4 +1186,24 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements $this->nonBookableInfo = $nonBookableInfo; } + public function getTourThumbnail() + { + return $this->tourThumbnail; + } + + public function setTourThumbnail(FileReference $tourThumbnail) + { + $this->tourThumbnail = $tourThumbnail; + } + + public function getTourLink() + { + return $this->tourLink; + } + + public function setTourLink(string $tourLink) + { + $this->tourLink = $tourLink; + } + } diff --git a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_hotel.php b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_hotel.php index 0a36f512..03fb15f0 100644 --- a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_hotel.php +++ b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_hotel.php @@ -29,13 +29,13 @@ return [ --palette--;;destinations, --palette--;;categories, keywords, --div--;Texte, teaser, description, features, room_types, additional_information, --div--;Verknüpfungen, facts, teamer, additional_codes, - --div--;Bilder/Dateien, teaser_images, header_images, images, reseller_images, tour_thumbnail, + --div--;Bilder/Dateien, teaser_images, header_images, images, reseller_images, --div--;Gruppenhaus Preise, --palette--;;season, groups_price_configs, groups_price_boards, groups_price_options', ], ], 'palettes' => [ 'top' => ['showitem' => 'hidden,earlybird,new,low_contingent,show_as_teaser, - --linebreak--,code,detail_page,--linebreak--,external_link,tour_link,--linebreak--,path_segment'], + --linebreak--,code,detail_page,--linebreak--,external_link,path_segment'], 'geolocation' => ['showitem' => 'address, longitude, latitude'], 'destinations' => ['showitem' => 'country,region,city'], 'name' => ['showitem' => 'name,short_name,--linebreak--,header_title,header_subtitle,--linebreak--,headline'], @@ -401,46 +401,6 @@ return [ $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] ), ], - 'tour_thumbnail' => [ - 'exclude' => 0, - 'label' => 'Thumbnail Rundgang', - 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( - 'tour_thumbnail', - [ - 'appearance' => [ - 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' - ], - 'overrideChildTca' => [ - 'types' => [ - \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ - 'showitem' => ' - --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, - --palette--;;filePalette', - ], - ], - 'columns' => [ - 'crop' => [ - 'config' => [ - 'cropVariants' => [ - 'default' => [ - 'title' => 'Preview', - 'allowedAspectRatios' => [ - 'preview' => [ - 'title' => 'Standard', - 'value' => 1.8, - ], - ], - ], - ], - ], - ], - ], - ], - 'maxitems' => 1, - ], - $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] - ), - ], 'reseller_images' => [ 'exclude' => 0, 'label' => 'Bilder für Vertriebspartner', @@ -483,16 +443,6 @@ return [ 'renderType' => 'inputLink', ], ], - 'tour_link' => [ - 'exclude' => 0, - 'label' => 'URL 360° Rundgang (matterport)', - 'config' => [ - 'type' => 'input', - 'size' => 30, - 'eval' => 'trim', - 'renderType' => 'inputLink', - ], - ], 'type' => [ 'exclude' => 0, 'label' => 'Typ', diff --git a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_product.php b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_product.php index 4211ae1a..e8fa0e03 100644 --- a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_product.php +++ b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_product.php @@ -31,6 +31,7 @@ return [ non_bookable_info, --div--;Verknüpfungen, --palette--;;records, hotels, facts, faqs, additional_regions, --div--;Bilder/Dateien, teaser_images, header_images, images, reseller_images, banner, video, + tour_thumbnail, --div--;Bewertung, --palette--;;rating, testimonials, --div--;Buchbarkeit, non_bookable_dates', ], @@ -38,7 +39,7 @@ return [ 'palettes' => [ 'destinations' => ['showitem' => 'country,region,city'], 'top' => ['showitem' => 'searchable, bookable, hide_booking_button, daytrip, important, skipass_included, - season, detail_page, external_link, path_segment, min_price'], + season, detail_page, external_link, tour_link, path_segment, min_price'], 'name' => ['showitem' => 'name,code'], 'alternative' => ['showitem' => 'alt_product, alt_label'], 'header' => ['showitem' => 'headline, subline, --linebreak--, header_title, header_subtitle'], @@ -585,6 +586,46 @@ return [ $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] ), ], + 'tour_thumbnail' => [ + 'exclude' => 0, + 'label' => 'Thumbnail Rundgang', + 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig( + 'tour_thumbnail', + [ + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'overrideChildTca' => [ + 'types' => [ + \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [ + 'showitem' => ' + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette', + ], + ], + 'columns' => [ + 'crop' => [ + 'config' => [ + 'cropVariants' => [ + 'default' => [ + 'title' => 'Preview', + 'allowedAspectRatios' => [ + 'preview' => [ + 'title' => 'Standard', + 'value' => 1.8, + ], + ], + ], + ], + ], + ], + ], + ], + 'maxitems' => 1, + ], + $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] + ), + ], 'concept' => [ 'exclude' => 0, 'label' => 'Konzept', @@ -850,6 +891,16 @@ return [ 'eval' => 'trim', ] ], + 'tour_link' => [ + 'exclude' => 0, + 'label' => 'URL 360° Rundgang (matterport)', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim', + 'renderType' => 'inputLink', + ], + ], 'path_segment' => [ 'exclude' => 0, 'label' => 'Buchungslink URL', diff --git a/public/typo3conf/ext/ep_products/ext_tables.sql b/public/typo3conf/ext/ep_products/ext_tables.sql index 19ebc8d2..3b59b4a5 100644 --- a/public/typo3conf/ext/ep_products/ext_tables.sql +++ b/public/typo3conf/ext/ep_products/ext_tables.sql @@ -24,6 +24,7 @@ CREATE TABLE tx_epproducts_domain_model_product bus_pro_id int(11) unsigned NOT NULL default '0', detail_page varchar(255) DEFAULT '' NOT NULL, external_link varchar(255) DEFAULT '' NOT NULL, + tour_link varchar(255) DEFAULT '' NOT NULL, path_segment varchar(255) DEFAULT '' NOT NULL, description text NOT NULL, teaser text NOT NULL, @@ -45,6 +46,7 @@ CREATE TABLE tx_epproducts_domain_model_product header_images int(11) unsigned NOT NULL default '0', images int(11) unsigned NOT NULL default '0', reseller_images int(11) unsigned NOT NULL default '0', + tour_thumbnail int(11) unsigned NOT NULL default '0', concept int(11) unsigned DEFAULT '0' NOT NULL, country int(11) unsigned DEFAULT '0' NOT NULL, region int(11) unsigned DEFAULT '0' NOT NULL, @@ -233,11 +235,9 @@ CREATE TABLE tx_epproducts_domain_model_hotel teaser_images int(11) unsigned NOT NULL default '0', header_images int(11) unsigned NOT NULL default '0', images int(11) unsigned NOT NULL default '0', - tour_thumbnail int(11) unsigned NOT NULL default '0', reseller_images int(11) unsigned NOT NULL default '0', code varchar(255) DEFAULT '' NOT NULL, external_link varchar(255) DEFAULT '' NOT NULL, - tour_link varchar(255) DEFAULT '' NOT NULL, path_segment varchar(255) DEFAULT '' NOT NULL, type varchar(255) DEFAULT '' NOT NULL, category int(11) DEFAULT '0' NOT NULL, 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 ce78658f..04cc5529 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 @@ -210,18 +210,18 @@ - +

360°-Rundgang

- - + -