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
+