From 566c4bfad9da29213fb92981ff99f3a99b99b6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Fri, 17 Jan 2025 14:55:29 +0100 Subject: [PATCH] feat: additional fields for groups price calculator --- .../Controller/AjaxGroupsPriceController.php | 9 +++ .../Domain/Model/Dto/GroupsPriceInquiry.php | 77 +++++++++++++++++++ .../js/components/GroupsPriceCalculator.vue | 51 ++++++++++-- .../Resources/Private/Language/locallang.xlf | 6 ++ .../Private/Templates/Email/GroupsPrice.html | 16 ++++ .../Private/Templates/GroupsPrice/Index.html | 2 +- 6 files changed, 153 insertions(+), 8 deletions(-) diff --git a/public/typo3conf/ext/ep_products/Classes/Controller/AjaxGroupsPriceController.php b/public/typo3conf/ext/ep_products/Classes/Controller/AjaxGroupsPriceController.php index e505d4c0..37300d26 100644 --- a/public/typo3conf/ext/ep_products/Classes/Controller/AjaxGroupsPriceController.php +++ b/public/typo3conf/ext/ep_products/Classes/Controller/AjaxGroupsPriceController.php @@ -84,9 +84,18 @@ class AjaxGroupsPriceController extends ActionController $selectedOptions = []; } + $mode = $groupsPriceInquiry->getMode(); + + if (false === in_array($mode, [GroupsPriceInquiry::MODE_BOOKING, GroupsPriceInquiry::MODE_INQUIRY])) { + $mode = GroupsPriceInquiry::MODE_BOOKING; + } + $variables = [ + 'mode' => $mode, 'hotel' => $hotel, 'name' => $groupsPriceInquiry->getName(), + 'group' => $groupsPriceInquiry->getGroup(), + 'address' => $groupsPriceInquiry->getAddress(), 'email' => $groupsPriceInquiry->getEmail(), 'phone' => $groupsPriceInquiry->getPhone(), 'remarks' => $groupsPriceInquiry->getRemarks(), diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Dto/GroupsPriceInquiry.php b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Dto/GroupsPriceInquiry.php index 36d41d84..ba0c49dd 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Dto/GroupsPriceInquiry.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Dto/GroupsPriceInquiry.php @@ -28,12 +28,32 @@ namespace EP\EpProducts\Domain\Model\Dto; class GroupsPriceInquiry { + const MODE_INQUIRY = 'inquiry'; + const MODE_BOOKING = 'booking'; + + /** + * @var string + */ + protected $mode; + /** * @var string * @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty") */ protected $name; + /** + * @var string + * @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty") + */ + protected $group; + + /** + * @var string + * @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty") + */ + protected $address; + /** * @var string * @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty") @@ -99,6 +119,27 @@ class GroupsPriceInquiry */ protected $summary; + public function __construct() + { + $this->mode = self::MODE_BOOKING; + } + + /** + * @return string + */ + public function getMode() + { + return $this->mode; + } + + /** + * @param string $mode + */ + public function setMode($mode) + { + $this->mode = $mode; + } + /** * @return string */ @@ -115,6 +156,42 @@ class GroupsPriceInquiry $this->name = $name; } + /** + * @return string + */ + public function getGroup() + { + return $this->group; + } + + /** + * @param string $group + */ + public function setGroup($group) + { + $this->group = $group; + + return $this; + } + + /** + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * @param string $address + */ + public function setAddress($address) + { + $this->address = $address; + + return $this; + } + /** * @return string */ 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 index 7160a3db..d7fb32a3 100644 --- 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 @@ -153,7 +153,7 @@
- Angebot anfordern + Jetzt buchen
@@ -168,6 +168,29 @@ v-show="formErrors.name" v-html="formErrors.name">
+
+ +