diff --git a/CHANGELOG.md b/CHANGELOG.md index 54447b427..ec08870d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,21 @@ and this project adheres to * [person] name suggestions within create person form when person is created departing from a search input (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/377) +* [notification: formulaire création] descend la box avec la description dans le bas du formulaire +* [notification for activity]: fix link to activity +* [notification] add "URGENT" before accompanying course with emergency = true +* [notification] add a "read more" button on system notification +* [notification] add `[Chill]` in the subject of each notification, automatically +* [notification] add a counter for notification in activity list and accompanying period list, and search results +* [parcours] bugfix if deathdate is not defined (eg. for a thirdparty) parcours is still displayed. Gave error before. +* [workflow] add breadcrumb to show steps +* [popover] add popover html popup mechanism (used by workflow breadcrumb) +* [templates] improve updatedBy macro in item metadatas +* [parcours]: bug fix when comment is pinned all other comments remain in the collection (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/385) +* [workflow] + * add My workflow section with my opened subscriptions + * apply workflow on documents, accompanyingCourseWork and Evaluations +* [wopi-link] a new vue component allow to open wopi link in a fullscreen chill-themed modal ## Test releases @@ -21,7 +36,6 @@ and this project adheres to * [main] location form type: fix unmapped address field (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/246) * [activity] fix wrong import of js assets for adding and viewing documents in activity (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/83 & https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/176) * [person]: space added between deathdate and age in twig renderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/380) -* [parcours]: bug fix when comment is pinned all other comments remain in the collection (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/385) ### test release 2022-01-17 diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 6db1f6945..2947fda38 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -31,6 +31,7 @@ use DateTime; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Psr\Log\LoggerInterface; +use RuntimeException; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\Form\Extension\Core\Type\SubmitType; @@ -38,8 +39,8 @@ 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\Component\Serializer\SerializerInterface; use function array_key_exists; final class ActivityController extends AbstractController @@ -471,20 +472,21 @@ final class ActivityController extends AbstractController public function showAction(Request $request, int $id): Response { - $view = null; + $entity = $this->activityRepository->find($id); - [$person, $accompanyingPeriod] = $this->getEntity($request); + if (null === $entity) { + throw $this->createNotFoundException('Unable to find Activity entity.'); + } + + $accompanyingPeriod = $entity->getAccompanyingPeriod(); + $person = $entity->getPerson(); if ($accompanyingPeriod instanceof AccompanyingPeriod) { $view = 'ChillActivityBundle:Activity:showAccompanyingCourse.html.twig'; } elseif ($person instanceof Person) { $view = 'ChillActivityBundle:Activity:showPerson.html.twig'; - } - - $entity = $this->activityRepository->find($id); - - if (null === $entity) { - throw $this->createNotFoundException('Unable to find Activity entity.'); + } else { + throw new RuntimeException('the activity should be linked with a period or person'); } if (null !== $accompanyingPeriod) { @@ -493,8 +495,7 @@ final class ActivityController extends AbstractController $entity->personsNotAssociated = $entity->getPersonsNotAssociated(); } - // TODO revoir le Voter de Activity pour tenir compte qu'une activité peut appartenir a une période - // $this->denyAccessUnlessGranted('CHILL_ACTIVITY_SEE', $entity); + $this->denyAccessUnlessGranted(ActivityVoter::SEE, $entity); $deleteForm = $this->createDeleteForm($entity->getId(), $person, $accompanyingPeriod); diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index 77f650ce4..b8534de52 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -13,6 +13,7 @@ namespace Chill\ActivityBundle\Entity; use Chill\ActivityBundle\Validator\Constraints as ActivityValidator; use Chill\DocStoreBundle\Entity\Document; +use Chill\DocStoreBundle\Entity\StoredObject; use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable; use Chill\MainBundle\Entity\HasCenterInterface; @@ -61,13 +62,13 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac /** * @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod") - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) */ private ?AccompanyingPeriod $accompanyingPeriod = null; /** * @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityType") - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) * @SerializedName("activityType") * @ORM\JoinColumn(name="type_id") */ @@ -107,13 +108,13 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac * @ORM\Id * @ORM\Column(name="id", type="integer") * @ORM\GeneratedValue(strategy="AUTO") - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) */ private ?int $id = null; /** * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Location") - * @groups({"read"}) + * @groups({"read", "docgen:read"}) */ private ?Location $location = null; @@ -124,7 +125,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac /** * @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\Person") - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) */ private ?Collection $persons = null; @@ -146,20 +147,20 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac /** * @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialAction") * @ORM\JoinTable(name="chill_activity_activity_chill_person_socialaction") - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) */ private Collection $socialActions; /** * @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialIssue") * @ORM\JoinTable(name="chill_activity_activity_chill_person_socialissue") - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) */ private Collection $socialIssues; /** * @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty") - * @Groups({"read"}) + * @Groups({"read", "docgen:read"}) */ private ?Collection $thirdParties = null; @@ -191,7 +192,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac $this->socialActions = new ArrayCollection(); } - public function addDocument(Document $document): self + public function addDocument(StoredObject $document): self { $this->documents[] = $document; @@ -425,7 +426,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac return $this->getEmergency(); } - public function removeDocument(Document $document): void + public function removeDocument(StoredObject $document): void { $this->documents->removeElement($document); } diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig index 09a7ab2a3..6b2e33dfb 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig @@ -143,9 +143,17 @@
+ {{ document.description|chill_markdown_to_html }} ++ {% endif %} +
- {{ document.description|chill_markdown_to_html }} -- {% endif %} -
+ Description du document. Sed euismod nisi porta lorem mollis aliquam. Non curabitur gravida arcu ac tortor. +
+{{ form_label(transition_form.comment) }}
+ + {{ form_widget(transition_form.comment) }} + +{{ 'workflow.This workflow is finalized'|trans }}
+ {% else %} +{{ 'workflow.You are not allowed to apply a transition on this workflow'|trans }}
+{{ 'workflow.Only those users are allowed'|trans }}:
+ ++ {{ step.comment|chill_markdown_to_html }} ++
{{ 'workflow.No workflow'|trans }}
+ {% else %} ++ {% if l.entity_workflow.isUserSubscribedToStep(app.user) %} + + {{ 'workflow.you subscribed to all steps'|trans }} + {% endif %} +
++ {% if l.entity_workflow.isUserSubscribedToFinal(app.user) %} + + {{ 'workflow.you subscribed to final step'|trans }} + {% endif %} +
+