diff --git a/packages/ep_products/Classes/Controller/CityController.php b/packages/ep_products/Classes/Controller/CityController.php new file mode 100644 index 0000000..d4a1e63 --- /dev/null +++ b/packages/ep_products/Classes/Controller/CityController.php @@ -0,0 +1,99 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ +use Psr\Http\Message\ResponseInterface; +use EP\EpProducts\Domain\Model\City; +use EP\EpProducts\Domain\Repository\CityRepository; +use EP\EpProducts\Service\ProductDataService; +use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; + +class CityController extends ActionController +{ + + /** + * @var CityRepository + */ + protected $cityRepository; + + /** + * @var ProductDataService + */ + private $productDataService; + + /** + * @param CityRepository $cityRepository + * @param ProductDataService $productDataService + */ + public function __construct(CityRepository $cityRepository, ProductDataService $productDataService) + { + $this->cityRepository = $cityRepository; + $this->productDataService = $productDataService; + } + + /** + * @param City $city + */ + public function detailAction(?City $city = null): ResponseInterface + { + if (null === $city) { + $cityUid = ($this->settings['cityUid'] ?? ''); + $city = $this->cityRepository->findByIdentifier($cityUid); + } + + $teasers = []; + + if (null !== $city) { + $filterSettings = [ + 'cityUids' => [$cityUid] + ]; + $teasers = $this->productDataService->getTeasergroup($filterSettings); + } + + $this->view->assignMultiple([ + 'city' => $city, + 'teasers' => $teasers, + 'filterSettings' => $filterSettings, + ]); + return $this->htmlResponse(); + } + + public function teasergroupAction(): ResponseInterface + { + $regionUid = (int)($this->settings['regionUid'] ?? ''); + $countryUid = (int)($this->settings['countryUid'] ?? ''); + $season = ($this->settings['season'] ?? ''); + $citiesPid = (int)($this->settings['citiesStoragePid'] ?? ''); + + $cities = $this->cityRepository->getTeasersByCountryOrRegionAndSeason($regionUid, $countryUid, $season, $citiesPid); + $data = $this->request->getAttribute('currentContentObject')->data; + $this->view->assign('data', $data); + $this->view->assign('teasers', $cities); + return $this->htmlResponse(); + } + +} diff --git a/packages/ep_products/Classes/Controller/ConceptController.php b/packages/ep_products/Classes/Controller/ConceptController.php new file mode 100644 index 0000000..23c5a67 --- /dev/null +++ b/packages/ep_products/Classes/Controller/ConceptController.php @@ -0,0 +1,106 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ +use Psr\Http\Message\ResponseInterface; +use EP\EpProducts\Domain\Model\Concept; +use EP\EpProducts\Domain\Repository\ConceptRepository; +use EP\EpProducts\Service\ProductDataService; +use EP\EpTheme\Domain\Repository\PageRepository; +use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; + +class ConceptController extends ActionController +{ + + /** + * @var ConceptRepository + */ + protected $conceptRepository; + + /** + * @var ProductDataService + */ + protected $productDataService; + + /** + * @var PageRepository + */ + private $pageRepository; + + /** + * @param ConceptRepository $conceptRepository + * @param ProductDataService $productDataService + * @param PageRepository $pageRepository + */ + public function __construct(ConceptRepository $conceptRepository, ProductDataService $productDataService, PageRepository $pageRepository) + { + $this->conceptRepository = $conceptRepository; + $this->productDataService = $productDataService; + $this->pageRepository = $pageRepository; + } + + /** + * @param Concept $concept + */ + public function detailAction(?Concept $concept = null): ResponseInterface + { + if ($concept === null) { + $conceptUid = ($this->settings['conceptUid'] ?? ''); + $concept = $this->conceptRepository->findByIdentifier($conceptUid); + } + + $teaserConceptUids = GeneralUtility::trimExplode(',', ($this->settings['additionalConceptUids'] ?? '')); + if (null !== $concept) { + array_unshift($teaserConceptUids, $concept->getUid()); + } + + $filterSettings = ['conceptUids' => $teaserConceptUids]; + $excludedConceptUids = GeneralUtility::trimExplode(',', ($this->settings['excludedConceptUids'] ?? ''), true); + $limit = ($this->settings['showMoreLink'] ?? '') ? 6 : 0; + $teasers = $this->productDataService->getTeasergroup($filterSettings, $excludedConceptUids, $limit); + $pages = $this->pageRepository->findPagesByPid((int)($this->settings['conceptsPageUid'] ?? '')); + $data = $this->request->getAttribute('currentContentObject')->data; + + $this->view->assignMultiple([ + 'teasers' => $teasers, + 'concept' => $concept, + 'filterSettings' => $filterSettings, + 'pages' => $pages, + 'data' => $data, + ]); + return $this->htmlResponse(); + } + + public function teasergroupAction(): ResponseInterface + { + $concepts = $this->conceptRepository->findAll(); + $this->view->assign('teasers', $concepts); + return $this->htmlResponse(); + } + +} diff --git a/packages/ep_products/Classes/Controller/CountryController.php b/packages/ep_products/Classes/Controller/CountryController.php new file mode 100644 index 0000000..ee5b235 --- /dev/null +++ b/packages/ep_products/Classes/Controller/CountryController.php @@ -0,0 +1,80 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ +use Psr\Http\Message\ResponseInterface; +use EP\EpProducts\Domain\Model\Country; +use EP\EpProducts\Domain\Repository\CountryRepository; +use EP\EpProducts\Service\ProductDataService; +use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; + +class CountryController extends ActionController +{ + + /** + * @var CountryRepository + */ + protected $countryRepository; + + /** + * @var ProductDataService + */ + protected $productDataService; + + /** + * @param CountryRepository $countryRepository + * @param ProductDataService $productDataService + */ + public function __construct(CountryRepository $countryRepository, ProductDataService $productDataService) + { + $this->countryRepository = $countryRepository; + $this->productDataService = $productDataService; + } + + /** + * @param Country $country + */ + public function detailAction(?Country $country = null): ResponseInterface + { + if ($country === null) { + $countryUid = ($this->settings['countryUid'] ?? ''); + $country = $this->countryRepository->findByIdentifier($countryUid); + } + $filterSettings = [ + 'countryUids' => [ $countryUid ], + ]; + $excludedConceptUids = GeneralUtility::trimExplode(',', ($this->settings['excludedConceptUids'] ?? ''), true); + $limit = ($this->settings['showMoreLink'] ?? '') ? 6 : 0; + $teasers = $this->productDataService->getTeasergroup($filterSettings, $excludedConceptUids, $limit); + $this->view->assign('teasers', $teasers); + $this->view->assign('country', $country); + $this->view->assign('filterSettings', $filterSettings); + return $this->htmlResponse(); + } + +} diff --git a/packages/ep_products/Classes/Controller/FaqController.php b/packages/ep_products/Classes/Controller/FaqController.php new file mode 100644 index 0000000..5fceeaf --- /dev/null +++ b/packages/ep_products/Classes/Controller/FaqController.php @@ -0,0 +1,57 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ +use Psr\Http\Message\ResponseInterface; +use EP\EpProducts\Domain\Repository\FaqRepository; +use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; + +class FaqController extends ActionController +{ + + /** + * @var FaqRepository + */ + protected $faqRepository; + + /** + * @param FaqRepository $faqRepository + */ + public function __construct(FaqRepository $faqRepository) + { + $this->faqRepository = $faqRepository; + } + + public function detailAction(): ResponseInterface + { + $faqUids = ($this->settings['faqUids'] ?? ''); + $faqs = $this->faqRepository->findByUids($faqUids); + $this->view->assign('faqs', $faqs); + return $this->htmlResponse(); + } + +} diff --git a/packages/ep_products/Classes/Controller/HotelController.php b/packages/ep_products/Classes/Controller/HotelController.php new file mode 100644 index 0000000..87fc904 --- /dev/null +++ b/packages/ep_products/Classes/Controller/HotelController.php @@ -0,0 +1,157 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ +use Psr\Http\Message\ResponseInterface; +use EP\EpProducts\Domain\Model\Product; +use EP\EpProducts\Domain\Model\Hotel; +use EP\EpProducts\Domain\Repository\HotelRepository; +use EP\EpProducts\Domain\Repository\ProductRepository; +use EP\EpProducts\Service\HotelDataService; +use EP\EpProducts\Service\ProductDataService; +use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; + +class HotelController extends ActionController +{ + + /** + * @var HotelRepository + */ + protected $hotelRepository; + + /** + * @var ProductRepository + */ + protected $productRepository; + + /** + * @var HotelDataService + */ + protected $hotelDataService; + + /** + * @var ProductDataService + */ + protected $productDataService; + + /** + * @param HotelDataService $hotelDataService + * @param HotelRepository $hotelRepository + * @param ProductRepository $productRepository + * @param ProductDataService $productDataService + */ + public function __construct + ( + HotelDataService $hotelDataService, + HotelRepository $hotelRepository, + ProductRepository $productRepository, + ProductDataService $productDataService + ) + { + $this->hotelRepository = $hotelRepository; + $this->productRepository = $productRepository; + $this->hotelDataService = $hotelDataService; + $this->productDataService = $productDataService; + } + + /** + * @param Hotel $hotel + */ + public function detailAction(?Hotel $hotel = null): ResponseInterface + { + if ($hotel !== null) { + $hotelUid = $hotel->getUid(); + } else { + $hotelUid = ($this->settings['hotelUid'] ?? ''); + /** @var Hotel $hotel */ + $hotel = $this->hotelRepository->findByIdentifier($hotelUid); + } + $filterSettings = [ + 'hotelUid' => $hotelUid, + ]; + $excludedConceptUids = GeneralUtility::trimExplode(',', ($this->settings['excludedConceptUids'] ?? ''), true); + $limit = ($this->settings['hideMoreLink'] ?? '') ? 0 : 6; + $teasers = $this->productDataService->getTeasergroup($filterSettings, $excludedConceptUids, $limit); + $this->view->assign('hotel', $hotel); + $this->view->assign('teasers', $teasers); + $this->view->assign('filterSettings', $filterSettings); + return $this->htmlResponse(); + } + + public function detailEventAction(): ResponseInterface + { + $productUid = ($this->settings['productUid'] ?? ''); + /** @var Product $product */ + $product = $this->productRepository->findByIdentifier($productUid); + $hotelUid = ($this->settings['hotelUid'] ?? ''); + /** @var Hotel $hotel */ + $hotel = $this->hotelRepository->findByIdentifier($hotelUid); + $this->view->assignMultiple([ + 'product' => $product, + 'hotel' => $hotel, + ]); + return $this->htmlResponse(); + } + + public function teasergroupAction(): ResponseInterface + { + $criteria = [ + 'regionUid' => (int) ($this->settings['regionUid'] ?? ''), + 'countryUid' => (int) ($this->settings['countryUid'] ?? ''), + 'conceptUid' => (int) ($this->settings['conceptUid'] ?? ''), + 'productUid' => (int) ($this->settings['productUid'] ?? ''), + 'category' => (int) ($this->settings['category'] ?? ''), + 'type' => (int) ($this->settings['type'] ?? ''), + ]; + $bookable = $this->hotelDataService->getTeasersByCriteria($criteria); + $bookableHotelUids = array_keys($bookable); + $nonBookable = $this->hotelDataService->getDateIndependentTeasersByCriteria($criteria, $bookableHotelUids); + $data = $this->request->getAttribute('currentContentObject')->data; + $this->view->assign('data', $data); + $this->view->assign('bookable', $bookable); + $this->view->assign('nonBookable', $nonBookable); + return $this->htmlResponse(); + } + + public function dateIndependentTeasergroupAction(): ResponseInterface + { + $criteria = [ + 'regionUid' => (int) ($this->settings['regionUid'] ?? ''), + 'countryUid' => (int) ($this->settings['countryUid'] ?? ''), + 'productUid' => (int) ($this->settings['productUid'] ?? ''), + 'category' => (int) ($this->settings['category'] ?? ''), + 'type' => (int) ($this->settings['type'] ?? ''), + ]; + $hotels = $this->hotelDataService->getDateIndependentTeasersByCriteria($criteria); + $data = $this->request->getAttribute('currentContentObject')->data; + $this->view->assign('data', $data); + $this->view->assign('teasers', $hotels); + return $this->htmlResponse(); + } + +} diff --git a/packages/ep_products/Classes/Controller/MapController.php b/packages/ep_products/Classes/Controller/MapController.php new file mode 100644 index 0000000..bcc3dc2 --- /dev/null +++ b/packages/ep_products/Classes/Controller/MapController.php @@ -0,0 +1,126 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ +use Psr\Http\Message\ResponseInterface; +use EP\EpProducts\Domain\Model\Hotel; +use EP\EpProducts\Domain\Model\Product; +use EP\EpProducts\Domain\Repository\HotelRepository; +use EP\EpProducts\Domain\Repository\ProductRepository; +use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; +use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; + +class MapController extends ActionController +{ + + /** + * @var HotelRepository + */ + protected $hotelRepository; + + /** + * @var ProductRepository + */ + protected $productRepository; + + /** + * @param HotelRepository $hotelRepository + * @param ProductRepository $productRepository + */ + public function __construct( + HotelRepository $hotelRepository, + ProductRepository $productRepository + ) + { + $this->hotelRepository = $hotelRepository; + $this->productRepository = $productRepository; + } + + public function generalAction(): ResponseInterface + { + $markerData = []; + $selectedHotels = ($this->settings['hotelUids'] ?? ''); + $hotelUids = GeneralUtility::trimExplode(',', $selectedHotels); + $hotels = $this->hotelRepository->getListByUids($hotelUids); + if ($hotels) { + foreach ($hotels as $hotel) + { + /** @var Hotel $hotel */ + $markerData[] = [ + 'name' => $hotel->getName(), + 'uri' => $this->getUriForPageUid($hotel->getDetailPage()), + 'teaser' => $hotel->getTeaser(), + 'lat' => $hotel->getLatitude(), + 'lng' => $hotel->getLongitude(), + ]; + } + } + + $selectedProducts = ($this->settings['productUids'] ?? ''); + $productUids = GeneralUtility::trimExplode(',', $selectedProducts); + $products = $this->productRepository->getListByUids($productUids); + if ($products) { + foreach ($products as $product) + { + /** @var Product $product */ + $hotel = $product->getHotels()->current(); + if (null === $hotel || false === $hotel->isShowAsTeaser()) { + continue; + } + $markerData[] = [ + 'name' => $product->getName(), + 'uri' => $this->getUriForPageUid($product->getDetailPage()), + 'externalLink' => $hotel->getExternalLink(), + 'teaser' => preg_replace("/[\r\n\t]/", "", $product->getTeaser()), + 'lat' => $hotel->getLatitude(), + 'lng' => $hotel->getLongitude(), + ]; + } + } + + $data = $this->request->getAttribute('currentContentObject')->data; + $this->view->assign('data', $data); + $this->view->assign('markerData', json_encode($markerData, JSON_THROW_ON_ERROR | JSON_HEX_APOS)); + return $this->htmlResponse(); + } + + /** + * @param int $pageUid + * @return string + */ + protected function getUriForPageUid($pageUid) + { + /** @var ContentObjectRenderer $contentObject */ + $contentObject = GeneralUtility::makeInstance(ContentObjectRenderer::class); + return $contentObject->typoLink_URL( + [ + 'parameter' => $pageUid, + ] + ); + } +} diff --git a/packages/ep_products/Classes/Controller/PricetableController.php b/packages/ep_products/Classes/Controller/PricetableController.php new file mode 100644 index 0000000..0b34e6a --- /dev/null +++ b/packages/ep_products/Classes/Controller/PricetableController.php @@ -0,0 +1,42 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ +use Psr\Http\Message\ResponseInterface; +use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; + +class PricetableController extends ActionController +{ + + public function eventAction(): ResponseInterface + { + $productUid = ($this->settings['productUid'] ?? ''); + $this->view->assign('productUid', $productUid); + return $this->htmlResponse(); + } + +} diff --git a/packages/ep_products/Classes/Controller/RegionController.php b/packages/ep_products/Classes/Controller/RegionController.php new file mode 100644 index 0000000..7cbe622 --- /dev/null +++ b/packages/ep_products/Classes/Controller/RegionController.php @@ -0,0 +1,97 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ +use Psr\Http\Message\ResponseInterface; +use EP\EpProducts\Domain\Model\Region; +use EP\EpProducts\Domain\Repository\RegionRepository; +use EP\EpProducts\Service\ProductDataService; +use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; + +class RegionController extends ActionController +{ + + /** + * @var RegionRepository + */ + protected $regionRepository; + + /** + * @var ProductDataService + */ + protected $productDataService; + + /** + * @param RegionRepository $regionRepository + * @param ProductDataService $productDataService + */ + public function __construct(RegionRepository $regionRepository, ProductDataService $productDataService) + { + $this->regionRepository = $regionRepository; + $this->productDataService = $productDataService; + } + + /** + * @param Region $region + */ + public function detailAction(?Region $region = null): ResponseInterface + { + if ($region === null) { + $regionUid = ($this->settings['regionUid'] ?? ''); + $region = $this->regionRepository->findByIdentifier($regionUid); + } + $additionalRegionUids = GeneralUtility::trimExplode(',', ($this->settings['additionalRegionUids'] ?? ''), true); + $additionalRegionUids = array_map(function ($uid) { + return (int)$uid; + }, $additionalRegionUids); + $teaserRegionUids = array_merge([$region->getUid()], $additionalRegionUids); + $filterSettings = [ + 'regionUids' => $teaserRegionUids, + ]; + $excludedConceptUids = GeneralUtility::trimExplode(',', ($this->settings['excludedConceptUids'] ?? ''), true); + $limit = ($this->settings['hideMoreLink'] ?? '') ? 0 : 6; + $teasers = $this->productDataService->getTeasergroup($filterSettings, $excludedConceptUids, $limit); + $this->view->assign('teasers', $teasers); + $this->view->assign('region', $region); + $this->view->assign('filterSettings', $filterSettings); + return $this->htmlResponse(); + } + + public function teasergroupAction(): ResponseInterface + { + $countryUid = (int)($this->settings['countryUid'] ?? ''); + $season = ($this->settings['season'] ?? ''); + $regionsPid = (int)($this->settings['regionsStoragePid'] ?? ''); + $regions = $this->regionRepository->getTeasersByCountryAndSeason($countryUid, $season, $regionsPid); + $data = $this->request->getAttribute('currentContentObject')->data; + $this->view->assign('data', $data); + $this->view->assign('teasers', $regions); + return $this->htmlResponse(); + } + +} diff --git a/packages/ep_products/Classes/Controller/TeamController.php b/packages/ep_products/Classes/Controller/TeamController.php new file mode 100644 index 0000000..a0446b4 --- /dev/null +++ b/packages/ep_products/Classes/Controller/TeamController.php @@ -0,0 +1,98 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ +use Psr\Http\Message\ResponseInterface; +use EP\EpProducts\Domain\Model\Teammember; +use EP\EpProducts\Domain\Repository\TeammemberRepository; +use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; + +class TeamController extends ActionController +{ + /** + * @var TeammemberRepository + */ + protected $teammemberRepository; + + /** + * @param TeammemberRepository $teammemberRepository + */ + public function __construct(TeammemberRepository $teammemberRepository) + { + $this->teammemberRepository = $teammemberRepository; + } + + public function listAction(): ResponseInterface + { + if (isset($this->settings['teamCategories']) && count(GeneralUtility::trimExplode(',', ($this->settings['teamCategories'] ?? ''), true)) > 0) { + $members = $this->teammemberRepository->findByCategories(GeneralUtility::trimExplode(',', ($this->settings['teamCategories'] ?? ''), true)); + } else { + $members = $this->teammemberRepository->findAll(); + } + + $this->view->assign('members', $members); + return $this->htmlResponse(); + } + + /** + * @param Teammember $member + * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException + * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException + */ + public function showAction(?Teammember $member = null): ResponseInterface + { + if ($member === null) { + return $this->redirect('list', null, null, null, null, 0, 302); + } + + $this->view->assign('member', $member); + $this->view->assign('data', $this->request->getAttribute('currentContentObject')->data); + $this->view->assign('header', $this->coalesceHeader($member)); + return $this->htmlResponse(); + } + + /** + * @param Teammember $member + * + * @return string + */ + public function coalesceHeader(Teammember $member) + { + $data = $this->request->getAttribute('currentContentObject')->data; + if (isset($data['header']) && $data['header'] !== '') { + return $data['header']; + } + + $firstCategory = current($member->getCategories()->toArray()); + if ($firstCategory !== null && $firstCategory !== false) { + return $firstCategory->getTitle(); + } + + return ''; + } +} diff --git a/packages/ep_products/Classes/Domain/Repository/AbstractRepository.php b/packages/ep_products/Classes/Domain/Repository/AbstractRepository.php index 20470f3..2fc7bb6 100644 --- a/packages/ep_products/Classes/Domain/Repository/AbstractRepository.php +++ b/packages/ep_products/Classes/Domain/Repository/AbstractRepository.php @@ -96,7 +96,7 @@ abstract class AbstractRepository extends Repository protected function addHotelFilterConditions(QueryBuilder $qb, array $filterSettings): void { // Hotel - if ($filterSettings['hotelUid'] > 0) { + if (($filterSettings['hotelUid'] ?? 0) > 0) { $qb->andWhere($qb->expr()->eq( 'date.hotel', $qb->createNamedParameter((int)$filterSettings['hotelUid'], Connection::PARAM_INT) diff --git a/packages/ep_products/Classes/Domain/Repository/FaqRepository.php b/packages/ep_products/Classes/Domain/Repository/FaqRepository.php new file mode 100644 index 0000000..c0fd724 --- /dev/null +++ b/packages/ep_products/Classes/Domain/Repository/FaqRepository.php @@ -0,0 +1,63 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ + +use EP\EpProducts\Domain\Model\Faq; +use Doctrine\DBAL\ArrayParameterType; +use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper; + +class FaqRepository extends AbstractRepository +{ + + /** + * @param string $uids + * @return array + * @throws \Doctrine\DBAL\DBALException + */ + public function findByUids($uids) + { + /** @var DataMapper $dataMapper */ + $dataMapper = GeneralUtility::makeInstance(DataMapper::class); + $uids = GeneralUtility::intExplode(',', (string)$uids, true); + if ($uids === []) { + return []; + } + $qb = $this->getDbConnection()->createQueryBuilder(); + $qb + ->select('*') + ->from('tx_epproducts_domain_model_faq') + ->where('uid IN (:uids)') + ->setParameter('uids', $uids, ArrayParameterType::INTEGER); + $qb->getConcreteQueryBuilder()->orderBy('FIELD(uid, ' . implode(',', $uids) . ')'); + $rows = $qb->executeQuery()->fetchAllAssociative(); + + return $dataMapper->map(Faq::class, $rows); + } + +} diff --git a/packages/ep_products/Classes/Domain/Repository/TeammemberRepository.php b/packages/ep_products/Classes/Domain/Repository/TeammemberRepository.php new file mode 100644 index 0000000..55ae8b6 --- /dev/null +++ b/packages/ep_products/Classes/Domain/Repository/TeammemberRepository.php @@ -0,0 +1,54 @@ +, dreipunktnull + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ +class TeammemberRepository extends AbstractRepository +{ + /** + * @var array + */ + protected $defaultOrderings = [ + 'sorting' => 'ASC', + ]; + + /** + * @param array $categories + * @return array|QueryResultInterface + * @throws InvalidQueryException + */ + public function findByCategories(array $categories = []) + { + $qb = $this->createQuery(); + + $qb->matching($qb->in('categories.uid', $categories)); + + return $qb->execute(); + } +} diff --git a/packages/ep_products/Classes/Service/HotelDataService.php b/packages/ep_products/Classes/Service/HotelDataService.php index 9a37881..d8f9161 100644 --- a/packages/ep_products/Classes/Service/HotelDataService.php +++ b/packages/ep_products/Classes/Service/HotelDataService.php @@ -79,8 +79,7 @@ class HotelDataService implements SingletonInterface $hotelData['available'] = -1; // TODO: Needs improvement. '-1' actually means: no price/date info available } - $hotelCategory = array_key_exists($hotelData['hotelCategory'], Hotel::$categoryLabels) ? - Hotel::$categoryLabels[$hotelData['hotelCategory']] : null; + $hotelCategory = Hotel::$categoryLabels[$hotelData['hotelCategory'] ?? ''] ?? null; $dateStart = new \DateTime($hotelData['dateStart'] ?? 'now'); $dateEnd = new \DateTime($hotelData['dateEnd'] ?? 'now'); @@ -147,7 +146,7 @@ class HotelDataService implements SingletonInterface 'minDateStart' => null, 'maxDateEnd' => null, 'minPrice' => null, - 'pseudoPrice' => $row['pseudoPrice'], + 'pseudoPrice' => $row['pseudoPrice'] ?? null, 'available' => 0, 'detailPage' => $row['hotelDetailPage'], 'name' => $row['hotelName'], @@ -159,16 +158,18 @@ class HotelDataService implements SingletonInterface 'code' => $row['countryCode'], ], 'region' => [ - 'name' => $row['regionName'], + 'name' => $row['regionName'] ?? null, ] ]; } $teaser =& $teasers[$hotelUid]; - $teaser['available'] += $row['available']; + // Hotels without dates (date-independent teasers) have no date columns: as PHP 7.4 read + // them, they count as not available, with today as date and no price + $teaser['available'] += $row['available'] ?? 0; - $dateStart = new \DateTime($row['dateStart']); - $dateEnd = new \DateTime($row['dateEnd']); + $dateStart = new \DateTime($row['dateStart'] ?? 'now'); + $dateEnd = new \DateTime($row['dateEnd'] ?? 'now'); if ($teaser['minDateStart'] === null || $teaser['minDateStart'] > $dateStart) { $teaser['minDateStart'] = $dateStart; @@ -178,8 +179,8 @@ class HotelDataService implements SingletonInterface $teaser['maxDateEnd'] = $dateEnd; } - if ($teaser['minPrice'] === null || $teaser['minPrice'] > $row['minPrice']) { - $teaser['minPrice'] = $row['minPrice']; + if ($teaser['minPrice'] === null || $teaser['minPrice'] > ($row['minPrice'] ?? null)) { + $teaser['minPrice'] = $row['minPrice'] ?? null; } } diff --git a/packages/ep_products/Configuration/FlexForms/flexform_city_detail.xml b/packages/ep_products/Configuration/FlexForms/flexform_city_detail.xml new file mode 100644 index 0000000..b7662ec --- /dev/null +++ b/packages/ep_products/Configuration/FlexForms/flexform_city_detail.xml @@ -0,0 +1,35 @@ + + + + 1 + + + + + Konfiguration + array + + + 0 + + + select + selectSingle + tx_epproducts_domain_model_city + AND tx_epproducts_domain_model_city.hidden = 0 AND tx_epproducts_domain_model_city.deleted = 0 ORDER BY tx_epproducts_domain_model_city.name + 1 + 1 + + + + 0 + + + check + + + + + + + diff --git a/packages/ep_products/Configuration/FlexForms/flexform_city_teaser.xml b/packages/ep_products/Configuration/FlexForms/flexform_city_teaser.xml new file mode 100644 index 0000000..8ab82d4 --- /dev/null +++ b/packages/ep_products/Configuration/FlexForms/flexform_city_teaser.xml @@ -0,0 +1,72 @@ + + + + 1 + + + + + Konfiguration + array + + + 0 + + + select + selectSingle + tx_epproducts_domain_model_country + ORDER BY name + + + + 0 + + + 0 + 1 + + + + 0 + + + select + selectSingle + tx_epproducts_domain_model_region + ORDER BY name + + + + 0 + + + 0 + 1 + + + + 0 + + + select + selectSingle + + + Winter + w + + + Sommer + s + + + 1 + 1 + + + + + + + diff --git a/packages/ep_products/Configuration/FlexForms/flexform_concept_detail.xml b/packages/ep_products/Configuration/FlexForms/flexform_concept_detail.xml new file mode 100644 index 0000000..913c91b --- /dev/null +++ b/packages/ep_products/Configuration/FlexForms/flexform_concept_detail.xml @@ -0,0 +1,60 @@ + + + + 1 + + + + + Konfiguration + array + + + 0 + + + select + selectSingle + tx_epproducts_domain_model_concept + AND tx_epproducts_domain_model_concept.hidden = 0 AND tx_epproducts_domain_model_concept.deleted = 0 ORDER BY tx_epproducts_domain_model_concept.name + + + Alle + 0 + + + 1 + 1 + + + + + + select + selectSingleBox + tx_epproducts_domain_model_concept + AND tx_epproducts_domain_model_concept.hidden = 0 AND tx_epproducts_domain_model_concept.deleted = 0 ORDER BY tx_epproducts_domain_model_concept.name + 5 + 0 + 10 + + + + 0 + + + check + + + + 0 + + + check + + + + + + + diff --git a/packages/ep_products/Configuration/FlexForms/flexform_country.xml b/packages/ep_products/Configuration/FlexForms/flexform_country.xml new file mode 100644 index 0000000..0260c7d --- /dev/null +++ b/packages/ep_products/Configuration/FlexForms/flexform_country.xml @@ -0,0 +1,41 @@ + + + + 1 + + + + + Konfiguration + array + + + 0 + + + select + selectSingle + tx_epproducts_domain_model_country + AND tx_epproducts_domain_model_country.hidden = 0 AND tx_epproducts_domain_model_country.deleted = 0 ORDER BY tx_epproducts_domain_model_country.name + + + + 0 + + + 0 + 1 + + + + 0 + + + check + + + + + + + diff --git a/packages/ep_products/Configuration/FlexForms/flexform_faq.xml b/packages/ep_products/Configuration/FlexForms/flexform_faq.xml new file mode 100644 index 0000000..86ad2cd --- /dev/null +++ b/packages/ep_products/Configuration/FlexForms/flexform_faq.xml @@ -0,0 +1,29 @@ + + + + 1 + + + + + Konfiguration + array + + + 0 + + + select + selectMultipleSideBySide + tx_epproducts_domain_model_faq + AND tx_epproducts_domain_model_faq.hidden = 0 AND tx_epproducts_domain_model_faq.deleted = 0 ORDER BY tx_epproducts_domain_model_faq.label + 1 + 50 + 10 + + + + + + + diff --git a/packages/ep_products/Configuration/FlexForms/flexform_hotel_detail.xml b/packages/ep_products/Configuration/FlexForms/flexform_hotel_detail.xml new file mode 100644 index 0000000..f4356bc --- /dev/null +++ b/packages/ep_products/Configuration/FlexForms/flexform_hotel_detail.xml @@ -0,0 +1,41 @@ + + + + 1 + + + + + Konfiguration + array + + + 0 + + + select + selectSingle + tx_epproducts_domain_model_hotel + AND tx_epproducts_domain_model_hotel.hidden = 0 AND tx_epproducts_domain_model_hotel.deleted = 0 ORDER BY tx_epproducts_domain_model_hotel.name + + + Alle + 0 + + + 0 + 1 + + + + 0 + + + check + + + + + + + diff --git a/packages/ep_products/Configuration/FlexForms/flexform_hotel_detail_event.xml b/packages/ep_products/Configuration/FlexForms/flexform_hotel_detail_event.xml new file mode 100644 index 0000000..030d874 --- /dev/null +++ b/packages/ep_products/Configuration/FlexForms/flexform_hotel_detail_event.xml @@ -0,0 +1,46 @@ + + + + 1 + + + + + Konfiguration + array + + + 0 + + + select + selectSingle + tx_epproducts_domain_model_product + AND tx_epproducts_domain_model_product.hidden = 0 AND tx_epproducts_domain_model_product.deleted = 0 ORDER BY tx_epproducts_domain_model_product.name_internal + 1 + 1 + + + + 0 + + + select + selectSingle + tx_epproducts_domain_model_hotel + AND tx_epproducts_domain_model_hotel.hidden = 0 AND tx_epproducts_domain_model_hotel.deleted = 0 ORDER BY tx_epproducts_domain_model_hotel.name + + + Alle + 0 + + + 1 + 1 + + + + + + + diff --git a/packages/ep_products/Configuration/FlexForms/flexform_hotel_teaser.xml b/packages/ep_products/Configuration/FlexForms/flexform_hotel_teaser.xml new file mode 100644 index 0000000..5599d58 --- /dev/null +++ b/packages/ep_products/Configuration/FlexForms/flexform_hotel_teaser.xml @@ -0,0 +1,200 @@ + + + + 1 + + + + + Konfiguration + array + + + 0 + + + select + selectSingle + + + vierspaltig + 4 + + + dreispaltig + 3 + + + zweispaltig + 2 + + + 1 + 1 + + + + 0 + + FIELD:settings.productUid:REQ:FALSE + + select + selectSingle + tx_epproducts_domain_model_country + ORDER BY name + + + Keine Zuordnung + 0 + + + 0 + 1 + + + + 0 + + FIELD:settings.productUid:REQ:FALSE + + select + selectSingle + tx_epproducts_domain_model_region + ORDER BY name + + + Keine Zuordnung + 0 + + + 0 + 1 + + + + 0 + + FIELD:settings.productUid:REQ:FALSE + + select + selectSingle + tx_epproducts_domain_model_city + ORDER BY name + + + Keine Zuordnung + 0 + + + 0 + 1 + + + + + FIELD:settings.productUid:REQ:FALSE + + select + selectSingle + tx_epproducts_domain_model_concept + ORDER BY name + + + Keine Zuordnung + 0 + + + 0 + 1 + + + + + reload + + select + selectSingle + tx_epproducts_domain_model_product + ORDER BY name_internal + + + Keine Zuordnung + 0 + + + 0 + 1 + + + + + FIELD:settings.productUid:REQ:TRUE + + select + selectSingle + + + Alle + 0 + + + Standard + 1 + + + Basic + 5 + + + Komfort + 2 + + + Deluxe + 3 + + + Superdeluxe + 4 + + + 0 + 1 + + + + + + select + selectCheckBox + + + Ferienwohnung + 1 + + + Sportclub + 2 + + + Apartment + 3 + + + Gästerhaus + 4 + + + Pension + 5 + + + 0 + 10 + + + + + + + diff --git a/packages/ep_products/Configuration/FlexForms/flexform_hotel_teaser_date_independent.xml b/packages/ep_products/Configuration/FlexForms/flexform_hotel_teaser_date_independent.xml new file mode 100644 index 0000000..e71f029 --- /dev/null +++ b/packages/ep_products/Configuration/FlexForms/flexform_hotel_teaser_date_independent.xml @@ -0,0 +1,163 @@ + + + + 1 + + + + + Konfiguration + array + + + 0 + + + select + selectSingle + + + vierspaltig + 4 + + + dreispaltig + 3 + + + zweispaltig + 2 + + + 1 + 1 + + + + 0 + + FIELD:settings.productUid:REQ:FALSE + + select + selectSingle + tx_epproducts_domain_model_country + ORDER BY name + + + Keine Zuordnung + 0 + + + 0 + 1 + + + + 0 + + FIELD:settings.productUid:REQ:FALSE + + select + selectSingle + tx_epproducts_domain_model_region + ORDER BY name + + + Keine Zuordnung + 0 + + + 0 + 1 + + + + + reload + + select + selectSingle + tx_epproducts_domain_model_product + ORDER BY name_internal + + + Keine Zuordnung + 0 + + + 0 + 1 + + + + + FIELD:settings.productUid:REQ:TRUE + + select + selectSingle + + + Alle + 0 + + + Standard + 1 + + + Basic + 5 + + + Komfort + 2 + + + Deluxe + 3 + + + Superdeluxe + 4 + + + 0 + 1 + + + + + + select + selectCheckBox + + + Ferienwohnung + 1 + + + Sportclub + 2 + + + Apartment + 3 + + + Gästerhaus + 4 + + + Pension + 5 + + + 0 + 10 + + + + + + + diff --git a/packages/ep_products/Configuration/FlexForms/flexform_maps.xml b/packages/ep_products/Configuration/FlexForms/flexform_maps.xml new file mode 100644 index 0000000..a60fc77 --- /dev/null +++ b/packages/ep_products/Configuration/FlexForms/flexform_maps.xml @@ -0,0 +1,42 @@ + + + + 1 + + + + + Konfiguration + array + + + 0 + + + select + selectMultipleSideBySide + tx_epproducts_domain_model_hotel + AND tx_epproducts_domain_model_hotel.latitude != "" AND tx_epproducts_domain_model_hotel.longitude != "" ORDER BY name + 0 + 50 + 10 + + + + 0 + + + select + selectMultipleSideBySide + tx_epproducts_domain_model_product + AND tx_epproducts_domain_model_product.detail_page != 0 ORDER BY name_internal + 0 + 50 + 10 + + + + + + + diff --git a/packages/ep_products/Configuration/FlexForms/flexform_pricetable.xml b/packages/ep_products/Configuration/FlexForms/flexform_pricetable.xml new file mode 100644 index 0000000..e239f77 --- /dev/null +++ b/packages/ep_products/Configuration/FlexForms/flexform_pricetable.xml @@ -0,0 +1,56 @@ + + + + 1 + + + + + Konfiguration + array + + + + reload + + select + selectSingle + Pricetable->event + + + Preistabelle Eventreise + Pricetable->event + + + + + + + + check + 0 + + + + + + input + trim + + + + + + select + selectSingle + tx_epproducts_domain_model_product + AND tx_epproducts_domain_model_product.hidden = 0 AND tx_epproducts_domain_model_product.deleted = 0 ORDER BY tx_epproducts_domain_model_product.name_internal + 1 + 1 + + + + + + + diff --git a/packages/ep_products/Configuration/FlexForms/flexform_region_detail.xml b/packages/ep_products/Configuration/FlexForms/flexform_region_detail.xml new file mode 100644 index 0000000..d96d648 --- /dev/null +++ b/packages/ep_products/Configuration/FlexForms/flexform_region_detail.xml @@ -0,0 +1,47 @@ + + + + 1 + + + + + Konfiguration + array + + + 0 + + + select + selectSingle + tx_epproducts_domain_model_region + AND tx_epproducts_domain_model_region.hidden = 0 AND tx_epproducts_domain_model_region.deleted = 0 ORDER BY tx_epproducts_domain_model_region.name + 1 + 1 + + + + 0 + + + select + selectMultipleSideBySide + tx_epproducts_domain_model_region + AND tx_epproducts_domain_model_region.hidden = 0 AND tx_epproducts_domain_model_region.deleted = 0 ORDER BY tx_epproducts_domain_model_region.name + 0 + 5 + + + + 0 + + + check + + + + + + + diff --git a/packages/ep_products/Configuration/FlexForms/flexform_region_teaser.xml b/packages/ep_products/Configuration/FlexForms/flexform_region_teaser.xml new file mode 100644 index 0000000..411f576 --- /dev/null +++ b/packages/ep_products/Configuration/FlexForms/flexform_region_teaser.xml @@ -0,0 +1,48 @@ + + + + 1 + + + + + Konfiguration + array + + + 0 + + + select + selectSingle + tx_epproducts_domain_model_country + ORDER BY name + 1 + 1 + + + + 0 + + + select + selectSingle + + + Winter + w + + + Sommer + s + + + 1 + 1 + + + + + + + diff --git a/packages/ep_products/Configuration/FlexForms/flexform_teammembers.xml b/packages/ep_products/Configuration/FlexForms/flexform_teammembers.xml new file mode 100644 index 0000000..6360fa8 --- /dev/null +++ b/packages/ep_products/Configuration/FlexForms/flexform_teammembers.xml @@ -0,0 +1,46 @@ + + + + 1 + + + + + Konfiguration + array + + + 0 + + + input + 20 + 1 + + + + 0 + + + input + 20 + 1 + + + + 0 + + + select + selectMultipleSideBySide + 1 + sys_category + 0 + 99 + + + + + + + diff --git a/packages/ep_products/Configuration/TCA/Overrides/tt_content.php b/packages/ep_products/Configuration/TCA/Overrides/tt_content.php index c60c9c7..86f9804 100644 --- a/packages/ep_products/Configuration/TCA/Overrides/tt_content.php +++ b/packages/ep_products/Configuration/TCA/Overrides/tt_content.php @@ -49,6 +49,96 @@ call_user_func(function () { 'Schneehöhen' ); + ExtensionUtility::registerPlugin( + 'EpProducts', + 'country_detail', + 'Land' + ); + + ExtensionUtility::registerPlugin( + 'EpProducts', + 'region_teasergroup', + 'Gebiet: Teaser' + ); + + ExtensionUtility::registerPlugin( + 'EpProducts', + 'region_detail', + 'Gebiet: Details' + ); + + ExtensionUtility::registerPlugin( + 'EpProducts', + 'city_teasergroup', + 'Ort: Teaser' + ); + + ExtensionUtility::registerPlugin( + 'EpProducts', + 'city_detail', + 'Ort: Details' + ); + + ExtensionUtility::registerPlugin( + 'EpProducts', + 'hotel_teasergroup', + 'Hotel: Teaser' + ); + + ExtensionUtility::registerPlugin( + 'EpProducts', + 'hotel_teasergroup_nodate', + 'Hotel: Teaser (terminunabhängig)' + ); + + ExtensionUtility::registerPlugin( + 'EpProducts', + 'hotel_detail', + 'Hotel: Details' + ); + + ExtensionUtility::registerPlugin( + 'EpProducts', + 'hotel_detail_event', + 'Hotel: Details (Event)' + ); + + ExtensionUtility::registerPlugin( + 'EpProducts', + 'concept_teasergroup', + 'Konzept: Teaser' + ); + + ExtensionUtility::registerPlugin( + 'EpProducts', + 'concept_detail', + 'Konzept: Details' + ); + + ExtensionUtility::registerPlugin( + 'EpProducts', + 'teammembers', + 'Team' + ); + + ExtensionUtility::registerPlugin( + 'EpProducts', + 'faq', + 'FAQ' + ); + + ExtensionUtility::registerPlugin( + 'EpProducts', + 'maps', + 'Übersichtskarte Hotels/Produkte' + ); + + ExtensionUtility::registerPlugin( + 'EpProducts', + 'pricetable', + 'Preistabelle' + ); + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_product_detail'] = 'pi_flexform'; ExtensionManagementUtility::addPiFlexFormValue( 'epproducts_product_detail', @@ -73,4 +163,88 @@ call_user_func(function () { 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_snowreport.xml' ); + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_country_detail'] = 'pi_flexform'; + ExtensionManagementUtility::addPiFlexFormValue( + 'epproducts_country_detail', + 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_country.xml' + ); + + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_region_teasergroup'] = 'pi_flexform'; + ExtensionManagementUtility::addPiFlexFormValue( + 'epproducts_region_teasergroup', + 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_region_teaser.xml' + ); + + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_region_detail'] = 'pi_flexform'; + ExtensionManagementUtility::addPiFlexFormValue( + 'epproducts_region_detail', + 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_region_detail.xml' + ); + + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_city_teasergroup'] = 'pi_flexform'; + ExtensionManagementUtility::addPiFlexFormValue( + 'epproducts_city_teasergroup', + 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_city_teaser.xml' + ); + + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_city_detail'] = 'pi_flexform'; + ExtensionManagementUtility::addPiFlexFormValue( + 'epproducts_city_detail', + 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_city_detail.xml' + ); + + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_hotel_teasergroup'] = 'pi_flexform'; + ExtensionManagementUtility::addPiFlexFormValue( + 'epproducts_hotel_teasergroup', + 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_hotel_teaser.xml' + ); + + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_hotel_teasergroup_nodate'] = 'pi_flexform'; + ExtensionManagementUtility::addPiFlexFormValue( + 'epproducts_hotel_teasergroup_nodate', + 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_hotel_teaser_date_independent.xml' + ); + + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_hotel_detail'] = 'pi_flexform'; + ExtensionManagementUtility::addPiFlexFormValue( + 'epproducts_hotel_detail', + 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_hotel_detail.xml' + ); + + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_hotel_detail_event'] = 'pi_flexform'; + ExtensionManagementUtility::addPiFlexFormValue( + 'epproducts_hotel_detail_event', + 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_hotel_detail_event.xml' + ); + + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_concept_detail'] = 'pi_flexform'; + ExtensionManagementUtility::addPiFlexFormValue( + 'epproducts_concept_detail', + 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_concept_detail.xml' + ); + + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_faq'] = 'pi_flexform'; + ExtensionManagementUtility::addPiFlexFormValue( + 'epproducts_faq', + 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_faq.xml' + ); + + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_maps'] = 'pi_flexform'; + ExtensionManagementUtility::addPiFlexFormValue( + 'epproducts_maps', + 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_maps.xml' + ); + + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_pricetable'] = 'pi_flexform'; + ExtensionManagementUtility::addPiFlexFormValue( + 'epproducts_pricetable', + 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_pricetable.xml' + ); + + $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['epproducts_teammembers'] = 'pi_flexform'; + ExtensionManagementUtility::addPiFlexFormValue( + 'epproducts_teammembers', + 'FILE:EXT:ep_products/Configuration/FlexForms/flexform_teammembers.xml' + ); + }); diff --git a/packages/ep_products/ext_localconf.php b/packages/ep_products/ext_localconf.php index 1bd9fe9..9044c2f 100644 --- a/packages/ep_products/ext_localconf.php +++ b/packages/ep_products/ext_localconf.php @@ -1,6 +1,15 @@ 'detail', + ] + ); + + ExtensionUtility::configurePlugin( + 'EpProducts', + 'region_teasergroup', + [ + RegionController::class => 'teasergroup', + ] + ); + + ExtensionUtility::configurePlugin( + 'EpProducts', + 'region_detail', + [ + RegionController::class => 'detail', + ] + ); + + ExtensionUtility::configurePlugin( + 'EpProducts', + 'city_teasergroup', + [ + CityController::class => 'teasergroup', + ] + ); + + ExtensionUtility::configurePlugin( + 'EpProducts', + 'city_detail', + [ + CityController::class => 'detail', + ] + ); + + ExtensionUtility::configurePlugin( + 'EpProducts', + 'hotel_teasergroup', + [ + HotelController::class => 'teasergroup', + ] + ); + + ExtensionUtility::configurePlugin( + 'EpProducts', + 'hotel_teasergroup_nodate', + [ + HotelController::class => 'dateIndependentTeasergroup', + ] + ); + + ExtensionUtility::configurePlugin( + 'EpProducts', + 'hotel_detail', + [ + HotelController::class => 'detail', + ] + ); + + ExtensionUtility::configurePlugin( + 'EpProducts', + 'hotel_detail_event', + [ + HotelController::class => 'detailEvent', + ] + ); + + ExtensionUtility::configurePlugin( + 'EpProducts', + 'faq', + [ + FaqController::class => 'detail', + ] + ); + + ExtensionUtility::configurePlugin( + 'EpProducts', + 'concept_teasergroup', + [ + ConceptController::class => 'teasergroup', + ] + ); + + ExtensionUtility::configurePlugin( + 'EpProducts', + 'concept_detail', + [ + ConceptController::class => 'detail', + ] + ); + + ExtensionUtility::configurePlugin( + 'EpProducts', + 'teammembers', + [ + TeamController::class => 'list,show', + ] + ); + + ExtensionUtility::configurePlugin( + 'EpProducts', + 'maps', + [ + MapController::class => 'general', + ] + ); + + ExtensionUtility::configurePlugin( + 'EpProducts', + 'pricetable', + [ + PricetableController::class => 'event', + ] + ); + ExtensionUtility::configurePlugin( 'EpProducts', 'searchresult', diff --git a/packages/ep_theme/Classes/ViewHelpers/ContainerViewHelper.php b/packages/ep_theme/Classes/ViewHelpers/ContainerViewHelper.php index cba62b3..abda487 100644 --- a/packages/ep_theme/Classes/ViewHelpers/ContainerViewHelper.php +++ b/packages/ep_theme/Classes/ViewHelpers/ContainerViewHelper.php @@ -74,7 +74,7 @@ class ContainerViewHelper extends AbstractViewHelper $content = $this->arguments['content']; } $classes = []; - if (\in_array($this->arguments['data']['colPos'], static::$columnsWithoutContainers, false)) { + if (\in_array($this->arguments['data']['colPos'] ?? null, static::$columnsWithoutContainers, false)) { $classes[] = 'container'; } if ($this->arguments['cssClasses'] !== null) { @@ -88,8 +88,8 @@ class ContainerViewHelper extends AbstractViewHelper $scaleBottom = static::$scale[$this->arguments['data']['space_after_class']]; $classes[] = sprintf('pb-%d', $scaleBottom); } - if ('default' !== $this->arguments['data']['frame_class']) { - $classes[] = $this->arguments['data']['frame_class']; + if ('default' !== ($this->arguments['data']['frame_class'] ?? null)) { + $classes[] = $this->arguments['data']['frame_class'] ?? null; } if (count($classes) > 0) { return sprintf('
%s
', implode(' ', $classes), $this->arguments['rteContent'] ? ' data-rte-content' : '', $content); diff --git a/packages/ep_theme/Configuration/FlexForms/flexform_disturber.xml b/packages/ep_theme/Configuration/FlexForms/flexform_disturber.xml index 2fdfd63..19ca807 100644 --- a/packages/ep_theme/Configuration/FlexForms/flexform_disturber.xml +++ b/packages/ep_theme/Configuration/FlexForms/flexform_disturber.xml @@ -1,64 +1,59 @@ + - - 1 - - - - - - Konfiguration - - array - - -
1
- array - - - Button - array - - - - - 1 - - - input - trim - 30 - - <_PADDING type="integer">2 - - popup - Link - EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_link.gif - - wizard_link - - wizard - - - height=300,width=500,status=0,menubar=0,scrollbars=1 - - - - - - - - -
-
-
-
-
+ + 1 + + + + + Konfiguration + array + + +
1
+ array + + + Button + array + + + + 1 + + + input + trim + 30 + + <_PADDING type="integer">2 + + popup + Link + EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_link.gif + + wizard_link + + wizard + + + height=300,width=500,status=0,menubar=0,scrollbars=1 + + + + + + + +
+
+
+
+
diff --git a/packages/ep_theme/Resources/Private/Partials/SubpageHeader.html b/packages/ep_theme/Resources/Private/Partials/SubpageHeader.html new file mode 100644 index 0000000..d90d4c4 --- /dev/null +++ b/packages/ep_theme/Resources/Private/Partials/SubpageHeader.html @@ -0,0 +1,68 @@ + + +
+ + + + + + + + + +
+
+
+ + {topline} + + + {headline} + +
+
+
+ +
{headerImage.description -> f:format.htmlspecialchars()}
+
+ +
+ + +
+

Ski-
Pass

+

inklusive

+
+
+
+ + + +
+ + + + +
+ {badgeData.title -> f:format.raw()} + + {badgeData.subtitle -> f:format.raw()} + +
+
+
+
+
+
+
+
+ + diff --git a/packages/ep_theme/Resources/Private/Templates/City/Detail.html b/packages/ep_theme/Resources/Private/Templates/City/Detail.html new file mode 100644 index 0000000..5456d92 --- /dev/null +++ b/packages/ep_theme/Resources/Private/Templates/City/Detail.html @@ -0,0 +1,31 @@ + + + + + + + +
+ +
+
+ +
+
+ + + + + +
+
+
+
+ + diff --git a/packages/ep_theme/Resources/Private/Templates/City/Teasergroup.html b/packages/ep_theme/Resources/Private/Templates/City/Teasergroup.html new file mode 100644 index 0000000..4b75bdb --- /dev/null +++ b/packages/ep_theme/Resources/Private/Templates/City/Teasergroup.html @@ -0,0 +1,46 @@ + + + + + + + +
+ +
+ + +
+
+ + + +
+
+
+
+
+ + diff --git a/packages/ep_theme/Resources/Private/Templates/Concept/Detail.html b/packages/ep_theme/Resources/Private/Templates/Concept/Detail.html new file mode 100644 index 0000000..5545164 --- /dev/null +++ b/packages/ep_theme/Resources/Private/Templates/Concept/Detail.html @@ -0,0 +1,123 @@ + + + + + + + + + + + +
+ +
+
+
+ {concept.description -> f:format.html()} +
+ + + +
+
+ + +
+
+ + + +
+ + +
+ + Alle anzeigen + +
+
+
+
+
+ + + + + +
+ +
+ {concept.descriptionExtended -> f:format.html()} +
+
+ + + + + +
+
+
    + + + +
  • + + {page.title} + +
  • +
    +
    +
    +
+
+
+
+
+ + diff --git a/packages/ep_theme/Resources/Private/Templates/Concept/Teasergroup.html b/packages/ep_theme/Resources/Private/Templates/Concept/Teasergroup.html new file mode 100644 index 0000000..78e557b --- /dev/null +++ b/packages/ep_theme/Resources/Private/Templates/Concept/Teasergroup.html @@ -0,0 +1,46 @@ + + + + + + + + +
+
+ + +
+
+ + + +
+
+
+
+
+ + diff --git a/packages/ep_theme/Resources/Private/Templates/Country/Detail.html b/packages/ep_theme/Resources/Private/Templates/Country/Detail.html new file mode 100644 index 0000000..fddc6b4 --- /dev/null +++ b/packages/ep_theme/Resources/Private/Templates/Country/Detail.html @@ -0,0 +1,130 @@ + + + + + + + +
+ +
+
+
+ {country.description -> f:format.html()} +
+ +
+ + +
+ + + +
+
+ +
+ + +
+
+ + + +
+
+
+ + +
+ + Alle anzeigen + +
+
+
+
+
+ +
+ {country.descriptionExtended -> f:format.html()} +
+
+ + + +
+
+ + + +
+
+
+
+ + diff --git a/packages/ep_theme/Resources/Private/Templates/Faq/Detail.html b/packages/ep_theme/Resources/Private/Templates/Faq/Detail.html new file mode 100644 index 0000000..a027350 --- /dev/null +++ b/packages/ep_theme/Resources/Private/Templates/Faq/Detail.html @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/packages/ep_theme/Resources/Private/Templates/Hotel/DateIndependentTeasergroup.html b/packages/ep_theme/Resources/Private/Templates/Hotel/DateIndependentTeasergroup.html new file mode 100644 index 0000000..ce12341 --- /dev/null +++ b/packages/ep_theme/Resources/Private/Templates/Hotel/DateIndependentTeasergroup.html @@ -0,0 +1,27 @@ + + + + + +
+ +
+
+
    + +
  • + +
  • +
    +
+
+
+
+
+
+ + diff --git a/packages/ep_theme/Resources/Private/Templates/Hotel/Detail.html b/packages/ep_theme/Resources/Private/Templates/Hotel/Detail.html new file mode 100644 index 0000000..41a4977 --- /dev/null +++ b/packages/ep_theme/Resources/Private/Templates/Hotel/Detail.html @@ -0,0 +1,37 @@ + + + + + + + +
+ +
+
+ +
+
+ + + + + +
+

Lage

+
+ +
+
+
+
+
+
+ + diff --git a/packages/ep_theme/Resources/Private/Templates/Hotel/DetailEvent.html b/packages/ep_theme/Resources/Private/Templates/Hotel/DetailEvent.html new file mode 100644 index 0000000..1a0b51c --- /dev/null +++ b/packages/ep_theme/Resources/Private/Templates/Hotel/DetailEvent.html @@ -0,0 +1,39 @@ + + + + + + +
+
+ +
+
+ {hotel.description -> f:format.html()} +
+
+
+ +

Buchungsoptionen

+
+ +
+
+

Ausstattung

+ {hotel.features -> f:format.html()} +

Zimmerarten / Apartments

+ {hotel.roomTypes -> f:format.html()} + +

Zusatzinformationen

+ {hotel.additionalInformation -> f:format.html()} +
+
+
+ + diff --git a/packages/ep_theme/Resources/Private/Templates/Hotel/Teasergroup.html b/packages/ep_theme/Resources/Private/Templates/Hotel/Teasergroup.html new file mode 100644 index 0000000..86090cb --- /dev/null +++ b/packages/ep_theme/Resources/Private/Templates/Hotel/Teasergroup.html @@ -0,0 +1,54 @@ + + + + + + + + +
+
+ + +
+
+ + + + + + +
+
+
+
+
+ + diff --git a/packages/ep_theme/Resources/Private/Templates/Map/General.html b/packages/ep_theme/Resources/Private/Templates/Map/General.html new file mode 100644 index 0000000..f829c83 --- /dev/null +++ b/packages/ep_theme/Resources/Private/Templates/Map/General.html @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/packages/ep_theme/Resources/Private/Templates/Pricetable/Event.html b/packages/ep_theme/Resources/Private/Templates/Pricetable/Event.html new file mode 100644 index 0000000..bcd6f42 --- /dev/null +++ b/packages/ep_theme/Resources/Private/Templates/Pricetable/Event.html @@ -0,0 +1,15 @@ + + + + + +
+ +
+
+ + diff --git a/packages/ep_theme/Resources/Private/Templates/Region/Detail.html b/packages/ep_theme/Resources/Private/Templates/Region/Detail.html new file mode 100644 index 0000000..ad9d8f5 --- /dev/null +++ b/packages/ep_theme/Resources/Private/Templates/Region/Detail.html @@ -0,0 +1,34 @@ + + + + + + + +
+ +
+
+ +
+
+ + + + + + + + +
+
+
+
+ + diff --git a/packages/ep_theme/Resources/Private/Templates/Region/Teasergroup.html b/packages/ep_theme/Resources/Private/Templates/Region/Teasergroup.html new file mode 100644 index 0000000..b1a26cc --- /dev/null +++ b/packages/ep_theme/Resources/Private/Templates/Region/Teasergroup.html @@ -0,0 +1,46 @@ + + + + + + + +
+ +
+ + +
+
+ + + +
+
+
+
+
+ + diff --git a/packages/ep_theme/Resources/Private/Templates/Team/List.html b/packages/ep_theme/Resources/Private/Templates/Team/List.html new file mode 100644 index 0000000..d3edd32 --- /dev/null +++ b/packages/ep_theme/Resources/Private/Templates/Team/List.html @@ -0,0 +1,49 @@ + + + + + +
+ +
+ + + +
+
+
+
+ + + + + + diff --git a/packages/ep_theme/Resources/Private/Templates/Team/Show.html b/packages/ep_theme/Resources/Private/Templates/Team/Show.html new file mode 100644 index 0000000..645862b --- /dev/null +++ b/packages/ep_theme/Resources/Private/Templates/Team/Show.html @@ -0,0 +1,48 @@ + + + + + +
+
+
+ + + +
+
+ +
+ {member.description -> f:format.html()} +
+ +
+ + + + + + {member.email} + + + + + + + + {member.phone} + + +
+
+ + zurück + +
+
+
+
+ +