Add a link between accompanying period and user

It is now allowed to indicates who make/made the accompanying period.

This feature may be hidden by a specific configuration option. Default
to visible.
This commit is contained in:
2019-07-01 15:21:34 +02:00
parent 5b60415166
commit 19cc54a674
13 changed files with 173 additions and 31 deletions

View File

@@ -79,8 +79,13 @@ class AccompanyingPeriodController extends Controller
$person->addAccompanyingPeriod(
$accompanyingPeriod);
$form = $this->createForm(AccompanyingPeriodType::class,
$accompanyingPeriod, array('period_action' => 'create'));
$form = $this->createForm(
AccompanyingPeriodType::class,
$accompanyingPeriod,
[
'period_action' => 'create',
'center' => $person->getCenter()
]);
if ($request->getMethod() === 'POST') {
$form->handleRequest($request);
@@ -135,7 +140,8 @@ class AccompanyingPeriodController extends Controller
'You are not allowed to update this person');
$form = $this->createForm(AccompanyingPeriodType::class,
$accompanyingPeriod, array('period_action' => 'update'));
$accompanyingPeriod, array('period_action' => 'update',
'center' => $person->getCenter()));
if ($request->getMethod() === 'POST') {
$form->handleRequest($request);
@@ -190,7 +196,8 @@ class AccompanyingPeriodController extends Controller
$current = $person->getCurrentAccompanyingPeriod();
$form = $this->createForm(AccompanyingPeriodType::class, $current, array(
'period_action' => 'close'
'period_action' => 'close',
'center' => $person->getCenter()
));
if ($request->getMethod() === 'POST') {
@@ -286,7 +293,8 @@ class AccompanyingPeriodController extends Controller
$accompanyingPeriod = new AccompanyingPeriod(new \DateTime());
$form = $this->createForm(AccompanyingPeriodType::class,
$accompanyingPeriod, array('period_action' => 'open'));
$accompanyingPeriod, array('period_action' => 'open',
'center' => $person->getCenter()));
if ($request->getMethod() === 'POST') {
$form->handleRequest($request);