diff --git a/public/typo3conf/ext/ep_products/Classes/Controller/AjaxCalendarController.php b/public/typo3conf/ext/ep_products/Classes/Controller/AjaxCalendarController.php index f74fad71..a921d913 100644 --- a/public/typo3conf/ext/ep_products/Classes/Controller/AjaxCalendarController.php +++ b/public/typo3conf/ext/ep_products/Classes/Controller/AjaxCalendarController.php @@ -71,7 +71,7 @@ class AjaxCalendarController extends ActionController $eventsRangeBegin = $range->getBegin()->sub(new \DateInterval('P1D')); $eventsRangeEnd = $range->getEnd()->add(new \DateInterval('P1D')); $eventsRange = new Range($eventsRangeBegin, $eventsRangeEnd); - $events = $factory->getEvents($eventsRange, [ 'hotel' => $hotel ]); + $events = $factory->getEvents($eventsRange, [ 'hotel' => $hotel, 'hotelUid' => $hotel->getUid() ]); $yearStart = $factory->getYear($range->getBegin()->format('Y')); $yearEnd = null; diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ContingentRepository.php b/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ContingentRepository.php index 380d5d56..6806a502 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ContingentRepository.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ContingentRepository.php @@ -49,6 +49,7 @@ class ContingentRepository extends AbstractRepository implements ProviderInterfa { $optionsResolver = new OptionsResolver(); $optionsResolver->setRequired(['hotel']); + $optionsResolver->setDefined(['hotelUid']); $optionsResolver->setAllowedTypes('hotel', Hotel::class); $resolvedOptions = $optionsResolver->resolve($options); @@ -61,13 +62,24 @@ class ContingentRepository extends AbstractRepository implements ProviderInterfa $qb ->select('status as status', 'date as date', 'min_price as minPrice', 'pax', 'available') ->from('tx_epproducts_domain_model_contingent') - ->where('hotel_code = :hotelCode') ->andWhere('date >= :dateFrom') - ->setParameter('hotelCode', $hotelCode) ->setParameter('dateFrom', $begin->format('Y-m-d')) ->orderBy('date') ; + if (!empty($hotel->getCode())) { + $qb + ->where('hotel_code = :hotelCode') + ->setParameter('hotelCode', $hotelCode) + ; + } else { + $hotelUid = $resolvedOptions['hotelUid']; + $qb + ->where('hotel = :hotelUid') + ->setParameter('hotelUid', $hotelUid) + ; + } + if (null !== $end) { $qb ->andWhere('date <= :dateTo') @@ -179,5 +191,5 @@ class ContingentRepository extends AbstractRepository implements ProviderInterfa return $qb->execute()->fetchAllAssociative(); } - + } diff --git a/public/typo3conf/ext/ep_theme/Classes/ViewHelpers/Calendar/ContingentViewHelper.php b/public/typo3conf/ext/ep_theme/Classes/ViewHelpers/Calendar/ContingentViewHelper.php index 3daf0930..fb2d94cf 100644 --- a/public/typo3conf/ext/ep_theme/Classes/ViewHelpers/Calendar/ContingentViewHelper.php +++ b/public/typo3conf/ext/ep_theme/Classes/ViewHelpers/Calendar/ContingentViewHelper.php @@ -78,7 +78,7 @@ class ContingentViewHelper extends AbstractViewHelper } $now = new \DateTime('now'); if ($now > $day->getBegin()) { - $class = [ 'text-muted' ]; + $class = [ 'text-gray-400' ]; return static::getHtml($class, $day->format('d')); } $contingents = $events->find($day); @@ -132,20 +132,20 @@ class ContingentViewHelper extends AbstractViewHelper */ protected static function getTransientLabelClasses($levelFrom, $levelTo = null) { - $classes = [ 'label' ]; + $classes = [ 'block p-1 leading-none text-sm text-white' ]; if ($levelFrom === static::LEVEL_RED) { - $class = 'label-danger'; + $class = 'full'; } elseif ($levelFrom === static::LEVEL_YELLOW) { - $class = 'label-warning'; + $class = 'partial'; } else { - $class = 'label-success'; + $class = 'free'; } if ($levelTo === static::LEVEL_RED) { - $class .= '-danger'; + $class .= '-to-full'; } elseif ($levelTo === static::LEVEL_YELLOW) { - $class .= '-warning'; + $class .= '-to-partial'; } elseif ($levelTo !== null) { - $class .= '-success'; + $class .= '-to-free'; } $classes[] = $class; return $classes; @@ -162,7 +162,7 @@ class ContingentViewHelper extends AbstractViewHelper if ($percentage <= 20 || $status === Contingent::STATUS_BLOCKED) { return static::LEVEL_RED; } - if (($percentage > 20 && $percentage <= 80) || $status === Contingent::STATUS_ONREQUEST) { + if ($percentage <= 80 || $status === Contingent::STATUS_ONREQUEST) { return static::LEVEL_YELLOW; } return static::LEVEL_GREEN; diff --git a/public/typo3conf/ext/ep_theme/Configuration/TypoScript/constants.typoscript b/public/typo3conf/ext/ep_theme/Configuration/TypoScript/constants.typoscript index 5283ec0b..f9ecedfb 100644 --- a/public/typo3conf/ext/ep_theme/Configuration/TypoScript/constants.typoscript +++ b/public/typo3conf/ext/ep_theme/Configuration/TypoScript/constants.typoscript @@ -78,7 +78,7 @@ plugin.tx_eptheme { # cat=eptheme/400/100; type=string; label=Phone number general phoneNumberLink = +492212722760 # cat=eptheme/400/110; type=string; label=Phone number WhatsApp - whatsAppNumberLink = 492212722760 + whatsAppNumberLink = https://wa.me/492212722760 # cat=eptheme/400/120; type=string; label=Business hours days businessHoursDays = Montag - Freitag # cat=eptheme/400/130; type=string; label=Business hours time diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/calendar.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/calendar.js index 986b9a9a..38af773b 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/calendar.js +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/calendar.js @@ -1,6 +1,6 @@ import axios from 'axios' -export default uri => ({ +export default props => ({ loading: false, selectedIndex: null, selectableMonths: [], @@ -28,10 +28,11 @@ export default uri => ({ this.loading = true let selectedMonth = this.selectableMonths[this.selectedIndex] let data = new URLSearchParams({ - 'tx_epproducts_ajax[month]': selectedMonth.getMonth(), - 'tx_epproducts_ajax[year]': selectedMonth.getYear(), + 'tx_epproducts_ajax[hotel]': props.hotel, + 'tx_epproducts_ajax[month]': selectedMonth.getMonth() + 1, + 'tx_epproducts_ajax[year]': selectedMonth.getFullYear(), }) - axios.post(uri, data) + axios.post(props.url, data) .then(response => ( this.calendarWrapper.innerHTML = response.data )) diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_calendar.scss b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_calendar.scss index 8a59e00a..faac2b26 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_calendar.scss +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_calendar.scss @@ -1,59 +1,44 @@ -.calendar { - @apply relative; - - &--single { - @apply mb-16; - } +.label-success, +.free { + @apply bg-green-500; } -.calendar__month { - - &--single { - @apply text-lg; - } - +.label-warning, +.partial { + @apply bg-yellow-300; } -.calendar__select { - @apply mb-8 outline-none focus:outline-none; +.label-danger, +.full { + @apply bg-red-500; } -.calendar__loading { - @apply absolute top-0 left-0 inset-0 w-full h-full z-10 bg-overlay-white; - - img { - @apply absolute top-1/2 left-1/2 -translate-xy-1/2; - } -} - -.calendar__days { - - table { - @apply mb-0; - } - -} - -.label-success-danger { +.label-success-danger, +.free-to-full { background: linear-gradient(to bottom right, theme('colors.green.500') 50%, theme('colors.red.500') 50%); } -.label-success-warning { - background: linear-gradient(to bottom right, theme('colors.green.500') 50%, theme('colors.red.500') 50%); +.label-success-warning, +.free-to-partial { + background: linear-gradient(to bottom right, theme('colors.green.500') 50%, theme('colors.yellow.300') 50%); } -.label-danger-success { +.label-danger-success, +.full-to-free { background: linear-gradient(to bottom right, theme('colors.red.500') 50%, theme('colors.green.500') 50%); } -.label-warning-success { - background: linear-gradient(to bottom right, theme('colors.red.500') 50%, theme('colors.green.500') 50%); +.label-warning-success, +.partial-to-free { + background: linear-gradient(to bottom right, theme('colors.yellow.300') 50%, theme('colors.green.500') 50%); } -.label-danger-warning { - background: linear-gradient(to bottom right, theme('colors.red.500') 50%, theme('colors.red.500') 50%); +.label-danger-warning, +.full-to-partial { + background: linear-gradient(to bottom right, theme('colors.red.500') 50%, theme('colors.yellow.300') 50%); } -.label-warning-danger { - background: linear-gradient(to bottom right, theme('colors.red.500') 50%, theme('colors.red.500') 50%); +.label-warning-danger, +.partial-to-full { + background: linear-gradient(to bottom right, theme('colors.yellow.300') 50%, theme('colors.red.500') 50%); } diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_contact-bar.scss b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_contact-bar.scss index 77e3b432..95e77ea1 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_contact-bar.scss +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/components/_contact-bar.scss @@ -11,7 +11,7 @@ @apply flex-1 text-white py-2 bg-ep-primary; @screen md { - @apply flex flex-none items-start transition-transform duration-300 ease-in-out p-1 shadow-md; + @apply flex flex-none items-start transition-transform duration-300 ease-in-out p-1 shadow-md focus:text-white; &:hover { @apply text-white; transform: translateX(calc(-100% + theme('spacing.8'))); diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/ContactBar.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/ContactBar.html index 287094e0..0d6890b9 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/ContactBar.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/ContactBar.html @@ -27,7 +27,7 @@ {settings.phoneNumber} - - {settings.whatsApp} als Kontakt speichern + {settings.whatsApp} - - + + @@ -83,8 +83,8 @@ - - + + diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Officetip.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Officetip.html index ad6e8ead..9943cebc 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Officetip.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Officetip.html @@ -1,12 +1,16 @@ - - - - Officetipp + + + + + Officetipp + + + @@ -14,9 +18,11 @@ - - {officetip.text -> f:format.nl2br()} - {officetip.author.name} + + + {officetip.text -> f:format.nl2br()} + + {officetip.author.name} diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxCalendar/Range.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxCalendar/Range.html index f9063135..178f8fc7 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxCalendar/Range.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxCalendar/Range.html @@ -17,23 +17,29 @@ - - - + + + - {weekday} + + {weekday} + - - - - - - - - - + + + + + + + + + + + + + diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Concept/Detail.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Concept/Detail.html index a88bd88a..6c864df1 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Concept/Detail.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Concept/Detail.html @@ -18,11 +18,7 @@ - - - - - + {concept.description -> f:format.html()} diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Password/Index.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Password/Index.html index 1c41a1db..6d6fd877 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Password/Index.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Password/Index.html @@ -5,12 +5,9 @@ - - - - + + diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html index c0002e3f..ded1cf86 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html @@ -593,18 +593,26 @@ Preisberechnung - - Belegungskalender - ")'> - - - - - - - - + + + Belegungskalender + + + })'> + + + + + +
Officetipp
{officetip.text -> f:format.nl2br()}
Belegungskalender