Withdraw selected part lots, when building

This commit is contained in:
Jan Böhmer 2023-01-22 16:59:58 +01:00
parent 31a20d0692
commit 616533ea4a
6 changed files with 79 additions and 3 deletions

View file

@ -26,6 +26,7 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\DataMapperInterface;
use Symfony\Component\Form\Event\PreSetDataEvent;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormInterface;
@ -47,6 +48,12 @@ class ProjectBuildType extends AbstractType implements DataMapperInterface
$builder->add('submit', SubmitType::class, []);
$builder->add('comment', TextType::class, [
'label' => 'part.info.withdraw_modal.comment',
'help' => 'part.info.withdraw_modal.comment.hint',
'required' => false,
]);
//The form is initially empty, we have to define the fields after we know the data
$builder->addEventListener(FormEvents::PRE_SET_DATA, function (PreSetDataEvent $event) {
$form = $event->getForm();