Compare commits
3 commits
master
...
wip/stash-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
513ac6ed6c | ||
|
|
da3158b4f7 | ||
|
|
4370149f25 |
9 changed files with 38 additions and 12 deletions
|
|
@ -42,6 +42,8 @@
|
|||
|
||||
{{ form_errors(form) }}
|
||||
|
||||
{{ form_errors(form.email) }}
|
||||
|
||||
<div id="message"></div>
|
||||
|
||||
<div class="form-box">
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
<form class="st-booking-form" method="post" data-toggle="validator">
|
||||
|
||||
{{ form_errors(form) }}
|
||||
{{ form_errors(form.email) }}
|
||||
|
||||
<div id="message"></div>
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,6 @@ class BookingController extends Controller
|
|||
$crmBookingUrl = preg_replace('/\\/api/', '', $crmBookingUrl).'/edit';
|
||||
}
|
||||
|
||||
|
||||
$this->get('mailer')->send(\Swift_Message::newInstance()
|
||||
->setSubject('Ihr Buchungsauftrag bei STERN TOURS')
|
||||
->setFrom('stern@stern-tours.de', 'STERN TOURS')
|
||||
|
|
|
|||
|
|
@ -898,11 +898,16 @@ class TravelBooking
|
|||
for ($i = 0; $i < count($travelers); ++$i)
|
||||
{
|
||||
$traveler = $travelers[$i];
|
||||
|
||||
$birthdate = $traveler->getBirthDate();
|
||||
if(!strtotime($birthdate)){
|
||||
$birthdate = '01.01.1900';
|
||||
}
|
||||
$participants[''. ($i+1)] = [
|
||||
'gender' => $traveler->getSex(),
|
||||
'first_name' => $traveler->getFirstName(),
|
||||
'last_name' => $traveler->getLastName(),
|
||||
'birthday' => $traveler->getBirthDate()
|
||||
'birthday' => $birthdate,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -930,6 +935,9 @@ class TravelBooking
|
|||
$traveler->setSex(intval($participant['gender']));
|
||||
$traveler->setFirstName($participant['first_name']);
|
||||
$traveler->setLastName($participant['last_name']);
|
||||
if(!strtotime($participant['birthday'])){
|
||||
$participant['birthday'] = '01.01.1900';
|
||||
}
|
||||
$traveler->setBirthDate(\DateTime::createFromFormat('d.m.Y', $participant['birthday']));
|
||||
$ret[] = $traveler;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,6 +88,9 @@ class Traveler
|
|||
*/
|
||||
public function getBirthDate()
|
||||
{
|
||||
if(($this->birthDate instanceof String) && !strtotime($this->birthDate)){
|
||||
return '01.01.1900';
|
||||
}
|
||||
return $this->birthDate;
|
||||
}
|
||||
|
||||
|
|
@ -96,6 +99,7 @@ class Traveler
|
|||
*/
|
||||
public function setBirthDate($birthDate)
|
||||
{
|
||||
|
||||
$this->birthDate = $birthDate;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,8 +31,7 @@ class BookingSternToursCrmExporter extends SternToursCrmExporter
|
|||
$this->warn('Failed creating lead in CRM Lead', $bookingRequest, $travelDate, Logger::ERROR);
|
||||
return false;
|
||||
}
|
||||
$bookingUrl = $this->createBooking($bookingRequest, $travelDate, $bookingPriceInfo, $lead['customer_id'],
|
||||
$lead['id']);
|
||||
$bookingUrl = $this->createBooking($bookingRequest, $travelDate, $bookingPriceInfo, $lead['customer_id'], $lead['id']);
|
||||
if ($bookingUrl === false)
|
||||
{
|
||||
$this->warn('Failed creating booking in CRM Booking', $bookingRequest, $travelDate, Logger::ERROR);
|
||||
|
|
@ -268,7 +267,6 @@ class BookingSternToursCrmExporter extends SternToursCrmExporter
|
|||
'participant_firstname' => $bookingRequest->getTravelers()[0]->getFirstName(),
|
||||
'participant_birthdate' => $bookingRequest->getTravelers()[0]->getBirthDate(),
|
||||
]]);
|
||||
|
||||
if (!$resp['success'])
|
||||
{
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ use Monolog\Logger;
|
|||
|
||||
abstract class SternToursCrmExporter
|
||||
{
|
||||
const API_URL = 'http://www.cms.stern-tours.net/api';
|
||||
//const API_URL = 'http://www.cms.stern-tours.net/api';
|
||||
const API_URL = 'http://cms-stern-torus.local/api';
|
||||
const API_KEY = 'f6077389c9ce710e554763a5de02c8ec';
|
||||
const API_USER_ID = 15; // 'apiuser'
|
||||
const WEBSITE_ID = 1; // 'sterntours.de'
|
||||
|
|
|
|||
|
|
@ -133,17 +133,17 @@ class BookingRequestType extends AbstractType
|
|||
])
|
||||
->add('phone')
|
||||
->add('fax')
|
||||
->add('email')
|
||||
/*EmailType::class, [
|
||||
->add('email',
|
||||
EmailType::class, [
|
||||
'constraints' =>[
|
||||
new Email([
|
||||
'message'=>'This is not the corect email format'
|
||||
'message'=>'Dies ist nicht das richtige E-Mail-Format, bitte korrigieren.'
|
||||
]),
|
||||
new NotBlank([
|
||||
'message' => 'This field can not be blank'
|
||||
'message' => 'Das Feld E-Mail darf nicht leer sein.'
|
||||
])
|
||||
]
|
||||
])*/
|
||||
])
|
||||
->add('rooms', CollectionType::class, [
|
||||
'entry_type' => RoomType::class,
|
||||
'by_reference' => false,
|
||||
|
|
|
|||
|
|
@ -19,12 +19,15 @@ use Symfony\Component\Form\Extension\Core\Type\CollectionType;
|
|||
use Symfony\Component\Form\Extension\Core\Type\RangeType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormEvent;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\Choice;
|
||||
use Symfony\Component\Validator\Constraints\NotNull;
|
||||
use Symfony\Component\Validator\Constraints\Email;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
|
||||
class FewoBookingRequestType extends AbstractType
|
||||
{
|
||||
|
|
@ -117,7 +120,17 @@ class FewoBookingRequestType extends AbstractType
|
|||
->add('city')
|
||||
->add('phone')
|
||||
->add('fax')
|
||||
->add('email')
|
||||
->add('email',
|
||||
EmailType::class, [
|
||||
'constraints' =>[
|
||||
new Email([
|
||||
'message'=>'Dies ist nicht das richtige E-Mail-Format, bitte korrigieren.'
|
||||
]),
|
||||
new NotBlank([
|
||||
'message' => 'Das Feld E-Mail darf nicht leer sein.'
|
||||
])
|
||||
]
|
||||
])
|
||||
->add('notes', TextareaType::class, ['required' => false])
|
||||
->add('acceptTerms', CheckboxType::class, ['required' => true])
|
||||
->add('acceptPrivacy', CheckboxType::class, ['required' => true])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue