From 3e2ff463bce58bd0603f3bb3859ad01227e3f141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 26 Apr 2024 13:47:25 +0200 Subject: [PATCH 1/9] make the script which subscribe to user calendars on ms-graph more tolerant to errors The script does not fails and exit when some calendar settings are not reachable --- .changes/unreleased/Feature-20240426-134831.yaml | 6 ++++++ .../Command/MapAndSubscribeUserCalendarCommand.php | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 .changes/unreleased/Feature-20240426-134831.yaml diff --git a/.changes/unreleased/Feature-20240426-134831.yaml b/.changes/unreleased/Feature-20240426-134831.yaml new file mode 100644 index 000000000..00952fe57 --- /dev/null +++ b/.changes/unreleased/Feature-20240426-134831.yaml @@ -0,0 +1,6 @@ +kind: Feature +body: Make the script which subscribe to microsoft calendars changes more tolerant + to errors or missing configuration on the microsoft side +time: 2024-04-26T13:48:31.476415017+02:00 +custom: + Issue: "197" diff --git a/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php b/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php index 4964f0064..177fd2375 100644 --- a/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php +++ b/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php @@ -49,8 +49,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; @@ -93,7 +91,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. From c773f9c6db31542685f409475182168e9ba607ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 29 Apr 2024 11:39:46 +0200 Subject: [PATCH 2/9] Update geographical unit filter for period's location The geographical unit filter in the accompanying course filters now takes the period's location on the address into account. This enhancement was achieved by modifying the GeographicalUnitStatFilter class. As a result, the "filter accompanying period by geographical unit" option provides more accurate data. --- .changes/unreleased/Fixed-20240429-113804.yaml | 6 ++++++ .../GeographicalUnitStatFilter.php | 16 ++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 .changes/unreleased/Fixed-20240429-113804.yaml diff --git a/.changes/unreleased/Fixed-20240429-113804.yaml b/.changes/unreleased/Fixed-20240429-113804.yaml new file mode 100644 index 000000000..0fa696901 --- /dev/null +++ b/.changes/unreleased/Fixed-20240429-113804.yaml @@ -0,0 +1,6 @@ +kind: Fixed +body: Allow the filter "filter accompanying period by geographical unit" to take period's + location on address into account +time: 2024-04-29T11:38:04.966027861+02:00 +custom: + Issue: "275" diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php index ce193e1a4..7d0980dad 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php @@ -33,8 +33,12 @@ 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 @@ -50,6 +54,10 @@ class GeographicalUnitStatFilter implements FilterInterface FROM '.AccompanyingPeriod\AccompanyingPeriodLocationHistory::class.' acp_geog_filter_location_history 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 < :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 + )) 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 @@ -57,10 +65,6 @@ class GeographicalUnitStatFilter implements FilterInterface (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 - )) AND acp_geog_filter_units IN (:acp_geog_filter_units) AND acp_geog_filter_location_history.period = acp.id '; From 89c231de41a1ad13a04663599bb20bd21539446c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 29 Apr 2024 13:03:22 +0200 Subject: [PATCH 3/9] Update geographical unit computation for closed periods in exports The geographical unit computation in the ChillPersonBundle now considers the closing date of an accompanying period when a person changes location. This provides more accurate statistics, especially in situations where the individual moved after the period closed. The changes also include refinements for the validFrom and validTo data within the AccompanyingCourseFilters and AccompanyingCourseAggregators. --- .changes/unreleased/Feature-20240429-130102.yaml | 7 +++++++ .../GeographicalUnitStatAggregator.php | 15 +++++++++------ .../GeographicalUnitStatFilter.php | 9 +++++---- 3 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 .changes/unreleased/Feature-20240429-130102.yaml diff --git a/.changes/unreleased/Feature-20240429-130102.yaml b/.changes/unreleased/Feature-20240429-130102.yaml new file mode 100644 index 000000000..e07dcb40e --- /dev/null +++ b/.changes/unreleased/Feature-20240429-130102.yaml @@ -0,0 +1,7 @@ +kind: Feature +body: '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.' +time: 2024-04-29T13:01:02.463796452+02:00 +custom: + Issue: "276" diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php index 2d6dbeae4..0a861d64c 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php @@ -28,8 +28,11 @@ 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 @@ -43,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)' ) ) ); @@ -58,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 7d0980dad..d84745403 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php @@ -52,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 < :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_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 + (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 From 536c2622c79a8e38e075f61b6c689b001fafe10c Mon Sep 17 00:00:00 2001 From: Ronchie Blondiau Date: Tue, 7 May 2024 14:30:16 +0000 Subject: [PATCH 4/9] 239 - doc generation form added to top of doc list page when more than 5 documents --- .changes/unreleased/UX-20240507-160217.yaml | 5 + .../accompanying_period_list.html.twig | 108 +++++++++------- .../views/GenericDoc/person_list.html.twig | 122 +++++++++--------- 3 files changed, 122 insertions(+), 113 deletions(-) create mode 100644 .changes/unreleased/UX-20240507-160217.yaml diff --git a/.changes/unreleased/UX-20240507-160217.yaml b/.changes/unreleased/UX-20240507-160217.yaml new file mode 100644 index 000000000..f74a2f2ef --- /dev/null +++ b/.changes/unreleased/UX-20240507-160217.yaml @@ -0,0 +1,5 @@ +kind: UX +body: Form for document generation moved to the top of document list page +time: 2024-05-07T16:02:17.11820977+02:00 +custom: + Issue: "" 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 %} From 46c647cbb77ebeef220ec5463a5183213a298a22 Mon Sep 17 00:00:00 2001 From: rblondiau Date: Thu, 25 Apr 2024 10:39:56 +0200 Subject: [PATCH 5/9] fixed events width --- .../Resources/views/Event/new.html.twig | 34 ++- .../Resources/views/Event/page_list.html.twig | 196 ++++++++++-------- 2 files changed, 131 insertions(+), 99 deletions(-) diff --git a/src/Bundle/ChillEventBundle/Resources/views/Event/new.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Event/new.html.twig index 12ea8f246..6412c94a5 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Event/new.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Event/new.html.twig @@ -1,18 +1,11 @@ -{% extends '@ChillEvent/layout.html.twig' %} - -{% block js %} - {{ encore_entry_script_tags('mod_async_upload') }} -{% endblock %} - -{% block css %} - {{ encore_entry_link_tags('mod_async_upload') }} -{% endblock %} - -{% block title 'Event creation'|trans %} - -{% block event_content -%} +{% extends '@ChillEvent/layout.html.twig' %} {% block js %} +{{ encore_entry_script_tags("mod_async_upload") }} +{% endblock %} {% block css %} +{{ encore_entry_link_tags("mod_async_upload") }} +{% endblock %} {% block title 'Event creation'|trans %} {% block event_content +-%}
-

