Startseiten-CMS-Anbindung abschließen

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Kevin Adametz 2026-05-28 15:04:21 +00:00
parent 754aa699a1
commit 45150780de
22 changed files with 28191 additions and 2362 deletions

View file

@ -88,6 +88,17 @@
gtag('config', 'G-Y1Y779PDME'); gtag('config', 'G-Y1Y779PDME');
</script> </script>
<script>
(function (c, s, q, u, a, r, e) {
c.hj=c.hj||function(){(c.hj.q=c.hj.q||[]).push(arguments)};
c._hjSettings = { hjid: a };
r = s.getElementsByTagName('head')[0];
e = s.createElement('script');
e.async = true;
e.src = q + c._hjSettings.hjid + u;
r.appendChild(e);
})(window, document, 'https://static.hj.contentsquare.net/c/csq-', '.js', 5350061);
</script>
{% block stylesheets %} {% block stylesheets %}
{% endblock stylesheets %} {% endblock stylesheets %}
@ -99,7 +110,12 @@
</head> </head>
<style> <style>
@media (min-width: 992px) and (max-width: 1200px ) {
.topMain.nav-pills>li>a {
padding: .5rem .8rem;
margin-right: .4rem;
}
}
</style> </style>
<body class="no-js"> <body class="no-js">
<div id="wrapper"> <div id="wrapper">
@ -116,7 +132,7 @@
<div class="home-message text-center small"> <div class="home-message text-center small">
<div class="home-info-box"> <div class="home-info-box">
<div id="eKomiSeal_default" class="eKomi-header" style="padding-top: 5px;padding-left: 2px;"> <div id="eKomiSeal_default" class="eKomi-header" style="padding-top: 5px;padding-left: 2px;">
<img class="lozad" border="0" src="{{ asset('images/dummy.png') }}" data-src="{{ asset('images/logo-qualitaet-22.png') }}" alt="Top Kundenservice" height="78"> <img class="lozad" border="0" src="{{ asset('images/dummy.png') }}" data-src="{{ asset('images/logo-qualitaet.png') }}" alt="Top Kundenservice" height="78">
</div> </div>
<ul class="c4"> <ul class="c4">
<li>Spezialist für Kulturreisen </li> <li>Spezialist für Kulturreisen </li>
@ -152,7 +168,9 @@
</div> </div>
<div id="sidebar" class="col-xs-12 col-sm-12 col-md-3 col-md-pull-9 order_first"> <div id="sidebar" class="col-xs-12 col-sm-12 col-md-3 col-md-pull-9 order_first">
{% if site_loading is defined and page is defined %} {% if dev_home_sidebar is defined %}
{% include 'default/components/sidebar/devHomeSidebar.html.twig' %}
{% elseif 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 %} {% elseif site_loading is defined and api is defined %}
{{ render(controller('AppBundle:Component:makeSidebarWidget', {'site_loading': site_loading, 'page': null, 'api': api})) }} {{ render(controller('AppBundle:Component:makeSidebarWidget', {'site_loading': site_loading, 'page': null, 'api': api})) }}
@ -164,13 +182,6 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
<div class="clearfix" style="margin-bottom: 10px; margin-top: 0;">
<div id="auorg-bg">
<a href="https://www.ausgezeichnet.org" target="_blank" title="Unabh&auml;ngige Bewertungen, Kundenbewertungen und G&uuml;tesiegel von AUSGEZEICHNET.ORG" class="auorg-br">
<span style="font-size:8px;font-weight:normal;text-transform:uppercase;">AUSGEZEICHNET.ORG</span>
</a>
</div>
</div>
</div><!-- end row --> </div><!-- end row -->
@ -184,7 +195,7 @@
{{ render(controller('AppBundle:Component:footer')) }} {{ render(controller('AppBundle:Component:footer')) }}
<a class="js-go-to u-go-to-v1 animated" href="#!" data-type="fixed" data-offset-top="400" data-show-effect="zoomIn" data-hide-effect="zoomOut" data-position='{"bottom": 15, "right": 15 }'> <a class="js-go-to u-go-to-v1 animated" href="#!" data-type="fixed" data-offset-top="400" data-show-effect="zoomIn" data-hide-effect="zoomOut" data-position='{"bottom": 65, "left": 12 }'>
<i class="icon-up-open-big"></i> <i class="icon-up-open-big"></i>
</a> </a>
</div><!-- end wrapper --> </div><!-- end wrapper -->
@ -206,7 +217,6 @@
}); });
}); });
</script> </script>
<script type="text/javascript" src="https://siegel.ausgezeichnet.org/widgets/js/55b648290cf257aef3483d90/widget.js" data-cookieconsent="marketing"></script><!-- Ausgezeichnet.org-Siegel: End -->
{% endblock javascripts %} {% endblock javascripts %}
</body> </body>

View file

@ -39,12 +39,12 @@
<footer class="footer clearfix"> <footer class="footer clearfix">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-md-6 col-sm-6 col-xs-12"> <div class="col-md-5 col-sm-6 col-xs-12">
<p class="hl4">Ihre Vorteile bei STERN TOURS</p> <p class="hl4">Ihre Vorteile bei STERN TOURS</p>
<p>Unsere Produktauswahl ist vielfältig. Neben dem Pauschaltourismus und Jugendreisen sind wir auf individuelle Kulturreisen spezialisiert.</p> <p>Unsere Produktauswahl ist vielfältig. Neben dem Pauschaltourismus sind wir auf individuelle Kulturreisen spezialisiert.</p>
<img class="left-img lozad" src="{{ asset('/images/dummy.png') }}" data-src="{{ asset('/images/STERN_22-Jahre.png') }}" alt="Stern Tours 20 Jahre"> <img class="left-img lozad" src="{{ asset('/images/dummy.png') }}" data-src="{{ asset('/images/STERN_1998.png') }}" alt="Stern Tours seit 1998">
<ul class="c4"> <ul class="c4">
<li>Spezialist seit 1998</li> <li>Spezialist seit 1998</li>
<li>Top Service</li> <li>Top Service</li>
@ -53,20 +53,25 @@
</ul> </ul>
</div><!-- end col --> </div><!-- end col -->
<div class="col-md-6 col-sm-6 col-xs-12"> <div class="col-md-7 col-sm-6 col-xs-12">
<div class="row"> <div class="row">
<div class="col-md-6" style="margin-bottom: 1rem;"> <div class="col-md-6 col-xs-12" style="margin-bottom: 1rem;">
<p class="hl4">Reiseversicherung</p> <p class="hl4">Reiseversicherung</p>
{% image '@AppBundle/Resources/public/images/logos/rundv.png' %} {% image '@AppBundle/Resources/public/images/logos/rundv.png' %}
<img class="img-responsive lozad" src="{{ asset('/images/dummy.png') }}" data-src="{{ asset_url }}" alt="R + V"> <img class="img-responsive lozad" src="{{ asset('/images/dummy.png') }}" data-src="{{ asset_url }}" alt="R + V">
{% endimage %} {% endimage %}
</div>
<div class="col-md-6">
<p class="hl4">Sicherheit</p> <p class="hl4">Sicherheit</p>
{% image '@AppBundle/Resources/public/images/logos/ssl.png' %} {% image '@AppBundle/Resources/public/images/logos/ssl.png' %}
<img class="left-img lozad" src="{{ asset('/images/dummy.png') }}" data-src="{{ asset_url }}" alt="SSL" style="margin-top: 0.3rem;"> <img class="left-img lozad" src="{{ asset('/images/dummy.png') }}" data-src="{{ asset_url }}" alt="SSL" style="margin-top: 0.3rem;">
{% endimage %} {% endimage %}
</div> </div>
<div class="col-md-6 col-xs-12">
<div style="padding: 20px 0 0 0;"> </div>
<a href="/ueber-uns#atmosfair"><img class="img-responsive lozad" src="{{ asset('/images/dummy.png') }}" style="max-width: 300px;" data-src="/docs/images/logo_atmosfair_blue.png" alt="atmosfair"></a>
<div style="padding: 20px 0 0 0;"> </div>
<a href="/ueber-uns#atmosfair" style="color: #fff; text-decoration: none; font-size: 1.2rem;">&gt; mehr erfahren</a>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -93,3 +98,9 @@
</div><!-- end row --> </div><!-- end row -->
</div><!-- end container --> </div><!-- end container -->
</div><!-- end copyrights --> </div><!-- end copyrights -->
<!-- Ausgezeichnet.org-Dynamic-Seal: Begin -->
<div class="auorgDynamicSeal" auorg-data-type="rounded"></div>
<script src="https://siegel.ausgezeichnet.org/widgets/55b648290cf257aef3483d90/dynamic-seal.js?lang=de_DE" defer> </script> <!-- Ausgezeichnet.org-Dynamic-Seal: End -->

View file

