[closing motive] add an hierarchy + admin section for closing motives

This commit is contained in:
2020-03-12 12:19:15 +01:00
parent ceb3b5e955
commit e59f58f461
26 changed files with 712 additions and 41 deletions

View File

@@ -135,6 +135,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
$this->prependRoleHierarchy($container);
$this->prependHomepageWidget($container);
$this->prependDoctrineDQL($container);
$this->prependCruds($container);
$bundles = $container->getParameter('kernel.bundles');
//add ChillMain to assetic-enabled bundles
@@ -240,4 +241,33 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
)
));
}
protected function prependCruds(ContainerBuilder $container)
{
$container->prependExtensionConfig('chill_main', [
'cruds' => [
[
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class,
'name' => 'closing_motive',
'base_path' => '/admin/closing-motive',
'form_class' => \Chill\PersonBundle\Form\ClosingMotiveType::class,
'controller' => \Chill\PersonBundle\Controller\AdminClosingMotiveController::class,
'actions' => [
'index' => [
'template' => '@ChillPerson/ClosingMotive/index.html.twig',
'role' => 'ROLE_ADMIN'
],
'new' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillPerson/ClosingMotive/new.html.twig',
],
'edit' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillPerson/ClosingMotive/edit.html.twig',
]
]
]
]
]);
}
}