mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-14 14:24:24 +00:00
start form
This commit is contained in:
parent
8389afb4a8
commit
e7c76734a6
@ -2,34 +2,71 @@
|
|||||||
|
|
||||||
namespace Chill\AsideActivityBundle\Form;
|
namespace Chill\AsideActivityBundle\Form;
|
||||||
|
|
||||||
|
use Chill\MainBundle\Entity\User;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Chill\PersonBundle\Form\Type\ClosingMotivePickerType;
|
|
||||||
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class ClosingMotiveType extends AbstractType
|
class AsideActivityType extends AbstractType
|
||||||
{
|
{
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('date', DateType::class, [
|
->add('createdBy', 'entity',
|
||||||
'label' => 'Nom'
|
array(
|
||||||
|
'class' => User::class,
|
||||||
|
'choice_label' => 'username'
|
||||||
|
),
|
||||||
|
[
|
||||||
|
'label' => 'Utilisateur',
|
||||||
|
'required' => true
|
||||||
])
|
])
|
||||||
;
|
->add('agent', 'entity',
|
||||||
|
array(
|
||||||
|
'class' => User::class,
|
||||||
|
'choice_label' => 'username'
|
||||||
|
),
|
||||||
|
[
|
||||||
|
'label' => 'Agent',
|
||||||
|
'required' => true
|
||||||
|
])
|
||||||
|
->add('type', 'entity',
|
||||||
|
array(
|
||||||
|
'class' => AsideActivityType::class,
|
||||||
|
'choice_label' => 'title'
|
||||||
|
),
|
||||||
|
[
|
||||||
|
'label' => 'Type',
|
||||||
|
'required' => true
|
||||||
|
])
|
||||||
|
->add('date', DateType::class, [
|
||||||
|
'label' => 'Date',
|
||||||
|
'required' => true
|
||||||
|
])
|
||||||
|
->add('duration', NumberType::class, [
|
||||||
|
'label' => 'Durée'
|
||||||
|
])
|
||||||
|
->add('location', TextType::class, [
|
||||||
|
'label' => 'Lieu'
|
||||||
|
])
|
||||||
|
->add('note', TextareaType::class, [
|
||||||
|
'label' => 'Note'
|
||||||
|
])
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
{
|
{
|
||||||
$resolver
|
$resolver->setDefaults([
|
||||||
->setDefault('class', \Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class)
|
'data_class' => AsideActivity::class,
|
||||||
;
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user