@ -187,7 +187,7 @@
{# @var nav_page \AppBundle\Entity\Page #} {# @var nav_page \AppBundle\Entity\Page #}
<li class="dropdown"> <li class="dropdown">
<a class="dropdown-toggle" href="{{ nav_page.urlPath }}"> <a class="dropdown-toggle" href="{{ nav_page.urlPath }}">
<i class="fa fa-star"></i> {{ nav_page.title|replace({'Reisen': ''}) }} <span class="hidden-md">Reisen</span> <i class="fa fa-star"></i> {{ nav_page.title|replace({'Reisen': ''}) }} <span class="hidden-md hidden-lg">Reisen</span>
</a> </a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
@ -278,12 +278,6 @@
<li role="menuitem" itemprop="name"> <li role="menuitem" itemprop="name">
<a itemprop="url" href="/tuerkei-reisen" title="Türkei Reisen"><i class="fa fa-star"></i> Türkei Reisen </a> <a itemprop="url" href="/tuerkei-reisen" title="Türkei Reisen"><i class="fa fa-star"></i> Türkei Reisen </a>
</li> </li>
<li role="menuitem" itemprop="name">
<a itemprop="url" href="/usbekistan-reisen" title="Usbekistan Reisen"><i class="fa fa-star"></i> Usbekistan Reisen </a>
</li>
<li role="menuitem" itemprop="name">
<a itemprop="url" href="/marokko-urlaub" title="Marokko Reisen"><i class="fa fa-star"></i> Marokko Reisen</a>
</li>
<li class="divider"></li> <li class="divider"></li>
<li role="menuitem" itemprop="name"> <li role="menuitem" itemprop="name">
@ -305,6 +299,11 @@
<i class="fa fa-book"></i> Reisemagazin <i class="fa fa-book"></i> Reisemagazin
</a> </a>
</li> </li>
<li role="menuitem" itemprop="name">
<a itemprop="url" href="/reisenews" title="Reisenews">
<i class="fa fa-newspaper-o"></i> Reisenews
</a>
</li>
</ul> </ul>
</li> </li>
</ul> </ul>

View file

@ -1,5 +1,71 @@
{% form_theme search_form 'default/form/theme.html.twig' %} {% form_theme search_form 'default/form/theme.html.twig' %}
<style>
.dev-start-slider {
background: #e8dfd2;
overflow: hidden;
}
.dev-start-slider .dev-start-slider-frame {
position: relative;
z-index: 2;
max-width: 1280px;
margin: 0 auto;
overflow: hidden;
background: #e8dfd2;
}
.dev-start-slider .carousel-inner > .item {
overflow: hidden;
}
.dev-start-slider .dev-start-slider-blur {
position: absolute;
top: -24px;
right: -24px;
bottom: -24px;
left: -24px;
z-index: 1;
background-color: #e8dfd2;
background-position: center;
background-size: cover;
filter: blur(18px);
opacity: 0.65;
transform: scale(1.04);
}
.dev-start-slider .carousel-indicators {
right: auto;
bottom: 26px;
left: 50%;
z-index: 4;
width: 100%;
max-width: 1280px;
margin-left: 0;
padding-left: 24px;
text-align: left;
transform: translateX(-50%);
}
.dev-start-slider .carousel-indicators li,
.dev-start-slider .carousel-indicators .active {
width: auto;
height: auto;
margin: 0 6px 0 0;
padding: 5px 10px;
border: 1px solid rgba(255, 255, 255, 0.85);
border-radius: 14px;
background: rgba(0, 0, 0, 0.35);
color: #fff;
text-indent: 0;
line-height: 1;
}
.dev-start-slider .carousel-indicators .active {
background: #d89a13;
border-color: #d89a13;
}
.dev-start-slider .fill {
background-color: #e8dfd2;
background-position: center;
background-size: cover;
}
</style>
<section class="section fullscreen background start-slider dev-start-slider"> <section class="section fullscreen background start-slider dev-start-slider">
<div class="absolute-section"> <div class="absolute-section">
<div class="container-fluid"> <div class="container-fluid">
@ -22,12 +88,48 @@
</div> </div>
</div> </div>
<div id="myCarousel" class="carousel slide"> <div id="myCarousel" class="carousel slide">
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active">1/4</li>
<li data-target="#myCarousel" data-slide-to="1">2/4</li>
<li data-target="#myCarousel" data-slide-to="2">3/4</li>
<li data-target="#myCarousel" data-slide-to="3">4/4</li>
</ol>
<div class="carousel-inner"> <div class="carousel-inner">
<div class="item active"> <div class="item active">
<div class="fill lozad" style="background-image:url(images/placeholder-image.png)" data-background-image="{{ image('bundles/app/images/travel/slider_aegypten.jpg') }}"></div> <div class="dev-start-slider-blur" style="background-image:url({{ asset('img/slider/a1.jpg') }})"></div>
<noscript> <div class="dev-start-slider-frame">
<div class="fill" style="background-image:url({{ image('bundles/app/images/travel/slider_aegypten.jpg').cropResize(1024).guess(70) }})"></div> <div class="fill" style="background-image:url({{ asset('img/slider/a1.jpg') }})"></div>
</noscript> <noscript>
<div class="fill" style="background-image:url({{ asset('img/slider/a1.jpg') }})"></div>
</noscript>
</div>
</div>
<div class="item">
<div class="dev-start-slider-blur" style="background-image:url({{ asset('img/slider/m1.jpg') }})"></div>
<div class="dev-start-slider-frame">
<div class="fill" style="background-image:url({{ asset('img/slider/m1.jpg') }})"></div>
<noscript>
<div class="fill" style="background-image:url({{ asset('img/slider/m1.jpg') }})"></div>
</noscript>
</div>
</div>
<div class="item">
<div class="dev-start-slider-blur" style="background-image:url({{ asset('img/slider/s1.jpg') }})"></div>
<div class="dev-start-slider-frame">
<div class="fill" style="background-image:url({{ asset('img/slider/s1.jpg') }})"></div>
<noscript>
<div class="fill" style="background-image:url({{ asset('img/slider/s1.jpg') }})"></div>
</noscript>
</div>
</div>
<div class="item">
<div class="dev-start-slider-blur" style="background-image:url({{ asset('img/slider/u1.jpg') }})"></div>
<div class="dev-start-slider-frame">
<div class="fill" style="background-image:url({{ asset('img/slider/u1.jpg') }})"></div>
<noscript>
<div class="fill" style="background-image:url({{ asset('img/slider/u1.jpg') }})"></div>
</noscript>
</div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -7,11 +7,21 @@
<div class="item-img"> <div class="item-img">
{% include 'default/components/pageBoxImage.html.twig' %} {% include 'default/components/pageBoxImage.html.twig' %}
{% if show_item_counter is defined and show_item_counter %}
<span class="homepage-card-counter">{{ loop.index }}/{{ pages|length }}</span>
{% endif %}
{% if new_page_ids is defined and page.id in new_page_ids %}
<span class="homepage-card-new-badge">Neu</span>
{% endif %}
</div> </div>
<div class="box_mid"> <div class="box_mid">
<div class="hl5">{{ page.title }}</div> <div class="hl5">{{ page.title }}</div>
{% if page.homepageCountryName is not empty %}
<div class="text-muted small">{{ page.homepageCountryName }}</div>
{% endif %}
{% if (page.boxBody ?? page.description) is not empty %} {% if (page.boxBody ?? page.description) is not empty %}
<p>{{ page.boxBody|default(page.description) }}</p> <p>{{ page.boxBody|default(page.description) }}</p>
{% endif %} {% endif %}

View file

@ -1,32 +1,37 @@
{# @var child_page \AppBundle\Entity\Page #} {# @var child_page \AppBundle\Entity\Page #}
<div class="col-md-4 col-sm-6"> <div class="col-md-4 col-sm-6">
<div class="travel-wrapper get-box-link"> <div class="travel-wrapper get-box-link">
<div class="item text-left">
<div class="item-img">
<div class="lb">
{% if child_page.boxStar is not empty %} <div class="item text-left">
<div class="cstar_left">{{ child_page.boxStar|raw }}</div> <div class="item-img">
{% endif %} <div class="lb">
{% if child_page.travelProgram is not empty and child_page.travelProgram.lowestPrice > 0 %} {% if child_page.boxStar is not empty %}
<div class="cprice">ab {{ child_page.travelProgram.lowestPrice|number_format }} € p.P.</div> <div class="cstar_left">{{ child_page.boxStar|raw }}</div>
{% endif %} {% endif %}
{% if child_page.boxDiscount is not empty %} {% if child_page.travelProgram is not empty and child_page.travelProgram.lowestPrice > 0 %}
<div class="cdiscount">{{ child_page.boxDiscount|raw }}</div> <div class="cprice">ab {{ child_page.travelProgram.lowestPrice|number_format }} € p.P.</div>
{% endif %} {% endif %}
{% if child_page.model == 'feedback'%} {% if child_page.boxDiscount is not empty %}
<div class="cdiscount">{{ child_page.date|date }}</div> <div class="cdiscount">{{ child_page.boxDiscount|raw }}</div>
{% endif %} {% endif %}
{% if child_page.model == 'feedback'%}
<div class="cdiscount">{{ child_page.date|date }}</div>
{% endif %}
</div>
{% include 'default/components/pageBoxImage.html.twig' with {page: child_page} %}
</div> </div>
{% include 'default/components/pageBoxImage.html.twig' with {page: child_page} %}
<div class="box_mid">
<div class="hl5">{{ child_page.title }}</div>
<p>{{ child_page.description }}</p>
</div>
<a class="item-button is-box-link dobble_line" href="{{ child_page.urlPath }}" title="{{ child_page.title }}">
<span>{{ child_page.title }}</span>
</a>
</div> </div>
<div class="box_mid">
<div class="hl5">{{ child_page.title }}</div>
<p>{{ child_page.boxBody ?? child_page.description }}</p>
</div>
<a class="item-button is-box-link dobble_line" href="{{ child_page.urlPath }}" title="{{ child_page.title }}">
<span>{{ child_page.title }}</span>
</a>
</div>
</div> </div>
</div> </div>

View file

@ -1,17 +1,27 @@
{% if page.boxImageUrl is not empty %} {% if page.boxBody is not empty and page.boxBodyImage is defined and page.boxBodyImage %}
{% set image_url = page.boxImageUrl %} {% set image_url = page.boxBodyImage['thumb_url'] %}
{% set image_alt = page.travelProgram.title|default(page.title) %} {% set image_alt = page.boxBodyImage['title'] %}
{% elseif page.travelProgram is not empty and page.travelProgram.previewImage is not empty %} <div class="img-background lozad" data-background-image="{{ image_url }}" style="background-image:url({{ asset('images/placeholder-image.png') }});"></div>
{% set image_url = 'uploads/travel_program/' ~ page.travelProgram.previewImage.fileNameWithExtension %}
{% set image_alt = page.title %}
{% elseif page.fewoLodging is not empty and page.fewoLodging.images is not empty and page.fewoLodging.images[0] is not empty %}
{% set image_url = '_uploads/images/' ~ page.fewoLodging.images[0].file %}
{% set image_alt = page.title %}
{% else %} {% else %}
{% set image_url = asset('/bundles/app/images/no-picture.png')%} {% if page.boxImageUrl is not empty %}
{% set image_alt = 'Kein Vorschaubild vorhanden' %} {% set image_url = page.boxImageUrl %}
{% set image_alt = page.travelProgram.title|default(page.title) %}
{% elseif page.travelProgram is not empty and page.travelProgram.previewImage is not empty %}
{% set image_url = 'uploads/travel_program/' ~ page.travelProgram.previewImage.fileNameWithExtension %}
{% set image_alt = page.title %}
{% elseif page.fewoLodging is not empty and page.fewoLodging.images is not empty and page.fewoLodging.images[0] is not empty %}
{% set image_url = '_uploads/images/' ~ page.fewoLodging.images[0].file %}
{% set image_alt = page.title %}
{% elseif page.boxBody is not empty and page.boxBodyImage is defined and page.boxBodyImage %}
{% set image_url = page.boxBodyImage['thumb_url'] %}
{% set image_alt = page.boxBodyImage['title'] %}
{% 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(360).guess(70) }}" style="background-image:url({{ asset('images/placeholder-image.png') }})"></div>
<noscript>
<img width="234" data-url="{{ image_url }}" height="180" src="{{ image(image_url|trim('/')).cropResize(360).guess(70) }}" class="img-responsiv img-responsiv-item" style="">
</noscript>
{% endif %} {% endif %}
<div class="img-background lozad" data-background-image="{{ image(image_url|trim('/')).cropResize(360).guess(70) }}" style="background-image:url({{ asset('images/placeholder-image.png') }})"></div>
<noscript>
<img width="234" data-url="{{ image_url }}" height="180" src="{{ image(image_url|trim('/')).cropResize(360).guess(70) }}" class="img-responsiv img-responsiv-item" style="">
</noscript>

View file

@ -0,0 +1,64 @@
{% if dev_home_sidebar_offer_pages is defined and dev_home_sidebar_offer_pages is not empty %}
{% include 'default/components/sidebar/pageSliderSidebarWidget.html.twig' with {
slider_title: dev_home_sidebar_offer_title|default('Aktuell planbare Reisen'),
target_widget: 'dev-home-offers-widget',
pages: dev_home_sidebar_offer_pages,
new_badge_active: dev_home_sidebar_new_badge_active|default(false),
show_item_counter: true,
new_page_ids: dev_home_sidebar_new_page_ids|default([])
} %}
{% endif %}
{% if dev_home_sidebar_news_pages is defined and dev_home_sidebar_news_pages is not empty %}
{% include 'default/components/sidebar/pageSliderSidebarWidget.html.twig' with {
slider_title: dev_home_sidebar_news_title|default('Reisenews'),
target_widget: 'dev-home-news-widget',
pages: dev_home_sidebar_news_pages,
show_item_counter: true
} %}
{% endif %}
<style>
#dev-home-usedom-widget .box_mid {
padding: 24px 20px;
background: #f6f1e8;
border: 1px solid #eadfcf;
border-radius: 4px;
}
#dev-home-usedom-widget .hl5 {
margin-bottom: 12px;
color: #d89a13;
}
#dev-home-usedom-widget p {
margin-bottom: 18px;
}
#dev-home-usedom-widget .dev-usedom-sidebar-button {
display: inline-block;
padding: 10px 24px;
border-radius: 3px;
background: #d89a13;
color: #fff;
font-weight: 600;
text-transform: uppercase;
}
#dev-home-usedom-widget .dev-usedom-sidebar-button:hover {
background: #b97f00;
color: #fff;
text-decoration: none;
}
</style>
<div class="widget clearfix hidden-xs">
<div class="widget-title">
<a class="collapse-widget collapsed" href="#dev-home-usedom-widget" data-toggle="collapse" aria-expanded="true">Ferienwohnungen Usedom</a>
</div>
<div class="boxwidget collapse" id="dev-home-usedom-widget" aria-expanded="true">
<div class="box_mid text-center">
<div class="hl5">Urlaub an der Ostsee</div>
<p>8 Ferienwohnungen in zwei Häusern auf Usedom - ideal als nahes, kurzfristig planbares zweites Standbein.</p>
<a class="dev-usedom-sidebar-button" href="/ferienwohnungen" title="Ferienwohnungen auf Usedom">
ansehen
</a>
</div>
</div>
</div>

View file

@ -0,0 +1,4 @@
{{ render(controller('AppBundle:Component:newsSidebarWidget', {
title: widget.name,
limit: widget.configNewsLimit
})) }}

View file

@ -2,36 +2,50 @@
<div class="widget clearfix hidden-xs"> <div class="widget clearfix hidden-xs">
<div class="widget-title"> <div class="widget-title">
<a class="collapse-widget collapsed" href="#{{ target_widget }}" data-toggle="collapse" aria-expanded="true">{{ slider_title }}</a> <a class="collapse-widget collapsed" href="#{{ target_widget }}" data-toggle="collapse" aria-expanded="true">
{{ slider_title }}
{% if new_badge_active is defined and new_badge_active %}
<span class="label label-warning">Neu</span>
{% endif %}
</a>
</div><!-- end title --> </div><!-- end title -->
<div class="boxwidget collapse" id="{{ target_widget }}" aria-expanded="true"> <div class="boxwidget collapse" id="{{ target_widget }}" aria-expanded="true">
<div class="box-slider"> <div class="box-slider">
{% for page in pages %} {% for page in pages %}
<div class="travel-wrapper slide{{ loop.first ? ' active' }}"> <div class="travel-wrapper slide{{ loop.first ? ' active' }}">
<a href="{{ page.urlPath|default('javascript:void(0);') }}" class="item text-center"> <a href="{{ page.urlPath|default('javascript:void(0);') }}" class="item text-center">
<div class="item-img"> <div class="item-img">
{% include 'default/components/pageBoxImage.html.twig' %} {% include 'default/components/pageBoxImage.html.twig' %}
{% if show_item_counter is defined and show_item_counter %}
<span class="homepage-card-counter">{{ loop.index }}/{{ pages|length }}</span>
{% endif %}
{% if new_page_ids is defined and page.id in new_page_ids %}
<span class="homepage-card-new-badge">Neu</span>
{% endif %}
</div> </div>
<div class="box_mid"> <div class="box_mid">
<div class="hl5">{{ page.title }}</div> {% if target_widget == 'news-widget' and page.date is not empty %}
<div class="text-muted text-center">Vom: {{ page.date|date('d.m.Y') }}</div>
<p>{{ page.boxBody ?? page.description }}</p> {% endif %}
<div class="hl5">{{ page.title }} </div>
{% if page.homepageCountryName is not empty %}
<div class="text-muted small">{{ page.homepageCountryName }}</div>
{% endif %}
<p>{{ page.description }}</p>
{% if page.travelProgram is not empty and page.travelProgram.lowestPrice > 0 %} {% if page.travelProgram is not empty and page.travelProgram.lowestPrice > 0 %}
<div class="price"> <div class="price">
Für {{ page.travelProgram.lowestPrice|number_format }},- € p.P. Für {{ page.travelProgram.lowestPrice|number_format }},- € p.P.
</div> </div>
{% endif %} {% endif %}
</div> </div>
</a> </a>
</div><!-- end travel-wrapper --> </div><!-- end travel-wrapper -->
{% endfor %} {% endfor %}
<div class="item-switch clearfix"> <div class="item-switch clearfix">
<a href="javascript:void(0);" class="item-button-prev">zurück</a> <a href="javascript:void(0);" class="item-button-prev">zurück</a>
<a href="javascript:void(0);" class="item-button-next">weiter</a> <a href="javascript:void(0);" class="item-button-next">weiter</a>

View file

@ -4,7 +4,7 @@
{% for widget in widgets %} {% for widget in widgets %}
{% if widget.component is defined %} {% if widget.component is defined %}
{% include 'default/components/sidebar/' ~ widget.component ~ '.html.twig' %} {% include 'default/components/sidebar/' ~ widget.component ~ '.html.twig' %}
{% if(loop.index == loop_half ) %} {% if(loop.index == (loop_half|default((widgets|length / 2)|round(0, 'ceil'))) ) %}
</div> </div>
<div class="col-sm-6 col-md-12"> <div class="col-sm-6 col-md-12">
{% endif %} {% endif %}

View file

