diff --git a/public/typo3conf/ext/ep_products/Classes/Controller/AjaxTableController.php b/public/typo3conf/ext/ep_products/Classes/Controller/AjaxTableController.php index 71429d34..28f947c4 100644 --- a/public/typo3conf/ext/ep_products/Classes/Controller/AjaxTableController.php +++ b/public/typo3conf/ext/ep_products/Classes/Controller/AjaxTableController.php @@ -30,6 +30,7 @@ namespace EP\EpProducts\Controller; use EP\EpProducts\Domain\Model\Date; use EP\EpProducts\Domain\Model\Hotel; use EP\EpProducts\Domain\Model\Product; +use EP\EpProducts\Domain\Repository\InfoboxRepository; use EP\EpProducts\Domain\Repository\ProductRepository; use EP\EpProducts\Service\ContingentDataService; use EP\EpProducts\Service\DateService; @@ -51,6 +52,11 @@ class AjaxTableController extends ActionController */ protected $productRepository; + /** + * @var InfoboxRepository + */ + protected $infoboxRepository; + /** * @var \EP\EpProducts\Service\FilterService */ @@ -73,6 +79,7 @@ class AjaxTableController extends ActionController /** * @param ProductRepository $productRepository + * @param InfoboxRepository $infoboxRepository * @param DateService $dateService * @param FilterService $filterService * @param ResellerDataService $resellerDataService @@ -81,12 +88,14 @@ class AjaxTableController extends ActionController public function __construct ( ProductRepository $productRepository, + InfoboxRepository $infoboxRepository, DateService $dateService, FilterService $filterService, ResellerDataService $resellerDataService, ContingentDataService $contingentDataService ) { $this->productRepository = $productRepository; + $this->infoboxRepository = $infoboxRepository; $this->dateService = $dateService; $this->filterService = $filterService; $this->resellerDataService = $resellerDataService; @@ -187,6 +196,8 @@ class AjaxTableController extends ActionController $isProductWithNoInfoConcept = ($product->getConcept() !== null) && \in_array($product->getConcept()->getUid(), $noInfoConceptUids, false); + $nonBookableInfo = $this->getNonBookableInfobox($product); + $this->view->assignMultiple([ 'allDates' => $allDates, 'bookableDates' => $bookableDates, @@ -199,6 +210,7 @@ class AjaxTableController extends ActionController 'hasSurcharge' => $hasSurchargeOrDiscount['surcharge'], 'hasDiscount' => $hasSurchargeOrDiscount['discount'], 'isProductWithNoInfoConcept' => $isProductWithNoInfoConcept, + 'nonBookableInfo' => $nonBookableInfo, ]); } @@ -242,6 +254,8 @@ class AjaxTableController extends ActionController $isProductWithNoInfoConcept = ($product->getConcept() !== null) && \in_array($product->getConcept()->getUid(), $noInfoConceptUids, false); + $nonBookableInfo = $this->getNonBookableInfobox($product); + $this->view->assignMultiple([ 'dateRange' => $dateRange, 'product' => $product, @@ -253,6 +267,7 @@ class AjaxTableController extends ActionController 'hasDiscount' => $hasSurchargeOrDiscount['discount'], 'isProductWithNoInfoConcept' => $isProductWithNoInfoConcept, 'isSingleDate' => $singleDate, + 'nonBookableInfo' => $nonBookableInfo, ]); } @@ -267,12 +282,16 @@ class AjaxTableController extends ActionController } else { $paCode = null; } + + $nonBookableInfo = $this->getNonBookableInfobox($product); + $pricetable = $this->dateService->getPriceTable([ 'product' => $product, 'hotel' => $hotel, 'filterSettings' => $this->filterService->getNormalizedFilterSettings(), 'template' => $this->settings['bpnBookingUrlTemplateCode'], 'paCode' => $paCode, + 'nonBookableInfo' => $nonBookableInfo, ]); $this->view->assign('pricetable', $pricetable); @@ -297,6 +316,7 @@ class AjaxTableController extends ActionController $maxPax = max($roomTypesPax); $template = $this->settings['bpnBookingUrlTemplateCode']; $pricetable = $this->dateService->getEventPriceTable($product, $maxPax, $template); + $nonBookableInfo = $this->getNonBookableInfobox($product); $categories = [ Hotel::CATEGORY_STANDARD => 'Standard', Hotel::CATEGORY_COMFORT => 'Komfort', @@ -309,6 +329,7 @@ class AjaxTableController extends ActionController 'pricetable' => $pricetable, 'categories' => $categories, 'themekey' => $this->settings['themekey'], + 'nonBookableInfo' => $nonBookableInfo, ]); } @@ -336,4 +357,16 @@ class AjaxTableController extends ActionController $this->view->assign('rooms', $rooms); } + /** + * @param Product $product + * @return \EP\EpProducts\Domain\Model\Infobox + */ + protected function getNonBookableInfobox(Product $product) + { + if (null !== $nonBookableInfo = $product->getNonBookableInfo()) { + return $nonBookableInfo; + } + + return $this->infoboxRepository->getDefault(); + } } diff --git a/public/typo3conf/ext/ep_products/Classes/Controller/ProductController.php b/public/typo3conf/ext/ep_products/Classes/Controller/ProductController.php index 3722539f..dfecb159 100644 --- a/public/typo3conf/ext/ep_products/Classes/Controller/ProductController.php +++ b/public/typo3conf/ext/ep_products/Classes/Controller/ProductController.php @@ -30,6 +30,7 @@ namespace EP\EpProducts\Controller; use EP\EpProducts\Domain\Model\Hotel; use EP\EpProducts\Domain\Model\Product; use EP\EpProducts\Domain\Repository\HotelRepository; +use EP\EpProducts\Domain\Repository\InfoboxRepository; use EP\EpProducts\Domain\Repository\ProductRepository; use EP\EpProducts\Service\ContingentDataService; use EP\EpProducts\Service\DateService; @@ -76,6 +77,11 @@ class ProductController extends ActionController */ private $contingentDataService; + /** + * @var InfoboxRepository + */ + private $infoboxRepository; + /** * @param ProductRepository $productRepository * @param ProductDataService $productDataService @@ -84,6 +90,7 @@ class ProductController extends ActionController * @param ContingentDataService $contingentDataService * @param DateService $dateService * @param FilterService $filterService + * @param InfoboxRepository $infoboxRepository */ public function __construct( ProductRepository $productRepository, @@ -92,7 +99,8 @@ class ProductController extends ActionController HotelDataService $hotelDataService, ContingentDataService $contingentDataService, DateService $dateService, - FilterService $filterService + FilterService $filterService, + InfoboxRepository $infoboxRepository ) { $this->productRepository = $productRepository; $this->productDataService = $productDataService; @@ -101,6 +109,7 @@ class ProductController extends ActionController $this->contingentDataService = $contingentDataService; $this->dateService = $dateService; $this->filterService = $filterService; + $this->infoboxRepository = $infoboxRepository; } /** @@ -227,12 +236,15 @@ class ProductController extends ActionController $dateFrom = $this->settings['dateFrom'] ? date('Y-m-d', $this->settings['dateFrom']) : null; $dateTo = $this->settings['dateTo'] ? date('Y-m-d', $this->settings['dateTo']) : null; $data = $this->configurationManager->getContentObject()->data; + $nonBookableInfo = $this->settings['infoboxUid'] ? $this->infoboxRepository->findByUid($this->settings['infoboxUid']) : $this->infoboxRepository->findByDefaultText(); + $this->view->assign('data', $data); $this->view->assign('teasers', $teasers); $this->view->assign('dateAuto', $dateAuto); $this->view->assign('filterSettings', $filterSettings); $this->view->assign('dateFrom', $dateFrom); $this->view->assign('dateTo', $dateTo); + $this->view->assign('nonBookableInfo', $nonBookableInfo); } } diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Infobox.php b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Infobox.php new file mode 100644 index 00000000..d7884b5c --- /dev/null +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Infobox.php @@ -0,0 +1,73 @@ +title; + } + + /** + * @param string $title + */ + public function setTitle($title) + { + $this->title = $title; + } + + /** + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * @param string $text + */ + public function setText($text) + { + $this->text = $text; + } + + /** + * @return bool + */ + public function isDefaultText() + { + return $this->defaultText; + } + + /** + * @param bool $defaultText + */ + public function setDefaultText($defaultText) + { + $this->defaultText = $defaultText; + } +} + 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 b954e91f..97b78f63 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Product.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Product.php @@ -280,6 +280,11 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements */ protected $minPrice; + /** + * @var \EP\EpProducts\Domain\Model\Infobox + */ + protected $nonBookableInfo; + public function __construct() { $this->initStorageObjects(); @@ -1132,4 +1137,20 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements $this->minPrice = $minPrice; } + /** + * @return Infobox + */ + public function getNonBookableInfo() + { + return $this->nonBookableInfo; + } + + /** + * @param Infobox $nonBookableInfo + */ + public function setNonBookableInfo($nonBookableInfo) + { + $this->nonBookableInfo = $nonBookableInfo; + } + } diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Repository/InfoboxRepository.php b/public/typo3conf/ext/ep_products/Classes/Domain/Repository/InfoboxRepository.php new file mode 100644 index 00000000..dbe54fed --- /dev/null +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Repository/InfoboxRepository.php @@ -0,0 +1,21 @@ +createQuery(); + $query->getQuerySettings()->setRespectStoragePage(false); + + $result = $query + ->matching($query->equals('defaultText', true)) + ->execute() + ; + + return $result->getFirst(); + } +} diff --git a/public/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_product_teaser.xml b/public/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_product_teaser.xml index ab1c4671..9b9bfcbb 100644 --- a/public/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_product_teaser.xml +++ b/public/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_product_teaser.xml @@ -225,6 +225,26 @@ + + + + teasergroup]]> + + select + selectSingle + tx_epproducts_domain_model_infobox + ORDER BY title + + + Default + 0 + + + 0 + 1 + + + diff --git a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_infobox.php b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_infobox.php new file mode 100644 index 00000000..df50193e --- /dev/null +++ b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_infobox.php @@ -0,0 +1,143 @@ + [ + 'title' => 'LLL:EXT:ep_products/Resources/Private/Language/locallang.xlf:tx_epproducts_domain_model_infobox', + 'default_sortby' => 'ORDER BY title', + 'label' => 'title', + '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' => 'name', + 'iconfile' => 'EXT:ep_theme/Resources/Public/images/icon_ce.svg', + ], + 'types' => [ + '1' => [ + 'showitem' => '--palette--;;top, title, text', + ], + ], + 'palettes' => [ + 'top' => ['showitem' => 'hidden, default_text'], + ], + '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', + ], + ], + + 'title' => [ + 'exclude' => 0, + 'label' => 'Titel (nur intern)', + 'config' => [ + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim,required' + ], + ], + 'text' => [ + 'exclude' => 0, + 'label' => 'Text', + 'config' => [ + 'type' => 'text', + 'cols' => 40, + 'rows' => 15, + 'eval' => 'trim,required', + 'enableRichtext' => true, + ] + ], + 'default_text' => [ + 'exclude' => 0, + 'label' => 'Default', + 'config' => [ + 'type' => 'check', + ], + ], + ], +]; 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 9cf03544..a45b9b94 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 @@ -27,7 +27,7 @@ return [ 'showitem' => '--palette--;;top, name_internal, --palette--;;name, --palette--;;header, --palette--;;destinations, --palette--;;misc, --palette--;Alternative;alternative, --div--;Texte, teaser, teaser_long, concept_description, board_description, additional_services, - included_services, programme_description, ski_pass_description, + included_services, programme_description, ski_pass_description, 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, --div--;Bewertung, --palette--;;rating, testimonials, @@ -817,6 +817,21 @@ return [ 'maxitems' => 1, ], ], + 'non_bookable_info' => [ + 'exclude' => 0, + 'label' => 'Infobox nicht buchbar', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'foreign_table' => 'tx_epproducts_domain_model_infobox', + 'foreign_table_where' => 'AND tx_epproducts_domain_model_infobox.deleted = 0 ORDER BY tx_epproducts_domain_model_infobox.title', + 'items' => [ + ['Standardtext', 0], + ], + 'minitems' => 0, + 'maxitems' => 1, + ], + ], 'external_link' => [ 'exclude' => false, 'label' => 'Externer Link', diff --git a/public/typo3conf/ext/ep_products/Resources/Private/Language/locallang.xlf b/public/typo3conf/ext/ep_products/Resources/Private/Language/locallang.xlf index cb537767..7a198124 100644 --- a/public/typo3conf/ext/ep_products/Resources/Private/Language/locallang.xlf +++ b/public/typo3conf/ext/ep_products/Resources/Private/Language/locallang.xlf @@ -63,6 +63,9 @@ Vertriebspartner + + Infobox + diff --git a/public/typo3conf/ext/ep_products/ext_tables.sql b/public/typo3conf/ext/ep_products/ext_tables.sql index 5f6035df..b85e7cc2 100644 --- a/public/typo3conf/ext/ep_products/ext_tables.sql +++ b/public/typo3conf/ext/ep_products/ext_tables.sql @@ -61,6 +61,7 @@ CREATE TABLE tx_epproducts_domain_model_product video varchar(255) DEFAULT '' NOT NULL, banner int(11) unsigned NOT NULL default '0', badge int(11) unsigned NOT NULL default '0', + non_bookable_info int(11) unsigned NOT NULL default '0', non_bookable_dates varchar(255) DEFAULT '' NOT NULL, min_price int(11) unsigned NOT NULL default '0', tstamp int(11) unsigned DEFAULT '0' NOT NULL, @@ -1304,6 +1305,48 @@ CREATE TABLE tx_epproducts_domain_model_reseller ); +# +# Table structure for table 'tx_epproducts_domain_model_infobox' +# +CREATE TABLE tx_epproducts_domain_model_infobox +( + + uid int(11) NOT NULL auto_increment, + pid int(11) DEFAULT '0' NOT NULL, + + title varchar(255) DEFAULT '' NOT NULL, + text text NOT NULL, + default_text tinyint(4) unsigned DEFAULT '0' NOT NULL, + + 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' # diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_misc.scss b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_misc.scss index 730faa26..c0bfaa1d 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_misc.scss +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_misc.scss @@ -5,3 +5,7 @@ .anchor { @apply block h-0 w-0 pt-16 -mt-16; } + +.alert { + @apply bg-ep-primary-bg p-4 text-ep-primary-dark; +} diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Pricetable.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Pricetable.html index 82fece05..09ce8061 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Pricetable.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Pricetable.html @@ -5,7 +5,9 @@ - +
+ {nonBookableInfo.text -> f:format.html()} +
- +
+ {nonBookableInfo.text -> f:format.html()} +
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/EventPricetable.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/EventPricetable.html index 476b3e58..d31333b3 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/EventPricetable.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/EventPricetable.html @@ -11,7 +11,9 @@ - +
+ {nonBookableInfo.text -> f:format.html()} +
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/Pricetable.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/Pricetable.html index 31aa9fad..8325bfec 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/Pricetable.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/Pricetable.html @@ -15,7 +15,9 @@ - +
+ {nonBookableInfo.text -> f:format.html()} +
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Teasergroup.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Teasergroup.html index d8f0844b..ed7bdb5b 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Teasergroup.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Teasergroup.html @@ -13,27 +13,28 @@ -
- - -
-
- - + + +
+
+ + - -
- - -
- - Alle anzeigen - + +
+ + +
+ + Alle anzeigen + +
+
+
+ + + +
+ {nonBookableInfo.text -> f:format.html()}
-
-
+
+