src/Form/Type/VacancyResponseType.php line 36

Open in your IDE?
  1. <?php
  2. /**
  3.  * Vacancy Type
  4.  *
  5.  * @author Vincent van Waasbergen <v.vanwaasbergen@visualmedia.nl>
  6.  */
  7. namespace App\Form\Type;
  8. use App\Entity\Vacancy;
  9. use FOS\CKEditorBundle\Form\Type\CKEditorType;
  10. use Symfony\Component\Form\AbstractType;
  11. use Symfony\Bridge\Doctrine\Form\Type\EntityType;
  12. use Symfony\Component\Form\Extension\Core\Type\DateType;
  13. use Symfony\Component\Form\Extension\Core\Type\FileType;
  14. use Symfony\Component\Form\Extension\Core\Type\TextType;
  15. use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
  16. use Symfony\Component\Form\Extension\Core\Type\SubmitType;
  17. use Symfony\Component\Form\Extension\Core\Type\TextareaType;
  18. use Symfony\Component\Form\FormBuilderInterface;
  19. use Symfony\Component\OptionsResolver\OptionsResolver;
  20. use Symfony\Component\Validator\Constraints\IsTrue;
  21. use Symfony\Component\Validator\Constraints\NotBlank;
  22. use VisualMedia\EmployeeBundle\Entity\BaseEmployee;
  23. use VisualMedia\LisaBundle\Component\Manager;
  24. use VisualMedia\LisaBundle\Component\ManagerData;
  25. use VisualMedia\LisaBundle\Form\Type\DateTimeType;
  26. use VisualMedia\ProjectBundle\Entity\BaseProject;
  27. use VisualMedia\VacancyBundle\Form\Type\VacancyType as BaseVacancyType;
  28. /**
  29.  * Vacancy Type
  30.  */
  31. class VacancyResponseType extends AbstractType
  32. {
  33.     /**
  34.      * {@inheritDoc}
  35.      */
  36.     public function buildForm(FormBuilderInterface $builder, array $options): void
  37.     {
  38.         $builder->add('firstName'TextType::class, array(
  39.             'label' => 'Voornaam',
  40.             'required' => true,
  41.         ));
  42.         $builder->add('lastName'TextType::class, array(
  43.             'label' => 'Achternaam',
  44.             'required' => true,
  45.         ));
  46.         $builder->add('phone'TextType::class, array(
  47.             'label' => 'Telefoonnummer',
  48.             'required' => true,
  49.         ));
  50.         $builder->add('email'TextType::class, array(
  51.             'label' => 'E-mailadres',
  52.             'required' => true,
  53.         ));
  54.         $builder->add('uploadResume'TextType::class, array(
  55.             'label' => 'Uploaden CV',
  56.             'required' => false,
  57.         ));
  58.         $builder->add('uploadResume'FileType::class, array(
  59.             'label' => 'Uploaden CV',
  60.             'required' => false,
  61.             'mapped' => false,
  62.             'attr' => [ 'accept' => implode(',', [ 'application/msword''.doc''.docx,''application/pdf' ]) ],
  63.         ));
  64.         $builder->add('motivation'TextareaType::class, array(
  65.             'label' => 'Je motivatie',
  66.             'trim' => true,
  67.             'required' => true,
  68.             'constraints' => array(
  69.                 new NotBlank(),
  70.             )
  71.         ));
  72.         // $builder->add('uploadMotivation', FileType::class, array(
  73.         //     'label' => 'Uploaden motivatiebrief',
  74.         //     'required' => true,
  75.         //     'mapped' => false,
  76.         //     'attr' => [ 'accept' => implode(',', [ 'application/msword', '.doc', '.docx,', 'application/pdf' ]) ],
  77.         // ));
  78.         $builder->add('privacyStatement'CheckboxType::class, array(
  79.             'label' => 'Ik geef toestemming voor het opslaan van mijn gegevens, volgens de richtlijnen zoals beschreven in ons <a href="/privacyverklaring/" target="_blank">privacyverklaring</a>.',
  80.             'constraints' => [ new IsTrue([ 'message' => 'checkout.terms_and_conditions.is_true' ]) ],
  81.             'data' => false,
  82.         ));
  83.         $builder->add('submit'SubmitType::class, [ 'label' => 'Verzenden' ]);
  84.     }
  85.     /**
  86.      * {@inheritDoc}
  87.      */
  88.     public function configureOptions(OptionsResolver $resolver): void
  89.     {
  90.         $resolver->setDefaults([
  91.             // ...
  92.         ]);
  93.     }
  94. }