From 2fe77f2610c8075a5685fd937270b9a3a361fd79 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Wed, 8 Mar 2023 19:45:33 +0100 Subject: [PATCH 01/38] UX [admin][templates] fix styles on permissionsgroup pages for standard acl model (not vendee) --- .../views/PermissionsGroup/edit.html.twig | 47 +++++++++---------- .../views/PermissionsGroup/index.html.twig | 2 +- .../views/PermissionsGroup/show.html.twig | 16 +++---- 3 files changed, 29 insertions(+), 36 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig index 0f854f7ed..a7875c4ff 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig @@ -12,7 +12,7 @@ {% if edit_form.flags is defined %} {{ form_row(edit_form.flags) }} {% endif %} - {{ form_row(edit_form.submit, { 'attr': { 'class': 'btn btn-chill-green' } } ) }} + {{ form_row(edit_form.submit, { 'attr': { 'class': 'btn btn-save float-end' } } ) }} {{ form_end(edit_form) }}

{{ 'Grant those permissions'|trans }} :

@@ -22,7 +22,7 @@

{{ title|default("Unclassified")|trans }}

- +
@@ -41,7 +41,7 @@ {{ 'Which implies'|trans }} : {% for role in expanded_roles[role_scope.role] %}{{ role|trans }}{% if not loop.last %}, {% endif %}{% endfor %} {% endif %} - - @@ -66,30 +66,25 @@

{{ 'This group does not provide any permission'|trans }}

{%- endif -%} -
-

{{ 'Grant new permissions'|trans }}

- {{ form_start(add_role_scopes_form) }} - {{ form_errors(add_role_scopes_form) }} - {{ form_row(add_role_scopes_form.composed_role_scope.role) }} - {{ form_row(add_role_scopes_form.composed_role_scope.scope) }} +

{{ 'Grant new permissions'|trans }}

