diff --git a/composer.lock b/composer.lock
index ccbe03e4..d8d11eca 100644
--- a/composer.lock
+++ b/composer.lock
@@ -299,16 +299,16 @@
},
{
"name": "doctrine/dbal",
- "version": "v2.10.0",
+ "version": "v2.10.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
- "reference": "0c9a646775ef549eb0a213a4f9bd4381d9b4d934"
+ "reference": "c2b8e6e82732a64ecde1cddf9e1e06cb8556e3d8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/dbal/zipball/0c9a646775ef549eb0a213a4f9bd4381d9b4d934",
- "reference": "0c9a646775ef549eb0a213a4f9bd4381d9b4d934",
+ "url": "https://api.github.com/repos/doctrine/dbal/zipball/c2b8e6e82732a64ecde1cddf9e1e06cb8556e3d8",
+ "reference": "c2b8e6e82732a64ecde1cddf9e1e06cb8556e3d8",
"shasum": ""
},
"require": {
@@ -387,7 +387,7 @@
"sqlserver",
"sqlsrv"
],
- "time": "2019-11-03T16:50:43+00:00"
+ "time": "2020-01-04T12:56:21+00:00"
},
{
"name": "doctrine/event-manager",
diff --git a/public/typo3conf/ext/ep_products/Classes/Controller/AjaxGroupsPriceController.php b/public/typo3conf/ext/ep_products/Classes/Controller/AjaxGroupsPriceController.php
new file mode 100644
index 00000000..70b2e9f9
--- /dev/null
+++ b/public/typo3conf/ext/ep_products/Classes/Controller/AjaxGroupsPriceController.php
@@ -0,0 +1,95 @@
+, 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\Hotel;
+use EP\EpProducts\Service\GroupsPriceService;
+use League\Period\Period;
+use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
+use TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException;
+
+class AjaxGroupsPriceController extends ActionController
+{
+ /**
+ * @var GroupsPriceService
+ */
+ protected $groupsPriceService;
+
+ public function __construct(GroupsPriceService $groupsPriceService)
+ {
+ parent::__construct();
+
+ $this->groupsPriceService = $groupsPriceService;
+ }
+
+ public function initializeAction()
+ {
+ if ($this->request->hasArgument('dateFrom')) {
+ try {
+ $dateFrom = new \DateTime($this->request->getArgument('dateFrom'));
+ }
+ catch (\Throwable $e) {
+ $dateFrom = null;
+ }
+ $this->request->setArgument('dateFrom', $dateFrom);
+ }
+
+ if ($this->request->hasArgument('dateTo')) {
+ try {
+ $dateTo = new \DateTime($this->request->getArgument('dateTo'));
+ }
+ catch (\Throwable $e) {
+ $dateTo = null;
+ }
+ $this->request->setArgument('dateTo', $dateTo);
+ }
+ }
+
+ /**
+ * @param Hotel $hotel
+ * @param \DateTime $dateFrom
+ * @param \DateTime $dateTo
+ * @param int $pax
+ * @return string
+ * @throws \League\Period\Exception
+ */
+ public function indexAction(Hotel $hotel, \DateTime $dateFrom = null, \DateTime $dateTo = null, $pax = 0)
+ {
+ if (null !== $dateFrom && null !== $dateTo) {
+ $period = new Period($dateFrom, $dateTo);
+ $price = $this->groupsPriceService->calculateHotelPrice($hotel, $period, $pax);
+ }
+
+ return json_encode([
+ 'price' => $price ?? [],
+ 'configs' => $hotel->getGroupsPriceConfigs()->toArray(),
+ 'boards' => $hotel->getGroupsPriceBoards()->toArray(),
+ 'options' => $hotel->getGroupsPriceOptions()->toArray(),
+ ], JSON_THROW_ON_ERROR, 512);
+ }
+}
diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceBoard.php b/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceBoard.php
new file mode 100644
index 00000000..71c6fd21
--- /dev/null
+++ b/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceBoard.php
@@ -0,0 +1,86 @@
+, 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 GroupsPriceBoard extends AbstractEntity implements \JsonSerializable
+{
+ /**
+ * @var string
+ */
+ protected $title;
+
+ /**
+ * @var float
+ */
+ protected $price;
+
+ /**
+ * @return string
+ */
+ public function getTitle(): string
+ {
+ return $this->title;
+ }
+
+ /**
+ * @param string $title
+ */
+ public function setTitle(string $title): void
+ {
+ $this->title = $title;
+ }
+
+ /**
+ * @return float
+ */
+ public function getPrice(): float
+ {
+ return $this->price;
+ }
+
+ /**
+ * @param float $price
+ */
+ public function setPrice(float $price): void
+ {
+ $this->price = $price;
+ }
+
+ /**
+ * @return array
+ */
+ public function jsonSerialize()
+ {
+ return [
+ 'title' => $this->getTitle(),
+ 'price' => $this->getPrice(),
+ ];
+ }
+}
\ No newline at end of file
diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceConfig.php b/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceConfig.php
new file mode 100644
index 00000000..a1b7d8ab
--- /dev/null
+++ b/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceConfig.php
@@ -0,0 +1,152 @@
+, 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 GroupsPriceConfig extends AbstractEntity implements \JsonSerializable
+{
+ /**
+ * @var \DateTime
+ */
+ protected $dateFrom;
+
+ /**
+ * @var \DateTime
+ */
+ protected $dateTo;
+
+ /**
+ * @var int
+ */
+ protected $personsIncluded;
+
+ /**
+ * @var float
+ */
+ protected $price;
+
+ /**
+ * @var float
+ */
+ protected $priceAdditionalPerson;
+
+ /**
+ * @return \DateTime
+ */
+ public function getDateFrom(): \DateTime
+ {
+ return $this->dateFrom;
+ }
+
+ /**
+ * @param \DateTime $dateFrom
+ */
+ public function setDateFrom(\DateTime $dateFrom): void
+ {
+ $this->dateFrom = $dateFrom;
+ }
+
+ /**
+ * @return \DateTime
+ */
+ public function getDateTo(): \DateTime
+ {
+ return $this->dateTo;
+ }
+
+ /**
+ * @param \DateTime $dateTo
+ */
+ public function setDateTo(\DateTime $dateTo): void
+ {
+ $this->dateTo = $dateTo;
+ }
+
+ /**
+ * @return int
+ */
+ public function getPersonsIncluded(): int
+ {
+ return $this->personsIncluded;
+ }
+
+ /**
+ * @param int $personsIncluded
+ */
+ public function setPersonsIncluded(int $personsIncluded): void
+ {
+ $this->personsIncluded = $personsIncluded;
+ }
+
+ /**
+ * @return float
+ */
+ public function getPrice(): float
+ {
+ return $this->price;
+ }
+
+ /**
+ * @param float $price
+ */
+ public function setPrice(float $price): void
+ {
+ $this->price = $price;
+ }
+
+ /**
+ * @return float
+ */
+ public function getPriceAdditionalPerson(): float
+ {
+ return $this->priceAdditionalPerson;
+ }
+
+ /**
+ * @param float $priceAdditionalPerson
+ */
+ public function setPriceAdditionalPerson(float $priceAdditionalPerson): void
+ {
+ $this->priceAdditionalPerson = $priceAdditionalPerson;
+ }
+
+ /**
+ * @return array
+ */
+ public function jsonSerialize()
+ {
+ return [
+ 'dateFrom' => $this->getDateFrom()->format('d.m.Y'),
+ 'dateTo' => $this->getDateTo()->format('d.m.Y'),
+ 'personsIncluded' => $this->getPersonsIncluded(),
+ 'price' => $this->getPrice(),
+ 'priceAdditionalPerson' => $this->getPriceAdditionalPerson(),
+ ];
+ }
+}
\ No newline at end of file
diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceOption.php b/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceOption.php
new file mode 100644
index 00000000..63f4d534
--- /dev/null
+++ b/public/typo3conf/ext/ep_products/Classes/Domain/Model/GroupsPriceOption.php
@@ -0,0 +1,86 @@
+, 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 GroupsPriceOption extends AbstractEntity implements \JsonSerializable
+{
+ /**
+ * @var string
+ */
+ protected $title;
+
+ /**
+ * @var float
+ */
+ protected $price;
+
+ /**
+ * @return string
+ */
+ public function getTitle(): string
+ {
+ return $this->title;
+ }
+
+ /**
+ * @param string $title
+ */
+ public function setTitle(string $title): void
+ {
+ $this->title = $title;
+ }
+
+ /**
+ * @return float
+ */
+ public function getPrice(): float
+ {
+ return $this->price;
+ }
+
+ /**
+ * @param float $price
+ */
+ public function setPrice(float $price): void
+ {
+ $this->price = $price;
+ }
+
+ /**
+ * @return array
+ */
+ public function jsonSerialize()
+ {
+ return [
+ 'title' => $this->getTitle(),
+ 'price' => $this->getPrice(),
+ ];
+ }
+}
\ No newline at end of file
diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php
index 64e0dd8e..7151ecb5 100644
--- a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php
+++ b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php
@@ -27,7 +27,10 @@ namespace EP\EpProducts\Domain\Model;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
-class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements TeaserInterface
+use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
+use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
+
+class Hotel extends AbstractEntity implements TeaserInterface
{
const CATEGORY_STANDARD = 1;
@@ -246,6 +249,21 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
*/
protected $pathSegment;
+ /**
+ * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\GroupsPriceConfig>
+ */
+ protected $groupsPriceConfigs;
+
+ /**
+ * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\GroupsPriceOption>
+ */
+ protected $groupsPriceOptions;
+
+ /**
+ * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\GroupsPriceBoard>
+ */
+ protected $groupsPriceBoards;
+
public function __construct()
{
$this->initStorageObjects();
@@ -253,14 +271,17 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
protected function initStorageObjects()
{
- $this->images = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
- $this->resellerImages = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
- $this->teaserImages = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
- $this->headerImages = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
- $this->teamer = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
- $this->products = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
- $this->facts = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
- $this->additionalCodes = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
+ $this->images = new ObjectStorage();
+ $this->resellerImages = new ObjectStorage();
+ $this->teaserImages = new ObjectStorage();
+ $this->headerImages = new ObjectStorage();
+ $this->teamer = new ObjectStorage();
+ $this->products = new ObjectStorage();
+ $this->facts = new ObjectStorage();
+ $this->additionalCodes = new ObjectStorage();
+ $this->groupsPriceConfigs = new ObjectStorage();
+ $this->groupsPriceOptions = new ObjectStorage();
+ $this->groupsPriceBoards = new ObjectStorage();
}
/**
@@ -537,6 +558,7 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
if (empty($this->latitude) && $this->region !== null) {
return $this->region->getLatitude();
}
+
return $this->latitude;
}
@@ -556,6 +578,7 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
if (empty($this->longitude) && $this->region !== null) {
return $this->region->getLongitude();
}
+
return $this->longitude;
}
@@ -584,7 +607,7 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
}
/**
- * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> $images
+ * @return ObjectStorage $images
*/
public function getImages()
{
@@ -592,15 +615,15 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
}
/**
- * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> $images
+ * @param ObjectStorage $images
*/
- public function setImages(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $images)
+ public function setImages(ObjectStorage $images)
{
$this->images = $images;
}
/**
- * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> $resellerImages
+ * @return ObjectStorage $resellerImages
*/
public function getResellerImages()
{
@@ -608,7 +631,7 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
}
/**
- * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> $resellerImages
+ * @param ObjectStorage $resellerImages
*/
public function setResellerImages($resellerImages)
{
@@ -616,7 +639,7 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
}
/**
- * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
+ * @return ObjectStorage
*/
public function getTeaserImages()
{
@@ -624,7 +647,7 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
}
/**
- * @return null|\TYPO3\CMS\Extbase\Persistence\ObjectStorage
+ * @return null|ObjectStorage
*/
public function getTeaserImage()
{
@@ -632,11 +655,13 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
return null;
}
- return reset($this->teaserImages->toArray());
+ $images = $this->teaserImages->toArray();
+
+ return reset($images);
}
/**
- * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $teaserImages
+ * @param ObjectStorage $teaserImages
*/
public function setTeaserImages($teaserImages)
{
@@ -644,7 +669,7 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
}
/**
- * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
+ * @return ObjectStorage
*/
public function getHeaderImages()
{
@@ -658,7 +683,7 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
}
/**
- * @return null|\TYPO3\CMS\Extbase\Persistence\ObjectStorage
+ * @return null|ObjectStorage
*/
public function getHeaderImage()
{
@@ -666,11 +691,13 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
return null;
}
- return reset($this->headerImages->toArray());
+ $images = $this->headerImages->toArray();
+
+ return reset($images);
}
/**
- * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $headerImages
+ * @param ObjectStorage $headerImages
*/
public function setHeaderImages($headerImages)
{
@@ -694,23 +721,23 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
}
/**
- * @param \EP\EpProducts\Domain\Model\MatchCode $code
+ * @param MatchCode $code
*/
- public function addAdditionalCode(\EP\EpProducts\Domain\Model\MatchCode $code)
+ public function addAdditionalCode(MatchCode $code)
{
$this->additionalCodes->attach($code);
}
/**
- * @param \EP\EpProducts\Domain\Model\MatchCode $codeToRemove
+ * @param MatchCode $codeToRemove
*/
- public function removeAdditionalCodes(\EP\EpProducts\Domain\Model\MatchCode $codeToRemove)
+ public function removeAdditionalCodes(MatchCode $codeToRemove)
{
$this->additionalCodes->detach($codeToRemove);
}
/**
- * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\MatchCode> $codes
+ * @return ObjectStorage $codes
*/
public function getAdditionalCodes()
{
@@ -718,9 +745,9 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
}
/**
- * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\MatchCode> $codes
+ * @param ObjectStorage $codes
*/
- public function setAdditionalCodes(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $codes)
+ public function setAdditionalCodes(ObjectStorage $codes)
{
$this->additionalCodes = $codes;
}
@@ -770,7 +797,7 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
}
/**
- * @return \EP\EpProducts\Domain\Model\Country $country
+ * @return Country $country
*/
public function getCountry()
{
@@ -778,15 +805,15 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
}
/**
- * @param \EP\EpProducts\Domain\Model\Country $country
+ * @param Country $country
*/
- public function setCountry(\EP\EpProducts\Domain\Model\Country $country)
+ public function setCountry(Country $country)
{
$this->country = $country;
}
/**
- * @return \EP\EpProducts\Domain\Model\Region $region
+ * @return Region $region
*/
public function getRegion()
{
@@ -794,15 +821,15 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
}
/**
- * @param \EP\EpProducts\Domain\Model\Region $region
+ * @param Region $region
*/
- public function setRegion(\EP\EpProducts\Domain\Model\Region $region)
+ public function setRegion(Region $region)
{
$this->region = $region;
}
/**
- * @return \EP\EpProducts\Domain\Model\City $city
+ * @return City $city
*/
public function getCity()
{
@@ -810,31 +837,31 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
}
/**
- * @param \EP\EpProducts\Domain\Model\City $city
+ * @param City $city
*/
- public function setCity(\EP\EpProducts\Domain\Model\City $city)
+ public function setCity(City $city)
{
$this->city = $city;
}
/**
- * @param \EP\EpProducts\Domain\Model\Teammember $teamer
+ * @param Teammember $teamer
*/
- public function addTeamer(\EP\EpProducts\Domain\Model\Teammember $teamer)
+ public function addTeamer(Teammember $teamer)
{
$this->teamer->attach($teamer);
}
/**
- * @param \EP\EpProducts\Domain\Model\Teammember $teamerToRemove The Teammember to be removed
+ * @param Teammember $teamerToRemove The Teammember to be removed
*/
- public function removeTeamer(\EP\EpProducts\Domain\Model\Teammember $teamerToRemove)
+ public function removeTeamer(Teammember $teamerToRemove)
{
$this->teamer->detach($teamerToRemove);
}
/**
- * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\Teammember> $teamer
+ * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage $teamer
*/
public function getTeamer()
{
@@ -842,31 +869,31 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
}
/**
- * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\Teammember> $teamer
+ * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $teamer
*/
- public function setTeamer(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $teamer)
+ public function setTeamer(ObjectStorage $teamer)
{
$this->teamer = $teamer;
}
/**
- * @param \EP\EpProducts\Domain\Model\Product $product
+ * @param Product $product
*/
- public function addProduct(\EP\EpProducts\Domain\Model\Product $product)
+ public function addProduct(Product $product)
{
$this->products->attach($product);
}
/**
- * @param \EP\EpProducts\Domain\Model\Product $product
+ * @param Product $product
*/
- public function removeProduct(\EP\EpProducts\Domain\Model\Product $product)
+ public function removeProduct(Product $product)
{
$this->products->detach($product);
}
/**
- * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\Product>
+ * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
*/
public function getProducts()
{
@@ -874,38 +901,38 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
}
/**
- * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\Product> $products
+ * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $products
*/
- public function setProducts(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $products)
+ public function setProducts(ObjectStorage $products)
{
$this->products = $products;
}
/**
- * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\Room> $rooms
+ * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $rooms
*/
public function setRooms($rooms) {
$this->rooms = $rooms;
}
/**
- * @param \EP\EpProducts\Domain\Model\Fact $fact
+ * @param Fact $fact
*/
- public function addFact(\EP\EpProducts\Domain\Model\Fact $fact)
+ public function addFact(Fact $fact)
{
$this->facts->attach($fact);
}
/**
- * @param \EP\EpProducts\Domain\Model\Fact $factToRemove
+ * @param Fact $factToRemove
*/
- public function removeFact(\EP\EpProducts\Domain\Model\Fact $factToRemove)
+ public function removeFact(Fact $factToRemove)
{
$this->facts->detach($factToRemove);
}
/**
- * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\Fact>
+ * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
*/
public function getFacts()
{
@@ -913,9 +940,9 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
}
/**
- * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\EP\EpProducts\Domain\Model\Fact> $facts
+ * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $facts
*/
- public function setFacts(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $facts)
+ public function setFacts(ObjectStorage $facts)
{
$this->facts = $facts;
}
@@ -968,4 +995,51 @@ class Hotel extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements Te
return !$this->getIsApartment() && !$this->getIsHolidayFlat();
}
+ /**
+ * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
+ */
+ public function getGroupsPriceConfigs()
+ {
+ return $this->groupsPriceConfigs;
+ }
+
+ /**
+ * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $groupPriceConfigs
+ */
+ public function setGroupsPriceConfigs(ObjectStorage $groupPriceConfigs)
+ {
+ $this->groupsPriceConfigs = $groupPriceConfigs;
+ }
+
+ /**
+ * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
+ */
+ public function getGroupsPriceOptions()
+ {
+ return $this->groupsPriceOptions;
+ }
+
+ /**
+ * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $groupsPriceOptions
+ */
+ public function setGroupsPriceOptions(ObjectStorage $groupsPriceOptions)
+ {
+ $this->groupsPriceOptions = $groupsPriceOptions;
+ }
+
+ /**
+ * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage
+ */
+ public function getGroupsPriceBoards()
+ {
+ return $this->groupsPriceBoards;
+ }
+
+ /**
+ * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $groupsPriceBoards
+ */
+ public function setGroupsPriceBoards(ObjectStorage $groupsPriceBoards)
+ {
+ $this->groupsPriceBoards = $groupsPriceBoards;
+ }
}
diff --git a/public/typo3conf/ext/ep_products/Classes/Service/GroupsPriceService.php b/public/typo3conf/ext/ep_products/Classes/Service/GroupsPriceService.php
new file mode 100644
index 00000000..cc174e83
--- /dev/null
+++ b/public/typo3conf/ext/ep_products/Classes/Service/GroupsPriceService.php
@@ -0,0 +1,105 @@
+getConfigs($hotel);
+
+ // Create periods in configs to simplify following steps
+ $this->patchConfigPeriods($configs);
+
+ $nights = 0;
+ $price = 0;
+
+ // Iterate over provided period
+ foreach ($period->getDatePeriod('1 DAY') as $day) {
+
+ // Iterate over all configs
+ foreach ($configs as $config) {
+
+ // Skip config if current day is not contained
+ if (false === $config['period']->contains($day)) {
+ continue;
+ }
+
+ // Calculate base price
+ $price += $config['price'];
+
+ // Add costs for not-included number of persons
+ if ($pax > $config['persons_included']) {
+ $price += $config['price_additional_person'] * ($pax - $config['persons_included']);
+ }
+ }
+
+ $nights++;
+ }
+
+ if ($nights === 2) {
+ $shortTermCosts = $price * .2;
+ }
+
+ if ($nights === 3) {
+ $shortTermCosts = $price * .1;
+ }
+
+ $electricityCosts = ($nights - 1) * $pax * 1.7;
+
+ return [
+ 'pax' => $pax,
+ 'basePrice' => $price,
+ 'shortTermCosts' => $shortTermCosts ?? 0.0,
+ 'electricityCosts' => $electricityCosts,
+ 'nights' => $nights,
+ ];
+ }
+
+ protected function patchConfigPeriods(array &$configs)
+ {
+ foreach ($configs as $idx => $config) {
+ $configDateFrom = (new \DateTimeImmutable())->setTimestamp($config['date_from']);
+ $configDateTo = (new \DateTimeImmutable())->setTimestamp($config['date_to']);
+ $configs[$idx]['period'] = new Period($configDateFrom, $configDateTo);
+ }
+ }
+
+ /**
+ * @param Hotel $hotel
+ * @return array
+ */
+ protected function getConfigs(Hotel $hotel)
+ {
+ $qb = $this->getQueryBuilder();
+
+ return $qb
+ ->select('*')
+ ->from('tx_epproducts_domain_model_groupspriceconfig')
+ ->where($qb->expr()->eq('hotel', $qb->createNamedParameter($hotel->getUid())))
+ ->orderBy('date_from')
+ ->execute()
+ ->fetchAll()
+ ;
+ }
+
+ protected function getQueryBuilder()
+ {
+ /** @var ConnectionPool $connectionPool */
+ $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
+
+ return $connectionPool->getQueryBuilderForTable('tx_epproducts_domain_model_groupspriceconfig');
+ }
+}
\ No newline at end of file
diff --git a/public/typo3conf/ext/ep_products/Classes/Service/LabelService.php b/public/typo3conf/ext/ep_products/Classes/Service/LabelService.php
index a1803e8a..b9e3e38b 100644
--- a/public/typo3conf/ext/ep_products/Classes/Service/LabelService.php
+++ b/public/typo3conf/ext/ep_products/Classes/Service/LabelService.php
@@ -93,4 +93,13 @@ class LabelService
$parameters['title'] = sprintf('%s: %s (%d/%d)', $date->format('d.m.Y'), $hotel['name'], $contingent['available'], $contingent['pax']);
}
+ /**
+ * @param array $parameters
+ * @param array $parentObject
+ */
+ public function getGroupsPriceConfigLabel(&$parameters, $parentObject)
+ {
+ $record = BackendUtility::getRecord('tx_epproducts_domain_model_groupspriceconfig', $parameters['row']['uid']);
+ $parameters['title'] = sprintf('%s - %s', date('d.m.Y', $record['date_from']), date('d.m.Y', $record['date_to']));
+ }
}
diff --git a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groupspriceboard.php b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groupspriceboard.php
new file mode 100644
index 00000000..cf687993
--- /dev/null
+++ b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groupspriceboard.php
@@ -0,0 +1,149 @@
+ [
+ 'title' => 'Verpflegungsleistung',
+ 'default_sortby' => 'ORDER BY price',
+ 'sortby' => 'sorting',
+ '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' => 'title',
+ 'iconfile' => 'EXT:ep_theme/Resources/Public/images/icon_ce.svg',
+ 'hideTable' => true,
+ ],
+ 'interface' => [
+ 'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, price',
+ ],
+ 'types' => [
+ '1' => [
+ 'showitem' => 'title, price',
+ ],
+ ],
+ 'palettes' => [
+ ],
+ 'columns' => [
+
+ 'sys_language_uid' => [
+ 'exclude' => 0,
+ 'label' => 'LLL:EXT:lang/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:lang/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', -1],
+ ['LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.default_value', 0]
+ ],
+ ],
+ ],
+ 'l10n_parent' => [
+ 'displayCond' => 'FIELD:sys_language_uid:>:0',
+ 'exclude' => 0,
+ 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
+ 'config' => [
+ 'type' => 'select',
+ 'renderType' => 'selectSingle',
+ 'items' => [
+ ['', 0],
+ ],
+ 'foreign_table' => 'tx_epproducts_domain_model_groupspriceboard',
+ 'foreign_table_where' => 'AND tx_epproducts_domain_model_groupspriceboard.pid=###CURRENT_PID### AND tx_epproducts_domain_model_groupspriceboard.sys_language_uid IN (-1,0)',
+ ],
+ ],
+ 'l10n_diffsource' => [
+ 'config' => [
+ 'type' => 'passthrough',
+ ],
+ ],
+
+ 't3ver_label' => [
+ 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.versionLabel',
+ 'config' => [
+ 'type' => 'input',
+ 'size' => 30,
+ 'max' => 255,
+ ]
+ ],
+
+ 'hidden' => [
+ 'exclude' => 0,
+ 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.hidden',
+ 'config' => [
+ 'type' => 'check',
+ ],
+ ],
+ 'starttime' => [
+ 'exclude' => 0,
+ 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.starttime',
+ 'config' => [
+ 'type' => 'input',
+ 'size' => 13,
+ 'eval' => 'datetime',
+ 'checkbox' => 0,
+ 'default' => 0,
+ 'range' => [
+ 'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
+ ],
+ 'behaviour' => [
+ 'allowLanguageSynchronization' => true,
+ ],
+ 'renderType' => 'inputDateTime',
+ ],
+ ],
+ 'endtime' => [
+ 'exclude' => 0,
+ 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.endtime',
+ 'config' => [
+ 'type' => 'input',
+ 'size' => 13,
+ 'eval' => 'datetime',
+ 'checkbox' => 0,
+ 'default' => 0,
+ 'range' => [
+ 'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
+ ],
+ 'behaviour' => [
+ 'allowLanguageSynchronization' => true,
+ ],
+ 'renderType' => 'inputDateTime',
+ ],
+ ],
+
+ 'title' => [
+ 'exclude' => false,
+ 'label' => 'Bezeichnung',
+ 'config' => [
+ 'type' => 'input',
+ 'size' => 32,
+ 'eval' => 'required',
+ ]
+ ],
+ 'price' => [
+ 'exclude' => false,
+ 'label' => 'Preis pro Person/Nacht',
+ 'config' => [
+ 'type' => 'input',
+ 'size' => 8,
+ 'eval' => 'double2,required',
+ ]
+ ],
+ 'sorting' => [
+ 'config' => [
+ 'type' => 'passthrough'
+ ]
+ ],
+ ],
+];
diff --git a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groupspriceconfig.php b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groupspriceconfig.php
new file mode 100644
index 00000000..f66297d1
--- /dev/null
+++ b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groupspriceconfig.php
@@ -0,0 +1,176 @@
+ [
+ 'title' => 'Gruppenhaus Preis',
+ 'default_sortby' => 'ORDER BY date_from',
+ 'label' => 'date_from',
+ 'label_userFunc' => \EP\EpProducts\Service\LabelService::class . '->getGroupsPriceConfigLabel',
+ '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' => 'date_from',
+ 'iconfile' => 'EXT:ep_theme/Resources/Public/images/icon_ce.svg',
+ 'hideTable' => true,
+ ],
+ 'interface' => [
+ 'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, date_from, date_to,
+ persons_included, price, price_additional_person',
+ ],
+ 'types' => [
+ '1' => [
+ 'showitem' => '--palette--;;dates, --palette--;;prices, persons_included',
+ ],
+ ],
+ 'palettes' => [
+ 'dates' => ['showitem' => 'date_from, date_to'],
+ 'prices' => ['showitem' => 'price, price_additional_person'],
+ ],
+ 'columns' => [
+
+ 'sys_language_uid' => [
+ 'exclude' => 0,
+ 'label' => 'LLL:EXT:lang/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:lang/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', -1],
+ ['LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.default_value', 0]
+ ],
+ ],
+ ],
+ 'l10n_parent' => [
+ 'displayCond' => 'FIELD:sys_language_uid:>:0',
+ 'exclude' => 0,
+ 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
+ 'config' => [
+ 'type' => 'select',
+ 'renderType' => 'selectSingle',
+ 'items' => [
+ ['', 0],
+ ],
+ 'foreign_table' => 'tx_epproducts_domain_model_groupspriceconfig',
+ 'foreign_table_where' => 'AND tx_epproducts_domain_model_groupspriceconfig.pid=###CURRENT_PID### AND tx_epproducts_domain_model_groupspriceconfig.sys_language_uid IN (-1,0)',
+ ],
+ ],
+ 'l10n_diffsource' => [
+ 'config' => [
+ 'type' => 'passthrough',
+ ],
+ ],
+
+ 't3ver_label' => [
+ 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.versionLabel',
+ 'config' => [
+ 'type' => 'input',
+ 'size' => 30,
+ 'max' => 255,
+ ]
+ ],
+
+ 'hidden' => [
+ 'exclude' => 0,
+ 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.hidden',
+ 'config' => [
+ 'type' => 'check',
+ ],
+ ],
+ 'starttime' => [
+ 'exclude' => 0,
+ 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.starttime',
+ 'config' => [
+ 'type' => 'input',
+ 'size' => 13,
+ 'eval' => 'datetime',
+ 'checkbox' => 0,
+ 'default' => 0,
+ 'range' => [
+ 'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
+ ],
+ 'behaviour' => [
+ 'allowLanguageSynchronization' => true,
+ ],
+ 'renderType' => 'inputDateTime',
+ ],
+ ],
+ 'endtime' => [
+ 'exclude' => 0,
+ 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.endtime',
+ 'config' => [
+ 'type' => 'input',
+ 'size' => 13,
+ 'eval' => 'datetime',
+ 'checkbox' => 0,
+ 'default' => 0,
+ 'range' => [
+ 'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
+ ],
+ 'behaviour' => [
+ 'allowLanguageSynchronization' => true,
+ ],
+ 'renderType' => 'inputDateTime',
+ ],
+ ],
+
+ 'date_from' => [
+ 'exclude' => false,
+ 'label' => 'Datum von',
+ 'config' => [
+ 'type' => 'input',
+ 'size' => 8,
+ 'eval' => 'date,required',
+ 'renderType' => 'inputDateTime',
+ ]
+ ],
+ 'date_to' => [
+ 'exclude' => false,
+ 'label' => 'Datum bis',
+ 'config' => [
+ 'type' => 'input',
+ 'size' => 8,
+ 'eval' => 'date,required',
+ 'renderType' => 'inputDateTime',
+ ]
+ ],
+ 'persons_included' => [
+ 'exclude' => false,
+ 'label' => 'Inklusiv-Personen',
+ 'config' => [
+ 'type' => 'input',
+ 'size' => 4,
+ 'eval' => 'int,required',
+ ]
+ ],
+ 'price' => [
+ 'exclude' => false,
+ 'label' => 'Preis pro Nacht',
+ 'config' => [
+ 'type' => 'input',
+ 'size' => 8,
+ 'eval' => 'double2,required',
+ ]
+ ],
+ 'price_additional_person' => [
+ 'exclude' => false,
+ 'label' => 'Preis weitere Person',
+ 'config' => [
+ 'type' => 'input',
+ 'size' => 8,
+ 'eval' => 'double2,required',
+ ]
+ ],
+ ],
+];
diff --git a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groupspriceoption.php b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groupspriceoption.php
new file mode 100644
index 00000000..7808a59b
--- /dev/null
+++ b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_groupspriceoption.php
@@ -0,0 +1,149 @@
+ [
+ 'title' => 'Gruppenhaus Zusatzleistung',
+ 'default_sortby' => 'ORDER BY price',
+ 'sortby' => 'sorting',
+ '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' => 'title',
+ 'iconfile' => 'EXT:ep_theme/Resources/Public/images/icon_ce.svg',
+ 'hideTable' => true,
+ ],
+ 'interface' => [
+ 'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, title, price',
+ ],
+ 'types' => [
+ '1' => [
+ 'showitem' => 'title, price',
+ ],
+ ],
+ 'palettes' => [
+ ],
+ 'columns' => [
+
+ 'sys_language_uid' => [
+ 'exclude' => 0,
+ 'label' => 'LLL:EXT:lang/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:lang/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', -1],
+ ['LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.default_value', 0]
+ ],
+ ],
+ ],
+ 'l10n_parent' => [
+ 'displayCond' => 'FIELD:sys_language_uid:>:0',
+ 'exclude' => 0,
+ 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent',
+ 'config' => [
+ 'type' => 'select',
+ 'renderType' => 'selectSingle',
+ 'items' => [
+ ['', 0],
+ ],
+ 'foreign_table' => 'tx_epproducts_domain_model_groupspriceoption',
+ 'foreign_table_where' => 'AND tx_epproducts_domain_model_groupspriceoption.pid=###CURRENT_PID### AND tx_epproducts_domain_model_groupspriceoption.sys_language_uid IN (-1,0)',
+ ],
+ ],
+ 'l10n_diffsource' => [
+ 'config' => [
+ 'type' => 'passthrough',
+ ],
+ ],
+
+ 't3ver_label' => [
+ 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.versionLabel',
+ 'config' => [
+ 'type' => 'input',
+ 'size' => 30,
+ 'max' => 255,
+ ]
+ ],
+
+ 'hidden' => [
+ 'exclude' => 0,
+ 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.hidden',
+ 'config' => [
+ 'type' => 'check',
+ ],
+ ],
+ 'starttime' => [
+ 'exclude' => 0,
+ 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.starttime',
+ 'config' => [
+ 'type' => 'input',
+ 'size' => 13,
+ 'eval' => 'datetime',
+ 'checkbox' => 0,
+ 'default' => 0,
+ 'range' => [
+ 'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
+ ],
+ 'behaviour' => [
+ 'allowLanguageSynchronization' => true,
+ ],
+ 'renderType' => 'inputDateTime',
+ ],
+ ],
+ 'endtime' => [
+ 'exclude' => 0,
+ 'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xlf:LGL.endtime',
+ 'config' => [
+ 'type' => 'input',
+ 'size' => 13,
+ 'eval' => 'datetime',
+ 'checkbox' => 0,
+ 'default' => 0,
+ 'range' => [
+ 'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
+ ],
+ 'behaviour' => [
+ 'allowLanguageSynchronization' => true,
+ ],
+ 'renderType' => 'inputDateTime',
+ ],
+ ],
+
+ 'title' => [
+ 'exclude' => false,
+ 'label' => 'Bezeichnung',
+ 'config' => [
+ 'type' => 'input',
+ 'size' => 32,
+ 'eval' => 'required',
+ ]
+ ],
+ 'price' => [
+ 'exclude' => false,
+ 'label' => 'Preis',
+ 'config' => [
+ 'type' => 'input',
+ 'size' => 8,
+ 'eval' => 'double2,required',
+ ]
+ ],
+ 'sorting' => [
+ 'config' => [
+ 'type' => 'passthrough'
+ ]
+ ],
+ ],
+];
diff --git a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_hotel.php b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_hotel.php
index 2f34bd7a..48bd6326 100644
--- a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_hotel.php
+++ b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_hotel.php
@@ -28,7 +28,7 @@ return [
address, longitude, latitude, headline, teaser, description, features, room_types, additional_information,
teaser_images, header_images, images, reseller_images, code, type, category, country, region, city, facts,
teamer, products, header_title,header_subtitle, earlybird, new, low_contingent, show_as_teaser,
- external_link, path_segment',
+ external_link, path_segment, groups_price_configs, groups_price_boards, groups_price_options',
],
'types' => [
'1' => [
@@ -36,7 +36,8 @@ return [
--palette--;;destinations, --palette--;;categories, keywords,
--div--;Texte, teaser, description, features, room_types, additional_information,
--div--;Verknüpfungen, facts, teamer, additional_codes,
- --div--;Bilder/Dateien, teaser_images, header_images, images, reseller_images',
+ --div--;Bilder/Dateien, teaser_images, header_images, images, reseller_images,
+ --div--;Gruppenhaus Preise, groups_price_configs, groups_price_boards, groups_price_options',
],
],
'palettes' => [
@@ -592,7 +593,7 @@ return [
'additional_codes' => [
'exclude' => 0,
'label' => 'Zusätzliche Codes',
- 'config' => array(
+ 'config' => [
'type' => 'inline',
'foreign_table' => 'tx_epproducts_domain_model_matchcode',
'foreign_field' => 'entity',
@@ -600,15 +601,15 @@ return [
'entity_type' => 'hotel',
],
'maxitems' => 10,
- 'appearance' => array(
+ 'appearance' => [
'collapseAll' => 1,
'levelLinksPosition' => 'top',
'showSynchronizationLink' => 0,
'showPossibleLocalizationRecords' => 0,
'showAllLocalizationLink' => 0,
'expandSingle' => 1,
- ),
- ),
+ ],
+ ],
],
'latitude' => [
'exclude' => 0,
@@ -654,5 +655,64 @@ return [
'eval' => 'uniqueInSite',
],
],
+ 'groups_price_configs' => [
+ 'exclude' => 0,
+ 'label' => 'Preiskonfigurationen',
+ 'config' => [
+ 'type' => 'inline',
+ 'foreign_table' => 'tx_epproducts_domain_model_groupspriceconfig',
+ 'foreign_field' => 'hotel',
+ 'maxitems' => 99,
+ 'minitems' => 0,
+ 'appearance' => [
+ 'collapseAll' => 1,
+ 'levelLinksPosition' => 'top',
+ 'showSynchronizationLink' => 0,
+ 'showPossibleLocalizationRecords' => 0,
+ 'showAllLocalizationLink' => 0,
+ 'expandSingle' => 1,
+ ],
+ ],
+ ],
+ 'groups_price_boards' => [
+ 'exclude' => 0,
+ 'label' => 'Verpflegungsleistungen',
+ 'config' => [
+ 'type' => 'inline',
+ 'foreign_table' => 'tx_epproducts_domain_model_groupspriceboard',
+ 'foreign_field' => 'hotel',
+ 'maxitems' => 99,
+ 'minitems' => 0,
+ 'appearance' => [
+ 'useSortable' => true,
+ 'collapseAll' => 1,
+ 'levelLinksPosition' => 'top',
+ 'showSynchronizationLink' => 0,
+ 'showPossibleLocalizationRecords' => 0,
+ 'showAllLocalizationLink' => 0,
+ 'expandSingle' => 1,
+ ],
+ ],
+ ],
+ 'groups_price_options' => [
+ 'exclude' => 0,
+ 'label' => 'Optionale Zusatzleistungen',
+ 'config' => [
+ 'type' => 'inline',
+ 'foreign_table' => 'tx_epproducts_domain_model_groupspriceoption',
+ 'foreign_field' => 'hotel',
+ 'maxitems' => 99,
+ 'minitems' => 0,
+ 'appearance' => [
+ 'useSortable' => true,
+ 'collapseAll' => 1,
+ 'levelLinksPosition' => 'top',
+ 'showSynchronizationLink' => 0,
+ 'showPossibleLocalizationRecords' => 0,
+ 'showAllLocalizationLink' => 0,
+ 'expandSingle' => 1,
+ ],
+ ],
+ ],
],
];
diff --git a/public/typo3conf/ext/ep_products/Configuration/TypoScript/setup.typoscript b/public/typo3conf/ext/ep_products/Configuration/TypoScript/setup.typoscript
index 7f1e426c..a770a066 100644
--- a/public/typo3conf/ext/ep_products/Configuration/TypoScript/setup.typoscript
+++ b/public/typo3conf/ext/ep_products/Configuration/TypoScript/setup.typoscript
@@ -133,6 +133,9 @@ tx_epproducts_ajax_json {
AjaxWatchlist {
1 = list
}
+ AjaxGroupsPrice {
+ 1 = index
+ }
}
features.requireCHashArgumentForActionArguments = 0
settings =< plugin.tx_epproducts.settings
diff --git a/public/typo3conf/ext/ep_products/ext_localconf.php b/public/typo3conf/ext/ep_products/ext_localconf.php
index b32051ff..255c1ddf 100644
--- a/public/typo3conf/ext/ep_products/ext_localconf.php
+++ b/public/typo3conf/ext/ep_products/ext_localconf.php
@@ -345,6 +345,7 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\EP\EpProducts\T
'AjaxTable' => 'pricetable,pricetableHtml,eventPricetable',
'AjaxCalendar' => 'range,contingents,availableRooms',
'AjaxWatchlist' => 'list',
+ 'AjaxGroupsPrice' => 'index',
],
[
'AjaxSearch' => 'searchresult',
@@ -355,6 +356,7 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\EP\EpProducts\T
'AjaxTable' => 'pricetable,pricetableHtml,eventPricetable',
'AjaxCalendar' => 'range,contingents,availableRooms',
'AjaxWatchlist' => 'list',
+ 'AjaxGroupsPrice' => 'index',
]
);
@@ -382,6 +384,7 @@ $GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_epp
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_epproducts_ajax[months]';
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_epproducts_ajax[month]';
$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_epproducts_ajax[year]';
+$GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['excludedParameters'][] = 'tx_epproducts_ajax[hotel]';
$GLOBALS['TYPO3_CONF_VARS']['LOG']['EP']['EpProducts']['Controller']['writerConfiguration'] = [
\TYPO3\CMS\Core\Log\LogLevel::INFO => [
diff --git a/public/typo3conf/ext/ep_products/ext_tables.sql b/public/typo3conf/ext/ep_products/ext_tables.sql
index 123cf0c0..7bccd587 100644
--- a/public/typo3conf/ext/ep_products/ext_tables.sql
+++ b/public/typo3conf/ext/ep_products/ext_tables.sql
@@ -238,6 +238,9 @@ CREATE TABLE tx_epproducts_domain_model_hotel
address varchar(255) DEFAULT '' NOT NULL,
latitude varchar(255) DEFAULT '' NOT NULL,
longitude varchar(255) DEFAULT '' NOT NULL,
+ groups_price_configs int(11) unsigned NOT NULL default '0',
+ groups_price_options int(11) unsigned NOT NULL default '0',
+ groups_price_boards int(11) unsigned NOT NULL default '0',
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
@@ -268,6 +271,137 @@ CREATE TABLE tx_epproducts_domain_model_hotel
);
+#
+# Table structure for table 'tx_epproducts_domain_model_groupspriceconfig'
+#
+CREATE TABLE tx_epproducts_domain_model_groupspriceconfig
+(
+
+ uid int(11) NOT NULL auto_increment,
+ pid int(11) DEFAULT '0' NOT NULL,
+
+ date_from int(11) unsigned DEFAULT '0' NOT NULL,
+ date_to int(11) unsigned DEFAULT '0' NOT NULL,
+ persons_included int(11) unsigned DEFAULT '0' NOT NULL,
+ price float(8) unsigned DEFAULT '0' NOT NULL,
+ price_additional_person float(8) unsigned DEFAULT '0' NOT NULL,
+ hotel int(11) unsigned DEFAULT '0',
+
+ tstamp int(11) unsigned DEFAULT '0' NOT NULL,
+ crdate int(11) unsigned DEFAULT '0' NOT NULL,
+ cruser_id int(11) unsigned DEFAULT '0' NOT NULL,
+ deleted tinyint(4) unsigned DEFAULT '0' NOT NULL,
+ hidden tinyint(4) unsigned DEFAULT '0' NOT NULL,
+ starttime int(11) unsigned DEFAULT '0' NOT NULL,
+ endtime int(11) unsigned DEFAULT '0' NOT NULL,
+
+ t3ver_oid int(11) DEFAULT '0' NOT NULL,
+ t3ver_id int(11) DEFAULT '0' NOT NULL,
+ t3ver_wsid int(11) DEFAULT '0' NOT NULL,
+ t3ver_label varchar(255) DEFAULT '' NOT NULL,
+ t3ver_state tinyint(4) DEFAULT '0' NOT NULL,
+ t3ver_stage int(11) DEFAULT '0' NOT NULL,
+ t3ver_count int(11) DEFAULT '0' NOT NULL,
+ t3ver_tstamp int(11) DEFAULT '0' NOT NULL,
+ t3ver_move_id int(11) DEFAULT '0' NOT NULL,
+
+ sys_language_uid int(11) DEFAULT '0' NOT NULL,
+ l10n_parent int(11) DEFAULT '0' NOT NULL,
+ l10n_diffsource mediumblob,
+
+ PRIMARY KEY (uid),
+ KEY parent (pid),
+ KEY t3ver_oid (t3ver_oid, t3ver_wsid),
+ KEY language (l10n_parent, sys_language_uid)
+
+);
+
+#
+# Table structure for table 'tx_epproducts_domain_model_groupspriceoption'
+#
+CREATE TABLE tx_epproducts_domain_model_groupspriceoption
+(
+
+ uid int(11) NOT NULL auto_increment,
+ pid int(11) DEFAULT '0' NOT NULL,
+
+ title varchar(255) DEFAULT '' NOT NULL,
+ price float(8) unsigned DEFAULT '0' NOT NULL,
+ hotel int(11) unsigned DEFAULT '0',
+ sorting int(11) 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 'tx_epproducts_domain_model_groupspriceboard'
+#
+CREATE TABLE tx_epproducts_domain_model_groupspriceboard
+(
+
+ uid int(11) NOT NULL auto_increment,
+ pid int(11) DEFAULT '0' NOT NULL,
+
+ title varchar(255) DEFAULT '' NOT NULL,
+ price float(8) unsigned DEFAULT '0' NOT NULL,
+ hotel int(11) unsigned DEFAULT '0',
+ sorting int(11) 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 'tx_epproducts_domain_model_room'
#
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/GroupsPriceCalculator.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/GroupsPriceCalculator.vue
new file mode 100644
index 00000000..1f423707
--- /dev/null
+++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/GroupsPriceCalculator.vue
@@ -0,0 +1,53 @@
+
+