mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-10-31 01:08:26 +00:00 
			
		
		
		
	Compare commits
	
		
			4 Commits
		
	
	
		
			405-aside-
			...
			362-bug-ma
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 499aa3adea | |||
| b597ff89e0 | |||
| 3c801a6d0e | |||
| 4093949c2f | 
| @@ -11,6 +11,7 @@ | ||||
|     "@hotwired/stimulus": "^3.0.0", | ||||
|     "@luminateone/eslint-baseline": "^1.0.9", | ||||
|     "@symfony/stimulus-bridge": "^3.2.0", | ||||
|     "@symfony/ux-translator": "file:vendor/symfony/ux-translator/assets", | ||||
|     "@symfony/webpack-encore": "^4.1.0", | ||||
|     "@tsconfig/node20": "^20.1.4", | ||||
|     "@types/dompurify": "^3.0.5", | ||||
|   | ||||
| @@ -15,6 +15,7 @@ use Chill\CalendarBundle\Repository\CalendarRepository; | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Chill\MainBundle\Entity\User; | ||||
| use Chill\MainBundle\Serializer\Model\Collection; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\JsonResponse; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
| use Symfony\Component\HttpFoundation\Response; | ||||
| @@ -23,7 +24,10 @@ use Symfony\Component\Routing\Annotation\Route; | ||||
|  | ||||
| class CalendarAPIController extends ApiController | ||||
| { | ||||
|     public function __construct(private readonly CalendarRepository $calendarRepository) {} | ||||
|     public function __construct(private readonly CalendarRepository $calendarRepository, ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     #[Route(path: '/api/1.0/calendar/calendar/by-user/{id}.{_format}', name: 'chill_api_single_calendar_list_by-user', requirements: ['_format' => 'json'])] | ||||
|     public function listByUser(User $user, Request $request, string $_format): JsonResponse | ||||
|   | ||||
| @@ -15,6 +15,7 @@ use Chill\CalendarBundle\Repository\CalendarRangeRepository; | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Chill\MainBundle\Entity\User; | ||||
| use Chill\MainBundle\Serializer\Model\Collection; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\JsonResponse; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
| use Symfony\Component\HttpFoundation\Response; | ||||
| @@ -23,7 +24,10 @@ use Symfony\Component\Routing\Annotation\Route; | ||||
|  | ||||
| class CalendarRangeAPIController extends ApiController | ||||
| { | ||||
|     public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository) {} | ||||
|     public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     #[Route(path: '/api/1.0/calendar/calendar-range-available/{id}.{_format}', name: 'chill_api_single_calendar_range_available', requirements: ['_format' => 'json'])] | ||||
|     public function availableRanges(User $user, Request $request, string $_format): JsonResponse | ||||
|   | ||||
| @@ -14,6 +14,7 @@ namespace Chill\DocStoreBundle\Controller; | ||||
| use Chill\DocStoreBundle\Entity\StoredObject; | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Doctrine\ORM\EntityManagerInterface; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\JsonResponse; | ||||
| use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; | ||||
| use Symfony\Component\Routing\Annotation\Route; | ||||
| @@ -27,7 +28,10 @@ class StoredObjectApiController extends ApiController | ||||
|         private readonly Security $security, | ||||
|         private readonly SerializerInterface $serializer, | ||||
|         private readonly EntityManagerInterface $entityManager, | ||||
|     ) {} | ||||
|         ManagerRegistry $managerRegistry, | ||||
|     ) { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a new stored object. | ||||
|   | ||||
| @@ -14,6 +14,7 @@ namespace Chill\DocStoreBundle\Tests\Controller; | ||||
| use Chill\DocStoreBundle\Controller\StoredObjectApiController; | ||||
| use Chill\DocStoreBundle\Entity\StoredObject; | ||||
| use Doctrine\ORM\EntityManagerInterface; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use PHPUnit\Framework\TestCase; | ||||
| use Symfony\Component\HttpFoundation\JsonResponse; | ||||
| use Symfony\Component\Security\Core\Security; | ||||
| @@ -45,7 +46,9 @@ class StoredObjectApiControllerTest extends TestCase | ||||
|             {"type":  "stored-object", "id":  1} | ||||
|             JSON); | ||||
|  | ||||
|         $controller = new StoredObjectApiController($security, $serializer, $entityManager); | ||||
|         $managerRegistry = $this->createMock(ManagerRegistry::class); | ||||
|  | ||||
|         $controller = new StoredObjectApiController($security, $serializer, $entityManager, $managerRegistry); | ||||
|  | ||||
|         $actual = $controller->createStoredObject(); | ||||
|  | ||||
|   | ||||
| @@ -39,6 +39,8 @@ abstract class AbstractCRUDController extends AbstractController | ||||
|      */ | ||||
|     protected array $crudConfig = []; | ||||
|  | ||||
|     public function __construct(protected ManagerRegistry $managerRegistry) {} | ||||
|  | ||||
|     /** | ||||
|      * get the role given from the config. | ||||
|      */ | ||||
| @@ -213,7 +215,7 @@ abstract class AbstractCRUDController extends AbstractController | ||||
|  | ||||
|     protected function getManagerRegistry(): ManagerRegistry | ||||
|     { | ||||
|         return $this->container->get(ManagerRegistry::class); | ||||
|         return $this->managerRegistry; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -13,6 +13,7 @@ namespace Chill\MainBundle\CRUD\Controller; | ||||
|  | ||||
| use Chill\MainBundle\Pagination\PaginatorInterface; | ||||
| use Chill\MainBundle\Serializer\Model\Collection; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
| use Symfony\Component\HttpFoundation\Response; | ||||
| use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; | ||||
| @@ -23,6 +24,11 @@ use Symfony\Component\Validator\ConstraintViolationListInterface; | ||||
|  | ||||
| class ApiController extends AbstractCRUDController | ||||
| { | ||||
|     public function __construct(ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Base method for handling api action. | ||||
|      * | ||||
|   | ||||
| @@ -13,6 +13,7 @@ namespace Chill\MainBundle\Controller; | ||||
|  | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Chill\MainBundle\Entity\Address; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\JsonResponse; | ||||
| use Symfony\Component\HttpFoundation\Response; | ||||
| use Symfony\Component\Routing\Annotation\Route; | ||||
| @@ -20,7 +21,10 @@ use Symfony\Component\Serializer\Normalizer\AbstractNormalizer; | ||||
|  | ||||
| class AddressApiController extends ApiController | ||||
| { | ||||
|     public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} | ||||
|     public function __construct(protected ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Duplicate an existing address. | ||||
|   | ||||
| @@ -17,6 +17,7 @@ use Chill\MainBundle\Pagination\PaginatorFactory; | ||||
| use Chill\MainBundle\Pagination\PaginatorInterface; | ||||
| use Chill\MainBundle\Repository\AddressReferenceRepository; | ||||
| use Chill\MainBundle\Serializer\Model\Collection; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\JsonResponse; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
| use Symfony\Component\HttpFoundation\Response; | ||||
| @@ -26,7 +27,10 @@ use Symfony\Component\Serializer\Normalizer\AbstractNormalizer; | ||||
|  | ||||
| final class AddressReferenceAPIController extends ApiController | ||||
| { | ||||
|     public function __construct(private readonly AddressReferenceRepository $addressReferenceRepository, private readonly PaginatorFactory $paginatorFactory) {} | ||||
|     public function __construct(private readonly AddressReferenceRepository $addressReferenceRepository, private readonly PaginatorFactory $paginatorFactory, ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     #[Route(path: '/api/1.0/main/address-reference/by-postal-code/{id}/search.json')] | ||||
|     public function search(PostalCode $postalCode, Request $request): JsonResponse | ||||
|   | ||||
| @@ -13,10 +13,16 @@ namespace Chill\MainBundle\Controller; | ||||
|  | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Chill\MainBundle\Pagination\PaginatorInterface; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
|  | ||||
| class CivilityApiController extends ApiController | ||||
| { | ||||
|     public function __construct(protected ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format) | ||||
|     { | ||||
|         return $query->addOrderBy('e.order', 'ASC'); | ||||
|   | ||||
| @@ -12,5 +12,12 @@ declare(strict_types=1); | ||||
| namespace Chill\MainBundle\Controller; | ||||
|  | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
|  | ||||
| class CountryApiController extends ApiController {} | ||||
| class CountryApiController extends ApiController | ||||
| { | ||||
|     public function __construct(protected ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -13,10 +13,16 @@ namespace Chill\MainBundle\Controller; | ||||
|  | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Chill\MainBundle\Pagination\PaginatorInterface; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
|  | ||||
| class GenderApiController extends ApiController | ||||
| { | ||||
|     public function __construct(protected ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     protected function customizeQuery(string $action, Request $request, $query): void | ||||
|     { | ||||
|         $query | ||||
|   | ||||
| @@ -12,5 +12,12 @@ declare(strict_types=1); | ||||
| namespace Chill\MainBundle\Controller; | ||||
|  | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
|  | ||||
| class GeographicalUnitApiController extends ApiController {} | ||||
| class GeographicalUnitApiController extends ApiController | ||||
| { | ||||
|     public function __construct(protected ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -14,6 +14,7 @@ namespace Chill\MainBundle\Controller; | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Chill\MainBundle\Pagination\PaginatorInterface; | ||||
| use Doctrine\ORM\QueryBuilder; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
|  | ||||
| /** | ||||
| @@ -21,6 +22,11 @@ use Symfony\Component\HttpFoundation\Request; | ||||
|  */ | ||||
| class LocationApiController extends ApiController | ||||
| { | ||||
|     public function __construct(protected ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     protected function customizeQuery(string $action, Request $request, $query): void | ||||
|     { | ||||
|         $query | ||||
|   | ||||
| @@ -12,6 +12,7 @@ declare(strict_types=1); | ||||
| namespace Chill\MainBundle\Controller; | ||||
|  | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
|  | ||||
| /** | ||||
| @@ -19,6 +20,11 @@ use Symfony\Component\HttpFoundation\Request; | ||||
|  */ | ||||
| class LocationTypeApiController extends ApiController | ||||
| { | ||||
|     public function __construct(protected ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     public function customizeQuery(string $action, Request $request, $query): void | ||||
|     { | ||||
|         $query->andWhere( | ||||
|   | ||||
| @@ -16,6 +16,7 @@ use Chill\MainBundle\Pagination\PaginatorFactory; | ||||
| use Chill\MainBundle\Repository\CountryRepository; | ||||
| use Chill\MainBundle\Repository\PostalCodeRepositoryInterface; | ||||
| use Chill\MainBundle\Serializer\Model\Collection; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\JsonResponse; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
| use Symfony\Component\HttpFoundation\Response; | ||||
| @@ -26,7 +27,10 @@ use Symfony\Component\Serializer\Normalizer\AbstractNormalizer; | ||||
|  | ||||
| final class PostalCodeAPIController extends ApiController | ||||
| { | ||||
|     public function __construct(private readonly CountryRepository $countryRepository, private readonly PostalCodeRepositoryInterface $postalCodeRepository, private readonly PaginatorFactory $paginatorFactory) {} | ||||
|     public function __construct(private readonly CountryRepository $countryRepository, private readonly PostalCodeRepositoryInterface $postalCodeRepository, private readonly PaginatorFactory $paginatorFactory, ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     #[Route(path: '/api/1.0/main/postal-code/search.json')] | ||||
|     public function search(Request $request): JsonResponse | ||||
|   | ||||
| @@ -12,10 +12,16 @@ declare(strict_types=1); | ||||
| namespace Chill\MainBundle\Controller; | ||||
|  | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
|  | ||||
| class ScopeApiController extends ApiController | ||||
| { | ||||
|     public function __construct(protected ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     protected function customizeQuery(string $action, Request $request, $query): void | ||||
|     { | ||||
|         if ('_index' === $action) { | ||||
|   | ||||
| @@ -15,6 +15,7 @@ use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Chill\MainBundle\Pagination\PaginatorInterface; | ||||
| use Chill\MainBundle\Security\ChillSecurity; | ||||
| use Doctrine\ORM\QueryBuilder; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\JsonResponse; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
| use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; | ||||
| @@ -22,7 +23,10 @@ use Symfony\Component\Routing\Annotation\Route; | ||||
|  | ||||
| class UserApiController extends ApiController | ||||
| { | ||||
|     public function __construct(private readonly ChillSecurity $security) {} | ||||
|     public function __construct(private readonly ChillSecurity $security, ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     #[Route(path: '/api/1.0/main/user-current-location.{_format}', name: 'chill_main_user_current_location', requirements: ['_format' => 'json'])] | ||||
|     public function currentLocation(mixed $_format): JsonResponse | ||||
|   | ||||
| @@ -12,5 +12,12 @@ declare(strict_types=1); | ||||
| namespace Chill\MainBundle\Controller; | ||||
|  | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
|  | ||||
| class UserGroupApiController extends ApiController {} | ||||
| class UserGroupApiController extends ApiController | ||||
| { | ||||
|     public function __construct(protected ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -12,10 +12,16 @@ declare(strict_types=1); | ||||
| namespace Chill\MainBundle\Controller; | ||||
|  | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
|  | ||||
| class UserJobApiController extends ApiController | ||||
| { | ||||
|     public function __construct(protected ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     protected function customizeQuery(string $action, Request $request, $query): void | ||||
|     { | ||||
|         if ('_index' === $action) { | ||||
|   | ||||
| @@ -27,10 +27,10 @@ function loadDynamicPicker(element) { | ||||
|         : input.value === "[]" || input.value === "" | ||||
|           ? null | ||||
|           : [JSON.parse(input.value)]; | ||||
|     (suggested = JSON.parse(el.dataset.suggested)), | ||||
|       (as_id = parseInt(el.dataset.asId) === 1), | ||||
|       (submit_on_adding_new_entity = | ||||
|         parseInt(el.dataset.submitOnAddingNewEntity) === 1); | ||||
|     suggested = JSON.parse(el.dataset.suggested); | ||||
|     as_id = parseInt(el.dataset.asId) === 1; | ||||
|     submit_on_adding_new_entity = | ||||
|       parseInt(el.dataset.submitOnAddingNewEntity) === 1; | ||||
|     label = el.dataset.label; | ||||
|  | ||||
|     if (!isMultiple) { | ||||
| @@ -177,7 +177,7 @@ document.addEventListener("pick-entity-type-action", function (e) { | ||||
|   } | ||||
| }); | ||||
|  | ||||
| document.addEventListener("DOMContentLoaded", function (e) { | ||||
| document.addEventListener("DOMContentLoaded", function () { | ||||
|   loadDynamicPicker(document); | ||||
| }); | ||||
|  | ||||
|   | ||||
| @@ -2,6 +2,7 @@ services: | ||||
|     _defaults: | ||||
|         autowire: true | ||||
|         autoconfigure: true | ||||
|         public: false | ||||
|  | ||||
|     Chill\MainBundle\Controller\: | ||||
|         resource: '../../Controller' | ||||
|   | ||||
| @@ -29,6 +29,7 @@ use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepos | ||||
| use Chill\PersonBundle\Repository\AccompanyingPeriodRepository; | ||||
| use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter; | ||||
| use Chill\ThirdPartyBundle\Entity\ThirdParty; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; | ||||
| use Symfony\Component\EventDispatcher\EventDispatcherInterface; | ||||
| use Symfony\Component\HttpFoundation\JsonResponse; | ||||
| @@ -46,7 +47,10 @@ use Symfony\Component\Workflow\Registry; | ||||
|  | ||||
| final class AccompanyingCourseApiController extends ApiController | ||||
| { | ||||
|     public function __construct(private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, private readonly EventDispatcherInterface $eventDispatcher, private readonly ReferralsSuggestionInterface $referralAvailable, private readonly Registry $registry, private readonly ValidatorInterface $validator, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry, private readonly AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository) {} | ||||
|     public function __construct(private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, private readonly EventDispatcherInterface $eventDispatcher, private readonly ReferralsSuggestionInterface $referralAvailable, private readonly Registry $registry, private readonly ValidatorInterface $validator, protected ManagerRegistry $managerRegistry, private readonly AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     public function commentApi($id, Request $request, string $_format): Response | ||||
|     { | ||||
|   | ||||
| @@ -16,6 +16,7 @@ use Chill\MainBundle\Entity\User; | ||||
| use Chill\MainBundle\Serializer\Model\Collection; | ||||
| use Chill\MainBundle\Serializer\Model\Counter; | ||||
| use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepository; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\JsonResponse; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
| use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; | ||||
| @@ -27,7 +28,10 @@ class AccompanyingCourseWorkApiController extends ApiController | ||||
|     public function __construct( | ||||
|         private readonly AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository, | ||||
|         private readonly Security $security, | ||||
|     ) {} | ||||
|         ManagerRegistry $managerRegistry, | ||||
|     ) { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     #[Route(path: '/api/1.0/person/accompanying-period/work/my-near-end')] | ||||
|     public function myWorksNearEndDate(Request $request): JsonResponse | ||||
|   | ||||
| @@ -12,5 +12,12 @@ declare(strict_types=1); | ||||
| namespace Chill\PersonBundle\Controller; | ||||
|  | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
|  | ||||
| class AccompanyingPeriodCommentApiController extends ApiController {} | ||||
| class AccompanyingPeriodCommentApiController extends ApiController | ||||
| { | ||||
|     public function __construct(protected ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -12,5 +12,12 @@ declare(strict_types=1); | ||||
| namespace Chill\PersonBundle\Controller; | ||||
|  | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
|  | ||||
| class AccompanyingPeriodResourceApiController extends ApiController {} | ||||
| class AccompanyingPeriodResourceApiController extends ApiController | ||||
| { | ||||
|     public function __construct(protected ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -22,6 +22,7 @@ use Chill\PersonBundle\Event\Person\PersonAddressMoveEvent; | ||||
| use Chill\PersonBundle\Repository\Household\HouseholdACLAwareRepositoryInterface; | ||||
| use Chill\PersonBundle\Repository\Household\HouseholdRepository; | ||||
| use Chill\PersonBundle\Security\Authorization\HouseholdVoter; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
| use Symfony\Component\HttpFoundation\Response; | ||||
| @@ -31,7 +32,10 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; | ||||
|  | ||||
| class HouseholdApiController extends ApiController | ||||
| { | ||||
|     public function __construct(private readonly EventDispatcherInterface $eventDispatcher, private readonly HouseholdRepository $householdRepository, private readonly HouseholdACLAwareRepositoryInterface $householdACLAwareRepository, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} | ||||
|     public function __construct(private readonly EventDispatcherInterface $eventDispatcher, private readonly HouseholdRepository $householdRepository, private readonly HouseholdACLAwareRepositoryInterface $householdACLAwareRepository, protected ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @return \Symfony\Component\HttpFoundation\JsonResponse | ||||
|   | ||||
| @@ -13,10 +13,16 @@ namespace Chill\PersonBundle\Controller; | ||||
|  | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Doctrine\ORM\QueryBuilder; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
|  | ||||
| class HouseholdCompositionTypeApiController extends ApiController | ||||
| { | ||||
|     public function __construct(protected ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param QueryBuilder $query | ||||
|      */ | ||||
|   | ||||
| @@ -23,6 +23,7 @@ use Chill\PersonBundle\Repository\Household\PositionRepository; | ||||
| use Chill\PersonBundle\Repository\PersonRepository; | ||||
| use Chill\PersonBundle\Security\Authorization\HouseholdVoter; | ||||
| use Chill\PersonBundle\Security\Authorization\PersonVoter; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
| use Symfony\Component\HttpFoundation\Response; | ||||
| use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; | ||||
| @@ -47,9 +48,10 @@ class HouseholdMemberController extends ApiController | ||||
|         private readonly HouseholdRepository $householdRepository, | ||||
|         private readonly Security $security, | ||||
|         private readonly PositionRepository $positionRepository, | ||||
|         private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry, | ||||
|         protected ParameterBagInterface $parameterBag, | ||||
|         ManagerRegistry $managerRegistry, | ||||
|     ) { | ||||
|         parent::__construct($managerRegistry); | ||||
|         $this->household_fields_visibility = $parameterBag->get('chill_person.household_fields'); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -12,10 +12,16 @@ declare(strict_types=1); | ||||
| namespace Chill\PersonBundle\Controller; | ||||
|  | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
|  | ||||
| class OpeningApiController extends ApiController | ||||
| { | ||||
|     public function __construct(protected ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     protected function customizeQuery(string $action, Request $request, $qb): void | ||||
|     { | ||||
|         $qb->where($qb->expr()->gt('e.noActiveAfter', ':now')) | ||||
|   | ||||
| @@ -18,6 +18,7 @@ use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation; | ||||
| use Chill\PersonBundle\Entity\Person; | ||||
| use Chill\PersonBundle\Security\Authorization\PersonVoter; | ||||
| use Chill\PersonBundle\Security\AuthorizedCenterOnPersonCreationInterface; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; | ||||
| use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
| @@ -32,7 +33,9 @@ class PersonApiController extends ApiController | ||||
|         private readonly AuthorizedCenterOnPersonCreationInterface $authorizedCenterOnPersonCreation, | ||||
|         private readonly ConfigPersonAltNamesHelper $configPersonAltNameHelper, | ||||
|         ParameterBagInterface $parameterBag, | ||||
|         ManagerRegistry $managerRegistry, | ||||
|     ) { | ||||
|         parent::__construct($managerRegistry); | ||||
|         $this->showCenters = $parameterBag->get('chill_main')['acl']['form_show_centers']; | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -12,5 +12,12 @@ declare(strict_types=1); | ||||
| namespace Chill\PersonBundle\Controller; | ||||
|  | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
|  | ||||
| class RelationApiController extends ApiController {} | ||||
| class RelationApiController extends ApiController | ||||
| { | ||||
|     public function __construct(protected ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -15,12 +15,16 @@ use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Chill\PersonBundle\Entity\Person; | ||||
| use Chill\PersonBundle\Repository\Relationships\RelationshipRepository; | ||||
| use Chill\PersonBundle\Security\Authorization\PersonVoter; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; | ||||
| use Symfony\Component\HttpFoundation\Response; | ||||
|  | ||||
| class RelationshipApiController extends ApiController | ||||
| { | ||||
|     public function __construct(private readonly RelationshipRepository $repository) {} | ||||
|     public function __construct(private readonly RelationshipRepository $repository, ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @ParamConverter("person", options={"id": "person_id"}) | ||||
|   | ||||
| @@ -13,10 +13,16 @@ namespace Chill\PersonBundle\Controller; | ||||
|  | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Chill\MainBundle\Pagination\PaginatorInterface; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
|  | ||||
| class SocialIssueApiController extends ApiController | ||||
| { | ||||
|     public function __construct(protected ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     protected function customizeQuery(string $action, Request $request, $query): void | ||||
|     { | ||||
|         $query->where( | ||||
|   | ||||
| @@ -16,12 +16,16 @@ use Chill\MainBundle\Pagination\PaginatorFactory; | ||||
| use Chill\MainBundle\Serializer\Model\Collection; | ||||
| use Chill\PersonBundle\Entity\SocialWork\SocialAction; | ||||
| use Chill\PersonBundle\Repository\SocialWork\GoalRepository; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
| use Symfony\Component\HttpFoundation\Response; | ||||
|  | ||||
| class SocialWorkGoalApiController extends ApiController | ||||
| { | ||||
|     public function __construct(private readonly GoalRepository $goalRepository, private readonly PaginatorFactory $paginator) {} | ||||
|     public function __construct(private readonly GoalRepository $goalRepository, private readonly PaginatorFactory $paginator, ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     public function listBySocialAction(Request $request, SocialAction $action): Response | ||||
|     { | ||||
|   | ||||
| @@ -16,12 +16,16 @@ use Chill\MainBundle\Serializer\Model\Collection; | ||||
| use Chill\PersonBundle\Entity\SocialWork\Goal; | ||||
| use Chill\PersonBundle\Entity\SocialWork\SocialAction; | ||||
| use Chill\PersonBundle\Repository\SocialWork\ResultRepository; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
| use Symfony\Component\HttpFoundation\Response; | ||||
|  | ||||
| class SocialWorkResultApiController extends ApiController | ||||
| { | ||||
|     public function __construct(private readonly ResultRepository $resultRepository) {} | ||||
|     public function __construct(private readonly ResultRepository $resultRepository, ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     public function listByGoal(Request $request, Goal $goal): Response | ||||
|     { | ||||
|   | ||||
| @@ -16,6 +16,7 @@ use Chill\MainBundle\Pagination\PaginatorFactory; | ||||
| use Chill\MainBundle\Serializer\Model\Collection; | ||||
| use Chill\PersonBundle\Entity\SocialWork\SocialAction; | ||||
| use Chill\PersonBundle\Repository\SocialWork\SocialIssueRepository; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Symfony\Component\Clock\ClockInterface; | ||||
| use Symfony\Component\HttpFoundation\JsonResponse; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
| @@ -26,7 +27,10 @@ final class SocialWorkSocialActionApiController extends ApiController | ||||
|         private readonly SocialIssueRepository $socialIssueRepository, | ||||
|         private readonly PaginatorFactory $paginator, | ||||
|         private readonly ClockInterface $clock, | ||||
|     ) {} | ||||
|         ManagerRegistry $managerRegistry, | ||||
|     ) { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
|  | ||||
|     public function listBySocialIssueApi($id, Request $request) | ||||
|     { | ||||
|   | ||||
| @@ -12,5 +12,12 @@ declare(strict_types=1); | ||||
| namespace Chill\ThirdPartyBundle\Controller; | ||||
|  | ||||
| use Chill\MainBundle\CRUD\Controller\ApiController; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
|  | ||||
| class ThirdPartyApiController extends ApiController {} | ||||
| class ThirdPartyApiController extends ApiController | ||||
| { | ||||
|     public function __construct(protected ManagerRegistry $managerRegistry) | ||||
|     { | ||||
|         parent::__construct($managerRegistry); | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user