From c1770aae9dbf34d8710037f28e5323f0bf6c5d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Tue, 25 Feb 2025 10:15:51 +0100 Subject: [PATCH] feat: link matterport hotel tours addresses #8697w9zwr --- .../Classes/Domain/Model/Hotel.php | 85 +++++++++++++------ .../TCA/tx_epproducts_domain_model_hotel.php | 62 ++++++++++++-- .../typo3conf/ext/ep_products/ext_tables.sql | 2 + .../Private/Templates/Product/Detail.html | 27 ++++++ 4 files changed, 143 insertions(+), 33 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 ed46919b..4100beab 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php @@ -27,6 +27,7 @@ namespace EP\EpProducts\Domain\Model; * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ +use TYPO3\CMS\Extbase\Domain\Model\FileReference; use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; @@ -169,22 +170,27 @@ class Hotel extends AbstractEntity implements TeaserInterface protected $address = ''; /** - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> + * @var ObjectStorage */ protected $images; /** - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> + * @var FileReference + */ + protected $tourThumbnail; + + /** + * @var ObjectStorage */ protected $resellerImages; /** - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> + * @var ObjectStorage */ protected $teaserImages; /** - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> + * @var ObjectStorage */ protected $headerImages; @@ -194,7 +200,7 @@ class Hotel extends AbstractEntity implements TeaserInterface protected $code = ''; /** - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\MatchCode> + * @var ObjectStorage * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ protected $additionalCodes; @@ -210,32 +216,32 @@ class Hotel extends AbstractEntity implements TeaserInterface protected $category = self::CATEGORY_STANDARD; /** - * @var \EP\EpProducts\Domain\Model\Country + * @var Country */ protected $country; /** - * @var \EP\EpProducts\Domain\Model\Region + * @var Region */ protected $region; /** - * @var \EP\EpProducts\Domain\Model\City + * @var City */ protected $city; /** - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\Teammember> + * @var ObjectStorage */ protected $teamer; /** - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\Product> + * @var ObjectStorage */ protected $products; /** - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\Fact> + * @var ObjectStorage */ protected $facts; @@ -244,23 +250,28 @@ class Hotel extends AbstractEntity implements TeaserInterface */ protected $externalLink; + /** + * @var string + */ + protected $tourLink; + /** * @var string */ protected $pathSegment; /** - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\GroupsPriceConfig> + * @var ObjectStorage */ protected $groupsPriceConfigs; /** - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\GroupsPriceOption> + * @var ObjectStorage */ protected $groupsPriceOptions; /** - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\GroupsPriceBoard> + * @var ObjectStorage */ protected $groupsPriceBoards; @@ -861,7 +872,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage $teamer + * @return ObjectStorage $teamer */ public function getTeamer() { @@ -869,7 +880,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $teamer + * @param ObjectStorage $teamer */ public function setTeamer(ObjectStorage $teamer) { @@ -893,7 +904,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage + * @return ObjectStorage */ public function getProducts() { @@ -901,7 +912,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $products + * @param ObjectStorage $products */ public function setProducts(ObjectStorage $products) { @@ -909,7 +920,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $rooms + * @param ObjectStorage $rooms */ public function setRooms($rooms) { $this->rooms = $rooms; @@ -932,7 +943,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage + * @return ObjectStorage */ public function getFacts() { @@ -940,7 +951,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $facts + * @param ObjectStorage $facts */ public function setFacts(ObjectStorage $facts) { @@ -996,7 +1007,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage + * @return ObjectStorage */ public function getGroupsPriceConfigs() { @@ -1004,7 +1015,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $groupPriceConfigs + * @param ObjectStorage $groupPriceConfigs */ public function setGroupsPriceConfigs(ObjectStorage $groupPriceConfigs) { @@ -1012,7 +1023,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage + * @return ObjectStorage */ public function getGroupsPriceOptions() { @@ -1020,7 +1031,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $groupsPriceOptions + * @param ObjectStorage $groupsPriceOptions */ public function setGroupsPriceOptions(ObjectStorage $groupsPriceOptions) { @@ -1028,7 +1039,7 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage + * @return ObjectStorage */ public function getGroupsPriceBoards() { @@ -1036,10 +1047,30 @@ class Hotel extends AbstractEntity implements TeaserInterface } /** - * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $groupsPriceBoards + * @param ObjectStorage $groupsPriceBoards */ public function setGroupsPriceBoards(ObjectStorage $groupsPriceBoards) { $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; + } } 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 1cc7fd49..84038e95 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 @@ -25,17 +25,17 @@ return [ ], 'types' => [ '1' => [ - 'showitem' => '--palette--;;top, --palette--;;name, --palette--;;geolocation, - --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, + 'showitem' => '--palette--;;top, --palette--;;name, --palette--;;geolocation, + --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--;Gruppenhaus Preise, 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,path_segment'], + --linebreak--,code,detail_page,--linebreak--,external_link,tour_link,--linebreak--,path_segment'], 'geolocation' => ['showitem' => 'address, longitude, latitude'], 'destinations' => ['showitem' => 'country,region,city'], 'name' => ['showitem' => 'name,short_name,--linebreak--,header_title,header_subtitle,--linebreak--,headline'], @@ -400,6 +400,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'] + ), + ], 'reseller_images' => [ 'exclude' => 0, 'label' => 'Bilder für Vertriebspartner', @@ -442,6 +482,16 @@ 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/ext_tables.sql b/public/typo3conf/ext/ep_products/ext_tables.sql index bc2fe07e..0f8e8a0c 100644 --- a/public/typo3conf/ext/ep_products/ext_tables.sql +++ b/public/typo3conf/ext/ep_products/ext_tables.sql @@ -233,9 +233,11 @@ 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 28e9f202..f973a214 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 @@ -239,6 +239,33 @@ + +
+

+ 360°-Rundgang +

+ + + + + + +
+ öffnen +
+
+
+
+
+