Fix services not being listed in full

This commit is contained in:
Björn Fromme
2018-08-01 15:28:06 +02:00
parent 94150f12cd
commit e4f45b646e
4 changed files with 18 additions and 12 deletions
@@ -67,7 +67,7 @@ class Date
/**
* @var array
*/
public $services = [];
public $servicesoptional = [];
/**
* @var array
@@ -99,10 +99,13 @@ class Date
$date->skipassincluded = $array['dateSkipassIncluded'];
$date->busincluded = $array['dateBusIncluded'];
$date->servicesincluded['service'] = unserialize($array['dateServicesIncluded']);
foreach (unserialize($array['dateServicesGeneral']) as $row)
$servicesGeneral = unserialize($array['dateServicesGeneral']);
foreach ($servicesGeneral as $category)
{
$date->services['service'][] = Service::fromArray($row);
foreach ($category as $row)
{
$date->servicesoptional['service'][] = Service::fromArray($row);
}
}
foreach (unserialize($array['pickups']) as $row)
@@ -47,7 +47,7 @@ class Room
/**
* @var array
*/
public $services;
public $servicesoptional;
/**
* @var string
@@ -73,9 +73,13 @@ class Room
$room->nights = $array['roomNights'];
$room->available = $array['roomAvailable'];
foreach (unserialize($array['roomOptionalServices']) as $row)
$servicesOptional = unserialize($array['roomOptionalServices']);
foreach ($servicesOptional as $category)
{
$room->services['service'][] = Service::fromArray($row);
foreach ($category as $row)
{
$room->servicesoptional['service'][] = Service::fromArray($row);
}
}
return $room;
@@ -47,9 +47,8 @@ class Service
{
$service = new self;
$data = reset($array);
$service->label = $data['label'];
$service->price = $data['price'];
$service->label = $array['label'];
$service->price = $array['price'];
return $service;
}
@@ -24,7 +24,7 @@
<f:render section="CollapsibleSimple" arguments="{id: 8, label: 'Verpflegung', description: productData.board}"/>
<f:render section="CollapsibleSimple" arguments="{id: 9, label: 'Programm', description: productData.programme}"/>
<f:for each="{productData.hotels.hotel}" as="hotel" iteration="iteration">
<f:render section="CollapsibleHotel" arguments="{id: '10-{iteration.cycle}', label: 'Unterkunft{f:if(condition: \'{productData.hotels.hotel -> f:count()} > 1\', then: \' {iteration.cycle}\')} (Termine, Zimmer, Leistungen, Bilder)', hotel: hotel}"/>
<f:render section="CollapsibleHotel" arguments="{id: '10-{iteration.cycle}', label: 'Unterkunft{f:if(condition: \'{productData.hotels.hotel -> f:count()} > 1\', then: \' {iteration.cycle}\')} (Termine, Zimmer, Leistungen, Anreise, Bilder)', hotel: hotel}"/>
</f:for>
<f:render section="CollapsibleImages" arguments="{id: 11, label: 'Allgemeine Bilder/Video', images: productData.images.image, video: productData.video}"/>
</div>
@@ -161,7 +161,7 @@
<th>Zusatzleistungen</th>
<td>
<table class="table table-condesed">
<f:for each="{date.services.service}" as="service">
<f:for each="{date.servicesoptional.service}" as="service">
<tr>
<td>{service.label}</td>
<td>{service.price} €</td>