diff --git a/.changes/unreleased/Fixed-20240416-161817.yaml b/.changes/unreleased/Fixed-20240416-161817.yaml deleted file mode 100644 index 6884c11fe..000000000 --- a/.changes/unreleased/Fixed-20240416-161817.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kind: Fixed -body: Fix broken link in homepage when a evaluation from a closed acc period was present - in the homepage widget -time: 2024-04-16T16:18:17.888645172+02:00 -custom: - Issue: "270" diff --git a/.changes/v2.19.0.md b/.changes/v2.19.0.md new file mode 100644 index 000000000..6b24baa6a --- /dev/null +++ b/.changes/v2.19.0.md @@ -0,0 +1,20 @@ +## v2.19.0 - 2024-05-14 +### Feature +* ([#197](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/197)) Make the script which subscribe to microsoft calendars changes more tolerant to errors or missing configuration on the microsoft side +* ([#276](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/276)) Take closing date into account when computing the geographical unit on accompanying period. When a person moved after an accompanying period is closed, the date of closing accompanying period is took into account if it is earlier than the date given by the user. +### Fixed +* ([#270](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/270)) Fix broken link in homepage when a evaluation from a closed acc period was present in the homepage widget +* ([#275](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/275)) Allow the filter "filter accompanying period by geographical unit" to take period's location on address into account +### UX +* Form for document generation moved to the top of document list page +* ([#266](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/266)) Event bundle: adjust certain graphical issues for better user experience + + +### Traduction francophone des principaux changements + +- script de synchronisation des agendas de microsoft Outlook: le script est plus tolérant aux erreurs de configuration côté serveur (manque de droit d'accès); +- dans les statistiques sur les parcours d'accompagnements, regroupement et filtre par unité géographique: lorsque la date de prise en compte de l'adresse est postérieure à la fermeture du parcours, c'est la date de fermeture du parcours qui est prise en compte (cela permet de tenir compte de la localisation de l'usager au moment de la fermeture dans le cas où celui-ci aurait déménagé par la suite); +- sur la page d'accueil, il n'y a plus de rappel pour les évaluations pour les parcours cloturés; +- correction du filtre "filtrer par zone géographique" +- répétition du bouton pour générer un document en haut de la page "liste des documents", quand il y a plus de cinq documents; +- module événement: améliorerations graphiques diff --git a/CHANGELOG.md b/CHANGELOG.md index ae9407c8a..9b2f5e2e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,27 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). +## v2.19.0 - 2024-05-14 +### Feature +* ([#197](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/197)) Make the script which subscribe to microsoft calendars changes more tolerant to errors or missing configuration on the microsoft side +* ([#276](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/276)) Take closing date into account when computing the geographical unit on accompanying period. When a person moved after an accompanying period is closed, the date of closing accompanying period is took into account if it is earlier than the date given by the user. +### Fixed +* ([#270](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/270)) Fix broken link in homepage when a evaluation from a closed acc period was present in the homepage widget +* ([#275](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/275)) Allow the filter "filter accompanying period by geographical unit" to take period's location on address into account +### UX +* Form for document generation moved to the top of document list page +* ([#266](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/266)) Event bundle: adjust certain graphical issues for better user experience + + +### Traduction francophone des principaux changements + +- script de synchronisation des agendas de microsoft Outlook: le script est plus tolérant aux erreurs de configuration côté serveur (manque de droit d'accès); +- dans les statistiques sur les parcours d'accompagnements, regroupement et filtre par unité géographique: lorsque la date de prise en compte de l'adresse est postérieure à la fermeture du parcours, c'est la date de fermeture du parcours qui est prise en compte (cela permet de tenir compte de la localisation de l'usager au moment de la fermeture dans le cas où celui-ci aurait déménagé par la suite); +- sur la page d'accueil, il n'y a plus de rappel pour les évaluations pour les parcours cloturés; +- correction du filtre "filtrer par zone géographique" +- répétition du bouton pour générer un document en haut de la page "liste des documents", quand il y a plus de cinq documents; +- module événement: améliorerations graphiques + ## v2.18.2 - 2024-04-12 ### Fixed * ([#250](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/250)) Postal codes import : fix the source URL and the keys to handle each record diff --git a/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php b/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php index 41830cd44..ae4205c38 100644 --- a/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php +++ b/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php @@ -51,8 +51,6 @@ final class MapAndSubscribeUserCalendarCommand extends Command $limit = 50; $offset = 0; - /** @var \DateInterval $interval the interval before the end of the expiration */ - $interval = new \DateInterval('P1D'); $expiration = (new \DateTimeImmutable('now'))->add(new \DateInterval($input->getOption('subscription-duration'))); $users = $this->userRepository->findAllAsArray('fr'); $created = 0; @@ -95,7 +93,6 @@ final class MapAndSubscribeUserCalendarCommand extends Command } catch (UserAbsenceSyncException $e) { $this->logger->error('could not sync user absence', ['userId' => $user->getId(), 'email' => $user->getEmail(), 'exception' => $e->getTraceAsString(), 'message' => $e->getMessage()]); $output->writeln(sprintf('Could not sync user absence: id: %s and email: %s', $user->getId(), $user->getEmail())); - throw $e; } // we first try to renew an existing subscription, if any. diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/GenericDoc/accompanying_period_list.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/GenericDoc/accompanying_period_list.html.twig index b22c7d00f..46b08f37d 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/GenericDoc/accompanying_period_list.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/GenericDoc/accompanying_period_list.html.twig @@ -1,54 +1,62 @@ -{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %} +{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %} {% set +activeRouteKey = '' %} {% block title %} +{{ "Documents" }} +{% endblock %} {% block js %} +{{ parent() }} +{{ encore_entry_script_tags("mod_docgen_picktemplate") }} +{{ encore_entry_script_tags("mod_entity_workflow_pick") }} +{{ encore_entry_script_tags("mod_document_action_buttons_group") }} +{% endblock %} {% block css %} +{{ parent() }} +{{ encore_entry_script_tags("mod_docgen_picktemplate") }} +{{ encore_entry_link_tags("mod_entity_workflow_pick") }} +{{ encore_entry_link_tags("mod_document_action_buttons_group") }} +{% endblock %} {% block content %} +
+

