From 5211fb2fe959eb8b22b4bc2b2c04acf11e27651d Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 9 Sep 2021 16:42:53 +0200 Subject: [PATCH] Documents added to accompanying course menu --- .../test/Fixtures/App/app/Resources/.DS_Store | Bin 6148 -> 0 bytes .../DocumentAccompanyingCourseController.php | 9 ++++++--- .../Form/AccompanyingCourseDocumentType.php | 2 +- .../AccompanyingCourseDocument/index.html.twig | 6 +++--- .../Menu/AccompanyingCourseMenuBuilder.php | 9 ++++++++- .../Resources/test/Fixtures/.DS_Store | Bin 6148 -> 0 bytes 6 files changed, 18 insertions(+), 8 deletions(-) delete mode 100644 src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/Resources/.DS_Store delete mode 100644 src/Bundle/ChillReportBundle/Resources/test/Fixtures/.DS_Store diff --git a/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/Resources/.DS_Store b/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/Resources/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 'DESC'] ); + // dump($course); + // dump($documents); + // $event = new PrivacyEvent($course, [ // 'element_class' => AccompanyingCourseDocument::class, // 'action' => 'index' @@ -118,9 +121,9 @@ class DocumentAccompanyingCourseController extends AbstractController $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { - $this->denyAccessUnlessGranted( - 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE', $document, - 'creation of this activity not allowed'); + // $this->denyAccessUnlessGranted( + // 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE', $document, + // 'creation of this activity not allowed'); $em = $this->getDoctrine()->getManager(); $em->persist($document); diff --git a/src/Bundle/ChillDocStoreBundle/Form/AccompanyingCourseDocumentType.php b/src/Bundle/ChillDocStoreBundle/Form/AccompanyingCourseDocumentType.php index c24d7a910..bdaea7ee0 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/AccompanyingCourseDocumentType.php +++ b/src/Bundle/ChillDocStoreBundle/Form/AccompanyingCourseDocumentType.php @@ -72,7 +72,7 @@ class AccompanyingCourseDocumentType extends AbstractType 'query_builder' => function (EntityRepository $er) { return $er->createQueryBuilder('c') ->where('c.documentClass = :docClass') - ->setParameter('docClass', AccompanyingCourseDocument::class); + ->setParameter('docClass', PersonDocument::class); }, 'choice_label' => function ($entity = null) { return $entity ? $this->translatableStringHelper->localize($entity->getName()) : ''; diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/index.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/index.html.twig index 3e8ed7f9c..114dbb342 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/index.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/index.html.twig @@ -29,7 +29,7 @@ {{ document.title }} {{ document.category.name|localize_translatable_string }} - {{ document.scope.name|localize_translatable_string }} + {# {{ document.scope.name|localize_translatable_string }} #}
    {% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS', document) %} @@ -37,12 +37,12 @@ {{ m.download_button(document.object, document.title) }}
  • - +
  • {% endif %} {% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) %}
  • - +
  • {% endif %}
diff --git a/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php index 744e5dbbe..41de5718d 100644 --- a/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php @@ -61,12 +61,19 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface ]]) ->setExtras(['order' => 30]); + $menu->addChild($this->translator->trans('Documents'), [ + 'route' => 'accompanying_course_document_index', + 'routeParameters' => [ + 'course' => $period->getId() + ]]) + ->setExtras(['order' => 40]); + $menu->addChild($this->translator->trans('Accompanying Course Action'), [ 'route' => 'chill_person_accompanying_period_work_list', 'routeParameters' => [ 'id' => $period->getId() ]]) - ->setExtras(['order' => 40]); + ->setExtras(['order' => 50]); } diff --git a/src/Bundle/ChillReportBundle/Resources/test/Fixtures/.DS_Store b/src/Bundle/ChillReportBundle/Resources/test/Fixtures/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0