feat: driver license check for teamers
closes #869bup9vf
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Upload;
|
||||
use App\Model\DriverLicenseCheckDto;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class DriverLicenseCheckType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('status', ChoiceType::class, [
|
||||
'label' => 'neuer Status',
|
||||
'choices' => [
|
||||
'in Bearbeitung' => Upload::STATUS_NEW,
|
||||
'bestätigt' => Upload::STATUS_CHECKED,
|
||||
'abgelehnt' => Upload::STATUS_REJECTED,
|
||||
],
|
||||
])
|
||||
->add('comment', TextareaType::class, [
|
||||
'label' => 'Kommentar/Begründung',
|
||||
'required' => false,
|
||||
'attr' => [
|
||||
'rows' => 3,
|
||||
],
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => DriverLicenseCheckDto::class,
|
||||
'anti_xss' => true,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Model\DriverLicenseDeclarationDto;
|
||||
use App\Model\UploadSessionDto;
|
||||
use App\Service\Upload\UploadHandler;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class DriverLicenseDeclarationType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder->add('hasDriverLicense', ChoiceType::class, [
|
||||
'label' => 'Besitzt du einen gültigen Führerschein?',
|
||||
'choices' => [
|
||||
'Ja' => true,
|
||||
'Nein' => false,
|
||||
],
|
||||
'expanded' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
public function buildView(FormView $view, FormInterface $form, array $options): void
|
||||
{
|
||||
/** @var UploadSessionDto $uploadSession */
|
||||
$uploadSession = $options['upload_session'];
|
||||
|
||||
$view->vars['upload_session_params'] = [
|
||||
UploadHandler::SESSION_KEY => $uploadSession->getUid(),
|
||||
];
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver
|
||||
->setDefaults([
|
||||
'data_class' => DriverLicenseDeclarationDto::class,
|
||||
])
|
||||
->setRequired(['upload_session'])
|
||||
->setAllowedTypes('upload_session', UploadSessionDto::class)
|
||||
;
|
||||
}
|
||||
}
|
||||
@@ -36,6 +36,10 @@ class TeamerFilterType extends AbstractType
|
||||
'label' => 'Snowboardlehrer:innen-Lizenz',
|
||||
'required' => false,
|
||||
])
|
||||
->add('driverLicenseVerified', CheckboxType::class, [
|
||||
'label' => 'Führerschein bestätigt',
|
||||
'required' => false,
|
||||
])
|
||||
->add('jobProfiles', MultiselectEntityType::class, [
|
||||
'label' => 'Job-Profile',
|
||||
'class' => JobProfile::class,
|
||||
|
||||
Reference in New Issue
Block a user