{{ "Documents" }}

-{% set activeRouteKey = '' %} - -{% block title %} - {{ 'Documents' }} -{% endblock %} - -{% block js %} - {{ parent() }} - {{ encore_entry_script_tags('mod_docgen_picktemplate') }} - {{ encore_entry_script_tags('mod_entity_workflow_pick') }} - {{ encore_entry_script_tags('mod_document_action_buttons_group') }} -{% endblock %} - -{% block css %} - {{ parent() }} - {{ encore_entry_script_tags('mod_docgen_picktemplate') }} - {{ encore_entry_link_tags('mod_entity_workflow_pick') }} - {{ encore_entry_link_tags('mod_document_action_buttons_group') }} -{% endblock %} - -{% block content %} -
-

{{ 'Documents' }}

- - {{ filter|chill_render_filter_order_helper }} - - {% if documents|length == 0 %} -

{{ 'No documents'|trans }}

- {% else %} -
- {% for document in documents %} - {{ document|chill_generic_doc_render }} - {% endfor %} -
- {% endif %} - - {{ chill_pagination(pagination) }} - -
- - {% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE', accompanyingCourse) %} - - {% endif %} + {{ filter | chill_render_filter_order_helper }} + {% if documents|length > 5 %} +
+ {% endif %} {% if documents|length == 0 %} +

{{ "No documents" | trans }}

+ {% else %} +
+ {% for document in documents %} + {{ document | chill_generic_doc_render }} + {% endfor %}
+ {% endif %} + + {{ chill_pagination(pagination) }} + +
+ + {% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE', + accompanyingCourse) %} + + {% endif %} +
{% endblock %} diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/GenericDoc/person_list.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/GenericDoc/person_list.html.twig index a4aa4fbbc..5bc9f42d1 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/GenericDoc/person_list.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/GenericDoc/person_list.html.twig @@ -1,74 +1,70 @@ -{# - * Copyright (C) 2018, Champs Libres Cooperative SCRLFS, - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -#} - -{% extends "@ChillPerson/Person/layout.html.twig" %} - -{% set activeRouteKey = '' %} - -{% import "@ChillDocStore/Macro/macro.html.twig" as m %} - -{% block title %} - {{ 'Documents for %name%'|trans({ '%name%': person|chill_entity_render_string } ) }} -{% endblock %} - -{% block js %} - {{ parent() }} - {{ encore_entry_script_tags('mod_docgen_picktemplate') }} - {{ encore_entry_script_tags('mod_entity_workflow_pick') }} - {{ encore_entry_script_tags('mod_document_action_buttons_group') }} -{% endblock %} - -{% block css %} - {{ parent() }} - {{ encore_entry_link_tags('mod_docgen_picktemplate') }} - {{ encore_entry_link_tags('mod_entity_workflow_pick') }} - {{ encore_entry_link_tags('mod_document_action_buttons_group') }} -{% endblock %} - -{% block content %} +{# * Copyright (C) 2018, Champs Libres Cooperative SCRLFS, + * * This program is free software: you can +redistribute it and/or modify * it under the terms of the GNU Affero General +Public License as * published by the Free Software Foundation, either version 3 +of the * License, or (at your option) any later version. * * This program is +distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; +without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. See the * GNU Affero General Public License for more +details. * * You should have received a copy of the GNU Affero General Public +License * along with this program. If not, see . +#} {% extends "@ChillPerson/Person/layout.html.twig" %} {% set activeRouteKey = +'' %} {% import "@ChillDocStore/Macro/macro.html.twig" as m %} {% block title %} +{{ 'Documents for %name%'|trans({ '%name%': person|chill_entity_render_string } ) }} +{% endblock %} {% block js %} +{{ parent() }} +{{ encore_entry_script_tags("mod_docgen_picktemplate") }} +{{ encore_entry_script_tags("mod_entity_workflow_pick") }} +{{ encore_entry_script_tags("mod_document_action_buttons_group") }} +{% endblock %} {% block css %} +{{ parent() }} +{{ encore_entry_link_tags("mod_docgen_picktemplate") }} +{{ encore_entry_link_tags("mod_entity_workflow_pick") }} +{{ encore_entry_link_tags("mod_document_action_buttons_group") }} +{% endblock %} {% block content %}
-

{{ 'Documents for %name%'|trans({ '%name%': person|chill_entity_render_string } ) }}

+

+ {{ 'Documents for %name%'|trans({ '%name%': person|chill_entity_render_string } ) }} +

- {{ filter|chill_render_filter_order_helper }} + {{ filter | chill_render_filter_order_helper }} - {% if documents|length == 0 %} -

{{ 'No documents'|trans }}

+ {% if documents|length > 5 %} +
+ {% endif %} {% if documents|length == 0 %} +

{{ "No documents" | trans }}

{% else %} -
- {% for document in documents %} - {{ document|chill_generic_doc_render }} - {% endfor %} -
+
+ {% for document in documents %} + {{ document | chill_generic_doc_render }} + {% endfor %} +
{% endif %} - {{ chill_pagination(pagination) }} + {{ chill_pagination(pagination) }} -
- - {% if is_granted('CHILL_PERSON_DOCUMENT_CREATE', person) %} - - {% endif %} +
+ {% if is_granted('CHILL_PERSON_DOCUMENT_CREATE', person) %} + + {% endif %}
{% endblock %} diff --git a/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml b/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml index ffabdaa59..c16c161bc 100644 --- a/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml @@ -13,7 +13,7 @@ Update document: Modifier le document Edit attributes: Modifier les propriétés du document Existing document: Document existant No document to download: Aucun document à télécharger -'Choose a document category': Choisissez une catégorie de document +"Choose a document category": Choisissez une catégorie de document No document found: Aucun document trouvé The document is successfully registered: Le document est enregistré The document is successfully updated: Le document est mis à jour @@ -36,7 +36,6 @@ Delete document ?: Supprimer le document ? Are you sure you want to remove this document ?: Êtes-vous sûr·e de vouloir supprimer ce document ? The document is successfully removed: Le document a été supprimé - # dropzone upload File too big: Fichier trop volumineux Drop your file or click here: Cliquez ici ou faites glissez votre nouveau fichier dans cette zone diff --git a/src/Bundle/ChillEventBundle/Form/EventType.php b/src/Bundle/ChillEventBundle/Form/EventType.php index fe64ef12b..98cb5ea5e 100644 --- a/src/Bundle/ChillEventBundle/Form/EventType.php +++ b/src/Bundle/ChillEventBundle/Form/EventType.php @@ -18,9 +18,9 @@ use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Form\Type\ChillCollectionType; use Chill\MainBundle\Form\Type\ChillDateTimeType; use Chill\MainBundle\Form\Type\CommentType; +use Chill\MainBundle\Form\Type\PickUserDynamicType; use Chill\MainBundle\Form\Type\PickUserLocationType; use Chill\MainBundle\Form\Type\ScopePickerType; -use Chill\MainBundle\Form\Type\UserPickerType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\MoneyType; use Symfony\Component\Form\FormBuilderInterface; @@ -45,14 +45,8 @@ class EventType extends AbstractType 'class' => '', ], ]) - ->add('moderator', UserPickerType::class, [ - 'center' => $options['center'], - 'role' => $options['role'], - 'placeholder' => 'Pick a moderator', - 'attr' => [ - 'class' => '', - ], - 'required' => false, + ->add('moderator', PickUserDynamicType::class, [ + 'label' => 'Pick a moderator', ]) ->add('location', PickUserLocationType::class, [ 'label' => 'event.fields.location', diff --git a/src/Bundle/ChillEventBundle/Resources/views/Event/edit.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Event/edit.html.twig index fc4001c63..b6b11878b 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Event/edit.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Event/edit.html.twig @@ -1,10 +1,14 @@ -{% extends '@ChillEvent/layout.html.twig' %} +{% extends '@ChillEvent/layout.html.twig' %} {% block js %} +{{ encore_entry_script_tags("mod_async_upload") }} +{{ encore_entry_script_tags("mod_pickentity_type") }} -{% block title 'Event edit'|trans %} +{% endblock %} {% block css %} +{{ encore_entry_link_tags("mod_async_upload") }} +{{ encore_entry_link_tags("mod_pickentity_type") }} -{% block event_content -%} +{% endblock %} {% block title 'Event edit'|trans %} {% block event_content -%}
-

{{ 'Event edit'|trans }}

+

{{ "Event edit" | trans }}

{{ form_start(edit_form) }} {{ form_errors(edit_form) }} @@ -12,7 +16,7 @@ {{ form_row(edit_form.name) }} {{ form_row(edit_form.date) }} - {{ form_row(edit_form.type, { 'label': 'Event type' }) }} + {{ form_row(edit_form.type, { label: "Event type" }) }} {{ form_row(edit_form.moderator) }} {{ form_row(edit_form.location) }} {{ form_row(edit_form.organizationCost) }} @@ -22,16 +26,22 @@ {{ form_end(edit_form) }} -
{% endblock %} diff --git a/src/Bundle/ChillEventBundle/Resources/views/Event/new.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Event/new.html.twig index 12ea8f246..0fb69a4ea 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Event/new.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Event/new.html.twig @@ -1,41 +1,41 @@ -{% extends '@ChillEvent/layout.html.twig' %} +{% extends '@ChillEvent/layout.html.twig' %} {% block js %} +{{ encore_entry_script_tags("mod_async_upload") }} +{{ encore_entry_script_tags("mod_pickentity_type") }} -{% block js %} - {{ encore_entry_script_tags('mod_async_upload') }} -{% endblock %} +{% endblock %} {% block css %} +{{ encore_entry_link_tags("mod_async_upload") }} +{{ encore_entry_link_tags("mod_pickentity_type") }} -{% block css %} - {{ encore_entry_link_tags('mod_async_upload') }} -{% endblock %} - -{% block title 'Event creation'|trans %} - -{% block event_content -%} +{% endblock %} {% block title 'Event creation'|trans %} {% block event_content +-%}
-

{{ 'Event creation'|trans }}

+

{{ "Event creation" | trans }}

{{ form_start(form) }} {{ form_errors(form) }} {{ form_row(form.circle) }} {{ form_row(form.name) }} {{ form_row(form.date) }} - - {{ form_row(form.type, { 'label': 'Event type' }) }} + {{ form_row(form.type, { label: "Event type" }) }} {{ form_row(form.moderator) }} {{ form_row(form.location) }} {{ form_row(form.organizationCost) }} - {{ form_row(form.comment) }} {{ form_row(form.documents) }} diff --git a/src/Bundle/ChillEventBundle/Resources/views/Event/page_list.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Event/page_list.html.twig index f22b56c05..bb1ffa24e 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Event/page_list.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Event/page_list.html.twig @@ -1,92 +1,126 @@ -{% extends '@ChillEvent/layout.html.twig' %} +{% extends '@ChillEvent/layout.html.twig' %} {% block title 'Events'|trans %} {% +block js %} +{{ parent() }} +{{ encore_entry_script_tags("mod_pickentity_type") }} +{% endblock %} {% block css %} +{{ parent() }} +{{ encore_entry_link_tags("mod_pickentity_type") }} +{% endblock %} {% block content %} +
+

{{ block("title") }}

-{% block title 'Events'|trans %} + {{ filter | chill_render_filter_order_helper }} -{% block js %} - {{ parent() }} - {{ encore_entry_script_tags('mod_pickentity_type') }} -{% endblock %} - -{% block css %} - {{ parent() }} - {{ encore_entry_link_tags('mod_pickentity_type') }} -{% endblock %} - -{% block content %} -

{{ block('title') }}

- - {{ filter|chill_render_filter_order_helper }} - -{# {% if is_granted('CHILL_EVENT_CREATE') %} #} - - {# {% endif %} #} - {% if events|length > 0 %} -
- {% for e in events %} -
-
-
-
- {{ e.name }} -
-

{{ e.type.name|localize_translatable_string }}

- {% if e.moderator is not null %} -

{{ 'Moderator'|trans }}: {{ e.moderator|chill_entity_render_box }}

- {% endif %} -
-
-
-

{{ e.date|format_datetime('medium', 'medium') }}

-

{{ 'count participations to this event'|trans({'count': e.participations|length}) }}

-
-
+ {# {% if is_granted('CHILL_EVENT_CREATE') %} #} + + {# {% endif %} #} {% if events|length > 0 %} +
+ {% for e in events %} +
+
+
+
+ {{ e.name }}
- {% if e.participations|length > 0 %} -
- {{ 'Participations'|trans }} : - {% for part in e.participations|slice(0, 20) %} - {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { - targetEntity: { name: 'person', id: part.person.id }, - action: 'show', - displayBadge: true, - buttonText: part.person|chill_entity_render_string, - isDead: part.person.deathdate is not null - } %} - {% endfor %} - {% if e.participations|length > 20 %} - {{ 'events.and_other_count_participants'|trans({'count': e.participations|length - 20}) }} - {% endif %} -
+

{{ e.type.name | localize_translatable_string }}

+ {% if e.moderator is not null %} +

+ {{ "Moderator" | trans }}: + {{ e.moderator | chill_entity_render_box }} +

{% endif %} -
-
- {{ form_start(eventForms[e.id]) }} - {{ form_widget(eventForms[e.id].person_id) }} - {{ form_end(eventForms[e.id]) }} -
-
-
-
-
-
-
    - {% if is_granted('CHILL_EVENT_UPDATE', e) %} -
  • - {% endif %} - {% if is_granted('CHILL_EVENT_UPDATE', e) %} -
  • - {% endif %} -
  • -
-
+
+
+
+

{{ e.date|format_datetime('medium', 'medium') }}

+

+ {{ 'count participations to this event'|trans({'count': e.participations|length}) }} +

- {% endfor %} +
+ {% if e.participations|length > 0 %} +
+ {{ "Participations" | trans }} : + {% for part in e.participations|slice(0, 20) %} {% include + '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { + targetEntity: { name: 'person', id: part.person.id }, action: + 'show', displayBadge: true, buttonText: + part.person|chill_entity_render_string, isDead: + part.person.deathdate is not null } %} {% endfor %} {% if + e.participations|length > 20 %} + {{ 'events.and_other_count_participants'|trans({'count': e.participations|length - 20}) }} + {% endif %} +
+ {% endif %} +
+
+ {{ form_start(eventForms[e.id]) }} + {{ form_widget(eventForms[e.id].person_id) }} + {{ form_end(eventForms[e.id]) }} +
+
+
+
+
+
    + {% if is_granted('CHILL_EVENT_UPDATE', e) %} +
  • + +
  • + {% endif %} {% if is_granted('CHILL_EVENT_UPDATE', e) %} +
  • + +
  • + {% endif %} +
  • + +
  • +
+
+
+ {% endfor %} +
{% endif %} +
- {{ chill_pagination(pagination) }} +{{ chill_pagination(pagination) }} {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig index 9c60028ad..1d0764980 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig @@ -173,10 +173,10 @@ {{ form_widget(entry) }} {{ form_errors(entry) }}
- + {% else %}
  • - {{ form.vars.empty_collection_explain|default('No item')|trans }} + {{ form.vars.empty_collection_explain|default('No entities')|trans }}
  • {% endfor %} diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php index 3fa612988..0a861d64c 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php @@ -28,7 +28,12 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class GeographicalUnitStatAggregator implements AggregatorInterface { - public function __construct(private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private TranslatableStringHelperInterface $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter) {} + public function __construct( + private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, + private TranslatableStringHelperInterface $translatableStringHelper, + private RollingDateConverterInterface $rollingDateConverter + ) { + } public function addRole(): ?string { @@ -41,10 +46,10 @@ final readonly class GeographicalUnitStatAggregator implements AggregatorInterfa $qb->andWhere( $qb->expr()->andX( - 'acp_geog_agg_location_history.startDate <= :acp_geog_aggregator_date', + 'acp_geog_agg_location_history.startDate <= LEAST(:acp_geog_aggregator_date, acp.closingDate)', $qb->expr()->orX( 'acp_geog_agg_location_history.endDate IS NULL', - 'acp_geog_agg_location_history.endDate > :acp_geog_aggregator_date' + 'acp_geog_agg_location_history.endDate > LEAST(:acp_geog_aggregator_date, acp.closingDate)' ) ) ); @@ -56,9 +61,9 @@ final readonly class GeographicalUnitStatAggregator implements AggregatorInterfa Join::WITH, $qb->expr()->andX( 'IDENTITY(acp_geog_agg_address_person_location.person) = IDENTITY(acp_geog_agg_location_history.personLocation)', - 'acp_geog_agg_address_person_location.validFrom <= :acp_geog_aggregator_date', + 'acp_geog_agg_address_person_location.validFrom <= LEAST(:acp_geog_aggregator_date, acp.closingDate)', $qb->expr()->orX( - 'acp_geog_agg_address_person_location.validTo > :acp_geog_aggregator_date', + 'acp_geog_agg_address_person_location.validTo > LEAST(:acp_geog_aggregator_date, acp.closingDate)', $qb->expr()->isNull('acp_geog_agg_address_person_location.validTo') ) ) diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php index 3b1183c99..d84745403 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php @@ -33,7 +33,13 @@ use Symfony\Component\Form\FormBuilderInterface; */ class GeographicalUnitStatFilter implements FilterInterface { - public function __construct(private readonly GeographicalUnitRepositoryInterface $geographicalUnitRepository, private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct( + private readonly GeographicalUnitRepositoryInterface $geographicalUnitRepository, + private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, + private readonly TranslatableStringHelperInterface $translatableStringHelper, + private readonly RollingDateConverterInterface $rollingDateConverter + ) { + } public function addRole(): ?string { @@ -46,18 +52,19 @@ class GeographicalUnitStatFilter implements FilterInterface 'SELECT 1 FROM '.AccompanyingPeriod\AccompanyingPeriodLocationHistory::class.' acp_geog_filter_location_history + JOIN acp_geog_filter_location_history.period acp_geog_filter_location_history_period LEFT JOIN '.PersonHouseholdAddress::class.' acp_geog_filter_address_person_location WITH IDENTITY(acp_geog_filter_location_history.personLocation) = IDENTITY(acp_geog_filter_address_person_location.person) + AND + (acp_geog_filter_address_person_location.validFrom < LEAST(:acp_geog_filter_date, acp_geog_filter_location_history_period.closingDate) AND ( + acp_geog_filter_address_person_location.validTo IS NULL OR acp_geog_filter_address_person_location.validTo > LEAST(:acp_geog_filter_date, acp_geog_filter_location_history_period.closingDate) + )) LEFT JOIN '.Address::class.' acp_geog_filter_address WITH COALESCE(IDENTITY(acp_geog_filter_address_person_location.address), IDENTITY(acp_geog_filter_location_history.addressLocation)) = acp_geog_filter_address.id LEFT JOIN acp_geog_filter_address.geographicalUnits acp_geog_filter_units WHERE - (acp_geog_filter_location_history.startDate <= :acp_geog_filter_date AND ( - acp_geog_filter_location_history.endDate IS NULL OR acp_geog_filter_location_history.endDate > :acp_geog_filter_date - )) - AND - (acp_geog_filter_address_person_location.validFrom < :acp_geog_filter_date AND ( - acp_geog_filter_address_person_location.validTo IS NULL OR acp_geog_filter_address_person_location.validTo > :acp_geog_filter_date + (acp_geog_filter_location_history.startDate <= LEAST(:acp_geog_filter_date, acp_geog_filter_location_history_period.closingDate) AND ( + acp_geog_filter_location_history.endDate IS NULL OR acp_geog_filter_location_history.endDate > LEAST(:acp_geog_filter_date, acp_geog_filter_location_history_period.closingDate) )) AND acp_geog_filter_units IN (:acp_geog_filter_units) AND acp_geog_filter_location_history.period = acp.id