From ff9c159297818a0fb807b74729686e0b6a7e5499 Mon Sep 17 00:00:00 2001 From: uli Date: Tue, 21 Feb 2017 15:01:28 +0000 Subject: [PATCH] =?UTF-8?q?*=20Neues=20Form-Widget=20f=C3=BCr=20input=20+?= =?UTF-8?q?=20HTML5-datalist=20(autocomplete)=20*=20Layout=20head-Bereich:?= =?UTF-8?q?=20canonical-Tag=20und=20title-Tag,=20sowie=20robots/noindex,no?= =?UTF-8?q?follow=20f=C3=BCr=20einige=20Seiten=20*=20Abfahrtsorte=20in=20d?= =?UTF-8?q?er=20Suchmaske=20auf=20der=20Startseite=20angepasst=20*=20Trave?= =?UTF-8?q?ltainment-Suche:=20Suchergebnisseite,=20CMS-Template=20(mit=20S?= =?UTF-8?q?uchmaske=20oben),=20Sidebar-Widget=20*=20Behoben:=20Vorschaubil?= =?UTF-8?q?d=20von=20Reiseprogrammen=20wird=20nicht=20mehr=20angezeigt=20*?= =?UTF-8?q?=20Bewertung=20f=C3=BCr=20google-Ergebniseintrag=20(In=20der=20?= =?UTF-8?q?Sidebar)=20*=20E-Mail-Signatur=20korrigiert=20*=20Eltern-Templa?= =?UTF-8?q?te=20wird=20dynamisch=20bestimmt=20/=20Template=20ohne=20"Rahme?= =?UTF-8?q?n"=20wird=20f=C3=BCr=20AJAX-Anfragen=20verwendet=20*=20Termin-S?= =?UTF-8?q?tatus=20in=20Termintabelle=20auf=20Reiseprogrammseiten=20anzeig?= =?UTF-8?q?en=20*=20/create-tree=20:=20Reisef=C3=BChrer-Unterseiten=20mit?= =?UTF-8?q?=20Reisef=C3=BChrer-Hauptseite=20verkn=C3=BCpfen=20*=20Behoben:?= =?UTF-8?q?=20Exception=20bei=20=C3=96ffnen=20bestimmter=20Reisetermine;?= =?UTF-8?q?=20Bei=20diesen=20Terminen=20fehlen=20die=20Abfahrtsorte=20*=20?= =?UTF-8?q?Behoben:=20Video=20klappt=20erst=20beim=202.=20Klick=20aus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3299 f459cee4-fb09-11de-96c3-f9c5f16c3c76 --- trunk/app/Resources/views/base.html.twig | 22 + .../default/components/home/slider.html.twig | 124 +++ .../default/components/pageBox.html.twig | 2 +- .../default/components/sidebar.html.twig | 15 +- .../sidebar/ttSearchSidebarWidget.html.twig | 21 + .../views/default/components/slider.html.twig | 188 ----- .../components/ttBodySearchForm.html.twig | 30 + .../email/components/signature.txt.twig | 4 +- .../views/default/form/helpers.html.twig | 3 + .../views/default/form/theme.html.twig | 10 + .../views/default/pages/booking.html.twig | 3 +- .../pages/bookingConfirmation.html.twig | 2 + .../views/default/pages/home.html.twig | 6 +- .../views/default/pages/search.html.twig | 14 +- .../default/pages/travelProgram.html.twig | 9 +- .../default/pages/traveltainment.html.twig | 17 + .../views/default/pages/ttSearch.html.twig | 20 + trunk/app/config/services.yml | 5 + .../Controller/DefaultController.php | 103 ++- trunk/src/AppBundle/Entity/BookingRequest.php | 3 - trunk/src/AppBundle/Entity/TravelDate.php | 2 +- trunk/src/AppBundle/Form/DatalistType.php | 37 + .../src/AppBundle/Form/SearchRequestType.php | 10 +- .../AppBundle/Form/TtSearchRequestType.php | 732 ++++++++++++++++++ .../AppBundle/Resources/public/js/custom.js | 2 +- trunk/src/AppBundle/Twig/AppExtension.php | 7 + trunk/src/AppBundle/Util/DepartureUtil.php | 5 + 27 files changed, 1167 insertions(+), 229 deletions(-) create mode 100644 trunk/app/Resources/views/default/components/home/slider.html.twig create mode 100644 trunk/app/Resources/views/default/components/sidebar/ttSearchSidebarWidget.html.twig delete mode 100644 trunk/app/Resources/views/default/components/slider.html.twig create mode 100644 trunk/app/Resources/views/default/components/ttBodySearchForm.html.twig create mode 100644 trunk/app/Resources/views/default/pages/traveltainment.html.twig create mode 100644 trunk/app/Resources/views/default/pages/ttSearch.html.twig create mode 100644 trunk/src/AppBundle/Form/DatalistType.php create mode 100644 trunk/src/AppBundle/Form/TtSearchRequestType.php diff --git a/trunk/app/Resources/views/base.html.twig b/trunk/app/Resources/views/base.html.twig index 31a1c812..6bf30fa5 100644 --- a/trunk/app/Resources/views/base.html.twig +++ b/trunk/app/Resources/views/base.html.twig @@ -5,6 +5,12 @@ + + {% block page_title %} + {{ page is defined ? page.pagetitle : 'Kulturreisen vom Reiseveranstalter STERN TOURS aus Berlin' }} + {% endblock page_title %} + + {% block metatags %} @@ -19,6 +25,22 @@ + {% block canonical_tag %} + {% block canonical_url %} + {% if canonical_url is not defined and page is defined %} + {% if page.canonicalUrl is not empty %} + {% set canonical_url = (page.canonicalUrl starts with '/' ? get_base_url()) ~ page.canonicalUrl %} + {% else %} + {% set canonical_url = get_base_url() ~ page.urlPath %} + {% endif %} + {% endif %} + {% endblock %} + {% if canonical_url is defined %} + + + {% endif %} + {% endblock %} + {% block stylesheets %} {% stylesheets 'bundles/app/css/bootstrap-3.3.7.css' diff --git a/trunk/app/Resources/views/default/components/home/slider.html.twig b/trunk/app/Resources/views/default/components/home/slider.html.twig new file mode 100644 index 00000000..b18e232b --- /dev/null +++ b/trunk/app/Resources/views/default/components/home/slider.html.twig @@ -0,0 +1,124 @@ +{% form_theme search_form 'default/form/theme.html.twig' %} + +
+
+
+
+
+
+
+
+ eKomi - The Feedback Company: +
+
    +
  • Spezialist für Kulturreisen
  • +
  • Reiseexperte seit 1998
  • +
  • Beratung für individuelle Reisen
  • +
+
+
+
+
+
+
+ +
+ + + +
+
+
+
+ + + +
+
+
+
+ {{ form_field_pho(search_form.c) }} +
+ +
+ {{ form_field_pho(search_form.b, 'Anreise') }} +
+
+ {{ form_field_pho(search_form.e, 'Abreise') }} +
+ +
+ + +
+ +
+ +
+
+
+ +
+ {% include 'default/components/ttBodySearchForm.html.twig' %} +
+ +
+
+
+
+
\ No newline at end of file diff --git a/trunk/app/Resources/views/default/components/pageBox.html.twig b/trunk/app/Resources/views/default/components/pageBox.html.twig index a35aa6c0..00ede503 100644 --- a/trunk/app/Resources/views/default/components/pageBox.html.twig +++ b/trunk/app/Resources/views/default/components/pageBox.html.twig @@ -18,7 +18,7 @@ {% if child_page.boxImageUrl is not empty %} {% set image_url = child_page.boxImageUrl %} {% set image_alt = child_page.travelProgram.title|default(child_page.title) %} - {% elseif child_page.boxImageUrl is not empty %} + {% elseif child_page.travelProgram is not empty and child_page.travelProgram.previewImage is not empty %} {% set image_url = '/uploads/travel_program/' ~ child_page.travelProgram.previewImage.fileNameWithExtension %} {% set image_alt = child_page.title %} {% else %} diff --git a/trunk/app/Resources/views/default/components/sidebar.html.twig b/trunk/app/Resources/views/default/components/sidebar.html.twig index a1118011..72b29519 100644 --- a/trunk/app/Resources/views/default/components/sidebar.html.twig +++ b/trunk/app/Resources/views/default/components/sidebar.html.twig @@ -1,6 +1,6 @@ + +
+
+ STERN TOURS Online-Shop
+ + 4.90 / 5 + + bei 66 Bewertungen +
+
+ diff --git a/trunk/app/Resources/views/default/components/sidebar/ttSearchSidebarWidget.html.twig b/trunk/app/Resources/views/default/components/sidebar/ttSearchSidebarWidget.html.twig new file mode 100644 index 00000000..c8502d27 --- /dev/null +++ b/trunk/app/Resources/views/default/components/sidebar/ttSearchSidebarWidget.html.twig @@ -0,0 +1,21 @@ +{% form_theme tt_search_form 'default/form/theme.html.twig' %} +
+
+
{{ form_field_pho(tt_search_form.termin, 'Früheste Anreise') }}
+
{{ form_field_pho(tt_search_form.ruecktermin, 'Späteste Abreise') }}
+
{{ form_field_pho(tt_search_form.dauer) }}
+
{{ form_field_pho(tt_search_form.topRegion, 'Reiseziel') }}
+
{{ form_field_pho(tt_search_form.abflughafen, 'Abflughafen') }}
+
{{ form_field_pho(tt_search_form.shotel, 'Hotelname') }}
+
{{ form_field_pho(tt_search_form.kategorie) }}
+
{{ form_field_pho(tt_search_form.zimmer) }}
+
{{ form_field_pho(tt_search_form.t) }}
+
{{ form_field_pho(tt_search_form.child0) }}
+
{{ form_field_pho(tt_search_form.child1) }}
+
{{ form_field_pho(tt_search_form.child2) }}
+ +
+ +
+
+
\ No newline at end of file diff --git a/trunk/app/Resources/views/default/components/slider.html.twig b/trunk/app/Resources/views/default/components/slider.html.twig deleted file mode 100644 index 0c5016f3..00000000 --- a/trunk/app/Resources/views/default/components/slider.html.twig +++ /dev/null @@ -1,188 +0,0 @@ -
-
-
-
-
-
-
-
- eKomi - The Feedback Company: -
-
    -
  • Spezialist für Kulturreisen
  • -
  • Reiseexperte seit 1998
  • -
  • Beratung für individuelle Reisen
  • -
-
-
-
-
-
-
- -
- - - -
-
-
-
- - - -
-
-
-
- -
- -
-
- -
-
-
-
-
- -
-
-
- -
- -
- -
- -
-
-
- -
-
- -
- -
- -
-
- - - - - - -
- -
-
- -
-
- - - - - -
- -
- - - - - - - -
- -
- - - - - - - -
- - -
- -
- -
-
-
-
-
-
-
\ No newline at end of file diff --git a/trunk/app/Resources/views/default/components/ttBodySearchForm.html.twig b/trunk/app/Resources/views/default/components/ttBodySearchForm.html.twig new file mode 100644 index 00000000..4fdd7665 --- /dev/null +++ b/trunk/app/Resources/views/default/components/ttBodySearchForm.html.twig @@ -0,0 +1,30 @@ +{% form_theme tt_search_form 'default/form/theme.html.twig' %} + +
+
+
{{ form_field_pho(tt_search_form.termin, 'Früheste Anreise') }}
+
{{ form_field_pho(tt_search_form.ruecktermin, 'Späteste Abreise') }}
+
{{ form_field_pho(tt_search_form.dauer) }}
+
{{ form_field_pho(tt_search_form.topRegion, 'Reiseziel') }}
+
+ +
+
{{ form_field_pho(tt_search_form.abflughafen, 'Abflughafen') }}
+
{{ form_field_pho(tt_search_form.shotel, 'Hotelname') }}
+
{{ form_field_pho(tt_search_form.kategorie) }}
+
{{ form_field_pho(tt_search_form.zimmer) }}
+
+ +
+
{{ form_field_pho(tt_search_form.t) }}
+
{{ form_field_pho(tt_search_form.child0) }}
+
{{ form_field_pho(tt_search_form.child1) }}
+
{{ form_field_pho(tt_search_form.child2) }}
+
+ + {% block tt_body_search_form_submit %} +
+ +
+ {% endblock %} +
\ No newline at end of file diff --git a/trunk/app/Resources/views/default/email/components/signature.txt.twig b/trunk/app/Resources/views/default/email/components/signature.txt.twig index 2323278e..f0ce77ba 100644 --- a/trunk/app/Resources/views/default/email/components/signature.txt.twig +++ b/trunk/app/Resources/views/default/email/components/signature.txt.twig @@ -3,7 +3,7 @@ Ihr Team von STERN TOURS -- -STERN TOURS Travelservice GmbH +STERN TOURS GmbH Uhlandstr. 137 10717 Berlin @@ -14,6 +14,6 @@ Fax: 030 / 700 94 1044 Registergericht: Amtsgericht Charlottenburg Registernummer: HRB 67111 -Steuernummer: 27/016/10728 +Steuernummer: 27/545/30703 UST-Ident.-Nr.: DE192609253 Finanzamt: Wilmersdorf \ No newline at end of file diff --git a/trunk/app/Resources/views/default/form/helpers.html.twig b/trunk/app/Resources/views/default/form/helpers.html.twig index 03bef70b..1bc4bb12 100644 --- a/trunk/app/Resources/views/default/form/helpers.html.twig +++ b/trunk/app/Resources/views/default/form/helpers.html.twig @@ -5,6 +5,9 @@ {%- endblock form_field -%} {%- block form_field_pho -%} + {%- if label is empty -%} + {%- set label = form.vars.placeholder -%} + {%- endif -%} {%- set opt = opt|merge({ label_attr: (opt.label_attr ?? {})|merge({class: (opt.label_attr.class|default('') ~ ' sr-only')|trim}), attr: (opt.attr ?? {})|merge({placeholder: opt.attr.placeholder|default( diff --git a/trunk/app/Resources/views/default/form/theme.html.twig b/trunk/app/Resources/views/default/form/theme.html.twig index cf74e925..0741869c 100644 --- a/trunk/app/Resources/views/default/form/theme.html.twig +++ b/trunk/app/Resources/views/default/form/theme.html.twig @@ -32,6 +32,16 @@ {{- block('base_radio_widget') -}} {%- endblock radio_widget %} +{% block datalist_widget -%} + {% set attr = attr|merge({list: attr.list|default(id ~ '_list')}) -%} + {{ block('form_widget_simple') -}} + + {% for choice in choices %} + + {% endfor %} + +{%- endblock datalist_widget %} + {% block form_label -%} {%- if required -%} {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' st-required')|trim}) -%} diff --git a/trunk/app/Resources/views/default/pages/booking.html.twig b/trunk/app/Resources/views/default/pages/booking.html.twig index 3faa8e5e..89ff6997 100644 --- a/trunk/app/Resources/views/default/pages/booking.html.twig +++ b/trunk/app/Resources/views/default/pages/booking.html.twig @@ -3,8 +3,9 @@ {% block metatags %} {{ parent() }} - + {% endblock %} +{% block canonical_tag %}{% endblock %} {% block stylesheets %} {{ parent() }} diff --git a/trunk/app/Resources/views/default/pages/bookingConfirmation.html.twig b/trunk/app/Resources/views/default/pages/bookingConfirmation.html.twig index db6caca2..a22f3638 100644 --- a/trunk/app/Resources/views/default/pages/bookingConfirmation.html.twig +++ b/trunk/app/Resources/views/default/pages/bookingConfirmation.html.twig @@ -1,5 +1,7 @@ {% extends 'base.html.twig' %} +{% block canonical_tag %}{% endblock %} + {% block body %}

Vielen Dank für Ihren Buchungsauftrag!

{% endblock %} \ No newline at end of file diff --git a/trunk/app/Resources/views/default/pages/home.html.twig b/trunk/app/Resources/views/default/pages/home.html.twig index 2696264b..705ef305 100644 --- a/trunk/app/Resources/views/default/pages/home.html.twig +++ b/trunk/app/Resources/views/default/pages/home.html.twig @@ -1,7 +1,11 @@ {% extends 'base.html.twig' %} +{% block canonical_url %} + {% set canonical_url = get_base_url() ~ '/' %} +{% endblock %} + {% block header2 %} - {% include 'default/components/slider.html.twig' %} + {% include 'default/components/home/slider.html.twig' %} {% endblock %} {% block breadcrumb %}{% endblock %} diff --git a/trunk/app/Resources/views/default/pages/search.html.twig b/trunk/app/Resources/views/default/pages/search.html.twig index 8415b69c..16535031 100644 --- a/trunk/app/Resources/views/default/pages/search.html.twig +++ b/trunk/app/Resources/views/default/pages/search.html.twig @@ -26,11 +26,13 @@ >
- - - Druckversion - - + + {# #TODO + + Druckversion + + #} +
{{ travel_program.title }}
{{ travel_program.subtitle }}
@@ -92,7 +94,7 @@ - Verfügbarkeit diff --git a/trunk/app/Resources/views/default/pages/travelProgram.html.twig b/trunk/app/Resources/views/default/pages/travelProgram.html.twig index 42bbfd88..a6672ce1 100644 --- a/trunk/app/Resources/views/default/pages/travelProgram.html.twig +++ b/trunk/app/Resources/views/default/pages/travelProgram.html.twig @@ -182,7 +182,8 @@ Preis p.P im Doppelzimmer Preis p.P im Einzelzimmer Abflugorte / Zuschläge - Buchung + Status + Buchungsformular @@ -251,12 +252,16 @@ 'id': loop.index0 } %} + + Verfügbarkeit + - Buchungsformular + Weiter diff --git a/trunk/app/Resources/views/default/pages/traveltainment.html.twig b/trunk/app/Resources/views/default/pages/traveltainment.html.twig new file mode 100644 index 00000000..9ffe420c --- /dev/null +++ b/trunk/app/Resources/views/default/pages/traveltainment.html.twig @@ -0,0 +1,17 @@ +{% extends get_base_template() %} + +{% block body %} +
+ {% embed 'default/components/ttBodySearchForm.html.twig' %} + {% block tt_body_search_form_submit %} +
+ +
+ {% endblock %} + {% endembed %} +
+ +
+ {{ page.content|raw|keywords }} +
+{% endblock %} \ No newline at end of file diff --git a/trunk/app/Resources/views/default/pages/ttSearch.html.twig b/trunk/app/Resources/views/default/pages/ttSearch.html.twig new file mode 100644 index 00000000..6d1316b7 --- /dev/null +++ b/trunk/app/Resources/views/default/pages/ttSearch.html.twig @@ -0,0 +1,20 @@ +{% extends get_base_template() %} + +{% block metatags %} + {{ parent() }} + +{% endblock %} + +{% block search_sidebar_widget %} + {{ include('default/components/sidebar/ttSearchSidebarWidget.html.twig') }} +{% endblock %} + +{% block body %} + {% if tt_url is defined %} + + {% else %} +

Es konnten leider keine Ergebnisse gefunden werden.

+ {% endif %} +{% endblock body %} \ No newline at end of file diff --git a/trunk/app/config/services.yml b/trunk/app/config/services.yml index b32a4abd..defd92d4 100644 --- a/trunk/app/config/services.yml +++ b/trunk/app/config/services.yml @@ -26,6 +26,11 @@ services: tags: - { name: twig.extension } + form.type.datalist_type: + class: AppBundle\Form\DatalistType + tags: + - { name: form.type, alias: datalist } + app.booking_exporter: class: AppBundle\Export\SternToursCrmBookingExporter arguments: diff --git a/trunk/src/AppBundle/Controller/DefaultController.php b/trunk/src/AppBundle/Controller/DefaultController.php index 7080c230..37f4027e 100644 --- a/trunk/src/AppBundle/Controller/DefaultController.php +++ b/trunk/src/AppBundle/Controller/DefaultController.php @@ -6,6 +6,7 @@ use AppBundle\Entity\BreadcrumbEntry; use AppBundle\Entity\Page; use AppBundle\Entity\TravelProgram; use AppBundle\Form\SearchRequestType; +use AppBundle\Form\TtSearchRequestType; use AppBundle\Util; use Doctrine\ORM\EntityManager; use Doctrine\ORM\Query\Expr; @@ -27,8 +28,7 @@ class DefaultController extends Controller public function defaultAction(Request $request) { - // #TODO 404 - die ("caught"); + throw new $this->createNotFoundException(); } /** @@ -36,14 +36,12 @@ class DefaultController extends Controller */ public function homeAction() { - //$departures = $this->getEntityManager()->getRepository('AppBundle:TravelDeparturePoint')->findAll(); - $destinations = $this->getEntityManager()->getRepository('AppBundle:TravelCountry')->findAll(); - return $this->render('default/pages/home.html.twig', [ 'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR, - 'destinations' => $destinations, - 'startDate' => new \DateTime('+5 day'), - 'endDate' => new \DateTime('+19 day') + 'canonical_url' => Util::getBaseUrl() .'/', + 'show_search_sidebar_widget' => false, + 'search_form' => $this->createForm(SearchRequestType::class)->createView(), + 'tt_search_form' => $this->createForm(TtSearchRequestType::class)->createView(), ]); } @@ -51,7 +49,7 @@ class DefaultController extends Controller { return $this->render('default/pages/default.html.twig', [ 'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR, - 'page' => $page + 'page' => $page, ]); } @@ -60,14 +58,6 @@ class DefaultController extends Controller return $this->render('default/pages/overview.html.twig', [ 'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR, 'page' => $page, - - // #WORKAROUND Special navigation logic here adapted from the old website: Don't show child entries - // #TODO Only applies at level 0 - /* - 'nav_pages' => $page->getChildren(), - 'nav_child_pages' => [], - 'nav_open_node' => null - */ ]); } @@ -108,6 +98,17 @@ class DefaultController extends Controller ]); } + public function cmsTraveltainmentAction(Page $page) + { + $form = $this->createForm(TtSearchRequestType::class); + + return $this->render('default/pages/traveltainment.html.twig', [ + 'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR, + 'page' => $page, + 'tt_search_form' => $form->createView(), + ]); + } + public function cmsTravelProgramAction(Page $page) { $this->getDoctrine()->getRepository('AppBundle:TravelPeriod')->getTrueTravelPeriods($page->getTravelProgram()); @@ -160,6 +161,69 @@ class DefaultController extends Controller ]); } + /** + * @Route("/tt-suche") + */ + public function ttSearchAction(Request $request) + { + $form = $this->createForm(TtSearchRequestType::class); + $form->handleRequest($request); + + if ($form->isValid()) + { + $data = $form->getData(); + + $ttUrl = 'http://www.vidado.com/booking/ibe_bp2/index.php?CID=8ce65750ce5af9d9a6b22c9b04772ea7&formular=4&engine=pauschal&showresult=1'; + $ttUrl .= '&termin=' . $data['termin']->format('d.m.Y'); + $ttUrl .= '&ruecktermin=' . $data['ruecktermin']->format('d.m.Y'); + if (!empty($data['dauer'])) $ttUrl .= '&dauer='. $data['dauer']; + if (!empty($data['t'])) + { + $ttUrl .= '&personen=25'. str_repeat(';25', $data['t']); + for ($i = 0; $i < 3; ++$i) + { + if (!empty($data['child'.$i])) + { + $ttUrl .= ';'. $data['child'. $i]; + } + } + } + $ttUrl .= '&detail='; + if (!empty($data['topRegion']) && isset(TtSearchRequestType::$DESTINATION_CHOICES[$data['topRegion']])) + { + $ttUrl .= 'hotel&topRegion='. TtSearchRequestType::$DESTINATION_CHOICES[$data['topRegion']]; + } + else + { + $ttUrl .= 'zielgebiet'; + } + if (!empty($data['abflughafen'])) $ttUrl .= '&abflughafen='. $data['abflughafen']; + if (!empty($data['shotel'])) $ttUrl .= '&shotel='. urlencode($data['shotel']); + if (!empty($data['kategorie'])) $ttUrl .= '&kategorie='. $data['kategorie']; + if (!empty($data['zimmer'])) $ttUrl .= '&zimmer='. $data['zimmer']; + if (!empty($data['verpflegung'])) $ttUrl .= '&verpflegung='. $data['verpflegung']; + if (!empty($data['hbfges'])) $ttUrl .= '&hbfges='. $data['hbfges']; + if (!empty($data['hbfanz'])) $ttUrl .= '&hbfanz='. $data['hbfanz']; + if (!empty($data['hbfempf'])) $ttUrl .= '&hbfempf='. $data['hbfempf']; + if ($data['familie_kinder'] ?? false) $ttUrl .= '&familie_kinder=0'; + if ($data['strand'] ?? false) $ttUrl .= '&strand=0'; + if ($data['wellness'] ?? false) $ttUrl .= '&wellness=0'; + if ($data['typ'] ?? false) $ttUrl .= '&typ=0'; + if (!empty($data['sportangebot'])) $ttUrl .= '&sportangebot='. $data['sportangebot']; + + //die($ttUrl); + //http://www.vidado.com/booking/ibe_bp2/index.php?CID=8ce65750ce5af9d9a6b22c9b04772ea7&formular=4&engine=pauschal&detail=hotel&showresult=1&termin=26.02.2017&ruecktermin=12.03.2017&dauer=6_14&personen=25;25&abflughafen=-1&topRegion=727 + //http://www.vidado.com/booking/ibe_bp2/index.php?CID=8ce65750ce5af9d9a6b22c9b04772ea7&formular=4&engine=pauschal&detail=zielgebiet&showresult=1&termin=26.02.2017&ruecktermin=12.03.2017&dauer=6_14&personen=25;25&abflughafen=-1&topRegion= + } + + return $this->render('default/pages/ttSearch.html.twig', [ + 'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR, + 'breadcrumb_entries' => [new BreadcrumbEntry('Suchen')], + 'tt_search_form' => $form->createView(), + 'tt_url' => $ttUrl ?? null, + ]); + } + public function headerAction() { $qb = $this->getEntityManager()->createQueryBuilder(); @@ -255,8 +319,6 @@ class DefaultController extends Controller } return $this->render('default/components/sidebar/searchSidebarWidget.html.twig', [ 'search_form' => $this->createForm(SearchRequestType::class, [ - 'b' => new \DateTime('+5 day'), - 'e' => new \DateTime('+19 day'), 'c' => $destination, 'c2' => $combinedDestination, ])->createView() @@ -302,6 +364,8 @@ class DefaultController extends Controller $em->getConnection()->executeUpdate('UPDATE page SET owner = 47 WHERE catalog_id = 3 AND owner = 0'); $em->getConnection()->executeUpdate('UPDATE page SET owner = 66 WHERE catalog_id = 6 AND owner = 0'); $em->getConnection()->executeUpdate('UPDATE page SET owner = 2803 WHERE catalog_id = 14 AND owner = 0'); + // Add missing owner relation + $em->getConnection()->executeUpdate('UPDATE page SET owner = 13 WHERE id in (1314,1426,1472,1548)'); $lft = 0; $this->createTree(0, $lft, 0); @@ -311,6 +375,7 @@ class DefaultController extends Controller $em->getConnection()->executeUpdate('UPDATE page SET owner = 0 WHERE parent_id = 47 AND catalog_id = 3'); $em->getConnection()->executeUpdate('UPDATE page SET owner = 0 WHERE parent_id = 66 AND catalog_id = 6'); $em->getConnection()->executeUpdate('UPDATE page SET owner = 0 WHERE parent_id = 2803 AND catalog_id = 14'); + $em->getConnection()->executeUpdate('UPDATE page SET owner = 0 WHERE id in (1314,1426,1472,1548)'); $em->commit(); diff --git a/trunk/src/AppBundle/Entity/BookingRequest.php b/trunk/src/AppBundle/Entity/BookingRequest.php index bee26b49..5ff0696a 100644 --- a/trunk/src/AppBundle/Entity/BookingRequest.php +++ b/trunk/src/AppBundle/Entity/BookingRequest.php @@ -78,9 +78,6 @@ class BookingRequest */ private $email; - /* - * @ Assert\Valid() - */ private $travelers = []; private $notes; diff --git a/trunk/src/AppBundle/Entity/TravelDate.php b/trunk/src/AppBundle/Entity/TravelDate.php index 1bbb9574..21ead819 100644 --- a/trunk/src/AppBundle/Entity/TravelDate.php +++ b/trunk/src/AppBundle/Entity/TravelDate.php @@ -182,7 +182,7 @@ final class TravelDate $departures = $this->flightPeriod === null ? [] : $this->flightPeriod->getDepartures(); } $defaultDepartures = DepartureUtil::filterDeparturesByPeriod($defaultDepartures, $this->start, $this->end, true); - $this->departures = DepartureUtil::mergeDeparturesWithDefaults($defaultDepartures, $departures, true); + $this->departures = DepartureUtil::mergeDeparturesWithDefaults($departures, $defaultDepartures, true); } return $this->departures; } diff --git a/trunk/src/AppBundle/Form/DatalistType.php b/trunk/src/AppBundle/Form/DatalistType.php new file mode 100644 index 00000000..39e9ef83 --- /dev/null +++ b/trunk/src/AppBundle/Form/DatalistType.php @@ -0,0 +1,37 @@ + + * @date 02/20/2017 + */ + +namespace AppBundle\Form; + + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\TextType; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\FormView; +use Symfony\Component\OptionsResolver\OptionsResolver; + +class DatalistType extends AbstractType +{ + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setRequired(['choices']); + } + + public function buildView(FormView $view, FormInterface $form, array $options) + { + $view->vars['choices'] = $options['choices']; + } + + public function getName() + { + return 'datalist'; + } + + public function getParent() + { + return TextType::class; + } +} \ No newline at end of file diff --git a/trunk/src/AppBundle/Form/SearchRequestType.php b/trunk/src/AppBundle/Form/SearchRequestType.php index e40099f0..c22a17c7 100644 --- a/trunk/src/AppBundle/Form/SearchRequestType.php +++ b/trunk/src/AppBundle/Form/SearchRequestType.php @@ -22,8 +22,14 @@ class SearchRequestType extends AbstractType { $builder->setMethod('GET'); $builder - ->add('b', StDateType::class, ['required' => false]) - ->add('e', StDateType::class, ['required' => false]) + ->add('b', StDateType::class, [ + 'required' => false, + 'data' => new \DateTime('+5 day'), + ]) + ->add('e', StDateType::class, [ + 'required' => false, + 'data' => new \DateTime('+19 day'), + ]) ->add('c', EntityType::class, [ 'required' => false, 'placeholder' => 'beliebiges Reiseziel', diff --git a/trunk/src/AppBundle/Form/TtSearchRequestType.php b/trunk/src/AppBundle/Form/TtSearchRequestType.php new file mode 100644 index 00000000..2da7fd94 --- /dev/null +++ b/trunk/src/AppBundle/Form/TtSearchRequestType.php @@ -0,0 +1,732 @@ + + * @date 02/17/2017 + */ + +namespace AppBundle\Form; + + +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Symfony\Component\Form\Extension\Core\Type\TextType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; + +class TtSearchRequestType extends AbstractType +{ + /** + * @param FormBuilderInterface $builder + * @param array $options + */ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $childChoices = ['< 2 Jahre' => 1]; + for ($i = 2; $i <= 16; ++$i) + { + $childChoices[$i .' Jahre'] = $i; + } + $defaultStartDate = new \DateTime('+5 day'); + $defaultEndDate = new \DateTime('+19 day'); + + $builder->setMethod('GET'); + $builder + ->add('termin', StDateType::class, [ + 'required' => false, + 'empty_data' => $defaultStartDate->format('d.m.Y'), + 'data' => $defaultStartDate, + ]) + ->add('ruecktermin', StDateType::class, [ + 'required' => false, + 'empty_data' => $defaultEndDate->format('d.m.Y'), + 'data' => $defaultEndDate, + ]) + ->add('dauer', ChoiceType::class, [ + 'required' => false, + 'empty_data' => '6_14', + 'placeholder' => 'beliebige Reisedauer', + 'choices' => self::$DURATION_CHOICES, + ]) + ->add('topRegion', DatalistType::class, [ + 'required' => false, + 'choices' => array_keys(self::$DESTINATION_CHOICES), + ]) + ->add('t', ChoiceType::class, [ + 'choices' => self::$TRAVELER_CHOICES, + ]) + ; + for ($i = 0; $i < 3; ++$i) + { + $builder->add('child'. $i, ChoiceType::class, [ + 'required' => false, + 'placeholder' => 'Kind '. ($i + 1) .' - nicht vorhanden', + 'choices' => $childChoices + ]); + } + $builder + ->add('abflughafen', ChoiceType::class, [ + 'required' => false, + 'placeholder' => 'Abflughafen - beliebig', + 'choices' => self::$DEPARTURE_CHOICES, + ]) + ->add('shotel', TextType::class, ['required' => false]) + ->add('kategorie', ChoiceType::class, [ + 'required' => false, + 'placeholder' => 'Hotel - beliebig', + 'choices' => self::$HOTEL_CATEGORY_CHOICES, + ]) + ->add('zimmer', ChoiceType::class, [ + 'required' => false, + 'placeholder' => 'Zimmertyp - beliebig', + 'choices' => self::$ROOM_TYPE_CHOICES, + ]) + ->add('verpflegung', ChoiceType::class, [ + 'required' => false, + 'placeholder' => 'Verpflegung - beliebig', + 'choices' => self::$FARE_CHOICES + ]) + ->add('hbfges', ChoiceType::class, [ + 'required' => false, + 'placeholder' => 'Bewertung - beliebig', + 'choices' => self::$HOTEL_RATING_CHOICES, + ]) + ->add('hbfanz', ChoiceType::class, [ + 'required' => false, + 'placeholder' => 'Anzahl Bewertungen - beliebig', + 'choices' => self::$HOTEL_RATING_COUNT_CHOICES, + ]) + ->add('hbfempf', ChoiceType::class, [ + 'required' => false, + 'placeholder' => 'Weiterempfehlungen - beliebig', + 'choices' => self::$HOTEL_RECOMM_CHOICES, + ]) + ->add('familie_kinder', CheckboxType::class, ['required' => false]) + ->add('strand', CheckboxType::class, ['required' => false]) + ->add('wellness', CheckboxType::class, ['required' => false]) + ->add('typ', CheckboxType::class, ['required' => false]) + ->add('sportangebot', ChoiceType::class, [ + 'required' => false, + 'placeholder' => 'Sportangebot - beliebig', + 'choices' => self::$SPORT_CHOICES, + ]) + ; + } + + /** + * @param OptionsResolver $resolver + */ + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults(array( + 'csrf_protection' => false, + )); + } + + public function getBlockPrefix() + { + return null; + } + + private static $TRAVELER_CHOICES = [ + '1 Erwachsene(r)' => 1, + '2 Erwachsene' => 2, + '3 Erwachsene' => 3, + '4 Erwachsene' => 4, + ]; + + private static $DURATION_CHOICES = [ + '1 - 4 Tage' => '9', + '5 - 8 Tage' => '10', + '1 Woche' => '6_7', + '9 - 12 Tage' => '7', + '13 - 15 Tage' => '3', + '2 Wochen' => '6_14', + '16 - 22 Tage' => '12', + '3 Wochen' => '6_21', + '> 22 Tage oder länger' => '13', + ]; + + private static $HOTEL_CATEGORY_CHOICES = [ + '2 Sterne' => 0, + '3 Sterne' => 1, + '4 Sterne' => 2, + '5 Sterne' => 3, + ]; + + private static $ROOM_TYPE_CHOICES = [ + 'Einzelzimmer' => 5, + 'Doppelzimmer' => 6, + 'Familienzimmer' => 2, + 'Bungalow' => 0, + 'Appartment' => 7, + ]; + + private static $FARE_CHOICES = [ + 'nur Übernachtung' => 0, + 'Frühstück' => 1, + 'Halbpension' => 2, + 'Vollpension' => 3, + 'All Inclusive' => 4, + ]; + + private static $HOTEL_RATING_CHOICES = [ + 'min. 3.0 von 6.0' => 30, + 'min. 4.0 von 6.0' => 40, + 'min. 5.0 von 6.0' => 50, + '6.0 von 6.0' => 60, + ]; + + private static $HOTEL_RATING_COUNT_CHOICES = [ + 'min. 5' => 5, + 'min. 10' => 10, + 'min. 25' => 25, + 'min. 50' => 50, + 'min. 100' => 100, + ]; + + private static $HOTEL_RECOMM_CHOICES = [ + 'min. 80%' => 800, + 'min. 90%' => 900, + '100%' => 1000, + ]; + + private static $SPORT_CHOICES = [ + 'großes Sportangebot' => 10, + 'Tennis' => 0, + 'Golf' => 1, + 'Squash' => 2, + 'Radsport' => 3, + 'Wassersport' => 4, + 'Tauchen' => 5, + 'Reiten' => 6, + 'Wandern' => 7, + 'Surfen' => 8, + ]; + + private static $DEPARTURE_CHOICES = [ + 'Nord' => 5000, + 'S\xFCd' => 5001, + 'West' => 5002, + 'Ost' => 5003, + 'Amsterdam (NL)' => 1, + 'Basel-Mulhouse (CH)' => 3, + 'Berlin Brandenburg' => 141, + 'Berlin-Sch\xF6nefeld' => 4, + 'Berlin-Tegel' => 5, + 'Bremen' => 8, + 'Br\xFCssel (B)' => 9, + 'Br\xFCssel Charleroi (B)' => 67, + 'Dortmund' => 10, + 'Dresden' => 11, + 'D\xFCsseldorf' => 12, + 'Eindhoven (NL)' => 73, + 'Enschede (NL)' => 13, + 'Erfurt-Weimar' => 14, + 'Frankfurt' => 15, + 'Frankfurt-Hahn' => 16, + 'Friedrichshafen' => 17, + 'Genf (CH)' => 18, + 'Graz (A)' => 19, + 'Groningen (NL)' => 81, + 'Hamburg' => 20, + 'Hannover' => 21, + 'Innsbruck (A)' => 23, + 'Karlsruhe' => 24, + 'Kassel-Calden' => 25, + 'Klagenfurt (A)' => 27, + 'K\xF6ln-Bonn' => 28, + 'Leipzig/Halle' => 29, + 'Linz (A)' => 30, + 'L\xFCbeck' => 31, + 'L\xFCttich (B)' => 32, + 'Luxemburg' => 33, + 'Maastricht - Aachen (NL)' => 34, + 'Magdeburg Cochstedt' => 139, + 'Memmingen' => 90, + 'M\xFCnchen' => 36, + 'M\xFCnster-Osnabr\xFCck' => 37, + 'Niederrhein (Weeze)' => 49, + 'N\xFCrnberg' => 38, + 'Paderborn' => 39, + 'Rostock' => 40, + 'Saarbr\xFCcken' => 41, + 'Salzburg (A)' => 42, + 'Schwerin' => 43, + 'Strasbourg (F)' => 44, + 'Stuttgart' => 45, + 'Warschau (PL)' => 77, + 'Wien (A)' => 46, + 'Z\xFCrich (CH)' => 47, + 'Zweibr\xFCcken' => 48, + ]; + + public static $DESTINATION_CHOICES = [ + 'Balearen' => 10000, + '- Formentera' => 627, + '- Ibiza' => 32, + '- Mallorca' => 35, + '- Menorca' => 630, + 'Kanaren' => 10001, + '- Fuerteventura' => 832, + '- Teneriffa' => 56, + '- La Palma' => 675, + '- Lanzarote' => 676, + '- Gran Canaria' => 345, + '- La Gomera' => 50, + '- El Hierro' => 59, + '- Graciosa' => 670, + 'Portugal' => 10002, + '- Faro & Algarve' => 637, + '- Lissabon & Umgebung' => 674, + '- Costa da Caparica (Setúbal)' => 636, + '- Alentejo - Beja / Setubal / Evora / Santarem / Portalegre' => 339, + '- Porto' => 467, + '- Costa do Estoril (Lissabon)' => 695, + '- Costa de Prata (Leira / Coimbra / Aveiro)' => 457, + '- Costa Verde (Braga / Viana do Castelo)' => 494, + '- Madeira' => 639, + '- Madeira Rundreisen' => 2244, + '- Coimbra / Leiria / Castello Branco' => 338, + '- Azoren' => 664, + '- Azoren Rundreisen' => 2246, + '- Porto Santo' => 2662, + '- Braga / Vila Real / Viano do Castelo / Branganca' => 2660, + '- Aveiro / Guarda / Viseu' => 2659, + '- Costa Azul (Setubal / Beja)' => 2658, + 'Spanisches Festland' => 10003, + '- Spanien Rundreise' => 2068, + '- Barcelona & Umgebung' => 2068, + '- Golf von Almeria' => 63, + '- Costa del Sol & Costa Tropical' => 62, + '- Costa Blanca & Costa Calida' => 64, + '- Costa Brava' => 2013, + '- Madrid & Umgebung' => 794, + '- Andalusien Inland' => 229, + '- Andalusien Rundreisen' => 2253, + '- Costa Barcelona' => 931, + '- Costa Dorada' => 2054, + '- Costa de la Luz' => 61, + '- Nordspanien - Atlantikküste' => 505, + '- Costa Azahar' => 2014, + '- Zentral Spanien' => 793, + '- Provinz Murcia Inland' => 2661, + '- Provinz Valencia Inland' => 4202, + '- Spanien Nordosten & Pyrenäen' => 65, + '- Ceuta' => 4203, + '- Melilla' => 4204, + 'Türkei' => 10004, + '- Rundreisen' => 946, + '- Side & Alanya' => 643, + '- Kemer & Beldibi' => 644, + '- Istanbul & Umgebung' => 373, + '- Antalya & Belek' => 434, + '- Kusadasi & Didyma' => 651, + '- Dalaman - Fethiye - Ölüdeniz' => 646, + '- Ayvalik, Cesme & Izmir' => 652, + '- Marmaris & Icmeler & Datca' => 647, + '- Bodrum' => 648, + '- Ost-Thrakien & Marmarameer' => 4108, + '- Schwarzmeerküste Türkei' => 2511, + '- Türkei Inland' => 526, + '- Mersin - Adana - Antakya' => 542, + 'Griechische Inseln' => 10005, + '- Kreta' => 616, + '- Rhodos' => 655, + '- Kos' => 7, + '- Santorin' => 12, + '- Korfu & Paxi' => 6, + '- Mykonos' => 9, + '- Zakynthos' => 14, + '- Euböa (Evia)' => 383, + '- Karpathos & Kasos' => 15, + '- Lesbos & Lemnos' => 8, + '- Poros' => 546, + 'Griechische Festland' => 10006, + '- Athen & Umgebung' => 18, + '- Thessaloniki' => 625, + '- Olympische Riviera' => 733, + '- Chalkidiki' => 534, + '- Peloponnes' => 382, + '- Epirus & Westgriechenland' => 553, + '- Pilion' => 734, + '- Thessalien & Mittelgriechenland' => 4103, + 'Italien, Malta' => 10007, + '- Italien Rundreise' => 2235, + '- Malta Rundreise' => 2513, + '- Venetien' => 82, + '- Malta' => 595, + '- Rom & Umgebung' => 560, + '- Toskana' => 537, + '- Emilia Romagna' => 81, + '- Aostatal & Piemont & Lombardei' => 845, + '- Neapel & Umgebung' => 76, + '- Sizilien' => 77, + '- Sizilien Rundreisen' => 2222, + '- Apulien' => 464, + '- Latium' => 3005, + '- Trentino & Südtirol' => 844, + '- Oberitalienische Seen' => 2012, + '- Friaul - Julisch Venetien' => 297, + '- Ligurien' => 818, + '- Ischia' => 75, + '- Sardinien' => 78, + '- Gardasee' => 2048, + '- Kalabrien' => 536, + '- Umbrien' => 817, + '- Basilikata' => 291, + '- Dolomiten' => 2046, + '- Italienische Alpen' => 2047, + '- Capri' => 79, + 'Marroko, Tunesien Pauschalreisen' => 10008, + '- Marokko Rundreisen' => 2237, + '- Tunesien Rundreisen' => 959, + '- Marokko - Marrakesch' => 126, + '- Marokko - Atlantikküste: Agadir / Safi / Tiznit' => 125, + '- Marokko - Atlantikküste: Casablanca / El Jadida / Rabat' => 4200, + '- Marokko - Inland' => 705, + '- Tunesien - Monastir' => 614, + '- Tunesien - Hammamet' => 132, + '- Tunesien - Insel Djerba' => 133, + '- Tunesien - Oase Zarzis' => 135, + '- Tunesien - Norden' => 131, + '- Tunesien - Inland & Gabès & Sfax' => 136, + '- Tunesien - Oase Tozeur / Tamerza / Nefta' => 134, + 'Ägypten Pauschalreisen' => 10010, + '- Nilkreuzfahrten' => 2202, + '- Rundreisen & Badeurlaub' => 2204, + '- Hurghada & Safaga' => 350, + '- Marsa Alam & Quseir' => 330, + '- Luxor & Assuan' => 349, + '- Sharm el Sheikh / Nuweiba / Taba' => 351, + '- Kairo & Gizeh & Memphis & Ismailia' => 348, + '- weitere Angebote Ägypten' => 2500, + '- Marsa Matruh & Alexandria' => 4144, + 'Afrika' => 10011, + '- Kap Verde - Sal' => 585, + '- Kap Verde - Boavista' => 280, + '- Kenia - Nairobi & Inland' => 174, + '- Gambia' => 137, + '- Kenia - Südküste' => 359, + '- Kenia - Nordküste' => 358, + '- Namibia' => 453, + '- Western Cape (Kapstadt)' => 873, + '- Senegal' => 139, + '- Tansania - Sansibar' => 454, + '- Eastern Cape (Port Elizabeth)' => 4109, + '- Northern Cape (Kimberley)' => 875, + '- Gauteng (Johannesburg)' => 883, + '- KwaZulu-Natal (Durban)' => 881, + '- Limpopo (Polokwane)' => 879, + '- Northwest (Mahikeng)' => 876, + '- Äthiopien' => 4112, + '- Madagaskar' => 161, + '- Botswana' => 842, + '- Malawi' => 1019, + 'Kuba' => 10012, + '- Kuba - Havanna & Varadero' => 369, + '- Kuba - Holguin' => 371, + '- weitere Angebote Kuba' => 2522, + 'Dom. Republik' => 10013, + '- Dom. Republik - Süden (Santo Domingo)' => 368, + '- Dom. Republik - Norden (Puerto Plata & Samana)' => 366, + '- Dom. Republik - Osten (Punta Cana)' => 367, + 'Karibik' => 10014, + '- Jamaika' => 247, + '- Curacao' => 582, + '- Martinique' => 571, + '- Guadeloupe' => 572, + '- Barbados' => 245, + '- Saint-Martin (frz.)' => 4098, + '- Grenada' => 377, + '- Puerto Rico' => 251, + '- Aruba' => 4197, + '- Tobago' => 378, + '- Sint Maarten (nl.)' => 4198, + '- Antigua & Barbuda' => 250, + '- Bonaire, Sint Eustatius & Saba' => 4110, + '- Bahamas' => 566, + '- Saint Kitts & Nevis' => 578, + '- Cayman Islands' => 581, + '- St.Lucia' => 249, + '- Bermuda' => 437, + '- Saint-Barthélemy' => 2648, + '- Virgin Islands British' => 680, + '- Turks & Caicosinseln' => 574, + '- St. Vincent & Grenadinen' => 747, + '- Virgin Islands USA' => 4199, + 'USA' => 10015, + '- New York' => 697, + '- Illinois & Wisconsin' => 759, + '- New Jersey & Delaware' => 782, + '- Florida Ostküste' => 521, + '- Nevada' => 692, + '- Florida Orlando & Inland' => 524, + '- Florida Westküste' => 522, + '- Florida Südspitze' => 523, + '- Kalifornien' => 688, + '- New England' => 886, + '- Pennsylvania' => 758, + '- Texas' => 755, + '- Arizona' => 484, + '- Georgia' => 757, + '- Tennessee' => 773, + '- Louisiana & Mississippi' => 756, + '- Michigan' => 762, + 'Mexiko' => 10016, + '- Mexiko: Yucatan / Cancun' => 282, + '- Mexiko Stadt' => 541, + '- Mexiko: Acapulco / Oaxaca' => 701, + '- Mexiko: Pazifikküste' => 704, + '- Mexiko: Karibikküste' => 2241, + '- Mexiko: Inland' => 438, + 'Asien' => 10017, + '- Sri Lanka' => 361, + '- Malaysia' => 452, + '- Hongkong & Kowloon & Hongkong Island' => 474, + '- China - Peking (Beijing)' => 439, + '- China - Hubei / Shaanxi / Shanxi / Henan' => 2654, + '- China - Shanghai' => 4141, + '- Singapur' => 473, + '- Neu Delhi / Rajasthan / Uttar Pradesh / Madhya Pradesh' => 488, + '- Vietnam' => 448, + '- Karnataka / Kerala / A. Pradesh / T. Nadu / Lakkadiven' => 197, + '- Indonesien: Bali' => 311, + '- Nepal' => 461, + '- Punjab / Uttarakhand / Himachal Pradesh & Hoher Norden' => 2629, + '- Indonesien: Java' => 470, + '- Indien: Goa' => 360, + '- Kambodscha' => 843, + '- Taipeh & Umgebung' => 489, + '- Bihar / Jharkhand / West Bengal / Odisha & Ostindien' => 2630, + '- China - Hainan / Guangdong / Hunan / Jiangxi' => 2653, + '- Indonesien: Insel Bintan & Batam' => 871, + '- Indonesien: Kleine Sundainseln' => 528, + '- Laos' => 847, + '- Myanmar' => 645, + '- Indien: Maharashtra - Mumbai / Gujarat' => 4201, + '- Macao' => 708, + '- Indonesien: Nordosten' => 4166, + '- Tokio, Osaka, Hiroshima, Japan. Inseln' => 469, + 'Zypern' => 10019, + '- Zypern Rundreisen' => 2276, + '- Republik Zypern - Süden' => 620, + '- Nordzypern' => 99, + 'Dubai, Arabische Halbinsel' => 10020, + '- Oman Rundreisen' => 2164, + '- Arabische Halbinsel Rundreisen' => 2273, + '- Oman' => 532, + '- Ras Al-Khaimah' => 723, + '- Dubai' => 353, + '- Sharjah / Khorfakkan' => 352, + '- Abu Dhabi' => 354, + '- Fujairah' => 722, + '- Ajman' => 724, + '- Al Ain' => 884, + '- Bahrain' => 721, + '- Umm Al Quwain' => 725, + '- Katar' => 720, + 'Frankreich' => 10021, + '- Côte d\'Azur' => 2055, + '- Paris & Umgebung' => 495, + '- Pays de la Loire' => 4188, + '- Aquitanien' => 25, + '- Disneyland Paris' => 2041, + '- Normandie & Picardie & Nord-Pas-de-Calais' => 1023, + '- Burgund & Centre' => 2017, + '- Provence-Alpes-Côte d\'Azur' => 2056, + '- Languedoc Roussillon' => 2057, + '- Monaco' => 880, + '- Franche-Comté & Champagne-Ardenne' => 200, + '- Korsika' => 23, + '- Rhone Alpes' => 2042, + 'Nordeuropa' => 10022, + '- Schweden' => 851, + '- Dänemark' => 902, + '- Norwegen' => 813, + '- Finnland' => 490, + '- Island' => 449, + 'Südamerika' => 10023, + '- Brasilien: Distrito Federal (Brasilia)' => 2599, + '- Brasilien: Ceara (Fortaleza)' => 4170, + '- Brasilien: Rio Grande de Norte (Natal)' => 4169, + '- Brasilien: Alagoas (Maceio)' => 4172, + '- Brasilien: Rio de Janeiro & Umgebung' => 375, + '- Brasilien: Parana (Curitiba)' => 2592, + '- Brasilien: Bahia (Salvador da Bahia)' => 4167, + '- Brasilien: Amazonas (Manaus)' => 4171, + '- Brasilien: Sergipe (Aracaju)' => 2594, + '- Brasilien: Rio Grande do Sul (Porto Alegre)' => 2590, + '- Kolumbien' => 376, + '- Brasilien: Pernambuco (Recife)' => 374, + '- Ecuador' => 783, + '- Peru' => 787, + '- Venezuela - Isla Margarita' => 440, + '- Uruguay' => 785, + '- Argentinien' => 450, + '- Chile' => 784, + '- Venezuela - Küste & Inland & Los Roques Archipel' => 293, + '- Brasilien: Paraiba (Joao Pessoa)' => 2595, + 'Kanada' => 10024, + '- Ontario' => 766, + '- Alberta' => 767, + '- Quebec' => 765, + '- British Columbia' => 768, + 'Naher Osten' => 10026, + '- Israel - Tel Aviv & Umgebung' => 510, + '- Israel- Eilat' => 225, + '- Israel- Totes Meer' => 727, + '- Israel' => 511, + '- Jordanien' => 515, + '- Israel - Jerusalem & Umgebung' => 509, + '- Iran' => 2580, + 'Thailand' => 10027, + '- Bangkok & Umgebung' => 321, + '- Insel Phuket' => 322, + '- Insel Ko Samui' => 325, + '- Nordthailand (Chiang Mai, Chiang Rai, Sukhothai)' => 4128, + '- Südostthailand (Pattaya, Jomtien)' => 4131, + '- Khao Lak & Umgebung' => 846, + '- Krabi & Umgebung' => 4133, + '- Westthailand (Hua Hin, Cha Am, River Kwai)' => 4130, + '- Südthailand (Surat Thani, Trang)' => 4132, + '- Inseln im Golf von Thailand (Koh Chang, Koh Phangan)' => 323, + '- Inseln in der Andaman See (Koh Pee Pee, Koh Lanta)' => 327, + '- Nordostthailand (Issan)' => 4129, + '- sonstige Angebote Thailand' => 2535, + 'Mitteleuropa' => 10028, + '- Niederlande' => 854, + '- Irland' => 503, + '- London & Südengland' => 178, + '- Wien & Umgebung' => 958, + '- Salzburg - Salzburger Land' => 2007, + '- Schottland' => 901, + '- Belgien' => 855, + '- Kärnten' => 951, + '- Österreich Rundreisen' => 2243, + '- Niederösterreich' => 952, + '- Wallis' => 934, + '- Tirol - Osttirol' => 2018, + '- Salzburg - Salzburg' => 954, + '- Bern & Berner Oberland' => 916, + '- Tirol - Innsbruck, Mittel- und Nordtirol' => 956, + '- Steiermark' => 955, + '- Graubünden' => 920, + '- Mittel- & Nordengland' => 179, + '- Tirol - Westtirol & Ötztal' => 2009, + '- Oberösterreich' => 953, + '- Genf' => 918, + '- Tirol - Region Seefeld' => 2001, + '- Zürich' => 936, + '- Luzern & Aargau' => 922, + '- Uri & Glarus' => 932, + '- Nordirland' => 905, + '- Salzkammergut - Salzburg' => 2006, + '- Burgenland' => 950, + '- Waadt & Jura & Neuenburg' => 933, + '- Tirol - Zillertal' => 2004, + '- St.Gallen & Thurgau' => 926, + '- Jersey - Kanalinsel' => 962, + '- Tirol - Paznaun' => 1003, + '- Bodensee (Österreich)' => 4190, + '- Tessin' => 930, + 'Deutschland' => 10029, + '- Allgäu' => 2026, + '- Baden-Württemberg' => 104, + '- Bayerisch-Schwaben' => 4196, + '- Bayerische Alpen' => 2058, + '- Bayerischer Wald' => 2025, + '- Berchtesgadener Land' => 2069, + '- Berlin' => 106, + '- Bodensee (Deutschland)' => 2028, + '- Borkum' => 2078, + '- Brandenburg' => 107, + '- Bremen' => 112, + '- Düsseldorf & Umgebung' => 2019, + '- Eifel & Westerwald' => 2052, + '- Elbsandsteingebirge' => 2051, + '- Emsland' => 2037, + '- Erzgebirge' => 2050, + '- Fichtelgebirge' => 2030, + '- Franken' => 2060, + '- Hamburg' => 113, + '- Harz' => 2031, + '- Hessen' => 114, + '- Hessisches Bergland' => 2072, + '- Hochschwarzwald' => 4111, + '- Hunsrück / Taunus' => 2061, + '- Insel Rügen' => 2032, + '- Insel Usedom' => 2033, + '- Köln & Umgebung' => 2020, + '- Lausitz' => 2071, + '- Lüneburger Heide' => 2024, + '- Mecklenburg Ostseeküste' => 2035, + '- Mecklenburg-Vorpommern' => 115, + '- Mecklenburgische Seenplatte' => 2034, + '- Mosel' => 2062, + '- München' => 264, + '- Münsterland' => 2074, + '- Niederbayern' => 2063, + '- Niedersachsen' => 116, + '- Nordfriesland & Inseln' => 127, + '- Nordrhein-Westfalen' => 117, + '- Nordseeküste und Inseln - sonstige Angebote' => 2036, + '- Oberbayern' => 2008, + '- Oberpfalz' => 105, + '- Ostseeküste' => 2039, + '- Pfalz' => 2053, + '- Radtouren und andere Specials' => 3001, + '- Rheingau' => 2022, + '- Rheinland' => 2065, + '- Rheinland-Pfalz' => 118, + '- Rhön' => 2029, + '- Ruhrgebiet' => 2059, + '- Rundreise Deutschland & sonstige Angebote' => 2501, + '- Saarland' => 119, + '- Sachsen' => 121, + '- Sachsen-Anhalt' => 123, + '- Sauerland' => 2038, + '- Schleswig-Holstein' => 4102, + '- Schwarzwald' => 2002, + '- Schwäbische Alb' => 2066, + '- Spessart - Odenwald' => 2070, + '- Teutoburger Wald' => 2021, + '- Thüringen' => 128, + '- Thüringer Wald' => 2067, + 'Kroatien, Bulgarien, Osteuropa' => 10030, + '- Estland' => 838, + '- Georgien' => 837, + '- Angebote Rad- und Schiff Kroatien' => 3014, + '- Insel Brac' => 501, + '- Insel Hvar' => 500, + '- Insel Krk' => 507, + '- Istrien' => 483, + '- Kroatische Inseln' => 504, + '- Kvarner Bucht' => 480, + '- Mitteldalmatien' => 877, + '- Mittelkroatien' => 301, + '- Norddalmatien' => 2011, + '- Slavonien' => 302, + '- Süddalmatien' => 635, + '- Lettland' => 836, + '- Litauen' => 316, + '- Mazedonien' => 909, + '- Moldavien' => 835, + '- Montenegro' => 455, + '- Polen' => 852, + '- Bukarest & Umgebung' => 816, + '- Rumänien' => 110, + '- Baikalsee' => 892, + '- Moskau & Umgebung' => 820, + '- Sankt Petersburg & Russland Nordwest (Murmansk)' => 821, + '- Serbien' => 2579, + '- Slowakei' => 850, + '- Slowenien Inland' => 497, + '- slowenische Adria' => 628, + '- Tschechien' => 853, + '- Ukraine & Krim' => 751, + '- Plattensee / Balaton' => 2016, + '- Ungarn' => 849, + '- Weißrussland' => 834, + ]; +} \ No newline at end of file diff --git a/trunk/src/AppBundle/Resources/public/js/custom.js b/trunk/src/AppBundle/Resources/public/js/custom.js index e7763b8c..d2426d6d 100644 --- a/trunk/src/AppBundle/Resources/public/js/custom.js +++ b/trunk/src/AppBundle/Resources/public/js/custom.js @@ -25,11 +25,11 @@ jQuery(document).ready(function($) { allowfullscreen: true, 'data-st-video': this.id }) - .addClass('st-collapsed') .hide() .insertAfter(this) ; el$ + .addClass('st-collapsed') .css('background-image', 'url(/images/st2/icons/arrowup.gif)') .text(caption + ' einblenden') .attr('href', 'javascript:void(0);') diff --git a/trunk/src/AppBundle/Twig/AppExtension.php b/trunk/src/AppBundle/Twig/AppExtension.php index ab753eac..ddb60068 100644 --- a/trunk/src/AppBundle/Twig/AppExtension.php +++ b/trunk/src/AppBundle/Twig/AppExtension.php @@ -8,6 +8,7 @@ namespace AppBundle\Twig; use AppBundle\Service\KeywordService; +use AppBundle\Util; use Symfony\Component\HttpFoundation\RequestStack; class AppExtension extends \Twig_Extension @@ -46,6 +47,7 @@ class AppExtension extends \Twig_Extension 'is_safe' => ['html'] ]), 'get_base_template' => new \Twig_SimpleFunction('get_base_template', [$this, 'getBaseTemplate']), + 'get_base_url' => new \Twig_SimpleFunction('get_base_url', [$this, 'getBaseUrl']), ]; } @@ -64,6 +66,11 @@ class AppExtension extends \Twig_Extension return ($this->requestStack->getCurrentRequest()->isXmlHttpRequest() ? 'ajax' : 'base') .'.html.twig'; } + public function getBaseUrl() + { + return Util::getBaseUrl(); + } + public function formField($form, $label = null, $opt = null) { $this->template = $this->environment->loadTemplate( '::default/form/helpers.html.twig' ); diff --git a/trunk/src/AppBundle/Util/DepartureUtil.php b/trunk/src/AppBundle/Util/DepartureUtil.php index cdce316d..edb9f5a9 100644 --- a/trunk/src/AppBundle/Util/DepartureUtil.php +++ b/trunk/src/AppBundle/Util/DepartureUtil.php @@ -8,6 +8,7 @@ namespace AppBundle\Util; use AppBundle\Entity\TravelDeparturePoint; +use Doctrine\Common\Collections\Collection; class DepartureUtil { @@ -118,6 +119,10 @@ class DepartureUtil $departures[] = $defaultDeparture; } } + if ($departures instanceof Collection) + { + $departures = $departures->toArray(); + } return DepartureUtil::sortDepartures($departures); }