diff --git a/CHANGELOG.md b/CHANGELOG.md index a5ad0ea2d..52f0dd4ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,14 @@ and this project adheres to ## Unreleased +* [activity] Fix delete button for document (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/554) +* [activity] Add return path the document generation (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/553) +* [person] add person ressource to person docgen normaliser (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/517) +* [person] AccompanyingCourseWorkEdit: fix deleting evaluation documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/546) +* [person] AccompanyingCourseWorkEdit: download existing documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/512) +* [person] AccompanyingCourseWorkEdit: replace document by a new one (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/511) +* [person] AccompanyingPeriodWork: add referrers to work, add doctrine event listener to add logged user to referrers collection and display a referrers list in work list (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/502) +* [person] AccompanyingPeriodWorkEvaluation: fix circular reference when serialising (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/495) * [person] order accompanying period by opening date in search persons, person and household period lists (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/493) * [parcours] autosave of the pinned comment for draft accompanying course (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/477) * [main] filter user job in undispatch acc period to assign (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/472) @@ -46,6 +54,11 @@ and this project adheres to * [thirdparty] For contacts show current civility/profession in edit form + fix saving of edited information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/491) * [household] create-edit household composition placed in separate page to avoid confusion (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/505) * [blur] Improved positioning of toggle icon (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/486) +* [parcours] List of parcours for a specific user so they can be reassigned in case of absence (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/509) +* [thirdparty] Thirdparty view page, english text translated (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/534) +* [social_action] Translation changed in evaluation section (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/512) +* [household] Within parcours listing page of household add create button (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/560) +* [person_resource] bugfix when adding thirdparty or freetext resource (no issue) ## Test releases diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 3858979ef..a89b1d67c 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -179,14 +179,15 @@ final class ActivityController extends AbstractController { $view = null; - [$person, $accompanyingPeriod] = $this->getEntity($request); - $entity = $this->activityRepository->find($id); if (null === $entity) { throw $this->createNotFoundException('Unable to find Activity entity.'); } + $accompanyingPeriod = $entity->getAccompanyingPeriod(); + $person = $entity->getPerson(); + if ($entity->getAccompanyingPeriod() instanceof AccompanyingPeriod) { $view = 'ChillActivityBundle:Activity:editAccompanyingCourse.html.twig'; $accompanyingPeriod = $entity->getAccompanyingPeriod(); @@ -220,6 +221,9 @@ final class ActivityController extends AbstractController $this->entityManager->persist($entity); $this->entityManager->flush(); + $params = $this->buildParamsToUrl($person, $accompanyingPeriod); + $params['id'] = $entity->getId(); + if ($form->has('gendocTemplateId') && null !== $form['gendocTemplateId']->getData()) { return $this->redirectToRoute( 'chill_docgenerator_generate_from_template', @@ -227,15 +231,13 @@ final class ActivityController extends AbstractController 'template' => $form->get('gendocTemplateId')->getData(), 'entityClassName' => Activity::class, 'entityId' => $entity->getId(), + 'returnPath' => $this->generateUrl('chill_activity_activity_edit', $params), ] ); } $this->addFlash('success', $this->get('translator')->trans('Success : activity updated!')); - $params = $this->buildParamsToUrl($person, $accompanyingPeriod); - $params['id'] = $entity->getId(); - return $this->redirectToRoute('chill_activity_activity_show', $params); } @@ -444,6 +446,9 @@ final class ActivityController extends AbstractController 'template' => $form->get('gendocTemplateId')->getData(), 'entityClassName' => Activity::class, 'entityId' => $entity->getId(), + 'returnPath' => $this->generateUrl('chill_activity_activity_edit', [ + 'id' => $entity->getId(), + ]), ] ); } diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 6f935ad99..891eb8577 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -305,6 +305,7 @@ class ActivityType extends AbstractType 'label' => $activityType->getLabel('documents'), 'required' => $activityType->isRequired('documents'), 'allow_add' => true, + 'allow_delete' => true, 'button_add_label' => 'activity.Insert a document', 'button_remove_label' => 'activity.Remove a document', 'empty_collection_explain' => 'No documents', diff --git a/src/Bundle/ChillActivityBundle/Resources/public/page/edit_activity/index.scss b/src/Bundle/ChillActivityBundle/Resources/public/page/edit_activity/index.scss new file mode 100644 index 000000000..16e66eadb --- /dev/null +++ b/src/Bundle/ChillActivityBundle/Resources/public/page/edit_activity/index.scss @@ -0,0 +1,16 @@ +div.chill-dropzone__below-zone { + a.btn-delete { + display: none; + } +} + +// do it in js does not work +// document.addEventListener('DOMContentLoaded', e => { +// const dropzoneBelow = document.querySelectorAll('div.chill-dropzone__below-zone'); +// dropzoneBelow.forEach( +// d => { +// const a = d.querySelector('a.btn-delete'); +// d.removeChild(a); +// } +// ) +// }); diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig index b278c0300..d0359e223 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/editAccompanyingCourse.html.twig @@ -30,4 +30,5 @@ {{ parent() }} {{ encore_entry_link_tags('mod_async_upload') }} {{ encore_entry_link_tags('vue_activity') }} + {{ encore_entry_link_tags('page_edit_activity') }} {% endblock %} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/listPerson.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/listPerson.html.twig index ac4266f8c..8b30bc6c7 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/listPerson.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/listPerson.html.twig @@ -46,7 +46,7 @@ {% include 'ChillActivityBundle:Activity:list.html.twig' with {'context': 'person'} %} - {% if is_granted('CHILL_ACTIVITY_CREATE', person) %} + {% if is_granted('CHILL_ACTIVITY_CREATE_PERSON', person) %}