feat: move tour link and thumbnail to product entity

addresses #8697w9zwr
This commit is contained in:
Björn Fromme
2025-03-24 16:08:36 +01:00
parent c3cd1dc872
commit 2afed48aba
6 changed files with 92 additions and 89 deletions
@@ -174,11 +174,6 @@ class Hotel extends AbstractEntity implements TeaserInterface
*/ */
protected $images; protected $images;
/**
* @var FileReference
*/
protected $tourThumbnail;
/** /**
* @var ObjectStorage<FileReference> * @var ObjectStorage<FileReference>
*/ */
@@ -250,11 +245,6 @@ class Hotel extends AbstractEntity implements TeaserInterface
*/ */
protected $externalLink; protected $externalLink;
/**
* @var string
*/
protected $tourLink;
/** /**
* @var string * @var string
*/ */
@@ -1064,26 +1054,6 @@ class Hotel extends AbstractEntity implements TeaserInterface
$this->groupsPriceBoards = $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;
}
public function getMainSeasonFrom() public function getMainSeasonFrom()
{ {
return $this->mainSeasonFrom; return $this->mainSeasonFrom;
@@ -2,6 +2,8 @@
namespace EP\EpProducts\Domain\Model; namespace EP\EpProducts\Domain\Model;
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
/*************************************************************** /***************************************************************
* *
* Copyright notice * Copyright notice
@@ -70,6 +72,11 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements
*/ */
protected $externalLink = ''; protected $externalLink = '';
/**
* @var string
*/
protected $tourLink;
/** /**
* @var string * @var string
*/ */
@@ -200,6 +207,11 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements
*/ */
protected $headerImages; protected $headerImages;
/**
* @var FileReference
*/
protected $tourThumbnail;
/** /**
* @var \EP\EpProducts\Domain\Model\Concept * @var \EP\EpProducts\Domain\Model\Concept
*/ */
@@ -1174,4 +1186,24 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements
$this->nonBookableInfo = $nonBookableInfo; $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;
}
} }
@@ -29,13 +29,13 @@ return [
--palette--;;destinations, --palette--;;categories, keywords, --palette--;;destinations, --palette--;;categories, keywords,
--div--;Texte, teaser, description, features, room_types, additional_information, --div--;Texte, teaser, description, features, room_types, additional_information,
--div--;Verknüpfungen, facts, teamer, additional_codes, --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', --div--;Gruppenhaus Preise, --palette--;;season, groups_price_configs, groups_price_boards, groups_price_options',
], ],
], ],
'palettes' => [ 'palettes' => [
'top' => ['showitem' => 'hidden,earlybird,new,low_contingent,show_as_teaser, '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'], 'geolocation' => ['showitem' => 'address, longitude, latitude'],
'destinations' => ['showitem' => 'country,region,city'], 'destinations' => ['showitem' => 'country,region,city'],
'name' => ['showitem' => 'name,short_name,--linebreak--,header_title,header_subtitle,--linebreak--,headline'], 'name' => ['showitem' => 'name,short_name,--linebreak--,header_title,header_subtitle,--linebreak--,headline'],
@@ -401,46 +401,6 @@ return [
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] $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' => [ 'reseller_images' => [
'exclude' => 0, 'exclude' => 0,
'label' => 'Bilder für Vertriebspartner', 'label' => 'Bilder für Vertriebspartner',
@@ -483,16 +443,6 @@ return [
'renderType' => 'inputLink', 'renderType' => 'inputLink',
], ],
], ],
'tour_link' => [
'exclude' => 0,
'label' => 'URL 360° Rundgang (matterport)',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim',
'renderType' => 'inputLink',
],
],
'type' => [ 'type' => [
'exclude' => 0, 'exclude' => 0,
'label' => 'Typ', 'label' => 'Typ',
@@ -31,6 +31,7 @@ return [
non_bookable_info, non_bookable_info,
--div--;Verknüpfungen, --palette--;;records, hotels, facts, faqs, additional_regions, --div--;Verknüpfungen, --palette--;;records, hotels, facts, faqs, additional_regions,
--div--;Bilder/Dateien, teaser_images, header_images, images, reseller_images, banner, video, --div--;Bilder/Dateien, teaser_images, header_images, images, reseller_images, banner, video,
tour_thumbnail,
--div--;Bewertung, --palette--;;rating, testimonials, --div--;Bewertung, --palette--;;rating, testimonials,
--div--;Buchbarkeit, non_bookable_dates', --div--;Buchbarkeit, non_bookable_dates',
], ],
@@ -38,7 +39,7 @@ return [
'palettes' => [ 'palettes' => [
'destinations' => ['showitem' => 'country,region,city'], 'destinations' => ['showitem' => 'country,region,city'],
'top' => ['showitem' => 'searchable, bookable, hide_booking_button, daytrip, important, skipass_included, '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'], 'name' => ['showitem' => 'name,code'],
'alternative' => ['showitem' => 'alt_product, alt_label'], 'alternative' => ['showitem' => 'alt_product, alt_label'],
'header' => ['showitem' => 'headline, subline, --linebreak--, header_title, header_subtitle'], 'header' => ['showitem' => 'headline, subline, --linebreak--, header_title, header_subtitle'],
@@ -585,6 +586,46 @@ return [
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] $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' => [ 'concept' => [
'exclude' => 0, 'exclude' => 0,
'label' => 'Konzept', 'label' => 'Konzept',
@@ -850,6 +891,16 @@ return [
'eval' => 'trim', 'eval' => 'trim',
] ]
], ],
'tour_link' => [
'exclude' => 0,
'label' => 'URL 360° Rundgang (matterport)',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim',
'renderType' => 'inputLink',
],
],
'path_segment' => [ 'path_segment' => [
'exclude' => 0, 'exclude' => 0,
'label' => 'Buchungslink URL', 'label' => 'Buchungslink URL',
@@ -24,6 +24,7 @@ CREATE TABLE tx_epproducts_domain_model_product
bus_pro_id int(11) unsigned NOT NULL default '0', bus_pro_id int(11) unsigned NOT NULL default '0',
detail_page varchar(255) DEFAULT '' NOT NULL, detail_page varchar(255) DEFAULT '' NOT NULL,
external_link 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, path_segment varchar(255) DEFAULT '' NOT NULL,
description text NOT NULL, description text NOT NULL,
teaser 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', header_images int(11) unsigned NOT NULL default '0',
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', 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, concept int(11) unsigned DEFAULT '0' NOT NULL,
country int(11) unsigned DEFAULT '0' NOT NULL, country int(11) unsigned DEFAULT '0' NOT NULL,
region 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', teaser_images int(11) unsigned NOT NULL default '0',
header_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', 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', reseller_images int(11) unsigned NOT NULL default '0',
code varchar(255) DEFAULT '' NOT NULL, code varchar(255) DEFAULT '' NOT NULL,
external_link 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, path_segment varchar(255) DEFAULT '' NOT NULL,
type varchar(255) DEFAULT '' NOT NULL, type varchar(255) DEFAULT '' NOT NULL,
category int(11) DEFAULT '0' NOT NULL, category int(11) DEFAULT '0' NOT NULL,
@@ -210,18 +210,18 @@
<f:section name="Sidebar"> <f:section name="Sidebar">
<f:render section="SidebarGallery" arguments="{_all}"/> <f:render section="SidebarGallery" arguments="{_all}"/>
<f:render section="Calendar" arguments="{_all}"/> <f:render section="Calendar" arguments="{_all}"/>
<f:if condition="{hotel.tourLink}"> <f:if condition="{product.tourLink}">
<div class="bg-zinc-50 p-4 mb-4" <div class="bg-zinc-50 p-4 mb-4"
data-controller="lightbox"> data-controller="lightbox">
<p class="font-bold mb-2"> <p class="font-bold mb-2">
360°-Rundgang 360°-Rundgang
</p> </p>
<a href="{hotel.tourLink}" <a href="{product.tourLink}"
target="_blank" target="_blank"
title="360°-Rundgang {hotel.name}"> title="360°-Rundgang {hotel.name}">
<f:if condition="{hotel.tourThumbnail}"> <f:if condition="{product.tourThumbnail}">
<f:then> <f:then>
<ep:lazyLoadImage image="{hotel.tourThumbnail}" <ep:lazyLoadImage image="{product.tourThumbnail}"
loaderimg="EXT:ep_theme/Resources/Public/images/lazy.png" loaderimg="EXT:ep_theme/Resources/Public/images/lazy.png"
class="block w-full h-auto" class="block w-full h-auto"
width="330" width="330"