mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 05:44:24 +00:00
start form
This commit is contained in:
parent
8389afb4a8
commit
e7c76734a6
@ -2,34 +2,71 @@
|
||||
|
||||
namespace Chill\AsideActivityBundle\Form;
|
||||
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
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\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)
|
||||
{
|
||||
$builder
|
||||
->add('date', DateType::class, [
|
||||
'label' => 'Nom'
|
||||
->add('createdBy', 'entity',
|
||||
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
|
||||
->setDefault('class', \Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class)
|
||||
;
|
||||
$resolver->setDefaults([
|
||||
'data_class' => AsideActivity::class,
|
||||
]);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user