diff --git a/CHANGELOG.md b/CHANGELOG.md index df4dab422..542c99a37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ and this project adheres to * [activity][export] DX/Feature: use of an `ActivityTypeRepositoryInterface` instead of the old-style EntityRepository * [person][export] Fixed: some inconsistency with date filter on accompanying courses * [person][export] Fixed: use left join for related entities in accompanying course aggregators +* [workflow] Feature: allow user to copy and send manually the access link for the workflow +* [workflow] Feature: show the email addresses that received an access link for the workflow ## Test releases @@ -32,6 +34,7 @@ and this project adheres to * [person-thirdparty]: fix quick-add of names that consist of multiple parts (eg. De Vlieger) within onthefly modal person/thirdparty * [search]: Order of birthdate fields changed in advanced search to avoid confusion. * [workflow]: Constraint added to workflow (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/675) +* [social_action]: only show active objectives (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/625) * [household]: Reposition and cut button for enfant hors menage have been deleted (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/620) * [admin]: Add crud for composition type in admin (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/611) diff --git a/phpstan-deprecations.neon b/phpstan-deprecations.neon index 1f6ca4401..9a6d862b5 100644 --- a/phpstan-deprecations.neon +++ b/phpstan-deprecations.neon @@ -175,13 +175,6 @@ parameters: count: 1 path: src/Bundle/ChillActivityBundle/Form/ActivityType.php - - - message: """ - #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: - Use getReachableCircles$# - """ - count: 1 - path: src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php - message: """ @@ -294,14 +287,6 @@ parameters: count: 1 path: src/Bundle/ChillEventBundle/Form/Type/PickEventType.php - - - message: """ - #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: - Use getReachableCircles$# - """ - count: 1 - path: src/Bundle/ChillEventBundle/Search/EventSearch.php - - message: """ #^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: @@ -390,13 +375,6 @@ parameters: count: 1 path: src/Bundle/ChillMainBundle/Export/ExportInterface.php - - - message: """ - #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: - Use getReachableCircles$# - """ - count: 1 - path: src/Bundle/ChillMainBundle/Export/ExportManager.php - message: """ @@ -754,14 +732,6 @@ parameters: count: 1 path: src/Bundle/ChillPersonBundle/Widget/PersonListWidget.php - - - message: """ - #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: - Use getReachableCircles$# - """ - count: 1 - path: src/Bundle/ChillReportBundle/Controller/ReportController.php - - message: """ #^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: @@ -794,14 +764,6 @@ parameters: count: 1 path: src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php - - - message: """ - #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: - Use getReachableCircles$# - """ - count: 1 - path: src/Bundle/ChillReportBundle/Form/ReportType.php - - message: """ #^Parameter \\$role of method Chill\\\\ReportBundle\\\\Form\\\\ReportType\\:\\:appendScopeChoices\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: @@ -810,14 +772,6 @@ parameters: count: 1 path: src/Bundle/ChillReportBundle/Form/ReportType.php - - - message: """ - #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: - Use getReachableCircles$# - """ - count: 1 - path: src/Bundle/ChillReportBundle/Search/ReportSearch.php - - message: """ #^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\: @@ -826,13 +780,6 @@ parameters: count: 1 path: src/Bundle/ChillReportBundle/Search/ReportSearch.php - - - message: """ - #^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\: - Use getReachableCircles$# - """ - count: 2 - path: src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php - message: """ diff --git a/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php b/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php index bb65fb5b2..c365b5e06 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php +++ b/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php @@ -14,6 +14,8 @@ namespace Chill\DocGeneratorBundle\Controller; use Chill\DocGeneratorBundle\Context\ContextManager; use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate; use Chill\MainBundle\CRUD\Controller\CRUDController; +use Chill\MainBundle\Pagination\PaginatorInterface; +use Doctrine\ORM\QueryBuilder; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; @@ -84,4 +86,16 @@ class AdminDocGeneratorTemplateController extends CRUDController return $entity; } + + /** + * @param QueryBuilder $query + * + * @return QueryBuilder|mixed + */ + protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) + { + return $query->addSelect('JSON_EXTRACT(e.name, :lang) AS HIDDEN name_lang') + ->setParameter('lang', $request->getLocale()) + ->addOrderBy('name_lang', 'ASC'); + } } diff --git a/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php b/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php index 4f800fd6a..6a80c34dc 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php +++ b/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php @@ -15,14 +15,18 @@ use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Doctrine\Persistence\ObjectRepository; +use Symfony\Component\HttpFoundation\RequestStack; final class DocGeneratorTemplateRepository implements ObjectRepository { private EntityRepository $repository; - public function __construct(EntityManagerInterface $entityManager) + private RequestStack $requestStack; + + public function __construct(EntityManagerInterface $entityManager, RequestStack $requestStack) { $this->repository = $entityManager->getRepository(DocGeneratorTemplate::class); + $this->requestStack = $requestStack; } public function countByEntity(string $entity): int @@ -71,7 +75,10 @@ final class DocGeneratorTemplateRepository implements ObjectRepository $builder ->where('t.entity LIKE :entity') ->andWhere($builder->expr()->eq('t.active', "'TRUE'")) - ->setParameter('entity', addslashes($entity)); + ->setParameter('entity', addslashes($entity)) + ->addSelect('JSON_EXTRACT(t.name, :lang) AS HIDDEN name_lang') + ->setParameter('lang', $this->requestStack->getCurrentRequest()->getLocale()) + ->addOrderBy('name_lang', 'ASC'); return $builder ->getQuery() diff --git a/src/Bundle/ChillDocGeneratorBundle/Resources/views/Generator/basic_form.html.twig b/src/Bundle/ChillDocGeneratorBundle/Resources/views/Generator/basic_form.html.twig index 7b24eae0d..35fa6e319 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Resources/views/Generator/basic_form.html.twig +++ b/src/Bundle/ChillDocGeneratorBundle/Resources/views/Generator/basic_form.html.twig @@ -2,6 +2,14 @@ {% block title 'docgen.Generate a document'|trans %} +{% block js %} + {{ encore_entry_script_tags('mod_pickentity_type') }} +{% endblock %} + +{% block css %} + {{ encore_entry_link_tags('mod_pickentity_type') }} +{% endblock %} + {% block content %}

