mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-25 09:03:48 +00:00
refactor pickTemplate and adapt existing usage
This commit is contained in:
@@ -34,6 +34,7 @@ use Psr\Log\LoggerInterface;
|
||||
use RuntimeException;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@@ -393,9 +394,25 @@ final class ActivityController extends AbstractController
|
||||
'role' => new Role('CHILL_ACTIVITY_CREATE'),
|
||||
'activityType' => $entity->getActivityType(),
|
||||
'accompanyingPeriod' => $accompanyingPeriod,
|
||||
])->handleRequest($request);
|
||||
]);
|
||||
|
||||
if ($form->has('documents')) {
|
||||
$form->add('gendocTemplateId', HiddenType::class, [
|
||||
'mapped' => false,
|
||||
'data' => null,
|
||||
'attr' => [
|
||||
// required for js
|
||||
'data-template-id' => 'data-template-id',
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
if ($form->has('gendocTemplateId')) {
|
||||
dd($form->get('gendocTemplateId')->getData());
|
||||
}
|
||||
$this->entityManager->persist($entity);
|
||||
$this->entityManager->flush();
|
||||
|
||||
|
Reference in New Issue
Block a user