Add modal for inlcuded services

This commit is contained in:
Björn Fromme
2018-10-01 17:14:24 +02:00
parent 56eac1eb7e
commit 6937465012
5 changed files with 42 additions and 6 deletions
@@ -138,8 +138,8 @@ class ContingentRepository extends AbstractRepository implements ProviderInterfa
$qb
->select('c.room_code as code', 'c.room_label as label', 'c.available as available', 'c.min_price as price',
'c.hotel_bus_pro_id as hotelBusProId',
'd.bus_pro_id as busProId', 'd.services_included as servicesIncluded')
'c.hotel_bus_pro_id as hotelBusProId', 'd.bus_pro_id as busProId',
'd.services_included as servicesIncluded', 'd.skipass_included as skipassIncluded')
->from('tx_epproducts_domain_model_contingent', 'c')
->innerJoin('c', 'tx_epproducts_domain_model_daytrip', 'd', 'c.date = d.date AND c.hotel_code = d.hotel_code')
->where('c.hotel = :hotelUid')
@@ -69,6 +69,8 @@ class ContingentDataService
'dateEnd' => $dateTo->format('Y-m-d'),
]);
$row['servicesIncluded'] = unserialize($row['servicesIncluded']);
$rooms[] = $row;
}
@@ -316,6 +316,7 @@ class DateImportService implements SingletonInterface
static $datesAdded = [];
$skiPass = $this->parseSelectionGroup($xmlDate, 'Leistungen Skipass');
$skiPassIncluded = (int) (count($skiPass) > 0);
$servicesBoard = $this->parseSelectionGroup($xmlDate, 'Leistungen Verpflegung');
$servicesIncluded = $this->parseSelectionGroup($xmlDate, 'Leistungen Sonstige');
@@ -342,6 +343,7 @@ class DateImportService implements SingletonInterface
'hotel_bus_pro_id' => (int) $xmlHotel->attributes()['idbuspro'],
'hotel_code' => $hotelCode,
'services_included' => $servicesCombined,
'skipass_included' => $skiPassIncluded,
]
);
}
@@ -1002,6 +1002,7 @@ CREATE TABLE tx_epproducts_domain_model_daytrip (
hotel_bus_pro_id varchar(64) DEFAULT '' NOT NULL,
hotel_code varchar(64) DEFAULT '' NOT NULL,
services_included TEXT NOT NULL,
skipass_included tinyint(4) unsigned DEFAULT '0' NOT NULL,
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
@@ -17,15 +17,44 @@
<tr>
<th>Zimmerart</th>
<th>Preis</th>
<th>inkl.</th>
<th></th>
</tr>
</thead>
<tbody>
<tr v-for="entry of availableRooms">
<td>{{entry.label}}</td>
<td style="white-space: nowrap">ab {{entry.price * selectedNumberOfDays}} &euro;</td>
<tr v-for="(row, index) of availableRooms">
<td>{{ row.label }}</td>
<td style="white-space: nowrap">ab {{ row.price * selectedNumberOfDays }} &euro;</td>
<td>
<a :href="entry.bookingUrl" target="_blank"
<i v-if="row.skipassIncluded" data-placement="top" title="Skipass inklusive" class="fa fa-tag tooltiptoggle"></i>
<a href="#" data-toggle="modal"
:data-target="'#services' + index"><i class="fa fa-info-circle"></i></a>
<div class="modal fade" :id="'services' + index" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button button--small" class="close" data-dismiss="modal">
<span>&times;</span>
</button>
<h5 class="modal-title">Inklusivleistungen</h5>
</div>
<div class="modal-body">
<div class="table-responsive">
<table class="table table-striped">
<tbody>
<tr v-for="service of row.servicesIncluded">
<td><span class="glyphicon glyphicon-ok" aria-hidden="true"></span> {{ service }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</td>
<td>
<a :href="row.bookingUrl" target="_blank"
class="button button--small button--action">Buchen</a>
</td>
</tr>
@@ -41,6 +70,7 @@
<script>
import $ from 'jquery'
import Vue from 'vue'
import EventBus from '../_bus'
import flatpickr from 'flatpickr'
import { German } from 'flatpickr/dist/l10n/de'
import dayjs from 'dayjs'
@@ -164,6 +194,7 @@
$.post(this.roomsEndpointUri, query, (json) => {
this.loading = false;
this.availableRooms = json;
EventBus.$emit('ajaxContentLoaded');
}, 'json');
}
},