<?php
namespace App\Form;
use App\Entity\CancelReason;
use App\Entity\Client;
use App\Entity\Contract;
use App\Entity\Intervenant;
use App\Entity\Product;
use App\Entity\RDV;
use App\Entity\RDVProduct;
use App\Entity\Salon;
use Doctrine\ORM\EntityRepository;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
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;
class ReplanningType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('intervenant', EntityType::class, [
'label' => 'Choisir un intervenant',
'class' => Intervenant::class,
'attr' => [
'placeholder' => 'Choisir un intervenant',
],
'label_attr' => array('class' => ''),
'required' => false
])
->add('start', TextType::class, [
'label' => 'Choisir une date de début',
'required' => true,
'attr' => [
'placeholder' => 'Choisir une date de début',
],
'label_attr' => array('class' => ''),
])
->add('end', TextType::class, [
'label' => 'Choisir une date de fin',
'attr' => [
'placeholder' => 'Choisir une date de fin',
],
'label_attr' => array('class' => ''),
])
->add('status', ChoiceType::class, [
'label' => 'Statut',
'choices' => [
'Planifié' => RDV::STATUS_PLANIFIER,
'Annulé' => RDV::STATUS_ANNULER,
'Validé' => RDV::STATUS_VALIDATED,
]
])
->add('cancelReason', EntityType::class, [
'label' => 'Choisir un motif d\'annulation',
'class' => CancelReason::class,
'placeholder' => 'Choisir un motif d\'annulation',
'required' => false,
'attr' => [
'placeholder' => 'Choisir un motif d\'annulation',
],
'label_attr' => array('class' => ''),
])
->add('rdvSelected', HiddenType::class, [
'required' => false,
'label' => false,
'attr' => [
'id' => 'rdvSelected'
]
]);;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
]);
}
}