diff --git a/public/typo3conf/ext/ep_products/Classes/Controller/GroupsPriceController.php b/public/typo3conf/ext/ep_products/Classes/Controller/GroupsPriceController.php index 783f3266..49300c80 100644 --- a/public/typo3conf/ext/ep_products/Classes/Controller/GroupsPriceController.php +++ b/public/typo3conf/ext/ep_products/Classes/Controller/GroupsPriceController.php @@ -40,6 +40,15 @@ class GroupsPriceController extends ActionController return $a->getDateFrom() > $b->getDateFrom(); }); + $mainSeasonFrom = $mainSeasonTo = null; + + if (null !== $hotel->getMainSeasonFrom()) { + $mainSeasonFrom = $hotel->getMainSeasonFrom()->format('d.m.Y'); + } + if (null !== $hotel->getMainSeasonTo()) { + $mainSeasonTo = $hotel->getMainSeasonTo()->format('d.m.Y'); + } + $this->view->assign('hotel', $hotel); $this->view->assign('runningCostsEUR', $this->settings['runningCostsEUR']); $this->view->assign('runningCostsCHF', $this->settings['runningCostsCHF']); @@ -49,5 +58,7 @@ class GroupsPriceController extends ActionController $this->view->assign('configs', json_encode(array_values($configs), JSON_HEX_APOS)); $this->view->assign('boards', json_encode($hotel->getGroupsPriceBoards()->toArray(), JSON_HEX_APOS)); $this->view->assign('options', json_encode($hotel->getGroupsPriceOptions()->toArray(), JSON_HEX_APOS)); + $this->view->assign('mainSeasonFrom', $mainSeasonFrom); + $this->view->assign('mainSeasonTo', $mainSeasonTo); } } 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 4100beab..d1c4bba4 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Hotel.php @@ -275,6 +275,16 @@ class Hotel extends AbstractEntity implements TeaserInterface */ protected $groupsPriceBoards; + /** + * @var \DateTime + */ + protected $mainSeasonFrom; + + /** + * @var \DateTime + */ + protected $mainSeasonTo; + public function __construct() { $this->initStorageObjects(); @@ -1073,4 +1083,24 @@ class Hotel extends AbstractEntity implements TeaserInterface { $this->tourLink = $tourLink; } + + public function getMainSeasonFrom() + { + return $this->mainSeasonFrom; + } + + public function setMainSeasonFrom(\DateTime $mainSeasonFrom) + { + $this->mainSeasonFrom = $mainSeasonFrom; + } + + public function getMainSeasonTo() + { + return $this->mainSeasonTo; + } + + public function setMainSeasonTo(\DateTime $mainSeasonTo) + { + $this->mainSeasonTo = $mainSeasonTo; + } } 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 index 51f8ae6f..a7b78049 100644 --- 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 @@ -178,7 +178,7 @@ return [ ], 'price_additional_person_chf' => [ 'exclude' => false, - 'label' => 'Preis weitere Person', + 'label' => 'Preis weitere Person in CHF', 'description' => 'ohne Jokercard, alle Altersgruppen', 'config' => [ 'type' => 'input', @@ -238,7 +238,7 @@ return [ ], 'price_additional_person_group_3_chf' => [ 'exclude' => false, - 'label' => 'Preis weitere Person', + 'label' => 'Preis weitere Person in CHF', 'description' => 'mit Jokercard, ab 15 Jahre', 'config' => [ 'type' => 'input', 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 84038e95..0a36f512 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 @@ -30,7 +30,7 @@ return [ --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, tour_thumbnail, - --div--;Gruppenhaus Preise, groups_price_configs, groups_price_boards, groups_price_options', + --div--;Gruppenhaus Preise, --palette--;;season, groups_price_configs, groups_price_boards, groups_price_options', ], ], 'palettes' => [ @@ -40,6 +40,7 @@ return [ 'destinations' => ['showitem' => 'country,region,city'], 'name' => ['showitem' => 'name,short_name,--linebreak--,header_title,header_subtitle,--linebreak--,headline'], 'categories' => ['showitem' => 'type,category'], + 'season' => ['showitem' => 'main_season_from, main_season_to'], ], 'columns' => [ @@ -740,5 +741,31 @@ return [ ], ], ], + 'main_season_from' => [ + 'exclude' => false, + 'label' => 'Hauptsaison von', + 'config' => [ + 'dbType' => 'date', + 'type' => 'input', + 'size' => 7, + 'eval' => 'date', + 'checkbox' => 0, + 'default' => '0000-00-00', + 'renderType' => 'inputDateTime', + ], + ], + 'main_season_to' => [ + 'exclude' => false, + 'label' => 'Hauptsaison bis', + 'config' => [ + 'dbType' => 'date', + 'type' => 'input', + 'size' => 7, + 'eval' => 'date', + 'checkbox' => 0, + 'default' => '0000-00-00', + 'renderType' => 'inputDateTime', + ], + ], ], ]; diff --git a/public/typo3conf/ext/ep_products/ext_tables.sql b/public/typo3conf/ext/ep_products/ext_tables.sql index 0f8e8a0c..19ebc8d2 100644 --- a/public/typo3conf/ext/ep_products/ext_tables.sql +++ b/public/typo3conf/ext/ep_products/ext_tables.sql @@ -255,6 +255,8 @@ CREATE TABLE tx_epproducts_domain_model_hotel 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', + main_season_from date DEFAULT NULL, + main_season_to date DEFAULT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, 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 3cf5bbf6..802586a6 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 @@ -8,7 +8,10 @@ -

+ in der Hauptsaison {{ mainSeasonFrom }}-{{ mainSeasonTo }} mind. {{ minBookingDays }} Tage +

+

Einzelne Nächte sind nur auf Anfrage buchbar

@@ -326,6 +329,18 @@ export default { ] } }, + mainSeasonFrom: { + type: String, + default: null, + }, + mainSeasonTo: { + type: String, + default: null, + }, + minBookingDays: { + type: Number, + default: 5, + }, }, data() { return { @@ -356,10 +371,12 @@ export default { }, methods: { formatCurrency({ EUR, CHF }) { - let price = parseFloat(EUR).toFixed(2).replace(/\./, ',') + ' €' + let price if ('CH' === this.countryCode && 0 < CHF) { - price += `/${parseFloat(CHF).toFixed(2).replace(/\./, ',')} CHF` + price = `${parseFloat(CHF).toFixed(2).replace(/\./, ',')} CHF` + } else { + price = parseFloat(EUR).toFixed(2).replace(/\./, ',') + ' €' } return price diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/GroupsPrice/Index.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/GroupsPrice/Index.html index bcb4dcdc..a58f3685 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/GroupsPrice/Index.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/GroupsPrice/Index.html @@ -20,8 +20,10 @@ country-code="{countryCode}" endpoint="{ep:uri.ajax(action: 'processForm', controller: 'AjaxGroupsPrice', pageUid: settings.defaultAjaxUid, arguments: '{hotel: hotel}')}" loader-uri="{f:uri.image(src: 'EXT:ep_theme/Resources/Public/images/ajax-loader-white.gif')}" - logo-at="{f:uri.image(src: 'fileadmin/user_upload/Logos_Banner/Alpinevacation.jpg')}" - logo-ch="{f:uri.image(src: 'fileadmin/user_upload/Logos_Banner/Cllt_Touristik_frei_gestellt.jpg')}" + logo-ch="{f:uri.image(src: 'fileadmin/user_upload/Logos_Banner/Alpinevacation.jpg')}" + logo-at="{f:uri.image(src: 'fileadmin/user_upload/Logos_Banner/Cllt_Touristik_frei_gestellt.jpg')}" + main-season-from="{mainSeasonFrom}" + main-season-to="{mainSeasonTo}" >