mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 13:03:50 +00:00
ChillPersonBundle: Add numberOfDependents and numberOfDependentsWithDisabilities
This commit is contained in:
@@ -33,9 +33,12 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Component\Serializer\Exception;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||
|
||||
class HouseholdMemberController extends ApiController
|
||||
{
|
||||
private array $fields_visibility;
|
||||
|
||||
public function __construct(
|
||||
private readonly UrlGeneratorInterface $generator,
|
||||
private readonly TranslatorInterface $translator,
|
||||
@@ -45,7 +48,10 @@ class HouseholdMemberController extends ApiController
|
||||
private readonly Security $security,
|
||||
private readonly PositionRepository $positionRepository,
|
||||
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry,
|
||||
) {}
|
||||
protected ParameterBagInterface $parameterBag,
|
||||
) {
|
||||
$this->fields_visibility = $parameterBag->get('chill_person.person_fields');
|
||||
}
|
||||
|
||||
#[Route(path: '/{_locale}/person/household/member/{id}/edit', name: 'chill_person_household_member_edit')]
|
||||
public function editMembership(Request $request, HouseholdMember $member): Response
|
||||
@@ -144,6 +150,7 @@ class HouseholdMemberController extends ApiController
|
||||
'allowHouseholdCreate' => $allowHouseholdCreate ?? true,
|
||||
'allowHouseholdSearch' => $allowHouseholdSearch ?? true,
|
||||
'allowLeaveWithoutHousehold' => $allowLeaveWithoutHousehold ?? $request->query->has('allow_leave_without_household'),
|
||||
'displayDependents' => ('visible' == $this->fields_visibility['number_of_dependents']) ? true : false,
|
||||
];
|
||||
|
||||
// context
|
||||
|
Reference in New Issue
Block a user