@ -16,6 +16,11 @@
{% block stylesheets %} {% block stylesheets %}
{{ parent() }} {{ parent() }}
<link rel="preload" as="image" href="{{ asset('img/slider/a1.jpg') }}">
<link rel="preload" as="image" href="{{ asset('img/slider/m1.jpg') }}">
<link rel="preload" as="image" href="{{ asset('img/slider/s1.jpg') }}">
<link rel="preload" as="image" href="{{ asset('img/slider/u1.jpg') }}">
<link rel="preload" as="image" href="{{ asset('img/usedom.jpg') }}">
<style> <style>
.dev-home-note { .dev-home-note {
margin-bottom: 25px; margin-bottom: 25px;
@ -36,6 +41,61 @@
.dev-usedom-teaser .btn { .dev-usedom-teaser .btn {
margin-top: 5px; margin-top: 5px;
} }
.dev-usedom-teaser-image {
overflow: hidden;
border-radius: 4px;
}
.dev-usedom-teaser-image .img-background {
min-height: 190px;
background-size: cover;
background-position: center;
}
.dev-usedom-carousel-heading {
margin: 8px 0 20px;
padding: 0 15px 8px;
border-bottom: 1px solid #d89a13;
color: #5a5a5a;
}
.dev-destination-note {
margin: 10px 0 18px;
padding: 12px 16px;
border-left: 4px solid #d89a13;
background: #f8f3ea;
}
.dev-destination-note strong {
display: block;
margin-bottom: 4px;
}
.travel-wrapper .item .item-img {
position: relative;
}
.homepage-card-counter {
position: absolute;
right: 10px;
top: 10px;
z-index: 12;
padding: 3px 8px;
border-radius: 2px;
background: rgb(100, 136, 89, 0.88);
color: #fff;
font-size: 12px;
font-weight: 700;
line-height: 1.2;
}
.homepage-card-new-badge {
position: absolute;
left: 10px;
top: 10px;
z-index: 12;
padding: 3px 8px;
border-radius: 2px;
background: #ffc926;
color: #1a457c;
font-size: 12px;
font-weight: 700;
line-height: 1.2;
text-transform: uppercase;
}
</style> </style>
{% endblock %} {% endblock %}
@ -52,11 +112,22 @@
Diese Startseite ist nur unter dem Testlink sichtbar und nicht fuer Suchmaschinen freigegeben. Diese Startseite ist nur unter dem Testlink sichtbar und nicht fuer Suchmaschinen freigegeben.
</div> </div>
<h1>Unsere beliebtesten Kulturreisen</h1> {% set homepage_offer_heading = homepage_offer_title|default('beliebtesten Kulturreisen') %}
{% if '%count%' in homepage_offer_heading %}
<h1>{{ homepage_offer_heading|replace({'%count%': homepage_offer_pages|length}) }}</h1>
{% elseif homepage_offer_heading|slice(0, 6) == 'Unsere' %}
<h1>{{ homepage_offer_heading }}</h1>
{% else %}
<h1>Unsere {{ homepage_offer_pages|length }} {{ homepage_offer_heading|replace({'Beliebte': 'beliebtesten', 'beliebte': 'beliebtesten'}) }}</h1>
{% endif %}
<section id="dev-home-offers"> <section id="dev-home-offers">
{% if homepage_offer_pages is not empty %} {% if homepage_offer_pages is not empty %}
{% include 'default/components/multiPageBoxCarousel.html.twig' with {pages: homepage_offer_pages} %} {% include 'default/components/multiPageBoxCarousel.html.twig' with {
pages: homepage_offer_pages,
show_item_counter: true,
new_page_ids: homepage_offer_new_page_ids|default([])
} %}
{% else %} {% else %}
<p>Aktuell konnten keine kuratierten Reiseangebote geladen werden.</p> <p>Aktuell konnten keine kuratierten Reiseangebote geladen werden.</p>
{% endif %} {% endif %}
@ -64,28 +135,54 @@
<section class="clearfix dev-usedom-teaser" id="dev-home-usedom"> <section class="clearfix dev-usedom-teaser" id="dev-home-usedom">
<div class="row"> <div class="row">
<div class="col-md-8"> <div class="col-md-7">
<h2 class="h3 h3l">Lieber näher zuhause? Ferienwohnungen auf Usedom</h2> <h2 class="h3 h3l">Lieber näher zuhause? Ferienwohnungen auf Usedom</h2>
<p class="lead"> <p class="lead">
Neben unseren Kulturreisen bieten wir acht Ferienwohnungen in zwei Häusern auf Usedom. Neben unseren Kulturreisen bieten wir <strong>8 Ferienwohnungen</strong> in zwei Häusern auf Usedom.
Ideal für alle, die kurzfristig, individuell und nah an der Ostsee Urlaub machen möchten. Ideal für alle, die kurzfristig, individuell und nah an der Ostsee Urlaub machen möchten.
</p> </p>
<a class="btn btn-primary" href="/ferienwohnungen" title="Ferienwohnungen auf Usedom ansehen"> <a class="btn btn-primary" href="/ferienwohnungen" title="Ferienwohnungen auf Usedom ansehen">
Ferienwohnungen ansehen Ferienwohnungen ansehen
</a> </a>
<br><br>
</div> </div>
<div class="col-md-4"> <div class="col-md-5">
<p> <div class="dev-usedom-teaser-image">
Der Block macht Usedom als zweites Standbein sichtbar, ohne die Kulturreisen zu verdrängen. <img class="img-responsive" src="{{ asset('img/usedom.jpg') }}" alt="Ferienwohnungen auf Usedom">
Bilder und Reihenfolge können nach Sichtung des vorhandenen Bildpools noch feinjustiert werden. </div>
</p>
</div> </div>
</div> </div>
<div class="clearfix">
</div>
<h2 class="h4 h3l dev-usedom-carousel-heading">Unsere 8 Ferienwohnungen auf Usedom</h2>
{% if fewo_lodgings is not empty %} {% if fewo_lodgings is not empty %}
<div class="row"> <div class="owl-fullwidth owl-carousel owl-theme">
{% for lodging in fewo_lodgings %} {% for lodging in fewo_lodgings %}
{% include 'default/components/pageLodgingBox.html.twig' %} <div class="owl-item-full">
<div class="travel-wrapper get-box-link">
<div class="item text-left">
<div class="item-img">
<div class="lb">
{% if lodging.page.boxStar is not empty %}
<div class="cstar_left">{{ lodging.page.boxStar|raw }}</div>
{% endif %}
{% if lodging.page.boxDiscount is not empty %}
<div class="cdiscount">{{ lodging.page.boxDiscount|raw }}</div>
{% endif %}
</div>
{% include 'default/components/pageBoxImage.html.twig' with {page: lodging.page} %}
</div>
<div class="box_mid">
<div class="hl5">{{ lodging.page.title }}</div>
<p>{{ lodging.page.boxBody ?? lodging.page.description }}</p>
</div>
<a class="item-button is-box-link dobble_line" href="{{ lodging.page.urlPath }}" title="{{ lodging.page.title }}">
<span>{{ lodging.page.title }}</span>
</a>
</div>
</div>
</div>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
@ -104,16 +201,100 @@
<h1>STERN TOURS - Ihr Kulturreise-Spezialist aus Berlin</h1> <h1>STERN TOURS - Ihr Kulturreise-Spezialist aus Berlin</h1>
<p class="ft"> <p class="ft">
Herzlich willkommen bei STERN TOURS, Ihrem Reiseveranstalter für ausgewählte Kulturreisen. Herzlich willkommen bei STERN TOURS, Ihrem Reiseveranstalter für ausgewählte Kulturreisen.
In der aktuellen Startseitenfassung stehen besonders die Reiseziele im Vordergrund, die Seit 1998 beraten wir Reisende zu den historischen Schätzen des Orients, Nordafrikas und
derzeit gut planbar und verkaufbar sind: Ägypten, Marokko, Usbekistan und Oman. Zentralasiens. In der aktuellen Startseitenfassung stehen besonders die Reiseziele im
Vordergrund, die derzeit gut planbar und verkaufbar sind: Ägypten, Marokko, Usbekistan
und Oman. Bei Destinationen mit angespannter Lage kommunizieren wir bewusst transparent
und beraten persönlich, statt Reisen unkritisch in den Vordergrund zu stellen.
</p> </p>
<h2 class="h3 h3l">Kulturreisen mit Erfahrung und persönlicher Beratung</h2> <hr>
<h2 class="h3 h3l">Ägypten - Land der Pyramiden und Pharaonen</h2>
<p class="ft"> <p class="ft">
Seit 1998 beraten wir Reisende zu Kulturreisen in den Orient und angrenzende Regionen. Ägypten bleibt eines der klassischen STERN TOURS Ziele: Pyramiden, Luxor, das Tal der Könige,
Die neue Frontseite soll Orientierung geben, buchbare Reisen sichtbar machen und zugleich Kairo und der Nil verbinden große Geschichte mit gut planbaren Kulturreisen. Unsere Programme
verantwortungsvoll mit Destinationen umgehen, bei denen die Lage eine vorsichtigere führen zu den wichtigsten Stätten des alten Ägypten und lassen sich je nach Reiseverlauf mit
Kommunikation erfordert. einer Nilkreuzfahrt oder erholsamen Tagen am Roten Meer verbinden.
Hier finden Sie unsere <a href="/aegypten-reisen/aegypten-rundreisen" title="Ägypten Rundreisen">Ägypten Rundreisen</a>.
</p> </p>
<h2 class="h3 h3l">Marokko - Königsstädte, Wüste und lebendige Kultur</h2>
<p class="ft">
Marokko verbindet orientalische Atmosphäre mit einer guten Erreichbarkeit: Marrakesch, Fès,
Rabat und Meknès stehen für Königsstädte, Handwerk, Märkte und eindrucksvolle Architektur.
Ausflüge in den Atlas und in die Wüstenlandschaften machen Marokko zu einem vielseitigen Ziel
für Kulturreisende, die derzeit eine gut planbare Alternative im nordafrikanischen Raum suchen.
Hier finden Sie unsere <a href="/marokko-urlaub/marokko-rundreisen" title="Marokko Rundreisen">Marokko Rundreisen</a>.
</p>
<h2 class="h3 h3l">Usbekistan - entlang der Seidenstraße nach Samarkand</h2>
<p class="ft">
Usbekistan ist ein junges Reiseland mit einer sehr alten Kultur. Samarkand, Buchara und Chiwa
stehen für die Seidenstraße, prachtvolle Medresen, türkisfarbene Kuppeln und Oasenstädte, die
bis heute von Handel, Handwerk und Geschichte erzählen. Für kulturinteressierte Gäste ist
Usbekistan aktuell eines der spannendsten und zugleich gut vermittelbaren Ziele im Programm.
Hier finden Sie unsere <a href="/usbekistan-reisen/usbekistan-rundreisen" title="Usbekistan Rundreisen">Usbekistan Rundreisen</a>.
</p>
<h2 class="h3 h3l">Oman - Wüstenschlösser, Naturschauspiele und Badestrände</h2>
<p class="ft">
Der Oman bietet Wüsten, Gebirge, Oasen, Küsten und eine wohltuend ruhige Form orientalischer
Gastfreundschaft. Maskat, Nizwa, traditionelle Souks, Forts und Fahrten durch eindrucksvolle
Landschaften machen das Sultanat zu einem hochwertigen Kulturreiseziel. Wer eine planbare Reise
mit Natur, Geschichte und Erholung verbinden möchte, findet im Oman eine starke Alternative.
Hier finden Sie unsere <a href="/oman-reisen/oman-rundreisen" title="Oman Rundreisen">Oman Rundreisen</a>.
</p>
<h2 class="h3 h3l">Türkei - Kultur zwischen Europa und Asien</h2>
<p class="ft">
Die Türkei bietet mit Istanbul, Ephesus, Kappadokien und vielen antiken Stätten ein großes
kulturelles Spektrum. Auf der aktuellen Startseite bleibt sie bewusst im Hintergrund, da der
Fokus auf den derzeit wichtigsten STERN TOURS Zielen liegt.
Hier finden Sie unsere <a href="/tuerkei-reisen/tuerkei-rundreisen" title="Türkei Rundreisen">Türkei Rundreisen</a>.
</p>
<h2 class="h3 h3l">Jordanien - Petra, Wadi Rum und persönliche Beratung</h2>
<div class="dev-destination-note">
<strong>Aktuelle Einordnung:</strong>
Reisen nach Jordanien sind grundsätzlich weiterhin möglich. Aufgrund der angespannten Lage in
der Region empfehlen wir eine persönliche Beratung und eine sorgfältige Prüfung von Reisezeitraum
und Verfügbarkeit.
</div>
<p class="ft">
Jordanien bleibt kulturell eines der eindrucksvollsten Ziele der Region: die Felsenstadt Petra,
Wadi Rum, Amman, Jerash und das Tote Meer prägen viele Reiseverläufe. Auf der Startseite wird
Jordanien derzeit bewusst weniger prominent beworben; Interessierte beraten wir gern individuell.
Hier finden Sie unsere <a href="/jordanien-reisen/jordanien-rundreisen" title="Jordanien Rundreisen">Jordanien Rundreisen</a>.
</p>
<h2 class="h3 h3l">Israel - große Religionsgeschichte mit aktueller Lageprüfung</h2>
<div class="dev-destination-note">
<strong>Aktuelle Einordnung:</strong>
Die Lage in der Region ist angespannt. Wir empfehlen, geplante Reisen nach Israel sorgfältig zu
prüfen und sich vor einer Buchung persönlich beraten zu lassen.
</div>
<p class="ft">
Israel ist ein Land von herausragender religiöser und kultureller Bedeutung: Jerusalem, Galiläa,
das Tote Meer, Haifa und Akko stehen für Geschichte, Begegnung und Vielfalt. Aufgrund der
aktuellen Situation tritt Israel auf der Startseite nicht in den Vordergrund; Anfragen mit
längerem Vorlauf behandeln wir individuell und verantwortungsvoll.
Hier finden Sie unsere <a href="/israel-reisen/israel-rundreisen" title="Israel Rundreisen">Israel Rundreisen</a>.
</p>
<h2 class="h3 h3l">Iran - Kulturschätze Persiens, derzeit nicht im Vordergrund</h2>
<div class="dev-destination-note">
<strong>Aktuelle Einordnung:</strong>
Aufgrund der aktuellen Lage sind Iran-Reisen derzeit nicht als aktive Buchungsempfehlung auf der
Startseite platziert. Interessierte können sich vormerken lassen und werden informiert, sobald
Reisen wieder verantwortungsvoll planbar sind.
</div>
<p class="ft">
Der Iran blickt auf Jahrtausende Kulturgeschichte zurück: Isfahan, Schiras, Yazd und Persepolis
gehören zu den großen Namen persischer Geschichte. Diese Faszination bleibt bestehen, wird aber
aktuell bewusst nicht verkaufsstark beworben. Der Schwerpunkt liegt auf transparenter Information
und späterer Wiederaufnahme, sobald die Rahmenbedingungen es erlauben.
Hier finden Sie unsere <a href="/iran-reisen/iran-rundreisen" title="Iran Rundreisen">Iran Rundreisen</a>.
</p>
</div> </div>
</section> </section>
</div> </div>

View file

@ -1,4 +1,5 @@
<?php <?php
/** /**
* @author Ulrich Hecht <ulrich.hecht@hecht-software.de> * @author Ulrich Hecht <ulrich.hecht@hecht-software.de>
* @date 12/08/2016 * @date 12/08/2016
@ -37,7 +38,8 @@ class BookingController extends Controller
* @throws \Exception * @throws \Exception
*/ */
private function getErrorMessages(\Symfony\Component\Form\Form $form) { private function getErrorMessages(\Symfony\Component\Form\Form $form)
{
$errors = array(); $errors = array();
foreach ($form->getErrors() as $key => $error) { foreach ($form->getErrors() as $key => $error) {
@ -64,37 +66,35 @@ class BookingController extends Controller
public function indexAction(Page $travelProgramPage, $action, Request $request) public function indexAction(Page $travelProgramPage, $action, Request $request)
{ {
if($action == '/show_nationality_country_text') if ($action == '/show_nationality_country_text') {
{
$ret = ""; $ret = "";
$nationality_id = $request->request->get('nationality_id'); $nationality_id = $request->request->get('nationality_id');
$country_ids = $request->request->get('country_ids'); $country_ids = $request->request->get('country_ids');
foreach ($country_ids as $country_id){ foreach ($country_ids as $country_id) {
$country = $this->getEntityManager()->getRepository('AppBundle:TravelCountry')->findOneBy(['id' => $country_id]); $country = $this->getEntityManager()->getRepository('AppBundle:TravelCountry')->findOneBy(['id' => $country_id]);
$req = $this->getDoctrine()->getRepository('AppBundle:TravelNationalityRequirement')->findOneByCountryAndNationality($country_id, $nationality_id); $req = $this->getDoctrine()->getRepository('AppBundle:TravelNationalityRequirement')->findOneByCountryAndNationality($country_id, $nationality_id);
if($req && $country){ if ($req && $country) {
$setC = !empty($country->getName()) ? $country->getName() : "Einreiseland"; $setC = !empty($country->getName()) ? $country->getName() : "Einreiseland";
$setT = !empty($req->getText()) ? $req->getText() : "Die Einreisebestimmungen erhalten Sie nach der Bestätigung Ihrer Anfrage."; $setT = !empty($req->getText()) ? $req->getText() : "Die Einreisebestimmungen erhalten Sie nach der Bestätigung Ihrer Anfrage.";
$ret .= "<h2>".$setC."</h2>"; $ret .= "<h2>" . $setC . "</h2>";
$ret .= "<p>".$setT."</p>"; $ret .= "<p>" . $setT . "</p>";
$ret .= "<hr>"; $ret .= "<hr>";
} }
} }
echo $ret; echo $ret;
die(); die();
} }
$travelProgram = $travelProgramPage->getTravelProgram(); $travelProgram = $travelProgramPage->getTravelProgram();
if (!$request->query->has('nr')) if (!$request->query->has('nr')) {
{
return $this->redirect($travelProgramPage->getUrlPath()); return $this->redirect($travelProgramPage->getUrlPath());
} }
$this->getDoctrine()->getRepository('AppBundle:TravelPeriod')->getTrueTravelPeriods($travelProgram); $this->getDoctrine()->getRepository('AppBundle:TravelPeriod')->getTrueTravelPeriods($travelProgram);
@ -102,24 +102,20 @@ class BookingController extends Controller
$this->priceTypeById = $this->getDoctrine()->getRepository('AppBundle:TravelPeriodPriceType')->findAllIndexedById(); $this->priceTypeById = $this->getDoctrine()->getRepository('AppBundle:TravelPeriodPriceType')->findAllIndexedById();
// #TODO Consider changing key of travel dates // #TODO Consider changing key of travel dates
foreach ($travelProgram->getTravelDates() as $curTravelDate) foreach ($travelProgram->getTravelDates() as $curTravelDate) {
{ if ($curTravelDate->getStatus() != 0) {
if($curTravelDate->getStatus() != 0){ if ($curTravelDate->getName() == $request->query->get('nr')) {
if ($curTravelDate->getName() == $request->query->get('nr'))
{
$travelDate = $curTravelDate; $travelDate = $curTravelDate;
break; break;
} }
} }
} }
if (!isset($travelDate)) if (!isset($travelDate)) {
{
throw $this->createNotFoundException(); throw $this->createNotFoundException();
} }
$now = new \DateTime(); $now = new \DateTime();
if ($travelDate->getStart() <= $now) if ($travelDate->getStart() <= $now) {
{
throw $this->createNotFoundException(); throw $this->createNotFoundException();
} }
@ -132,8 +128,7 @@ class BookingController extends Controller
/** @var BookingRequest $bookingRequest */ /** @var BookingRequest $bookingRequest */
$bookingRequest = new BookingRequest(); $bookingRequest = new BookingRequest();
if ($request->getMethod() != 'POST') if ($request->getMethod() != 'POST') {
{
$bookingRequest->setRoomCount(0); $bookingRequest->setRoomCount(0);
} }
$form = $this->createForm(BookingRequestType::class, $bookingRequest, [ $form = $this->createForm(BookingRequestType::class, $bookingRequest, [
@ -141,8 +136,7 @@ class BookingController extends Controller
'travel_program' => $travelProgram, 'travel_program' => $travelProgram,
'nationalities' => $nationalities 'nationalities' => $nationalities
]); ]);
if ($request->getMethod() == 'POST') if ($request->getMethod() == 'POST') {
{
$form->handleRequest($request); $form->handleRequest($request);
$bookingRequest = $form->getData(); $bookingRequest = $form->getData();
} }
@ -151,75 +145,85 @@ class BookingController extends Controller
$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);
if ($action == '/buchen') if ($action == '/buchen') {
{
$breadcrumbEntries = Util::createBreadcrumb($travelProgramPage); $breadcrumbEntries = Util::createBreadcrumb($travelProgramPage);
$breadcrumbEntries[] = new BreadcrumbEntry('Buchen'); $breadcrumbEntries[] = new BreadcrumbEntry('Buchen');
$errors = [];
if ($request->getMethod() === 'POST' && $form->isValid()) if ($request->getMethod() === 'POST') {
{
$errors = array();
foreach ($form as $fieldName => $formField) { foreach ($form as $fieldName => $formField) {
foreach ($formField->getErrors(true) as $error) { foreach ($formField->getErrors(true) as $error) {
$errors[$fieldName] = $error->getMessage(); $errors[$fieldName] = $error->getMessage();
} }
} }
if (!$bookingRequest->checkIsRoomSelected()) {
$errors['room'] = 'Bitte wählen Sie mindestens ein Zimmer aus.';
}
}
if ($request->getMethod() === 'POST' && $form->isValid() && count($errors) == 0) {
$booking = $this->getDoctrine()->getRepository('AppBundle:TravelBooking')->createFromBookingRequest( $booking = $this->getDoctrine()->getRepository('AppBundle:TravelBooking')->createFromBookingRequest(
$bookingRequest, $travelDate, $bookingPriceInfo); $bookingRequest,
$travelDate,
$bookingPriceInfo
);
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$em->persist($booking); $em->persist($booking);
$em->flush(); $em->flush();
$ret = Util::loadFromApi('booking/import', ['travel_booking_id' => $booking->getId()]); $ret = Util::loadFromApi('booking/import', ['travel_booking_id' => $booking->getId()]);
$error_crm = 'CRM Fehler: | interne travel_booking ID: '.$booking->getId(); $error_crm = 'CRM Fehler: | interne travel_booking ID: ' . $booking->getId();
$this->get('mailer')->send(\Swift_Message::newInstance() $this->get('mailer')->send(
->setSubject('Ihr Buchungsauftrag bei STERN TOURS') \Swift_Message::newInstance()
->setFrom('stern@stern-tours.de', 'STERN TOURS') ->setSubject('Ihr Buchungsauftrag bei STERN TOURS')
->setTo($bookingRequest->getEmail()) // ->setFrom('stern@stern-tours.de', 'STERN TOURS')
->setBody( ->setTo($bookingRequest->getEmail()) //
$this->renderView('default/email/bookingConfirmationEmail.txt.twig', [ ->setBody(
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR, $this->renderView('default/email/bookingConfirmationEmail.txt.twig', [
'booking_request' => $bookingRequest, 'base_dir' => realpath($this->getParameter('kernel.root_dir') . '/..') . DIRECTORY_SEPARATOR,
'booking_price_info' => $bookingPriceInfo, 'booking_request' => $bookingRequest,
'travel_date' => $travelDate, 'booking_price_info' => $bookingPriceInfo,
'breadcrumb_entries' => $breadcrumbEntries, 'travel_date' => $travelDate,
'nationalities' => $nationalities, 'breadcrumb_entries' => $breadcrumbEntries,
'summary' => $htmlSummary, 'nationalities' => $nationalities,
'summary' => $htmlSummary,
]), ]),
'text/plain', 'utf-8' 'text/plain',
) 'utf-8'
)
); );
$this->get('mailer')->send(\Swift_Message::newInstance() $this->get('mailer')->send(
->setSubject('BUCHUNG: '. $travelProgram->getTitle() .'('. $travelDate->getName() .')') \Swift_Message::newInstance()
->setFrom('stern@stern-tours.de', 'STERN TOURS') ->setSubject('BUCHUNG: ' . $travelProgram->getTitle() . '(' . $travelDate->getName() . ')')
->setTo("stern@stern-tours.de") ->setFrom('stern@stern-tours.de', 'STERN TOURS')
->setBody( ->setTo("stern@stern-tours.de")
$this->renderView('default/email/bookingServiceEmail.txt.twig', [ ->setBody(
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR, $this->renderView('default/email/bookingServiceEmail.txt.twig', [
'crm_v1_url' => isset($ret->url_v1) ? $ret->url_v1 : $error_crm, 'base_dir' => realpath($this->getParameter('kernel.root_dir') . '/..') . DIRECTORY_SEPARATOR,
'crm_v3_url' => isset($ret->url_v3) ? $ret->url_v3 : $error_crm, 'crm_v1_url' => isset($ret->url_v1) ? $ret->url_v1 : $error_crm,
'lead_id' => isset($ret->lead_id) ? $ret->lead_id : '', 'crm_v3_url' => isset($ret->url_v3) ? $ret->url_v3 : $error_crm,
'travel_program_url' => Util::getBaseUrl() . $travelProgramPage->getUrlPath(), 'lead_id' => isset($ret->lead_id) ? $ret->lead_id : '',
'booking_request' => $bookingRequest, 'travel_program_url' => Util::getBaseUrl() . $travelProgramPage->getUrlPath(),
'booking_price_info' => $bookingPriceInfo, 'booking_request' => $bookingRequest,
'travel_date' => $travelDate, 'booking_price_info' => $bookingPriceInfo,
'breadcrumb_entries' => $breadcrumbEntries, 'travel_date' => $travelDate,
'nationalities' => $nationalities, 'breadcrumb_entries' => $breadcrumbEntries,
'summary' => $htmlSummary, 'nationalities' => $nationalities,
'summary' => $htmlSummary,
]), ]),
'text/plain', 'utf-8' 'text/plain',
) 'utf-8'
)
); );
// #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,
'site_loading' => 'bookingconfirm', 'site_loading' => 'bookingconfirm',
'page' => $travelProgramPage, 'page' => $travelProgramPage,
'booking_request' => $bookingRequest, 'booking_request' => $bookingRequest,
@ -243,7 +247,7 @@ class BookingController extends Controller
} }
return $this->render('default/pages/booking.html.twig', [ return $this->render('default/pages/booking.html.twig', [
'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR, 'base_dir' => realpath($this->getParameter('kernel.root_dir') . '/..') . DIRECTORY_SEPARATOR,
'site_loading' => 'booking', 'site_loading' => 'booking',
'page' => $travelProgramPage, 'page' => $travelProgramPage,
'breadcrumb_entries' => $breadcrumbEntries, 'breadcrumb_entries' => $breadcrumbEntries,
@ -263,17 +267,15 @@ class BookingController extends Controller
'total_price' => $totalPrice, 'total_price' => $totalPrice,
'nationalities' => $nationalities, 'nationalities' => $nationalities,
'booking_price_info' => $bookingPriceInfo, 'booking_price_info' => $bookingPriceInfo,
'errors' => count($errors) ? $errors : null,
'mediator_terms_filename' => $travelProgram->getIsMediated() 'mediator_terms_filename' => $travelProgram->getIsMediated()
? $this->getDoctrine()->getRepository('AppBundle:TravelOrganizer')->find(1)->getFileName() ? $this->getDoctrine()->getRepository('AppBundle:TravelOrganizer')->find(1)->getFileName()
: null : null
]); ]);
} } 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,
'total_price' => $totalPrice, 'total_price' => $totalPrice,
'booking_price_info' => $bookingPriceInfo, 'booking_price_info' => $bookingPriceInfo,
@ -281,13 +283,13 @@ class BookingController extends Controller
]); ]);
} }
throw new \Exception('Unknow BookingController action: '. $action); throw new \Exception('Unknow BookingController action: ' . $action);
} }
private function calcNumTravelerLabel($number) private function calcNumTravelerLabel($number)
{ {
$ret = 0; $ret = 0;
if($number > 0) if ($number > 0)
$ret = 1; $ret = 1;
return $ret; return $ret;
@ -311,13 +313,11 @@ class BookingController extends Controller
$childrenCount = $bookingRequest->getChildrenCount(); $childrenCount = $bookingRequest->getChildrenCount();
if (isset($outHtmlSummary)) if (isset($outHtmlSummary)) {
{
$insuranceHtmlSummary = []; $insuranceHtmlSummary = [];
} }
if (isset($outPriceInfo)) if (isset($outPriceInfo)) {
{
$outPriceInfo['rooms'] = []; $outPriceInfo['rooms'] = [];
$outPriceInfo['insurances'] = []; $outPriceInfo['insurances'] = [];
$outPriceInfo['insurancesOut'] = []; $outPriceInfo['insurancesOut'] = [];
@ -331,40 +331,37 @@ class BookingController extends Controller
$outPriceInfo['discount'] = []; $outPriceInfo['discount'] = [];
$outPriceInfo['booking_before'] = []; $outPriceInfo['booking_before'] = [];
$outPriceInfo['booking_after'] = []; $outPriceInfo['booking_after'] = [];
} }
$tempDepartureHTML = array(); $tempDepartureHTML = array();
//ABFLUG //ABFLUG
if($bookingRequest->getDeparture() != null) if ($bookingRequest->getDeparture() != null) {
{ $departure = Util\DepartureUtil::limitIndividualArrivalPrice(
$departure = Util\DepartureUtil::limitIndividualArrivalPrice($bookingRequest->getDeparture(), $bookingRequest->getDeparture(),
$travelDate->getFlightPrice()); $travelDate->getFlightPrice()
if (isset($outPriceInfo)) );
{ if (isset($outPriceInfo)) {
$outPriceInfo['departure'] = $departure; $outPriceInfo['departure'] = $departure;
} }
if ($departure->getExtraCharge() != 0) if ($departure->getExtraCharge() != 0) {
{
$insuranceAssessmentBasis += $departure->getExtraCharge(); $insuranceAssessmentBasis += $departure->getExtraCharge();
$insuranceAssessmentChildBasis += $departure->getExtraCharge(); $insuranceAssessmentChildBasis += $departure->getExtraCharge();
$a = ($travelerCount + $childrenCount) * $departure->getExtraCharge(); $a = ($travelerCount + $childrenCount) * $departure->getExtraCharge();
$ret += $a; $ret += $a;
$outPriceInfo['departure_extra'] += $a; $outPriceInfo['departure_extra'] += $a;
if (isset($outHtmlSummary)) if (isset($outHtmlSummary)) {
{
$key = $departure->getExtraCharge(); $key = $departure->getExtraCharge();
if(!empty($tempDepartureHTML[$key])) { if (!empty($tempDepartureHTML[$key])) {
$tempDepartureHTML[$key]['count'] = $tempDepartureHTML[$key]['count'] + ($travelerCount + $childrenCount); $tempDepartureHTML[$key]['count'] = $tempDepartureHTML[$key]['count'] + ($travelerCount + $childrenCount);
$tempDepartureHTML[$key]['value'] = $tempDepartureHTML[$key]['value'] + $a; $tempDepartureHTML[$key]['value'] = $tempDepartureHTML[$key]['value'] + $a;
}else{ } else {
$tempDepartureHTML[$key] = array( $tempDepartureHTML[$key] = array(
'value' => $a, 'value' => $a,
'label_first' => ($departure->getExtraCharge() > 0 ? 'Aufschlag' : 'Abzug') . ' für Abfahrts-/Abflugort "'. $departure->getName(), 'label_first' => ($departure->getExtraCharge() > 0 ? 'Aufschlag' : 'Abzug') . ' für Abfahrts-/Abflugort "' . $departure->getName(),
'label_last' => Util::formatPrice($departure->getExtraCharge()) . ' pro Person', 'label_last' => Util::formatPrice($departure->getExtraCharge()) . ' pro Person',
'count' => ($travelerCount + $childrenCount), 'count' => ($travelerCount + $childrenCount),
); );
} }
} }
@ -373,21 +370,19 @@ class BookingController extends Controller
//OPTIONEN //OPTIONEN
$tempOptionHTML = array(); $tempOptionHTML = array();
foreach ($bookingRequest->getTravelOptions() as $travelOption) foreach ($bookingRequest->getTravelOptions() as $travelOption) {
{
$insuranceAssessmentBasis += $travelOption->getPrice(); $insuranceAssessmentBasis += $travelOption->getPrice();
$insuranceAssessmentChildBasis += $travelOption->getPriceChildren(); $insuranceAssessmentChildBasis += $travelOption->getPriceChildren();
$a = $travelerCount * $travelOption->getPrice(); $a = $travelerCount * $travelOption->getPrice();
$a += $childrenCount * $travelOption->getPriceChildren(); $a += $childrenCount * $travelOption->getPriceChildren();
$ret += $a; $ret += $a;
//OPTIONS //OPTIONS
if (isset($outHtmlSummary)) if (isset($outHtmlSummary)) {
{
$key = $travelOption->getId(); $key = $travelOption->getId();
if(!empty($tempOptionHTML[$key])) { if (!empty($tempOptionHTML[$key])) {
// $tempOptionHTML[$key]['count'] = $tempOptionHTML[$key]['count'] + $travelerCount; // $tempOptionHTML[$key]['count'] = $tempOptionHTML[$key]['count'] + $travelerCount;
$tempOptionHTML[$key]['value'] = $tempOptionHTML[$key]['value'] + $a; $tempOptionHTML[$key]['value'] = $tempOptionHTML[$key]['value'] + $a;
}else{ } else {
$tempOptionHTML[$key] = array( $tempOptionHTML[$key] = array(
'value' => $a, 'value' => $a,
'label_first' => $travelOption->getName(), 'label_first' => $travelOption->getName(),
@ -398,8 +393,7 @@ class BookingController extends Controller
); );
} }
} }
if (isset($outPriceInfo)) if (isset($outPriceInfo)) {
{
$outPriceInfo['options'][] = $travelOption; $outPriceInfo['options'][] = $travelOption;
} }
} }
@ -432,10 +426,8 @@ class BookingController extends Controller
$possibleRooms = $this->getRooms($travelDate->getPrices(), $persons); $possibleRooms = $this->getRooms($travelDate->getPrices(), $persons);
$tempComfortHTML = array(); $tempComfortHTML = array();
if ($bookingRequest->getComfort()) if ($bookingRequest->getComfort()) {
{ foreach ($possibleRooms as $room) {
foreach ($possibleRooms as $room)
{
$insuranceAssessmentBasis += $room['price']->getEffectiveComfortPrice(); $insuranceAssessmentBasis += $room['price']->getEffectiveComfortPrice();
$insuranceAssessmentChildBasis += $room['price']->getEffectiveComfortPrice(); $insuranceAssessmentChildBasis += $room['price']->getEffectiveComfortPrice();
@ -446,13 +438,12 @@ class BookingController extends Controller
$b = $childrenCount * $room['price']->getEffectiveComfortPrice(); $b = $childrenCount * $room['price']->getEffectiveComfortPrice();
$ret += $a + $b; $ret += $a + $b;
if (isset($outHtmlSummary)) if (isset($outHtmlSummary)) {
{
$key = intval($room['price']->getEffectiveComfortPrice()); $key = intval($room['price']->getEffectiveComfortPrice());
if(!empty($tempComfortHTML[$key])) { if (!empty($tempComfortHTML[$key])) {
$tempComfortHTML[$key]['count'] = $tempComfortHTML[$key]['count'] + $adultCount + $childrenCount; $tempComfortHTML[$key]['count'] = $tempComfortHTML[$key]['count'] + $adultCount + $childrenCount;
$tempComfortHTML[$key]['value'] = $tempComfortHTML[$key]['value'] + $a + $b; $tempComfortHTML[$key]['value'] = $tempComfortHTML[$key]['value'] + $a + $b;
}else{ } else {
$tempComfortHTML[$key] = array( $tempComfortHTML[$key] = array(
'value' => $a + $b, 'value' => $a + $b,
'label_first' => 'Komfort-Kategorie', 'label_first' => 'Komfort-Kategorie',
@ -461,8 +452,7 @@ class BookingController extends Controller
); );
} }
} }
if (isset($outPriceInfo)) if (isset($outPriceInfo)) {
{
$outPriceInfo['classOptions'][] = [ $outPriceInfo['classOptions'][] = [
'count' => $room['persons']['total'], 'count' => $room['persons']['total'],
'name' => 'Komfort (4 Sterne)', 'name' => 'Komfort (4 Sterne)',
@ -473,10 +463,10 @@ class BookingController extends Controller
} }
//days before //days before
if($bookingRequest->getExtraBookingDaysBefore()){ if ($bookingRequest->getExtraBookingDaysBefore()) {
$newDay = clone $travelDate->getStart(); $newDay = clone $travelDate->getStart();
$newDay->modify('-'.$bookingRequest->getExtraBookingDaysBefore().' day'); $newDay->modify('-' . $bookingRequest->getExtraBookingDaysBefore() . ' day');
$newExtraDaysTravelDate['change'] = 1; $newExtraDaysTravelDate['change'] = 1;
$newExtraDaysTravelDate['start'] = $newDay->format('d.m.Y'); $newExtraDaysTravelDate['start'] = $newDay->format('d.m.Y');
@ -486,9 +476,9 @@ class BookingController extends Controller
$adultCount = $room['persons']['adults']; $adultCount = $room['persons']['adults'];
$childrenCount = $room['persons']['children']; $childrenCount = $room['persons']['children'];
if ($bookingRequest->getComfort()){ if ($bookingRequest->getComfort()) {
$singleExtraFullPrice = $room['price']->getEffectiveExtraComfortPrice(); $singleExtraFullPrice = $room['price']->getEffectiveExtraComfortPrice();
}else{ } else {
$singleExtraFullPrice = $room['price']->getEffectiveExtraPrice(); $singleExtraFullPrice = $room['price']->getEffectiveExtraPrice();
} }
$childExtraPrice = $room['price']->getEffectiveExtraChildPrice(); $childExtraPrice = $room['price']->getEffectiveExtraChildPrice();
@ -527,16 +517,14 @@ class BookingController extends Controller
); );
} }
} }
} }
$tempExtraDaysAfterHTML = array(); $tempExtraDaysAfterHTML = array();
//days after //days after
if($bookingRequest->getExtraBookingDaysAfter()){ if ($bookingRequest->getExtraBookingDaysAfter()) {
$newDay = clone $travelDate->getEnd(); $newDay = clone $travelDate->getEnd();
$newDay->modify('+'.$bookingRequest->getExtraBookingDaysAfter().' day'); $newDay->modify('+' . $bookingRequest->getExtraBookingDaysAfter() . ' day');
$newExtraDaysTravelDate['change'] = 1; $newExtraDaysTravelDate['change'] = 1;
$newExtraDaysTravelDate['end'] = $newDay->format('d.m.Y'); $newExtraDaysTravelDate['end'] = $newDay->format('d.m.Y');
@ -546,9 +534,9 @@ class BookingController extends Controller
$adultCount = $room['persons']['adults']; $adultCount = $room['persons']['adults'];
$childrenCount = $room['persons']['children']; $childrenCount = $room['persons']['children'];
if ($bookingRequest->getComfort()){ if ($bookingRequest->getComfort()) {
$singleExtraFullPrice = $room['price']->getEffectiveExtraComfortPrice(); $singleExtraFullPrice = $room['price']->getEffectiveExtraComfortPrice();
}else{ } else {
$singleExtraFullPrice = $room['price']->getEffectiveExtraPrice(); $singleExtraFullPrice = $room['price']->getEffectiveExtraPrice();
} }
$childExtraPrice = $room['price']->getEffectiveExtraChildPrice(); $childExtraPrice = $room['price']->getEffectiveExtraChildPrice();
@ -587,14 +575,11 @@ class BookingController extends Controller
); );
} }
} }
} }
//ROOMS DISCOUNT Versicherungen //ROOMS DISCOUNT Versicherungen
foreach ($possibleRooms as $room) foreach ($possibleRooms as $room) {
{
$adultCount = $room['persons']['adults']; $adultCount = $room['persons']['adults'];
$childrenCount = $room['persons']['children']; $childrenCount = $room['persons']['children'];
@ -615,8 +600,7 @@ class BookingController extends Controller
$outPriceInfo['flight_price'] += (($singel_flight_price * $adultCount) + ($singel_flight_price * $room['persons']['children'])); $outPriceInfo['flight_price'] += (($singel_flight_price * $adultCount) + ($singel_flight_price * $room['persons']['children']));
//Room price //Room price
if (isset($outPriceInfo)) if (isset($outPriceInfo)) {
{
$price = $singleDiscountPrice ?? $singleFullPrice; $price = $singleDiscountPrice ?? $singleFullPrice;
$price += $singleChildDiscountPrice ?? $childPrice; $price += $singleChildDiscountPrice ?? $childPrice;
@ -635,14 +619,13 @@ class BookingController extends Controller
//Room html //Room html
if (isset($outHtmlSummary)) if (isset($outHtmlSummary)) {
{
//ROOMS //ROOMS
$key = $room['priceType']->getId(); $key = $room['priceType']->getId();
if(!empty($tempRoomHTML[$key])) { if (!empty($tempRoomHTML[$key])) {
$tempRoomHTML[$key]['count'] = $tempRoomHTML[$key]['count'] + 1; $tempRoomHTML[$key]['count'] = $tempRoomHTML[$key]['count'] + 1;
$tempRoomHTML[$key]['value'] = $tempRoomHTML[$key]['value'] + $roomPrice; $tempRoomHTML[$key]['value'] = $tempRoomHTML[$key]['value'] + $roomPrice;
}else{ } else {
$tempRoomHTML[$key] = array( $tempRoomHTML[$key] = array(
'value' => $roomPrice, 'value' => $roomPrice,
'label_first' => $room['priceType']->getName(), 'label_first' => $room['priceType']->getName(),
@ -654,13 +637,12 @@ class BookingController extends Controller
} }
//DISCOUNT //DISCOUNT
if ($singleDiscountPrice !== null) if ($singleDiscountPrice !== null) {
{ $key = intval(($singleFullPrice - $singleDiscountPrice) * 100);
$key = intval(($singleFullPrice - $singleDiscountPrice)*100); if (!empty($tempDiscountHTML[$key])) {
if(!empty($tempDiscountHTML[$key])) {
$tempDiscountHTML[$key]['count'] = $tempDiscountHTML[$key]['count'] + $adultCount; $tempDiscountHTML[$key]['count'] = $tempDiscountHTML[$key]['count'] + $adultCount;
$tempDiscountHTML[$key]['value'] = $tempDiscountHTML[$key]['value'] + $discount; $tempDiscountHTML[$key]['value'] = $tempDiscountHTML[$key]['value'] + $discount;
}else{ } else {
$tempDiscountHTML[$key] = array( $tempDiscountHTML[$key] = array(
'value' => $discount, 'value' => $discount,
'label_first' => 'Rabatt', 'label_first' => 'Rabatt',
@ -668,12 +650,12 @@ class BookingController extends Controller
'count' => $adultCount, 'count' => $adultCount,
); );
} }
if($childDiscount > 0){ if ($childDiscount > 0) {
$key = intval(($childPrice - $singleChildDiscountPrice)*100); $key = intval(($childPrice - $singleChildDiscountPrice) * 100);
if(!empty($tempDiscountHTML[$key])) { if (!empty($tempDiscountHTML[$key])) {
$tempDiscountHTML[$key]['count'] = $tempDiscountHTML[$key]['count'] + $childrenCount; $tempDiscountHTML[$key]['count'] = $tempDiscountHTML[$key]['count'] + $childrenCount;
$tempDiscountHTML[$key]['value'] = $tempDiscountHTML[$key]['value'] + $childDiscount; $tempDiscountHTML[$key]['value'] = $tempDiscountHTML[$key]['value'] + $childDiscount;
}else{ } else {
$tempDiscountHTML[$key] = array( $tempDiscountHTML[$key] = array(
'value' => $childDiscount, 'value' => $childDiscount,
'label_first' => 'Rabatt', 'label_first' => 'Rabatt',
@ -682,13 +664,12 @@ class BookingController extends Controller
); );
} }
} }
if (isset($outPriceInfo)) if (isset($outPriceInfo)) {
{ $key = intval(($singleFullPrice - $singleDiscountPrice) * 100);
$key = intval(($singleFullPrice - $singleDiscountPrice)*100); if (!empty($outPriceInfo['discount'][$key])) {
if(!empty($outPriceInfo['discount'][$key])) {
$outPriceInfo['discount'][$key]['count'] = $outPriceInfo['discount'][$key]['count'] + $adultCount; $outPriceInfo['discount'][$key]['count'] = $outPriceInfo['discount'][$key]['count'] + $adultCount;
$outPriceInfo['discount'][$key]['value'] = $outPriceInfo['discount'][$key]['value'] + $discount; $outPriceInfo['discount'][$key]['value'] = $outPriceInfo['discount'][$key]['value'] + $discount;
}else{ } else {
$outPriceInfo['discount'][$key] = array( $outPriceInfo['discount'][$key] = array(
'value' => $discount, 'value' => $discount,
'price_discount' => ($singleFullPrice - $singleDiscountPrice), 'price_discount' => ($singleFullPrice - $singleDiscountPrice),
@ -697,12 +678,12 @@ class BookingController extends Controller
'count' => $adultCount, 'count' => $adultCount,
); );
} }
if($childDiscount > 0){ if ($childDiscount > 0) {
$key = intval(($childPrice - $singleChildDiscountPrice)*100); $key = intval(($childPrice - $singleChildDiscountPrice) * 100);
if(!empty($outPriceInfo['discount'][$key])) { if (!empty($outPriceInfo['discount'][$key])) {
$outPriceInfo['discount'][$key]['count'] = $outPriceInfo['discount'][$key]['count'] + $childrenCount; $outPriceInfo['discount'][$key]['count'] = $outPriceInfo['discount'][$key]['count'] + $childrenCount;
$outPriceInfo['discount'][$key]['value'] = $outPriceInfo['discount'][$key]['value'] + $childDiscount; $outPriceInfo['discount'][$key]['value'] = $outPriceInfo['discount'][$key]['value'] + $childDiscount;
}else{ } else {
$outPriceInfo['discount'][$key] = array( $outPriceInfo['discount'][$key] = array(
'value' => $childDiscount, 'value' => $childDiscount,
'label_first' => 'Rabatt', 'label_first' => 'Rabatt',
@ -712,12 +693,10 @@ 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);
@ -736,28 +715,27 @@ class BookingController extends Controller
$insuranceTotal += $a + $b; $insuranceTotal += $a + $b;
$ret += $a + $b; $ret += $a + $b;
if (isset($insuranceHtmlSummary)) if (isset($insuranceHtmlSummary)) {
{ if (!empty($tempInsuranceHTML[$insurancePriceValue])) {
if(!empty($tempInsuranceHTML[$insurancePriceValue])){
$tempInsuranceHTML[$insurancePriceValue]['count'] = intval($tempInsuranceHTML[$insurancePriceValue]['count']) + $adultCount; $tempInsuranceHTML[$insurancePriceValue]['count'] = intval($tempInsuranceHTML[$insurancePriceValue]['count']) + $adultCount;
$tempInsuranceHTML[$insurancePriceValue]['value'] = $tempInsuranceHTML[$insurancePriceValue]['value'] + $a; $tempInsuranceHTML[$insurancePriceValue]['value'] = $tempInsuranceHTML[$insurancePriceValue]['value'] + $a;
}else{ } else {
$tempInsuranceHTML[$insurancePriceValue] = array( $tempInsuranceHTML[$insurancePriceValue] = array(
'value' => $a, 'value' => $a,
'label_first' => 'RV '. $bookingRequest->getInsurance()->getName() .' ('. $insurancePrice->getCode() .') ', 'label_first' => 'RV ' . $bookingRequest->getInsurance()->getName() . ' (' . $insurancePrice->getCode() . ') ',
'label_last' => Util::formatPrice($insurancePriceValue) . ' pro Person', 'label_last' => Util::formatPrice($insurancePriceValue) . ' pro Person',
'count' => $adultCount, 'count' => $adultCount,
); );
} }
if($b > 0){ if ($b > 0) {
if(!empty($tempInsuranceHTML[$insuranceChildPriceValue])){ if (!empty($tempInsuranceHTML[$insuranceChildPriceValue])) {
$tempInsuranceHTML[$insuranceChildPriceValue]['count'] = intval($tempInsuranceHTML[$insuranceChildPriceValue]['count']) + $childrenCount; $tempInsuranceHTML[$insuranceChildPriceValue]['count'] = intval($tempInsuranceHTML[$insuranceChildPriceValue]['count']) + $childrenCount;
$tempInsuranceHTML[$insuranceChildPriceValue]['value'] = $tempInsuranceHTML[$insuranceChildPriceValue]['value'] + $b; $tempInsuranceHTML[$insuranceChildPriceValue]['value'] = $tempInsuranceHTML[$insuranceChildPriceValue]['value'] + $b;
}else{ } else {
$tempInsuranceHTML[$insuranceChildPriceValue] = array( $tempInsuranceHTML[$insuranceChildPriceValue] = array(
'value' => $b, 'value' => $b,
'label_first' => 'RV '. $bookingRequest->getInsurance()->getName() .' ('. $insuranceChildPrice->getCode() .') ', 'label_first' => 'RV ' . $bookingRequest->getInsurance()->getName() . ' (' . $insuranceChildPrice->getCode() . ') ',
'label_last' => Util::formatPrice($insuranceChildPriceValue) . ' pro Kind', 'label_last' => Util::formatPrice($insuranceChildPriceValue) . ' pro Kind',
'count' => $childrenCount, 'count' => $childrenCount,
@ -765,27 +743,26 @@ class BookingController extends Controller
} }
} }
} }
if (isset($outPriceInfo)) if (isset($outPriceInfo)) {
{ if (!empty($outPriceInfo['insurancesOut'][$insurancePriceValue])) {
if(!empty($outPriceInfo['insurancesOut'][$insurancePriceValue])){
$outPriceInfo['insurancesOut'][$insurancePriceValue]['count'] = intval($outPriceInfo['insurancesOut'][$insurancePriceValue]['count']) + $childrenCount; $outPriceInfo['insurancesOut'][$insurancePriceValue]['count'] = intval($outPriceInfo['insurancesOut'][$insurancePriceValue]['count']) + $childrenCount;
$outPriceInfo['insurancesOut'][$insurancePriceValue]['value'] = $outPriceInfo['insurancesOut'][$insurancePriceValue]['value'] + $b; $outPriceInfo['insurancesOut'][$insurancePriceValue]['value'] = $outPriceInfo['insurancesOut'][$insurancePriceValue]['value'] + $b;
}else{ } else {
$outPriceInfo['insurancesOut'][$insurancePriceValue] = [ $outPriceInfo['insurancesOut'][$insurancePriceValue] = [
'value' => $a, 'value' => $a,
'label_first' => 'RV '. $bookingRequest->getInsurance()->getName() .' ('. $insurancePrice->getCode() .') ', 'label_first' => 'RV ' . $bookingRequest->getInsurance()->getName() . ' (' . $insurancePrice->getCode() . ') ',
'label_last' => Util::formatPrice($insurancePriceValue) . ' pro Person', 'label_last' => Util::formatPrice($insurancePriceValue) . ' pro Person',
'count' => $adultCount, 'count' => $adultCount,
]; ];
} }
if($b > 0){ if ($b > 0) {
if(!empty($outPriceInfo['insurancesOut'][$insuranceChildPriceValue])){ if (!empty($outPriceInfo['insurancesOut'][$insuranceChildPriceValue])) {
$outPriceInfo['insurancesOut'][$insuranceChildPriceValue]['count'] = intval($outPriceInfo['insurancesOut'][$insuranceChildPriceValue]['count']) + $childrenCount; $outPriceInfo['insurancesOut'][$insuranceChildPriceValue]['count'] = intval($outPriceInfo['insurancesOut'][$insuranceChildPriceValue]['count']) + $childrenCount;
$outPriceInfo['insurancesOut'][$insuranceChildPriceValue]['value'] = $outPriceInfo['insurancesOut'][$insuranceChildPriceValue]['value'] + $b; $outPriceInfo['insurancesOut'][$insuranceChildPriceValue]['value'] = $outPriceInfo['insurancesOut'][$insuranceChildPriceValue]['value'] + $b;
}else{ } else {
$outPriceInfo['insurancesOut'][$insuranceChildPriceValue] = [ $outPriceInfo['insurancesOut'][$insuranceChildPriceValue] = [
'value' => $b, 'value' => $b,
'label_first' => 'RV '. $bookingRequest->getInsurance()->getName() .' ('. $insuranceChildPrice->getCode() .') ', 'label_first' => 'RV ' . $bookingRequest->getInsurance()->getName() . ' (' . $insuranceChildPrice->getCode() . ') ',
'label_last' => Util::formatPrice($insuranceChildPriceValue) . ' pro Kind', 'label_last' => Util::formatPrice($insuranceChildPriceValue) . ' pro Kind',
'count' => $childrenCount, 'count' => $childrenCount,
]; ];
@ -808,14 +785,14 @@ class BookingController extends Controller
//ROOMS //ROOMS
if(count($tempRoomHTML) > 0){ if (count($tempRoomHTML) > 0) {
foreach ($tempRoomHTML as $item) { foreach ($tempRoomHTML as $item) {
$label = '<strong>'.$item['count'].'</strong> x '.$item['label_first'].'<strong> ['.$item['label_last'].']</strong>'; $label = '<strong>' . $item['count'] . '</strong> x ' . $item['label_first'] . '<strong> [' . $item['label_last'] . ']</strong>';
if($item['childCount'] > 0){ if ($item['childCount'] > 0) {
$label .= ' <strong>[ + Kind: '.$item['price_child']; $label .= ' <strong>[ + Kind: ' . $item['price_child'];
} }
$label .= ']</strong>'; $label .= ']</strong>';
$outHtmlSummary[] =[ $outHtmlSummary[] = [
'value' => $item['value'], 'value' => $item['value'],
'label' => $label, 'label' => $label,
]; ];
@ -823,42 +800,42 @@ class BookingController extends Controller
} }
//Comfort //Comfort
if(count($tempComfortHTML) > 0){ if (count($tempComfortHTML) > 0) {
foreach ($tempComfortHTML as $item) { foreach ($tempComfortHTML as $item) {
$outHtmlSummary[] =[ $outHtmlSummary[] = [
'value' => $item['value'], 'value' => $item['value'],
'label' => '<strong>'.$item['count'].'</strong> x '.$item['label_first'].'<strong> ['.$item['label_last'].' ]</strong>', 'label' => '<strong>' . $item['count'] . '</strong> x ' . $item['label_first'] . '<strong> [' . $item['label_last'] . ' ]</strong>',
]; ];
} }
} }
//Departure //Departure
if(count($tempDepartureHTML) > 0){ if (count($tempDepartureHTML) > 0) {
foreach ($tempDepartureHTML as $item) { foreach ($tempDepartureHTML as $item) {
$outHtmlSummary[] =[ $outHtmlSummary[] = [
'value' => $item['value'], 'value' => $item['value'],
'label' => '<strong>'.$item['count'].'</strong> x '.$item['label_first'].'<strong> ['.$item['label_last'].' ]</strong>', 'label' => '<strong>' . $item['count'] . '</strong> x ' . $item['label_first'] . '<strong> [' . $item['label_last'] . ' ]</strong>',
]; ];
} }
} }
//DISCOUNT //DISCOUNT
if(count($tempDiscountHTML) > 0){ if (count($tempDiscountHTML) > 0) {
foreach ($tempDiscountHTML as $item) { foreach ($tempDiscountHTML as $item) {
$insuranceHtmlSummary[] =[ $insuranceHtmlSummary[] = [
'value' => $item['value'], 'value' => $item['value'],
'label' => '<strong>'.$item['count'].'</strong> x '.$item['label_first'].'<strong> ['.$item['label_last'].' ]</strong>', 'label' => '<strong>' . $item['count'] . '</strong> x ' . $item['label_first'] . '<strong> [' . $item['label_last'] . ' ]</strong>',
]; ];
} }
} }
//options //options
if(count($tempOptionHTML) > 0){ if (count($tempOptionHTML) > 0) {
foreach ($tempOptionHTML as $item) { foreach ($tempOptionHTML as $item) {
$label = '<strong>'.$item['count'].'</strong> x '.$item['label_first'].'<strong> ['.$item['label_last'].']</strong>'; $label = '<strong>' . $item['count'] . '</strong> x ' . $item['label_first'] . '<strong> [' . $item['label_last'] . ']</strong>';
if($item['childCount'] > 0){ if ($item['childCount'] > 0) {
$label .= ' <strong>['.$item['price_child'].']</strong>'; $label .= ' <strong>[' . $item['price_child'] . ']</strong>';
} }
$outHtmlSummary[] =[ $outHtmlSummary[] = [
'value' => $item['value'], 'value' => $item['value'],
'label' => $label, 'label' => $label,
]; ];
@ -866,14 +843,14 @@ class BookingController extends Controller
} }
//extra days before //extra days before
if(count($tempExtraDaysBeforeHTML) > 0){ if (count($tempExtraDaysBeforeHTML) > 0) {
foreach ($tempExtraDaysBeforeHTML as $item) { foreach ($tempExtraDaysBeforeHTML as $item) {
$setDays = $item['days'] . ($item['days'] == 1 ? ' Tag' : ' Tage'); $setDays = $item['days'] . ($item['days'] == 1 ? ' Tag' : ' Tage');
$label = '<strong>'.$item['count'].'</strong> x '.$setDays.' '.$item['label_first'].'<strong> ['.$item['label_last'].']</strong>'; $label = '<strong>' . $item['count'] . '</strong> x ' . $setDays . ' ' . $item['label_first'] . '<strong> [' . $item['label_last'] . ']</strong>';
if($item['childCount'] > 0){ if ($item['childCount'] > 0) {
$label .= ' <strong>[+ Kind: '.$item['price_child'].']</strong>'; $label .= ' <strong>[+ Kind: ' . $item['price_child'] . ']</strong>';
} }
$outHtmlSummary[] =[ $outHtmlSummary[] = [
'value' => $item['value'], 'value' => $item['value'],
'label' => $label, 'label' => $label,
]; ];
@ -881,14 +858,14 @@ class BookingController extends Controller
} }
//extra days after //extra days after
if(count($tempExtraDaysAfterHTML) > 0){ if (count($tempExtraDaysAfterHTML) > 0) {
foreach ($tempExtraDaysAfterHTML as $item) { foreach ($tempExtraDaysAfterHTML as $item) {
$setDays = $item['days'] . ($item['days'] == 1 ? ' Tag' : ' Tage'); $setDays = $item['days'] . ($item['days'] == 1 ? ' Tag' : ' Tage');
$label = '<strong>'.$item['count'].'</strong> x '.$setDays.' '.$item['label_first'].'<strong> ['.$item['label_last'].']</strong>'; $label = '<strong>' . $item['count'] . '</strong> x ' . $setDays . ' ' . $item['label_first'] . '<strong> [' . $item['label_last'] . ']</strong>';
if($item['childCount'] > 0){ if ($item['childCount'] > 0) {
$label .= ' <strong>[+ Kind: '.$item['price_child'].']</strong>'; $label .= ' <strong>[+ Kind: ' . $item['price_child'] . ']</strong>';
} }
$outHtmlSummary[] =[ $outHtmlSummary[] = [
'value' => $item['value'], 'value' => $item['value'],
'label' => $label, 'label' => $label,
]; ];
@ -897,11 +874,11 @@ class BookingController extends Controller
//Versicherungen //Versicherungen
if(count($tempInsuranceHTML) > 0 ){ if (count($tempInsuranceHTML) > 0) {
foreach ($tempInsuranceHTML as $item) { foreach ($tempInsuranceHTML as $item) {
$insuranceHtmlSummary[] =[ $insuranceHtmlSummary[] = [
'value' => $item['value'], 'value' => $item['value'],
'label' => '<strong>'.$item['count'].'</strong> x '.$item['label_first'].'<strong> ['.$item['label_last'].' ]</strong>', 'label' => '<strong>' . $item['count'] . '</strong> x ' . $item['label_first'] . '<strong> [' . $item['label_last'] . ' ]</strong>',
]; ];
} }
} }
@ -909,38 +886,36 @@ class BookingController extends Controller
if (isset($insuranceHtmlSummary)) if (isset($insuranceHtmlSummary)) {
{
$outHtmlSummary = array_merge($outHtmlSummary, $insuranceHtmlSummary); $outHtmlSummary = array_merge($outHtmlSummary, $insuranceHtmlSummary);
} }
if($newExtraDaysTravelDate['change'] == 1){ if ($newExtraDaysTravelDate['change'] == 1) {
$outHtmlSummary[] = [ $outHtmlSummary[] = [
'value' => '!', 'value' => '!',
'label' => "Geänderter Reisezeitraum: ".$newExtraDaysTravelDate['start']." - ".$newExtraDaysTravelDate['end'], 'label' => "Geänderter Reisezeitraum: " . $newExtraDaysTravelDate['start'] . " - " . $newExtraDaysTravelDate['end'],
]; ];
} }
if (isset($outPriceInfo)) if (isset($outPriceInfo)) {
{
$outPriceInfo['total'] = $ret; $outPriceInfo['total'] = $ret;
$outPriceInfo['totalWithoutInsurance'] = $ret - $insuranceTotal; $outPriceInfo['totalWithoutInsurance'] = $ret - $insuranceTotal;
$outPriceInfo['totalInsurance'] = $insuranceTotal; $outPriceInfo['totalInsurance'] = $insuranceTotal;
if($outPriceInfo['departure_extra'] >= 0){ if ($outPriceInfo['departure_extra'] >= 0) {
$outPriceInfo['flight_price'] = $outPriceInfo['flight_price'] + $outPriceInfo['departure_extra']; $outPriceInfo['flight_price'] = $outPriceInfo['flight_price'] + $outPriceInfo['departure_extra'];
}else{ } else {
$outPriceInfo['flight_price'] = 0; $outPriceInfo['flight_price'] = 0;
} }
if($depositPercent === null) { if ($depositPercent === null) {
$depositPercent = 20; $depositPercent = 20;
} }
//Aeqypten (20% from price) //Aeqypten (20% from price)
if($categoryId == 1){ if ($categoryId == 1) {
$deposit = ($outPriceInfo['totalWithoutInsurance'] / 100 * $depositPercent); $deposit = ($outPriceInfo['totalWithoutInsurance'] / 100 * $depositPercent);
$outPriceInfo['deposit_total'] = $deposit; $outPriceInfo['deposit_total'] = $deposit;
$outPriceInfo['final_payment'] = ($outPriceInfo['totalWithoutInsurance'] - $outPriceInfo['deposit_total']); $outPriceInfo['final_payment'] = ($outPriceInfo['totalWithoutInsurance'] - $outPriceInfo['deposit_total']);
}else{ } else {
//all 100% vom Flugpreis und 20% von der Landleistung. //all 100% vom Flugpreis und 20% von der Landleistung.
$deposit = (($outPriceInfo['totalWithoutInsurance'] - $outPriceInfo['flight_price']) / 100 * $depositPercent); $deposit = (($outPriceInfo['totalWithoutInsurance'] - $outPriceInfo['flight_price']) / 100 * $depositPercent);
$outPriceInfo['deposit_total'] = ($deposit + $outPriceInfo['flight_price']); $outPriceInfo['deposit_total'] = ($deposit + $outPriceInfo['flight_price']);
@ -961,16 +936,13 @@ class BookingController extends Controller
{ {
$ret = []; $ret = [];
foreach($prices as $price) foreach ($prices as $price) {
{
$priceTypeId = $price->getPriceTypeId(); $priceTypeId = $price->getPriceTypeId();
//with children //with children
$priceType = $this->priceTypeById[$priceTypeId]; $priceType = $this->priceTypeById[$priceTypeId];
if($priceTypeId == 1 && $persons['singleRoomPersons'] > 0) if ($priceTypeId == 1 && $persons['singleRoomPersons'] > 0) {
{ for ($i = 0; $i < $persons['singleRoomPersons']; $i++) {
for($i = 0; $i < $persons['singleRoomPersons']; $i++)
{
$currentPersons = [ $currentPersons = [
'total' => 1, 'total' => 1,
'adults' => 1, 'adults' => 1,
@ -985,13 +957,11 @@ class BookingController extends Controller
} }
} }
if($priceTypeId == 1 && $persons['singleRoomChildPersons'] > 0) if ($priceTypeId == 1 && $persons['singleRoomChildPersons'] > 0) {
{
$priceTypeId = 2; $priceTypeId = 2;
$priceType = $this->priceTypeById[$priceTypeId]; $priceType = $this->priceTypeById[$priceTypeId];
for($i = 0; $i < $persons['singleRoomChildPersons']; $i++) for ($i = 0; $i < $persons['singleRoomChildPersons']; $i++) {
{
$currentPersons = [ $currentPersons = [
'total' => 1, 'total' => 1,
'adults' => 1, 'adults' => 1,
@ -1006,10 +976,8 @@ class BookingController extends Controller
} }
} }
if($priceTypeId == 3 && $persons['doubleRoomPersons'] > 0) if ($priceTypeId == 3 && $persons['doubleRoomPersons'] > 0) {
{ for ($j = 0; $j < ($persons['doubleRoomPersons'] / 2); $j++) {
for($j = 0; $j < ($persons['doubleRoomPersons'] / 2); $j++)
{
$currentPersons = [ $currentPersons = [
'total' => 2, 'total' => 2,
'adults' => 2, 'adults' => 2,
@ -1024,13 +992,11 @@ class BookingController extends Controller
} }
} }
if($priceTypeId == 3 && $persons['doubleRoomChildPersons'] > 0) if ($priceTypeId == 3 && $persons['doubleRoomChildPersons'] > 0) {
{
$priceTypeId = 4; $priceTypeId = 4;
$priceType = $this->priceTypeById[$priceTypeId]; $priceType = $this->priceTypeById[$priceTypeId];
for($j = 0; $j < ($persons['doubleRoomChildPersons'] / 2); $j++) for ($j = 0; $j < ($persons['doubleRoomChildPersons'] / 2); $j++) {
{
$currentPersons = [ $currentPersons = [
'total' => 2, 'total' => 2,
'adults' => 2, 'adults' => 2,
@ -1045,10 +1011,8 @@ class BookingController extends Controller
} }
} }
if($priceTypeId == 5 && $persons['tripleRoomPersons'] > 0) if ($priceTypeId == 5 && $persons['tripleRoomPersons'] > 0) {
{ for ($k = 0; $k < ($persons['tripleRoomPersons'] / 3); $k++) {
for($k = 0; $k < ($persons['tripleRoomPersons'] / 3); $k++)
{
$currentPersons = [ $currentPersons = [
'total' => 3, 'total' => 3,
'adults' => 3, 'adults' => 3,
@ -1063,13 +1027,11 @@ class BookingController extends Controller
} }
} }
if($priceTypeId == 5 && $persons['tripleRoomChildPersons'] > 0) if ($priceTypeId == 5 && $persons['tripleRoomChildPersons'] > 0) {
{
$priceTypeId = 7; $priceTypeId = 7;
$priceType = $this->priceTypeById[$priceTypeId]; $priceType = $this->priceTypeById[$priceTypeId];
for($k = 0; $k < ($persons['tripleRoomChildPersons'] / 3); $k++) for ($k = 0; $k < ($persons['tripleRoomChildPersons'] / 3); $k++) {
{
$currentPersons = [ $currentPersons = [
'total' => 3, 'total' => 3,
'adults' => 3, 'adults' => 3,

View file

@ -32,10 +32,32 @@ class ComponentController extends Controller
if(!$this->headerContent){ if(!$this->headerContent){
$this->headerContent = Util::loadFromApi('cms/header/info', ['url'=>""]); $this->headerContent = Util::loadFromApi('cms/header/info', ['url'=>""]);
} }
if (!$this->headerContent) {
$this->headerContent = $this->getEmptyHeaderContent();
}
return $this->headerContent; return $this->headerContent;
} }
private function getEmptyHeaderContent()
{
$inactive = (object) ['active' => 0, 'content' => ''];
return (object) [
'info' => (object) [
'office_important_note_active' => 0,
'office_important_note' => '',
'office_appointment' => '',
],
'available' => (object) [
'phone' => $inactive,
'local' => $inactive,
],
'local' => (object) [],
'phone' => (object) [],
];
}
public function getHeaderTravelProgram($page){ public function getHeaderTravelProgram($page){
$programmes = [ $programmes = [
@ -344,6 +366,18 @@ class ComponentController extends Controller
]); ]);
} }
public function newsSidebarWidgetAction($title = 'News', $limit = 3)
{
$limit = max(1, min(12, (int) $limit));
return $this->render('default/components/sidebar/pageSliderSidebarWidget.html.twig', [
'slider_title' => $title,
'target_widget' => 'news-widget',
'pages' => $this->getEntityManager()->getRepository('AppBundle:Page')->findHomepageNews($limit),
'theme' => 'gray-box',
]);
}
public function makeSidebarWidgetAction($site_loading = 'default', Page $page = null, $api=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;

View file

@ -99,12 +99,30 @@ class DefaultController extends Controller
} }
$pageRepo = $this->getEntityManager()->getRepository('AppBundle:Page'); $pageRepo = $this->getEntityManager()->getRepository('AppBundle:Page');
$sidebarWidgetRepo = $this->getEntityManager()->getRepository('AppBundle:SidebarWidget');
$plannableTripsWidget = $sidebarWidgetRepo->findActiveWidgetByComponent('homepagePlannableTrips');
$popularTripsWidget = $sidebarWidgetRepo->findActiveWidgetByComponent('homepagePopularTrips');
$newsWidget = $sidebarWidgetRepo->findActiveWidgetByComponent('newsSidebarWidget', 'home');
$homepageOfferPages = $popularTripsWidget
? $pageRepo->findActiveTravelPagesByIds($popularTripsWidget->getConfigPageIds())
: [];
$devHomeSidebarOfferPages = $plannableTripsWidget
? $pageRepo->findActiveTravelPagesByIds($plannableTripsWidget->getConfigPageIds())
: [];
if (empty($homepageOfferPages)) {
$homepageOfferPages = $pageRepo->findHomepageOffers();
}
if (empty($devHomeSidebarOfferPages)) {
$devHomeSidebarOfferPages = $pageRepo->findHomepageOffers(4);
}
$fewoLodgings = []; $fewoLodgings = [];
$lodgingGroups = $this->getEntityManager()->getRepository('AppBundle:FewoLodgingGroup')->findAll(); $lodgingGroups = $this->getEntityManager()->getRepository('AppBundle:FewoLodgingGroup')->findAll();
foreach ($lodgingGroups as $lodgingGroup) { foreach ($lodgingGroups as $lodgingGroup) {
foreach ($lodgingGroup->getLodgings() as $lodging) { foreach ($lodgingGroup->getLodgings() as $lodging) {
$fewoLodgings[] = $lodging; $fewoLodgings[] = $lodging;
if (count($fewoLodgings) >= 3) { if (count($fewoLodgings) >= 8) {
break 2; break 2;
} }
} }
@ -121,9 +139,18 @@ class DefaultController extends Controller
'e' => $search_request_e ? $search_request_e : null, 'e' => $search_request_e ? $search_request_e : null,
])->createView(), ])->createView(),
'tt_search_form' => $this->createForm(TtSearchRequestType::class)->createView(), 'tt_search_form' => $this->createForm(TtSearchRequestType::class)->createView(),
'homepage_offer_pages' => $pageRepo->findHomepageOffers(), 'homepage_offer_pages' => $homepageOfferPages,
'homepage_offer_title' => $popularTripsWidget && $popularTripsWidget->getName() ? $popularTripsWidget->getName() : 'beliebtesten Kulturreisen',
'homepage_offer_new_page_ids' => $popularTripsWidget ? $popularTripsWidget->getConfigNewPageIds() : [],
'country_pages' => $pageRepo->findHomepageCountryPages(), 'country_pages' => $pageRepo->findHomepageCountryPages(),
'fewo_lodgings' => $fewoLodgings, 'fewo_lodgings' => $fewoLodgings,
'dev_home_sidebar' => true,
'dev_home_sidebar_offer_title' => $plannableTripsWidget && $plannableTripsWidget->getName() ? $plannableTripsWidget->getName() : 'Aktuell planbare Reisen',
'dev_home_sidebar_offer_pages' => $devHomeSidebarOfferPages,
'dev_home_sidebar_new_badge_active' => $plannableTripsWidget ? $plannableTripsWidget->getConfigNewBadgeActive() : false,
'dev_home_sidebar_new_page_ids' => $plannableTripsWidget ? $plannableTripsWidget->getConfigNewPageIds() : [],
'dev_home_sidebar_news_title' => $newsWidget && $newsWidget->getName() ? $newsWidget->getName() : 'Reisenews',
'dev_home_sidebar_news_pages' => $pageRepo->findHomepageNews($newsWidget ? $newsWidget->getConfigNewsLimit() : 3),
]); ]);
} }

View file

@ -965,4 +965,27 @@ class BookingRequest
{ {
//$context-> //$context->
} }
public function checkIsRoomSelected()
{
if ($this->singleRoomCount > 0) {
return true;
}
if ($this->doubleRoomCount > 0) {
return true;
}
if ($this->tripleRoomCount > 0) {
return true;
}
if ($this->singleRoomChildCount > 0) {
return true;
}
if ($this->doubleRoomChildCount > 0) {
return true;
}
if ($this->tripleRoomChildCount > 0) {
return true;
}
return false;
}
} }

View file

@ -996,6 +996,22 @@ class Page
{ {
return $this->country; return $this->country;
} }
public function getHomepageCountryName()
{
if ($this->country) {
return $this->country->getName();
}
if ($this->travelProgram) {
foreach ($this->travelProgram->getCountries() as $country) {
return $country->getName();
}
}
return null;
}
/** /**
* Constructor * Constructor
*/ */
@ -1286,6 +1302,20 @@ class Page
return $this; return $this;
} }
/**
* Get boxBody / Image USED for Box Image by v3 CMS
*
* @return array|false
*/
public function getBoxBodyImage()
{
if($this->boxBody != ""){
$boxBodyImage = json_decode($this->boxBody, true);
return $boxBodyImage;
}
return false;
}
/** /**
* Get boxBody * Get boxBody
* *

View file

@ -134,6 +134,42 @@ class PageRepository extends NestedTreeRepository
return array_slice($pages, 0, $limit); return array_slice($pages, 0, $limit);
} }
public function findActiveTravelPagesByIds(array $ids)
{
$ids = array_values(array_filter(array_map('intval', $ids)));
if (empty($ids)) {
return [];
}
$pages = $this->createQueryBuilder('node')
->distinct()
->innerJoin('node.travelProgram', 'tp')
->addSelect('tp')
->leftJoin('tp.countries', 'c')
->addSelect('c')
->where('node.id IN (:ids)')
->andWhere('node.status = 1')
->andWhere('tp.status = 1')
->setParameter('ids', $ids)
->getQuery()
->execute();
$pagesById = [];
foreach ($pages as $page) {
$pagesById[$page->getId()] = $page;
}
$ret = [];
foreach ($ids as $id) {
if (isset($pagesById[$id])) {
$ret[] = $pagesById[$id];
}
}
return $ret;
}
/** /**
* @return Page[] * @return Page[]
*/ */
@ -155,6 +191,28 @@ class PageRepository extends NestedTreeRepository
return $pages; return $pages;
} }
/**
* @return Page[]
*/
public function findHomepageNews($limit = 3)
{
$rootPage = $this->find(3153);
if (!$rootPage) {
return [];
}
return $this->createQueryBuilder('node')
->where('node.parent = :rootPage')
->andWhere('node.showInNavi = 1')
->andWhere('node.status = 1')
->orderBy('node.date', 'DESC')
->addOrderBy('node.order', 'ASC')
->setParameter('rootPage', $rootPage)
->setMaxResults($limit)
->getQuery()
->execute();
}
private function getHomepagePriority(Page $page) private function getHomepagePriority(Page $page)
{ {
$haystack = $this->buildHomepageSortHaystack($page); $haystack = $this->buildHomepageSortHaystack($page);
@ -220,7 +278,7 @@ class PageRepository extends NestedTreeRepository
public function findTopCountryNavPages() public function findTopCountryNavPages()
{ {
return $this->createQueryBuilder('node') $pages = $this->createQueryBuilder('node')
->innerJoin('node.country', 'country') ->innerJoin('node.country', 'country')
->leftJoin('node.children', 'childPage', Expr\Join::WITH, 'childPage.status > 0') ->leftJoin('node.children', 'childPage', Expr\Join::WITH, 'childPage.status > 0')
->addSelect('childPage') ->addSelect('childPage')
@ -232,6 +290,25 @@ class PageRepository extends NestedTreeRepository
->getQuery() ->getQuery()
->execute() ->execute()
; ;
usort($pages, function (Page $a, Page $b) {
$priorityA = $this->getHomepagePriority($a);
$priorityB = $this->getHomepagePriority($b);
if ($priorityA !== $priorityB) {
return $priorityA - $priorityB;
}
$orderA = $a->getOrder() ?: 9999;
$orderB = $b->getOrder() ?: 9999;
if ($orderA !== $orderB) {
return $orderA - $orderB;
}
return strcasecmp($a->getTitle(), $b->getTitle());
});
return $pages;
} }
public function findFeedbacks($rootPageId) public function findFeedbacks($rootPageId)

View file

@ -146,6 +146,57 @@ class SidebarWidget
return $this->html; return $this->html;
} }
public function getConfig()
{
$config = json_decode($this->html, true);
if (!is_array($config)) {
return [];
}
return $config;
}
public function getConfigPageIds()
{
$config = $this->getConfig();
if (!isset($config['page_ids']) || !is_array($config['page_ids'])) {
return [];
}
return array_values(array_filter($config['page_ids']));
}
public function getConfigNewBadgeActive()
{
$config = $this->getConfig();
return !empty($config['new_badge_active']);
}
public function getConfigNewPageIds()
{
$config = $this->getConfig();
if (!isset($config['new_page_ids']) || !is_array($config['new_page_ids'])) {
return [];
}
return array_values(array_filter(array_map('intval', $config['new_page_ids'])));
}
public function getConfigNewsLimit()
{
$config = $this->getConfig();
if (!isset($config['news_limit'])) {
return 3;
}
return max(1, min(12, (int) $config['news_limit']));
}
/** /**
* Set showAt * Set showAt
* *

View file

@ -15,6 +15,8 @@ class SidebarWidgetRepository extends \Doctrine\ORM\EntityRepository
{ {
$qb = $this->createQueryBuilder('sidebar_widget'); $qb = $this->createQueryBuilder('sidebar_widget');
$qb->where('sidebar_widget.active = 1') $qb->where('sidebar_widget.active = 1')
->andWhere('sidebar_widget.component NOT IN (:configComponents)')
->setParameter('configComponents', ['homepagePlannableTrips', 'homepagePopularTrips'])
->addOrderBy('sidebar_widget.pos', 'ASC'); ->addOrderBy('sidebar_widget.pos', 'ASC');
$results = $qb->getQuery()->getResult(); $results = $qb->getQuery()->getResult();
@ -27,4 +29,23 @@ class SidebarWidgetRepository extends \Doctrine\ORM\EntityRepository
} }
return $ret; return $ret;
} }
public function findActiveWidgetByComponent($component, $site = null)
{
$qb = $this->createQueryBuilder('sidebar_widget');
$results = $qb->where('sidebar_widget.active = 1')
->andWhere('sidebar_widget.component = :component')
->setParameter('component', $component)
->addOrderBy('sidebar_widget.pos', 'ASC')
->getQuery()
->getResult();
foreach ($results as $result) {
if ($site === null || $result->getIsShowAt($site)) {
return $result;
}
}
return null;
}
} }

View file

@ -379,7 +379,23 @@ jQuery(document).ready(function($) {
/* ============================================== /* ==============================================
OWL CAROUSEL --> OWL CAROUSEL -->
=============================================== */ =============================================== */
var owl = $('.owl-fullwidth').owlCarousel({ function loadOwlCarouselBackgrounds(ctx$) {
$('.lozad[data-background-image]', ctx$).each(function () {
var image$ = $(this);
var backgroundImage = image$.attr('data-background-image');
if (backgroundImage) {
image$.css('background-image', 'url("' + backgroundImage + '")');
}
});
}
var owlFullwidth$ = $('.owl-fullwidth');
owlFullwidth$.on('initialized.owl.carousel translated.owl.carousel refreshed.owl.carousel', function () {
loadOwlCarouselBackgrounds($(this));
});
var owl = owlFullwidth$.owlCarousel({
loop:true, loop:true,
margin:0, margin:0,
nav:true, nav:true,
@ -399,6 +415,7 @@ jQuery(document).ready(function($) {
} }
}, },
}); });
loadOwlCarouselBackgrounds(owlFullwidth$);
/* ============================================== /* ==============================================
BOX LINK --> BOX LINK -->
@ -613,14 +630,31 @@ initGoTo();
$(document).ready(function() { $(document).ready(function() {
$('.st-booking-form').validator().on('submit', function (e) { $('.st-booking-form').validator().on('submit', function (e) {
if (e.isDefaultPrevented()) { if (e.isDefaultPrevented()) {
// handle the invalid form... $(".btn-booking-form .alert-danger").removeClass("hide");
} else { $(".btn-booking-form .alert-danger").addClass("show");
$(".btn-booking-form").attr("disabled", true);
} else {
$(".btn-booking-form .alert-danger").removeClass("hide");
$(".btn-booking-form .alert-danger").addClass("show");
$(".btn-booking-form").attr("disabled", true);
$(".btn-booking-form .btn-booking-submit").addClass("hide"); $(".btn-booking-form .btn-booking-submit").addClass("hide");
$(".btn-booking-form .btn-booking-loading").removeClass("hide"); $(".btn-booking-form .btn-booking-loading").removeClass("hide");
} }
}); });
$(".st-booking-form")
.validator()
.on("submit", function (t) {
(t.isDefaultPrevented(),
$(".btn-booking-form .alert-danger").removeClass("hide"),
$(".btn-booking-form .alert-danger").addClass("show")) ||
($(".btn-booking-form .alert-danger").removeClass("show"),
$(".btn-booking-form .alert-danger").addClass(""),
$(".btn-booking-form").attr("disabled", !0),
$(".btn-booking-form .btn-booking-submit").addClass("hide"),
$(".btn-booking-form .btn-booking-loading").removeClass("hide"));
});
var $topNavAccordion = $('#topNavAccordion'); var $topNavAccordion = $('#topNavAccordion');
$topNavAccordion.on('show.bs.collapse','.collapse', function() { $topNavAccordion.on('show.bs.collapse','.collapse', function() {
$topNavAccordion.find('.collapse.in').collapse('hide'); $topNavAccordion.find('.collapse.in').collapse('hide');

25192
web/js/custom-min.js vendored

File diff suppressed because one or more lines are too long