Rabatt export, optimize
This commit is contained in:
parent
54fc46ace4
commit
f2be8e54b4
23 changed files with 552 additions and 34 deletions
|
|
@ -147,9 +147,11 @@
|
||||||
|
|
||||||
{% if site_loading is defined and page is defined %}
|
{% if site_loading is defined and page is defined %}
|
||||||
{{ render(controller('AppBundle:Component:makeSidebarWidget', {'site_loading': site_loading, 'page': page})) }}
|
{{ render(controller('AppBundle:Component:makeSidebarWidget', {'site_loading': site_loading, 'page': page})) }}
|
||||||
|
{% elseif site_loading is defined and api is defined %}
|
||||||
|
{{ render(controller('AppBundle:Component:makeSidebarWidget', {'site_loading': site_loading, 'page': null, 'api': api})) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if site_loading is defined %}
|
{% if site_loading is defined and search_form is defined %}
|
||||||
{{ render(controller('AppBundle:Component:makeSidebarWidget', {'site_loading': site_loading, 'page': null, 'search_form': search_form})) }}
|
{{ render(controller('AppBundle:Component:makeSidebarWidget', {'site_loading': site_loading, 'page': null, 'api': null, 'search_form': search_form})) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ render(controller('AppBundle:Component:makeSidebarWidget', {'site_loading': 'default'})) }}
|
{{ render(controller('AppBundle:Component:makeSidebarWidget', {'site_loading': 'default'})) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
<style>
|
||||||
|
.modal-content .wrapper-nav-tabs {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<div class="modal fade" tabindex="-1" role="dialog" id="st-{{ id }}-modal">
|
<div class="modal fade" tabindex="-1" role="dialog" id="st-{{ id }}-modal">
|
||||||
<div class="modal-dialog modal-lg" role="document">
|
<div class="modal-dialog modal-lg" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
{% if api.navi is defined %}
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#sidebar #side-navigation .side-menu li.lvl_deep_1 {
|
||||||
|
padding-left: 10px!important;
|
||||||
|
}
|
||||||
|
#sidebar #side-navigation .side-menu li.lvl_deep_2 {
|
||||||
|
padding-left: 30px!important;
|
||||||
|
}
|
||||||
|
#sidebar #side-navigation .side-menu li.lvl_deep_3 {
|
||||||
|
padding-left: 50px!important;
|
||||||
|
}
|
||||||
|
#sidebar #side-navigation .side-menu li.lvl_deep_4 {
|
||||||
|
padding-left: 70px!important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="widget clearfix">
|
||||||
|
<div class="widget-title">
|
||||||
|
<a class="collapse-widget" href="#side-navigation" data-toggle="collapse">{{ title }}</a>
|
||||||
|
</div><!-- end title -->
|
||||||
|
|
||||||
|
<nav id="side-navigation" class="navbar collapse in" role="navigation" itemscope
|
||||||
|
itemtype="https://schema.org/SiteNavigationElement"
|
||||||
|
>
|
||||||
|
<ul class="side-menu" role="menu">
|
||||||
|
|
||||||
|
{% for nav in api.navi %}
|
||||||
|
|
||||||
|
|
||||||
|
{% if nav.lvl == 0 %}
|
||||||
|
<li {% if nav.active == 1 %} class ="active"{% endif %} role="menuitem" itemprop="name">
|
||||||
|
<a itemprop="url" href="{{ nav.url }}" title="{{ nav.name }}">
|
||||||
|
{{ nav.name }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% else %}
|
||||||
|
<li class="sub-menu-item{% if nav.active == 1 %} active{% endif %} lvl_deep_{{ nav.lvl }}" role="menuitem" itemprop="name">
|
||||||
|
|
||||||
|
<i class="fa fa-star"></i>
|
||||||
|
<a itemprop="url" href="{{ nav.url }}" title="{{ nav.name }}">
|
||||||
|
{{ nav.name }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{#
|
||||||
|
{% if nav.children is defined %}
|
||||||
|
{% for child in nav.children %}
|
||||||
|
<li class="sub-menu-item{% if child.active == 1 %} active{% endif %}" role="menuitem" itemprop="name">
|
||||||
|
<i class="fa fa-star"></i>
|
||||||
|
<a itemprop="url" href="{{ child.url }}" title="{{ child.name }}">
|
||||||
|
{{ child.name }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
#}
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
@ -2,3 +2,7 @@
|
||||||
{% if page is not empty %}
|
{% if page is not empty %}
|
||||||
{{ render(controller('AppBundle:Component:navSidebarWidget', {page: page, title:widget.name})) }}
|
{{ render(controller('AppBundle:Component:navSidebarWidget', {page: page, title:widget.name})) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if api is not empty %}
|
||||||
|
{{ render(controller('AppBundle:Component:navSidebarApiWidget', {api: api, title:widget.name})) }}
|
||||||
|
{% endif %}
|
||||||
|
|
@ -7,9 +7,11 @@
|
||||||
{{ include('default/components/sidebar/ttSearchSidebarWidget.html.twig') }}
|
{{ include('default/components/sidebar/ttSearchSidebarWidget.html.twig') }}
|
||||||
{# END WORKAROUND #}
|
{# END WORKAROUND #}
|
||||||
|
|
||||||
{% elseif page is not empty %}
|
{% elseif page is defined and page is not empty %}
|
||||||
{# #HACK Dont display the search in FEWO #}
|
{# #HACK Dont display the search in FEWO #}
|
||||||
{% if page.title != 'Ferienwohnungen' %}
|
{% if page.title != 'Ferienwohnungen' %}
|
||||||
{{ render(controller('AppBundle:Component:searchSidebarWidget', {page: page, title:widget.name})) }}
|
{{ render(controller('AppBundle:Component:searchSidebarWidget', {page:page, title:widget.name})) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% elseif api is defined and api is not empty %}
|
||||||
|
{{ render(controller('AppBundle:Component:searchSidebarApiWidget', {api:api, title:widget.name})) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
{# @var booking_request \AppBundle\Entity\BookingRequest #}
|
{# @var booking_request \AppBundle\Entity\BookingRequest #}
|
||||||
Sehr geehrte{{ booking_request.salutation == 1 ? 'r Herr' : ' Frau' }} {{ booking_request.lastName }},
|
Sehr geehrte{{ booking_request.salutation == 1 ? 'r Herr' : ' Frau' }} {{ booking_request.lastName }},
|
||||||
|
|
||||||
vielen Dank für Ihre Online-Buchung . Dieser wird schnellstmöglich bearbeitet und stellt noch keine{#
|
vielen Dank für Ihren verbindlichen Buchungsauftrag. Dieser wird schnellstmöglich bearbeitet und stellt noch keine{#
|
||||||
#} Mietbestätigung dar. Bitte prüfen Sie noch einmal Ihre Angaben und kontaktieren Sie uns bitte, wenn ein Fehler{#
|
#} Reisebestätigung dar. Bitte prüfen Sie noch einmal Ihre Angaben und kontaktieren Sie uns bitte, wenn ein Fehler{#
|
||||||
#} enthalten ist.
|
#} enthalten ist.
|
||||||
|
|
||||||
{% include 'default/email/components/bookingSummary.txt.twig' %}
|
{% include 'default/email/components/bookingSummary.txt.twig' %}
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ Nr., Zimmertyp, Geschlecht, Vorname, Nachname, Geburtsdatum
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
=====================================================================================
|
=====================================================================================
|
||||||
Mitteilungen / Sonstiges:
|
Unverbindliche Anmerkungen:
|
||||||
=====================================================================================
|
=====================================================================================
|
||||||
{{ booking_request.notes ?? '-' }}
|
{{ booking_request.notes ?? '-' }}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ Erwachsene: {{ fewo_booking_request.travelerCountAdult }}
|
||||||
Kinder: {{ fewo_booking_request.travelerCountChild }}
|
Kinder: {{ fewo_booking_request.travelerCountChild }}
|
||||||
Gesamt: {{ fewo_booking_request.travelerCount }}
|
Gesamt: {{ fewo_booking_request.travelerCount }}
|
||||||
=======================================================
|
=======================================================
|
||||||
Mitteilungen / Sonstiges:
|
Unverbindliche Anmerkungen:
|
||||||
{{ fewo_booking_request.notes ?? '-' }}
|
{{ fewo_booking_request.notes ?? '-' }}
|
||||||
|
|
||||||
=======================================================
|
=======================================================
|
||||||
|
|
|
||||||
|
|
@ -219,15 +219,20 @@
|
||||||
{% if extraDays == 1 and travel_program.drafts.count() > 0 %}
|
{% if extraDays == 1 and travel_program.drafts.count() > 0 %}
|
||||||
<tr>
|
<tr>
|
||||||
{% else %}
|
{% else %}
|
||||||
<tr style="display:none">
|
<tr style="display:none;">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<td>Verlängerung buchen</td>
|
<td>Verlängerung buchen</td>
|
||||||
<td>
|
<td>
|
||||||
<p>{{ getContextBySlug('verlaengerung-vor') }}</p>
|
{% for country in travel_program.countries %}
|
||||||
|
<p>{{ country.textBefore }}</p>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
{{ form_widget(form.extraBookingDaysBefore) }}
|
{{ form_widget(form.extraBookingDaysBefore) }}
|
||||||
{{ form_errors(form.extraBookingDaysBefore) }}
|
{{ form_errors(form.extraBookingDaysBefore) }}
|
||||||
<br>
|
<br>
|
||||||
<p>{{ getContextBySlug('verlaengerung-nach') }}</p>
|
{% for country in travel_program.countries %}
|
||||||
|
<p>{{ country.textAfter }}</p>
|
||||||
|
{% endfor %}
|
||||||
{{ form_widget(form.extraBookingDaysAfter) }}
|
{{ form_widget(form.extraBookingDaysAfter) }}
|
||||||
{{ form_errors(form.extraBookingDaysAfter) }}
|
{{ form_errors(form.extraBookingDaysAfter) }}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -356,7 +356,7 @@
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
<div class="">
|
<div class="">
|
||||||
<div class="col-md-12 col-sm-12 col-xs-12">
|
<div class="col-md-12 col-sm-12 col-xs-12">
|
||||||
<h5>Mitteilungen / Sonstiges (optional)</h5>
|
<h5>Unverbindliche Anmerkungen</h5>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12 col-sm-12 col-xs-12">
|
<div class="col-md-12 col-sm-12 col-xs-12">
|
||||||
<p>{{ booking.comments }}</p>
|
<p>{{ booking.comments }}</p>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,96 @@
|
||||||
|
{% extends get_base_template() %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<section class="clearfix">
|
||||||
|
{% if(api is defined) %}
|
||||||
|
|
||||||
|
{% if api.sites|length > 1 %}
|
||||||
|
<div class="wrapper-nav-tabs">
|
||||||
|
<ul class="nav nav-tabs nav-justified list-nav-tabs">
|
||||||
|
{% for site in api.sites %}
|
||||||
|
<li class="{% if loop.index==1 %} active {% endif %}">
|
||||||
|
<a href="#travel_guide_content_{{ site.id }}" aria-controls="travel_guide_content_{{ site.id }}" role="tab" data-toggle="tab">
|
||||||
|
{% if(site.scope == 0) %}
|
||||||
|
Zusammenfassung <i class="hidden-xs">für eilige Leser</i>
|
||||||
|
{% else %}
|
||||||
|
Ausführliche Darstellung <i class="hidden-xs">für Interessierte</i>
|
||||||
|
{% endif %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tab-content">
|
||||||
|
{% for site in api.sites %}
|
||||||
|
<div role="tabpanel" class="tab-pane {% if loop.index==1 %} active {% endif %}" id="travel_guide_content_{{ site.id }}">
|
||||||
|
<h1>{{ site.name }}</h1>
|
||||||
|
{{ site.full_text|raw|keywords|lozad }}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="wrapper-nav-tabs">
|
||||||
|
<ul class="nav nav-tabs nav-justified list-nav-tabs">
|
||||||
|
{% for site in api.sites %}
|
||||||
|
<li class="{% if loop.index==1 %} active {% endif %}">
|
||||||
|
<a href="#travel_guide_content_{{ site.id }}" aria-controls="travel_guide_content_{{ site.id }}" role="tab" data-toggle="tab">
|
||||||
|
{% if(site.scope == 0) %}
|
||||||
|
Zusammenfassung <i class="hidden-xs">für eilige Leser</i>
|
||||||
|
{% else %}
|
||||||
|
Ausführliche Darstellung <i class="hidden-xs">für Interessierte</i>
|
||||||
|
{% endif %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
{% for site in api.sites %}
|
||||||
|
<h1>{{ site.name }}</h1>
|
||||||
|
{{ site.full_text|raw|keywords|lozad }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</section>
|
||||||
|
<hr>
|
||||||
|
{% if(api is defined and api.children is defined and api.children is not empty) %}
|
||||||
|
<section class="clearfix">
|
||||||
|
<h2></h2>
|
||||||
|
<div class="row">
|
||||||
|
{% for child_page in api.children %}
|
||||||
|
{% if(child_page.active) %}
|
||||||
|
<div class="col-md-4 col-sm-6">
|
||||||
|
<div class="travel-wrapper get-box-link">
|
||||||
|
<div class="item text-left">
|
||||||
|
{% if(false and child_page.box_image_url is defined and child_page.box_image_url is not empty) %}
|
||||||
|
<div class="item-img" style="height: 220px;">
|
||||||
|
{% if child_page.box_image_url is defined and child_page.box_image_url is not empty %}
|
||||||
|
{% set image_url = child_page.box_image_url %}
|
||||||
|
{% set image_alt = child_page.name %}
|
||||||
|
{% else %}
|
||||||
|
{% set image_url = asset('/bundles/app/images/no-picture.png')%}
|
||||||
|
{% set image_alt = 'Kein Vorschaubild vorhanden' %}
|
||||||
|
{% endif %}
|
||||||
|
<div class="img-background lozad" data-background-image="{{ image(image_url|trim('/')).cropResize(960).guess(90) }}" style="background-image:url({{ asset('images/placeholder-image.png') }}); height: 220px;"></div>
|
||||||
|
<noscript>
|
||||||
|
<img width="234" height="180" src="{{ image(image_url|trim('/')).cropResize(960).guess(90) }}" class="img-responsiv img-responsiv-item" style="">
|
||||||
|
</noscript>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<div class="box_mid">
|
||||||
|
<div class="hl5">{{ child_page.name }}</div>
|
||||||
|
<p>{{ child_page.description }}</p>
|
||||||
|
</div>
|
||||||
|
<a class="item-button is-box-link dobble_line" href="{{ child_page.url }}" title="{{ child_page.name }}">
|
||||||
|
<span>{{ child_page.name }}</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
@ -213,7 +213,7 @@
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
<div class="">
|
<div class="">
|
||||||
<div class="col-md-12 col-sm-12 col-xs-12">
|
<div class="col-md-12 col-sm-12 col-xs-12">
|
||||||
<h5>Mitteilungen / Sonstiges (optional)</h5>
|
<h5>Unverbindliche Anmerkungen</h5>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12 col-sm-12 col-xs-12">
|
<div class="col-md-12 col-sm-12 col-xs-12">
|
||||||
{{ form_field(form.notes, 'Mitteilungen / Sonstiges (optional)', {
|
{{ form_field(form.notes, 'Mitteilungen / Sonstiges (optional)', {
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@
|
||||||
<div class="form-box">
|
<div class="form-box">
|
||||||
<div class="">
|
<div class="">
|
||||||
<div class="col-md-12 col-sm-12 col-xs-12">
|
<div class="col-md-12 col-sm-12 col-xs-12">
|
||||||
<h5>Mitteilungen / Sonstiges (optional)</h5>
|
<h5>Unverbindliche Anmerkungen</h5>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12 col-sm-12 col-xs-12">
|
<div class="col-md-12 col-sm-12 col-xs-12">
|
||||||
<p>{{ fewo_booking_request.notes }}</p>
|
<p>{{ fewo_booking_request.notes }}</p>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,94 @@
|
||||||
|
{% extends get_base_template() %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<section class="clearfix">
|
||||||
|
{% if(api is defined) %}
|
||||||
|
|
||||||
|
{% if api.sites|length > 1 %}
|
||||||
|
<div class="wrapper-nav-tabs">
|
||||||
|
<ul class="nav nav-tabs nav-justified list-nav-tabs">
|
||||||
|
{% for site in api.sites %}
|
||||||
|
<li class="">
|
||||||
|
<a href="#travel_guide_content_{{ site.id }}" aria-controls="travel_guide_content_{{ site.id }}" role="tab" data-toggle="tab">
|
||||||
|
{% if(site.scope == 0) %}
|
||||||
|
Kurzer Inhalt
|
||||||
|
{% else %}
|
||||||
|
Langer Inhalt
|
||||||
|
{% endif %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tab-content">
|
||||||
|
{% for site in api.sites %}
|
||||||
|
<div role="tabpanel" class="tab-pane active" id="travel_guide_content_{{ site.id }}">
|
||||||
|
{{ site.full_text|raw|keywords|lozad }}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="wrapper-nav-tabs">
|
||||||
|
<ul class="nav nav-tabs nav-justified list-nav-tabs">
|
||||||
|
{% for site in api.sites %}
|
||||||
|
<li class="">
|
||||||
|
<a href="#travel_guide_content_{{ site.id }}" aria-controls="travel_guide_content_{{ site.id }}" role="tab" data-toggle="tab">
|
||||||
|
{% if(site.scope == 0) %}
|
||||||
|
Kurzer Inhalt
|
||||||
|
{% else %}
|
||||||
|
Langer Inhalt
|
||||||
|
{% endif %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
{% for site in api.sites %}
|
||||||
|
{{ site.full_text|raw|keywords|lozad }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</section>
|
||||||
|
<hr>
|
||||||
|
{% if(api is defined and api.children is defined and api.children is not empty) %}
|
||||||
|
<section class="clearfix">
|
||||||
|
<h2></h2>
|
||||||
|
<div class="row">
|
||||||
|
{% for child_page in api.children %}
|
||||||
|
{% if(child_page.active) %}
|
||||||
|
<div class="col-md-4 col-sm-6">
|
||||||
|
<div class="travel-wrapper get-box-link">
|
||||||
|
<div class="item text-left">
|
||||||
|
{% if(false and child_page.box_image_url is defined and child_page.box_image_url is not empty) %}
|
||||||
|
<div class="item-img" style="height: 220px;">
|
||||||
|
{% if child_page.box_image_url is defined and child_page.box_image_url is not empty %}
|
||||||
|
{% set image_url = child_page.box_image_url %}
|
||||||
|
{% set image_alt = child_page.name %}
|
||||||
|
{% else %}
|
||||||
|
{% set image_url = asset('/bundles/app/images/no-picture.png')%}
|
||||||
|
{% set image_alt = 'Kein Vorschaubild vorhanden' %}
|
||||||
|
{% endif %}
|
||||||
|
<div class="img-background lozad" data-background-image="{{ image(image_url|trim('/')).cropResize(960).guess(90) }}" style="background-image:url({{ asset('images/placeholder-image.png') }}); height: 220px;"></div>
|
||||||
|
<noscript>
|
||||||
|
<img width="234" height="180" src="{{ image(image_url|trim('/')).cropResize(960).guess(90) }}" class="img-responsiv img-responsiv-item" style="">
|
||||||
|
</noscript>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<div class="box_mid">
|
||||||
|
<div class="hl5">{{ child_page.name }}</div>
|
||||||
|
<p>{{ child_page.description }}</p>
|
||||||
|
</div>
|
||||||
|
<a class="item-button is-box-link dobble_line" href="{{ child_page.url }}" title="{{ child_page.name }}">
|
||||||
|
<span>{{ child_page.name }}</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
@ -145,6 +145,7 @@ class BookingController extends Controller
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
$bookingRequest = $form->getData();
|
$bookingRequest = $form->getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
$htmlSummary = [];
|
$htmlSummary = [];
|
||||||
$bookingPriceInfo = [];
|
$bookingPriceInfo = [];
|
||||||
$totalPrice = $this->calculatePrice($travelDate, $bookingRequest, $travelProgram->getCategory()->getId(), $travelProgram->getDepositPercent(), $htmlSummary, $bookingPriceInfo);
|
$totalPrice = $this->calculatePrice($travelDate, $bookingRequest, $travelProgram->getCategory()->getId(), $travelProgram->getDepositPercent(), $htmlSummary, $bookingPriceInfo);
|
||||||
|
|
@ -171,7 +172,6 @@ class BookingController extends Controller
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
$crmBookingUrl = $this->get('app.booking_exporter')->process($bookingRequest, $travelDate, $bookingPriceInfo);
|
$crmBookingUrl = $this->get('app.booking_exporter')->process($bookingRequest, $travelDate, $bookingPriceInfo);
|
||||||
|
|
||||||
if (!$crmBookingUrl)
|
if (!$crmBookingUrl)
|
||||||
{
|
{
|
||||||
$crmBookingUrl = '[CRM-EXPORT FEHLGESCHLAGEN]';
|
$crmBookingUrl = '[CRM-EXPORT FEHLGESCHLAGEN]';
|
||||||
|
|
@ -199,6 +199,7 @@ class BookingController extends Controller
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
$this->get('mailer')->send(\Swift_Message::newInstance()
|
$this->get('mailer')->send(\Swift_Message::newInstance()
|
||||||
->setSubject('BUCHUNG: '. $travelProgram->getTitle() .'('. $travelDate->getName() .')')
|
->setSubject('BUCHUNG: '. $travelProgram->getTitle() .'('. $travelDate->getName() .')')
|
||||||
->setFrom('stern@stern-tours.de', 'STERN TOURS')
|
->setFrom('stern@stern-tours.de', 'STERN TOURS')
|
||||||
|
|
@ -221,7 +222,6 @@ class BookingController extends Controller
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// #TODO This will lead to multiple bookings due to multiple form submission. Redirect instead!
|
// #TODO This will lead to multiple bookings due to multiple form submission. Redirect instead!
|
||||||
return $this->render('default/pages/bookingConfirmation.html.twig', [
|
return $this->render('default/pages/bookingConfirmation.html.twig', [
|
||||||
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
|
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
|
||||||
|
|
@ -276,6 +276,7 @@ class BookingController extends Controller
|
||||||
|
|
||||||
elseif ($action == '/berechne-gesamtpreis')
|
elseif ($action == '/berechne-gesamtpreis')
|
||||||
{
|
{
|
||||||
|
|
||||||
return $this->render('default/components/booking/summary.html.twig', [
|
return $this->render('default/components/booking/summary.html.twig', [
|
||||||
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
|
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
|
||||||
'summary' => $htmlSummary,
|
'summary' => $htmlSummary,
|
||||||
|
|
@ -536,7 +537,7 @@ class BookingController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$tempExtraDaysAfterHTML = array();
|
$tempExtraDaysAfterHTML = array();
|
||||||
//days before
|
//days after
|
||||||
if($bookingRequest->getExtraBookingDaysAfter()){
|
if($bookingRequest->getExtraBookingDaysAfter()){
|
||||||
|
|
||||||
$newDay = clone $travelDate->getEnd();
|
$newDay = clone $travelDate->getEnd();
|
||||||
|
|
@ -631,6 +632,9 @@ class BookingController extends Controller
|
||||||
'price' => $singleDiscountPrice ?? $singleFullPrice,
|
'price' => $singleDiscountPrice ?? $singleFullPrice,
|
||||||
'price_children' => $singleChildDiscountPrice ?? $childPrice,
|
'price_children' => $singleChildDiscountPrice ?? $childPrice,
|
||||||
'price_total' => $roomPrice + $discount + $childDiscount,
|
'price_total' => $roomPrice + $discount + $childDiscount,
|
||||||
|
'price_full' => $singleFullPrice,
|
||||||
|
'price_children_full' => $childPrice,
|
||||||
|
'price_total_full' => $roomPrice,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -692,6 +696,7 @@ class BookingController extends Controller
|
||||||
}else{
|
}else{
|
||||||
$outPriceInfo['discount'][$key] = array(
|
$outPriceInfo['discount'][$key] = array(
|
||||||
'value' => $discount,
|
'value' => $discount,
|
||||||
|
'price_discount' => ($singleFullPrice - $singleDiscountPrice),
|
||||||
'label_first' => 'Rabatt',
|
'label_first' => 'Rabatt',
|
||||||
'label_last' => Util::formatPrice($singleFullPrice - $singleDiscountPrice) . ' pro Person',
|
'label_last' => Util::formatPrice($singleFullPrice - $singleDiscountPrice) . ' pro Person',
|
||||||
'count' => $adultCount,
|
'count' => $adultCount,
|
||||||
|
|
@ -718,12 +723,15 @@ class BookingController extends Controller
|
||||||
//Versicherung price + html
|
//Versicherung price + html
|
||||||
if ($bookingRequest->getInsurance() && $adultCount > 0)
|
if ($bookingRequest->getInsurance() && $adultCount > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
$curAssessmentBasis = $insuranceAssessmentBasis + ($singleDiscountPrice ?? $singleFullPrice);
|
$curAssessmentBasis = $insuranceAssessmentBasis + ($singleDiscountPrice ?? $singleFullPrice);
|
||||||
$curAssessmentChildBasis = $insuranceAssessmentChildBasis + ($singleChildDiscountPrice ?? $childPrice);
|
$curAssessmentChildBasis = $insuranceAssessmentChildBasis + ($singleChildDiscountPrice ?? $childPrice);
|
||||||
$insurancePrice = $this->getDoctrine()->getRepository('AppBundle:TravelInsurancePrice')
|
$insurancePrice = $this->getDoctrine()->getRepository('AppBundle:TravelInsurancePrice')
|
||||||
->findOneByInsuranceIdAndAssessmentBasis($bookingRequest->getInsurance()->getId(), $curAssessmentBasis);
|
->findOneByInsuranceIdAndAssessmentBasis($bookingRequest->getInsurance()->getId(), $curAssessmentBasis);
|
||||||
|
|
||||||
$insuranceChildPrice = $this->getDoctrine()->getRepository('AppBundle:TravelInsurancePrice')
|
$insuranceChildPrice = $this->getDoctrine()->getRepository('AppBundle:TravelInsurancePrice')
|
||||||
->findOneByInsuranceIdAndAssessmentBasis($bookingRequest->getInsurance()->getId(), $curAssessmentChildBasis);
|
->findOneByInsuranceIdAndAssessmentBasis($bookingRequest->getInsurance()->getId(), $curAssessmentChildBasis);
|
||||||
|
|
||||||
$insurancePriceValue = $insurancePrice->getPrice() > 0 ? $insurancePrice->getPrice() : round($insurancePrice->getPercent() * $curAssessmentBasis / 100, 2);
|
$insurancePriceValue = $insurancePrice->getPrice() > 0 ? $insurancePrice->getPrice() : round($insurancePrice->getPercent() * $curAssessmentBasis / 100, 2);
|
||||||
$insuranceChildPriceValue = $insuranceChildPrice->getPrice() > 0 ? $insuranceChildPrice->getPrice() : round($insuranceChildPrice->getPercent() * $curAssessmentChildBasis / 100, 2);
|
$insuranceChildPriceValue = $insuranceChildPrice->getPrice() > 0 ? $insuranceChildPrice->getPrice() : round($insuranceChildPrice->getPercent() * $curAssessmentChildBasis / 100, 2);
|
||||||
|
|
||||||
|
|
@ -804,8 +812,6 @@ class BookingController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//ROOMS
|
//ROOMS
|
||||||
if(count($tempRoomHTML) > 0){
|
if(count($tempRoomHTML) > 0){
|
||||||
foreach ($tempRoomHTML as $item) {
|
foreach ($tempRoomHTML as $item) {
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ use AppBundle\Entity\FewoPrice;
|
||||||
use AppBundle\Entity\Page;
|
use AppBundle\Entity\Page;
|
||||||
use AppBundle\Entity\SunstarTravelProgram;
|
use AppBundle\Entity\SunstarTravelProgram;
|
||||||
use AppBundle\Entity\FewoLodgingGroup;
|
use AppBundle\Entity\FewoLodgingGroup;
|
||||||
|
use AppBundle\Form\SearchRequestType;
|
||||||
use AppBundle\Form\TtSearchRequestType;
|
use AppBundle\Form\TtSearchRequestType;
|
||||||
use AppBundle\Listener\KernelControllerListener;
|
use AppBundle\Listener\KernelControllerListener;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManager;
|
||||||
|
|
@ -51,6 +52,28 @@ class CmsController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function iqTravelGuideAction($api, $template = 'TravelGuide')
|
||||||
|
{
|
||||||
|
|
||||||
|
/* $travel_guide_content = false;
|
||||||
|
if($page->getTravelGuideContentId() > 0){
|
||||||
|
$repo = $this->getEntityManager()->getRepository('AppBundle:TravelGuides');
|
||||||
|
$travel_guide_content = $repo->findByID($page->getTravelGuideContentId());
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
return $this->render('default/pages/cms/iq'. $template .'.html.twig', [
|
||||||
|
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
|
||||||
|
'site_loading' => 'default',
|
||||||
|
'api' => $api,
|
||||||
|
'breadcrumb_entries' => $api->bread_crumb,
|
||||||
|
// 'search_form' => $this->createForm(SearchRequestType::class)->createView(),
|
||||||
|
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function travelGuideAction(Page $page, $template = 'default')
|
public function travelGuideAction(Page $page, $template = 'default')
|
||||||
{
|
{
|
||||||
if(!empty($page->getTemplate())) {
|
if(!empty($page->getTemplate())) {
|
||||||
|
|
@ -62,7 +85,6 @@ class CmsController extends Controller
|
||||||
$travel_guide_content = $repo->findByID($page->getTravelGuideContentId());
|
$travel_guide_content = $repo->findByID($page->getTravelGuideContentId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return $this->render('default/pages/cms/'. $template .'.html.twig', [
|
return $this->render('default/pages/cms/'. $template .'.html.twig', [
|
||||||
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
|
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR,
|
||||||
'site_loading' => 'default',
|
'site_loading' => 'default',
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,16 @@ class ComponentController extends Controller
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function navSidebarApiWidgetAction($api, $title = 'Reiseführer')
|
||||||
|
{
|
||||||
|
|
||||||
|
return $this->render('default/components/sidebar/navSidebarApiWidgetInner.html.twig', [
|
||||||
|
'api'=>$api,
|
||||||
|
'title' => "Reiseführer",
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
public function navSidebarWidgetAction(Page $page, $title = 'Reiseprogramme')
|
public function navSidebarWidgetAction(Page $page, $title = 'Reiseprogramme')
|
||||||
{
|
{
|
||||||
if(!empty($page->getTitle())){
|
if(!empty($page->getTitle())){
|
||||||
|
|
@ -95,6 +105,26 @@ class ComponentController extends Controller
|
||||||
return $this->render('default/components/sidebar/navSidebarWidgetInner.html.twig', $view);
|
return $this->render('default/components/sidebar/navSidebarWidgetInner.html.twig', $view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function searchSidebarApiWidgetAction($api, $title = 'Suche')
|
||||||
|
{
|
||||||
|
$combinedDestination = null;
|
||||||
|
$destination = null;
|
||||||
|
//todo need Country by name
|
||||||
|
if(isset($api->sites[0]->country_id)){
|
||||||
|
$repo = $this->getEntityManager()->getRepository('AppBundle:TravelCountry');
|
||||||
|
$destination = $repo->find($api->sites[0]->country_id);
|
||||||
|
}
|
||||||
|
return $this->render('default/components/sidebar/searchSidebarWidgetInner.html.twig', [
|
||||||
|
'slider_title' => "suche",
|
||||||
|
'search_form' => $this->createForm(SearchRequestType::class, [
|
||||||
|
'c' =>$destination,
|
||||||
|
'c2' => $combinedDestination,
|
||||||
|
])->createView()
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function searchSidebarWidgetAction(Page $page, $title = 'Suche')
|
public function searchSidebarWidgetAction(Page $page, $title = 'Suche')
|
||||||
{
|
{
|
||||||
$combinedDestination = null;
|
$combinedDestination = null;
|
||||||
|
|
@ -111,6 +141,7 @@ class ComponentController extends Controller
|
||||||
{
|
{
|
||||||
$destination = $page->getCountry();
|
$destination = $page->getCountry();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('default/components/sidebar/searchSidebarWidgetInner.html.twig', [
|
return $this->render('default/components/sidebar/searchSidebarWidgetInner.html.twig', [
|
||||||
'slider_title' => "suche",
|
'slider_title' => "suche",
|
||||||
'search_form' => $this->createForm(SearchRequestType::class, [
|
'search_form' => $this->createForm(SearchRequestType::class, [
|
||||||
|
|
@ -190,7 +221,7 @@ class ComponentController extends Controller
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function makeSidebarWidgetAction($site_loading = 'default', Page $page = null, $search_form = null){
|
public function makeSidebarWidgetAction($site_loading = 'default', Page $page = null, $api=null, $search_form = null){
|
||||||
|
|
||||||
$show_seal_of_approval = false;
|
$show_seal_of_approval = false;
|
||||||
//default
|
//default
|
||||||
|
|
@ -226,6 +257,7 @@ class ComponentController extends Controller
|
||||||
$widgets = $sidebarRepo->findWidgetsBy($site);
|
$widgets = $sidebarRepo->findWidgetsBy($site);
|
||||||
|
|
||||||
$vars = [ 'page' => $page,
|
$vars = [ 'page' => $page,
|
||||||
|
'api' => $api,
|
||||||
'site_loading' => $site_loading,
|
'site_loading' => $site_loading,
|
||||||
'widgets' => $widgets,
|
'widgets' => $widgets,
|
||||||
'show_seal_of_approval' => $show_seal_of_approval,
|
'show_seal_of_approval' => $show_seal_of_approval,
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,27 @@ class TravelCountry
|
||||||
*/
|
*/
|
||||||
private $name;
|
private $name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="slug", type="string", length=255, nullable=true)
|
||||||
|
*/
|
||||||
|
private $slug;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="text_before", type="string", length=255, nullable=true)
|
||||||
|
*/
|
||||||
|
private $text_before;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @ORM\Column(name="text_after", type="string", length=255, nullable=true)
|
||||||
|
*/
|
||||||
|
private $text_after;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
*
|
||||||
|
|
@ -99,6 +120,80 @@ class TravelCountry
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set slug
|
||||||
|
*
|
||||||
|
* @param string $slug
|
||||||
|
*
|
||||||
|
* @return TravelCountry
|
||||||
|
*/
|
||||||
|
public function setSlug($slug)
|
||||||
|
{
|
||||||
|
$this->slug = $slug;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get slug
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getSlug()
|
||||||
|
{
|
||||||
|
return $this->slug;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set text_before
|
||||||
|
*
|
||||||
|
* @param string $text_before
|
||||||
|
*
|
||||||
|
* @return TravelCountry
|
||||||
|
*/
|
||||||
|
public function setTextBefore($text_before)
|
||||||
|
{
|
||||||
|
$this->text_before = $text_before;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get text_before
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getTextBefore()
|
||||||
|
{
|
||||||
|
return $this->text_before;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set text_after
|
||||||
|
*
|
||||||
|
* @param string $text_after
|
||||||
|
*
|
||||||
|
* @return TravelCountry
|
||||||
|
*/
|
||||||
|
public function setTextAfter($text_after)
|
||||||
|
{
|
||||||
|
$this->text_after = $text_after;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get text_after
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getTextAfter()
|
||||||
|
{
|
||||||
|
return $this->text_after;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set htmlInformation
|
* Set htmlInformation
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -141,10 +141,14 @@ class BookingSternToursCrmExporter extends SternToursCrmExporter
|
||||||
'adult' => $room['adults'],
|
'adult' => $room['adults'],
|
||||||
'children' => 0,
|
'children' => 0,
|
||||||
'price_children' => 0,
|
'price_children' => 0,
|
||||||
|
'price_children_full' => 0,
|
||||||
|
'price_adult_full' => $room['price_full'],
|
||||||
];
|
];
|
||||||
if($room['children'] > 0){
|
if($room['children'] > 0){
|
||||||
$rooms[$i]['children'] = $room['children'];
|
$rooms[$i]['children'] = $room['children'];
|
||||||
$rooms[$i]['price_children'] = $room['price_children'];
|
$rooms[$i]['price_children'] = $room['price_children'];
|
||||||
|
$rooms[$i]['price_children_full'] = $room['price_children_full'];
|
||||||
|
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
@ -169,13 +173,23 @@ class BookingSternToursCrmExporter extends SternToursCrmExporter
|
||||||
'children' => 0,
|
'children' => 0,
|
||||||
'price_children' => 0,
|
'price_children' => 0,
|
||||||
];
|
];
|
||||||
if($option->getPriceChildren() > 0){
|
if($bookingRequest->getChildrenCount() > 0){
|
||||||
$travel_options[$i]['children'] = $bookingRequest->getChildrenCount();
|
$travel_options[$i]['children'] = $bookingRequest->getChildrenCount();
|
||||||
$travel_options[$i]['price_children'] = $option->getPriceChildren();
|
$travel_options[$i]['price_children'] = $option->getPriceChildren();
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
$dis = [];
|
||||||
|
$i = 0;
|
||||||
|
foreach ($bookingPriceInfo['discount'] as $discount)
|
||||||
|
{
|
||||||
|
$dis[$i] = [
|
||||||
|
'count' => $discount['count'],
|
||||||
|
'value' => $discount['value'],
|
||||||
|
'price' => $discount['price_discount']
|
||||||
|
];
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
$resp = $this->httpPostAPIv3('draft/create_drafts_from_booking', [
|
$resp = $this->httpPostAPIv3('draft/create_drafts_from_booking', [
|
||||||
'travel_program_id' => $tp->getId(),
|
'travel_program_id' => $tp->getId(),
|
||||||
'comfort' => $bookingRequest->getComfort(),
|
'comfort' => $bookingRequest->getComfort(),
|
||||||
|
|
@ -193,6 +207,7 @@ class BookingSternToursCrmExporter extends SternToursCrmExporter
|
||||||
'rooms' => $rooms,
|
'rooms' => $rooms,
|
||||||
'class_options' => $class_options,
|
'class_options' => $class_options,
|
||||||
'travel_options' => $travel_options,
|
'travel_options' => $travel_options,
|
||||||
|
'discount' => $dis,
|
||||||
]);
|
]);
|
||||||
if (count($resp) == 0)
|
if (count($resp) == 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ namespace AppBundle\Listener;
|
||||||
use AppBundle\AppBundle;
|
use AppBundle\AppBundle;
|
||||||
use AppBundle\Controller\DefaultController;
|
use AppBundle\Controller\DefaultController;
|
||||||
use AppBundle\Entity\Page;
|
use AppBundle\Entity\Page;
|
||||||
|
use AppBundle\Util;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManager;
|
||||||
use Doctrine\ORM\PersistentCollection;
|
use Doctrine\ORM\PersistentCollection;
|
||||||
use Symfony\Bundle\FrameworkBundle\Routing\Router;
|
use Symfony\Bundle\FrameworkBundle\Routing\Router;
|
||||||
|
|
@ -31,6 +32,7 @@ class KernelControllerListener
|
||||||
$this->controllerResolver = $controllerResolver;
|
$this->controllerResolver = $controllerResolver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function onKernelController(FilterControllerEvent $event)
|
public function onKernelController(FilterControllerEvent $event)
|
||||||
{
|
{
|
||||||
$request = $event->getRequest();
|
$request = $event->getRequest();
|
||||||
|
|
@ -42,6 +44,7 @@ class KernelControllerListener
|
||||||
}
|
}
|
||||||
$session->set('time', time());
|
$session->set('time', time());
|
||||||
|
|
||||||
|
|
||||||
if ($request->get('_controller') == 'AppBundle\Controller\DefaultController::defaultAction')
|
if ($request->get('_controller') == 'AppBundle\Controller\DefaultController::defaultAction')
|
||||||
{
|
{
|
||||||
$repo = $this->em->getRepository('AppBundle:Page');
|
$repo = $this->em->getRepository('AppBundle:Page');
|
||||||
|
|
@ -56,18 +59,20 @@ class KernelControllerListener
|
||||||
$pathArray = explode('/', $path);
|
$pathArray = explode('/', $path);
|
||||||
$restOfPath = '';
|
$restOfPath = '';
|
||||||
$curPath = $path;
|
$curPath = $path;
|
||||||
|
$api = Util::loadFromApi('cms/search', ['url'=>$curPath]);
|
||||||
while (!empty($pathArray))
|
while (!empty($pathArray))
|
||||||
{
|
{
|
||||||
|
if(!$api){
|
||||||
$node = $repo->findOneBy(['realUrlPath' => '/'. $curPath]);
|
$node = $repo->findOneBy(['realUrlPath' => '/'. $curPath]);
|
||||||
if ($node)
|
if ($node)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$restOfPath = '/'. array_pop($pathArray) . $restOfPath;
|
$restOfPath = '/'. array_pop($pathArray) . $restOfPath;
|
||||||
$curPath = implode('/', $pathArray);
|
$curPath = implode('/', $pathArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//find and try 301
|
//find and try 301
|
||||||
//find => to
|
//find => to
|
||||||
$redirects = [
|
$redirects = [
|
||||||
|
|
@ -96,9 +101,26 @@ class KernelControllerListener
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//load content from API!
|
||||||
|
if($api){
|
||||||
|
$request->attributes->set('_controller', 'AppBundle:Cms:iqTravelGuide');
|
||||||
|
$request->attributes->set('api', $api);
|
||||||
|
$request->attributes->set('template', 'TravelGuide');
|
||||||
|
try
|
||||||
|
{
|
||||||
|
$controller = $this->controllerResolver->getController($request);
|
||||||
|
}
|
||||||
|
catch (\LogicException $e)
|
||||||
|
{
|
||||||
|
// If there is no controller action, call the default action and pass the template name
|
||||||
|
$request->attributes->set('_controller', 'AppBundle:Cms:Default');
|
||||||
|
$request->attributes->set('template', "Default");
|
||||||
|
}
|
||||||
|
$event->setController($controller ?? $this->controllerResolver->getController($request));
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
if (!$node)
|
if (!$node)
|
||||||
{
|
{
|
||||||
// Now try to find a page by tracing a page node path using the page nodes' slugs
|
// Now try to find a page by tracing a page node path using the page nodes' slugs
|
||||||
|
|
@ -236,4 +258,6 @@ class KernelControllerListener
|
||||||
$event->setController($controller ?? $this->controllerResolver->getController($request));
|
$event->setController($controller ?? $this->controllerResolver->getController($request));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -9,6 +9,7 @@ namespace AppBundle\Service;
|
||||||
|
|
||||||
use AppBundle\Entity\Keyword;
|
use AppBundle\Entity\Keyword;
|
||||||
use AppBundle\Entity\Page;
|
use AppBundle\Entity\Page;
|
||||||
|
use AppBundle\Util;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManager;
|
||||||
|
|
||||||
class KeywordService
|
class KeywordService
|
||||||
|
|
@ -134,8 +135,7 @@ class KeywordService
|
||||||
if($dict === null)
|
if($dict === null)
|
||||||
{
|
{
|
||||||
$dict = [];
|
$dict = [];
|
||||||
$keywords = $this->entityManager->getRepository('AppBundle:Keyword')->findAll();
|
/* $keywords = $this->entityManager->getRepository('AppBundle:Keyword')->findAll();
|
||||||
/** @var Keyword $keyword */
|
|
||||||
foreach($keywords as $keyword)
|
foreach($keywords as $keyword)
|
||||||
{
|
{
|
||||||
if(isset($dict[$keyword->getValue()]))
|
if(isset($dict[$keyword->getValue()]))
|
||||||
|
|
@ -156,7 +156,6 @@ class KeywordService
|
||||||
->getQuery()
|
->getQuery()
|
||||||
->execute()
|
->execute()
|
||||||
;
|
;
|
||||||
/** @var Page $page */
|
|
||||||
foreach($pages as $page)
|
foreach($pages as $page)
|
||||||
{
|
{
|
||||||
if(isset($dict[$page->getKeyword()]))
|
if(isset($dict[$page->getKeyword()]))
|
||||||
|
|
@ -169,6 +168,23 @@ class KeywordService
|
||||||
$dict[$page->getKeyword()] = $dictEntry;
|
$dict[$page->getKeyword()] = $dictEntry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
/** @var Page $page */
|
||||||
|
$keywords = Util::loadFromApi('cms/keywords', ['url'=>'']);
|
||||||
|
foreach($keywords as $keyword => $url)
|
||||||
|
{
|
||||||
|
if(isset($dict[$keyword]))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$dictEntry = $this->createKeywordDictEntry("/".$url, $keyword, $classes);
|
||||||
|
if ($dictEntry !== null)
|
||||||
|
{
|
||||||
|
$dict[$keyword] = $dictEntry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return $dict;
|
return $dict;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,8 +86,9 @@ class AppExtension extends \Twig_Extension
|
||||||
return date("Ymd", time());
|
return date("Ymd", time());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getContentBySlug($slug)
|
public function getContentBySlug($slug, $to = "")
|
||||||
{
|
{
|
||||||
|
$slug = $slug.$to;
|
||||||
$repo = $this->em->getRepository('AppBundle:CMSContent');
|
$repo = $this->em->getRepository('AppBundle:CMSContent');
|
||||||
$re = $repo->findBySlug($slug);
|
$re = $repo->findBySlug($slug);
|
||||||
if($re){
|
if($re){
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ class Util
|
||||||
return array_reverse($ret);
|
return array_reverse($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static function reAttachRelatedCollection($entity, $field, $collection)
|
public static function reAttachRelatedCollection($entity, $field, $collection)
|
||||||
{
|
{
|
||||||
$cls = new \ReflectionClass(get_class($entity));
|
$cls = new \ReflectionClass(get_class($entity));
|
||||||
|
|
@ -168,6 +169,40 @@ class Util
|
||||||
return self::httpRequest($url, 'GET', '', $headers, $withRespHeaders, $cookieJarPath);
|
return self::httpRequest($url, 'GET', '', $headers, $withRespHeaders, $cookieJarPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static function loadFromApi($action, $postData){
|
||||||
|
|
||||||
|
$baseUrl = 'https://mein.sterntours.de/api/';
|
||||||
|
if($_SERVER['HTTP_HOST'] == 'sterntours.local') {
|
||||||
|
$baseUrl = 'http://mein.sterntours.local/api/';
|
||||||
|
}
|
||||||
|
$postData['key'] = 'f6077389c9ce710e554763a5de02c8ec';
|
||||||
|
$data = $postData;
|
||||||
|
$result = "";
|
||||||
|
$ch = curl_init();
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
|
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
|
||||||
|
curl_setopt($ch, CURLOPT_POST, true);
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $baseUrl.$action);
|
||||||
|
|
||||||
|
$result = curl_exec($ch);
|
||||||
|
/* var_dump($result);
|
||||||
|
die();
|
||||||
|
*/
|
||||||
|
$r = json_decode($result);
|
||||||
|
curl_close($ch);
|
||||||
|
if(isset($r->success)) {
|
||||||
|
return $r->ret;
|
||||||
|
}
|
||||||
|
if(isset($r->error)) {
|
||||||
|
//$this->logger->warn('*** v3 Error: '.$r->error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints formatted back-trace. CLI-output is colorized as well.
|
* Prints formatted back-trace. CLI-output is colorized as well.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue