mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Merge branch 'issue180_activity_coherence' into 'master'
activity: edit an activity: choose the context based on the activity, not the url parameters See merge request Chill-Projet/chill-bundles!226
This commit is contained in:
commit
2102e65729
@ -105,18 +105,19 @@ final class ActivityController extends AbstractController
|
|||||||
|
|
||||||
[$person, $accompanyingPeriod] = $this->getEntity($request);
|
[$person, $accompanyingPeriod] = $this->getEntity($request);
|
||||||
|
|
||||||
if ($accompanyingPeriod instanceof AccompanyingPeriod) {
|
|
||||||
$view = 'ChillActivityBundle:Activity:confirm_deleteAccompanyingCourse.html.twig';
|
|
||||||
} elseif ($person instanceof Person) {
|
|
||||||
$view = 'ChillActivityBundle:Activity:confirm_deletePerson.html.twig';
|
|
||||||
}
|
|
||||||
|
|
||||||
$activity = $this->activityRepository->find($id);
|
$activity = $this->activityRepository->find($id);
|
||||||
|
|
||||||
if (!$activity) {
|
if (!$activity) {
|
||||||
throw $this->createNotFoundException('Unable to find Activity entity.');
|
throw $this->createNotFoundException('Unable to find Activity entity.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($activity->getAccompanyingPeriod() instanceof AccompanyingPeriod) {
|
||||||
|
$view = 'ChillActivityBundle:Activity:confirm_deleteAccompanyingCourse.html.twig';
|
||||||
|
$accompanyingPeriod = $activity->getAccompanyingPeriod();
|
||||||
|
} else {
|
||||||
|
$view = 'ChillActivityBundle:Activity:confirm_deletePerson.html.twig';
|
||||||
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
// $this->denyAccessUnlessGranted('CHILL_ACTIVITY_DELETE', $activity);
|
// $this->denyAccessUnlessGranted('CHILL_ACTIVITY_DELETE', $activity);
|
||||||
|
|
||||||
@ -176,18 +177,18 @@ final class ActivityController extends AbstractController
|
|||||||
|
|
||||||
[$person, $accompanyingPeriod] = $this->getEntity($request);
|
[$person, $accompanyingPeriod] = $this->getEntity($request);
|
||||||
|
|
||||||
if ($accompanyingPeriod instanceof AccompanyingPeriod) {
|
|
||||||
$view = 'ChillActivityBundle:Activity:editAccompanyingCourse.html.twig';
|
|
||||||
} elseif ($person instanceof Person) {
|
|
||||||
$view = 'ChillActivityBundle:Activity:editPerson.html.twig';
|
|
||||||
}
|
|
||||||
|
|
||||||
$entity = $this->activityRepository->find($id);
|
$entity = $this->activityRepository->find($id);
|
||||||
|
|
||||||
if (null === $entity) {
|
if (null === $entity) {
|
||||||
throw $this->createNotFoundException('Unable to find Activity entity.');
|
throw $this->createNotFoundException('Unable to find Activity entity.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($entity->getAccompanyingPeriod() instanceof AccompanyingPeriod) {
|
||||||
|
$view = 'ChillActivityBundle:Activity:editAccompanyingCourse.html.twig';
|
||||||
|
$accompanyingPeriod = $entity->getAccompanyingPeriod();
|
||||||
|
} else {
|
||||||
|
$view = 'ChillActivityBundle:Activity:editPerson.html.twig';
|
||||||
|
}
|
||||||
// TODO
|
// TODO
|
||||||
// $this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity);
|
// $this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity);
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
<dt class="inline">{{ 'Social issues'|trans }}</dt>
|
<dt class="inline">{{ 'Social issues'|trans }}</dt>
|
||||||
<dd>
|
<dd>
|
||||||
{% if entity.socialIssues|length == 0 %}
|
{% if entity.socialIssues|length == 0 %}
|
||||||
<p class="chill-no-data-statement">{{ 'Any social issues'|trans }}</p>
|
<p class="chill-no-data-statement">{{ 'No social issues associated'|trans }}</p>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% for si in entity.socialIssues %}{{ si|chill_entity_render_box }}{% endfor %}
|
{% for si in entity.socialIssues %}{{ si|chill_entity_render_box }}{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -38,7 +38,7 @@
|
|||||||
<dt class="inline">{{ 'Social actions'|trans }}</dt>
|
<dt class="inline">{{ 'Social actions'|trans }}</dt>
|
||||||
<dd>
|
<dd>
|
||||||
{% if entity.socialActions|length == 0 %}
|
{% if entity.socialActions|length == 0 %}
|
||||||
<p class="chill-no-data-statement">{{ 'Any social actions'|trans }}</p>
|
<p class="chill-no-data-statement">{{ 'No social actions associated'|trans }}</p>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% for sa in entity.socialActions %}{{ sa|chill_entity_render_box }}{% endfor %}
|
{% for sa in entity.socialActions %}{{ sa|chill_entity_render_box }}{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -43,6 +43,7 @@ Sent: Envoyer
|
|||||||
Received: Recevoir
|
Received: Recevoir
|
||||||
by: 'Par '
|
by: 'Par '
|
||||||
location: Lieu
|
location: Lieu
|
||||||
|
Reasons: Sujets
|
||||||
|
|
||||||
|
|
||||||
#forms
|
#forms
|
||||||
|
Loading…
x
Reference in New Issue
Block a user