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>
|
||||||
|
<f:if condition="{hasIncludedServices}">
|
||||||
<th class="text-left">
|
<th class="text-left">
|
||||||
inkl.
|
inkl.
|
||||||
</th>
|
</th>
|
||||||
|
</f:if>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th class="hidden lg:table-cell"></th>
|
<th class="hidden lg:table-cell"></th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -58,6 +60,7 @@
|
|||||||
</f:else>
|
</f:else>
|
||||||
</f:if>
|
</f:if>
|
||||||
</td>
|
</td>
|
||||||
|
<f:if condition="{hasIncludedServices}">
|
||||||
<td class="px-2 py-1 border border-zinc-200">
|
<td class="px-2 py-1 border border-zinc-200">
|
||||||
<f:if condition="{row.busIncluded}">
|
<f:if condition="{row.busIncluded}">
|
||||||
<span data-cooltipz-dir="top"
|
<span data-cooltipz-dir="top"
|
||||||
@@ -77,6 +80,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</f:if>
|
</f:if>
|
||||||
</td>
|
</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"
|
||||||
|
|||||||
@@ -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>
|
||||||
|
<f:if condition="{hasIncludedServices}">
|
||||||
<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">
|
||||||
inklusive
|
inklusive
|
||||||
</th>
|
</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,6 +78,7 @@
|
|||||||
{row.nights}
|
{row.nights}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
|
<f:if condition="{hasIncludedServices}">
|
||||||
<td class="border-r border-zinc-200 px-2 p-1">
|
<td class="border-r border-zinc-200 px-2 p-1">
|
||||||
<div class="flex flex-wrap items-center">
|
<div class="flex flex-wrap items-center">
|
||||||
<div class="grid grid-cols-2">
|
<div class="grid grid-cols-2">
|
||||||
@@ -124,6 +127,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</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.pseudoPrice}">
|
<f:if condition="{row.pseudoPrice}">
|
||||||
<span class="block text-sm line-through">
|
<span class="block text-sm line-through">
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
<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>
|
||||||
|
<f:if condition="{hasIncludedServices}">
|
||||||
<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">
|
||||||
<span class="lg:hidden">
|
<span class="lg:hidden">
|
||||||
inkl.
|
inkl.
|
||||||
@@ -36,6 +37,7 @@
|
|||||||
inklusive
|
inklusive
|
||||||
</span>
|
</span>
|
||||||
</th>
|
</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,6 +73,7 @@
|
|||||||
</f:else>
|
</f:else>
|
||||||
</f:if>
|
</f:if>
|
||||||
</td>
|
</td>
|
||||||
|
<f:if condition="{hasIncludedServices}">
|
||||||
<td class="border-r border-zinc-200 px-2 py-1 md:p-2">
|
<td class="border-r border-zinc-200 px-2 py-1 md:p-2">
|
||||||
<div class="flex items-center justify-around space-x-1">
|
<div class="flex items-center justify-around space-x-1">
|
||||||
<div class="grid grid-cols-2">
|
<div class="grid grid-cols-2">
|
||||||
@@ -110,6 +113,7 @@
|
|||||||
</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