mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
rdv: rdv -> activity: pass calendar data to new activity controller
This commit is contained in:
@@ -215,10 +215,28 @@ class CalendarController extends AbstractController
|
||||
throw $this->createNotFoundException('Template not found');
|
||||
}
|
||||
|
||||
$personsId = [];
|
||||
foreach ($entity->getPersons() as $p) {
|
||||
array_push($personsId, $p->getId());
|
||||
}
|
||||
|
||||
$professionalsId = [];
|
||||
foreach ($entity->getProfessionals() as $p) {
|
||||
array_push($professionalsId, $p->getId());
|
||||
}
|
||||
|
||||
$activityData = [
|
||||
'personsId' => $personsId,
|
||||
'professionalsId' => $professionalsId,
|
||||
'date' => $entity->getStartDate()->format('Y-m-d'),
|
||||
'durationTime' => $entity->getEndDate()->diff($entity->getStartDate())->format("%H:%M")
|
||||
];
|
||||
|
||||
return $this->render($view, [
|
||||
'accompanyingCourse' => $accompanyingPeriod,
|
||||
'entity' => $entity,
|
||||
'user' => $user
|
||||
'user' => $user,
|
||||
'activityData' => $activityData
|
||||
//'delete_form' => $deleteForm->createView(),
|
||||
]);
|
||||
}
|
||||
|
@@ -65,13 +65,21 @@
|
||||
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<li class="cancel">
|
||||
<a class="btn btn-cancel" href="{{ path('chill_calendar_calendar_list', { 'accompanying_period_id': accompanying_course_id, 'user_id': user_id } ) }}">
|
||||
<a class="btn btn-cancel" href="{{ path('chill_calendar_calendar_list',
|
||||
{ 'accompanying_period_id': accompanying_course_id, 'user_id': user_id }) }}">
|
||||
{{ 'Back to the list'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-create" href="{{ chill_path_add_return_path('chill_activity_activity_new',
|
||||
{ 'accompanying_period_id': accompanying_course_id, 'activityData': activityData }) }}">
|
||||
{{ 'Transform to activity'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
{% if accompanyingCourse %}
|
||||
<li>
|
||||
<a class="btn btn-update" href="{{ path('chill_calendar_calendar_edit', { 'id': entity.id, 'accompanying_period_id': accompanying_course_id }) }}">
|
||||
<a class="btn btn-update" href="{{ path('chill_calendar_calendar_edit',
|
||||
{ 'id': entity.id, 'accompanying_period_id': accompanying_course_id }) }}">
|
||||
{{ 'Edit'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
|
@@ -23,4 +23,5 @@ Add a new calendar: Ajouter un nouveau rendez-vous
|
||||
"Success : calendar item created!": "Rendez-vous créé"
|
||||
The calendar item has been successfully removed.: Le rendez-vous a été supprimé
|
||||
From the day: Du
|
||||
to the day: au
|
||||
to the day: au
|
||||
Transform to activity: Transformer en échange
|
Reference in New Issue
Block a user