feat: show documents link only when applicable
This commit is contained in:
@@ -19,7 +19,7 @@ class Booking
|
|||||||
public ?Travel $travelData = null;
|
public ?Travel $travelData = null;
|
||||||
public ?int $hotelId = null;
|
public ?int $hotelId = null;
|
||||||
public ?string $hotelName = null;
|
public ?string $hotelName = null;
|
||||||
public ?bool $document = null;
|
public bool $hasDocuments = false;
|
||||||
public ?float $payment = null;
|
public ?float $payment = null;
|
||||||
public ?string $paymentId = null;
|
public ?string $paymentId = null;
|
||||||
public ?string $paymentType = null;
|
public ?string $paymentType = null;
|
||||||
|
|||||||
@@ -31,10 +31,12 @@ class BookingsParser extends AbstractParser
|
|||||||
$booking->travelId = $this->getIntOrNullValue($node->filterXPath('//idreise'));
|
$booking->travelId = $this->getIntOrNullValue($node->filterXPath('//idreise'));
|
||||||
$booking->travelDate = $this
|
$booking->travelDate = $this
|
||||||
->stringToDate($this->getStringOrNullValue($node->filterXPath('//reisedatum')));
|
->stringToDate($this->getStringOrNullValue($node->filterXPath('//reisedatum')));
|
||||||
$booking->document = $this
|
$booking->hasDocuments = $this
|
||||||
->stringToBool($this->getStringOrNullValue($node->filterXPath('//reisedokument')));
|
->stringToBool($this->getStringOrNullValue($node->filterXPath('//reisedokument')));
|
||||||
$booking->payment = $this
|
$booking->payment = $this
|
||||||
->stringToFloat($this->getStringOrNullValue($node->filterXPath('//zahlung')));
|
->stringToFloat($this->getStringOrNullValue($node->filterXPath('//zahlung')));
|
||||||
|
$booking->hasDocuments = $this
|
||||||
|
->stringToBool($this->getStringOrNullValue($node->filterXPath('//reisedokument')));
|
||||||
|
|
||||||
$bookings[] = $booking;
|
$bookings[] = $booking;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<h2 class="text-2xl font-semibold pb-4">
|
<h2 class="text-2xl font-semibold pb-4">
|
||||||
Meine Buchungen
|
Meine Buchungen
|
||||||
</h2>
|
</h2>
|
||||||
|
{% include '_partials/_flashes.html.twig' %}
|
||||||
<table class="w-full mb-4 responsive">
|
<table class="w-full mb-4 responsive">
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="bg-zinc-200">
|
<tr class="bg-zinc-200">
|
||||||
@@ -70,13 +71,17 @@
|
|||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="{{ path('app_booking_confirmation', { 'id': booking.id }) }}"
|
<a href="{{ path('app_booking_confirmation', { 'id': booking.id }) }}"
|
||||||
class="button bg-button button--small">
|
class="button bg-button button--small"
|
||||||
|
target="_blank">
|
||||||
Bestätigung
|
Bestätigung
|
||||||
</a>
|
</a>
|
||||||
<a href="{{ path('app_booking_documents', { 'id': booking.id }) }}"
|
{% if booking.hasDocuments %}
|
||||||
class="button bg-button button--small">
|
<a href="{{ path('app_booking_documents', { 'id': booking.id }) }}"
|
||||||
Reisedokumente
|
class="button bg-button button--small"
|
||||||
</a>
|
target="_blank">
|
||||||
|
Reisedokumente
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user