diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 5655e23c8..3faa756b3 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -32,7 +32,8 @@ src/Bundle/ChillPersonBundle/Tests/Controller/PersonDuplicateControllerViewTest.php - src/Bundle/ChillAsideActivityBundle/src/Tests/ + src/Bundle/ChillAsideActivityBundle/src/Tests/ + src/Bundle/ChillCalendarBundle/Tests/ 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 5008ddfcf..000000000 Binary files a/src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/Resources/.DS_Store and /dev/null differ diff --git a/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php b/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php index f3c4e7a59..d7073597a 100644 --- a/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php +++ b/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php @@ -29,17 +29,19 @@ class ListenToActivityCreate $activityData = $request->query->get('activityData'); if (array_key_exists('calendarId', $activityData)) { $calendarId = $activityData['calendarId']; + + // Attach the activity to the calendar + $em = $event->getObjectManager(); + + $calendar = $em->getRepository(\Chill\CalendarBundle\Entity\Calendar::class)->find($calendarId); + $calendar->setActivity($activity); + + $em->persist($calendar); + $em->flush(); } } - // Attach the activity to the calendar - $em = $event->getObjectManager(); - $calendar = $em->getRepository(\Chill\CalendarBundle\Entity\Calendar::class)->find($calendarId); - $calendar->setActivity($activity); - - $em->persist($calendar); - $em->flush(); } } diff --git a/src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseController.php b/src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseController.php new file mode 100644 index 000000000..512747b01 --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseController.php @@ -0,0 +1,199 @@ +translator = $translator; + $this->eventDispatcher = $eventDispatcher; + $this->authorizationHelper = $authorizationHelper; + } + + /** + * @Route("/", name="accompanying_course_document_index", methods="GET") + */ + public function index(AccompanyingPeriod $course): Response + { + $em = $this->getDoctrine()->getManager(); + + if ($course === NULL) { + throw $this->createNotFoundException('Accompanying period not found'); + } + + $this->denyAccessUnlessGranted(AccompanyingPeriodVoter::SEE, $course); + + $documents = $em + ->getRepository("ChillDocStoreBundle:AccompanyingCourseDocument") + ->findBy( + ['course' => $course], + ['date' => 'DESC'] + ); + + return $this->render( + 'ChillDocStoreBundle:AccompanyingCourseDocument:index.html.twig', + [ + 'documents' => $documents, + 'accompanyingCourse' => $course + ]); + } + + /** + * @Route("/new", name="accompanying_course_document_new", methods="GET|POST") + */ + public function new(Request $request, AccompanyingPeriod $course): Response + { + if ($course === NULL) { + throw $this->createNotFoundException('Accompanying period not found'); + } + + $this->denyAccessUnlessGranted(AccompanyingPeriodVoter::SEE, $course); + + $document = new AccompanyingCourseDocument(); + $document->setUser($this->getUser()); + $document->setCourse($course); + $document->setDate(new \DateTime('Now')); + + $form = $this->createForm(AccompanyingCourseDocumentType::class, $document); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $this->denyAccessUnlessGranted( + 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE', $document, + 'creation of this activity not allowed'); + + $em = $this->getDoctrine()->getManager(); + $em->persist($document); + $em->flush(); + + $this->addFlash('success', $this->translator->trans("The document is successfully registered")); + + return $this->redirectToRoute('accompanying_course_document_index', ['course' => $course->getId()]); + } elseif ($form->isSubmitted() and !$form->isValid()) { + $this->addFlash('error', $this->translator->trans("This form contains errors")); + } + + return $this->render('ChillDocStoreBundle:AccompanyingCourseDocument:new.html.twig', [ + 'document' => $document, + 'form' => $form->createView(), + 'accompanyingCourse' => $course, + ]); + } + + /** + * @Route("/{id}", name="accompanying_course_document_show", methods="GET") + */ + public function show(AccompanyingPeriod $course, AccompanyingCourseDocument $document): Response + { + $this->denyAccessUnlessGranted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', $course); + $this->denyAccessUnlessGranted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE', $document); + + return $this->render( + 'ChillDocStoreBundle:AccompanyingCourseDocument:show.html.twig', + ['document' => $document, 'accompanyingCourse' => $course]); + } + + /** + * @Route("/{id}/edit", name="accompanying_course_document_edit", methods="GET|POST") + */ + public function edit(Request $request, AccompanyingPeriod $course, AccompanyingCourseDocument $document): Response + { + $this->denyAccessUnlessGranted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', $course); + $this->denyAccessUnlessGranted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', $document); + + $document->setUser($this->getUser()); + $document->setDate(new \DateTime('Now')); + + $form = $this->createForm( + AccompanyingCourseDocumentType::class, $document); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $this->getDoctrine()->getManager()->flush(); + + $this->addFlash('success', $this->translator->trans("The document is successfully updated")); + + return $this->redirectToRoute( + 'accompanying_course_document_edit', + ['id' => $document->getId(), 'course' => $course->getId()]); + + } elseif ($form->isSubmitted() and !$form->isValid()) { + $this->addFlash('error', $this->translator->trans("This form contains errors")); + } + + return $this->render( + 'ChillDocStoreBundle:AccompanyingCourseDocument:edit.html.twig', + [ + 'document' => $document, + 'form' => $form->createView(), + 'accompanyingCourse' => $course, + ]); + } + + /** + * @Route("/{id}", name="accompanying_course_document_delete", methods="DELETE") + */ + public function delete(Request $request, AccompanyingPeriod $course, AccompanyingCourseDocument $document): Response + { + $this->denyAccessUnlessGranted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', $course); + $this->denyAccessUnlessGranted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_DELETE', $document); + + if ($this->isCsrfTokenValid('delete'.$document->getId(), $request->request->get('_token'))) { + $em = $this->getDoctrine()->getManager(); + $em->remove($document); + $em->flush(); + } + + return $this->redirectToRoute( + 'accompanying_course_document_index', ['accompanyingCourse' => $course->getId()]); + } +} diff --git a/src/Bundle/ChillDocStoreBundle/Entity/AccompanyingCourseDocument.php b/src/Bundle/ChillDocStoreBundle/Entity/AccompanyingCourseDocument.php new file mode 100644 index 000000000..fd3ba93bc --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/Entity/AccompanyingCourseDocument.php @@ -0,0 +1,32 @@ +course; + } + + public function setCourse(?AccompanyingPeriod $course): self + { + $this->course = $course; + + return $this; + } +} diff --git a/src/Bundle/ChillDocStoreBundle/EntityRepository/AccompanyingCourseDocumentRepository.php b/src/Bundle/ChillDocStoreBundle/EntityRepository/AccompanyingCourseDocumentRepository.php new file mode 100644 index 000000000..383529f52 --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/EntityRepository/AccompanyingCourseDocumentRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('a') + ->andWhere('a.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('a.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?AccompanyingCourseDocument + { + return $this->createQueryBuilder('a') + ->andWhere('a.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +} diff --git a/src/Bundle/ChillDocStoreBundle/Form/AccompanyingCourseDocumentType.php b/src/Bundle/ChillDocStoreBundle/Form/AccompanyingCourseDocumentType.php new file mode 100644 index 000000000..b1a113a0a --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/Form/AccompanyingCourseDocumentType.php @@ -0,0 +1,97 @@ +translatableStringHelper = $translatableStringHelper; + } + + + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder + ->add('title', TextType::class) + ->add('description', ChillTextareaType::class, [ + 'required' => false + ]) + ->add('object', StoredObjectType::class, [ + 'error_bubbling' => true + ]) + ->add('date', ChillDateType::class) + //TODO : adapt to using AccompanyingCourseDocument categories. Currently there are none... + ->add('category', EntityType::class, array( + 'placeholder' => 'Choose a document category', + 'class' => 'ChillDocStoreBundle:DocumentCategory', + 'query_builder' => function (EntityRepository $er) { + return $er->createQueryBuilder('c') + ->where('c.documentClass = :docClass') + ->setParameter('docClass', PersonDocument::class); + }, + 'choice_label' => function ($entity = null) { + return $entity ? $this->translatableStringHelper->localize($entity->getName()) : ''; + }, + )) + ; + + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults([ + 'data_class' => Document::class, + ]); + + // $resolver->setRequired(['role', 'center']) + // ->setAllowedTypes('role', [ \Symfony\Component\Security\Core\Role\Role::class ]) + // ->setAllowedTypes('center', [ \Chill\MainBundle\Entity\Center::class ]) + // ; + } +} diff --git a/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php b/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php index 03a8b7038..c48d45833 100644 --- a/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php +++ b/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php @@ -50,6 +50,9 @@ class MenuBuilder implements LocalMenuBuilderInterface public function buildMenu($menuId, MenuItem $menu, array $parameters) { switch($menuId) { + case 'accompanyingCourse': + $this->buildMenuAccompanyingCourse($menu, $parameters); + break; case 'person': $this->buildMenuPerson($menu, $parameters); break; @@ -57,7 +60,7 @@ class MenuBuilder implements LocalMenuBuilderInterface throw new \LogicException("this menuid $menuId is not implemented"); } } - + protected function buildMenuPerson(MenuItem $menu, array $parameters) { /* @var $person \Chill\PersonBundle\Entity\Person */ @@ -80,8 +83,25 @@ class MenuBuilder implements LocalMenuBuilderInterface } + protected function buildMenuAccompanyingCourse(MenuItem $menu, array $parameters){ + $course = $parameters['accompanyingCourse']; + // $user = $this->tokenStorage->getToken()->getUser(); + + //TODO : add condition to check user rights? + + $menu->addChild($this->translator->trans('Documents'), [ + 'route' => 'accompanying_course_document_index', + 'routeParameters' => [ + 'course' => $course->getId() + ] + ]) + ->setExtras([ + 'order'=> 400 + ]); + } + public static function getMenuIds(): array { - return [ 'person' ]; + return [ 'person', 'accompanyingCourse' ]; } } diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/_delete_form.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/_delete_form.html.twig new file mode 100644 index 000000000..90ee734e0 --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/_delete_form.html.twig @@ -0,0 +1,5 @@ +
+ + + +
diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/edit.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/edit.html.twig new file mode 100644 index 000000000..088a351f3 --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/edit.html.twig @@ -0,0 +1,45 @@ +{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %} + +{% set activeRouteKey = '' %} + +{% block title %} + {# {{ 'Editing document for %name%'|trans({ '%name%': accompanyingCourse|chill_entity_render_string } ) }} #} +{% endblock %} +{% block content %} + +

{{ 'Edit Document' | trans }}

+ + {{ form_errors(form) }} + + {{ form_start(form) }} + + {{ form_row(form.title) }} + {{ form_row(form.date) }} + {{ form_row(form.category) }} + {{ form_row(form.description) }} + {{ form_row(form.object, { 'label': 'Document', 'existing': document.object }) }} + + + + {{ form_end(form) }} + + +{% endblock %} + +{% block js %} + {{ parent() }} + {{ encore_entry_script_tags('mod_async_upload') }} +{% endblock %} + +{% block css %} + {{ encore_entry_link_tags('mod_async_upload') }} +{% endblock %} diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/index.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/index.html.twig new file mode 100644 index 000000000..fbea1229a --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/index.html.twig @@ -0,0 +1,70 @@ +{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %} + +{% set activeRouteKey = '' %} + +{% import "@ChillDocStore/Macro/macro.html.twig" as m %} + +{% block title %} + {{ 'Documents' }} +{% endblock %} + +{% block js %} + {{ parent() }} + {{ encore_entry_script_tags('mod_async_upload') }} +{% endblock %} + +{% block content %} +

{{ 'Documents' }}

+ + + + + + + + + + + + {% for document in documents %} + + + + + + {% else %} + + + + {% endfor %} + +
{{ 'Title' | trans }}{{ 'Category'|trans }}{{ 'Actions' | trans }}
{{ document.title }}{{ document.category.name|localize_translatable_string }} +
    + {% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS', document) %} +
  • + {{ m.download_button(document.object, document.title) }} +
  • +
  • + +
  • + {% endif %} + {% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) %} +
  • + +
  • + {% endif %} +
+
+ {{ 'Any document found'|trans }} +
+ + {% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE', accompanyingCourse) %} + + {% endif %} +{% endblock %} diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/new.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/new.html.twig new file mode 100644 index 000000000..713654739 --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/new.html.twig @@ -0,0 +1,46 @@ +{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %} + +{% set activeRouteKey = '' %} + +{% block title %} + {# {{ 'New document for %name%'|trans({ '%name%': accompanyingCourse|chill_entity_render_string } ) }} #} +{% endblock %} + + +{% block content %} + + {#

{{ 'New document for %name%'|trans({ '%name%': accompanyingCourse|chill_entity_render_string } ) }}

#} + + + {{ form_errors(form) }} + + {{ form_start(form) }} + + {{ form_row(form.title) }} + {{ form_row(form.date) }} + {{ form_row(form.category) }} + {# {{ form_row(form.scope) }} #} + {{ form_row(form.description) }} + {{ form_row(form.object, { 'label': 'Document', 'existing': document.object }) }} + + + {{ form_end(form) }} +{% endblock %} + +{% block js %} + {{ parent() }} + {{ encore_entry_script_tags('mod_async_upload') }} +{% endblock %} + +{% block css %} + {{ encore_entry_link_tags('mod_async_upload') }} +{% endblock %} diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/show.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/show.html.twig new file mode 100644 index 000000000..3bf9cac43 --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/show.html.twig @@ -0,0 +1,59 @@ +{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %} + +{% set activeRouteKey = '' %} + +{% import "@ChillDocStore/Macro/macro.html.twig" as m %} + +{% block title %} + {# {{ 'Detail of document of %name%'|trans({ '%name%': accompanyingCourse|chill_entity_render_string } ) }} #} +{% endblock %} + + +{% block js %} + {{ parent() }} + {{ encore_entry_script_tags('mod_async_upload') }} +{% endblock %} + +{% block content %} + +

{{ 'Document %title%' | trans({ '%title%': document.title }) }}

+ +
+
{{ 'Title'|trans }}
+
{{ document.title }}
+ +
{{ 'Category'|trans }}
+
{{ document.category.name|localize_translatable_string }}
+ +
{{ 'Description' | trans }}
+
+ {% if document.description is empty %} + {{ 'Any description'|trans }} + {% else %} +
+ {{ document.description|chill_markdown_to_html }} +
+ {% endif %} +
+ +
+ + diff --git a/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig index 507e3c609..0ea1d529c 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/User/edit.html.twig @@ -1,78 +1,56 @@ -{% extends '@ChillMain/Admin/layout_permissions.html.twig' %} - -{% block title %}{{ 'User edit'|trans }}{% endblock %} +{% extends '@ChillMain/Admin/Permission/layout_crud_permission_index.html.twig' %} {% block admin_content -%} -

{{ 'User edit'|trans }}

+ {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {% block crud_content_after_form %} +

{{ 'Permissions granted'|trans }}

- {{ form_start(edit_form) }} - - {{ form_row(edit_form.username) }} - {{ form_row(edit_form.email) }} - {{ form_row(edit_form.enabled, { 'label': "User'status"}) }} - - {{ form_widget(edit_form.submit, { 'attr': { 'class' : 'btn btn-chill-green center' } } ) }} - {{ 'Edit password'|trans }} - - {{ form_end(edit_form) }} - -

{{ 'Permissions granted'|trans }}

- - {% if entity.groupcenters|length > 0 %} - - - - - - - - - - {% for groupcenter in entity.groupcenters %} - - + + + {% endfor %} + +
{{ 'Permission group'|trans }}{{ 'Center'|trans }} 
+ {% if entity.groupcenters|length > 0 %} + + + + + + + + + + {% for groupcenter in entity.groupcenters %} + + - + - - - {% endfor %} - -
{{ 'Permission group'|trans }}{{ 'Center'|trans }} 
{{ groupcenter.permissionsgroup.name }} - + {{ groupcenter.center.name }} - - {{ form_start(delete_groupcenter_form[groupcenter.id]) }} - {{ form_row(delete_groupcenter_form[groupcenter.id].submit, { 'attr': { 'class': 'btn btn-chill-red' } } ) }} - {{ form_rest(delete_groupcenter_form[groupcenter.id]) }} - {{ form_end(delete_groupcenter_form[groupcenter.id]) }} -
- {% else %} -

{{ 'Any permissions granted to this user'|trans }}.

- {% endif %} - -

{{ 'Grant new permissions'|trans }}

- - {{ form_start(add_groupcenter_form) }} - {{ form_row(add_groupcenter_form.composed_groupcenter.center) }} - {{ form_row(add_groupcenter_form.composed_groupcenter.permissionsgroup) }} - {{ form_row(add_groupcenter_form.submit, { 'attr' : { 'class': 'btn btn-chill-green' } } ) }} +
+ {{ form_start(delete_groupcenter_form[groupcenter.id]) }} + {{ form_row(delete_groupcenter_form[groupcenter.id].submit, { 'attr': { 'class': 'btn btn-chill-red' } } ) }} + {{ form_rest(delete_groupcenter_form[groupcenter.id]) }} + {{ form_end(delete_groupcenter_form[groupcenter.id]) }} +
+ {% else %} +

{{ 'Any permissions granted to this user'|trans }}.

+ {% endif %} - {{ form_end(add_groupcenter_form) }} - - +

{{ 'Grant new permissions'|trans }}

+ + {{ form_start(add_groupcenter_form) }} + {{ form_row(add_groupcenter_form.composed_groupcenter.center) }} + {{ form_row(add_groupcenter_form.composed_groupcenter.permissionsgroup) }} + {{ form_row(add_groupcenter_form.submit, { 'attr' : { 'class': 'btn btn-chill-green' } } ) }} + + {{ form_end(add_groupcenter_form) }} + + {% endblock %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/User/edit_password.html.twig b/src/Bundle/ChillMainBundle/Resources/views/User/edit_password.html.twig index 3280b3679..c26f6cf24 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/User/edit_password.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/User/edit_password.html.twig @@ -1,4 +1,4 @@ -{% extends '@ChillMain/Admin/layout_permissions.html.twig' %} +{% extends '@ChillMain/Admin/Permission/layout_crud_permission_index.html.twig' %} {% block title %}{{ 'Edit password for %username%'|trans( { '%username%': entity.username } ) }}{% endblock %} @@ -7,19 +7,17 @@ {{ form_start(edit_form) }} {{ form_row(edit_form.new_password) }} - {{ form_widget(edit_form.submit, { 'attr': { 'class': 'btn btn-chill-orange' } } ) }} + + + {{ form_end(edit_form) }} - - {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig index c97a658bb..53bd89482 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig @@ -1,53 +1,60 @@ -{% extends '@ChillMain/Admin/layout_permissions.html.twig' %} - -{% block title %}{{ 'user list'|trans|capitalize }}{% endblock %} +{% extends '@ChillMain/Admin/Permission/layout_crud_permission_index.html.twig' %} {% block admin_content -%} -

{{ 'user list'|trans|capitalize }}

- - - - - - - - - - {% for entity in entities %} - - + {% embed '@ChillMain/CRUD/_index.html.twig' %} + {% block table_entities_thead_tr %} + + + + + {% endblock %} + {% block table_entities_tbody %} + {% for entity in entities %} + + + + - {% endfor %} - -
{{ 'Username'|trans|capitalize }}{{ 'Actions'|trans|capitalize }}
{{ entity.username }}{{ 'crud.admin_user.index.is_active'|trans }}{{ 'crud.admin_user.index.usernames'|trans }}{{ 'crud.admin_user.index.mains'|trans }} 
- + + {{ entity.username }} +
+ {{ entity.label }} +
+ {{ entity.email }} +
+ {% if entity.userJob %} + {{ entity.userJob.label|localize_translatable_string }} +
+ {% endif %} + {% if entity.mainScope %} + {{ entity.mainScope.name|localize_translatable_string }} +
+ {% endif %} + {% if entity.mainCenter %} + {{ entity.mainCenter.name }} + {% endif %} +
+
    +
  • + +
  • +
  • + +
  • + {% if is_granted('ROLE_ALLOWED_TO_SWITCH') %} +
  • + +
  • + {% endif %} +
- - - -{% endblock admin_content %} + {% endfor %} + {% endblock %} + {% endembed %} +{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/User/new.html.twig b/src/Bundle/ChillMainBundle/Resources/views/User/new.html.twig index b2234ef30..f0757b25d 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/User/new.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/User/new.html.twig @@ -1,22 +1,7 @@ -{% extends '@ChillMain/Admin/layout_permissions.html.twig' %} - -{% block title %}{{ 'User creation'|trans }}{% endblock %} +{% extends '@ChillMain/Admin/Permission/layout_crud_permission_index.html.twig' %} {% block admin_content -%} -

{{ 'User creation'|trans }}

- - {{ form_start(form) }} - {{ form_row(form.username) }} - {{ form_row(form.email) }} - {{ form_row(form.plainPassword) }} - {{ form_widget(form.submit, { 'attr' : { 'class': 'btn btn-chill-blue' } }) }} - {{ form_end(form) }} - - + {% embed '@ChillMain/CRUD/_new_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig b/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig index dc500642c..27fc4430b 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig @@ -1,25 +1,3 @@ -{# - * Copyright (C) 2014-2021, Champs Libres Cooperative SCRLFS, - / - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License -* along with this program. If not, see . -#} - -{# - The basic layout of Chill. All the page / template of Chill must use this template. -#} - diff --git a/src/Bundle/ChillMainBundle/Resources/views/layoutWithVerticalMenu.html.twig b/src/Bundle/ChillMainBundle/Resources/views/layoutWithVerticalMenu.html.twig index be582ab3b..c192eaaac 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/layoutWithVerticalMenu.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/layoutWithVerticalMenu.html.twig @@ -1,26 +1,3 @@ -{# - * Copyright (C) 2014-2021, Champs Libres Cooperative SCRLFS, - / - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -#} - -{# - Layout with a vertical menu and a conainer for the content (like admin, export) - ( for the vertical menu you can extends Menu/veticalMenu.html.twig ). -#} - {% extends "@ChillMain/layout.html.twig" %} {% block sublayout_content %} diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php index 96a63ff75..b943ce8da 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminSectionMenuBuilder.php @@ -23,7 +23,7 @@ use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; use Chill\MainBundle\Security\Authorization\ChillExportVoter; /** - * + * * */ class AdminSectionMenuBuilder implements LocalMenuBuilderInterface @@ -33,30 +33,31 @@ class AdminSectionMenuBuilder implements LocalMenuBuilderInterface * @var AuthorizationCheckerInterface */ protected $authorizationChecker; - + public function __construct(AuthorizationCheckerInterface $authorizationChecker) { $this->authorizationChecker = $authorizationChecker; } - + public function buildMenu($menuId, MenuItem $menu, array $parameters) { // all the entries below must have ROLE_ADMIN permissions if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { return; } - + $menu->addChild('Users and permissions', [ 'route' => 'chill_main_admin_permissions' ]) ->setExtras([ 'icons' => ['key'], - 'order' => 200 + 'order' => 200, + 'explain' => "Configure permissions for users" ]); } public static function getMenuIds(): array { - return [ 'admin_section' ]; + return [ 'admin_section', 'admin_index' ]; } } diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/PermissionMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/PermissionMenuBuilder.php new file mode 100644 index 000000000..470930820 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/PermissionMenuBuilder.php @@ -0,0 +1,43 @@ +addChild('Permissions group list', [ + 'route' => 'admin_permissionsgroup' + ])->setExtras([ + 'order' => 300 + ]); + + $menu->addChild('crud.admin_user.index.title', [ + 'route' => 'chill_crud_admin_user_index' + ])->setExtras(['order' => 400]); + + $menu->addChild('List circles', [ + 'route' => 'admin_scope' + ])->setExtras(['order' => 200]); + + $menu->addChild('Center list', [ + 'route' => 'admin_center' + ])->setExtras(['order' => 100]); + + $menu->addChild('User jobs', [ + 'route' => 'chill_crud_admin_user_job_index' + ])->setExtras(['order' => 150]); + + } +} diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/UserControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/UserControllerTest.php index 1953439dd..0017fbb4e 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/UserControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/UserControllerTest.php @@ -2,12 +2,17 @@ namespace Chill\MainBundle\Tests\Controller; +use Chill\MainBundle\Entity\User; +use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; +use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface; class UserControllerTest extends WebTestCase { private $client; + private array $toDelete = []; + public function setUp() { self::bootKernel(); @@ -22,18 +27,14 @@ class UserControllerTest extends WebTestCase public function testList() { // get the list - $crawler = $this->client->request('GET', '/fr/admin/user/'); + $crawler = $this->client->request('GET', '/fr/admin/main/user'); $this->assertEquals(200, $this->client->getResponse()->getStatusCode(), - "Unexpected HTTP status code for GET /admin/user/"); - - $link = $crawler->selectLink('Ajouter un nouvel utilisateur')->link(); - $this->assertInstanceOf('Symfony\Component\DomCrawler\Link', $link); - $this->assertRegExp('|/fr/admin/user/new$|', $link->getUri()); + "Unexpected HTTP status code for GET /admin/main/user"); } public function testNew() { - $crawler = $this->client->request('GET', '/fr/admin/user/new'); + $crawler = $this->client->request('GET', '/fr/admin/main/user/new'); $username = 'Test_user'. uniqid(); $password = 'Password1234!'; @@ -54,22 +55,15 @@ class UserControllerTest extends WebTestCase $this->assertGreaterThan(0, $crawler->filter('td:contains("Test_user")')->count(), 'Missing element td:contains("Test user")'); - $update = $crawler->selectLink('Modifier')->link(); - - $this->assertInstanceOf('Symfony\Component\DomCrawler\Link', $update); - $this->assertRegExp('|/fr/admin/user/[0-9]{1,}/edit$|', $update->getUri()); - //test the auth of the new client $this->isPasswordValid($username, $password); - - return $update; } protected function isPasswordValid($username, $password) { /* @var $passwordEncoder \Symfony\Component\Security\Core\Encoder\UserPasswordEncoder */ - $passwordEncoder = self::$kernel->getContainer() - ->get('security.password_encoder'); + $passwordEncoder = self::$container + ->get(UserPasswordEncoderInterface::class); $user = self::$kernel->getContainer() ->get('doctrine.orm.entity_manager') @@ -81,46 +75,33 @@ class UserControllerTest extends WebTestCase /** * - * @param \Symfony\Component\DomCrawler\Link $update - * @depends testNew + * @dataProvider dataGenerateUserId */ - public function testUpdate(\Symfony\Component\DomCrawler\Link $update) + public function testUpdate(int $userId, string $username) { - $crawler = $this->client->click($update); + $crawler = $this->client->request('GET', "/fr/admin/main/user/$userId/edit"); $username = 'Foo bar '.uniqid(); - $form = $crawler->selectButton('Mettre à jour')->form(array( + $form = $crawler->selectButton('Enregistrer & fermer')->form(array( 'chill_mainbundle_user[username]' => $username, )); $this->client->submit($form); $crawler = $this->client->followRedirect(); // Check the element contains an attribute with value equals "Foo" - $this->assertGreaterThan(0, $crawler->filter('[value="'.$username.'"]')->count(), - 'Missing element [value="Foo bar"]'); - - $updatePassword = $crawler->selectLink('Modifier le mot de passe')->link(); - - $this->assertInstanceOf('Symfony\Component\DomCrawler\Link', $updatePassword); - $this->assertRegExp('|/fr/admin/user/[0-9]{1,}/edit_password$|', - $updatePassword->getUri()); - - return array('link' => $updatePassword, 'username' => $username); + $this->assertGreaterThan(0, $crawler->filter('[data-username="'.$username.'"]')->count(), + 'Missing element [data-username="Foo bar"]'); } /** * - * @param \Symfony\Component\DomCrawler\Link $updatePassword - * @depends testUpdate + * @dataProvider dataGenerateUserId */ - public function testUpdatePassword(array $params) + public function testUpdatePassword(int $userId, $username) { - $link = $params['link']; - $username = $params['username']; + $crawler = $this->client->request('GET', "/fr/admin/user/$userId/edit_password"); $newPassword = '1234Password!'; - $crawler = $this->client->click($link); - $form = $crawler->selectButton('Changer le mot de passe')->form(array( 'chill_mainbundle_user_password[new_password][first]' => $newPassword, 'chill_mainbundle_user_password[new_password][second]' => $newPassword, @@ -130,10 +111,38 @@ class UserControllerTest extends WebTestCase $this->assertTrue($this->client->getResponse()->isRedirect(), "the response is a redirection"); - $this->client->followRedirect(); $this->isPasswordValid($username, $newPassword); } + protected function tearDown() + { + self::bootKernel(); + $em = self::$container->get(EntityManagerInterface::class); + foreach ($this->toDelete as list($class, $id)) { + $obj = $em->getRepository($class)->find($id); + $em->remove($obj); + } + + $em->flush(); + } + + public function dataGenerateUserId() + { + self::bootKernel(); + $em = self::$container->get(EntityManagerInterface::class); + + $user = new User(); + $user->setUsername('Test_user '.uniqid()); + $user->setPassword(self::$container->get(UserPasswordEncoderInterface::class)->encodePassword($user, + 'password')); + + $em->persist($user); + $em->flush(); + + $this->toDelete[] = [User::class, $user->getId()]; + + yield [ $user->getId(), $user->getUsername() ]; + } } diff --git a/src/Bundle/ChillMainBundle/config/routes.yaml b/src/Bundle/ChillMainBundle/config/routes.yaml index 697ec8ec0..9a155f6e6 100644 --- a/src/Bundle/ChillMainBundle/config/routes.yaml +++ b/src/Bundle/ChillMainBundle/config/routes.yaml @@ -6,10 +6,6 @@ chill_main_admin_permissionsgroup: resource: "@ChillMainBundle/config/routes/permissionsgroup.yaml" prefix: "{_locale}/admin/permissionsgroup" -chill_main_admin_user: - resource: "@ChillMainBundle/config/routes/user.yaml" - prefix: "{_locale}/admin/user" - chill_main_admin_scope: resource: "@ChillMainBundle/config/routes/scope.yaml" prefix: "{_locale}/admin/scope" @@ -57,15 +53,15 @@ chill_main_homepage: path: /{_locale}/homepage controller: Chill\MainBundle\Controller\DefaultController::indexAction -chill_main_admin_central: - path: /{_locale}/admin - controller: Chill\MainBundle\Controller\AdminController::indexAction - options: - menus: - admin_permissions: - order: 0 - label: Main admin menu - +# chill_main_admin_central: +# path: /{_locale}/admin +# controller: Chill\MainBundle\Controller\AdminController::indexAction +# options: +# menus: +# admin_permissions: +# order: 0 +# label: Main admin menu +# chill_main_admin_permissions: path: /{_locale}/admin/permissions controller: Chill\MainBundle\Controller\AdminController::indexPermissionsAction diff --git a/src/Bundle/ChillMainBundle/config/routes/center.yaml b/src/Bundle/ChillMainBundle/config/routes/center.yaml index 69b635cad..9dc322bc1 100644 --- a/src/Bundle/ChillMainBundle/config/routes/center.yaml +++ b/src/Bundle/ChillMainBundle/config/routes/center.yaml @@ -1,11 +1,6 @@ admin_center: path: / controller: Chill\MainBundle\Controller\CenterController::indexAction - options: - menus: - admin_permissions: - order: 100 - label: Center list admin_center_show: path: /{id}/show @@ -14,11 +9,6 @@ admin_center_show: admin_center_new: path: /new controller: Chill\MainBundle\Controller\CenterController::newAction - options: - menus: - admin_permissions: - order: 101 - label: New center admin_center_create: path: /create diff --git a/src/Bundle/ChillMainBundle/config/routes/permissionsgroup.yaml b/src/Bundle/ChillMainBundle/config/routes/permissionsgroup.yaml index 42e3ea3c2..56f3a7569 100644 --- a/src/Bundle/ChillMainBundle/config/routes/permissionsgroup.yaml +++ b/src/Bundle/ChillMainBundle/config/routes/permissionsgroup.yaml @@ -1,11 +1,6 @@ admin_permissionsgroup: path: / controller: Chill\MainBundle\Controller\PermissionsGroupController::indexAction - options: - menus: - admin_permissions: - order: 300 - label: Permissions group list admin_permissionsgroup_show: path: /{id}/show @@ -14,11 +9,6 @@ admin_permissionsgroup_show: admin_permissionsgroup_new: path: /new controller: Chill\MainBundle\Controller\PermissionsGroupController::newAction - options: - menus: - admin_permissions: - order: 301 - label: New permission group admin_permissionsgroup_create: path: /create @@ -33,12 +23,12 @@ admin_permissionsgroup_update: path: /{id}/update controller: Chill\MainBundle\Controller\PermissionsGroupController::updateAction methods: [POST, PUT] - + admin_permissionsgroup_delete_role_scope: path: /{pgid}/delete_link_role_scope/{rsid} controller: Chill\MainBundle\Controller\PermissionsGroupController::deleteLinkRoleScopeAction methods: [DELETE] - + admin_permissionsgroup_add_role_scope: path: /{id}/add_link_role_scope controller: Chill\MainBundle\Controller\PermissionsGroupController::addLinkRoleScopeAction diff --git a/src/Bundle/ChillMainBundle/config/routes/scope.yaml b/src/Bundle/ChillMainBundle/config/routes/scope.yaml index cb27ec93b..c7ea32718 100644 --- a/src/Bundle/ChillMainBundle/config/routes/scope.yaml +++ b/src/Bundle/ChillMainBundle/config/routes/scope.yaml @@ -1,11 +1,6 @@ admin_scope: path: / controller: Chill\MainBundle\Controller\ScopeController::indexAction - options: - menus: - admin_permissions: - order: 200 - label: List circles admin_scope_show: path: /{id}/show @@ -14,11 +9,6 @@ admin_scope_show: admin_scope_new: path: /new controller: Chill\MainBundle\Controller\ScopeController::newAction - options: - menus: - admin_permissions: - order: 201 - label: New circle admin_scope_create: path: /create diff --git a/src/Bundle/ChillMainBundle/config/routes/user.yaml b/src/Bundle/ChillMainBundle/config/routes/user.yaml deleted file mode 100644 index 545496138..000000000 --- a/src/Bundle/ChillMainBundle/config/routes/user.yaml +++ /dev/null @@ -1,54 +0,0 @@ -admin_user: - path: / - controller: Chill\MainBundle\Controller\UserController::indexAction - options: - menus: - admin_permissions: - order: 400 - label: List users - -admin_user_show: - path: /{id}/show - controller: Chill\MainBundle\Controller\UserController::showAction - -admin_user_new: - path: /new - controller: Chill\MainBundle\Controller\UserController::newAction - options: - menus: - admin_permissions: - order: 401 - label: Add a new user - -admin_user_create: - path: /create - controller: Chill\MainBundle\Controller\UserController::createAction - methods: POST - -admin_user_edit: - path: /{id}/edit - controller: Chill\MainBundle\Controller\UserController::editAction - -admin_user_edit_password: - path: /{id}/edit_password - controller: Chill\MainBundle\Controller\UserController::editPasswordAction - -admin_user_update: - path: /{id}/update - controller: Chill\MainBundle\Controller\UserController::updateAction - methods: [POST, PUT] - -admin_user_update_password: - path: /{id}/update_password - controller: Chill\MainBundle\Controller\UserController::updatePasswordAction - methods: [POST, PUT] - -admin_user_delete_group_center: - path: /{uid}/delete_link_groupcenter/{gcid} - controller: Chill\MainBundle\Controller\UserController::deleteLinkGroupCenterAction - methods: [DELETE] - -admin_user_add_group_center: - path: /{uid}/add_link_groupcenter - controller: Chill\MainBundle\Controller\UserController::addLinkGroupCenterAction - methods: [POST] diff --git a/src/Bundle/ChillMainBundle/config/services/controller.yaml b/src/Bundle/ChillMainBundle/config/services/controller.yaml index 11a9bc274..a74755ffd 100644 --- a/src/Bundle/ChillMainBundle/config/services/controller.yaml +++ b/src/Bundle/ChillMainBundle/config/services/controller.yaml @@ -29,10 +29,8 @@ services: tags: ['controller.service_arguments'] Chill\MainBundle\Controller\UserController: - arguments: - $logger: '@Psr\Log\LoggerInterface' - $validator: '@Symfony\Component\Validator\Validator\ValidatorInterface' - tags: ['controller.service_arguments'] + autowire: true + autoconfigure: true Chill\MainBundle\Controller\NotificationController: arguments: diff --git a/src/Bundle/ChillMainBundle/config/services/menu.yaml b/src/Bundle/ChillMainBundle/config/services/menu.yaml index 91b481b51..cf31dccf1 100644 --- a/src/Bundle/ChillMainBundle/config/services/menu.yaml +++ b/src/Bundle/ChillMainBundle/config/services/menu.yaml @@ -1,17 +1,22 @@ services: + Chill\MainBundle\Routing\MenuBuilder\: + resource: '../../Routing/MenuBuilder' + autowire: true + autoconfigure: true + Chill\MainBundle\Routing\MenuBuilder\UserMenuBuilder: arguments: $tokenStorage: '@Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface' tags: - { name: 'chill.menu_builder' } - + Chill\MainBundle\Routing\MenuBuilder\SectionMenuBuilder: arguments: $authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface' $translator: '@Symfony\Component\Translation\TranslatorInterface' tags: - { name: 'chill.menu_builder' } - + Chill\MainBundle\Routing\MenuBuilder\AdminSectionMenuBuilder: arguments: $authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface' diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index f799f20b6..d99a565c1 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -143,10 +143,8 @@ The role '%role%' has been removed: Le rôle "%role%" a été enlevé de ce grou The role '%role%' on circle '%scope%' has been removed: Le rôle "%role%" sur le cercle "%scope%" a été enlevé de ce groupe de permission #admin section for users -List users: Liste des utilisateurs user list: Liste des utilisateurs User edit: Modification d'un utilisateur -User creation: Créer un utilisateur User'status: Statut de l'utilisateur Disabled, the user is not allowed to login: Désactivé, l'utilisateur n'est pas autorisé à se connecter Enabled, the user is active: Actif, l'utilisateur peut se connecter @@ -281,6 +279,16 @@ crud: success: Les données ont été enregistrées view: link_duplicate: Dupliquer + ## admin for users + admin_user: + index: + title: Utilisateurs + add_new: "Créer" + is_active: "Actif ?" + usernames: "Identifiants" + mains: "Champs principaux" + title_new: "Nouvel utilisateur" + title_edit: Modifier un utilisateur No entities: Aucun élément CHILL_FOO_SEE: Voir un élément diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php index 848e8f874..adc37d5b5 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php @@ -247,7 +247,6 @@ class LoadPeople extends AbstractFixture implements OrderedFixtureInterface, Con if (\random_int(0, 10) > 3) { // always add social scope: $accompanyingPeriod->addScope($this->getReference('scope_social')); - var_dump(count($accompanyingPeriod->getScopes())); $accompanyingPeriod->setAddressLocation($this->createAddress()); $manager->persist($accompanyingPeriod->getAddressLocation()); diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index 2b0b5edbd..69429219f 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -146,7 +146,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * groups={"general", "creation"} * ) */ - private ?\DateTimeImmutable $deathdate; + private ?\DateTimeImmutable $deathdate = null; /** * The person's place of birth diff --git a/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php index df70b9e64..d82f8604b 100644 --- a/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php @@ -66,7 +66,7 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface 'routeParameters' => [ 'id' => $period->getId() ]]) - ->setExtras(['order' => 40]); + ->setExtras(['order' => 50]); } diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php index d15e8cd7a..cd4f8c9ce 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php @@ -199,7 +199,7 @@ final class PersonACLAwareRepository implements PersonACLAwareRepositoryInterfac } if (NULL !== $birthdate) { - $qb->andWhere($qb->expr()->eq('s.birthdate', ':birthdate')) + $qb->andWhere($qb->expr()->eq('p.birthdate', ':birthdate')) ->setParameter('birthdate', $birthdate); } diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/banner.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/banner.html.twig index b405f9bae..e55b39f64 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/banner.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/banner.html.twig @@ -1,35 +1,36 @@ 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 5008ddfcf..000000000 Binary files a/src/Bundle/ChillReportBundle/Resources/test/Fixtures/.DS_Store and /dev/null differ