mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
admin sections for person bundle
This commit is contained in:
parent
1a764025e1
commit
0f735c5749
@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace Chill\PersonBundle\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* Class AdminController.
|
||||
@ -25,4 +26,36 @@ class AdminController extends AbstractController
|
||||
{
|
||||
return $this->redirectToRoute('chill_main_admin_central');
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/admin/accompanying-course", name="chill_accompanying-course_admin_index")
|
||||
*/
|
||||
public function indexAccompanyingCourseAdminAction()
|
||||
{
|
||||
return $this->render('ChillPersonBundle:Admin:indexAccompanyingCourse.html.twig');
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/admin/household", name="chill_household_admin_index")
|
||||
*/
|
||||
public function indexHouseholdAdminAction()
|
||||
{
|
||||
return $this->render('ChillPersonBundle:Admin:indexHousehold.html.twig');
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/admin/person", name="chill_person_admin_index")
|
||||
*/
|
||||
public function indexPersonAdminAction()
|
||||
{
|
||||
return $this->render('ChillPersonBundle:Admin:indexPerson.html.twig');
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/admin/social-work", name="chill_social-work_admin_index")
|
||||
*/
|
||||
public function indexSocialWorkAdminAction()
|
||||
{
|
||||
return $this->render('ChillPersonBundle:Admin:indexSocialWork.html.twig');
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Menu;
|
||||
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
|
||||
class AdminAccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
/**
|
||||
* @var AuthorizationCheckerInterface
|
||||
*/
|
||||
protected $authorizationChecker;
|
||||
|
||||
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
|
||||
{
|
||||
$this->authorizationChecker = $authorizationChecker;
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$menu->addChild('person_admin.accompanying_period', [
|
||||
'route' => 'chill_accompanying-course_admin_index',
|
||||
])
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras(['order' => 2200, 'header' => true]);
|
||||
|
||||
$menu->addChild('person_admin.closing motives', [
|
||||
'route' => 'chill_crud_closing_motive_index',
|
||||
])->setExtras(['order' => 2210]);
|
||||
|
||||
$menu->addChild('person_admin.origin', [
|
||||
'route' => 'chill_crud_origin_index',
|
||||
])->setExtras(['order' => 2210]);
|
||||
|
||||
}
|
||||
|
||||
public static function getMenuIds(): array
|
||||
{
|
||||
return ['admin_section', 'admin_accompanying_course'];
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Menu;
|
||||
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
|
||||
class AdminHouseholdMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
/**
|
||||
* @var AuthorizationCheckerInterface
|
||||
*/
|
||||
protected $authorizationChecker;
|
||||
|
||||
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
|
||||
{
|
||||
$this->authorizationChecker = $authorizationChecker;
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$menu->addChild('Household', [
|
||||
'route' => 'chill_household_admin_index',
|
||||
])
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras(['order' => 2100, 'header' => true]);
|
||||
|
||||
$menu->addChild('Position', [
|
||||
'route' => 'chill_crud_person_household_position_index',
|
||||
])->setExtras(['order' => 2110]);
|
||||
|
||||
$menu->addChild('person_admin.relation', [
|
||||
'route' => 'chill_crud_person_relation_index',
|
||||
])->setExtras(['order' => 2120]);
|
||||
|
||||
}
|
||||
|
||||
public static function getMenuIds(): array
|
||||
{
|
||||
return ['admin_section', 'admin_household'];
|
||||
}
|
||||
}
|
60
src/Bundle/ChillPersonBundle/Menu/AdminPersonMenuBuilder.php
Normal file
60
src/Bundle/ChillPersonBundle/Menu/AdminPersonMenuBuilder.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Menu;
|
||||
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
|
||||
class AdminPersonMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
/**
|
||||
* @var AuthorizationCheckerInterface
|
||||
*/
|
||||
protected $authorizationChecker;
|
||||
|
||||
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
|
||||
{
|
||||
$this->authorizationChecker = $authorizationChecker;
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$menu->addChild('Person', [
|
||||
'route' => 'chill_person_admin_index',
|
||||
])
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras(['order' => 2000, 'header' => true]);
|
||||
|
||||
$menu->addChild('Civility', [
|
||||
'route' => 'chill_crud_main_civility_index',
|
||||
])->setExtras(['order' => 2010]);
|
||||
|
||||
$menu->addChild('Marital status', [
|
||||
'route' => 'chill_crud_person_marital-status_index',
|
||||
])->setExtras(['order' => 2020]);
|
||||
|
||||
$menu->addChild('person_admin.person_resource_kind', [
|
||||
'route' => 'chill_crud_person_resource-kind_index',
|
||||
])->setExtras(['order' => 2030]);
|
||||
|
||||
}
|
||||
|
||||
public static function getMenuIds(): array
|
||||
{
|
||||
return ['admin_section', 'admin_person'];
|
||||
}
|
||||
}
|
@ -15,7 +15,7 @@ use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
|
||||
class AdminMenuBuilder implements LocalMenuBuilderInterface
|
||||
class AdminSocialWorkMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
/**
|
||||
* @var AuthorizationCheckerInterface
|
||||
@ -33,47 +33,9 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface
|
||||
return;
|
||||
}
|
||||
|
||||
$menu->addChild('Person')
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras(['order' => 2000, 'header' => true]);
|
||||
|
||||
$menu->addChild('Civility', [
|
||||
'route' => 'chill_crud_main_civility_index',
|
||||
])->setExtras(['order' => 2010]);
|
||||
|
||||
$menu->addChild('Marital status', [
|
||||
'route' => 'chill_crud_person_marital-status_index',
|
||||
])->setExtras(['order' => 2020]);
|
||||
|
||||
$menu->addChild('person_admin.person_resource_kind', [
|
||||
'route' => 'chill_crud_person_resource-kind_index',
|
||||
])->setExtras(['order' => 2030]);
|
||||
|
||||
$menu->addChild('Household')
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras(['order' => 2100, 'header' => true]);
|
||||
|
||||
$menu->addChild('Position', [
|
||||
'route' => 'chill_crud_person_household_position_index',
|
||||
])->setExtras(['order' => 2110]);
|
||||
|
||||
$menu->addChild('person_admin.relation', [
|
||||
'route' => 'chill_crud_person_relation_index',
|
||||
])->setExtras(['order' => 2120]);
|
||||
|
||||
$menu->addChild('person_admin.accompanying_period')
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras(['order' => 2200, 'header' => true]);
|
||||
|
||||
$menu->addChild('person_admin.closing motives', [
|
||||
'route' => 'chill_crud_closing_motive_index',
|
||||
])->setExtras(['order' => 2210]);
|
||||
|
||||
$menu->addChild('person_admin.origin', [
|
||||
'route' => 'chill_crud_origin_index',
|
||||
])->setExtras(['order' => 2210]);
|
||||
|
||||
$menu->addChild('person_admin.social_work')
|
||||
$menu->addChild('person_admin.social_work', [
|
||||
'route' => 'chill_social-work_admin_index',
|
||||
])
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras(['order' => 2300, 'header' => true]);
|
||||
|
||||
@ -100,6 +62,6 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface
|
||||
|
||||
public static function getMenuIds(): array
|
||||
{
|
||||
return ['admin_section'];
|
||||
return ['admin_section', 'admin_social_work'];
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_accompanying_course', {
|
||||
'layout': '@ChillPerson/Admin/menu.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}<!-- block content empty -->
|
||||
<h1>{{ 'Accompanying course configuration' |trans }}</h1>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
@ -0,0 +1,13 @@
|
||||
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_household', {
|
||||
'layout': '@ChillPerson/Admin/menu.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}<!-- block content empty -->
|
||||
<h1>{{ 'Household configuration' |trans }}</h1>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
@ -0,0 +1,13 @@
|
||||
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_person', {
|
||||
'layout': '@ChillPerson/Admin/menu.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}<!-- block content empty -->
|
||||
<h1>{{ 'Person configuration' |trans }}</h1>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
@ -0,0 +1,13 @@
|
||||
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_social_work', {
|
||||
'layout': '@ChillPerson/Admin/menu.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}<!-- block content empty -->
|
||||
<h1>{{ 'Social work configuration' |trans }}</h1>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
@ -0,0 +1,2 @@
|
||||
{% extends "@ChillMain/Menu/verticalMenu.html.twig" %}
|
||||
{% block v_menu_title %}{{ 'Third party configuration'|trans }}{% endblock %}
|
Loading…
x
Reference in New Issue
Block a user