diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php new file mode 100644 index 000000000..cfd677373 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php @@ -0,0 +1,63 @@ +render('@ChillPerson/AccompanyingCourse/index.html.twig', [ + 'accompanyingCourse' => $accompanyingCourse + ]); + } + + /** + * Show page of Accompanying Course section + * + * the page show all blocks except one active edit block, managed by vuejs component + * that's why title of page is 'edit accompanying course' + * + * @Route("/{_locale}/parcours/{accompanying_period_id}/show", name="chill_person_accompanying_course_show") + * @ParamConverter("accompanyingCourse", options={"id": "accompanying_period_id"}) + */ + public function showAction(AccompanyingPeriod $accompanyingCourse): Response + { + return $this->render('@ChillPerson/AccompanyingCourse/show.html.twig', [ + 'accompanyingCourse' => $accompanyingCourse + ]); + } + + /** + * History page of Accompanying Course section + * + * the page show anti chronologic history with all actions, title of page is 'accompanying course details' + * + * @Route("/{_locale}/parcours/{accompanying_period_id}/history", name="chill_person_accompanying_course_history") + * @ParamConverter("accompanyingCourse", options={"id": "accompanying_period_id"}) + */ + public function historyAction(AccompanyingPeriod $accompanyingCourse): Response + { + return $this->render('@ChillPerson/AccompanyingCourse/history.html.twig', [ + 'accompanyingCourse' => $accompanyingCourse + ]); + } +} + + diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php index 2b51e9191..5c862ee4f 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php @@ -88,8 +88,8 @@ class AccompanyingPeriodController extends AbstractController $this->denyAccessUnlessGranted(PersonVoter::UPDATE, $person, 'You are not allowed to update this person'); - $accompanyingPeriod = new AccompanyingPeriod(new \DateTimeImmutable('now')); - $accompanyingPeriod->setClosingDate(new \DateTimeImmutable('now')); + $accompanyingPeriod = new AccompanyingPeriod(new \DateTime('now')); + $accompanyingPeriod->setClosingDate(new \DateTime('now')); $accompanyingPeriod->addPerson($person); //or $person->addAccompanyingPeriod($accompanyingPeriod); diff --git a/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php new file mode 100644 index 000000000..74052e87c --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php @@ -0,0 +1,58 @@ +translator = $translator; + } + + public static function getMenuIds(): array + { + return [ 'accompanyingCourse' ]; + } + + public function buildMenu($menuId, MenuItem $menu, array $parameters): void + { + $menu->addChild($this->translator->trans('Resume Accompanying Course'), [ + 'route' => 'chill_person_accompanying_course_index', + 'routeParameters' => [ + 'accompanying_period_id' => $parameters['accompanyingCourse']->getId() + ]]) + ->setExtras(['order' => 10]); + + $menu->addChild($this->translator->trans('Edit Accompanying Course'), [ + 'route' => 'chill_person_accompanying_course_show', + 'routeParameters' => [ + 'accompanying_period_id' => $parameters['accompanyingCourse']->getId() + ]]) + ->setExtras(['order' => 20]); + + $menu->addChild($this->translator->trans('Accompanying Course Details'), [ + 'route' => 'chill_person_accompanying_course_history', + 'routeParameters' => [ + 'accompanying_period_id' => $parameters['accompanyingCourse']->getId() + ]]) + ->setExtras(['order' => 30]); + } + + +} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/banner.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/banner.html.twig new file mode 100644 index 000000000..6ddb46246 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/banner.html.twig @@ -0,0 +1,41 @@ +
+
+
+ +
{% set title = title %} +

