src/Form/WorkWithUsType.php line 19

  1. <?php
  2. namespace App\Form;
  3. use Symfony\Component\Form\AbstractType;
  4. use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
  5. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  6. use Symfony\Component\Form\Extension\Core\Type\DateType;
  7. use Symfony\Component\Form\Extension\Core\Type\EmailType;
  8. use Symfony\Component\Form\Extension\Core\Type\FileType;
  9. use Symfony\Component\Form\Extension\Core\Type\TelType;
  10. use Symfony\Component\Form\Extension\Core\Type\TextareaType;
  11. use Symfony\Component\Form\Extension\Core\Type\TextType;
  12. use Symfony\Component\Form\FormBuilderInterface;
  13. use Symfony\Component\OptionsResolver\OptionsResolver;
  14. use Symfony\Component\Validator\Constraints\File;
  15. use Symfony\Contracts\Translation\TranslatorInterface;
  16. class WorkWithUsType extends AbstractType
  17. {
  18.     private $transalor;
  19.     public function __construct(TranslatorInterface $translator)
  20.     {
  21.         $this->transalor $translator;
  22.     }
  23.     public function buildForm(FormBuilderInterface $builder, array $options): void
  24.     {
  25.         $builder
  26.             ->add('name'TextType::class)
  27.             ->add('surname'TextType::class)
  28.             ->add('email'EmailType::class)
  29.             ->add('nationality'ChoiceType::class,[
  30.                 'required' => true,
  31.                 'placeholder' => $this->transalor->trans('form.choices.work_with_us.placeholder_nation') . '*',
  32.                 'choices' => [
  33.                     // 'Seleziona la tua Nazione*' => null,
  34.                     'Afghanistan' => 'Afghanistan',
  35.                     'Albania' => 'Albania',
  36.                     'Algeria' => 'Algeria',
  37.                     'Andorra' => 'Andorra',
  38.                     'Angola' => 'Angola',
  39.                     'Argentina' => 'Argentina',
  40.                     'Armenia' => 'Armenia',
  41.                     'Australia' => 'Australia',
  42.                     'Austria' => 'Austria',
  43.                     'Azerbaijan' => 'Azerbaijan',
  44.                     'Bahamas' => 'Bahamas',
  45.                     'Bahrain' => 'Bahrain',
  46.                     'Bangladesh' => 'Bangladesh',
  47.                     'Barbados' => 'Barbados',
  48.                     'Belarus' => 'Belarus',
  49.                     'Belgium' => 'Belgium',
  50.                     'Belize' => 'Belize',
  51.                     'Benin (Dahomey)' => 'Benin (Dahomey)',
  52.                     'Bolivia' => 'Bolivia',
  53.                     'Bosnia and Herzegovina' => 'Bosnia and Herzegovina',
  54.                     'Botswana' => 'Botswana',
  55.                     'Brazil' => 'Brazil',
  56.                     'Brunei' => 'Brunei',
  57.                     'Brunswick and Lüneburg' => 'Brunswick and Lüneburg',
  58.                     'Bulgaria' => 'Bulgaria',
  59.                     'Burkina Faso' => 'Burkina Faso',
  60.                     'Burma' => 'Burma',
  61.                     'Cabo Verde' => 'Cabo Verde',
  62.                     'Cambodia' => 'Cambodia',
  63.                     'Cameroon' => 'Cameroon',
  64.                     'Canada' => 'Canada',
  65.                     'Cayman Islands' => 'Cayman Islands',
  66.                     'Central African Republic' => 'Central African Republic',
  67.                     'Central American Federation' => 'Central American Federation',
  68.                     'Chad' => 'Chad',
  69.                     'Chile' => 'Chile',
  70.                     'China' => 'China',
  71.                     'Colombia' => 'Colombia',
  72.                     'Comoros' => 'Comoros',
  73.                     'Congo Free State' => 'Congo Free State',
  74.                     'Costa Ric' => 'Costa Ric',
  75.                     'Cote d’Ivoire (Ivory Coast)' => 'Cote d’Ivoire (Ivory Coast)',
  76.                     'Croatia' => 'Croatia',
  77.                     'Cuba' => 'Cuba',
  78.                     'Cyprus' => 'Cyprus',
  79.                     'Czechia' => 'Czechia',
  80.                     'Czechoslovakia' => 'Czechoslovakia',
  81.                     'Democratic Republic of the Congo' => 'Democratic Republic of the Congo',
  82.                     'Denmark' => 'Denmark',
  83.                     'Djibouti' => 'Djibouti',
  84.                     'Dominica' => 'Dominica',
  85.                     'Dominican Republic' => 'Dominican Republic',
  86.                     'Ecuador' => 'Ecuador',
  87.                     'Egyp' => 'Egyp',
  88.                     'El Salvador' => 'El Salvador',
  89.                     'Equatorial Guinea' => 'Equatorial Guinea',
  90.                     'Eritrea' => 'Eritrea',
  91.                     'Estonia' => 'Estonia',
  92.                     'Eswatini' => 'Eswatini',
  93.                     'Ethiopia' => 'Ethiopia',
  94.                     'Fiji' => 'Fiji',
  95.                     'Finland' => 'Finland',
  96.                     'France' => 'France',
  97.                     'Gabon' => 'Gabon',
  98.                     'Gambia' => 'Gambia',
  99.                     'Georgia' => 'Georgia',
  100.                     'Germany' => 'Germany',
  101.                     'Ghana' => 'Ghana',
  102.                     'Greece' => 'Greece',
  103.                     'Grenada' => 'Grenada',
  104.                     'Guatemala' => 'Guatemala',
  105.                     'Guine' => 'Guine',
  106.                     'Guyan' => 'Guyan',
  107.                     'Hai' => 'Hai',
  108.                     'Hanover' => 'Hanover',
  109.                     'Hanseatic Republics' => 'Hanseatic Republics',
  110.                     'Hawai' => 'Hawai',
  111.                     'Hes' => 'Hes',
  112.                     'Holy See' => 'Holy See',
  113.                     'Honduras' => 'Honduras',
  114.                     'Hungary' => 'Hungary',
  115.                     'Iceland' => 'Iceland',
  116.                     'Ind' => 'Ind',
  117.                     'Indonesia' => 'Indonesia',
  118.                     'Iran' => 'Iran',
  119.                     'Iraq' => 'Iraq',
  120.                     'Ireland' => 'Ireland',
  121.                     'Israel' => 'Israel',
  122.                     'Italy' => 'Italy',
  123.                     'Jamaica' => 'Jamaica',
  124.                     'Japan' => 'Japan',
  125.                     'Jordan' => 'Jordan',
  126.                     'Kazakhstan' => 'Kazakhstan',
  127.                     'Kenya' => 'Kenya',
  128.                     'Kiribati' => 'Kiribati',
  129.                     'Korea' => 'Korea',
  130.                     'Kosov' => 'Kosov',
  131.                     'Kuwai' => 'Kuwai',
  132.                     'Kyrgyzstan' => 'Kyrgyzstan',
  133.                     'Laos' => 'Laos',
  134.                     'Latvi' => 'Latvi',
  135.                     'Lebanon' => 'Lebanon',
  136.                     'Lesotho' => 'Lesotho',
  137.                     'Lew Chew (Loochoo)' => 'Lew Chew (Loochoo)',
  138.                     'Liberia' => 'Liberia',
  139.                     'Libya' => 'Libya',
  140.                     'Liechtenstein' => 'Liechtenstein',
  141.                     'Lithuania' => 'Lithuania',
  142.                     'Luxembourg' => 'Luxembourg',
  143.                     'Madagascar' => 'Madagascar',
  144.                     'Malawi' => 'Malawi',
  145.                     'Malaysia' => 'Malaysia',
  146.                     'Maldives' => 'Maldives',
  147.                     'Mali' => 'Mali',
  148.                     'Malta' => 'Malta',
  149.                     'Marshall Islands' => 'Marshall Islands',
  150.                     'Mauritania' => 'Mauritania',
  151.                     'Mauritius' => 'Mauritius',
  152.                     'Mecklenburg-Schwerin' => 'Mecklenburg-Schwerin',
  153.                     'Mecklenburg-Strelitz' => 'Mecklenburg-Strelitz',
  154.                     'Mexico' => 'Mexico',
  155.                     'Micronesia' => 'Micronesia',
  156.                     'Moldova' => 'Moldova',
  157.                     'Monaco' => 'Monaco',
  158.                     'Mongolia' => 'Mongolia',
  159.                     'Montenegro' => 'Montenegro',
  160.                     'Morocco' => 'Morocco',
  161.                     'Mozambique' => 'Mozambique',
  162.                     'Namibia' => 'Namibia',
  163.                     'Nassau' => 'Nassau',
  164.                     'Nauru' => 'Nauru',
  165.                     'Nepal' => 'Nepal',
  166.                     'Netherlands, The' => 'Netherlands, The',
  167.                     'New Zealand' => 'New Zealand',
  168.                     'Nicaragua' => 'Nicaragua',
  169.                     'Niger' => 'Niger',
  170.                     'Nigeria' => 'Nigeria',
  171.                     'North German Confederation' => 'North German Confederation',
  172.                     'North German Union' => 'North German Union',
  173.                     'North Macedonia' => 'North Macedonia',
  174.                     'Norway' => 'Norway',
  175.                     'Oldenburg' => 'Oldenburg',
  176.                     'Oman' => 'Oman',
  177.                     'Orange Free State' => 'Orange Free State',
  178.                     'Pakistan' => 'Pakistan',
  179.                     'Palau' => 'Palau',
  180.                     'Panama' => 'Panama',
  181.                     'Papal States' => 'Papal States',
  182.                     'Papua New Guinea' => 'Papua New Guinea',
  183.                     'Paraguay' => 'Paraguay',
  184.                     'Peru' => 'Peru',
  185.                     'Philippines' => 'Philippines',
  186.                     'Piedmont-Sardinia' => 'Piedmont-Sardinia',
  187.                     'Poland' => 'Poland',
  188.                     'Portugal' => 'Portugal',
  189.                     'Qatar' => 'Qatar',
  190.                     'Republic of Genoa' => 'Republic of Genoa',
  191.                     'Republic of Korea (South Korea)' => 'Republic of Korea (South Korea)',
  192.                     'Republic of the Congo' => 'Republic of the Congo',
  193.                     'Romania' => 'Romania',
  194.                     'Russia' => 'Russia',
  195.                     'Rwanda' => 'Rwanda',
  196.                     'Saint Kitts and Nevis' => 'Saint Kitts and Nevis',
  197.                     'Saint Lucia' => 'Saint Lucia',
  198.                     'Saint Vincent and the Grenadines' => 'Saint Vincent and the Grenadines',
  199.                     'Samoa' => 'Samoa',
  200.                     'San Marino' => 'San Marino',
  201.                     'Sao Tome and Principe' => 'Sao Tome and Principe',
  202.                     'Saudi Arabia' => 'Saudi Arabia',
  203.                     'Schaumburg-Lippe' => 'Schaumburg-Lippe',
  204.                     'Senegal' => 'Senegal',
  205.                     'Serbia' => 'Serbia',
  206.                     'Seychelles' => 'Seychelles',
  207.                     'Sierra Leone' => 'Sierra Leone',
  208.                     'Singapore' => 'Singapore',
  209.                     'Slovakia' => 'Slovakia',
  210.                     'Slovenia' => 'Slovenia',
  211.                     'Solomon Islands' => 'Solomon Islands',
  212.                     'Somalia' => 'Somalia',
  213.                     'South Africa' => 'South Africa',
  214.                     'South Sudan' => 'South Sudan',
  215.                     'Spain' => 'Spain',
  216.                     'Sri Lanka' => 'Sri Lanka',
  217.                     'Sudan' => 'Sudan',
  218.                     'Suriname' => 'Suriname',
  219.                     'Sweden' => 'Sweden',
  220.                     'Switzerland' => 'Switzerland',
  221.                     'Syria' => 'Syria',
  222.                     'Tajikistan' => 'Tajikistan',
  223.                     'Tanzania' => 'Tanzania',
  224.                     'Texas' => 'Texas',
  225.                     'Thailand' => 'Thailand',
  226.                     'Timor-Leste' => 'Timor-Leste',
  227.                     'Togo' => 'Togo',
  228.                     'Tonga' => 'Tonga',
  229.                     'Trinidad and Tobago' => 'Trinidad and Tobago',
  230.                     'Tunisia' => 'Tunisia',
  231.                     'Turkey' => 'Turkey',
  232.                     'Turkmenistan' => 'Turkmenistan',
  233.                     'Tuvalu' => 'Tuvalu',
  234.                     'Two Sicilies' => 'Two Sicilies',
  235.                     'Uganda' => 'Uganda',
  236.                     'Ukraine' => 'Ukraine',
  237.                     'Union of Soviet Socialist Republics' => 'Union of Soviet Socialist Republics',
  238.                     'United Arab Emirates, The' => 'United Arab Emirates, The',
  239.                     'United Kingdom, The' => 'United Kingdom, The',
  240.                     'Uruguay' => 'Uruguay',
  241.                     'Uzbekistan' => 'Uzbekistan',
  242.                     'Vanuatu' => 'Vanuatu',
  243.                     'Venezuela' => 'Venezuela',
  244.                     'Vietnam' => 'Vietnam',
  245.                     'Württemberg' => 'Württemberg',
  246.                     'Yemen' => 'Yemen',
  247.                     'Zambia' => 'Zambia',
  248.                     'Zimbabwe' => 'Zimbabwe',
  249.                 ]
  250.             ])
  251.             ->add('workingPosition'ChoiceType::class, [
  252.                 'required' => true,
  253.                 'placeholder' => $this->transalor->trans('form.choices.work_with_us.placeholder_works') . '*',
  254.                 'choices' => [
  255.                     $this->transalor->trans('form.choices.work_with_us.food_packaging_operator') => $this->transalor->trans('form.choices.work_with_us.food_packaging_operator'),
  256.                     $this->transalor->trans('form.choices.work_with_us.warehouse_keeper') => $this->transalor->trans('form.choices.work_with_us.warehouse_keeper'),
  257.                     $this->transalor->trans('form.choices.work_with_us.maintenance_technician') => $this->transalor->trans('form.choices.work_with_us.maintenance_technician'),
  258.                     $this->transalor->trans('form.choices.work_with_us.purchasing') => $this->transalor->trans('form.choices.work_with_us.purchasing'),
  259.                     $this->transalor->trans('form.choices.work_with_us.administration_finance') => $this->transalor->trans('form.choices.work_with_us.administration_finance'),
  260.                     $this->transalor->trans('form.choices.work_with_us.commercial') => $this->transalor->trans('form.choices.work_with_us.commercial'),
  261.                     $this->transalor->trans('form.choices.work_with_us.engineering') => $this->transalor->trans('form.choices.work_with_us.engineering'),
  262.                     $this->transalor->trans('form.choices.work_with_us.information_systems') => $this->transalor->trans('form.choices.work_with_us.information_systems'),
  263.                     $this->transalor->trans('form.choices.work_with_us.research_and_development') => $this->transalor->trans('form.choices.work_with_us.research_and_development'),
  264.                     $this->transalor->trans('form.choices.work_with_us.logistics') => $this->transalor->trans('form.choices.work_with_us.logistics'),
  265.                     $this->transalor->trans('form.choices.work_with_us.marketing') => $this->transalor->trans('form.choices.work_with_us.marketing'),
  266.                     $this->transalor->trans('form.choices.work_with_us.operations') => $this->transalor->trans('form.choices.work_with_us.operations'),
  267.                     $this->transalor->trans('form.choices.work_with_us.human_resources') => $this->transalor->trans('form.choices.work_with_us.human_resources'),
  268.                     $this->transalor->trans('form.choices.work_with_us.quality_assurance') => $this->transalor->trans('form.choices.work_with_us.quality_assurance'),
  269.                     $this->transalor->trans('form.choices.work_with_us.packaging_worker') => $this->transalor->trans('form.choices.work_with_us.packaging_worker'),
  270.                     $this->transalor->trans('form.choices.work_with_us.dough_mixer') => $this->transalor->trans('form.choices.work_with_us.dough_mixer'),
  271.                     $this->transalor->trans('form.choices.work_with_us.supply_chain') => $this->transalor->trans('form.choices.work_with_us.supply_chain'),
  272.                     $this->transalor->trans('form.choices.work_with_us.legal_affairs') => $this->transalor->trans('form.choices.work_with_us.legal_affairs'),
  273.                 ]
  274.             ])
  275.             ->add('file'FileType::class, [
  276.                 'required' => true,
  277.                 'constraints' => [
  278.                     new File([
  279.                         'maxSize' => '10M',
  280.                         'mimeTypes' => [
  281.                             'image/jpeg',
  282.                             'image/jpg',
  283.                             'image/png',
  284.                             'application/pdf',
  285.                             'application/x-pdf',
  286.                         ],
  287.                         'mimeTypesMessage' => $this->transalor->trans('form.errors.wrong_file_type'),
  288.                     ])
  289.                 ],
  290.             ])
  291.             ->add('message'TextareaType::class)
  292.             ->add('privacy'CheckboxType::class)
  293.             // ->add('data', CheckboxType::class)
  294.         ;
  295.     }
  296.     public function configureOptions(OptionsResolver $resolver): void
  297.     {
  298.         $resolver->setDefaults([
  299.             // 'mapped' => false,
  300.         ]);
  301.     }
  302. }