mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 03:23:48 +00:00
controller with crud logic + templates fixed for dispositif
This commit is contained in:
@@ -22,6 +22,7 @@ use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class CSPersonController extends OneToOneEntityPersonCRUDController
|
||||
{
|
||||
#[Route(path: '{_locale}/person/job/personal_situation/{id}/edit', name: 'chill_crud_job_personal_situation_edit')]
|
||||
public function personalSituationEdit(Request $request, $id): Response
|
||||
{
|
||||
return $this->formEditAction(
|
||||
@@ -32,6 +33,7 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
|
||||
);
|
||||
}
|
||||
|
||||
#[Route(path: '{_locale}/person/job/dispositifs/{id}/edit', name: 'chill_crud_job_dispositifs_edit')]
|
||||
public function dispositifsEdit(Request $request, $id)
|
||||
{
|
||||
return $this->formEditAction(
|
||||
@@ -42,13 +44,13 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
|
||||
);
|
||||
}
|
||||
|
||||
#[Route(path: '{_locale}/person/job/{person}/personal_situation', name: 'chill_job_personal_situation_view')]
|
||||
#[Route(path: '{_locale}/person/job/{person}/personal_situation', name: 'chill_crud_job_personal_situation_view')]
|
||||
public function personalSituationView(Request $request, $person): Response
|
||||
{
|
||||
return $this->viewAction('ps_situation_view', $request, $person);
|
||||
}
|
||||
|
||||
#[Route(path: '{_locale}/person/job/{person}/dispositifs', name: 'chill_job_dispositifs_view')]
|
||||
#[Route(path: '{_locale}/person/job/{person}/dispositifs', name: 'chill_crud_job_dispositifs_view')]
|
||||
public function dispositifsView(Request $request, $person): Response
|
||||
{
|
||||
return $this->viewAction('dispositifs_view', $request, $person);
|
||||
@@ -60,10 +62,10 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
|
||||
|
||||
switch ($action) {
|
||||
case 'ps_situation_view':
|
||||
$route = 'chill_crud_csperson_personal_situation_edit';
|
||||
$route = 'chill_crud_job_personal_situation_edit';
|
||||
break;
|
||||
case 'dispositifs_view':
|
||||
$route = 'chill_crud_csperson_dispositifs_edit';
|
||||
$route = 'chill_crud_job_dispositifs_edit';
|
||||
break;
|
||||
default:
|
||||
parent::generateRedirectOnCreateRoute($action, $request, $entity);
|
||||
@@ -91,12 +93,12 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
|
||||
{
|
||||
return match ($action) {
|
||||
'ps_situation_edit' => $this->redirectToRoute(
|
||||
'chill_crud_'.$this->getCrudName().'_personal_situation_view',
|
||||
['id' => $entity->getId()]
|
||||
'chill_crud_' .$this->getCrudName().'_personal_situation_view',
|
||||
['person' => $entity->getId()]
|
||||
),
|
||||
'dispositifs_edit' => $this->redirectToRoute(
|
||||
'chill_crud_'.$this->getCrudName().'_dispositifs_view',
|
||||
['id' => $entity->getId()]
|
||||
['person' => $entity->getId()]
|
||||
),
|
||||
default => null,
|
||||
};
|
||||
|
Reference in New Issue
Block a user