* Behoben: Falsche CRM-URL in Buchungs-Service-E-Mail
* Kontaktformular git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3300 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
parent
ff9c159297
commit
353b758bcd
12 changed files with 741 additions and 34 deletions
85
trunk/src/AppBundle/Form/ContactRequestType.php
Normal file
85
trunk/src/AppBundle/Form/ContactRequestType.php
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
<?php
|
||||
/**
|
||||
* @author Ulrich Hecht <ulrich.hecht@hecht-software.de>
|
||||
* @date 02/21/2017
|
||||
*/
|
||||
|
||||
namespace AppBundle\Form;
|
||||
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\Choice;
|
||||
use Symfony\Component\Validator\Constraints\NotNull;
|
||||
|
||||
class ContactRequestType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => 'AppBundle\Entity\ContactRequest',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FormBuilderInterface $builder
|
||||
* @param array $options
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$travelerCountChoices = [];
|
||||
for ($i = 1; $i <= 20; ++$i)
|
||||
{
|
||||
$travelerCountChoices[$i] = $i;
|
||||
}
|
||||
|
||||
$builder
|
||||
->add('salutation', ChoiceType::class, [
|
||||
'placeholder' => 'Anrede (Bitte wählen) *',
|
||||
'choices' => BookingRequestType::$SALUTATION_CHOICES,
|
||||
'constraints' => [
|
||||
new NotNull(),
|
||||
new Choice(['choices' => BookingRequestType::$SALUTATION_CHOICES])
|
||||
]
|
||||
])
|
||||
->add('firstName', TextType::class, ['required' => true])
|
||||
->add('lastName', TextType::class, ['required' => true])
|
||||
->add('streetAddress')
|
||||
->add('zipCode')
|
||||
->add('city')
|
||||
->add('nation', ChoiceType::class, [
|
||||
'placeholder' => 'Land (Bitte wählen)',
|
||||
'choices' => BookingRequestType::$NATION_CHOICES,
|
||||
'constraints' => [
|
||||
new NotNull(),
|
||||
new Choice(['choices' => BookingRequestType::$NATION_CHOICES])
|
||||
],
|
||||
'data' => BookingRequestType::$NATION_CHOICES['Deutschland'],
|
||||
])
|
||||
->add('phone', TextType::class, ['required' => true])
|
||||
->add('mobilePhone')
|
||||
->add('email', EmailType::class, ['required' => true])
|
||||
->add('travelerCount', ChoiceType::class, [
|
||||
'placeholder' => 'Anzahl der Reisenden (Bitte wählen)',
|
||||
'choices' => $travelerCountChoices,
|
||||
'constraints' => [
|
||||
new Choice(['choices' => $travelerCountChoices])]
|
||||
])
|
||||
->add('notes', TextareaType::class, ['required' => false])
|
||||
->add('departure0')
|
||||
->add('departure1')
|
||||
->add('departure2')
|
||||
->add('start', StDateType::class, ['required' => false])
|
||||
->add('end', StDateType::class, ['required' => false])
|
||||
->add('duration')
|
||||
;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue