Vaidator Booking E-Mail and traveler Date
git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3373 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
parent
751a904629
commit
fd9509420d
5 changed files with 26 additions and 4 deletions
|
|
@ -87,6 +87,7 @@ class BookingController extends Controller
|
|||
|
||||
if ($request->getMethod() == 'POST' && $form->isValid())
|
||||
{
|
||||
|
||||
$booking = $this->getDoctrine()->getRepository('AppBundle:TravelBooking')->createFromBookingRequest(
|
||||
$bookingRequest, $travelDate, $bookingPriceInfo);
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
|
|
|||
|
|
@ -28,14 +28,14 @@ class BookingSternToursCrmExporter extends SternToursCrmExporter
|
|||
$lead = $this->createLead($bookingRequest, $travelDate);
|
||||
if ($lead === null)
|
||||
{
|
||||
$this->warn('Failed creating lead in CRM', $bookingRequest, $travelDate, Logger::ERROR);
|
||||
$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']);
|
||||
if ($bookingUrl === false)
|
||||
{
|
||||
$this->warn('Failed creating booking in CRM', $bookingRequest, $travelDate, Logger::ERROR);
|
||||
$this->warn('Failed creating booking in CRM Booking', $bookingRequest, $travelDate, Logger::ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,12 +20,16 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
|||
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
|
||||
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 BookingRequestType extends AbstractType
|
||||
{
|
||||
|
|
@ -129,7 +133,16 @@ class BookingRequestType extends AbstractType
|
|||
])
|
||||
->add('phone')
|
||||
->add('fax')
|
||||
->add('email')
|
||||
->add('email', EmailType::class, [
|
||||
'constraints' =>[
|
||||
new Email([
|
||||
'message'=>'This is not the corect email format'
|
||||
]),
|
||||
new NotBlank([
|
||||
'message' => 'This field can not be blank'
|
||||
])
|
||||
]
|
||||
])
|
||||
->add('rooms', CollectionType::class, [
|
||||
'entry_type' => RoomType::class,
|
||||
'by_reference' => false,
|
||||
|
|
|
|||
|
|
@ -50,7 +50,10 @@ class TravelerType extends AbstractType
|
|||
])
|
||||
->add('firstName')
|
||||
->add('lastName')
|
||||
->add('birthDate')
|
||||
->add('birthDate', StDateType::class, [
|
||||
'format' => 'dd.MM.y'
|
||||
]
|
||||
)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
|
@ -69,3 +69,8 @@ a,
|
|||
.c1 li:before {
|
||||
color: darken(@text-brand-color, 0%);
|
||||
}
|
||||
|
||||
|
||||
.help-block {
|
||||
color:#cd2929;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue