diff --git a/.changes/unreleased/Feature-20251029-152510.yaml b/.changes/unreleased/Feature-20251029-152510.yaml new file mode 100644 index 000000000..fab026c08 --- /dev/null +++ b/.changes/unreleased/Feature-20251029-152510.yaml @@ -0,0 +1,6 @@ +kind: Feature +body: Add columns for comments linked to an activity in the activity list export +time: 2025-10-29T15:25:10.493968528+01:00 +custom: + Issue: "404" + SchemaChange: No schema change diff --git a/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php b/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php index dd817e7ab..c3a4428aa 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php @@ -66,6 +66,9 @@ class ListActivityHelper ->leftJoin('activity.location', 'location') ->addSelect('location.name AS locationName') ->addSelect('activity.sentReceived') + ->addSelect('activity.comment.comment AS commentText') + ->addSelect('activity.comment.date AS commentDate') + ->addSelect('JSON_BUILD_OBJECT(\'uid\', activity.comment.userId, \'d\', activity.comment.date) AS commentUser') ->addSelect('JSON_BUILD_OBJECT(\'uid\', IDENTITY(activity.createdBy), \'d\', activity.createdAt) AS createdBy') ->addSelect('activity.createdAt') ->addSelect('JSON_BUILD_OBJECT(\'uid\', IDENTITY(activity.updatedBy), \'d\', activity.updatedAt) AS updatedBy') @@ -87,6 +90,8 @@ class ListActivityHelper 'createdAt', 'updatedAt' => $this->dateTimeHelper->getLabel($key), 'createdBy', 'updatedBy' => $this->userHelper->getLabel($key, $values, $key), 'date' => $this->dateTimeHelper->getLabel(self::MSG_KEY.$key), + 'commentDate' => $this->dateTimeHelper->getLabel(self::MSG_KEY.'comment_date'), + 'commentUser' => $this->userHelper->getLabel($key, $values, self::MSG_KEY.'comment_user'), 'attendeeName' => function ($value) { if ('_header' === $value) { return 'Attendee'; @@ -176,6 +181,9 @@ class ListActivityHelper 'usersNames', 'thirdPartiesIds', 'thirdPartiesNames', + 'commentText', + 'commentDate', + 'commentUser', 'createdBy', 'createdAt', 'updatedBy', diff --git a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml index 70079bfc9..63c61d8e4 100644 --- a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml @@ -404,7 +404,9 @@ export: id: Identifiant 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 - + commentText: Commentaire + comment_date: Date de la dernière édition du commentaire + comment_user: Dernière édition par filter: activity: