mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 11:03:50 +00:00
Generate a context for docgen, on accompanying period
This commit is contained in:
@@ -14,13 +14,13 @@ namespace Chill\DocGeneratorBundle\Form;
|
||||
use Chill\DocGeneratorBundle\Context\ContextManager;
|
||||
use Chill\DocGeneratorBundle\Context\DocGeneratorContextInterface;
|
||||
use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate;
|
||||
use Chill\DocStoreBundle\Form\StoredObjectType;
|
||||
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Chill\DocStoreBundle\Form\StoredObjectType;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation;
|
||||
|
||||
class DocGeneratorTemplateType extends AbstractType
|
||||
{
|
||||
@@ -33,7 +33,7 @@ class DocGeneratorTemplateType extends AbstractType
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$contexts = \array_flip(\array_map(function (DocGeneratorContextInterface $c) {
|
||||
$contexts = array_flip(array_map(static function (DocGeneratorContextInterface $c) {
|
||||
return $c->getName();
|
||||
}, $this->contextManager->getContext()));
|
||||
|
||||
@@ -44,20 +44,19 @@ class DocGeneratorTemplateType extends AbstractType
|
||||
->add('context', ChoiceType::class, [
|
||||
'required' => true,
|
||||
'label' => 'Context',
|
||||
'choices' => $contexts
|
||||
'choices' => $contexts,
|
||||
])
|
||||
->add('entities', ChoiceType::class, [
|
||||
'multiple' => true,
|
||||
'choices' => [
|
||||
'choices' => [
|
||||
'AccompanyingPeriod' => 'Chill\PersonBundle\Entity\AccompanyingPeriod',
|
||||
'SocialWork\SocialAction' => 'Chill\PersonBundle\Entity\SocialWork\SocialAction',
|
||||
'AccompanyingPeriod\AccompanyingPeriodWorkEvaluation' => AccompanyingPeriodWorkEvaluation::class
|
||||
]])
|
||||
'AccompanyingPeriod\AccompanyingPeriodWorkEvaluation' => AccompanyingPeriodWorkEvaluation::class,
|
||||
], ])
|
||||
->add('description')
|
||||
->add('file', StoredObjectType::class, [
|
||||
'error_bubbling' => true
|
||||
])
|
||||
;
|
||||
'error_bubbling' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
|
Reference in New Issue
Block a user