feat: hide included services column in tables when not applicable
This commit is contained in:
@@ -194,6 +194,7 @@ class AjaxTableController extends ActionController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$hasSurchargeOrDiscount = $this->dateService->checkSurcharcheOrDiscount($allDates);
|
$hasSurchargeOrDiscount = $this->dateService->checkSurcharcheOrDiscount($allDates);
|
||||||
|
$hasIncludedServices = $this->dateService->hasIncludedServices($allDates);
|
||||||
$noInfoConceptUids = GeneralUtility::trimExplode(',', $this->settings['noInfoConceptUids']);
|
$noInfoConceptUids = GeneralUtility::trimExplode(',', $this->settings['noInfoConceptUids']);
|
||||||
$isProductWithNoInfoConcept = ($product->getConcept() !== null) && \in_array($product->getConcept()->getUid(),
|
$isProductWithNoInfoConcept = ($product->getConcept() !== null) && \in_array($product->getConcept()->getUid(),
|
||||||
$noInfoConceptUids, false);
|
$noInfoConceptUids, false);
|
||||||
@@ -209,6 +210,7 @@ class AjaxTableController extends ActionController
|
|||||||
'hotel' => $hotel,
|
'hotel' => $hotel,
|
||||||
'altProductLink' => $altProductLink,
|
'altProductLink' => $altProductLink,
|
||||||
'altLabel' => $altLabel,
|
'altLabel' => $altLabel,
|
||||||
|
'hasIncludedServices' => $hasIncludedServices,
|
||||||
'hasSurcharge' => $hasSurchargeOrDiscount['surcharge'],
|
'hasSurcharge' => $hasSurchargeOrDiscount['surcharge'],
|
||||||
'hasDiscount' => $hasSurchargeOrDiscount['discount'],
|
'hasDiscount' => $hasSurchargeOrDiscount['discount'],
|
||||||
'isProductWithNoInfoConcept' => $isProductWithNoInfoConcept,
|
'isProductWithNoInfoConcept' => $isProductWithNoInfoConcept,
|
||||||
@@ -244,14 +246,14 @@ class AjaxTableController extends ActionController
|
|||||||
'paCode' => GeneralUtility::_GET('pa'),
|
'paCode' => GeneralUtility::_GET('pa'),
|
||||||
]);
|
]);
|
||||||
$hasSurchargeOrDiscount = $this->dateService->checkSurcharcheOrDiscount($priceTable);
|
$hasSurchargeOrDiscount = $this->dateService->checkSurcharcheOrDiscount($priceTable);
|
||||||
|
$hasIncludedServices = $this->dateService->hasIncludedServices($priceTable);
|
||||||
|
|
||||||
$dateStart = $date ? $date->getDateStart()->format('d.m.y') : '';
|
$dateStart = $date ? $date->getDateStart()->format('d.m.y') : '';
|
||||||
$dateEnd = $date ? $date->getDateEnd()->format('d.m.y') : '';
|
$dateEnd = $date ? $date->getDateEnd()->format('d.m.y') : '';
|
||||||
$dateRange = sprintf('%s - %s', $dateStart, $dateEnd);
|
$dateRange = sprintf('%s - %s', $dateStart, $dateEnd);
|
||||||
|
|
||||||
$noInfoConceptUids = GeneralUtility::trimExplode(',', $this->settings['noInfoConceptUids']);
|
$noInfoConceptUids = GeneralUtility::trimExplode(',', $this->settings['noInfoConceptUids']);
|
||||||
$isProductWithNoInfoConcept = ($product->getConcept() !== null) && \in_array($product->getConcept()->getUid(),
|
$isProductWithNoInfoConcept = ($product->getConcept() !== null) && \in_array($product->getConcept()->getUid(), $noInfoConceptUids);
|
||||||
$noInfoConceptUids, false);
|
|
||||||
|
|
||||||
$nonBookableInfo = $this->getNonBookableInfobox($product);
|
$nonBookableInfo = $this->getNonBookableInfobox($product);
|
||||||
|
|
||||||
@@ -262,6 +264,7 @@ class AjaxTableController extends ActionController
|
|||||||
'servicesIncluded' => $date->getServicesIncluded(),
|
'servicesIncluded' => $date->getServicesIncluded(),
|
||||||
'prices' => $priceTable,
|
'prices' => $priceTable,
|
||||||
'unavailable' => count($priceTable) === 0,
|
'unavailable' => count($priceTable) === 0,
|
||||||
|
'hasIncludedServices' => $hasIncludedServices,
|
||||||
'hasSurcharge' => $hasSurchargeOrDiscount['surcharge'],
|
'hasSurcharge' => $hasSurchargeOrDiscount['surcharge'],
|
||||||
'hasDiscount' => $hasSurchargeOrDiscount['discount'],
|
'hasDiscount' => $hasSurchargeOrDiscount['discount'],
|
||||||
'isProductWithNoInfoConcept' => $isProductWithNoInfoConcept,
|
'isProductWithNoInfoConcept' => $isProductWithNoInfoConcept,
|
||||||
@@ -286,7 +289,7 @@ class AjaxTableController extends ActionController
|
|||||||
|
|
||||||
$nonBookableInfo = $this->getNonBookableInfobox($product);
|
$nonBookableInfo = $this->getNonBookableInfobox($product);
|
||||||
|
|
||||||
$pricetable = $this->dateService->getPriceTable([
|
$priceTable = $this->dateService->getPriceTable([
|
||||||
'product' => $product,
|
'product' => $product,
|
||||||
'hotel' => $hotel,
|
'hotel' => $hotel,
|
||||||
'filterSettings' => $this->filterService->getNormalizedFilterSettings(),
|
'filterSettings' => $this->filterService->getNormalizedFilterSettings(),
|
||||||
@@ -294,10 +297,14 @@ class AjaxTableController extends ActionController
|
|||||||
'paCode' => $paCode,
|
'paCode' => $paCode,
|
||||||
'sortByRoom' => true,
|
'sortByRoom' => true,
|
||||||
]);
|
]);
|
||||||
|
$hasIncludedServices = $this->dateService->hasIncludedServices($priceTable);
|
||||||
|
|
||||||
$this->view->assign('pricetable', $pricetable);
|
$this->view->assignMultiple([
|
||||||
$this->view->assign('nonBookableInfo', $nonBookableInfo);
|
'pricetable' => $priceTable,
|
||||||
$this->view->assign('bpnBookingUrlTemplateCode', $bpnBookingUrlTemplateCode ?? $this->settings['bpnBookingUrlTemplateCode']);
|
'hasIncludedServices' => $hasIncludedServices,
|
||||||
|
'nonBookableInfo' => $nonBookableInfo,
|
||||||
|
'bpnBookingUrlTemplateCode' => $bpnBookingUrlTemplateCode ?? $this->settings['bpnBookingUrlTemplateCode'],
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -319,7 +326,8 @@ class AjaxTableController extends ActionController
|
|||||||
}, $roomTypes);
|
}, $roomTypes);
|
||||||
$maxPax = max($roomTypesPax);
|
$maxPax = max($roomTypesPax);
|
||||||
$template = $this->settings['bpnBookingUrlTemplateCode'];
|
$template = $this->settings['bpnBookingUrlTemplateCode'];
|
||||||
$pricetable = $this->dateService->getEventPriceTable($product, $maxPax, $template);
|
$priceTable = $this->dateService->getEventPriceTable($product, $maxPax, $template);
|
||||||
|
$hasIncludedServices = $this->dateService->hasIncludedServices($priceTable);
|
||||||
$nonBookableInfo = $this->getNonBookableInfobox($product);
|
$nonBookableInfo = $this->getNonBookableInfobox($product);
|
||||||
$categories = [
|
$categories = [
|
||||||
Hotel::CATEGORY_STANDARD => 'Standard',
|
Hotel::CATEGORY_STANDARD => 'Standard',
|
||||||
@@ -330,7 +338,8 @@ class AjaxTableController extends ActionController
|
|||||||
$this->view->assignMultiple([
|
$this->view->assignMultiple([
|
||||||
'roomTypesPax' => $roomTypesPax,
|
'roomTypesPax' => $roomTypesPax,
|
||||||
'roomTypesLabels' => $roomTypesLabels,
|
'roomTypesLabels' => $roomTypesLabels,
|
||||||
'pricetable' => $pricetable,
|
'pricetable' => $priceTable,
|
||||||
|
'hasIncludedServices' => $hasIncludedServices,
|
||||||
'categories' => $categories,
|
'categories' => $categories,
|
||||||
'themekey' => $this->settings['themekey'],
|
'themekey' => $this->settings['themekey'],
|
||||||
'nonBookableInfo' => $nonBookableInfo,
|
'nonBookableInfo' => $nonBookableInfo,
|
||||||
|
|||||||
@@ -410,6 +410,20 @@ class DateService implements SingletonInterface
|
|||||||
return $priceTable;
|
return $priceTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function hasIncludedServices(array $tableData): bool
|
||||||
|
{
|
||||||
|
$included = false;
|
||||||
|
|
||||||
|
foreach ($tableData as $row) {
|
||||||
|
if ($row['busIncluded'] || $row['skipassIncluded']) {
|
||||||
|
$included = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $included;
|
||||||
|
}
|
||||||
|
|
||||||
public function checkSurcharcheOrDiscount(array $tableData): array
|
public function checkSurcharcheOrDiscount(array $tableData): array
|
||||||
{
|
{
|
||||||
$data = [
|
$data = [
|
||||||
|
|||||||
@@ -22,9 +22,11 @@
|
|||||||
<th class="text-left">
|
<th class="text-left">
|
||||||
Preis/Pers.
|
Preis/Pers.
|
||||||
</th>
|
</th>
|
||||||
<th class="text-left">
|
<f:if condition="{hasIncludedServices}">
|
||||||
inkl.
|
<th class="text-left">
|
||||||
</th>
|
inkl.
|
||||||
|
</th>
|
||||||
|
</f:if>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th class="hidden lg:table-cell"></th>
|
<th class="hidden lg:table-cell"></th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -58,25 +60,27 @@
|
|||||||
</f:else>
|
</f:else>
|
||||||
</f:if>
|
</f:if>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-2 py-1 border border-zinc-200">
|
<f:if condition="{hasIncludedServices}">
|
||||||
<f:if condition="{row.busIncluded}">
|
<td class="px-2 py-1 border border-zinc-200">
|
||||||
<span data-cooltipz-dir="top"
|
<f:if condition="{row.busIncluded}">
|
||||||
aria-label="Busfahrt"
|
<span data-cooltipz-dir="top"
|
||||||
role="tooltip"
|
aria-label="Busfahrt"
|
||||||
data-pricetable-target="busIcon"
|
role="tooltip"
|
||||||
data-bus-included="{row.busIncluded}"
|
data-pricetable-target="busIcon"
|
||||||
data-bus-price="{row.busPrice}">
|
data-bus-included="{row.busIncluded}"
|
||||||
{ep:icon(icon: 'bus', class: 'w-4 h-4 md:w-5 md:h-5')}
|
data-bus-price="{row.busPrice}">
|
||||||
</span>
|
{ep:icon(icon: 'bus', class: 'w-4 h-4 md:w-5 md:h-5')}
|
||||||
</f:if>
|
</span>
|
||||||
<f:if condition="{row.skipassIncluded}">
|
</f:if>
|
||||||
<span data-cooltipz-dir="top"
|
<f:if condition="{row.skipassIncluded}">
|
||||||
aria-label="Skipass"
|
<span data-cooltipz-dir="top"
|
||||||
role="tooltip">
|
aria-label="Skipass"
|
||||||
{ep:icon(icon: 'tag', class: 'w-4 h-4 md:w-5 md:h-5')}
|
role="tooltip">
|
||||||
</span>
|
{ep:icon(icon: 'tag', class: 'w-4 h-4 md:w-5 md:h-5')}
|
||||||
</f:if>
|
</span>
|
||||||
</td>
|
</f:if>
|
||||||
|
</td>
|
||||||
|
</f:if>
|
||||||
<td class="px-2 py-1 border border-zinc-200">
|
<td class="px-2 py-1 border border-zinc-200">
|
||||||
<f:if condition="{row.optionalServices} && {row.available}">
|
<f:if condition="{row.optionalServices} && {row.available}">
|
||||||
<button type="button"
|
<button type="button"
|
||||||
|
|||||||
+54
-50
@@ -35,9 +35,11 @@
|
|||||||
<th class="border-r border-white/50 px-2 py-1 md:p-2 text-sm md:text-base">
|
<th class="border-r border-white/50 px-2 py-1 md:p-2 text-sm md:text-base">
|
||||||
Nächte
|
Nächte
|
||||||
</th>
|
</th>
|
||||||
<th class="border-r border-white/50 px-2 py-1 md:p-2 text-sm md:text-base">
|
<f:if condition="{hasIncludedServices}">
|
||||||
inklusive
|
<th class="border-r border-white/50 px-2 py-1 md:p-2 text-sm md:text-base">
|
||||||
</th>
|
inklusive
|
||||||
|
</th>
|
||||||
|
</f:if>
|
||||||
<th class="border-r border-white/50 px-2 py-1 md:p-2 text-sm md:text-base">
|
<th class="border-r border-white/50 px-2 py-1 md:p-2 text-sm md:text-base">
|
||||||
ab
|
ab
|
||||||
</th>
|
</th>
|
||||||
@@ -76,54 +78,56 @@
|
|||||||
{row.nights}
|
{row.nights}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="border-r border-zinc-200 px-2 p-1">
|
<f:if condition="{hasIncludedServices}">
|
||||||
<div class="flex flex-wrap items-center">
|
<td class="border-r border-zinc-200 px-2 p-1">
|
||||||
<div class="grid grid-cols-2">
|
<div class="flex flex-wrap items-center">
|
||||||
<f:if condition="{row.busIncluded}">
|
<div class="grid grid-cols-2">
|
||||||
<f:then>
|
<f:if condition="{row.busIncluded}">
|
||||||
<span class="block p-1"
|
<f:then>
|
||||||
data-cooltipz-dir="top"
|
<span class="block p-1"
|
||||||
aria-label="Busfahrt inklusive"
|
data-cooltipz-dir="top"
|
||||||
role="tooltip"
|
aria-label="Busfahrt inklusive"
|
||||||
data-pricetable-target="busIcon"
|
role="tooltip"
|
||||||
data-bus-included="{row.busIncluded}"
|
data-pricetable-target="busIcon"
|
||||||
data-bus-price="{row.busPrice}">
|
data-bus-included="{row.busIncluded}"
|
||||||
<svg class="w-4 h-4 md:w-5 md:h-5">
|
data-bus-price="{row.busPrice}">
|
||||||
<use href="{f:uri.image(src: 'EXT:ep_theme/Resources/Public/images/icons_sprite.svg')}#icon-bus"></use>
|
<svg class="w-4 h-4 md:w-5 md:h-5">
|
||||||
</svg>
|
<use href="{f:uri.image(src: 'EXT:ep_theme/Resources/Public/images/icons_sprite.svg')}#icon-bus"></use>
|
||||||
</span>
|
</svg>
|
||||||
</f:then>
|
</span>
|
||||||
<f:else>
|
</f:then>
|
||||||
<span class="block"></span>
|
<f:else>
|
||||||
</f:else>
|
<span class="block"></span>
|
||||||
</f:if>
|
</f:else>
|
||||||
<f:if condition="{row.skipassIncluded}">
|
</f:if>
|
||||||
<f:then>
|
<f:if condition="{row.skipassIncluded}">
|
||||||
<span class="block p-1"
|
<f:then>
|
||||||
data-cooltipz-dir="top"
|
<span class="block p-1"
|
||||||
aria-label="{f:if(condition: row.summer, then: 'Bergbahnticket inklusive', else: 'Skipass inklusive')}"
|
data-cooltipz-dir="top"
|
||||||
role="tooltip">
|
aria-label="{f:if(condition: row.summer, then: 'Bergbahnticket inklusive', else: 'Skipass inklusive')}"
|
||||||
<svg class="w-4 h-4 md:w-5 md:h-5">
|
role="tooltip">
|
||||||
<use href="{f:uri.image(src: 'EXT:ep_theme/Resources/Public/images/icons_sprite.svg')}#icon-tag"></use>
|
<svg class="w-4 h-4 md:w-5 md:h-5">
|
||||||
</svg>
|
<use href="{f:uri.image(src: 'EXT:ep_theme/Resources/Public/images/icons_sprite.svg')}#icon-tag"></use>
|
||||||
</span>
|
</svg>
|
||||||
</f:then>
|
</span>
|
||||||
<f:else>
|
</f:then>
|
||||||
<span class="block"></span>
|
<f:else>
|
||||||
</f:else>
|
<span class="block"></span>
|
||||||
</f:if>
|
</f:else>
|
||||||
|
</f:if>
|
||||||
|
</div>
|
||||||
|
<button type="button"
|
||||||
|
class="text-ep-primary-light ser:text-ser-primary col-span-2 text-sm md:text-base text-left leading-none whitespace-nowrap p-1"
|
||||||
|
data-action="pricetable#openModal"
|
||||||
|
data-pricetable-type-param="services"
|
||||||
|
data-pricetable-uid-param="{row.dateUid}"
|
||||||
|
data-cooltipz-dir="top"
|
||||||
|
aria-label="Alle Inklusivleistungen anzeigen">
|
||||||
|
Leistungen
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<button type="button"
|
</td>
|
||||||
class="text-ep-primary-light ser:text-ser-primary col-span-2 text-sm md:text-base text-left leading-none whitespace-nowrap p-1"
|
</f:if>
|
||||||
data-action="pricetable#openModal"
|
|
||||||
data-pricetable-type-param="services"
|
|
||||||
data-pricetable-uid-param="{row.dateUid}"
|
|
||||||
data-cooltipz-dir="top"
|
|
||||||
aria-label="Alle Inklusivleistungen anzeigen">
|
|
||||||
Leistungen
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td class="border-r border-zinc-200 px-2 py-1 md:p-2 text-center">
|
<td class="border-r border-zinc-200 px-2 py-1 md:p-2 text-center">
|
||||||
<f:if condition="{row.pseudoPrice}">
|
<f:if condition="{row.pseudoPrice}">
|
||||||
<span class="block text-sm line-through">
|
<span class="block text-sm line-through">
|
||||||
|
|||||||
+50
-46
@@ -28,14 +28,16 @@
|
|||||||
<th class="border-r border-white/50 px-2 py-1 md:p-2 text-left text-sm md:text-base">
|
<th class="border-r border-white/50 px-2 py-1 md:p-2 text-left text-sm md:text-base">
|
||||||
Zimmertyp {dateRange}
|
Zimmertyp {dateRange}
|
||||||
</th>
|
</th>
|
||||||
<th class="border-r border-white/50 px-2 py-1 md:p-2 text-sm md:text-base">
|
<f:if condition="{hasIncludedServices}">
|
||||||
<span class="lg:hidden">
|
<th class="border-r border-white/50 px-2 py-1 md:p-2 text-sm md:text-base">
|
||||||
inkl.
|
<span class="lg:hidden">
|
||||||
</span>
|
inkl.
|
||||||
<span class="hidden lg:block">
|
</span>
|
||||||
inklusive
|
<span class="hidden lg:block">
|
||||||
</span>
|
inklusive
|
||||||
</th>
|
</span>
|
||||||
|
</th>
|
||||||
|
</f:if>
|
||||||
<th class="border-r border-white/50 px-2 py-1 md:p-2 text-sm md:text-base">
|
<th class="border-r border-white/50 px-2 py-1 md:p-2 text-sm md:text-base">
|
||||||
optional
|
optional
|
||||||
</th>
|
</th>
|
||||||
@@ -71,45 +73,47 @@
|
|||||||
</f:else>
|
</f:else>
|
||||||
</f:if>
|
</f:if>
|
||||||
</td>
|
</td>
|
||||||
<td class="border-r border-zinc-200 px-2 py-1 md:p-2">
|
<f:if condition="{hasIncludedServices}">
|
||||||
<div class="flex items-center justify-around space-x-1">
|
<td class="border-r border-zinc-200 px-2 py-1 md:p-2">
|
||||||
<div class="grid grid-cols-2">
|
<div class="flex items-center justify-around space-x-1">
|
||||||
<f:if condition="{row.busIncluded}">
|
<div class="grid grid-cols-2">
|
||||||
<f:then>
|
<f:if condition="{row.busIncluded}">
|
||||||
<span class="block p-1"
|
<f:then>
|
||||||
data-cooltipz-dir="top"
|
<span class="block p-1"
|
||||||
aria-label="Busfahrt inklusive"
|
data-cooltipz-dir="top"
|
||||||
role="tooltip"
|
aria-label="Busfahrt inklusive"
|
||||||
data-pricetable-target="busIcon"
|
role="tooltip"
|
||||||
data-bus-included="{row.busIncluded}"
|
data-pricetable-target="busIcon"
|
||||||
data-bus-price="{row.busPrice}">
|
data-bus-included="{row.busIncluded}"
|
||||||
<svg class="w-4 h-4 md:w-5 md:h-5">
|
data-bus-price="{row.busPrice}">
|
||||||
<use href="{f:uri.image(src: 'EXT:ep_theme/Resources/Public/images/icons_sprite.svg')}#icon-bus"></use>
|
<svg class="w-4 h-4 md:w-5 md:h-5">
|
||||||
</svg>
|
<use href="{f:uri.image(src: 'EXT:ep_theme/Resources/Public/images/icons_sprite.svg')}#icon-bus"></use>
|
||||||
</span>
|
</svg>
|
||||||
</f:then>
|
</span>
|
||||||
<f:else>
|
</f:then>
|
||||||
<span class="block"></span>
|
<f:else>
|
||||||
</f:else>
|
<span class="block"></span>
|
||||||
</f:if>
|
</f:else>
|
||||||
<f:if condition="{row.skipassIncluded}">
|
</f:if>
|
||||||
<f:then>
|
<f:if condition="{row.skipassIncluded}">
|
||||||
<span class="block p-1"
|
<f:then>
|
||||||
data-cooltipz-dir="top"
|
<span class="block p-1"
|
||||||
aria-label="{f:if(condition: row.summer, then: 'Bergbahnticket inklusive', else: 'Skipass inklusive')}"
|
data-cooltipz-dir="top"
|
||||||
role="tooltip">
|
aria-label="{f:if(condition: row.summer, then: 'Bergbahnticket inklusive', else: 'Skipass inklusive')}"
|
||||||
<svg class="w-4 h-4 md:w-5 md:h-5">
|
role="tooltip">
|
||||||
<use href="{f:uri.image(src: 'EXT:ep_theme/Resources/Public/images/icons_sprite.svg')}#icon-tag"></use>
|
<svg class="w-4 h-4 md:w-5 md:h-5">
|
||||||
</svg>
|
<use href="{f:uri.image(src: 'EXT:ep_theme/Resources/Public/images/icons_sprite.svg')}#icon-tag"></use>
|
||||||
</span>
|
</svg>
|
||||||
</f:then>
|
</span>
|
||||||
<f:else>
|
</f:then>
|
||||||
<span class="block"></span>
|
<f:else>
|
||||||
</f:else>
|
<span class="block"></span>
|
||||||
</f:if>
|
</f:else>
|
||||||
|
</f:if>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</td>
|
||||||
</td>
|
</f:if>
|
||||||
<td class="border-r border-zinc-200 px-2 py-1 md:p-2 text-center">
|
<td class="border-r border-zinc-200 px-2 py-1 md:p-2 text-center">
|
||||||
<f:if condition="{row.hasOptionalServices} && {row.available}">
|
<f:if condition="{row.hasOptionalServices} && {row.available}">
|
||||||
<button type="button"
|
<button type="button"
|
||||||
|
|||||||
Reference in New Issue
Block a user