From c83d6d392fc5b48160a506fd73484e9e0efca8bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 2 Mar 2022 21:35:16 +0100 Subject: [PATCH] [docgen/template] do not list template wich are inactive See https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/473 --- CHANGELOG.md | 1 + .../Repository/DocGeneratorTemplateRepository.php | 1 + .../AccompanyingPeriodWorkEvaluationApiController.php | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b3394911..7637230db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to * [thirdparty] Fix display of multiple contact badges so they wrap onto next line (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/482) * [confidential] Fix position of toggle button so it does not cover text nor fall outside of box (no issue) * [parcours] Fix edit of both thirdparty and contact name (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/474) +* [template] do not list inactive templates (for doc generator) ## Test releases diff --git a/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php b/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php index 5d99efa94..a0ab109fb 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php +++ b/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php @@ -70,6 +70,7 @@ final class DocGeneratorTemplateRepository implements ObjectRepository $builder ->where('t.entity LIKE :entity') + ->andWhere($builder->expr()->eq('t.active', "'TRUE'")) ->setParameter('entity', addslashes($entity)); return $builder diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php index 757e8df79..796d384ca 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php @@ -69,7 +69,7 @@ class AccompanyingPeriodWorkEvaluationApiController $evaluations = array_filter( $this->docGeneratorTemplateRepository - ->findByEntity(AccompanyingPeriodWorkEvaluation::class), + ->findByEntity(AccompanyingPeriodWorkEvaluation::class, 0, 500), static function (DocGeneratorTemplate $t) use ($evaluation) { $ids = $t->getOptions()['evaluations'] ?? [];