generate document with relatorio: config and driver

This commit is contained in:
2021-12-02 18:02:19 +01:00
parent 2245f83631
commit af6efdd0ba
15 changed files with 286 additions and 363 deletions

View File

@@ -12,14 +12,11 @@ declare(strict_types=1);
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\CallbackTransformer;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -45,17 +42,16 @@ class DocGeneratorTemplateType extends AbstractType
->add('description')
->add('file', StoredObjectType::class, [
'error_bubbling' => true,
])
;
]);
if ($context->hasAdminForm()) {
$sub = $builder
->create('options', null, ['compound' => true])
->addModelTransformer(new CallbackTransformer(
function (array $data) use ($context) {
static function (array $data) use ($context) {
return $context->adminFormTransform($data);
},
function (array $data) use ($context) {
static function (array $data) use ($context) {
return $context->adminFormReverseTransform($data);
}
));