{{ block('title') }}

diff --git a/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Normalizer/DocGenObjectNormalizerTest.php b/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Normalizer/DocGenObjectNormalizerTest.php index de2a8775a..3250d4d5a 100644 --- a/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Normalizer/DocGenObjectNormalizerTest.php +++ b/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Normalizer/DocGenObjectNormalizerTest.php @@ -77,6 +77,19 @@ final class DocGenObjectNormalizerTest extends KernelTestCase $this->assertArrayNotHasKey('baz', $actual['child']); } + public function testNormalizableBooleanPropertyOrMethodOnNull() + { + $actual = $this->normalizer->normalize(null, 'docgen', [AbstractNormalizer::GROUPS => ['docgen:read'], 'docgen:expects' => TestableClassWithBool::class]); + + $expected = [ + 'foo' => null, + 'thing' => null, + 'isNull' => true, + ]; + + $this->assertEquals($expected, $actual); + } + public function testNormalizationBasic() { $scope = new Scope(); @@ -93,6 +106,22 @@ final class DocGenObjectNormalizerTest extends KernelTestCase $this->assertEquals($expected, $normalized, 'test normalization fo a scope'); } + public function testNormalizeBooleanPropertyOrMethod() + { + $testable = new TestableClassWithBool(); + $testable->foo = false; + + $actual = $this->normalizer->normalize($testable, 'docgen', [AbstractNormalizer::GROUPS => ['docgen:read'], 'docgen:expects' => TestableClassWithBool::class]); + + $expected = [ + 'foo' => false, + 'thing' => true, + 'isNull' => false, + ]; + + $this->assertEquals($expected, $actual); + } + public function testNormalizeNull() { $actual = $this->normalizer->normalize(null, 'docgen', [AbstractNormalizer::GROUPS => ['docgen:read'], 'docgen:expects' => Scope::class]); @@ -170,3 +199,19 @@ class TestableChildClass */ public string $foo = 'bar'; } + +class TestableClassWithBool +{ + /** + * @Serializer\Groups("docgen:read") + */ + public bool $foo; + + /** + * @Serializer\Groups("docgen:read") + */ + public function getThing(): bool + { + return true; + } +} diff --git a/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php b/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php index 437f0930c..8e679b228 100644 --- a/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php +++ b/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php @@ -14,7 +14,7 @@ namespace Chill\MainBundle\Controller; use Chill\MainBundle\CRUD\Controller\ApiController; use Chill\MainBundle\Pagination\PaginatorFactory; use Chill\MainBundle\Repository\CountryRepository; -use Chill\MainBundle\Repository\PostalCodeRepository; +use Chill\MainBundle\Repository\PostalCodeRepositoryInterface; use Chill\MainBundle\Serializer\Model\Collection; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; @@ -30,11 +30,11 @@ final class PostalCodeAPIController extends ApiController private PaginatorFactory $paginatorFactory; - private PostalCodeRepository $postalCodeRepository; + private PostalCodeRepositoryInterface $postalCodeRepository; public function __construct( CountryRepository $countryRepository, - PostalCodeRepository $postalCodeRepository, + PostalCodeRepositoryInterface $postalCodeRepository, PaginatorFactory $paginatorFactory ) { $this->countryRepository = $countryRepository; diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index 8e189e956..d7f3f0bc5 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -27,6 +27,7 @@ use Chill\MainBundle\Doctrine\DQL\GetJsonFieldByKey; use Chill\MainBundle\Doctrine\DQL\JsonAggregate; use Chill\MainBundle\Doctrine\DQL\JsonbArrayLength; use Chill\MainBundle\Doctrine\DQL\JsonbExistsInArray; +use Chill\MainBundle\Doctrine\DQL\JsonExtract; use Chill\MainBundle\Doctrine\DQL\OverlapsI; use Chill\MainBundle\Doctrine\DQL\Replace; use Chill\MainBundle\Doctrine\DQL\Similarity; @@ -234,6 +235,7 @@ class ChillMainExtension extends Extension implements 'GET_JSON_FIELD_BY_KEY' => GetJsonFieldByKey::class, 'AGGREGATE' => JsonAggregate::class, 'REPLACE' => Replace::class, + 'JSON_EXTRACT' => JsonExtract::class, ], 'numeric_functions' => [ 'JSONB_EXISTS_IN_ARRAY' => JsonbExistsInArray::class, diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonExtract.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonExtract.php new file mode 100644 index 000000000..9f93c437e --- /dev/null +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonExtract.php @@ -0,0 +1,43 @@ +>%s', $this->element->dispatch($sqlWalker), $this->keyToExtract->dispatch($sqlWalker)); + } + + public function parse(Parser $parser) + { + $parser->match(Lexer::T_IDENTIFIER); + $parser->match(Lexer::T_OPEN_PARENTHESIS); + + $this->element = $parser->ArithmeticPrimary(); + + $parser->match(Lexer::T_COMMA); + + $this->keyToExtract = $parser->ArithmeticExpression(); + + $parser->match(Lexer::T_CLOSE_PARENTHESIS); + } +} diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/PostalCodeToIdTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/PostalCodeToIdTransformer.php new file mode 100644 index 000000000..ca488fe1a --- /dev/null +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/PostalCodeToIdTransformer.php @@ -0,0 +1,55 @@ +postalCodeRepository = $postalCodeRepository; + } + + public function reverseTransform($value) + { + if (null === $value || trim('') === $value) { + return null; + } + + if (!is_int((int) $value)) { + throw new TransformationFailedException('Cannot transform ' . gettype($value)); + } + + return $this->postalCodeRepository->find((int) $value); + } + + public function transform($value) + { + if (null === $value) { + return null; + } + + if ($value instanceof PostalCode) { + return $value->getId(); + } + + throw new TransformationFailedException('Could not reverseTransform ' . gettype($value)); + } +} diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickPostalCodeType.php b/src/Bundle/ChillMainBundle/Form/Type/PickPostalCodeType.php new file mode 100644 index 000000000..d1feacd6a --- /dev/null +++ b/src/Bundle/ChillMainBundle/Form/Type/PickPostalCodeType.php @@ -0,0 +1,49 @@ +postalCodeToIdTransformer = $postalCodeToIdTransformer; + } + + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder->addViewTransformer($this->postalCodeToIdTransformer); + } + + public function buildView(FormView $view, FormInterface $form, array $options) + { + $view->vars['uniqid'] = $view->vars['attr']['data-input-postal-code'] = uniqid('input_pick_postal_code_'); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('class', PostalCode::class) + ->setDefault('multiple', false) + ->setAllowedTypes('multiple', ['bool']) + ->setDefault('compound', false); + } +} diff --git a/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php b/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php index c53df01df..32c1322be 100644 --- a/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php @@ -18,10 +18,9 @@ use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\Query\ResultSetMapping; use Doctrine\ORM\Query\ResultSetMappingBuilder; -use Doctrine\Persistence\ObjectRepository; use RuntimeException; -final class PostalCodeRepository implements ObjectRepository +final class PostalCodeRepository implements PostalCodeRepositoryInterface { private EntityManagerInterface $entityManager; @@ -29,7 +28,7 @@ final class PostalCodeRepository implements ObjectRepository public function __construct(EntityManagerInterface $entityManager) { - $this->repository = $entityManager->getRepository(PostalCode::class); + $this->repository = $entityManager->getRepository($this->getClassName()); $this->entityManager = $entityManager; } @@ -51,20 +50,11 @@ final class PostalCodeRepository implements ObjectRepository return $this->repository->find($id, $lockMode, $lockVersion); } - /** - * @return PostalCode[] - */ public function findAll(): array { return $this->repository->findAll(); } - /** - * @param mixed|null $limit - * @param mixed|null $offset - * - * @return PostalCode[] - */ public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); @@ -95,7 +85,7 @@ final class PostalCodeRepository implements ObjectRepository return $this->repository->findOneBy($criteria, $orderBy); } - public function getClassName() + public function getClassName(): string { return PostalCode::class; } diff --git a/src/Bundle/ChillMainBundle/Repository/PostalCodeRepositoryInterface.php b/src/Bundle/ChillMainBundle/Repository/PostalCodeRepositoryInterface.php new file mode 100644 index 000000000..fe3dee195 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Repository/PostalCodeRepositoryInterface.php @@ -0,0 +1,42 @@ +', + components: { + PickPostalCode, + }, + data() { + return { + city: city, + } + }, + methods: { + onCitySelected(city) { + this.city = city; + input.value = city.id; + }, + onCityRemoved(city) { + this.city = null; + input.value = ''; + } + } + }) + .use(i18n) + .mount(el); +} + +function loadDynamicPickers(element) { + + let apps = element.querySelectorAll('[data-module="pick-postal-code"]'); + + apps.forEach(function(el) { + + const + uniqId = el.dataset.uniqid, + input = document.querySelector(`input[data-input-uniqid="${uniqId}"]`), + cityIdValue = input.value === '' ? null : input.value + ; + + if (cityIdValue !== null) { + makeFetch('GET', `/api/1.0/main/postal-code/${cityIdValue}.json`).then(city => { + loadOnePicker(el, input, uniqId, city); + }) + } else { + loadOnePicker(el, input, uniqId, null); + } + }); +} + +document.addEventListener('DOMContentLoaded', function(e) { + loadDynamicPickers(document) +}) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickPostalCode/PickPostalCode.md b/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickPostalCode/PickPostalCode.md new file mode 100644 index 000000000..501e96983 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickPostalCode/PickPostalCode.md @@ -0,0 +1,29 @@ +# Pickpostalcode + +Allow to pick a postal code. + +In use with module `mod_pick_postal_code`, associated with `PickPostalCodeType` in php. + +## Usage + + `` + +## Props + +* `picked`: the city picked. A javascript object (a city). Null if empty. +* `country`: country to restraint search on picked. May be null. + +## Emits + +### `selectCity` + +When a city is onCitySelected. + +Argument: a js object, representing a city + +### `removeCity` + +When a city is removed. + + +Argument: a js object, representing a city diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickPostalCode/PickPostalCode.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickPostalCode/PickPostalCode.vue new file mode 100644 index 000000000..d5e55dbbd --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickPostalCode/PickPostalCode.vue @@ -0,0 +1,107 @@ + + + diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickPostalCode/_PickPostalCode.scss b/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickPostalCode/_PickPostalCode.scss new file mode 100644 index 000000000..09f5fd539 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickPostalCode/_PickPostalCode.scss @@ -0,0 +1,3 @@ +.PickPostalCode { + +} diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickPostalCode/api.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickPostalCode/api.js new file mode 100644 index 000000000..d31dcc3f4 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/PickPostalCode/api.js @@ -0,0 +1,43 @@ +import {makeFetch, fetchResults} from 'ChillMainAssets/lib/api/apiMethods'; + +/** + * Endpoint chill_api_single_postal_code__index + * method GET, get Cities Object + * @params {object} a country object + * @returns {Promise} a promise containing all Postal Code objects filtered with country + */ +const fetchCities = (country) => { + // warning: do not use fetchResults (in apiMethods): we need only a **part** of the results in the db + const params = new URLSearchParams({item_per_page: 100}); + + if (country !== null) { + params.append('country', country.id); + } + + return makeFetch('GET', `/api/1.0/main/postal-code.json?${params.toString()}`).then(r => Promise.resolve(r.results)); +}; + +/** + * Endpoint chill_main_postalcodeapi_search + * method GET, get Cities Object + * @params {string} search a search string + * @params {object} country a country object + * @params {AbortController} an abort controller + * @returns {Promise} a promise containing all Postal Code objects filtered with country and a search string + */ +const searchCities = (search, country, controller) => { + const url = '/api/1.0/main/postal-code/search.json?'; + const params = new URLSearchParams({q: search}); + + if (country !== null) { + Object.assign('country', country.id); + } + + return makeFetch('GET', url + params, null, {signal: controller.signal}) + .then(result => Promise.resolve(result.results)); +}; + +export { + fetchCities, + searchCities, +}; diff --git a/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig index 1710a91b8..2b006fc4d 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig @@ -251,3 +251,9 @@
{% endblock %} + +{% block pick_postal_code_widget %} + {{ form_help(form)}} + +
+{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig index bb0411371..bd9274739 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig @@ -95,6 +95,15 @@ {% endif %} + {% if entity_workflow.currentStep.destEmail|length > 0 %} +

{{ 'workflow.An access key was also sent to those addresses'|trans }} :

+ + {% endif %} + {% if entity_workflow.currentStep.destUserByAccessKey|length > 0 %}

{{ 'workflow.Those users are also granted to apply a transition by using an access key'|trans }} :

{% endif %} + + {% if is_granted('CHILL_MAIN_WORKFLOW_LINK_SHOW', entity_workflow) %} +

{{ 'workflow.This link grant any user to apply a transition'|trans }} :

+ + {% set link = absolute_url(path('chill_main_workflow_grant_access_by_key', {'id': entity_workflow.currentStep.id, 'accessKey': entity_workflow.currentStep.accessKey})) %} +
+ + + + +
+ {% endif %} + + {% endif %}
diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_history.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_history.html.twig index dda309da0..72aab397c 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_history.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_history.html.twig @@ -81,6 +81,15 @@ {% endif %} + {% if entity_workflow.currentStep.destEmail|length > 0 %} +

{{ 'workflow.An access key was also sent to those addresses'|trans }} :

+ + {% endif %} + {% if step.destUserByAccessKey|length > 0 %}

{{ 'workflow.Those users are also granted to apply a transition by using an access key'|trans }} :