feat: mapping of hotel detail pages to products

This commit is contained in:
Björn Fromme
2025-08-04 08:55:39 +02:00
parent 538bec0e83
commit d52ca79a15
5 changed files with 206 additions and 3 deletions
@@ -361,11 +361,13 @@ class ProductRepository extends AbstractRepository
'room.name as roomName', 'room.pax as roomPax', 'room.price as roomPrice', 'room.name as roomName', 'room.pax as roomPax', 'room.price as roomPrice',
'room.available as available', 'room.available as available',
'hotel.detail_page as hotelDetailPageUid', 'hotel.short_name as hotelShortName', 'hotel.detail_page as hotelDetailPageUid', 'hotel.short_name as hotelShortName',
'hotel.show_as_teaser as hotelShowAsTeaser' 'hotel.show_as_teaser as hotelShowAsTeaser',
'hotel_mapping.detail_page as hotelMappingDetailPageUid',
) )
->from('tx_epproducts_domain_model_date', 'date') ->from('tx_epproducts_domain_model_date', 'date')
->innerJoin('date', 'tx_epproducts_domain_model_room', 'room', 'room.date = date.uid') ->innerJoin('date', 'tx_epproducts_domain_model_room', 'room', 'room.date = date.uid')
->innerJoin('date', 'tx_epproducts_domain_model_hotel', 'hotel', 'hotel.uid = date.hotel') ->innerJoin('date', 'tx_epproducts_domain_model_hotel', 'hotel', 'hotel.uid = date.hotel')
->leftJoin('hotel', 'tx_epproducts_domain_model_hotel_mapping', 'hotel_mapping', 'hotel_mapping.product = date.product AND hotel_mapping.hotel = date.hotel')
->where($qb->expr()->eq( ->where($qb->expr()->eq(
'date.product', 'date.product',
$qb->createNamedParameter($product->getUid(), Connection::PARAM_INT)) $qb->createNamedParameter($product->getUid(), Connection::PARAM_INT))
@@ -357,12 +357,13 @@ class DateService implements SingletonInterface
$hotelUid = $row['hotelUid']; $hotelUid = $row['hotelUid'];
if (!array_key_exists($hotelUid, $priceTable[$categoryUid])) { if (!array_key_exists($hotelUid, $priceTable[$categoryUid])) {
$priceTable[$categoryUid][$hotelUid] = [ $priceTable[$categoryUid][$hotelUid] = [
'category' => $categoryUid, 'category' => $categoryUid,
'hotelName' => $row['hotelName'], 'hotelName' => $row['hotelName'],
'hotelShortName' => $row['hotelShortName'], 'hotelShortName' => $row['hotelShortName'],
'hotelTitle' => $row['hotelTitle'], 'hotelTitle' => $row['hotelTitle'],
'hotelDetailPageUid' => $row['hotelDetailPageUid'], 'hotelDetailPageUid' => $row['hotelMappingDetailPageUid'] ?? $row['hotelDetailPageUid'],
'bookingUrl' => BookingUrlUtility::generateUrl([ 'bookingUrl' => BookingUrlUtility::generateUrl([
'bookingId' => $row['dateBusProId'], 'bookingId' => $row['dateBusProId'],
'hotelId' => $row['hotelBusProId'], 'hotelId' => $row['hotelBusProId'],
@@ -28,7 +28,7 @@ return [
'showitem' => '--palette--;;top, --palette--;;name, --palette--;;geolocation, 'showitem' => '--palette--;;top, --palette--;;name, --palette--;;geolocation,
--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, mappings,
--div--;Bilder/Dateien, teaser_images, header_images, images, reseller_images, --div--;Bilder/Dateien, teaser_images, header_images, images, reseller_images,
--div--;Gruppenhaus Preise, --palette--;;season,--palette--;;others, groups_price_configs, --div--;Gruppenhaus Preise, --palette--;;season,--palette--;;others, groups_price_configs,
groups_price_boards, groups_price_options', groups_price_boards, groups_price_options',
@@ -590,6 +590,24 @@ return [
], ],
], ],
], ],
'mappings' => [
'exclude' => 0,
'label' => 'abweichende Detailseiten',
'config' => [
'type' => 'inline',
'foreign_table' => 'tx_epproducts_domain_model_hotel_mapping',
'foreign_field' => 'hotel',
'maxitems' => 10,
'appearance' => [
'collapseAll' => 1,
'levelLinksPosition' => 'top',
'showSynchronizationLink' => 0,
'showPossibleLocalizationRecords' => 0,
'showAllLocalizationLink' => 0,
'expandSingle' => 1,
],
],
],
'latitude' => [ 'latitude' => [
'exclude' => 0, 'exclude' => 0,
'label' => 'Breitengrad', 'label' => 'Breitengrad',
@@ -0,0 +1,139 @@
<?php
return [
'ctrl' => [
'title' => 'Hotelmapping',
'label' => 'product',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'dividers2tabs' => true,
'versioningWS' => true,
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'transOrigDiffSourceField' => 'l10n_diffsource',
'delete' => 'deleted',
'enablecolumns' => [
'disabled' => 'hidden',
'starttime' => 'starttime',
'endtime' => 'endtime',
],
'searchFields' => 'product',
'iconfile' => 'EXT:ep_theme/Resources/Public/images/icon_ce.svg',
'hideTable' => true,
],
'types' => [
'1' => [
'showitem' => 'product,detail_page',
],
],
'palettes' => [],
'columns' => [
'sys_language_uid' => [
'exclude' => 0,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'sys_language',
'foreign_table_where' => 'ORDER BY sys_language.title',
'items' => [
['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', -1],
['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.default_value', 0]
],
'default' => 0,
],
],
'l10n_parent' => [
'displayCond' => 'FIELD:sys_language_uid:>:0',
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
['', 0],
],
'foreign_table' => 'tx_epproducts_domain_model_infobox',
'foreign_table_where' => 'AND tx_epproducts_domain_model_infobox.pid=###CURRENT_PID### AND tx_epproducts_domain_model_infobox.sys_language_uid IN (-1,0)',
],
],
'l10n_diffsource' => [
'config' => [
'type' => 'passthrough',
],
],
't3ver_label' => [
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.versionLabel',
'config' => [
'type' => 'input',
'size' => 30,
'max' => 255,
]
],
'hidden' => [
'exclude' => 0,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.hidden',
'config' => [
'type' => 'check',
],
],
'starttime' => [
'exclude' => 0,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime',
'config' => [
'type' => 'input',
'size' => 13,
'eval' => 'datetime',
'checkbox' => 0,
'default' => 0,
'behaviour' => [
'allowLanguageSynchronization' => true,
],
'renderType' => 'inputDateTime',
],
],
'endtime' => [
'exclude' => 0,
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime',
'config' => [
'type' => 'input',
'size' => 13,
'eval' => 'datetime',
'checkbox' => 0,
'default' => 0,
'behaviour' => [
'allowLanguageSynchronization' => true,
],
'renderType' => 'inputDateTime',
],
],
'product' => [
'exclude' => 0,
'label' => 'Produkt',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'foreign_table' => 'tx_epproducts_domain_model_product',
'minitems' => 1,
'maxitems' => 1,
'multiple' => 0,
],
],
'detail_page' => [
'exclude' => 0,
'label' => 'Detailseite',
'config' => [
'type' => 'input',
'size' => 30,
'renderType' => 'inputLink',
]
],
'hotel' => [
'config' => [
'type' => 'passthrough',
],
],
],
];
@@ -249,6 +249,7 @@ CREATE TABLE tx_epproducts_domain_model_hotel
rooms int(11) unsigned DEFAULT '0' NOT NULL, rooms int(11) unsigned DEFAULT '0' NOT NULL,
facts int(11) unsigned DEFAULT '0' NOT NULL, facts int(11) unsigned DEFAULT '0' NOT NULL,
additional_codes int(11) unsigned DEFAULT '0' NOT NULL, additional_codes int(11) unsigned DEFAULT '0' NOT NULL,
mappings int(11) unsigned DEFAULT '0' NOT NULL,
address varchar(255) DEFAULT '' NOT NULL, address varchar(255) DEFAULT '' NOT NULL,
latitude varchar(255) DEFAULT '' NOT NULL, latitude varchar(255) DEFAULT '' NOT NULL,
longitude varchar(255) DEFAULT '' NOT NULL, longitude varchar(255) DEFAULT '' NOT NULL,
@@ -1518,6 +1519,48 @@ CREATE TABLE tx_epproducts_domain_model_travelinfolink
); );
#
# Table structure for table 'tx_epproducts_domain_model_hotel_mapping'
#
CREATE TABLE tx_epproducts_domain_model_hotel_mapping
(
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
product int(11) unsigned DEFAULT '0' NOT NULL,
detail_page varchar(255) DEFAULT '' NOT NULL,
hotel int(11) unsigned DEFAULT '0',
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
cruser_id int(11) unsigned DEFAULT '0' NOT NULL,
deleted tinyint(4) unsigned DEFAULT '0' NOT NULL,
hidden tinyint(4) unsigned DEFAULT '0' NOT NULL,
starttime int(11) unsigned DEFAULT '0' NOT NULL,
endtime int(11) unsigned DEFAULT '0' NOT NULL,
t3ver_oid int(11) DEFAULT '0' NOT NULL,
t3ver_id int(11) DEFAULT '0' NOT NULL,
t3ver_wsid int(11) DEFAULT '0' NOT NULL,
t3ver_label varchar(255) DEFAULT '' NOT NULL,
t3ver_state tinyint(4) DEFAULT '0' NOT NULL,
t3ver_stage int(11) DEFAULT '0' NOT NULL,
t3ver_count int(11) DEFAULT '0' NOT NULL,
t3ver_tstamp int(11) DEFAULT '0' NOT NULL,
t3ver_move_id int(11) DEFAULT '0' NOT NULL,
sys_language_uid int(11) DEFAULT '0' NOT NULL,
l10n_parent int(11) DEFAULT '0' NOT NULL,
l10n_diffsource mediumblob,
PRIMARY KEY (uid),
KEY parent (pid),
KEY t3ver_oid (t3ver_oid, t3ver_wsid),
KEY language (l10n_parent, sys_language_uid)
);
# #
# Table structure for table 'sys_domain' # Table structure for table 'sys_domain'
# #