- + {{ form_start(add_role_scopes_form) }} + {{ form_errors(add_role_scopes_form) }} + {{ form_row(add_role_scopes_form.composed_role_scope.role) }} + {{ form_row(add_role_scopes_form.composed_role_scope.scope) }} - {{ form_end(add_role_scopes_form) }} -
+ + {{ form_end(add_role_scopes_form) }} {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/index.html.twig index 1b35e9799..06ddb94f5 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/index.html.twig @@ -5,7 +5,7 @@ {% block admin_content -%}

{{ 'Permissions group list'|trans }}

-
{{ 'Role'|trans }} + {%- if role_scope.scope is not null -%} {{ role_scope.scope.name|localize_translatable_string }} @@ -50,9 +50,9 @@ N/A {%- endif -%} + {{ form_start(delete_role_scopes_form[role_scope.id]) }} - {{ form_widget(delete_role_scopes_form[role_scope.id].submit, { 'attr': { 'class': 'btn btn-chill-red' } } ) }} + {{ form_widget(delete_role_scopes_form[role_scope.id].submit, { 'attr': { 'class': 'btn btn-remove' } } ) }} {{ form_end(delete_role_scopes_form[role_scope.id]) }}
+
diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig index eb93c4968..e960c79f7 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig @@ -18,7 +18,7 @@ {% for title, role_scopes in role_scopes_sorted %}

{{ title|default('Unclassified')|trans }}

-
{{ 'Name'|trans }}
+
@@ -36,7 +36,7 @@ {{ 'Which implies'|trans }} : {% for role in expanded_roles[role_scope.role] %}{{ role|trans }}{% if not loop.last %}, {% endif %}{% endfor %} {% endif %} -
{{ 'Role'|trans }}{%- if role_scope.scope is not null -%} + {%- if role_scope.scope is not null -%} {{ role_scope.scope.name|localize_translatable_string }} {%- else -%} N/A @@ -57,17 +57,15 @@ {% endif %} {% endblock %} From 19e51cc74c891fb085adf15787d8f15b24b5370f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 14 Apr 2023 12:11:04 +0200 Subject: [PATCH 02/38] Fix: new column name in hexasmal data for geographical coordinates --- .../Service/Import/PostalCodeFRFromOpenData.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php index f6cc2bd99..e2d25350d 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php +++ b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php @@ -78,8 +78,8 @@ class PostalCodeFRFromOpenData private function handleRecord(array $record): void { - if ('' !== trim($record['coordonnees_gps'])) { - [$lat, $lon] = array_map(static fn ($el) => (float) trim($el), explode(',', $record['coordonnees_gps'])); + if ('' !== trim($record['coordonnees_geographiques'] ?? $record['coordonnees_gps'])) { + [$lat, $lon] = array_map(static fn ($el) => (float) trim($el), explode(',', $record['coordonnees_geographiques'] ?? $record['coordonnees_gps'])); } else { $lat = $lon = 0.0; } From 91ba0c983d5de10276f120e33999a3c6d11ef998 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Fri, 14 Apr 2023 12:23:23 +0200 Subject: [PATCH 03/38] UX: improve admin > permissiongroup templates --- .../translations/messages.fr.yml | 1 + .../Resources/public/chill/chillmain.scss | 6 +++ .../views/PermissionsGroup/edit.html.twig | 50 ++++++++++--------- .../views/PermissionsGroup/index.html.twig | 2 +- .../views/PermissionsGroup/new.html.twig | 7 ++- .../views/PermissionsGroup/show.html.twig | 20 ++++---- .../Resources/views/User/edit.html.twig | 18 +++---- 7 files changed, 60 insertions(+), 44 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml index b64635f69..bfa9039e7 100644 --- a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml @@ -106,6 +106,7 @@ CHILL_ACTIVITY_SEE_DETAILS: Voir le détail des échanges CHILL_ACTIVITY_DELETE: Supprimer un échange CHILL_ACTIVITY_STATS: Statistique des échanges CHILL_ACTIVITY_LIST: Liste des échanges +CHILL_ACTIVITY_CREATE_PERSON: Créer un échange lié à un usager # admin Activities: Échanges diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss index 3c9fc8601..2523ee202 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss @@ -375,6 +375,12 @@ span.dt { font-weight: bolder; background-color: var(--bs-chill-light-gray); } +/// help text +.help-text { + margin-top: 0.25rem; + font-size: 0.875em; + color: var(--bs-gray); +} /* diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig index a7875c4ff..2404c8c0d 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig @@ -3,7 +3,7 @@ {% block title %}{{ 'PermissionsGroup "%name%" edit'|trans( { '%name%': entity.name } ) }}{% endblock %} {% block admin_content -%} -

{{ 'PermissionsGroup "%name%" edit'|trans( { '%name%': entity.name } ) }}

+

{{ 'PermissionsGroup "%name%" edit'|trans( { '%name%': entity.name } ) }}

{{ 'Details'|trans }}

@@ -15,17 +15,17 @@ {{ form_row(edit_form.submit, { 'attr': { 'class': 'btn btn-save float-end' } } ) }} {{ form_end(edit_form) }} -

{{ 'Grant those permissions'|trans }} :

+

{{ 'Grant those permissions'|trans }} :

{%- if entity.getRoleScopes|length > 0 -%} {% for title, role_scopes in role_scopes_sorted %}

{{ title|default("Unclassified")|trans }}

- +
- + @@ -37,9 +37,10 @@
{{ 'Role'|trans }}{{ 'Role'|trans }} {{ 'Circle'|trans }} {{ 'Actions'|trans }}
{{ role_scope.role|trans }} {% if expanded_roles[role_scope.role]|length > 1 %} -
- {{ 'Which implies'|trans }} : {% for role in expanded_roles[role_scope.role] %}{{ role|trans }}{% if not loop.last %}, {% endif %}{% endfor %} - {% endif %} +
+ {{ 'Which implies'|trans }} : {% for role in expanded_roles[role_scope.role] %}{{ role|trans }}{% if not loop.last %}, {% endif %}{% endfor %} +
+ {% endif %}
{%- if role_scope.scope is not null -%} @@ -66,25 +67,28 @@

{{ 'This group does not provide any permission'|trans }}

{%- endif -%} +
+

{{ 'Grant new permissions'|trans }}

-

{{ 'Grant new permissions'|trans }}

+ {{ form_start(add_role_scopes_form) }} + {{ form_errors(add_role_scopes_form) }} + {{ form_row(add_role_scopes_form.composed_role_scope.role) }} + {{ form_row(add_role_scopes_form.composed_role_scope.scope) }} - {{ form_start(add_role_scopes_form) }} - {{ form_errors(add_role_scopes_form) }} - {{ form_row(add_role_scopes_form.composed_role_scope.role) }} - {{ form_row(add_role_scopes_form.composed_role_scope.scope) }} + - + {{ form_end(add_role_scopes_form) }} +
- {{ form_end(add_role_scopes_form) }} {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/index.html.twig index 06ddb94f5..6741898e3 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/index.html.twig @@ -5,7 +5,7 @@ {% block admin_content -%}

{{ 'Permissions group list'|trans }}

- +
diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/new.html.twig index 921db8e6d..f8a1f7c31 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/new.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/new.html.twig @@ -10,8 +10,6 @@ {% if form.flags is defined %} {{ form_row(form.flags) }} {% endif %} - {{ form_row(form.submit, { 'attr': { 'class': 'btn btn-chill-green' } } ) }} - {{ form_end(form) }}
  • @@ -19,5 +17,10 @@ {{ 'Back to the list'|trans }}
  • +
  • + {{ form_widget(form.submit, { 'attr': { 'class': 'btn btn-create' } } ) }} +
+ + {{ form_end(form) }} {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig index e960c79f7..1271d2d60 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig @@ -3,26 +3,27 @@ {% block title %}{{ 'Permission group "%name%"'|trans({ '%name%': entity.name }) }}{% endblock %} {% block admin_content -%} -

{{ 'Permission group "%name%"'|trans({ '%name%': entity.name }) }}

+

{{ 'Permission group "%name%"'|trans({ '%name%': entity.name }) }}

-
{{ 'Name'|trans }}
+
- +
{{ 'Name'|trans }}{{ entity.name }}{{ entity.name }}
+ {% if role_scopes_sorted|length > 0 %} -

{{ 'Grant those permissions'|trans }} :

+

{{ 'Grant those permissions'|trans }} :

{% for title, role_scopes in role_scopes_sorted %}

{{ title|default('Unclassified')|trans }}

- +
- + @@ -32,14 +33,15 @@ diff --git a/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig index 0ecbdef9f..efbdc60d4 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig @@ -7,7 +7,7 @@

{{ 'Permissions granted'|trans }}

{% if entity.groupcenters|length > 0 %} -
{{ 'Role'|trans }}{{ 'Circle'|trans }}{{ 'Circle'|trans }}
{{ role_scope.role|trans }} {% if expanded_roles[role_scope.role]|length > 1 %} -
- {{ 'Which implies'|trans }} : {% for role in expanded_roles[role_scope.role] %}{{ role|trans }}{% if not loop.last %}, {% endif %}{% endfor %} +
+ {{ 'Which implies'|trans }} : {% for role in expanded_roles[role_scope.role] %}{{ role|trans }}{% if not loop.last %}, {% endif %}{% endfor %} +
{% endif %}
{%- if role_scope.scope is not null -%} {{ role_scope.scope.name|localize_translatable_string }} {%- else -%} - N/A + N/A {%- endif -%}
+
@@ -19,18 +19,18 @@ {% for groupcenter in entity.groupcenters %} @@ -47,7 +47,7 @@ {{ form_start(add_groupcenter_form) }} {{ form_row(add_groupcenter_form.composed_groupcenter.center) }} {{ form_row(add_groupcenter_form.composed_groupcenter.permissionsgroup) }} - {{ form_row(add_groupcenter_form.submit, { 'attr' : { 'class': 'btn btn-chill-green' } } ) }} + {{ form_row(add_groupcenter_form.submit, { 'attr' : { 'class': 'btn btn-create' } } ) }} {{ form_end(add_groupcenter_form) }} {% endif %} From 0af13b028e1d13e377f5ed4b5adb0445bb31d51a Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Fri, 14 Apr 2023 12:47:59 +0200 Subject: [PATCH 04/38] UX: improve admin templates --- .../views/DocGeneratorTemplate/index.html.twig | 4 +--- .../views/DocumentCategory/index.html.twig | 6 +++--- .../Resources/views/CRUD/_edit_content.html.twig | 2 +- .../Resources/views/CRUD/_index.html.twig | 2 +- .../Resources/views/User/edit.html.twig | 6 +++--- .../Resources/views/User/index.html.twig | 15 ++++++++------- .../Resources/views/UserJob/index.html.twig | 10 +++++----- 7 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/Bundle/ChillDocGeneratorBundle/Resources/views/DocGeneratorTemplate/index.html.twig b/src/Bundle/ChillDocGeneratorBundle/Resources/views/DocGeneratorTemplate/index.html.twig index 73527edb3..1adb6872b 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Resources/views/DocGeneratorTemplate/index.html.twig +++ b/src/Bundle/ChillDocGeneratorBundle/Resources/views/DocGeneratorTemplate/index.html.twig @@ -27,9 +27,7 @@ {% endfor %} diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/index.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/index.html.twig index 5731f57f5..ff20257a5 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/index.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/DocumentCategory/index.html.twig @@ -5,14 +5,14 @@ {% block admin_content %}

{{ 'Document category list' | trans }}

-
{{ 'Permission group'|trans }}
- - {{ groupcenter.permissionsgroup.name }} - + + {{ groupcenter.permissionsgroup.name }} + - - {{ groupcenter.center.name }} - + + {{ groupcenter.center.name }} + {{ form_start(delete_groupcenter_form[groupcenter.id]) }} - {{ form_row(delete_groupcenter_form[groupcenter.id].submit, { 'attr': { 'class': 'btn btn-chill-red' } } ) }} + {{ form_row(delete_groupcenter_form[groupcenter.id].submit, { 'attr': { 'class': 'btn btn-remove' } } ) }} {{ form_rest(delete_groupcenter_form[groupcenter.id]) }} {{ form_end(delete_groupcenter_form[groupcenter.id]) }} - - {{ 'Edit'|trans }} - +
+
- + @@ -23,7 +23,7 @@ -
{{ 'Creator bundle id' | trans }} {{ 'Internal id inside creator bundle' | trans }} {{ 'Document class' | trans }} {{ 'Name' | trans }}{{ 'Actions' | trans }}{{ 'Actions' | trans }}
{{ document_category.documentClass }} {{ document_category.name | localize_translatable_string}} + {{ ('crud.'~crud_name~'.title_edit')|trans }} +

{{ ('crud.'~crud_name~'.title_edit')|trans }}

{% endblock crud_content_header %} {% block crud_content_form %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/CRUD/_index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/CRUD/_index.html.twig index eaacc1f73..81e29a52e 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/CRUD/_index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/CRUD/_index.html.twig @@ -14,7 +14,7 @@ {% endblock %} {% else %} {% block table_entities %} - +
{% block table_entities_thead_tr %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig index efbdc60d4..4ac863ee6 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig @@ -4,7 +4,7 @@ {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} {% block crud_content_after_form %} {% if access_permissions_group_list %} -

{{ 'Permissions granted'|trans }}

+

{{ 'Permissions granted'|trans }}

{% if entity.groupcenters|length > 0 %}
@@ -28,9 +28,9 @@ {{ groupcenter.center.name }} - diff --git a/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig index b57e17c06..e4e7d70d8 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig @@ -69,19 +69,20 @@ {% endblock %} - + {% block table_entities_tbody %} {% for entity in entities %} @@ -25,19 +25,19 @@ {% endfor %} {% endblock %} - + {% block actions_before %}
  • {{'Back to the admin'|trans}}
  • {% endblock %} - + {% endembed %} {% endblock %} From d759b9c727cbda1e7cb39df6a2474d2596aba6cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 14 Apr 2023 13:11:29 +0200 Subject: [PATCH 05/38] Fixed: [import social work metadata] make association from parent/child SocialIssue and SocialAction on the owning side --- .../ChillPersonBundle/Service/Import/SocialWorkMetadata.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php index f1050b134..3d7b60254 100644 --- a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php +++ b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php @@ -287,7 +287,7 @@ final class SocialWorkMetadata implements SocialWorkMetadataInterface $return['socialActionChild'] = $previousSocialActionChild; } else { $return['socialActionChild'] = $child = (new SocialAction())->setTitle(['fr' => $socialActionChildTitle]); - $parent->addChild($child); + $child->setParent($parent); $child->setIssue($socialIssue)->setOrdering($orderingChild); $this->entityManager->persist($child); } @@ -332,7 +332,7 @@ final class SocialWorkMetadata implements SocialWorkMetadataInterface } elseif (null !== $socialIssueChildTitle) { $return['socialIssueChild'] = $child = (new SocialIssue())->setTitle(['fr' => $socialIssueChildTitle]) ->setOrdering($orderingChild); - $parent->addChild($child); + $child->setParent($parent); $this->entityManager->persist($child); } else { $return['socialIssueChild'] = null; From 318a84e04da8a55f672b1a9d9e0c46e6ce867aae Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Fri, 14 Apr 2023 13:22:31 +0200 Subject: [PATCH 06/38] permissiongroup: complete translation, remove itself role in 'which implies' --- .../ChillActivityBundle/translations/messages.fr.yml | 2 ++ .../Resources/views/PermissionsGroup/edit.html.twig | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml index bfa9039e7..0a7aacfd8 100644 --- a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml @@ -107,6 +107,8 @@ CHILL_ACTIVITY_DELETE: Supprimer un échange CHILL_ACTIVITY_STATS: Statistique des échanges CHILL_ACTIVITY_LIST: Liste des échanges CHILL_ACTIVITY_CREATE_PERSON: Créer un échange lié à un usager +CHILL_ACTIVITY_CREATE_ACCOMPANYING_COURSE: Créer un échange lié à un parcours +CHILL_ACTIVITY_FULL: Voir les détails, créer, supprimer et mettre à jour un échange # admin Activities: Échanges diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig index 2404c8c0d..a4c1e76fe 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig @@ -38,7 +38,13 @@ {{ role_scope.role|trans }} {% if expanded_roles[role_scope.role]|length > 1 %}
    - {{ 'Which implies'|trans }} : {% for role in expanded_roles[role_scope.role] %}{{ role|trans }}{% if not loop.last %}, {% endif %}{% endfor %} + {{ 'Which implies'|trans }} : + {% for role in expanded_roles[role_scope.role] %} + {% if role != role_scope.role %} + {{ role|trans }} + {% if not loop.last %}, {% endif %} + {% endif %} + {% endfor %}
    {% endif %} From 8042edc13c3f22b6c0e63d27c2f593d5d3fbfb59 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Fri, 14 Apr 2023 13:55:54 +0200 Subject: [PATCH 07/38] UX: [permissiongroup] fix form with new sticky-form class --- .../public/chill/scss/record_actions.scss | 40 ++++++++++++++----- .../views/PermissionsGroup/edit.html.twig | 2 +- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss index b8f60e250..57be7c8b4 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss @@ -1,3 +1,11 @@ +/// mixin to set sticky area on bottom when scrolling +@mixin sticky-bottom { + position: sticky; + bottom: 0; + margin-top: 4em; + z-index: 1000; +} + ul.record_actions { display: flex; flex-direction: row; @@ -53,16 +61,30 @@ ul.record_actions { } } } + +.sticky-form { + background-color: $white; + padding: 1em; + margin: -1em; + border-top: 1px solid $chill-ll-gray; + @include sticky-bottom; + + .sticky-form-buttons { + position: initial; + bottom: unset; + margin-top: unset; + z-index: unset; + } +} + .sticky-form-buttons { - margin-top: 4em; - background-color: $beige; - position: sticky; - bottom: 0.3em; - text-align: center; - display: flex; - padding: 0.8em 1.6em; - border-radius: 0; - z-index: 1000; + display: flex; + background-color: $beige; + text-align: center; + padding: 0.8em 1.6em; + border-radius: 0; + @include sticky-bottom; + bottom: 0.3em; } /// EXCEPTIONS diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig index a4c1e76fe..36d0b5404 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig @@ -73,7 +73,7 @@

    {{ 'This group does not provide any permission'|trans }}

    {%- endif -%} -
    +

    {{ 'Grant new permissions'|trans }}

    {{ form_start(add_role_scopes_form) }} From 27415ce86856cd7b2b5a76832836cd9015cb873d Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Fri, 14 Apr 2023 14:38:23 +0200 Subject: [PATCH 08/38] UX: [permissiongroup] sticky form more compact, and with help text --- .../ChillMainBundle/Form/Type/ComposedRoleScopeType.php | 1 + .../Resources/views/PermissionsGroup/edit.html.twig | 8 ++++++-- src/Bundle/ChillMainBundle/translations/messages.fr.yml | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php b/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php index 1d541cbd7..627ce596a 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php @@ -88,6 +88,7 @@ class ComposedRoleScopeType extends AbstractType ]) ->add('scope', EntityType::class, [ 'class' => Scope::class, + 'placeholder' => 'Choose amongst scopes', 'choice_label' => static function (Scope $scope) use ($translatableStringHelper) { return $translatableStringHelper->localize($scope->getName()); }, diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig index 36d0b5404..438bc8289 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig @@ -78,8 +78,12 @@ {{ form_start(add_role_scopes_form) }} {{ form_errors(add_role_scopes_form) }} - {{ form_row(add_role_scopes_form.composed_role_scope.role) }} - {{ form_row(add_role_scopes_form.composed_role_scope.scope) }} + +
    + {{ form_widget(add_role_scopes_form.composed_role_scope.role, { 'attr': { 'class': 'w-50' }}) }} + {{ form_widget(add_role_scopes_form.composed_role_scope.scope) }} +
    +
    {{ 'Help to pick role an scope'|trans }}
    • diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index 369abf628..af1ec5b01 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -168,11 +168,13 @@ New permission group: Nouveau groupe de permissions PermissionsGroup "%name%" edit: Modification du groupe de permission '%name%' Role: Rôle Choose amongst roles: Choisir parmi les rôles +Choose amongst scopes: Choisir un cercle Add permission: Ajouter les permissions This group does not provide any permission: Ce groupe n'attribue aucune permission The role '%role%' has been removed: Le rôle "%role%" a été enlevé de ce groupe de permission The role '%role%' on circle '%scope%' has been removed: Le rôle "%role%" sur le cercle "%scope%" a été enlevé de ce groupe de permission Unclassified: Non classifié +Help to pick role an scope: Les rôles marqués d'un (*) ne nécessitent pas de cercle. #admin section for users User configuration: Gestion des utilisateurs From 324a350bf16515da548748db96b24e2be0fc0247 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Fri, 14 Apr 2023 15:14:08 +0200 Subject: [PATCH 09/38] UX: [permissiongroup] improve transition between form and behind content --- .../Resources/public/chill/scss/record_actions.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss index 57be7c8b4..c3fe6d65c 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss @@ -66,7 +66,7 @@ ul.record_actions { background-color: $white; padding: 1em; margin: -1em; - border-top: 1px solid $chill-ll-gray; + box-shadow: 0 -20px 20px -20px rgba($chill-gray, .5); @include sticky-bottom; .sticky-form-buttons { From 83ce3b3e92606e98d3a1b0780537ec84549eec1e Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Fri, 14 Apr 2023 15:28:43 +0200 Subject: [PATCH 10/38] =?UTF-8?q?Use=20=E2=9A=91=20char=20to=20mark=20role?= =?UTF-8?q?s=20without=20scopes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ChillActivityBundle/translations/messages.fr.yml | 4 ++-- .../ChillMainBundle/translations/messages.fr.yml | 2 +- .../ChillPersonBundle/translations/messages.fr.yml | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml index 0a7aacfd8..581df7431 100644 --- a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml @@ -104,8 +104,8 @@ CHILL_ACTIVITY_UPDATE: Modifier un échange CHILL_ACTIVITY_SEE: Voir un échange CHILL_ACTIVITY_SEE_DETAILS: Voir le détail des échanges CHILL_ACTIVITY_DELETE: Supprimer un échange -CHILL_ACTIVITY_STATS: Statistique des échanges -CHILL_ACTIVITY_LIST: Liste des échanges +CHILL_ACTIVITY_STATS: Statistique des échanges (⚑) +CHILL_ACTIVITY_LIST: Liste des échanges (⚑) CHILL_ACTIVITY_CREATE_PERSON: Créer un échange lié à un usager CHILL_ACTIVITY_CREATE_ACCOMPANYING_COURSE: Créer un échange lié à un parcours CHILL_ACTIVITY_FULL: Voir les détails, créer, supprimer et mettre à jour un échange diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index af1ec5b01..99ba90310 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -174,7 +174,7 @@ This group does not provide any permission: Ce groupe n'attribue aucune permissi The role '%role%' has been removed: Le rôle "%role%" a été enlevé de ce groupe de permission The role '%role%' on circle '%scope%' has been removed: Le rôle "%role%" sur le cercle "%scope%" a été enlevé de ce groupe de permission Unclassified: Non classifié -Help to pick role an scope: Les rôles marqués d'un (*) ne nécessitent pas de cercle. +Help to pick role an scope: Les rôles marqués d'un (⚑) ne nécessitent pas de cercle. #admin section for users User configuration: Gestion des utilisateurs diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 18e3ab13f..2ca57f5f7 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -308,12 +308,12 @@ Opening the accompanying period: Ouverture d'un parcours d'accompagnement 'Timeline for %name%': 'Historique de %name%' # ROLES -CHILL_PERSON_SEE: Voir les usagers -CHILL_PERSON_UPDATE: Modifier les usagers -CHILL_PERSON_CREATE: Ajouter des usagers -CHILL_PERSON_STATS: Statistiques sur les usagers -CHILL_PERSON_LISTS: Liste des usagers -CHILL_PERSON_DUPLICATE: Gérer les doublons d'usagers +CHILL_PERSON_SEE: Voir les usagers (⚑) +CHILL_PERSON_UPDATE: Modifier les usagers (⚑) +CHILL_PERSON_CREATE: Ajouter des usagers (⚑) +CHILL_PERSON_STATS: Statistiques sur les usagers (⚑) +CHILL_PERSON_LISTS: Liste des usagers (⚑) +CHILL_PERSON_DUPLICATE: Gérer les doublons d'usagers (⚑) CHILL_PERSON_ACCOMPANYING_PERIOD_SEE: Vision simplifiée d'un parcours d'accompagnement CHILL_PERSON_ACCOMPANYING_PERIOD_CONFIDENTIAL: Voir et modifier les parcours d'accompagnement confidentielles From ec7f59fc031bf5e2e28d1e01c11f576637a2defb Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Fri, 14 Apr 2023 15:58:27 +0200 Subject: [PATCH 11/38] =?UTF-8?q?UX=20[translations]=20batch=20replace=20'?= =?UTF-8?q?activit=C3=A9'=20by=20'=C3=A9change'=20+=20check=20!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit note: fix some others mistakes --- .../translations/messages.fr.yml | 204 +++++++++--------- .../translations/messages.fr.yml | 2 +- .../translations/messages.fr.yml | 4 +- .../translations/messages.fr.yml | 2 +- 4 files changed, 106 insertions(+), 106 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml index b64635f69..be12daca0 100644 --- a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml @@ -116,7 +116,7 @@ Activity type configuration: Configuration des catégories d'échanges Activity Reasons: Sujets d'un échange Activity Reasons Category: Catégories de sujet d'échanges Activity Types Categories: Catégories des types d'échange -Activity Presences: Presences aux échanges +Activity Presences: Présences aux échanges Associated activity reason category is inactive: La catégorie de sujet attachée est inactive @@ -124,13 +124,13 @@ Associated activity reason category is inactive: La catégorie de sujet attaché crud: activity_type: title_new: Nouveau type d'échange - title_edit: Edition d'un type d'activité + title_edit: Édition d'un type d'échange activity_type_category: - title_new: Nouvelle catégorie de type d'activité - title_edit: Edition d'une catégorie de type d'activité + title_new: Nouvelle catégorie de type d'échange + title_edit: Édition d'une catégorie de type d'échange activity_presence: - title_new: Nouvelle Présence aux activités - title_edit: Edition d'une Présence aux activités + title_new: Nouvelle présence aux échanges + title_edit: Édition d'une présence aux échanges # activity reason admin ActivityReason list: Liste des sujets @@ -139,7 +139,7 @@ Active: Actif Category: Catégorie ActivityReason creation: Nouveau sujet ActivityReason edit: Modification d'un sujet -ActivityReason: Sujet d'activité +ActivityReason: Sujet d'échange The entity is inactive and won't be proposed: Le sujet est inactif et ne sera pas proposé The entity is active and will be proposed: Le sujet est actif et sera proposé @@ -148,17 +148,17 @@ ActivityReasonCategory list: Catégories de sujets Create a new activity category reason: Créer une nouvelle catégorie ActivityReasonCategory creation: Nouvelle catégorie de sujet ActivityReasonCategory edit: Modification d'une catégorie de sujet -ActivityReasonCategory: Catégorie de sujet d'activité +ActivityReasonCategory: Catégorie de sujet d'échange ActivityReasonCategory is active and will be proposed: La catégorie est active et sera proposée ActivityReasonCategory is inactive and won't be proposed: La catégorie est inactive et ne sera pas proposée #activity presence admin -ActivityPresence list: Liste des Présences aux activités -Create a new activity presence: Créer une nouvelle "Présence aux activités" +ActivityPresence list: Liste des présences aux échanges +Create a new activity presence: Créer une nouvelle "Présence aux échanges" # activity type type admin -ActivityType list: Types d'activités -Create a new activity type: Créer un nouveau type d'activité +ActivityType list: Types d'échanges +Create a new activity type: Créer un nouveau type d'échange Persons visible: Visibilité du champ Usagers Persons label: Libellé du champ Usagers User visible: Visibilité du champ Utilisateur @@ -197,135 +197,135 @@ Documents visible: Visibilité du champ Documents Documents label: Libellé du champ Documents # activity type category admin -ActivityTypeCategory list: Liste des catégories des types d'activité -Create a new activity type category: Créer une nouvelle catégorie de type d'activité +ActivityTypeCategory list: Liste des catégories des types d'échange +Create a new activity type category: Créer une nouvelle catégorie de type d'échange # activity delete -Remove activity: Supprimer une activité -Are you sure you want to remove the activity about "%name%" ?: Êtes-vous sûr de vouloir supprimer une activité qui concerne "%name%" ? -The activity has been successfully removed.: L'activité a été supprimée. +Remove activity: Supprimer un échange +Are you sure you want to remove the activity about "%name%" ?: Êtes-vous sûr de vouloir supprimer un échange qui concerne "%name%" ? +The activity has been successfully removed.: L'échange a été supprimé. # exports -Exports of activities linked to a person: Exports des activités liées à un usager -Number of activities linked to a person: Nombre d'activités liées à un usager -Count activities linked to a person: Nombre d'activités -Count activities linked to a person by various parameters.: Compte le nombre d'activités enregistrées et liées à un usager en fonction de différents paramètres. -Sum activity linked to a person duration: Durée des activités -Sum activities linked to a person duration: Durée des activités liés à un usager -Sum activities linked to a person duration by various parameters.: Additionne la durée des activités en fonction de différents paramètres. -List activity linked to a person: Liste les activités -List activities linked to a person: Liste des activités liés à un usager -List activities linked to a person description: Crée la liste des activités en fonction de différents paramètres. +Exports of activities linked to a person: Exports des échanges liés à un usager +Number of activities linked to a person: Nombre d'échanges liés à un usager +Count activities linked to a person: Nombre d'échanges +Count activities linked to a person by various parameters.: Compte le nombre d'échanges enregistrés et liés à un usager en fonction de différents paramètres. +Sum activity linked to a person duration: Durée des échanges +Sum activities linked to a person duration: Durée des échanges liés à un usager +Sum activities linked to a person duration by various parameters.: Additionne la durée des échanges en fonction de différents paramètres. +List activity linked to a person: Liste les échanges +List activities linked to a person: Liste des échanges liés à un usager +List activities linked to a person description: Crée la liste des échanges en fonction de différents paramètres. -Exports of activities linked to an accompanying period: Exports des activités liées à un parcours -Number of activities linked to an accompanying period: Nombre d'activités liées à un parcours -Count activities linked to an accompanying period: Nombre d'activités -Count activities linked to an accompanying period by various parameters.: Compte le nombre d'activités enregistrées et liées à un parcours en fonction de différents paramètres. -Sum activity linked to an accompanying period duration: Somme de la durée des activités -Sum activities linked to an accompanying period duration: Somme de la durée des activités liées à un parcours -Sum activities linked to an accompanying period duration by various parameters.: Additionne la durée des activités en fonction de différents paramètres. -Sum activity linked to an accompanying period visit duration: Somme de la durée de déplacement des activités -Sum activities linked to an accompanying period visit duration: Somme de la durée de déplacement des activités liées à un parcours -Sum activities linked to an accompanying period visit duration by various parameters.: Additionne la durée de déplacement des activités en fonction de différents paramètres. -Average activity linked to an accompanying period duration: Moyenne de la durée des activités -Average activities linked to an accompanying period duration: Moyenne de la durée des activités liées à un parcours -Average activities linked to an accompanying period duration by various parameters.: Moyenne de la durée des activités en fonction de différents paramètres. -Average activity linked to an accompanying period visit duration: Moyenne de la durée de déplacement des activités -Average activities linked to an accompanying period visit duration: Moyenne de la durée de déplacement des activités liées à un parcours -Average activities linked to an accompanying period visit duration by various parameters.: Moyenne de la durée de déplacement des activités en fonction de différents paramètres. +Exports of activities linked to an accompanying period: Exports des échanges liés à un parcours +Number of activities linked to an accompanying period: Nombre d'échanges liés à un parcours +Count activities linked to an accompanying period: Nombre d'échanges +Count activities linked to an accompanying period by various parameters.: Compte le nombre d'échanges enregistrés et liées à un parcours en fonction de différents paramètres. +Sum activity linked to an accompanying period duration: Somme de la durée des échanges +Sum activities linked to an accompanying period duration: Somme de la durée des échanges liés à un parcours +Sum activities linked to an accompanying period duration by various parameters.: Additionne la durée des échanges en fonction de différents paramètres. +Sum activity linked to an accompanying period visit duration: Somme de la durée de déplacement des échanges +Sum activities linked to an accompanying period visit duration: Somme de la durée de déplacement des échanges liés à un parcours +Sum activities linked to an accompanying period visit duration by various parameters.: Additionne la durée de déplacement des échanges en fonction de différents paramètres. +Average activity linked to an accompanying period duration: Moyenne de la durée des échanges +Average activities linked to an accompanying period duration: Moyenne de la durée des échanges liés à un parcours +Average activities linked to an accompanying period duration by various parameters.: Moyenne de la durée des échanges en fonction de différents paramètres. +Average activity linked to an accompanying period visit duration: Moyenne de la durée de déplacement des échanges +Average activities linked to an accompanying period visit duration: Moyenne de la durée de déplacement des échanges liés à un parcours +Average activities linked to an accompanying period visit duration by various parameters.: Moyenne de la durée de déplacement des échanges en fonction de différents paramètres. #filters -Filter by reason: Filtrer les activités par sujet +Filter by reason: Filtrer les échanges par sujet 'Filtered by reasons: only %list%': 'Filtré par sujet: seulement %list%' -'Filtered by activity type: only %list%': "Filtré par type d'activité: uniquement %list%" -Filtered by date activity: Filtrer les activités par date -Activities after this date: Activités après cette date -Activities before this date: Activités avant cette date -"Filtered by date of activity: only between %date_from% and %date_to%": "Filtré par date de l'activité: uniquement entre %date_from% et %date_to%" -This date should be after the date given in "Implied in an activity after this date" field: Cette date devrait être postérieure à la date donnée dans le champ "activités après cette date" +'Filtered by activity type: only %list%': "Filtré par type d'échange: uniquement %list%" +Filtered by date activity: Filtrer les échanges par date +Activities after this date: Échanges après cette date +Activities before this date: Échanges avant cette date +"Filtered by date of activity: only between %date_from% and %date_to%": "Filtré par date de l'échange: uniquement entre %date_from% et %date_to%" +This date should be after the date given in "Implied in an activity after this date" field: Cette date devrait être postérieure à la date donnée dans le champ "échanges après cette date" -Filtered by person having an activity in a period: Uniquement les usagers ayant eu une activité dans la période donnée -Implied in an activity after this date: Impliqué dans une activité après cette date -Implied in an activity before this date: Impliqué dans une activité avant cette date -Filtered by person having an activity between %date_from% and %date_to% with reasons %reasons_name%: Filtré par usager associées à une activité entre %date_from% et %date_to% avec les sujets %reasons_name% -Activity reasons for those activities: Sujets de ces activités +Filtered by person having an activity in a period: Uniquement les usagers ayant eu un échange dans la période donnée +Implied in an activity after this date: Impliqué dans un échange après cette date +Implied in an activity before this date: Impliqué dans un échange avant cette date +Filtered by person having an activity between %date_from% and %date_to% with reasons %reasons_name%: Filtré par usager associées à un échange entre %date_from% et %date_to% avec les sujets %reasons_name% +Activity reasons for those activities: Sujets de ces échanges -Filter by activity type: Filtrer les activités par type +Filter by activity type: Filtrer les échanges par type -Filter activity by location: Filtrer les activités par localisation +Filter activity by location: Filtrer les échanges par localisation 'Filtered activity by location: only %locations%': "Filtré par localisation: uniquement %locations%" -Filter activity by locationtype: Filtrer les activités par type de localisation +Filter activity by locationtype: Filtrer les échanges par type de localisation 'Filtered activity by locationtype: only %types%': "Filtré par type de localisation: uniquement %types%" Accepted locationtype: Types de localisation Accepted users: TMS(s) -Filter activity by emergency: Filtrer les activités par urgence +Filter activity by emergency: Filtrer les échanges par urgence 'Filtered activity by emergency: only %emergency%': "Filtré par urgence: uniquement si %emergency%" -activity is emergency: l'activité est urgente -activity is not emergency: l'activité n'est pas urgente -Filter activity by sentreceived: Filtrer les activités par envoyé/reçu +activity is emergency: l'échange est urgent +activity is not emergency: l'échange n'est pas urgent +Filter activity by sentreceived: Filtrer les échanges par envoyé/reçu 'Filtered activity by sentreceived: only %sentreceived%': "Filtré par envoyé/reçu: uniquement %sentreceived%" Accepted sentreceived: '' -Filter activity by linked socialaction: Filtrer les activités par action liée +Filter activity by linked socialaction: Filtrer les échanges par action liée 'Filtered activity by linked socialaction: only %actions%': "Filtré par action liée: uniquement %actions%" -Filter activity by linked socialissue: Filtrer les activités par problématique liée +Filter activity by linked socialissue: Filtrer les échanges par problématique liée 'Filtered activity by linked socialissue: only %issues%': "Filtré par problématique liée: uniquement %issues%" -Filter activity by user: Filtrer les activités par créateur -Filter activity by users: Filtrer les activités par utilisateur participant -Filter activity by creator: Filtrer les activités par créateur de l'échange +Filter activity by user: Filtrer les échanges par créateur +Filter activity by users: Filtrer les échanges par utilisateur participant +Filter activity by creator: Filtrer les échanges par créateur de l'échange 'Filtered activity by user: only %users%': "Filtré par référent: uniquement %users%" 'Filtered activity by users: only %users%': "Filtré par utilisateurs participants: uniquement %users%" 'Filtered activity by creator: only %users%': "Filtré par créateur: uniquement %users%" Creators: Créateurs -Filter activity by userscope: Filtrer les activités par service du créateur +Filter activity by userscope: Filtrer les échanges par service du créateur 'Filtered activity by userscope: only %scopes%': "Filtré par service du créateur: uniquement %scopes%" Accepted userscope: Services -Filter acp which has no activity: Filtrer les parcours qui n’ont pas d’activité -Filtered acp which has no activities: Filtrer les parcours sans activité associée -Group acp by activity number: Grouper les parcours par nombre d’activité +Filter acp which has no activity: Filtrer les parcours qui n’ont pas d’échange +Filtered acp which has no activities: Filtrer les parcours sans échange associé +Group acp by activity number: Grouper les parcours par nombre d’échange #aggregators -Activity type: Type d'activité -Activity user: Utilisateur lié à l'activité +Activity type: Type d'échange +Activity user: Utilisateur lié à l'échange By reason: Par sujet By category of reason: Par catégorie de sujet Reason's level: Niveau du sujet -Group by reasons: Sujet d'activité -Aggregate by activity user: Grouper les activités par référent -Aggregate by activity users: Grouper les activités par utilisateurs participants -Aggregate by activity type: Grouper les activités par type -Aggregate by activity reason: Grouper les activités par sujet -Aggregate by users scope: Grouper les activités par service principal de l'utilisateur -Users 's scope: Service principal des utilisateurs participants à l'activité -Aggregate by users job: Grouper les activités par métier des utilisateurs participants -Users 's job: Métier des utilisateurs participants à l'activité +Group by reasons: Sujet d'échange +Aggregate by activity user: Grouper les échanges par référent +Aggregate by activity users: Grouper les échanges par utilisateurs participants +Aggregate by activity type: Grouper les échanges par type +Aggregate by activity reason: Grouper les échanges par sujet +Aggregate by users scope: Grouper les échanges par service principal de l'utilisateur +Users 's scope: Service principal des utilisateurs participants à l'échange +Aggregate by users job: Grouper les échanges par métier des utilisateurs participants +Users 's job: Métier des utilisateurs participants à l'échange -Group activity by locationtype: Grouper les activités par type de localisation -Group activity by date: Grouper les activités par date +Group activity by locationtype: Grouper les échanges par type de localisation +Group activity by date: Grouper les échanges par date Frequency: Fréquence by month: Par mois by week: Par semaine for week: Semaine by year: Par année in year: En -Group activity by creator: Grouper les activités par créateur de l'échange -Group activity by creator scope: Grouper les activités par service du créateur de l'échange -Group activity by linked thirdparties: Grouper les activités par tiers impliqué +Group activity by creator: Grouper les échanges par créateur de l'échange +Group activity by creator scope: Grouper les échanges par service du créateur de l'échange +Group activity by linked thirdparties: Grouper les échanges par tiers impliqué Accepted thirdparty: Tiers impliqué -Group activity by linked socialaction: Grouper les activités par action liée -Group activity by linked socialissue: Grouper les activités par problématique liée -Group activity by userscope: Grouper les activités par service du créateur +Group activity by linked socialaction: Grouper les échanges par action liée +Group activity by linked socialissue: Grouper les échanges par problématique liée +Group activity by userscope: Grouper les échanges par service du créateur -Last activities: Les dernières activités +Last activities: Les derniers échanges -See activity in accompanying course context: Voir l'activité dans le contexte du parcours d'accompagnement +See activity in accompanying course context: Voir l'échange dans le contexte du parcours d'accompagnement -You get notified of an activity which does not exists any more: Cette notification ne correspond pas à une activité valide. -you are not allowed to see it details: La notification fait référence à une activité à laquelle vous n'avez pas accès. -This is the minimal activity data: Activité n° +You get notified of an activity which does not exists any more: Cette notification ne correspond pas à un échange valide. +you are not allowed to see it details: La notification fait référence à un échange auquel vous n'avez pas accès. +This is the minimal activity data: Échange n° docgen: - Activity basic: Echange + Activity basic: Échange A basic context for activity: Contexte pour les échanges Accompanying period with a list of activities: Parcours d'accompagnement avec liste des échanges Accompanying period with a list of activities description: Ce contexte reprend les informations du parcours, et tous les échanges pour un parcours. Les échanges ne sont pas filtrés. @@ -341,7 +341,7 @@ export: persons ids: Identifiant des usagers persons name: Nom des usagers thirds parties: Tiers - date: Date de l'activité + date: Date de l'échange locationName: Localisation sent received: Envoyé ou reçu emergency: Urgence @@ -350,17 +350,17 @@ export: travelTime: Durée de déplacement durationTime: Durée id: Identifiant - List activities linked to an accompanying course: Liste les activités liées à un parcours en fonction de différents filtres. - List activity linked to a course: Liste des activités liées à un parcours + List activities linked to an accompanying course: Liste les échanges liés à un parcours en fonction de différents filtres. + List activity linked to a course: Liste des échanges liés à un parcours filter: activity: by_usersjob: - Filter by users job: Filtrer les activités par métier d'au moins un utilisateur participant + Filter by users job: Filtrer les échanges par métier d'au moins un utilisateur participant 'Filtered activity by users job: only %jobs%': 'Filtré par métier d''au moins un utilisateur participant: seulement %jobs%' by_usersscope: - Filter by users scope: Filtrer les activités par services d'au moins un utilisateur participant + Filter by users scope: Filtrer les échanges par services d'au moins un utilisateur participant 'Filtered activity by users scope: only %scopes%': 'Filtré par service d''au moins un utilisateur participant: seulement %scopes%' aggregator: activity: @@ -368,4 +368,4 @@ export: Sent or received: Envoyé ou reçu is sent: envoyé is received: reçu - Group activity by sentreceived: Grouper les activités par envoyé / reçu + Group activity by sentreceived: Grouper les échanges par envoyé / reçu diff --git a/src/Bundle/ChillCustomFieldsBundle/translations/messages.fr.yml b/src/Bundle/ChillCustomFieldsBundle/translations/messages.fr.yml index 6e20d3f60..84b29b37e 100644 --- a/src/Bundle/ChillCustomFieldsBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillCustomFieldsBundle/translations/messages.fr.yml @@ -23,7 +23,7 @@ ordering: ordre label_field: label du champ active: actif No value defined for this option: Pas de valeur pour cette option -CustomFieldsGroup edit: Edition d'un groupe de champs personnalisé +CustomFieldsGroup edit: Édition d'un groupe de champs personnalisé type: type The custom fields group has been created: Le groupe de champs personnalisés a été créé The custom fields group has been updated: Le groupe de champs personnalisés a été mis à jour diff --git a/src/Bundle/ChillDocGeneratorBundle/translations/messages.fr.yml b/src/Bundle/ChillDocGeneratorBundle/translations/messages.fr.yml index d0950482e..5e55d6df8 100644 --- a/src/Bundle/ChillDocGeneratorBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillDocGeneratorBundle/translations/messages.fr.yml @@ -1,6 +1,6 @@ docgen: - Generate a document: Génerer un document - Generate: Génerer + Generate a document: Générer un document + Generate: Générer Document generation: Génération de documents Manage templates and document generation: Gestion des documents générés et de leurs modèles Pick template context: Choisir un contexte diff --git a/src/Bundle/ChillReportBundle/translations/messages.fr.yml b/src/Bundle/ChillReportBundle/translations/messages.fr.yml index cfde70521..69b0ea60e 100644 --- a/src/Bundle/ChillReportBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillReportBundle/translations/messages.fr.yml @@ -1,4 +1,4 @@ -'Report edit': "Edition d'un rapport" +'Report edit': "Édition d'un rapport" 'Save report': "Enregistrer le rapport" 'Reset report': "Remise à zéro" 'Add a report': "Ajout d'un rapport" From 91d40d91535de36df6f17dd44085991c281e7157 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Fri, 14 Apr 2023 16:44:38 +0200 Subject: [PATCH 12/38] =?UTF-8?q?remove=20(=E2=9A=91)=20mark=20in=20added?= =?UTF-8?q?=20roles=20table=20(use=20flag=20only=20in=20form=20select)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resources/views/PermissionsGroup/edit.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig index 438bc8289..0e1bf4551 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig @@ -35,13 +35,13 @@ {% for role_scope in role_scopes %}
    diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index 99ba90310..53619952c 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -425,6 +425,7 @@ No entities: Aucun élément CHILL_FOO_SEE: Voir un élément CHILL_FOO_EDIT: Modifier un élément +chill_export: Exports (statistiques) #Show templates Date: Date From ffc3a97651eac6b09d3750c476563952cb91518d Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Fri, 14 Apr 2023 17:17:41 +0200 Subject: [PATCH 14/38] Permissions more readables with scope before role --- .../views/PermissionsGroup/edit.html.twig | 20 +++++++++---------- .../views/PermissionsGroup/show.html.twig | 14 ++++++------- .../translations/messages.fr.yml | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig index 0e1bf4551..18e91f2c5 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig @@ -25,8 +25,8 @@
    + {{ form_start(delete_groupcenter_form[groupcenter.id]) }} - {{ form_row(delete_groupcenter_form[groupcenter.id].submit, { 'attr': { 'class': 'btn btn-remove' } } ) }} + {{ form_widget(delete_groupcenter_form[groupcenter.id].submit, { 'attr': { 'class': 'btn btn-remove' } } ) }} {{ form_rest(delete_groupcenter_form[groupcenter.id]) }} {{ form_end(delete_groupcenter_form[groupcenter.id]) }}
      + + {% if is_granted('ROLE_ALLOWED_TO_SWITCH') %} +
    • + +
    • + {% endif %} +
    • {% if allow_change_password is same as(true) %}
    • - -
    • - {% endif %} - - {% if is_granted('ROLE_ALLOWED_TO_SWITCH') %} -
    • - +
    • {% endif %}
    diff --git a/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig index e8ea9ec38..3902b33cf 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/UserJob/index.html.twig @@ -2,14 +2,14 @@ {% block admin_content %} {% embed '@ChillMain/CRUD/_index.html.twig' %} - + {% block table_entities_thead_tr %}
    id {{ 'Label'|trans }} {{ 'Active'|trans }} {{ 'Actions'|trans }}
    • - +
    - {{ role_scope.role|trans }} + {{ role_scope.role|trans|replace({'(⚑)': ''}) }} {% if expanded_roles[role_scope.role]|length > 1 %}
    {{ 'Which implies'|trans }} : {% for role in expanded_roles[role_scope.role] %} {% if role != role_scope.role %} - {{ role|trans }} + {{ role|trans|replace({'(⚑)': ''}) }} {% if not loop.last %}, {% endif %} {% endif %} {% endfor %} From 499417aea5500a09b14dae0c33368ce673c71862 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Fri, 14 Apr 2023 17:04:04 +0200 Subject: [PATCH 13/38] permissiongroup: complete translation, remove itself role in 'which implies' --- .../Resources/views/PermissionsGroup/show.html.twig | 10 ++++++++-- .../ChillMainBundle/translations/messages.fr.yml | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig index 1271d2d60..140c6b9aa 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig @@ -31,10 +31,16 @@ {% for role_scope in role_scopes %}
    - {{ role_scope.role|trans }} + {{ role_scope.role|trans|replace({'(⚑)': ''}) }} {% if expanded_roles[role_scope.role]|length > 1 %}
    - {{ 'Which implies'|trans }} : {% for role in expanded_roles[role_scope.role] %}{{ role|trans }}{% if not loop.last %}, {% endif %}{% endfor %} + {{ 'Which implies'|trans }} : + {% for role in expanded_roles[role_scope.role] %} + {% if role != role_scope.role %} + {{ role|trans|replace({'(⚑)': ''}) }} + {% if not loop.last %}, {% endif %} + {% endif %} + {% endfor %}
    {% endif %}
    - + @@ -34,6 +34,15 @@ {% for role_scope in role_scopes %} + -
    {{ 'Role'|trans }} {{ 'Circle'|trans }}{{ 'Role'|trans }} {{ 'Actions'|trans }}
    + {%- if role_scope.scope is not null -%} + + {{ role_scope.scope.name|localize_translatable_string }} + + {%- else -%} + N/A + {%- endif -%} + {{ role_scope.role|trans|replace({'(⚑)': ''}) }} {% if expanded_roles[role_scope.role]|length > 1 %} @@ -48,15 +57,6 @@ {% endif %} - {%- if role_scope.scope is not null -%} - - {{ role_scope.scope.name|localize_translatable_string }} - - {%- else -%} - N/A - {%- endif -%} - {{ form_start(delete_role_scopes_form[role_scope.id]) }} {{ form_widget(delete_role_scopes_form[role_scope.id].submit, { 'attr': { 'class': 'btn btn-remove' } } ) }} diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig index 140c6b9aa..e457fd913 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig @@ -22,14 +22,20 @@ - + {% for role_scope in role_scopes %} + - {% endfor %} diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index 53619952c..0acaffe79 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -167,7 +167,7 @@ Permissionsgroup: Groupe de permissions New permission group: Nouveau groupe de permissions PermissionsGroup "%name%" edit: Modification du groupe de permission '%name%' Role: Rôle -Choose amongst roles: Choisir parmi les rôles +Choose amongst roles: Choisir un rôle Choose amongst scopes: Choisir un cercle Add permission: Ajouter les permissions This group does not provide any permission: Ce groupe n'attribue aucune permission From 2b42db87dcbba52195fb50fd62ff31274d0930c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 14 Apr 2023 21:59:25 +0200 Subject: [PATCH 15/38] fix: [referrer scope aggregator] fix period overlapping --- .../AccompanyingCourseAggregators/ReferrerScopeAggregator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php index 4f8c6f0ef..ccbd21da1 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php @@ -64,7 +64,7 @@ class ReferrerScopeAggregator implements AggregatorInterface $qb->expr()->lte($userHistory . '.startDate', ':' . $dateCalc), $qb->expr()->orX( $qb->expr()->isNull($userHistory . '.endDate'), - $qb->expr()->lt($userHistory . '.endDate', ':' . $dateCalc) + $qb->expr()->gt($userHistory . '.endDate', ':' . $dateCalc) ) ) ) From 33051366d48ec01793787b1fee77fcd653c9a6ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 14 Apr 2023 23:20:59 +0200 Subject: [PATCH 16/38] Fix: [remote calendar ms graph] set another date format The previous date format was compliant with the spec described here: https://learn.microsoft.com/en-us/graph/api/user-list-calendarview?view=graph-rest-1.0&tabs=http However, the date format was not accepted. This should be fix the date format. --- .../Connector/MSGraphRemoteCalendarConnector.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php index 0454bae69..d8742ee63 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php @@ -107,8 +107,8 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface 'users/' . $userId . '/calendarView', [ 'query' => [ - 'startDateTime' => $startDate->format(DateTimeImmutable::ATOM), - 'endDateTime' => $endDate->format(DateTimeImmutable::ATOM), + 'startDateTime' => $startDate->setTimezone(RemoteEventConverter::getRemoteTimeZone())->format(RemoteEventConverter::getRemoteDateTimeSimpleFormat()), + 'endDateTime' => $endDate->setTimezone(RemoteEventConverter::getRemoteTimeZone())->format(RemoteEventConverter::getRemoteDateTimeSimpleFormat()), '$count' => 'true', '$top' => 0, ], @@ -181,8 +181,8 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface 'users/' . $userId . '/calendarView', [ 'query' => [ - 'startDateTime' => $startDate->format(DateTimeImmutable::ATOM), - 'endDateTime' => $endDate->format(DateTimeImmutable::ATOM), + 'startDateTime' => $startDate->setTimezone(RemoteEventConverter::getRemoteTimeZone())->format(RemoteEventConverter::getRemoteDateTimeSimpleFormat()), + 'endDateTime' => $endDate->setTimezone(RemoteEventConverter::getRemoteTimeZone())->format(RemoteEventConverter::getRemoteDateTimeSimpleFormat()), '$select' => 'id,subject,start,end,isAllDay', '$top' => $limit, '$skip' => $offset, @@ -539,7 +539,7 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface $userId = $this->mapCalendarToUser->getUserId($user); if (null === $userId) { - throw new Exception('no remote calendar for this user', [ + throw new Exception('no remote calendar for this user', 55698, [ 'user' => $user->getId(), 'remoteId' => $remoteId, ]); From ffa94dbe40273685b04091beb83bd0c055191a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 14 Apr 2023 23:41:37 +0200 Subject: [PATCH 17/38] Fix: [msgraph calendar subscription] fix infinite iterating on calendar subscription When the total of user to subscribe is a multiple of offset, the subscription was an infinite loop --- .../Command/MapAndSubscribeUserCalendarCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php b/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php index 902fe4c38..d0fdd0a02 100644 --- a/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php +++ b/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php @@ -76,7 +76,7 @@ class MapAndSubscribeUserCalendarCommand extends Command 'expiration' => $expiration->format(DateTimeImmutable::ATOM), ]); - while ($offset < ($total - 1)) { + while ($offset < $total) { $users = $this->userRepository->findByMostOldSubscriptionOrWithoutSubscriptionOrData( $interval, $limit, From c48c5875c66249edf2ee86aecb40cd87eb0e888a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 14 Apr 2023 23:47:33 +0200 Subject: [PATCH 18/38] DX: fix phpstan issues --- .../Connector/MSGraphRemoteCalendarConnector.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php index d8742ee63..d14ebaa02 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php @@ -539,10 +539,13 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface $userId = $this->mapCalendarToUser->getUserId($user); if (null === $userId) { - throw new Exception('no remote calendar for this user', 55698, [ - 'user' => $user->getId(), - 'remoteId' => $remoteId, - ]); + throw new Exception( + sprintf( + 'no remote calendar for this user: %s, remoteid: %s', + $user->getId(), + $remoteId + ) + ); } try { From d898f3ffce2daa855cdc3d2ad726a26b68af3549 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Mon, 17 Apr 2023 10:44:43 +0200 Subject: [PATCH 19/38] Feature [manual] update user manual link in footer --- .../ChillMainBundle/Resources/views/Layout/_footer.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/views/Layout/_footer.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Layout/_footer.html.twig index dbec69008..df6ba912b 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Layout/_footer.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Layout/_footer.html.twig @@ -1,8 +1,8 @@

    {{ 'This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License'|trans|raw }} -
    - +
    +
    {{ 'User manual'|trans }}

    From b69fb740b1c94956ed6bf12406bb9b6c616c6814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 18 Apr 2023 11:36:46 +0200 Subject: [PATCH 20/38] Fix: make geographical units valid during imports --- .../Service/Import/GeographicalUnitBaseImporter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Service/Import/GeographicalUnitBaseImporter.php b/src/Bundle/ChillMainBundle/Service/Import/GeographicalUnitBaseImporter.php index 99f919406..1ec6b70de 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/GeographicalUnitBaseImporter.php +++ b/src/Bundle/ChillMainBundle/Service/Import/GeographicalUnitBaseImporter.php @@ -207,7 +207,7 @@ final class GeographicalUnitBaseImporter (id, geom, unitname, layer_id, unitrefid) SELECT nextval('chill_main_geographical_unit_id_seq'), - geom, + st_makevalid(geom), unitName, layer.id, unitKey From a0d0c3840f0c4c964545ca38530737ea4c467d30 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Tue, 18 Apr 2023 19:04:30 +0200 Subject: [PATCH 21/38] Fix deprecated Role call --- .../ChillActivityBundle/Controller/ActivityController.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 798ae77b4..97678af50 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -41,7 +41,6 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Security\Core\Role\Role; use Symfony\Component\Serializer\SerializerInterface; use Symfony\Contracts\Translation\TranslatorInterface; use function array_key_exists; @@ -213,7 +212,7 @@ final class ActivityController extends AbstractController $form = $this->createForm(ActivityType::class, $entity, [ 'center' => $this->centerResolver->resolveCenters($entity)[0] ?? null, - 'role' => new Role('CHILL_ACTIVITY_UPDATE'), + 'role' => 'CHILL_ACTIVITY_UPDATE', 'activityType' => $entity->getActivityType(), 'accompanyingPeriod' => $accompanyingPeriod, ]); @@ -442,7 +441,7 @@ final class ActivityController extends AbstractController $form = $this->createForm(ActivityType::class, $entity, [ 'center' => $this->centerResolver->resolveCenters($entity)[0] ?? null, - 'role' => new Role('CHILL_ACTIVITY_CREATE'), + 'role' => 'CHILL_ACTIVITY_CREATE', 'activityType' => $entity->getActivityType(), 'accompanyingPeriod' => $accompanyingPeriod, ]); From 034e2553bc89946d1a8196ebd0d6fc82eff53ea5 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Tue, 18 Apr 2023 21:13:24 +0200 Subject: [PATCH 22/38] Fix option with RoleWithoutScope distinction. Remove flag. --- .../translations/messages.fr.yml | 4 +-- .../views/PermissionsGroup/edit.html.twig | 29 +++++++++++++++++-- .../views/PermissionsGroup/show.html.twig | 4 +-- .../translations/messages.fr.yml | 4 ++- .../translations/messages.fr.yml | 12 ++++---- 5 files changed, 39 insertions(+), 14 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml index 581df7431..0a7aacfd8 100644 --- a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml @@ -104,8 +104,8 @@ CHILL_ACTIVITY_UPDATE: Modifier un échange CHILL_ACTIVITY_SEE: Voir un échange CHILL_ACTIVITY_SEE_DETAILS: Voir le détail des échanges CHILL_ACTIVITY_DELETE: Supprimer un échange -CHILL_ACTIVITY_STATS: Statistique des échanges (⚑) -CHILL_ACTIVITY_LIST: Liste des échanges (⚑) +CHILL_ACTIVITY_STATS: Statistique des échanges +CHILL_ACTIVITY_LIST: Liste des échanges CHILL_ACTIVITY_CREATE_PERSON: Créer un échange lié à un usager CHILL_ACTIVITY_CREATE_ACCOMPANYING_COURSE: Créer un échange lié à un parcours CHILL_ACTIVITY_FULL: Voir les détails, créer, supprimer et mettre à jour un échange diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig index 18e91f2c5..2404178b2 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig @@ -44,13 +44,13 @@ {%- endif -%}
    -
    {{ 'Role'|trans }} {{ 'Circle'|trans }}{{ 'Role'|trans }}
    {%- if role_scope.scope is not null -%} + {{ role_scope.scope.name|localize_translatable_string }} + {%- else -%} + N/A + {%- endif -%} + {{ role_scope.role|trans|replace({'(⚑)': ''}) }} {% if expanded_roles[role_scope.role]|length > 1 %} @@ -44,12 +50,6 @@ {% endif %} {%- if role_scope.scope is not null -%} - {{ role_scope.scope.name|localize_translatable_string }} - {%- else -%} - N/A - {%- endif -%} -
    - {{ role_scope.role|trans|replace({'(⚑)': ''}) }} + {{ role_scope.role|trans }} {% if expanded_roles[role_scope.role]|length > 1 %}
    {{ 'Which implies'|trans }} : {% for role in expanded_roles[role_scope.role] %} {% if role != role_scope.role %} - {{ role|trans|replace({'(⚑)': ''}) }} + {{ role|trans }} {% if not loop.last %}, {% endif %} {% endif %} {% endfor %} @@ -83,7 +83,7 @@ {{ form_widget(add_role_scopes_form.composed_role_scope.role, { 'attr': { 'class': 'w-50' }}) }} {{ form_widget(add_role_scopes_form.composed_role_scope.scope) }}
    -
    {{ 'Help to pick role an scope'|trans }}
    +
    {{ 'Help to pick role and scope'|trans }}
    • @@ -102,3 +102,26 @@ {% endblock %} + +{% block js %} + +{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig index e457fd913..b183bc19e 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/show.html.twig @@ -37,13 +37,13 @@ {%- endif -%}
    - {{ role_scope.role|trans|replace({'(⚑)': ''}) }} + {{ role_scope.role|trans }} {% if expanded_roles[role_scope.role]|length > 1 %}
    {{ 'Which implies'|trans }} : {% for role in expanded_roles[role_scope.role] %} {% if role != role_scope.role %} - {{ role|trans|replace({'(⚑)': ''}) }} + {{ role|trans }} {% if not loop.last %}, {% endif %} {% endif %} {% endfor %} diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index 0acaffe79..b8349ce2e 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -174,7 +174,9 @@ This group does not provide any permission: Ce groupe n'attribue aucune permissi The role '%role%' has been removed: Le rôle "%role%" a été enlevé de ce groupe de permission The role '%role%' on circle '%scope%' has been removed: Le rôle "%role%" sur le cercle "%scope%" a été enlevé de ce groupe de permission Unclassified: Non classifié -Help to pick role an scope: Les rôles marqués d'un (⚑) ne nécessitent pas de cercle. +Help to pick role and scope: Certains rôles ne nécessitent pas de cercle. +The role need scope: Ce rôle nécessite un cercle. +The role does not need scope: Ce rôle ne nécessite pas de cercle ! #admin section for users User configuration: Gestion des utilisateurs diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 2ca57f5f7..18e3ab13f 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -308,12 +308,12 @@ Opening the accompanying period: Ouverture d'un parcours d'accompagnement 'Timeline for %name%': 'Historique de %name%' # ROLES -CHILL_PERSON_SEE: Voir les usagers (⚑) -CHILL_PERSON_UPDATE: Modifier les usagers (⚑) -CHILL_PERSON_CREATE: Ajouter des usagers (⚑) -CHILL_PERSON_STATS: Statistiques sur les usagers (⚑) -CHILL_PERSON_LISTS: Liste des usagers (⚑) -CHILL_PERSON_DUPLICATE: Gérer les doublons d'usagers (⚑) +CHILL_PERSON_SEE: Voir les usagers +CHILL_PERSON_UPDATE: Modifier les usagers +CHILL_PERSON_CREATE: Ajouter des usagers +CHILL_PERSON_STATS: Statistiques sur les usagers +CHILL_PERSON_LISTS: Liste des usagers +CHILL_PERSON_DUPLICATE: Gérer les doublons d'usagers CHILL_PERSON_ACCOMPANYING_PERIOD_SEE: Vision simplifiée d'un parcours d'accompagnement CHILL_PERSON_ACCOMPANYING_PERIOD_CONFIDENTIAL: Voir et modifier les parcours d'accompagnement confidentielles From cb1ea8c622afffc180bb5edb3669e9940ef76849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 19 Apr 2023 12:04:52 +0200 Subject: [PATCH 23/38] DX: [mailer] deprecate the chill mailer based on swift mailer --- composer.json | 1 - .../ChillMainBundle/Notification/Mailer.php | 69 +++++++------------ .../PasswordRecover/RecoverPasswordHelper.php | 68 ++++++------------ .../config/services/notification.yaml | 6 -- .../config/services/security.yaml | 6 +- 5 files changed, 47 insertions(+), 103 deletions(-) diff --git a/composer.json b/composer.json index 033b3f19b..b47856954 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,6 @@ "symfony/monolog-bundle": "^3.5", "symfony/security-bundle": "^4.4", "symfony/serializer": "^5.3", - "symfony/swiftmailer-bundle": "^3.5", "symfony/templating": "^4.4", "symfony/translation": "^4.4", "symfony/twig-bundle": "^4.4", diff --git a/src/Bundle/ChillMainBundle/Notification/Mailer.php b/src/Bundle/ChillMainBundle/Notification/Mailer.php index c63a96f04..307d5d1df 100644 --- a/src/Bundle/ChillMainBundle/Notification/Mailer.php +++ b/src/Bundle/ChillMainBundle/Notification/Mailer.php @@ -15,7 +15,10 @@ use Chill\MainBundle\Entity\User; use Psr\Log\LoggerInterface; use Swift_Mailer; use Swift_Message; +use Symfony\Component\Mailer\MailerInterface; +use Symfony\Component\Mime\Email; use Symfony\Component\Routing\RouterInterface; +use Symfony\Component\Templating\EngineInterface; use Symfony\Contracts\Translation\TranslatorInterface; use Twig\Environment; @@ -26,43 +29,34 @@ use function call_user_func; * Classe d'aide pour l'envoi de notification. * * Héberge toutes les méthodes pour ré-écrire les URL en fonction de la langue de l'utilisateur. + * + * @deprecated use the MailerInterface */ class Mailer { - /** - * @var Swift_Mailer - */ - protected $forcedMailer; - /** * @var LoggerInterface */ - protected $logger; - - /** - * @var Swift_Mailer - */ - protected $mailer; + private $logger; /** * @var array */ - protected $routeParameters; + private $routeParameters; /** * @var RouterInterface */ - protected $router; + private $router; /** * @var TranslatorInterface */ - protected $translator; + private $translator; - /** - * @var \Twig\Environment - */ - protected $twig; + private EngineInterface $twig; + + private MailerInterface $mailer; /** * Mailer constructor. @@ -70,11 +64,9 @@ class Mailer * @param $routeParameters */ public function __construct( + MailerInterface $mailer, LoggerInterface $logger, - Environment $twig, - Swift_Mailer $mailer, - // due to bug https://github.com/symfony/swiftmailer-bundle/issues/127 - // \Swift_Transport $mailerTransporter, + EngineInterface $twig, RouterInterface $router, TranslatorInterface $translator, $routeParameters @@ -82,7 +74,6 @@ class Mailer $this->logger = $logger; $this->twig = $twig; $this->mailer = $mailer; - //$this->forcedMailer = new \Swift_Mailer($mailerTransporter); $this->router = $router; $this->translator = $translator; $this->routeParameters = $routeParameters; @@ -115,20 +106,6 @@ class Mailer return $content; } - /** - * @param $force - * - * @throws \Symfony\Component\Mailer\Exception\TransportExceptionInterface - */ - public function sendMessage(Swift_Message $message, $force) - { - if ($force) { - $this->forcedMailer->send($message); - } else { - $this->mailer->send($message); - } - } - /** * Envoie une notification à un utilisateur. * @@ -155,23 +132,25 @@ class Mailer $subject[2] ?? null ); - $message = (new Swift_Message($subjectI18n)) - ->setFrom($fromEmail, $fromName) - ->setTo($to); + $email = new Email(); + $email->addTo($to)->subject($subjectI18n); foreach ($bodies as $contentType => $content) { - $message->setBody($content, $contentType); + match ($contentType) { + 'text/plain' => $email->text($content), + default => $email->text($content), + }; } if (null !== $callback) { - call_user_func($callback, $message); + call_user_func($callback, $email); } $this->logger->info('[notification] Sending notification', [ - 'to' => $message->getTo(), - 'subject' => $message->getSubject(), + 'to' => $email->getTo(), + 'subject' => $email->getSubject() ]); - $this->sendMessage($message, $force); + $this->mailer->send($email); } } diff --git a/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php b/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php index 07114e4b5..42881e291 100644 --- a/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php +++ b/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php @@ -14,6 +14,8 @@ namespace Chill\MainBundle\Security\PasswordRecover; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Notification\Mailer; use DateTimeInterface; +use Symfony\Bridge\Twig\Mime\TemplatedEmail; +use Symfony\Component\Mailer\MailerInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use function array_merge; @@ -22,33 +24,26 @@ class RecoverPasswordHelper { public const RECOVER_PASSWORD_ROUTE = 'password_recover'; - /** - * @var Mailer - */ - protected $mailer; - - protected $routeParameters; + private MailerInterface $mailer; /** * @var TokenManager */ - protected $tokenManager; + private $tokenManager; /** * @var UrlGeneratorInterface */ - protected $urlGenerator; + private $urlGenerator; public function __construct( TokenManager $tokenManager, UrlGeneratorInterface $urlGenerator, - Mailer $mailer, - array $routeParameters + MailerInterface $mailer, ) { $this->tokenManager = $tokenManager; $this->urlGenerator = $urlGenerator; $this->mailer = $mailer; - $this->routeParameters = $routeParameters; } /** @@ -59,27 +54,14 @@ class RecoverPasswordHelper */ public function generateUrl(User $user, DateTimeInterface $expiration, $absolute = true, array $parameters = []) { - $context = $this->urlGenerator->getContext(); - $previousHost = $context->getHost(); - $previousScheme = $context->getScheme(); - - $context->setHost($this->routeParameters['host']); - $context->setScheme($this->routeParameters['scheme']); - - $url = $this->urlGenerator->generate( + return $this->urlGenerator->generate( self::RECOVER_PASSWORD_ROUTE, array_merge( $this->tokenManager->generate($user, $expiration), $parameters ), - $absolute ? UrlGeneratorInterface::ABSOLUTE_URL : UrlGeneratorInterface::ABSOLUTE_PATH + UrlGeneratorInterface::ABSOLUTE_URL ); - - // reset the host - $context->setHost($previousHost); - $context->setScheme($previousScheme); - - return $url; } public function sendRecoverEmail( @@ -91,26 +73,20 @@ class RecoverPasswordHelper array $additionalUrlParameters = [], $emailSubject = 'Recover your password' ) { - $content = $this->mailer->renderContentToUser( - $user, - $template, - array_merge( - [ - 'user' => $user, - 'url' => $this->generateUrl($user, $expiration, true, $additionalUrlParameters), - ], - $templateParameters - ) - ); + if (null === $user->getEmail() || '' === trim($user->getEmail())) { + throw new \UnexpectedValueException("No emaail associated to the user"); + } - $this->mailer->sendNotification( - $user, - [$emailSubject], - [ - 'text/plain' => $content, - ], - null, - $force - ); + $email = (new TemplatedEmail()) + ->subject($emailSubject) + ->to($user->getEmail()) + ->textTemplate($template) + ->context([ + 'user' => $user, + 'url' => $this->generateUrl($user, $expiration, true, $additionalUrlParameters), + ...$templateParameters + ]); + + $this->mailer->send($email); } } diff --git a/src/Bundle/ChillMainBundle/config/services/notification.yaml b/src/Bundle/ChillMainBundle/config/services/notification.yaml index bb0b6bb8c..29cbce946 100644 --- a/src/Bundle/ChillMainBundle/config/services/notification.yaml +++ b/src/Bundle/ChillMainBundle/config/services/notification.yaml @@ -10,12 +10,6 @@ services: Chill\MainBundle\Notification\Mailer: arguments: - $logger: '@Psr\Log\LoggerInterface' - $twig: '@Twig\Environment' - $mailer: '@swiftmailer.mailer.default' - # $mailerTransporter: '@swiftmailer.transport' - $router: '@Symfony\Component\Routing\RouterInterface' - $translator: '@Symfony\Contracts\Translation\TranslatorInterface' $routeParameters: '%chill_main.notifications%' Chill\MainBundle\Notification\NotificationHandlerManager: diff --git a/src/Bundle/ChillMainBundle/config/services/security.yaml b/src/Bundle/ChillMainBundle/config/services/security.yaml index c0d9f98b9..38089becf 100644 --- a/src/Bundle/ChillMainBundle/config/services/security.yaml +++ b/src/Bundle/ChillMainBundle/config/services/security.yaml @@ -61,11 +61,7 @@ services: arguments: $secret: '%kernel.secret%' - Chill\MainBundle\Security\PasswordRecover\RecoverPasswordHelper: - arguments: - $tokenManager: '@Chill\MainBundle\Security\PasswordRecover\TokenManager' - $mailer: '@Chill\MainBundle\Notification\Mailer' - $routeParameters: "%chill_main.notifications%" + Chill\MainBundle\Security\PasswordRecover\RecoverPasswordHelper: ~ Chill\MainBundle\Security\PasswordRecover\PasswordRecoverEventSubscriber: arguments: From a1421ea99f2c502f46f3ffbf93a73eb0e9963aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 19 Apr 2023 12:58:40 +0200 Subject: [PATCH 24/38] Fix: fix usage of scope picker with unactives scopes --- .../Form/Type/ScopePickerType.php | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php b/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php index 79ed6df40..6f1a5837f 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php @@ -60,16 +60,17 @@ class ScopePickerType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { - $items = array_filter( - $this->authorizationHelper->getReachableScopes( - $this->security->getUser(), - $options['role'] instanceof Role ? $options['role']->getRole() : $options['role'], - $options['center'] - ), - static function (Scope $s) { - return $s->isActive(); - } - ); + $items = array_values( + array_filter( + $this->authorizationHelper->getReachableScopes( + $this->security->getUser(), + $options['role'] instanceof Role ? $options['role']->getRole() : $options['role'], + $options['center'] + ), + static function (Scope $s) { + return $s->isActive(); + } + )); if (0 === count($items)) { throw new RuntimeException('no scopes are reachable. This form should not be shown to user'); From 906d1fdab51bdc17c1c15d6901ebe09b9a0eee06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 19 Apr 2023 13:01:48 +0200 Subject: [PATCH 25/38] DX: remove usage of deprecated Role class --- .../Controller/SingleTaskController.php | 13 +++++-------- src/Bundle/ChillTaskBundle/Form/SingleTaskType.php | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php index 530f54b01..0cdcd7173 100644 --- a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php @@ -33,6 +33,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\FormFactoryInterface; +use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -205,7 +206,7 @@ final class SingleTaskController extends AbstractController . 'allowed to edit this task'); $event = (new UIEvent('single-task', $task)) - ->setForm($this->setCreateForm($task, new Role(TaskVoter::UPDATE))); + ->setForm($this->setCreateForm($task, TaskVoter::UPDATE)); $this->eventDispatcher->dispatch(UIEvent::EDIT_FORM, $event); $form = $event->getForm(); @@ -557,7 +558,7 @@ final class SingleTaskController extends AbstractController $this->denyAccessUnlessGranted($role, $task, 'You are not ' . 'allowed to create this task'); - $form = $this->setCreateForm($task, new Role($role)); + $form = $this->setCreateForm($task, $role); $form->handleRequest($request); @@ -650,7 +651,7 @@ final class SingleTaskController extends AbstractController /** * @return \Symfony\Component\Form\FormInterface */ - protected function setCreateForm(SingleTask $task, Role $role) + protected function setCreateForm(SingleTask $task, string $role) { $form = $this->createForm(SingleTaskType::class, $task, [ 'role' => $role, @@ -684,12 +685,8 @@ final class SingleTaskController extends AbstractController /** * Creates a form to delete a Task entity by id. - * - * @param mixed $id The entity id - * - * @return \Symfony\Component\Form\Form The form */ - private function createDeleteForm($id) + private function createDeleteForm($id): FormInterface { return $this->createFormBuilder() ->setAction($this->generateUrl( diff --git a/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php b/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php index 56e33954b..d27a2aa06 100644 --- a/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php +++ b/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php @@ -81,7 +81,7 @@ class SingleTaskType extends AbstractType ->add('circle', ScopePickerType::class, [ 'center' => $center, 'role' => $options['role'], - 'required' => false, + 'required' => true, ]); } } From e6163b2bc3a8e1d7bb4581586ab74321c5b1b37a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 19 Apr 2023 13:05:21 +0200 Subject: [PATCH 26/38] DX: fix cs --- .../DocGenerator/ListActivitiesByAccompanyingPeriodContext.php | 1 - .../Controller/AddressToReferenceMatcherController.php | 1 - src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php | 3 ++- src/Bundle/ChillMainBundle/Form/WorkflowStepType.php | 2 +- .../ChillMainBundle/migrations/Version20230306145728.php | 1 - src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php | 1 + 6 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php index 266fadfee..b2272dd7b 100644 --- a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php +++ b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php @@ -120,7 +120,6 @@ class ListActivitiesByAccompanyingPeriodContext implements public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array { - $denormalized = $this->accompanyingPeriodContext->contextGenerationDataDenormalize($template, $entity, $data); foreach (['myActivitiesOnly', 'myWorksOnly'] as $k) { diff --git a/src/Bundle/ChillMainBundle/Controller/AddressToReferenceMatcherController.php b/src/Bundle/ChillMainBundle/Controller/AddressToReferenceMatcherController.php index 5cdefceb5..aab63aea3 100644 --- a/src/Bundle/ChillMainBundle/Controller/AddressToReferenceMatcherController.php +++ b/src/Bundle/ChillMainBundle/Controller/AddressToReferenceMatcherController.php @@ -107,5 +107,4 @@ class AddressToReferenceMatcherController true ); } - } diff --git a/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php b/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php index 6f1a5837f..2529a0655 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php @@ -70,7 +70,8 @@ class ScopePickerType extends AbstractType static function (Scope $s) { return $s->isActive(); } - )); + ) + ); if (0 === count($items)) { throw new RuntimeException('no scopes are reachable. This form should not be shown to user'); diff --git a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php index 16dc0a4a5..54d953016 100644 --- a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php +++ b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php @@ -247,7 +247,7 @@ class WorkflowStepType extends AbstractType function ($step, ExecutionContextInterface $context, $payload) { $form = $context->getObject(); - foreach($form->get('future_dest_users')->getData() as $u) { + foreach ($form->get('future_dest_users')->getData() as $u) { if (in_array($u, $form->get('future_cc_users')->getData(), true)) { $context ->buildViolation('workflow.The user in cc cannot be a dest user in the same workflow step') diff --git a/src/Bundle/ChillMainBundle/migrations/Version20230306145728.php b/src/Bundle/ChillMainBundle/migrations/Version20230306145728.php index 09a0ece6e..32e138f54 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20230306145728.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20230306145728.php @@ -69,7 +69,6 @@ final class Version20230306145728 extends AbstractMigration $this->addSql('CREATE INDEX IDX_165051F63174800F ON chill_main_address (createdBy_id)'); $this->addSql('CREATE INDEX IDX_165051F665FF1AEC ON chill_main_address (updatedBy_id)'); $this->addSql('COMMENT ON COLUMN chill_main_address_reference.point IS \'(DC2Type:point)\''); - } public function down(Schema $schema): void diff --git a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php index 0cdcd7173..2ba9488b6 100644 --- a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php @@ -685,6 +685,7 @@ final class SingleTaskController extends AbstractController /** * Creates a form to delete a Task entity by id. + * @param mixed $id */ private function createDeleteForm($id): FormInterface { From a59e84b029442abac632559f13272a5fb96f5892 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 20 Apr 2023 14:54:36 +0200 Subject: [PATCH 27/38] Display too draft periods without creator in periods of a person --- .../Repository/AccompanyingPeriodACLAwareRepository.php | 3 ++- .../views/AccompanyingPeriod/user_draft_periods_list.html.twig | 1 + src/Bundle/ChillPersonBundle/translations/messages.fr.yml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php index e28832bf9..9327172ac 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php @@ -174,7 +174,8 @@ final class AccompanyingPeriodACLAwareRepository implements AccompanyingPeriodAC ->andWhere( $qb->expr()->orX( $qb->expr()->neq('ap.step', ':draft'), - $qb->expr()->eq('ap.createdBy', ':creator') + $qb->expr()->orX($qb->expr()->eq('ap.createdBy', ':creator'), + $qb->expr()->isNull('ap.createdBy')) ) ) ->setParameter('draft', AccompanyingPeriod::STEP_DRAFT) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_draft_periods_list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_draft_periods_list.html.twig index d7bd8eea6..ef38ee7b9 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_draft_periods_list.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_draft_periods_list.html.twig @@ -22,6 +22,7 @@

    {{ 'My accompanying periods in draft'|trans }}

    +

    {{ 'Display draft periods created by me'|trans }}

    {% for period in accompanyingPeriods %} diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 18e3ab13f..01634bb21 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -966,6 +966,7 @@ Linked evaluations: Évaluations associées # Accompanying period per user My accompanying periods: Mes parcours My accompanying periods in draft: Mes parcours brouillons +Display draft periods created by me: Affiche les parcours brouillon que j'ai créé (pas ceux dont je suis référent) Number of periods: Nombre de parcours workflow: From dde35be9c3cd29eca96ddc917f20f3300cfe7c66 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 20 Apr 2023 18:05:39 +0200 Subject: [PATCH 28/38] hide pagination if no periods --- .../AccompanyingPeriod/user_draft_periods_list.html.twig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_draft_periods_list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_draft_periods_list.html.twig index ef38ee7b9..60f6ae9e0 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_draft_periods_list.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_draft_periods_list.html.twig @@ -32,7 +32,9 @@ {% endfor %}
    - {{ chill_pagination(pagination) }} + {% if accompanyingPeriods|length > 0 %} + {{ chill_pagination(pagination) }} + {% endif %}
    From 631d65a57ff28d5fedabd5d5819a58e3c15f31c2 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 20 Apr 2023 18:09:25 +0200 Subject: [PATCH 29/38] improve indentation --- .../Repository/AccompanyingPeriodACLAwareRepository.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php index 9327172ac..0aaabd05f 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php @@ -174,8 +174,10 @@ final class AccompanyingPeriodACLAwareRepository implements AccompanyingPeriodAC ->andWhere( $qb->expr()->orX( $qb->expr()->neq('ap.step', ':draft'), - $qb->expr()->orX($qb->expr()->eq('ap.createdBy', ':creator'), - $qb->expr()->isNull('ap.createdBy')) + $qb->expr()->orX( + $qb->expr()->eq('ap.createdBy', ':creator'), + $qb->expr()->isNull('ap.createdBy') + ) ) ) ->setParameter('draft', AccompanyingPeriod::STEP_DRAFT) From 025ee2ea950548038f9d536e2c87398759dccfc7 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 20 Apr 2023 20:24:23 +0200 Subject: [PATCH 30/38] UX: [Admin][persmissionsgroup] complete in template: content wrapper with bootstrap classes --- .../public/chill/scss/record_actions.scss | 2 +- .../views/PermissionsGroup/edit.html.twig | 125 +++++++++--------- 2 files changed, 66 insertions(+), 61 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss index c3fe6d65c..5158a826e 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/record_actions.scss @@ -64,7 +64,7 @@ ul.record_actions { .sticky-form { background-color: $white; - padding: 1em; + padding-top: 1.25em; margin: -1em; box-shadow: 0 -20px 20px -20px rgba($chill-gray, .5); @include sticky-bottom; diff --git a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig index 2404178b2..df63cc848 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/PermissionsGroup/edit.html.twig @@ -3,77 +3,82 @@ {% block title %}{{ 'PermissionsGroup "%name%" edit'|trans( { '%name%': entity.name } ) }}{% endblock %} {% block admin_content -%} -

    {{ 'PermissionsGroup "%name%" edit'|trans( { '%name%': entity.name } ) }}

    +
    +
    -

    {{ 'Details'|trans }}

    +

    {{ 'PermissionsGroup "%name%" edit'|trans( { '%name%': entity.name } ) }}

    - {{ form_start(edit_form) }} - {{ form_row(edit_form.name) }} - {% if edit_form.flags is defined %} - {{ form_row(edit_form.flags) }} - {% endif %} - {{ form_row(edit_form.submit, { 'attr': { 'class': 'btn btn-save float-end' } } ) }} - {{ form_end(edit_form) }} +

    {{ 'Details'|trans }}

    -

    {{ 'Grant those permissions'|trans }} :

    + {{ form_start(edit_form) }} + {{ form_row(edit_form.name) }} + {% if edit_form.flags is defined %} + {{ form_row(edit_form.flags) }} + {% endif %} + {{ form_row(edit_form.submit, { 'attr': { 'class': 'btn btn-save float-end' } } ) }} + {{ form_end(edit_form) }} - {%- if entity.getRoleScopes|length > 0 -%} - {% for title, role_scopes in role_scopes_sorted %} +

    {{ 'Grant those permissions'|trans }} :

    -

    {{ title|default("Unclassified")|trans }}

    + {%- if entity.getRoleScopes|length > 0 -%} + {% for title, role_scopes in role_scopes_sorted %} - - +

    {{ title|default("Unclassified")|trans }}

    + +
    + + + + + + + + + + {% for role_scope in role_scopes %} - - - + + + - - - {% for role_scope in role_scopes %} - - - - - + {% endfor %} + +
    {{ 'Circle'|trans }}{{ 'Role'|trans }}{{ 'Actions'|trans }}
    {{ 'Circle'|trans }}{{ 'Role'|trans }}{{ 'Actions'|trans }} + {%- if role_scope.scope is not null -%} + + {{ role_scope.scope.name|localize_translatable_string }} + + {%- else -%} + N/A + {%- endif -%} + + {{ role_scope.role|trans }} + {% if expanded_roles[role_scope.role]|length > 1 %} +
    + {{ 'Which implies'|trans }} : + {% for role in expanded_roles[role_scope.role] %} + {% if role != role_scope.role %} + {{ role|trans }} + {% if not loop.last %}, {% endif %} + {% endif %} + {% endfor %} +
    + {% endif %} +
    + {{ form_start(delete_role_scopes_form[role_scope.id]) }} + {{ form_widget(delete_role_scopes_form[role_scope.id].submit, { 'attr': { 'class': 'btn btn-remove' } } ) }} + {{ form_end(delete_role_scopes_form[role_scope.id]) }} +
    - {%- if role_scope.scope is not null -%} - - {{ role_scope.scope.name|localize_translatable_string }} - - {%- else -%} - N/A - {%- endif -%} - - {{ role_scope.role|trans }} - {% if expanded_roles[role_scope.role]|length > 1 %} -
    - {{ 'Which implies'|trans }} : - {% for role in expanded_roles[role_scope.role] %} - {% if role != role_scope.role %} - {{ role|trans }} - {% if not loop.last %}, {% endif %} - {% endif %} - {% endfor %} -
    - {% endif %} -
    - {{ form_start(delete_role_scopes_form[role_scope.id]) }} - {{ form_widget(delete_role_scopes_form[role_scope.id].submit, { 'attr': { 'class': 'btn btn-remove' } } ) }} - {{ form_end(delete_role_scopes_form[role_scope.id]) }} -
    + {% endfor %} - {% endfor %} -
    - {% endfor %} + {%- else -%} +

    {{ 'This group does not provide any permission'|trans }}

    + {%- endif -%} - {%- else -%} -

    {{ 'This group does not provide any permission'|trans }}

    - {%- endif -%} + +
    -

    {{ 'Grant new permissions'|trans }}

    {{ form_start(add_role_scopes_form) }} @@ -100,7 +105,7 @@ {{ form_end(add_role_scopes_form) }}
    - +
    {% endblock %} {% block js %} From 7cb7897e1223095cbff702ad9662c5cf1d21a566 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Fri, 21 Apr 2023 18:05:29 +0200 Subject: [PATCH 31/38] Align address detail button style with banner context buttons --- .../AddressDetails/AddressDetailsButton.vue | 4 +-- .../Resources/public/chill/chillperson.scss | 36 +++++++++++++------ .../Resources/views/Person/banner.html.twig | 5 +-- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/AddressDetails/AddressDetailsButton.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/AddressDetails/AddressDetailsButton.vue index 7e060de4c..2bca56379 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/AddressDetails/AddressDetailsButton.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/AddressDetails/AddressDetailsButton.vue @@ -1,7 +1,7 @@