Commit 9d0bdd61 authored by Mat's avatar Mat

FormType pour Groupe et Depot

parent af915e72
......@@ -3,8 +3,13 @@
namespace PotageBundle\Form\Depot;
use PotageBundle\Entity\Depot;
use PotageBundle\Entity\Groupe;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\TimeType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
......@@ -13,8 +18,55 @@ class DepotType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
/*
$builder->add('groupe', EntityType::class, array(
'class' => Groupe::class,
'choice_label' => 'getNom',
'placeholder' => 'Associer le point de dépôt à un groupe',
'label' => 'Groupe',
'attr' => array('class' => 'form-control form-control-sm'),
));
*/
$builder->add('localisation', TextType::class, array(
'label' => "Localisation",
'label_attr' => array('class' => 'col-form-label'),
'attr' => array(
'class' => 'form-control form-control-sm',
),
));
$builder->add('responsable', TextType::class, array(
'label' => "Propriétaire ou personne responsable",
'label_attr' => array('class' => 'col-form-label'),
'attr' => array(
'class' => 'form-control form-control-sm',
),
));
$builder->add('jourPanier', ChoiceType::class, array(
'label' => "Jour de livraison",
'choices' => array(
'lundi' => '1',
'mardi' => '2',
'mercredi' => '3',
'jeudi' => '4',
'vendredi' => '5',
'samedi' => '6',
'dimanche' => '0',
),
'label_attr' => array('class' => 'col-form-label'),
'attr' => array(
'class' => 'form-control form-control-sm',
),
));
$builder->add('heurePanier', TimeType::class, array(
'label' => "Heure de livraison",
'widget' => 'single_text',
//'data' => new \DateTime('now'),
'label_attr' => array('class' => 'col-form-label'),
'attr' => array(
'class' => 'form-control form-control-sm',
),
));
/* TODO les champs en plus
*/
......
......@@ -2,9 +2,14 @@
namespace PotageBundle\Form\Groupe;
use PotageBundle\Entity\Depot;
use PotageBundle\Entity\Groupe;
use PotageBundle\Entity\Lettre;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\AbstractType;
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;
......@@ -13,8 +18,29 @@ class GroupeType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('depot', EntityType::class, array(
'class' => Depot::class,
'choice_label' => 'getNom',
'placeholder' => 'Associer le groupe à un point de dépôt',
'label' => 'Point de dépôt',
'attr' => array('class' => 'form-control form-control-sm'),
));
$builder->add('nom', TextType::class, array(
'label' => "Nom",
'label_attr' => array('class' => 'col-form-label'),
'attr' => array(
'class' => 'form-control form-control-sm',
),
));
$builder->add('description', TextareaType::class, array(
'label' => "Description",
'label_attr' => array('class' => 'col-form-label'),
'attr' => array(
'class' => 'form-control form-control-sm',
),
));
/* TODO les champs en plus
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment