mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-03 21:34:59 +00:00
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user