mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 03:23:48 +00:00
Allow Pick*Type to submit the form when selection an entity, and apply inside Event
This commit is contained in:
@@ -411,20 +411,17 @@ final class EventController extends AbstractController
|
||||
]
|
||||
);
|
||||
|
||||
$builder->add('person_id', PickPersonDynamicType::class, ['as_id' => true, 'multiple' => false]);
|
||||
$builder->add('person_id', PickPersonDynamicType::class, [
|
||||
'as_id' => true,
|
||||
'multiple' => false,
|
||||
'submit_on_adding_new_entity' => true,
|
||||
'label' => 'Add a participation',
|
||||
]);
|
||||
|
||||
$builder->add('event_id', HiddenType::class, [
|
||||
'data' => $event->getId(),
|
||||
]);
|
||||
|
||||
$builder->add(
|
||||
'submit',
|
||||
SubmitType::class,
|
||||
[
|
||||
'label' => 'Add a participation',
|
||||
]
|
||||
);
|
||||
|
||||
return $builder->getForm();
|
||||
}
|
||||
|
||||
|
@@ -101,7 +101,12 @@ final readonly class EventListController
|
||||
]
|
||||
);
|
||||
|
||||
$builder->add('person_id', PickPersonDynamicType::class, ['as_id' => true, 'multiple' => false]);
|
||||
$builder->add('person_id', PickPersonDynamicType::class, [
|
||||
'as_id' => true,
|
||||
'multiple' => false,
|
||||
'submit_on_adding_new_entity' => true,
|
||||
'label' => 'Add a participation',
|
||||
]);
|
||||
|
||||
$builder->add('event_id', HiddenType::class, [
|
||||
'data' => $event->getId(),
|
||||
|
@@ -60,18 +60,13 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{#
|
||||
<div class="item-row">
|
||||
<div class="item-col">
|
||||
{{ form_start(eventForms[e.id]) }}
|
||||
{{ form_widget(eventForms[e.id].person_id) }}
|
||||
<ul class="record_actions">
|
||||
<li><button type="submit" class="btn btn-create"></button></li>
|
||||
</ul>
|
||||
{{ form_end(eventForms[e.id]) }}
|
||||
</div>
|
||||
</div>
|
||||
#}
|
||||
<div class="item-row separator">
|
||||
<div class="item-col item-meta">
|
||||
</div>
|
||||
|
@@ -136,11 +136,8 @@
|
||||
'class' : 'custom-select',
|
||||
'style': 'min-width: 15em; max-width: 18em; display: inline-block;'
|
||||
}} ) }}
|
||||
<div class="input-group-append">
|
||||
{{ form_widget(form_add_participation_by_person.submit, { 'attr' : { 'class' : 'btn btn-create' } } ) }}
|
||||
</div>
|
||||
</div>
|
||||
{{ form_rest(form_add_participation_by_person) }}
|
||||
<input type="hidden" name="returnPath" value="{{ app.request.requestUri }}" />
|
||||
{{ form_end(form_add_participation_by_person) }}
|
||||
</div>
|
||||
|
||||
|
Reference in New Issue
Block a user