mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Event: add more fields: documents, organizationCost, note, and location
This commit is contained in:
@@ -11,12 +11,18 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\EventBundle\Form;
|
||||
|
||||
use Chill\DocStoreBundle\Entity\StoredObject;
|
||||
use Chill\DocStoreBundle\Form\StoredObjectType;
|
||||
use Chill\EventBundle\Form\Type\PickEventTypeType;
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Chill\MainBundle\Form\Type\ChillCollectionType;
|
||||
use Chill\MainBundle\Form\Type\ChillDateTimeType;
|
||||
use Chill\MainBundle\Form\Type\CommentType;
|
||||
use Chill\MainBundle\Form\Type\PickUserLocationType;
|
||||
use Chill\MainBundle\Form\Type\ScopePickerType;
|
||||
use Chill\MainBundle\Form\Type\UserPickerType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\MoneyType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
@@ -47,6 +53,28 @@ class EventType extends AbstractType
|
||||
'class' => '',
|
||||
],
|
||||
'required' => false,
|
||||
])
|
||||
->add('location', PickUserLocationType::class, [
|
||||
'label' => 'event.fields.location',
|
||||
])
|
||||
->add('comment', CommentType::class, [
|
||||
'label' => 'Comment',
|
||||
'required' => false,
|
||||
])
|
||||
->add('documents', ChillCollectionType::class, [
|
||||
'entry_type' => StoredObjectType::class,
|
||||
'entry_options' => [
|
||||
'has_title' => true,
|
||||
],
|
||||
'allow_add' => true,
|
||||
'allow_delete' => true,
|
||||
'delete_empty' => fn(StoredObject $storedObject): bool => '' === $storedObject->getFilename(),
|
||||
'button_remove_label' => 'event.form.remove_document',
|
||||
'button_add_label' => 'event.form.add_document',
|
||||
])
|
||||
->add('organizationCost', MoneyType::class, [
|
||||
'label' => 'event.fields.organizationCost',
|
||||
'help' => 'event.form.organisationCost_help',
|
||||
]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user