diff --git a/CHANGELOG.md b/CHANGELOG.md
index 969ae069c..49943e927 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,11 +11,63 @@ and this project adheres to
## Unreleased
+
+## Test releases
+
+### 2021-04-26
+
+* [Datepickers] datepickers fixed when using keyboard to enter date (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/545)
+* [social_action] Display 'agents traitants' in parcours resumé and social action list (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/568)
+* [Person_search] Closed parcours shown within an accordeon that can be opened/closed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/574)
+
+### 2021-04-24
+
+* [notification email on course designation] allow raw string in email content generation
+* [Accompanying period work] list evaluations associated to a work by startDate, and then by id, from the most recent to older
+* [Documents] Change wording 'créer' to 'enregistrer' (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/634)
+* [Parcours]: The number of 'mes parcours' displayed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/572)
+* [Hompage_widget]: Renaming of tabs and removal of social actions tab (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/570)
+* [activity]: Ignore thirdparties when creating a social action via an activity (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/573)
+* [parcours]: change wording of warning message and button when user is not associated to a household yet (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/590#note_918370943)
+* [Accompanying period work evaluations] list documents associated to a work by creation date, and then by id, from the most recent to older
+* [Course comment] add validationConstraint NotNull and NotBlank on comment content, to avoid sql error
+* [Notifications] delay the sending of notificaiton to kernel.terminate
+* [Notifications / Period user change] fix the sending of notification when user changes
+* [Activity form] invert 'incoming' and 'receiving' in Activity form
+* [Activity form] keep the same order for 'attendee' field in new and edit form
+* [list with period] use "sameas" test operator to introduce requestor in list
+* [notification email on course designation] allow raw string in email content generation
+* [Accompanying period work] list evaluations associated to a work by startDate, and then by id, from the most recent to older
+
+
+### 2021-04-13
+
+* [person] household address: add a form for editing the validFrom date (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/541)
+* [person] householdmemberseditor: fix composition type bug in select form (vuejs) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/543)
+* [docgen] add more persons choices in docgen for course: amongst requestor (if person), resources of course (if person), and PersonResource (if person);
+* [docgen] add a new context with a list of activities in course
+* [docgen] add a comment in budget lines
+* [notifications] allow to send a notification to an email address. The address receive an access link
+* [adresses] add constraints in database to avoid errors later: postcode not null, and validfrom <= validto
+* [accompanying work editor] add a label on document title input
+
+### 2021-04-07
+
+* notification list: move action buttons outside of the toggle
+* fix detecting of non-read notification
+* filter users which are disabled in search user api
+* order query for location and add pagination in list
+* allow every person which has part for a workflow to see the workflow page
+* able to see the workflow if the evaluation document has been deleted
+* hardcode the list of supported mime types for edition with collabora
+* list of accompanying course: allow to see the pinned comment in list_item
+
+### 2021-04-06
+
* [main] notification toggle read: correct js syntax for compilation in production (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/548)
* [parcours] Display of interlocuteurs changed to flex-table in parcours edit page to prevent cut-off of information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/535)
* [activity] espace entre les boutons pour supprimer les documents
-## Test releases
### continuous release in February and March
diff --git a/composer.json b/composer.json
index c96738df8..d0fc51c0e 100644
--- a/composer.json
+++ b/composer.json
@@ -21,7 +21,7 @@
"knplabs/knp-time-bundle": "^1.12",
"league/csv": "^9.7.1",
"nyholm/psr7": "^1.4",
- "ocramius/package-versions": "^1.10",
+ "ocramius/package-versions": "^1.10 || ^2",
"odolbeau/phone-number-bundle": "^3.6",
"phpoffice/phpspreadsheet": "^1.16",
"ramsey/uuid-doctrine": "^1.7",
@@ -33,6 +33,7 @@
"symfony/expression-language": "^4.4",
"symfony/form": "^4.4",
"symfony/framework-bundle": "^4.4",
+ "symfony/http-foundation": "^4.4",
"symfony/intl": "^4.4",
"symfony/mailer": "^5.4",
"symfony/mime": "^5.4",
@@ -103,7 +104,8 @@
"ergebnis/composer-normalize": true,
"ocramius/package-versions": true,
"phpro/grumphp": true,
- "phpstan/extension-installer": true
+ "phpstan/extension-installer": true,
+ "roave/you-are-using-it-wrong": true
},
"bin-dir": "bin",
"optimize-autoloader": true,
diff --git a/src/Bundle/ChillActivityBundle/EntityListener/ActivityEntityListener.php b/src/Bundle/ChillActivityBundle/EntityListener/ActivityEntityListener.php
index ab370e89e..88adf9723 100644
--- a/src/Bundle/ChillActivityBundle/EntityListener/ActivityEntityListener.php
+++ b/src/Bundle/ChillActivityBundle/EntityListener/ActivityEntityListener.php
@@ -66,9 +66,6 @@ class ActivityEntityListener
$newAction->addPerson($person);
}
- foreach ($associatedThirdparties as $thirdparty) {
- $newAction->setHandlingThierparty($thirdparty);
- }
$this->em->persist($newAction);
$this->em->flush();
}
diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php
index 1e1daead5..6e75bde25 100644
--- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php
+++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php
@@ -373,8 +373,8 @@ class ActivityType extends AbstractType
'label' => $activityType->getLabel('sentReceived'),
'required' => $activityType->isRequired('sentReceived'),
'choices' => [
- 'Sent' => Activity::SENTRECEIVED_SENT,
'Received' => Activity::SENTRECEIVED_RECEIVED,
+ 'Sent' => Activity::SENTRECEIVED_SENT,
],
]);
}
diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php
index 48f750c26..d960a0c21 100644
--- a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php
+++ b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php
@@ -12,13 +12,20 @@ declare(strict_types=1);
namespace Chill\ActivityBundle\Repository;
use Chill\ActivityBundle\Entity\Activity;
+use Chill\ActivityBundle\Entity\ActivityPresence;
+use Chill\ActivityBundle\Entity\ActivityType;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
+use Chill\MainBundle\Entity\Location;
+use Chill\MainBundle\Entity\LocationType;
use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
+use Doctrine\DBAL\Types\Types;
+use Doctrine\ORM\AbstractQuery;
use Doctrine\ORM\EntityManagerInterface;
+use Doctrine\ORM\Query\ResultSetMappingBuilder;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Security\Core\Security;
@@ -72,6 +79,86 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
->findByAccompanyingPeriod($period, $scopes, true, $limit, $start, $orderBy);
}
+ public function findByAccompanyingPeriodSimplified(AccompanyingPeriod $period, ?int $limit = 1000): array
+ {
+ $rsm = new ResultSetMappingBuilder($this->em);
+
+ $sql = '
+ SELECT
+ a.id AS activity_id,
+ date,
+ CASE WHEN durationtime IS NOT NULL THEN (EXTRACT(EPOCH from durationtime) / 60)::int ELSE 0 END AS durationtimeminute,
+ attendee_id,
+ comment_comment,
+ emergency,
+ sentreceived,
+ CASE WHEN traveltime IS NOT NULL THEN (EXTRACT(EPOCH from traveltime) / 60)::int ELSE 0 END AS traveltimeminute,
+ t.id AS type_id, t.name as type_name,
+ p.id AS presence_id, p.name AS presence_name,
+ location.id AS location_id, location.address_id, location.name AS location_name, location.phonenumber1, location.phonenumber2, location.email,
+ location.locationtype_id, locationtype.title AS locationtype_title,
+ users.userids AS userids,
+ thirdparties.thirdpartyids,
+ persons.personids,
+ actions.socialactionids,
+ issues.socialissueids
+
+ FROM activity a
+ LEFT JOIN chill_main_location location ON a.location_id = location.id
+ LEFT JOIN chill_main_location_type locationtype ON location.locationtype_id = locationtype.id
+ LEFT JOIN activitytpresence p ON a.attendee_id = p.id
+ LEFT JOIN activitytype t ON a.type_id = t.id
+ LEFT JOIN LATERAL (SELECT jsonb_agg(user_id) userids, activity_id FROM activity_user AS au WHERE a.id = au.activity_id GROUP BY activity_id) AS users ON TRUE
+ LEFT JOIN LATERAL (SELECT jsonb_agg(thirdparty_id) thirdpartyids, activity_id FROM activity_thirdparty AS au WHERE a.id = au.activity_id GROUP BY activity_id) AS thirdparties ON TRUE
+ LEFT JOIN LATERAL (SELECT jsonb_agg(person_id) personids, activity_id FROM activity_person AS au WHERE a.id = au.activity_id GROUP BY activity_id) AS persons ON TRUE
+ LEFT JOIN LATERAL (SELECT jsonb_agg(socialaction_id) socialactionids, activity_id FROM chill_activity_activity_chill_person_socialaction AS au WHERE a.id = au.activity_id GROUP BY activity_id) AS actions ON TRUE
+ LEFT JOIN LATERAL (SELECT jsonb_agg(socialissue_id) socialissueids, activity_id FROM chill_activity_activity_chill_person_socialissue AS au WHERE a.id = au.activity_id GROUP BY activity_id) AS issues ON TRUE
+
+ WHERE accompanyingperiod_id = ?
+ ORDER BY a.date DESC, a.id DESC
+ LIMIT ?
+ ';
+
+ $rsm
+ ->addEntityResult(Activity::class, 'a')
+ ->addFieldResult('a', 'activity_id', 'id')
+ ->addFieldResult('a', 'date', 'date')
+ ->addFieldResult('a', 'comment', 'comment')
+ ->addFieldResult('a', 'sentreceived', 'sentReceived')
+ ->addFieldResult('a', 'emergency', 'emergency')
+ ->addJoinedEntityResult(Location::class, 'location', 'a', 'location')
+ ->addFieldResult('location', 'location_id', 'id')
+ ->addFieldResult('location', 'location_name', 'name')
+ ->addFieldResult('location', 'phonenumber1', 'phonenumber1')
+ ->addFieldResult('location', 'phonenumber2', 'phonenumber2')
+ ->addFieldResult('location', 'email', 'email')
+ ->addJoinedEntityResult(LocationType::class, 'locationType', 'location', 'locationType')
+ ->addFieldResult('locationType', 'locationtype_id', 'id')
+ ->addFieldResult('locationType', 'locationtype_title', 'title')
+ ->addJoinedEntityResult(ActivityType::class, 'activityType', 'a', 'activityType')
+ ->addFieldResult('activityType', 'type_id', 'id')
+ ->addFieldResult('activityType', 'type_name', 'name')
+ ->addJoinedEntityResult(ActivityPresence::class, 'activityPresence', 'a', 'attendee')
+ ->addFieldResult('activityPresence', 'presence_id', 'id')
+ ->addFieldResult('activityPresence', 'presence_name', 'name')
+
+ // results which cannot be mapped into entity
+ ->addScalarResult('comment_comment', 'comment', Types::TEXT)
+ ->addScalarResult('userids', 'userIds', Types::JSON)
+ ->addScalarResult('thirdpartyids', 'thirdPartyIds', Types::JSON)
+ ->addScalarResult('personids', 'personIds', Types::JSON)
+ ->addScalarResult('socialactionids', 'socialActionIds', Types::JSON)
+ ->addScalarResult('socialissueids', 'socialIssueIds', Types::JSON)
+ ->addScalarResult('durationtimeminute', 'durationTimeMinute', Types::INTEGER)
+ ->addScalarResult('traveltimeminute', 'travelTimeMinute', Types::INTEGER);
+
+ $nq = $this->em->createNativeQuery($sql, $rsm);
+
+ $nq->setParameter(0, $period->getId())->setParameter(1, $limit);
+
+ return $nq->getResult(AbstractQuery::HYDRATE_ARRAY);
+ }
+
/**
* @param array $orderBy
*
diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepositoryInterface.php b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepositoryInterface.php
index 56fb112f9..1fc6d22b1 100644
--- a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepositoryInterface.php
+++ b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepositoryInterface.php
@@ -21,6 +21,15 @@ interface ActivityACLAwareRepositoryInterface
*/
public function findByAccompanyingPeriod(AccompanyingPeriod $period, string $role, ?int $start = 0, ?int $limit = 1000, ?array $orderBy = []): array;
+ /**
+ * Return a list of activities, simplified as array (not object).
+ *
+ * The aim of this method is to get a long list of activities and keep performance.
+ *
+ * @return array an array of array, each item representing an activity
+ */
+ public function findByAccompanyingPeriodSimplified(AccompanyingPeriod $period, ?int $limit = 1000): array;
+
/**
* @return Activity[]|array
*/
diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue
index 51957b010..4691a860a 100644
--- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue
+++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/SocialIssuesAcc.vue
@@ -54,19 +54,19 @@
{{ $t('activity.select_first_a_social_issue') }}
-
-