From faa508b4caf145dc317465e08961b0170df5e850 Mon Sep 17 00:00:00 2001 From: Kevin Adametz Date: Wed, 15 Jun 2022 18:08:20 +0200 Subject: [PATCH] 06 2022 --- .../email/bookingConfirmationEmail.txt.twig | 3 +- .../email/components/bookingSummary.txt.twig | 22 ++++---- .../components/fewoBookingSummary.txt.twig | 4 +- .../email/contactServiceEmail.txt.twig | 2 +- .../fewoBookingConfirmationEmail.txt.twig | 3 +- .../pages/bookingConfirmation.html.twig | 2 + .../Controller/DefaultController.php | 2 +- src/AppBundle/Entity/BookingRequest.php | 51 +++++++++++++++++++ src/AppBundle/Entity/ContactRequest.php | 50 ++++++++++++++++++ src/AppBundle/Entity/FewoBookingRequest.php | 50 ++++++++++++++++++ .../Entity/TravelBookingRepository.php | 3 +- src/AppBundle/Entity/TravelProgram.php | 36 ++++++++++++- src/AppBundle/Entity/Traveler.php | 34 +++++++++++++ src/AppBundle/Form/BookingRequestType.php | 3 +- src/AppBundle/Form/FewoBookingRequestType.php | 4 +- src/AppBundle/Form/TravelerType.php | 3 +- 16 files changed, 249 insertions(+), 23 deletions(-) diff --git a/app/Resources/views/default/email/bookingConfirmationEmail.txt.twig b/app/Resources/views/default/email/bookingConfirmationEmail.txt.twig index 9693086f..2a597d0c 100644 --- a/app/Resources/views/default/email/bookingConfirmationEmail.txt.twig +++ b/app/Resources/views/default/email/bookingConfirmationEmail.txt.twig @@ -1,5 +1,6 @@ {# @var booking_request \AppBundle\Entity\BookingRequest #} -Sehr geehrte{{ booking_request.salutation == 1 ? 'r Herr' : ' Frau' }} {{ booking_request.lastName }}, + +Sehr {{ booking_request.salutationDear }} {{ booking_request.salutationName }} {{ booking_request.firstName }} {{ booking_request.lastName }}, vielen Dank für Ihren verbindlichen Buchungsauftrag. Dieser wird schnellstmöglich bearbeitet und stellt noch keine{# #} Reisebestätigung dar. Bitte prüfen Sie noch einmal Ihre Angaben und kontaktieren Sie uns bitte, wenn ein Fehler{# diff --git a/app/Resources/views/default/email/components/bookingSummary.txt.twig b/app/Resources/views/default/email/components/bookingSummary.txt.twig index cdf3c3aa..d6c5f858 100644 --- a/app/Resources/views/default/email/components/bookingSummary.txt.twig +++ b/app/Resources/views/default/email/components/bookingSummary.txt.twig @@ -42,10 +42,10 @@ Nicht eingeschlossene, zubuchbare Leistungen: {% endfor %} ===================================================================================== -Reiseanmelder{% if booking_request.salutation == 2 %}in{% endif %} - +{{ booking_request.salutationApplicant }} ===================================================================================== +Anrede: {{ booking_request.salutationName }} Vorname: {{ booking_request.firstName }} Nachname: {{ booking_request.lastName }} Adresse: {{ booking_request.streetAddress }} @@ -64,27 +64,27 @@ Nr., Zimmertyp, Geschlecht, Vorname, Nachname, Geburtsdatum {% set travelerCollection = booking_request.travelers|slice(0, (booking_request.travelerCount + booking_request.childrenCount)) %} {% for room in booking_request.occupiedRooms %} {% if(room.type == 1) %} -{{ loop.index }}. Einzelzimmer Erwachsener, {{ travelerCollection[travelerIndex].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName(nationalities) }} +{{ loop.index }}. Einzelzimmer Erwachsener, {{ travelerCollection[travelerIndex].sexName }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName(nationalities) }} {% set travelerIndex = travelerIndex + 1 %} {% if(room.child == 1) %} -{{ loop.index }}. Einzelzimmer Kind, {{ travelerCollection[travelerIndex].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName(nationalities) }} +{{ loop.index }}. Einzelzimmer Kind, {{ travelerCollection[travelerIndex].sexName }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName(nationalities) }} {% set travelerIndex = travelerIndex + 1 %} {% endif %} {% elseif (room.type == 2) %} -{{ loop.index }}. Doppelzimmer Erwachsener, {{ travelerCollection[travelerIndex].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName(nationalities) }} -{{ loop.index }}. Doppelzimmer Erwachsener, {{ travelerCollection[travelerIndex+1].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex+1].firstName }}, {{ travelerCollection[travelerIndex+1].lastName -}}, {{ travelerCollection[travelerIndex+1].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName(nationalities) }} +{{ loop.index }}. Doppelzimmer Erwachsener, {{ travelerCollection[travelerIndex].sexName }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName(nationalities) }} +{{ loop.index }}. Doppelzimmer Erwachsener, {{ travelerCollection[travelerIndex+1].sexName }}, {{ travelerCollection[travelerIndex+1].firstName }}, {{ travelerCollection[travelerIndex+1].lastName -}}, {{ travelerCollection[travelerIndex+1].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName(nationalities) }} {% set travelerIndex = travelerIndex + 2 %} {% if(room.child == 1) %} -{{ loop.index }}. Doppelzimmer Kind, {{ travelerCollection[travelerIndex].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName(nationalities) }} +{{ loop.index }}. Doppelzimmer Kind, {{ travelerCollection[travelerIndex].sexName }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName(nationalities) }} {% set travelerIndex = travelerIndex + 1 %} {% endif %} {% elseif (room.type == 3) %} -{{ loop.index }}. Dreibettzimmer Erwachsener, {{ travelerCollection[travelerIndex].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName(nationalities) }} -{{ loop.index }}. Dreibettzimmer Erwachsener, {{ travelerCollection[travelerIndex+1].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex+1].firstName }}, {{ travelerCollection[travelerIndex+1].lastName -}}, {{ travelerCollection[travelerIndex+1].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName(nationalities) }} -{{ loop.index }}. Dreibettzimmer Erwachsener, {{ travelerCollection[travelerIndex+2].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex+2].firstName }}, {{ travelerCollection[travelerIndex+2].lastName -}}, {{ travelerCollection[travelerIndex+2].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName(nationalities) }} +{{ loop.index }}. Dreibettzimmer Erwachsener, {{ travelerCollection[travelerIndex].sexName }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName(nationalities) }} +{{ loop.index }}. Dreibettzimmer Erwachsener, {{ travelerCollection[travelerIndex+1].sexName }}, {{ travelerCollection[travelerIndex+1].firstName }}, {{ travelerCollection[travelerIndex+1].lastName -}}, {{ travelerCollection[travelerIndex+1].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName(nationalities) }} +{{ loop.index }}. Dreibettzimmer Erwachsener, {{ travelerCollection[travelerIndex+2].sexName }}, {{ travelerCollection[travelerIndex+2].firstName }}, {{ travelerCollection[travelerIndex+2].lastName -}}, {{ travelerCollection[travelerIndex+2].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName(nationalities) }} {% set travelerIndex = travelerIndex + 3 %} {% if(room.child == 1) %} -{{ loop.index }}. Dreibettzimmer Kind, {{ travelerCollection[travelerIndex].sex == 1 ? 'männlich' : 'weiblich' }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName(nationalities) }} +{{ loop.index }}. Dreibettzimmer Kind, {{ travelerCollection[travelerIndex].sexName }}, {{ travelerCollection[travelerIndex].firstName }}, {{ travelerCollection[travelerIndex].lastName -}}, {{ travelerCollection[travelerIndex].birthDate }}, {{ travelerCollection[travelerIndex].nationalityName(nationalities) }} {% set travelerIndex = travelerIndex + 1 %} {% endif %} {% endif %} diff --git a/app/Resources/views/default/email/components/fewoBookingSummary.txt.twig b/app/Resources/views/default/email/components/fewoBookingSummary.txt.twig index b5f7fa67..50cb514d 100644 --- a/app/Resources/views/default/email/components/fewoBookingSummary.txt.twig +++ b/app/Resources/views/default/email/components/fewoBookingSummary.txt.twig @@ -19,9 +19,9 @@ Ferienwohnung: {{ fewo_lodging.name }} * Gesamtpreis: {{ priceResult.total_price|number_format(2) }} € ======================================================= -Reiseanmelder: {% if fewo_booking_request.salutation == 2 %}in{% endif %} - +{{ fewo_booking_request.salutationApplicant }} +* Anrede: {{ fewo_booking_request.salutationName }} * Vorname: {{ fewo_booking_request.firstName }} * Nachname: {{ fewo_booking_request.lastName }} * Adresse: {{ fewo_booking_request.streetAddress }} diff --git a/app/Resources/views/default/email/contactServiceEmail.txt.twig b/app/Resources/views/default/email/contactServiceEmail.txt.twig index 12110472..97d09746 100644 --- a/app/Resources/views/default/email/contactServiceEmail.txt.twig +++ b/app/Resources/views/default/email/contactServiceEmail.txt.twig @@ -7,7 +7,7 @@ CRM {{ crm_v3_url }} -Anrede: {{ contact_request.salutation == 1 ? 'Herr' : 'Frau' }} +Anrede: {{ contact_request.salutationName }} Vorname: {{ contact_request.firstName|default('-') }} Nachname: {{ contact_request.lastName|default('-') }} Adresse: {{ contact_request.streetAddress|default('-') }} diff --git a/app/Resources/views/default/email/fewoBookingConfirmationEmail.txt.twig b/app/Resources/views/default/email/fewoBookingConfirmationEmail.txt.twig index b44ab901..eab2ff4f 100644 --- a/app/Resources/views/default/email/fewoBookingConfirmationEmail.txt.twig +++ b/app/Resources/views/default/email/fewoBookingConfirmationEmail.txt.twig @@ -1,6 +1,5 @@ {# @var fewo_booking_request \AppBundle\Entity\FewoBookingRequest #} -Sehr geehrte{{ fewo_booking_request.salutation == 1 ? 'r Herr' : ' Frau' }} {{ fewo_booking_request.lastName }}, - +Sehr {{ fewo_booking_request.salutationDear }} {{ fewo_booking_request.salutationName }} {{ fewo_booking_request.firstName }} {{ fewo_booking_request.lastName }}, vielen Dank für Ihren Auftrag, folgende Ferienwohnung wurde gemietet: diff --git a/app/Resources/views/default/pages/bookingConfirmation.html.twig b/app/Resources/views/default/pages/bookingConfirmation.html.twig index 1924d97e..12ce9236 100644 --- a/app/Resources/views/default/pages/bookingConfirmation.html.twig +++ b/app/Resources/views/default/pages/bookingConfirmation.html.twig @@ -146,6 +146,8 @@ Herr {% elseif booking.salutationId == 2 %} Frau + {% elseif booking.salutationId == 3 %} + Keine Angabe {% endif %} diff --git a/src/AppBundle/Controller/DefaultController.php b/src/AppBundle/Controller/DefaultController.php index ef764858..d5cff9f8 100644 --- a/src/AppBundle/Controller/DefaultController.php +++ b/src/AppBundle/Controller/DefaultController.php @@ -368,7 +368,7 @@ class DefaultController extends Controller if(empty($request->get('g-recaptcha-response'))){ $re_error = 'Bitte lösen Sie das reCAPTCHA.'; - $error = true; + $error = true; } //your site secret key $secret = '6LfjBm8UAAAAANKNzGhSiMaoEg9mUswlaZkOHgI4'; diff --git a/src/AppBundle/Entity/BookingRequest.php b/src/AppBundle/Entity/BookingRequest.php index c44b575f..dd5ff7ee 100644 --- a/src/AppBundle/Entity/BookingRequest.php +++ b/src/AppBundle/Entity/BookingRequest.php @@ -20,6 +20,8 @@ class BookingRequest // Used in SternToursCrmBookingExports, expected to be equivalent to sex (as defined in Traveler) const MR = 1; const MRS = 2; + const DIV = 3; + /** * @var TravelDeparturePoint $departure @@ -466,6 +468,55 @@ class BookingRequest $this->salutation = $salutation; } + public function getSalutationName() + { + switch ($this->salutation) { + case 1: + return 'Herr'; + break; + case 2: + return 'Frau'; + break; + case 3: + return 'Divers/keine Anrede'; + break; + } + return ''; + } + + public function getSalutationDear() + { + switch ($this->salutation) { + case 1: + return 'geehrter'; + break; + case 2: + return 'geehrte'; + break; + case 3: + return 'geehrte:r'; + break; + } + return ''; + } + + public function getSalutationApplicant() + { + switch ($this->salutation) { + case 1: + return 'Reiseanmelder'; + break; + case 2: + return 'Reiseanmelderin'; + break; + case 3: + return 'Reiseanmelder:in'; + break; + } + return ''; + } + + /** * @return string */ diff --git a/src/AppBundle/Entity/ContactRequest.php b/src/AppBundle/Entity/ContactRequest.php index c915020d..0279c0b6 100644 --- a/src/AppBundle/Entity/ContactRequest.php +++ b/src/AppBundle/Entity/ContactRequest.php @@ -13,6 +13,8 @@ class ContactRequest { const MR = 1; const MRS = 2; + const DIV = 3; + /** @var int|null $salutation */ private $salutation; @@ -92,6 +94,54 @@ class ContactRequest $this->salutation = $salutation; } + public function getSalutationName() + { + switch ($this->salutation) { + case 1: + return 'Herr'; + break; + case 2: + return 'Frau'; + break; + case 3: + return 'Divers/keine Anrede'; + break; + } + return ''; + } + + public function getSalutationDear() + { + switch ($this->salutation) { + case 1: + return 'geehrter'; + break; + case 2: + return 'geehrte'; + break; + case 3: + return 'geehrte:r'; + break; + } + return ''; + } + + public function getSalutationApplicant() + { + switch ($this->salutation) { + case 1: + return 'Reiseanmelder'; + break; + case 2: + return 'Reiseanmelderin'; + break; + case 3: + return 'Reiseanmelder:in'; + break; + } + return ''; + } + /** * @return null|string */ diff --git a/src/AppBundle/Entity/FewoBookingRequest.php b/src/AppBundle/Entity/FewoBookingRequest.php index 855fec66..8ddfae04 100644 --- a/src/AppBundle/Entity/FewoBookingRequest.php +++ b/src/AppBundle/Entity/FewoBookingRequest.php @@ -21,6 +21,8 @@ class FewoBookingRequest // Used in SternToursCrmBookingExports, expected to be equivalent to sex (as defined in Traveler) const MR = 1; const MRS = 2; + const DIV = 3; + /** * @Assert\DateTime() @@ -157,6 +159,54 @@ class FewoBookingRequest $this->salutation = $salutation; } + public function getSalutationName() + { + switch ($this->salutation) { + case 1: + return 'Herr'; + break; + case 2: + return 'Frau'; + break; + case 3: + return 'Divers/keine Anrede'; + break; + } + return ''; + } + + public function getSalutationDear() + { + switch ($this->salutation) { + case 1: + return 'geehrter'; + break; + case 2: + return 'geehrte'; + break; + case 3: + return 'geehrte:r'; + break; + } + return ''; + } + + public function getSalutationApplicant() + { + switch ($this->salutation) { + case 1: + return 'Reiseanmelder'; + break; + case 2: + return 'Reiseanmelderin'; + break; + case 3: + return 'Reiseanmelder:in'; + break; + } + return ''; + } + /** * @return mixed */ diff --git a/src/AppBundle/Entity/TravelBookingRepository.php b/src/AppBundle/Entity/TravelBookingRepository.php index ac78ff31..f25aaa58 100644 --- a/src/AppBundle/Entity/TravelBookingRepository.php +++ b/src/AppBundle/Entity/TravelBookingRepository.php @@ -90,7 +90,8 @@ class TravelBookingRepository extends \Doctrine\ORM\EntityRepository 'travel_category_id' => $tp->getTravelCategory(), 'travelagenda_id' => $tp->getTravelAgenda(), 'travel_title' => $tp->getTitle(), - 'travel_number' => $travelDate->getName() + 'travel_number' => $travelDate->getName(), + 'travel_company_id' => $tp->getTravelCompany(), ]); $ret->setSelectedDeparture([ diff --git a/src/AppBundle/Entity/TravelProgram.php b/src/AppBundle/Entity/TravelProgram.php index 475659b4..61a478be 100644 --- a/src/AppBundle/Entity/TravelProgram.php +++ b/src/AppBundle/Entity/TravelProgram.php @@ -198,6 +198,13 @@ class TravelProgram */ private $travelAgenda; + /** + * @var integer + * + * @ORM\Column(name="travel_company", type="integer", nullable=true) + */ + private $travelCompany; + /** * @var integer * @@ -1083,8 +1090,35 @@ class TravelProgram return $this->travelAgenda; } + /** + * Set travelCompany + * + * @param integer $travelCompany + * + * @return TravelProgram + */ + public function setTravelCompany($travelCompany) + { + $this->travelCompany = $travelCompany; + + return $this; + } + /** - * Set travelAgenda + * Get travelCompany + * + * @return integer + */ + public function getTravelCompany() + { + return $this->travelCompany; + } + + + + + /** + * Set depositPercent * * @param integer $depositPercent * diff --git a/src/AppBundle/Entity/Traveler.php b/src/AppBundle/Entity/Traveler.php index 3325e505..359ae60d 100644 --- a/src/AppBundle/Entity/Traveler.php +++ b/src/AppBundle/Entity/Traveler.php @@ -13,6 +13,8 @@ class Traveler // Used in SternToursCrmBookingExports, expected to be equivalent to salutation (as defined in BookingRequest) const MALE = 1; const FEMALE = 2; + const DIV = 3; + private $NATIONALITIES = []; @@ -78,6 +80,38 @@ class Traveler $this->sex = $sex; } + public function getSexName() + { + switch ($this->sex) { + case 1: + return 'Herr'; + break; + case 2: + return 'Frau'; + break; + case 3: + return 'Divers/keine Anrede'; + break; + } + return ''; + } + + public function getSexApplicant() + { + switch ($this->sex) { + case 1: + return 'Reiseanmelder'; + break; + case 2: + return 'Reiseanmelderin'; + break; + case 3: + return 'Reiseanmelder:in'; + break; + } + return ''; + } + /** * @return string */ diff --git a/src/AppBundle/Form/BookingRequestType.php b/src/AppBundle/Form/BookingRequestType.php index 7d3a35cc..cf07c9cb 100644 --- a/src/AppBundle/Form/BookingRequestType.php +++ b/src/AppBundle/Form/BookingRequestType.php @@ -97,7 +97,8 @@ class BookingRequestType extends AbstractType public static $SALUTATION_CHOICES = [ 'Herr' => BookingRequest::MR, - 'Frau' => BookingRequest::MRS + 'Frau' => BookingRequest::MRS, + 'Divers/keine Anrede' => BookingRequest::DIV ]; /* diff --git a/src/AppBundle/Form/FewoBookingRequestType.php b/src/AppBundle/Form/FewoBookingRequestType.php index 79ca7888..9aa1aa53 100644 --- a/src/AppBundle/Form/FewoBookingRequestType.php +++ b/src/AppBundle/Form/FewoBookingRequestType.php @@ -36,7 +36,9 @@ class FewoBookingRequestType extends AbstractType public static $SALUTATION_CHOICES = [ 'Herr' => 1, - 'Frau' => 2 + 'Frau' => 2, + 'Divers/keine Anrede' => 3 + ]; public static $NATIONALITY_CHOICES = []; diff --git a/src/AppBundle/Form/TravelerType.php b/src/AppBundle/Form/TravelerType.php index 7ba4acac..f30c832b 100644 --- a/src/AppBundle/Form/TravelerType.php +++ b/src/AppBundle/Form/TravelerType.php @@ -25,7 +25,8 @@ class TravelerType extends AbstractType { public static $SEX_CHOICES = [ 'männlich' => Traveler::MALE, - 'weiblich' => Traveler::FEMALE + 'weiblich' => Traveler::FEMALE, + 'Divers/keine Anrede' => Traveler::DIV ]; public static $NATIONALITY_CHOICES = [];