+ + {{ 'Accompanying Course'|trans }}{# ou défini en amont + {{ title|default('Accompanying Course'|trans)|raw }} #} + (n°{{ accompanyingCourse.id }}) +

+
+ +
+
    +
  • ponctuel régulier
  • +
  • ouvert
  • +
  • en file active
  • +
  • urgent
  • +
+
+ +
+

+ ouvert le 11 avril 2019
+ par Soline Maillet | SIPAS +

+
+ +
+
+
+
+ +
Problématiques sociales
+
_
+
_
+ +
+
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/history.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/history.html.twig new file mode 100644 index 000000000..8d6ee2a30 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/history.html.twig @@ -0,0 +1,26 @@ +{% extends 'ChillPersonBundle:AccompanyingCourse:layout.html.twig' %} + +{% block title %} + {{ 'Accompanying Course Details'|trans }} +{% endblock %} + +{% block content %} + +

{{ block('title') }}

+ +
+{{ accompanyingCourse.id }}
+{{ accompanyingCourse.openingDate|format_date('short') }}
+{{ accompanyingCourse.closingDate|format_date('short') }}
+{{ accompanyingCourse.closingMotive|chill_entity_render_box }}
+{{ accompanyingCourse.remark|raw }}
+{{ accompanyingCourse.user }}
+usagers:
+{% for p in accompanyingCourse.participations %}
+    {{ p.person.id }} | {{ p.person.fullnamecanonical }} | {{ p.startdate|format_date('short') }} | {{ p.enddate|format_date('short') }}
+{% endfor %}
+    
+ + {{ dump() }} + +{% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig new file mode 100644 index 000000000..82f7102fd --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig @@ -0,0 +1,26 @@ +{% extends 'ChillPersonBundle:AccompanyingCourse:layout.html.twig' %} + +{% block title %} + {{ 'Resume Accompanying Course'|trans }} +{% endblock %} + +{% block content %} + +

{{ block('title') }}

+ +
+{{ accompanyingCourse.id }}
+{{ accompanyingCourse.openingDate|format_date('short') }}
+{{ accompanyingCourse.closingDate|format_date('short') }}
+{{ accompanyingCourse.closingMotive|chill_entity_render_box }}
+{{ accompanyingCourse.remark|raw }}
+{{ accompanyingCourse.user }}
+usagers:
+{% for p in accompanyingCourse.participations %}
+    {{ p.person.id }} | {{ p.person.fullnamecanonical }} | {{ p.startdate|format_date('short') }} | {{ p.enddate|format_date('short') }}
+{% endfor %}
+    
+ + {{ dump() }} + +{% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/layout.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/layout.html.twig new file mode 100644 index 000000000..3e880fb62 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/layout.html.twig @@ -0,0 +1,47 @@ +{% extends "ChillMainBundle::layoutWithVerticalMenu.html.twig" %} + +{% block top_banner %} + {{ include('ChillPersonBundle:AccompanyingCourse:banner.html.twig', { title: block('title') }) }} +{% endblock %} + +{% block layout_wvm_content %} + {% block content %}{% endblock %} +{% endblock %} + +{% block vertical_menu_content %} + {{ chill_menu('accompanyingCourse', { + 'layout': 'ChillPersonBundle:AccompanyingCourse:menu.html.twig', + 'args' : { 'accompanyingCourse': accompanyingCourse } + }) }} +{% endblock %} + +{% block css %} + +{% endblock %} + +{% block js %} +{% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/menu.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/menu.html.twig new file mode 100644 index 000000000..a60abe7eb --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/menu.html.twig @@ -0,0 +1,7 @@ + diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/show.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/show.html.twig new file mode 100644 index 000000000..80c08c854 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/show.html.twig @@ -0,0 +1,27 @@ +{% extends 'ChillPersonBundle:AccompanyingCourse:layout.html.twig' %} + +{% block title %} + {{ 'Edit Accompanying Course'|trans }} +{% endblock %} + +{% block content %} + +

{{ block('title') }}

+ +
+{{ accompanyingCourse.id }}
+{{ accompanyingCourse.openingDate|format_date('short') }}
+{{ accompanyingCourse.closingDate|format_date('short') }}
+{{ accompanyingCourse.closingMotive|chill_entity_render_box }}
+{{ accompanyingCourse.remark|raw }}
+{{ accompanyingCourse.user }}
+usagers:
+{% for p in accompanyingCourse.participations %}
+    {{ p.person.id }} | {{ p.person.fullnamecanonical }} | {{ p.startdate|format_date('short') }} | {{ p.enddate|format_date('short') }}
+{% endfor %}
+    
+ + {{ dump() }} + + +{% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/list.html.twig index c0c50dbab..05e4702aa 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/list.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/list.html.twig @@ -18,7 +18,7 @@ {{ 'Remark'|trans }}   - + {% for accompanying_period in accompanying_periods %} @@ -27,7 +27,7 @@ {% if accompanying_period.closingDate == null %} {{ 'accompanying_period.dates_from_%opening_date%'|trans({ '%opening_date%': accompanying_period.openingDate|format_date('long') } ) }} {% else %} - {{ 'accompanying_period.dates_from_%opening_date%_to_%closing_date%'|trans({ + {{ 'accompanying_period.dates_from_%opening_date%_to_%closing_date%'|trans({ '%opening_date%': accompanying_period.openingDate|format_date('long'), '%closing_date%': accompanying_period.closingDate|format_date('long')} ) }} @@ -61,6 +61,12 @@ - + {% endfor %} @@ -106,7 +112,7 @@ {% endif %} - + {% endblock personcontent %} diff --git a/src/Bundle/ChillPersonBundle/config/routes.yaml b/src/Bundle/ChillPersonBundle/config/routes.yaml index 6af0a17ab..cd0de3ea3 100644 --- a/src/Bundle/ChillPersonBundle/config/routes.yaml +++ b/src/Bundle/ChillPersonBundle/config/routes.yaml @@ -50,11 +50,11 @@ chill_person_accompanying_period_close: chill_person_accompanying_period_open: path: /{_locale}/person/{person_id}/accompanying-period/open controller: Chill\PersonBundle\Controller\AccompanyingPeriodController::openAction - + chill_person_accompanying_period_re_open: path: /{_locale}/person/{person_id}/accompanying-period/{period_id}/re-open controller: Chill\PersonBundle\Controller\AccompanyingPeriodController::reOpenAction - + chill_person_address_list: path: /{_locale}/person/{person_id}/address/list controller: Chill\PersonBundle\Controller\PersonAddressController::listAction @@ -63,15 +63,15 @@ chill_person_address_create: path: /{_locale}/person/{person_id}/address/create controller: Chill\PersonBundle\Controller\PersonAddressController::createAction methods: [POST] - + chill_person_address_new: path: /{_locale}/person/{person_id}/address/new controller: Chill\PersonBundle\Controller\PersonAddressController::newAction - + chill_person_address_edit: path: /{_locale}/person/{person_id}/address/{address_id}/edit controller: Chill\PersonBundle\Controller\PersonAddressController::editAction - + chill_person_address_update: path: /{_locale}/person/{person_id}/address/{address_id}/update controller: Chill\PersonBundle\Controller\PersonAddressController::updateAction @@ -84,7 +84,7 @@ chill_person_timeline: person: order: 60 label: Timeline - + chill_person_admin: path: "/{_locale}/admin/person" controller: Chill\PersonBundle\Controller\AdminController::indexAction @@ -135,3 +135,7 @@ chill_person_maritalstatus_admin: admin_person: order: 120 label: 'person_admin.marital status' + +chill_person_controllers: + resource: "@ChillPersonBundle/Controller" + type: annotation diff --git a/src/Bundle/ChillPersonBundle/config/services/menu.yaml b/src/Bundle/ChillPersonBundle/config/services/menu.yaml index 63d65a5b3..e94a81572 100644 --- a/src/Bundle/ChillPersonBundle/config/services/menu.yaml +++ b/src/Bundle/ChillPersonBundle/config/services/menu.yaml @@ -3,18 +3,24 @@ services: arguments: $authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface' $translator: '@Symfony\Component\Translation\TranslatorInterface' - tags: + tags: - { name: 'chill.menu_builder' } - + Chill\PersonBundle\Menu\AdminMenuBuilder: arguments: $authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface' - tags: + tags: - { name: 'chill.menu_builder' } - + Chill\PersonBundle\Menu\PersonMenuBuilder: arguments: $showAccompanyingPeriod: '%chill_person.accompanying_period%' $translator: '@Symfony\Contracts\Translation\TranslatorInterface' - tags: + tags: + - { name: 'chill.menu_builder' } + + Chill\PersonBundle\Menu\AccompanyingCourseMenuBuilder: + arguments: + $translator: '@Symfony\Contracts\Translation\TranslatorInterface' + tags: - { name: 'chill.menu_builder' } diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 373fd668c..1fe6e3956 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -292,3 +292,12 @@ accompanying_period: dates_from_%opening_date%_to_%closing_date%: Ouvert du %opening_date% au %closing_date% occasional: ponctuel regular: régulier + +# Accompanying Course +Accompanying Course: Parcours d'accompagnement +Accompanying Course Details: Détails du parcours +Resume Accompanying Course: Résumé du parcours +Show Accompanying Course: Voir le parcours +Edit Accompanying Course: Modifier le parcours +Create Accompanying Course: Créer un nouveau parcours +Drop Accompanying Course: Supprimer le parcours