[docgen/template] do not list template wich are inactive

See https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/473
This commit is contained in:
Julien Fastré 2022-03-02 21:35:16 +01:00
parent 74a84e42a6
commit c83d6d392f
3 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -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'] ?? [];