{{ 'Event creation'|trans }}

+

{{ "Event creation" | trans }}

{{ form_start(form) }} {{ form_errors(form) }} @@ -20,7 +13,7 @@ {{ 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) }} @@ -30,12 +23,17 @@ 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 %} From d50d067bf79df4812a121c87647d3fe505108b3d Mon Sep 17 00:00:00 2001 From: rblondiau Date: Thu, 25 Apr 2024 12:51:20 +0200 Subject: [PATCH 6/9] added button for moderators and fixed participant styling --- .../ChillEventBundle/Form/EventType.php | 14 ++++------ .../Resources/views/Event/edit.html.twig | 28 +++++++++++++------ .../Resources/views/Event/new.html.twig | 6 ++-- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/Bundle/ChillEventBundle/Form/EventType.php b/src/Bundle/ChillEventBundle/Form/EventType.php index fe64ef12b..3363079fa 100644 --- a/src/Bundle/ChillEventBundle/Form/EventType.php +++ b/src/Bundle/ChillEventBundle/Form/EventType.php @@ -18,6 +18,7 @@ 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; @@ -45,14 +46,9 @@ 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', @@ -68,7 +64,7 @@ class EventType extends AbstractType ], 'allow_add' => true, 'allow_delete' => true, - 'delete_empty' => fn (StoredObject $storedObject): bool => '' === $storedObject->getFilename(), + 'delete_empty' => fn(StoredObject $storedObject): bool => '' === $storedObject->getFilename(), 'button_remove_label' => 'event.form.remove_document', 'button_add_label' => 'event.form.add_document', ]) 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 6412c94a5..0fb69a4ea 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Event/new.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Event/new.html.twig @@ -1,7 +1,11 @@ {% extends '@ChillEvent/layout.html.twig' %} {% block js %} {{ encore_entry_script_tags("mod_async_upload") }} +{{ encore_entry_script_tags("mod_pickentity_type") }} + {% endblock %} {% block css %} {{ encore_entry_link_tags("mod_async_upload") }} +{{ encore_entry_link_tags("mod_pickentity_type") }} + {% endblock %} {% block title 'Event creation'|trans %} {% block event_content -%}
@@ -12,12 +16,10 @@ {{ form_row(form.circle) }} {{ form_row(form.name) }} {{ form_row(form.date) }} - {{ 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) }} From 651c455bdf7c52f4639473b0c5019192d632e68f Mon Sep 17 00:00:00 2001 From: rblondiau Date: Thu, 25 Apr 2024 15:05:11 +0200 Subject: [PATCH 7/9] added translation for No item --- src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml b/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml index ffabdaa59..0bfe2b64c 100644 --- a/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml @@ -13,13 +13,14 @@ 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 Any description: Aucune description Document from person %name%: Document de l'usager %name% See the document: Voir le document +No item: Aucun document document: Any title: Aucun titre @@ -36,7 +37,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 From f7f7e1cb1d905b4f5fa6d9bfbc8d72060a6a1f22 Mon Sep 17 00:00:00 2001 From: rblondiau Date: Thu, 25 Apr 2024 15:44:29 +0200 Subject: [PATCH 8/9] updated translation by changing translation in twig --- src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml | 1 - .../ChillMainBundle/Resources/views/Form/fields.html.twig | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml b/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml index 0bfe2b64c..c16c161bc 100644 --- a/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml @@ -20,7 +20,6 @@ The document is successfully updated: Le document est mis à jour Any description: Aucune description Document from person %name%: Document de l'usager %name% See the document: Voir le document -No item: Aucun document document: Any title: Aucun titre 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 %} From 30955752c34ac3b2586bed9fef5a03eda19db509 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 8 May 2024 10:28:14 +0200 Subject: [PATCH 9/9] fix pipeline and add changie --- .changes/unreleased/UX-20240508-102757.yaml | 5 +++++ src/Bundle/ChillEventBundle/Form/EventType.php | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 .changes/unreleased/UX-20240508-102757.yaml diff --git a/.changes/unreleased/UX-20240508-102757.yaml b/.changes/unreleased/UX-20240508-102757.yaml new file mode 100644 index 000000000..8ba540e2d --- /dev/null +++ b/.changes/unreleased/UX-20240508-102757.yaml @@ -0,0 +1,5 @@ +kind: UX +body: Adjust certain graphical issues for better user experience +time: 2024-05-08T10:27:57.220873296+02:00 +custom: + Issue: "266" diff --git a/src/Bundle/ChillEventBundle/Form/EventType.php b/src/Bundle/ChillEventBundle/Form/EventType.php index 3363079fa..98cb5ea5e 100644 --- a/src/Bundle/ChillEventBundle/Form/EventType.php +++ b/src/Bundle/ChillEventBundle/Form/EventType.php @@ -21,7 +21,6 @@ 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; @@ -48,7 +47,6 @@ class EventType extends AbstractType ]) ->add('moderator', PickUserDynamicType::class, [ 'label' => 'Pick a moderator', - ]) ->add('location', PickUserLocationType::class, [ 'label' => 'event.fields.location', @@ -64,7 +62,7 @@ class EventType extends AbstractType ], 'allow_add' => true, 'allow_delete' => true, - 'delete_empty' => fn(StoredObject $storedObject): bool => '' === $storedObject->getFilename(), + 'delete_empty' => fn (StoredObject $storedObject): bool => '' === $storedObject->getFilename(), 'button_remove_label' => 'event.form.remove_document', 'button_add_label' => 'event.form.add_document', ])