mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 03:23:48 +00:00
Merge branch 'master' into 616_rapid-action
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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;
|
||||
|
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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;
|
||||
@@ -39,7 +39,6 @@ class AdminAccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras([
|
||||
'order' => 2200,
|
||||
'icons' => ['random'],
|
||||
]);
|
||||
|
||||
$menu->addChild('person_admin.closing motives', [
|
||||
|
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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;
|
||||
@@ -39,16 +39,19 @@ class AdminHouseholdMenuBuilder implements LocalMenuBuilderInterface
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras([
|
||||
'order' => 2100,
|
||||
'icons' => ['home'],
|
||||
]);
|
||||
|
||||
$menu->addChild('Position', [
|
||||
'route' => 'chill_crud_person_household_position_index',
|
||||
])->setExtras(['order' => 2110]);
|
||||
|
||||
$menu->addChild('Composition', [
|
||||
'route' => 'chill_crud_person_household_composition_type_index',
|
||||
])->setExtras(['order' => 2120]);
|
||||
|
||||
$menu->addChild('person_admin.relation', [
|
||||
'route' => 'chill_crud_person_relation_index',
|
||||
])->setExtras(['order' => 2120]);
|
||||
])->setExtras(['order' => 2130]);
|
||||
}
|
||||
|
||||
public static function getMenuIds(): array
|
||||
|
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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;
|
||||
@@ -39,7 +39,6 @@ class AdminPersonMenuBuilder implements LocalMenuBuilderInterface
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras([
|
||||
'order' => 2000,
|
||||
'icons' => ['child'],
|
||||
]);
|
||||
|
||||
$menu->addChild('Civility', [
|
||||
|
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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;
|
||||
@@ -39,7 +39,6 @@ class AdminSocialWorkMenuBuilder implements LocalMenuBuilderInterface
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras([
|
||||
'order' => 2300,
|
||||
'icons' => ['handshake-o'],
|
||||
]);
|
||||
|
||||
$menu->addChild('person_admin.social_action', [
|
||||
|
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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;
|
||||
|
@@ -1,22 +1,25 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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 Chill\PersonBundle\Entity\Person;
|
||||
use Chill\PersonBundle\Repository\ResidentialAddressRepository;
|
||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* Add menu entrie to person menu.
|
||||
@@ -25,6 +28,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
*
|
||||
* - person details ;
|
||||
* - accompanying period (if `visible`)
|
||||
*
|
||||
* @implements LocalMenuBuilderInterface<array{person: Person}>
|
||||
*/
|
||||
class PersonMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
@@ -35,18 +40,28 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
|
||||
|
||||
protected TranslatorInterface $translator;
|
||||
|
||||
private ResidentialAddressRepository $residentialAddressRepo;
|
||||
|
||||
private Security $security;
|
||||
|
||||
public function __construct(
|
||||
ParameterBagInterface $parameterBag,
|
||||
Security $security,
|
||||
TranslatorInterface $translator
|
||||
TranslatorInterface $translator,
|
||||
ResidentialAddressRepository $residentialAddressRepo
|
||||
) {
|
||||
$this->showAccompanyingPeriod = $parameterBag->get('chill_person.accompanying_period');
|
||||
$this->security = $security;
|
||||
$this->translator = $translator;
|
||||
$this->residentialAddressRepo = $residentialAddressRepo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $menuId
|
||||
* @param MenuItem $menu
|
||||
* @param array{person: Person} $parameters
|
||||
* @return void
|
||||
*/
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
$menu->addChild($this->translator->trans('Person details'), [
|
||||
@@ -67,6 +82,8 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
|
||||
])
|
||||
->setExtras([
|
||||
'order' => 60,
|
||||
'counter' => 0 < ($nbResidentials = $this->residentialAddressRepo->countByPerson($parameters['person'])) ?
|
||||
$nbResidentials : null,
|
||||
]);
|
||||
|
||||
$menu->addChild($this->translator->trans('person_resources_menu'), [
|
||||
@@ -77,6 +94,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
|
||||
])
|
||||
->setExtras([
|
||||
'order' => 70,
|
||||
'counter' => 0 < ($nbResources = $parameters['person']->countResources()) ? $nbResources : null,
|
||||
]);
|
||||
|
||||
$menu->addChild($this->translator->trans('household.person history'), [
|
||||
@@ -111,6 +129,8 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
|
||||
])
|
||||
->setExtras([
|
||||
'order' => 100,
|
||||
'counter' => 0 < ($nbAccompanyingPeriod = $parameters['person']->countAccompanyingPeriodInvolved())
|
||||
? $nbAccompanyingPeriod : null,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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\Entity\User;
|
||||
|
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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;
|
||||
|
Reference in New Issue
Block a user