mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
update php-cs-fixer and rector + fix rules
This commit is contained in:
parent
a63b40fb6c
commit
825cd127d1
@ -112,6 +112,7 @@ $rules = array_merge(
|
|||||||
],
|
],
|
||||||
'sort_algorithm' => 'alpha',
|
'sort_algorithm' => 'alpha',
|
||||||
],
|
],
|
||||||
|
'single_line_empty_body' => true,
|
||||||
],
|
],
|
||||||
$rules,
|
$rules,
|
||||||
$riskyRules,
|
$riskyRules,
|
||||||
|
@ -92,7 +92,7 @@
|
|||||||
"phpstan/phpstan-deprecation-rules": "^1.1",
|
"phpstan/phpstan-deprecation-rules": "^1.1",
|
||||||
"phpstan/phpstan-strict-rules": "^1.0",
|
"phpstan/phpstan-strict-rules": "^1.0",
|
||||||
"phpunit/phpunit": ">= 7.5",
|
"phpunit/phpunit": ">= 7.5",
|
||||||
"rector/rector": "^0.17.7",
|
"rector/rector": "^0.19.0",
|
||||||
"symfony/debug-bundle": "^5.4",
|
"symfony/debug-bundle": "^5.4",
|
||||||
"symfony/dotenv": "^5.4",
|
"symfony/dotenv": "^5.4",
|
||||||
"symfony/maker-bundle": "^1.20",
|
"symfony/maker-bundle": "^1.20",
|
||||||
|
@ -50,9 +50,6 @@ return static function (RectorConfig $rectorConfig): void {
|
|||||||
|
|
||||||
// skip some path...
|
// skip some path...
|
||||||
$rectorConfig->skip([
|
$rectorConfig->skip([
|
||||||
// we need to discuss this: are we going to have FALSE in tests instead of an error ?
|
|
||||||
\Rector\Php71\Rector\FuncCall\CountOnNullRector::class,
|
|
||||||
|
|
||||||
// we must adapt service definition
|
// we must adapt service definition
|
||||||
\Rector\Symfony\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector::class,
|
\Rector\Symfony\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector::class,
|
||||||
\Rector\Symfony\Symfony34\Rector\Closure\ContainerGetNameToTypeInTestsRector::class,
|
\Rector\Symfony\Symfony34\Rector\Closure\ContainerGetNameToTypeInTestsRector::class,
|
||||||
|
@ -675,8 +675,8 @@ final class ActivityController extends AbstractController
|
|||||||
throw $this->createNotFoundException('Accompanying Period not found');
|
throw $this->createNotFoundException('Accompanying Period not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Add permission
|
// TODO Add permission
|
||||||
// $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
|
// $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
|
||||||
} else {
|
} else {
|
||||||
throw $this->createNotFoundException('Person or Accompanying Period not found');
|
throw $this->createNotFoundException('Person or Accompanying Period not found');
|
||||||
}
|
}
|
||||||
|
@ -22,9 +22,8 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
*/
|
*/
|
||||||
class ActivityReasonCategoryController extends AbstractController
|
class ActivityReasonCategoryController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Creates a new ActivityReasonCategory entity.
|
* Creates a new ActivityReasonCategory entity.
|
||||||
*
|
*
|
||||||
@ -59,7 +58,7 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->find($id);
|
$entity = $em->getRepository(ActivityReasonCategory::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
|
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
|
||||||
@ -82,7 +81,7 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entities = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->findAll();
|
$entities = $em->getRepository(ActivityReasonCategory::class)->findAll();
|
||||||
|
|
||||||
return $this->render('@ChillActivity/ActivityReasonCategory/index.html.twig', [
|
return $this->render('@ChillActivity/ActivityReasonCategory/index.html.twig', [
|
||||||
'entities' => $entities,
|
'entities' => $entities,
|
||||||
@ -114,7 +113,7 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->find($id);
|
$entity = $em->getRepository(ActivityReasonCategory::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
|
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
|
||||||
@ -134,7 +133,7 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->find($id);
|
$entity = $em->getRepository(ActivityReasonCategory::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
|
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
|
||||||
|
@ -60,7 +60,7 @@ class ActivityReasonController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id);
|
$entity = $em->getRepository(ActivityReason::class)->find($id);
|
||||||
|
|
||||||
if (null === $entity) {
|
if (null === $entity) {
|
||||||
throw new NotFoundHttpException('Unable to find ActivityReason entity.');
|
throw new NotFoundHttpException('Unable to find ActivityReason entity.');
|
||||||
@ -115,7 +115,7 @@ class ActivityReasonController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id);
|
$entity = $em->getRepository(ActivityReason::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find ActivityReason entity.');
|
throw $this->createNotFoundException('Unable to find ActivityReason entity.');
|
||||||
@ -135,7 +135,7 @@ class ActivityReasonController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id);
|
$entity = $em->getRepository(ActivityReason::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find ActivityReason entity.');
|
throw $this->createNotFoundException('Unable to find ActivityReason entity.');
|
||||||
|
@ -36,6 +36,7 @@ use DateTime;
|
|||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Component\Serializer\Annotation\Context;
|
||||||
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||||
use Symfony\Component\Serializer\Annotation\Groups;
|
use Symfony\Component\Serializer\Annotation\Groups;
|
||||||
use Symfony\Component\Serializer\Annotation\SerializedName;
|
use Symfony\Component\Serializer\Annotation\SerializedName;
|
||||||
|
@ -404,7 +404,7 @@ class ActivityType extends AbstractType
|
|||||||
->setAllowedTypes('center', ['null', Center::class, 'array'])
|
->setAllowedTypes('center', ['null', Center::class, 'array'])
|
||||||
->setAllowedTypes('role', ['string'])
|
->setAllowedTypes('role', ['string'])
|
||||||
->setAllowedTypes('activityType', \Chill\ActivityBundle\Entity\ActivityType::class)
|
->setAllowedTypes('activityType', \Chill\ActivityBundle\Entity\ActivityType::class)
|
||||||
->setAllowedTypes('accompanyingPeriod', [\Chill\PersonBundle\Entity\AccompanyingPeriod::class, 'null']);
|
->setAllowedTypes('accompanyingPeriod', [AccompanyingPeriod::class, 'null']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockPrefix(): string
|
public function getBlockPrefix(): string
|
||||||
|
@ -27,7 +27,7 @@ final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
{
|
{
|
||||||
/** @var \Chill\PersonBundle\Entity\Person $person */
|
/** @var Person $person */
|
||||||
$person = $parameters['person'];
|
$person = $parameters['person'];
|
||||||
|
|
||||||
if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) {
|
if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) {
|
||||||
|
@ -310,7 +310,7 @@ final class ActivityControllerTest extends WebTestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Chill\ActivityBundle\Entity\ActivityType
|
* @return ActivityType
|
||||||
*/
|
*/
|
||||||
private function getRandomActivityType()
|
private function getRandomActivityType()
|
||||||
{
|
{
|
||||||
|
@ -35,7 +35,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest
|
|||||||
$this->filter = self::getContainer()->get('chill.activity.export.person_having_an_activity_between_date_filter');
|
$this->filter = self::getContainer()->get('chill.activity.export.person_having_an_activity_between_date_filter');
|
||||||
|
|
||||||
$request = $this->prophesize()
|
$request = $this->prophesize()
|
||||||
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
->willExtend(Request::class);
|
||||||
|
|
||||||
$request->getLocale()->willReturn('fr');
|
$request->getLocale()->willReturn('fr');
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ final class TranslatableActivityTypeTest extends KernelTestCase
|
|||||||
|
|
||||||
$this->assertTrue($form->isSynchronized());
|
$this->assertTrue($form->isSynchronized());
|
||||||
$this->assertInstanceOf(
|
$this->assertInstanceOf(
|
||||||
\Chill\ActivityBundle\Entity\ActivityType::class,
|
ActivityType::class,
|
||||||
$form->getData()['type'],
|
$form->getData()['type'],
|
||||||
'The data is an instance of Chill\\ActivityBundle\\Entity\\ActivityType'
|
'The data is an instance of Chill\\ActivityBundle\\Entity\\ActivityType'
|
||||||
);
|
);
|
||||||
@ -83,7 +83,7 @@ final class TranslatableActivityTypeTest extends KernelTestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Chill\ActivityBundle\Entity\ActivityType
|
* @return ActivityType
|
||||||
*/
|
*/
|
||||||
protected function getRandomType(mixed $active = true)
|
protected function getRandomType(mixed $active = true)
|
||||||
{
|
{
|
||||||
|
@ -407,7 +407,7 @@ class CalendarController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @var Calendar $entity */
|
/** @var Calendar $entity */
|
||||||
$entity = $em->getRepository(\Chill\CalendarBundle\Entity\Calendar::class)->find($id);
|
$entity = $em->getRepository(Calendar::class)->find($id);
|
||||||
|
|
||||||
if (null === $entity) {
|
if (null === $entity) {
|
||||||
throw $this->createNotFoundException('Unable to find Calendar entity.');
|
throw $this->createNotFoundException('Unable to find Calendar entity.');
|
||||||
|
@ -86,7 +86,7 @@ class CreateFieldsOnGroupCommand extends Command
|
|||||||
$em = $this->entityManager;
|
$em = $this->entityManager;
|
||||||
|
|
||||||
$customFieldsGroups = $em
|
$customFieldsGroups = $em
|
||||||
->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
|
->getRepository(CustomFieldsGroup::class)
|
||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
if (0 === \count($customFieldsGroups)) {
|
if (0 === \count($customFieldsGroups)) {
|
||||||
|
@ -121,7 +121,7 @@ class CustomFieldController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomField::class)->find($id);
|
$entity = $em->getRepository(CustomField::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find CustomField entity.');
|
throw $this->createNotFoundException('Unable to find CustomField entity.');
|
||||||
|
@ -37,7 +37,10 @@ class CustomFieldsGroupController extends AbstractController
|
|||||||
* CustomFieldsGroupController constructor.
|
* CustomFieldsGroupController constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly CustomFieldProvider $customFieldProvider, private readonly TranslatorInterface $translator, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
private readonly CustomFieldProvider $customFieldProvider,
|
||||||
|
private readonly TranslatorInterface $translator,
|
||||||
|
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry
|
||||||
|
) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new CustomFieldsGroup entity.
|
* Creates a new CustomFieldsGroup entity.
|
||||||
@ -79,7 +82,7 @@ class CustomFieldsGroupController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id);
|
$entity = $em->getRepository(CustomFieldsGroup::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.');
|
throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.');
|
||||||
@ -102,7 +105,7 @@ class CustomFieldsGroupController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$cfGroups = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->findAll();
|
$cfGroups = $em->getRepository(CustomFieldsGroup::class)->findAll();
|
||||||
$defaultGroups = $this->getDefaultGroupsId();
|
$defaultGroups = $this->getDefaultGroupsId();
|
||||||
|
|
||||||
$makeDefaultFormViews = [];
|
$makeDefaultFormViews = [];
|
||||||
@ -134,13 +137,13 @@ class CustomFieldsGroupController extends AbstractController
|
|||||||
|
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$cFGroup = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->findOneById($cFGroupId);
|
$cFGroup = $em->getRepository(CustomFieldsGroup::class)->findOneById($cFGroupId);
|
||||||
|
|
||||||
if (!$cFGroup) {
|
if (!$cFGroup) {
|
||||||
throw $this->createNotFoundException('customFieldsGroup not found with '."id {$cFGroupId}");
|
throw $this->createNotFoundException('customFieldsGroup not found with '."id {$cFGroupId}");
|
||||||
}
|
}
|
||||||
|
|
||||||
$cFDefaultGroup = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsDefaultGroup::class)
|
$cFDefaultGroup = $em->getRepository(CustomFieldsDefaultGroup::class)
|
||||||
->findOneByEntity($cFGroup->getEntity());
|
->findOneByEntity($cFGroup->getEntity());
|
||||||
|
|
||||||
if ($cFDefaultGroup) {
|
if ($cFDefaultGroup) {
|
||||||
@ -195,7 +198,7 @@ class CustomFieldsGroupController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id);
|
$entity = $em->getRepository(CustomFieldsGroup::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find CustomFieldsGroups entity.');
|
throw $this->createNotFoundException('Unable to find CustomFieldsGroups entity.');
|
||||||
@ -239,7 +242,7 @@ class CustomFieldsGroupController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id);
|
$entity = $em->getRepository(CustomFieldsGroup::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.');
|
throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.');
|
||||||
@ -263,7 +266,7 @@ class CustomFieldsGroupController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id);
|
$entity = $em->getRepository(CustomFieldsGroup::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.');
|
throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.');
|
||||||
|
@ -29,7 +29,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
|||||||
final class CustomFieldsChoiceTest extends KernelTestCase
|
final class CustomFieldsChoiceTest extends KernelTestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var \Chill\CustomFieldsBundle\CustomFields\CustomFieldChoice
|
* @var CustomFieldChoice
|
||||||
*/
|
*/
|
||||||
private $cfChoice;
|
private $cfChoice;
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ final class CustomFieldsTextTest extends WebTestCase
|
|||||||
$customField
|
$customField
|
||||||
);
|
);
|
||||||
$this->assertInstanceOf(
|
$this->assertInstanceOf(
|
||||||
\Chill\CustomFieldsBundle\CustomFields\CustomFieldText::class,
|
CustomFieldText::class,
|
||||||
$customField
|
$customField
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ final readonly class OnGenerationFails implements EventSubscriberInterface
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var \Chill\DocGeneratorBundle\Service\Messenger\RequestGenerationMessage $message */
|
/** @var RequestGenerationMessage $message */
|
||||||
$message = $event->getEnvelope()->getMessage();
|
$message = $event->getEnvelope()->getMessage();
|
||||||
|
|
||||||
$this->logger->error(self::LOG_PREFIX.'Docgen failed', [
|
$this->logger->error(self::LOG_PREFIX.'Docgen failed', [
|
||||||
|
@ -25,9 +25,8 @@ use Symfony\Component\Routing\Annotation\Route;
|
|||||||
*/
|
*/
|
||||||
class DocumentCategoryController extends AbstractController
|
class DocumentCategoryController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @Route("/{bundleId}/{idInsideBundle}", name="document_category_delete", methods="DELETE")
|
* @Route("/{bundleId}/{idInsideBundle}", name="document_category_delete", methods="DELETE")
|
||||||
*/
|
*/
|
||||||
@ -35,7 +34,7 @@ class DocumentCategoryController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
$documentCategory = $em
|
$documentCategory = $em
|
||||||
->getRepository(\Chill\DocStoreBundle\Entity\DocumentCategory::class)
|
->getRepository(DocumentCategory::class)
|
||||||
->findOneBy(
|
->findOneBy(
|
||||||
['bundleId' => $bundleId, 'idInsideBundle' => $idInsideBundle]
|
['bundleId' => $bundleId, 'idInsideBundle' => $idInsideBundle]
|
||||||
);
|
);
|
||||||
@ -55,7 +54,7 @@ class DocumentCategoryController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
$documentCategory = $em
|
$documentCategory = $em
|
||||||
->getRepository(\Chill\DocStoreBundle\Entity\DocumentCategory::class)
|
->getRepository(DocumentCategory::class)
|
||||||
->findOneBy(
|
->findOneBy(
|
||||||
['bundleId' => $bundleId, 'idInsideBundle' => $idInsideBundle]
|
['bundleId' => $bundleId, 'idInsideBundle' => $idInsideBundle]
|
||||||
);
|
);
|
||||||
@ -138,7 +137,7 @@ class DocumentCategoryController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
$documentCategory = $em
|
$documentCategory = $em
|
||||||
->getRepository(\Chill\DocStoreBundle\Entity\DocumentCategory::class)
|
->getRepository(DocumentCategory::class)
|
||||||
->findOneBy(
|
->findOneBy(
|
||||||
['bundleId' => $bundleId, 'idInsideBundle' => $idInsideBundle]
|
['bundleId' => $bundleId, 'idInsideBundle' => $idInsideBundle]
|
||||||
);
|
);
|
||||||
|
@ -41,7 +41,7 @@ class PersonDocument extends Document implements HasCenterInterface, HasScopeInt
|
|||||||
/**
|
/**
|
||||||
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Scope")
|
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Scope")
|
||||||
*
|
*
|
||||||
* @var \Chill\MainBundle\Entity\Scope The document's center
|
* @var Scope The document's center
|
||||||
*/
|
*/
|
||||||
private ?\Chill\MainBundle\Entity\Scope $scope = null;
|
private ?\Chill\MainBundle\Entity\Scope $scope = null;
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ class EventController extends AbstractController
|
|||||||
public function deleteAction($event_id, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
public function deleteAction($event_id, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
$event = $em->getRepository(\Chill\EventBundle\Entity\Event::class)->findOneBy([
|
$event = $em->getRepository(Event::class)->findOneBy([
|
||||||
'id' => $event_id,
|
'id' => $event_id,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ class EventController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\EventBundle\Entity\Event::class)->find($event_id);
|
$entity = $em->getRepository(Event::class)->find($event_id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find Event entity.');
|
throw $this->createNotFoundException('Unable to find Event entity.');
|
||||||
@ -174,7 +174,7 @@ class EventController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($person_id);
|
$person = $em->getRepository(Person::class)->find($person_id);
|
||||||
|
|
||||||
if (null === $person) {
|
if (null === $person) {
|
||||||
throw $this->createNotFoundException('Person not found');
|
throw $this->createNotFoundException('Person not found');
|
||||||
@ -188,11 +188,11 @@ class EventController extends AbstractController
|
|||||||
$person->getCenter()
|
$person->getCenter()
|
||||||
);
|
);
|
||||||
|
|
||||||
$total = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->countByPerson($person_id);
|
$total = $em->getRepository(Participation::class)->countByPerson($person_id);
|
||||||
|
|
||||||
$paginator = $this->paginator->create($total);
|
$paginator = $this->paginator->create($total);
|
||||||
|
|
||||||
$participations = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->findByPersonInCircle(
|
$participations = $em->getRepository(Participation::class)->findByPersonInCircle(
|
||||||
$person_id,
|
$person_id,
|
||||||
$reachablesCircles,
|
$reachablesCircles,
|
||||||
$paginator->getCurrentPage()->getFirstItemNumber(),
|
$paginator->getCurrentPage()->getFirstItemNumber(),
|
||||||
@ -353,7 +353,7 @@ class EventController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\EventBundle\Entity\Event::class)->find($event_id);
|
$entity = $em->getRepository(Event::class)->find($event_id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find Event entity.');
|
throw $this->createNotFoundException('Unable to find Event entity.');
|
||||||
|
@ -22,9 +22,8 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
*/
|
*/
|
||||||
class EventTypeController extends AbstractController
|
class EventTypeController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Creates a new EventType entity.
|
* Creates a new EventType entity.
|
||||||
*
|
*
|
||||||
@ -62,7 +61,7 @@ class EventTypeController extends AbstractController
|
|||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
$entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id);
|
$entity = $em->getRepository(EventType::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find EventType entity.');
|
throw $this->createNotFoundException('Unable to find EventType entity.');
|
||||||
@ -84,7 +83,7 @@ class EventTypeController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id);
|
$entity = $em->getRepository(EventType::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find EventType entity.');
|
throw $this->createNotFoundException('Unable to find EventType entity.');
|
||||||
@ -109,7 +108,7 @@ class EventTypeController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entities = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->findAll();
|
$entities = $em->getRepository(EventType::class)->findAll();
|
||||||
|
|
||||||
return $this->render('@ChillEvent/EventType/index.html.twig', [
|
return $this->render('@ChillEvent/EventType/index.html.twig', [
|
||||||
'entities' => $entities,
|
'entities' => $entities,
|
||||||
@ -141,7 +140,7 @@ class EventTypeController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id);
|
$entity = $em->getRepository(EventType::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find EventType entity.');
|
throw $this->createNotFoundException('Unable to find EventType entity.');
|
||||||
@ -164,7 +163,7 @@ class EventTypeController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id);
|
$entity = $em->getRepository(EventType::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find EventType entity.');
|
throw $this->createNotFoundException('Unable to find EventType entity.');
|
||||||
|
@ -34,7 +34,10 @@ class ParticipationController extends AbstractController
|
|||||||
* ParticipationController constructor.
|
* ParticipationController constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly LoggerInterface $logger, private readonly TranslatorInterface $translator, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
private readonly LoggerInterface $logger,
|
||||||
|
private readonly TranslatorInterface $translator,
|
||||||
|
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry
|
||||||
|
) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/event/participation/create", name="chill_event_participation_create")
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/event/participation/create", name="chill_event_participation_create")
|
||||||
@ -240,7 +243,7 @@ class ParticipationController extends AbstractController
|
|||||||
public function deleteAction($participation_id, Request $request): Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
public function deleteAction($participation_id, Request $request): Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
$participation = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->findOneBy([
|
$participation = $em->getRepository(Participation::class)->findOneBy([
|
||||||
'id' => $participation_id,
|
'id' => $participation_id,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -320,7 +323,7 @@ class ParticipationController extends AbstractController
|
|||||||
*/
|
*/
|
||||||
public function editMultipleAction($event_id): Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
public function editMultipleAction($event_id): Response|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||||
{
|
{
|
||||||
$event = $this->managerRegistry->getRepository(\Chill\EventBundle\Entity\Event::class)
|
$event = $this->managerRegistry->getRepository(Event::class)
|
||||||
->find($event_id);
|
->find($event_id);
|
||||||
|
|
||||||
if (null === $event) {
|
if (null === $event) {
|
||||||
@ -456,8 +459,8 @@ class ParticipationController extends AbstractController
|
|||||||
*/
|
*/
|
||||||
public function updateMultipleAction(mixed $event_id, Request $request)
|
public function updateMultipleAction(mixed $event_id, Request $request)
|
||||||
{
|
{
|
||||||
/** @var \Chill\EventBundle\Entity\Event $event */
|
/** @var Event $event */
|
||||||
$event = $this->managerRegistry->getRepository(\Chill\EventBundle\Entity\Event::class)
|
$event = $this->managerRegistry->getRepository(Event::class)
|
||||||
->find($event_id);
|
->find($event_id);
|
||||||
|
|
||||||
if (null === $event) {
|
if (null === $event) {
|
||||||
@ -499,7 +502,7 @@ class ParticipationController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Symfony\Component\Form\FormInterface
|
* @return FormInterface
|
||||||
*/
|
*/
|
||||||
protected function createEditFormMultiple(Collection $participations, Event $event)
|
protected function createEditFormMultiple(Collection $participations, Event $event)
|
||||||
{
|
{
|
||||||
@ -558,7 +561,7 @@ class ParticipationController extends AbstractController
|
|||||||
// prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given`
|
// prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given`
|
||||||
|
|
||||||
if (null !== $event_id) {
|
if (null !== $event_id) {
|
||||||
$event = $em->getRepository(\Chill\EventBundle\Entity\Event::class)
|
$event = $em->getRepository(Event::class)
|
||||||
->find($event_id);
|
->find($event_id);
|
||||||
|
|
||||||
if (null === $event) {
|
if (null === $event) {
|
||||||
@ -752,7 +755,7 @@ class ParticipationController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Symfony\Component\Form\FormInterface
|
* @return FormInterface
|
||||||
*/
|
*/
|
||||||
private function createDeleteForm($participation_id)
|
private function createDeleteForm($participation_id)
|
||||||
{
|
{
|
||||||
|
@ -22,9 +22,8 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
*/
|
*/
|
||||||
class RoleController extends AbstractController
|
class RoleController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Creates a new Role entity.
|
* Creates a new Role entity.
|
||||||
*
|
*
|
||||||
@ -62,7 +61,7 @@ class RoleController extends AbstractController
|
|||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
$entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id);
|
$entity = $em->getRepository(Role::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find Role entity.');
|
throw $this->createNotFoundException('Unable to find Role entity.');
|
||||||
@ -84,7 +83,7 @@ class RoleController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id);
|
$entity = $em->getRepository(Role::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find Role entity.');
|
throw $this->createNotFoundException('Unable to find Role entity.');
|
||||||
@ -109,7 +108,7 @@ class RoleController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entities = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->findAll();
|
$entities = $em->getRepository(Role::class)->findAll();
|
||||||
|
|
||||||
return $this->render('@ChillEvent/Role/index.html.twig', [
|
return $this->render('@ChillEvent/Role/index.html.twig', [
|
||||||
'entities' => $entities,
|
'entities' => $entities,
|
||||||
@ -141,7 +140,7 @@ class RoleController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id);
|
$entity = $em->getRepository(Role::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find Role entity.');
|
throw $this->createNotFoundException('Unable to find Role entity.');
|
||||||
@ -164,7 +163,7 @@ class RoleController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id);
|
$entity = $em->getRepository(Role::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find Role entity.');
|
throw $this->createNotFoundException('Unable to find Role entity.');
|
||||||
|
@ -22,9 +22,8 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
*/
|
*/
|
||||||
class StatusController extends AbstractController
|
class StatusController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Creates a new Status entity.
|
* Creates a new Status entity.
|
||||||
*
|
*
|
||||||
@ -62,7 +61,7 @@ class StatusController extends AbstractController
|
|||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
$entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id);
|
$entity = $em->getRepository(Status::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find Status entity.');
|
throw $this->createNotFoundException('Unable to find Status entity.');
|
||||||
@ -84,7 +83,7 @@ class StatusController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id);
|
$entity = $em->getRepository(Status::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find Status entity.');
|
throw $this->createNotFoundException('Unable to find Status entity.');
|
||||||
@ -109,7 +108,7 @@ class StatusController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entities = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->findAll();
|
$entities = $em->getRepository(Status::class)->findAll();
|
||||||
|
|
||||||
return $this->render('@ChillEvent/Status/index.html.twig', [
|
return $this->render('@ChillEvent/Status/index.html.twig', [
|
||||||
'entities' => $entities,
|
'entities' => $entities,
|
||||||
@ -141,7 +140,7 @@ class StatusController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id);
|
$entity = $em->getRepository(Status::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find Status entity.');
|
throw $this->createNotFoundException('Unable to find Status entity.');
|
||||||
@ -164,7 +163,7 @@ class StatusController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id);
|
$entity = $em->getRepository(Status::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find Status entity.');
|
throw $this->createNotFoundException('Unable to find Status entity.');
|
||||||
|
@ -73,7 +73,7 @@ class LoadParticipation extends AbstractFixture implements OrderedFixtureInterfa
|
|||||||
->findBy(['center' => $center]);
|
->findBy(['center' => $center]);
|
||||||
$events = $this->createEvents($center, $manager);
|
$events = $this->createEvents($center, $manager);
|
||||||
|
|
||||||
/** @var \Chill\PersonBundle\Entity\Person $person */
|
/** @var Person $person */
|
||||||
foreach ($people as $person) {
|
foreach ($people as $person) {
|
||||||
$nb = random_int(0, 3);
|
$nb = random_int(0, 3);
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ final class EventSearchTest extends WebTestCase
|
|||||||
/**
|
/**
|
||||||
* The eventSearch service, which is used to search events.
|
* The eventSearch service, which is used to search events.
|
||||||
*
|
*
|
||||||
* @var \Chill\EventBundle\Search\EventSearch
|
* @var EventSearch
|
||||||
*/
|
*/
|
||||||
protected $eventSearch;
|
protected $eventSearch;
|
||||||
|
|
||||||
|
@ -31,9 +31,8 @@ abstract class AbstractCRUDController extends AbstractController
|
|||||||
* This configuration si defined by `chill_main['crud']` or `chill_main['apis']`
|
* This configuration si defined by `chill_main['crud']` or `chill_main['apis']`
|
||||||
*/
|
*/
|
||||||
protected array $crudConfig = [];
|
protected array $crudConfig = [];
|
||||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
|
||||||
{
|
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the role given from the config.
|
* get the role given from the config.
|
||||||
|
@ -23,9 +23,8 @@ use Symfony\Component\Validator\ConstraintViolationListInterface;
|
|||||||
|
|
||||||
class ApiController extends AbstractCRUDController
|
class ApiController extends AbstractCRUDController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Base method for handling api action.
|
* Base method for handling api action.
|
||||||
*
|
*
|
||||||
|
@ -60,7 +60,6 @@ class CRUDRoutesLoader extends Loader
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param null $type
|
* @param null $type
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public function supports($resource, $type = null): bool
|
public function supports($resource, $type = null): bool
|
||||||
{
|
{
|
||||||
|
@ -83,7 +83,7 @@ class LoadAndUpdateLanguagesCommand extends Command
|
|||||||
$languages = [];
|
$languages = [];
|
||||||
|
|
||||||
foreach ($chillAvailableLanguages as $avLang) {
|
foreach ($chillAvailableLanguages as $avLang) {
|
||||||
$languages[$avLang] = \Symfony\Component\Intl\Languages::getNames();
|
$languages[$avLang] = Languages::getNames();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (Languages::getNames() as $code => $lang) {
|
foreach (Languages::getNames() as $code => $lang) {
|
||||||
@ -105,7 +105,7 @@ class LoadAndUpdateLanguagesCommand extends Command
|
|||||||
$languageDB = $em->getRepository(Language::class)->find($code);
|
$languageDB = $em->getRepository(Language::class)->find($code);
|
||||||
|
|
||||||
if (null === $languageDB) {
|
if (null === $languageDB) {
|
||||||
$languageDB = new \Chill\MainBundle\Entity\Language();
|
$languageDB = new Language();
|
||||||
$languageDB->setId($code);
|
$languageDB->setId($code);
|
||||||
$em->persist($languageDB);
|
$em->persist($languageDB);
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ class LoadCountriesCommand extends Command
|
|||||||
$names[$language] = Countries::getName($code, $language);
|
$names[$language] = Countries::getName($code, $language);
|
||||||
}
|
}
|
||||||
|
|
||||||
$country = new \Chill\MainBundle\Entity\Country();
|
$country = new Country();
|
||||||
$country->setName($names)->setCountryCode($code);
|
$country->setName($names)->setCountryCode($code);
|
||||||
$countryEntities[] = $country;
|
$countryEntities[] = $country;
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ class SetPasswordCommand extends Command
|
|||||||
public function _getUser($username)
|
public function _getUser($username)
|
||||||
{
|
{
|
||||||
return $this->entityManager
|
return $this->entityManager
|
||||||
->getRepository(\Chill\MainBundle\Entity\User::class)
|
->getRepository(User::class)
|
||||||
->findOneBy(['username' => $username]);
|
->findOneBy(['username' => $username]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,9 +20,8 @@ use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
|||||||
|
|
||||||
class AddressApiController extends ApiController
|
class AddressApiController extends ApiController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Duplicate an existing address.
|
* Duplicate an existing address.
|
||||||
*
|
*
|
||||||
|
@ -70,7 +70,7 @@ class ExportController extends AbstractController
|
|||||||
*/
|
*/
|
||||||
public function downloadResultAction(Request $request, mixed $alias)
|
public function downloadResultAction(Request $request, mixed $alias)
|
||||||
{
|
{
|
||||||
/** @var \Chill\MainBundle\Export\ExportManager $exportManager */
|
/** @var ExportManager $exportManager */
|
||||||
$exportManager = $this->exportManager;
|
$exportManager = $this->exportManager;
|
||||||
$export = $exportManager->getExport($alias);
|
$export = $exportManager->getExport($alias);
|
||||||
$key = $request->query->get('key', null);
|
$key = $request->query->get('key', null);
|
||||||
@ -108,13 +108,13 @@ class ExportController extends AbstractController
|
|||||||
*
|
*
|
||||||
* @param string $alias
|
* @param string $alias
|
||||||
*
|
*
|
||||||
* @return \Symfony\Component\HttpFoundation\Response
|
* @return Response
|
||||||
*
|
*
|
||||||
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/exports/generate/{alias}", name="chill_main_export_generate", methods={"GET"})
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/exports/generate/{alias}", name="chill_main_export_generate", methods={"GET"})
|
||||||
*/
|
*/
|
||||||
public function generateAction(Request $request, $alias)
|
public function generateAction(Request $request, $alias)
|
||||||
{
|
{
|
||||||
/** @var \Chill\MainBundle\Export\ExportManager $exportManager */
|
/** @var ExportManager $exportManager */
|
||||||
$exportManager = $this->exportManager;
|
$exportManager = $this->exportManager;
|
||||||
$key = $request->query->get('key', null);
|
$key = $request->query->get('key', null);
|
||||||
$savedExport = $this->getSavedExportFromRequest($request);
|
$savedExport = $this->getSavedExportFromRequest($request);
|
||||||
@ -274,7 +274,7 @@ class ExportController extends AbstractController
|
|||||||
*/
|
*/
|
||||||
protected function createCreateFormExport(string $alias, string $step, array $data, ?SavedExport $savedExport): FormInterface
|
protected function createCreateFormExport(string $alias, string $step, array $data, ?SavedExport $savedExport): FormInterface
|
||||||
{
|
{
|
||||||
/** @var \Chill\MainBundle\Export\ExportManager $exportManager */
|
/** @var ExportManager $exportManager */
|
||||||
$exportManager = $this->exportManager;
|
$exportManager = $this->exportManager;
|
||||||
$isGenerate = str_starts_with($step, 'generate_');
|
$isGenerate = str_starts_with($step, 'generate_');
|
||||||
|
|
||||||
@ -444,7 +444,7 @@ class ExportController extends AbstractController
|
|||||||
*
|
*
|
||||||
* @param string $alias
|
* @param string $alias
|
||||||
*
|
*
|
||||||
* @return \Symfony\Component\HttpFoundation\RedirectResponse
|
* @return RedirectResponse
|
||||||
*/
|
*/
|
||||||
private function forwardToGenerate(Request $request, DirectExportInterface|ExportInterface $export, $alias, ?SavedExport $savedExport)
|
private function forwardToGenerate(Request $request, DirectExportInterface|ExportInterface $export, $alias, ?SavedExport $savedExport)
|
||||||
{
|
{
|
||||||
@ -452,7 +452,7 @@ class ExportController extends AbstractController
|
|||||||
$dataFormatter = $this->session->get('formatter_step_raw', null);
|
$dataFormatter = $this->session->get('formatter_step_raw', null);
|
||||||
$dataExport = $this->session->get('export_step_raw', null);
|
$dataExport = $this->session->get('export_step_raw', null);
|
||||||
|
|
||||||
if (null === $dataFormatter && $export instanceof \Chill\MainBundle\Export\ExportInterface) {
|
if (null === $dataFormatter && $export instanceof ExportInterface) {
|
||||||
return $this->redirectToRoute('chill_main_export_new', [
|
return $this->redirectToRoute('chill_main_export_new', [
|
||||||
'alias' => $alias,
|
'alias' => $alias,
|
||||||
'step' => $this->getNextStep('generate', $export, true),
|
'step' => $this->getNextStep('generate', $export, true),
|
||||||
@ -531,7 +531,7 @@ class ExportController extends AbstractController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var \Chill\MainBundle\Export\ExportManager $exportManager */
|
/** @var ExportManager $exportManager */
|
||||||
$exportManager = $this->exportManager;
|
$exportManager = $this->exportManager;
|
||||||
|
|
||||||
$form = $this->createCreateFormExport($alias, 'centers', [], $savedExport);
|
$form = $this->createCreateFormExport($alias, 'centers', [], $savedExport);
|
||||||
@ -620,11 +620,11 @@ class ExportController extends AbstractController
|
|||||||
return 'export';
|
return 'export';
|
||||||
|
|
||||||
case 'export':
|
case 'export':
|
||||||
if ($export instanceof \Chill\MainBundle\Export\ExportInterface) {
|
if ($export instanceof ExportInterface) {
|
||||||
return $reverse ? 'centers' : 'formatter';
|
return $reverse ? 'centers' : 'formatter';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($export instanceof \Chill\MainBundle\Export\DirectExportInterface) {
|
if ($export instanceof DirectExportInterface) {
|
||||||
return $reverse ? 'centers' : 'generate';
|
return $reverse ? 'centers' : 'generate';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,8 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
class ScopeController extends AbstractController
|
class ScopeController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly EntityManagerInterface $entityManager, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry
|
private readonly EntityManagerInterface $entityManager,
|
||||||
|
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -85,7 +86,7 @@ class ScopeController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$entities = $em->getRepository(\Chill\MainBundle\Entity\Scope::class)->findAll();
|
$entities = $em->getRepository(Scope::class)->findAll();
|
||||||
|
|
||||||
return $this->render('@ChillMain/Scope/index.html.twig', [
|
return $this->render('@ChillMain/Scope/index.html.twig', [
|
||||||
'entities' => $entities,
|
'entities' => $entities,
|
||||||
@ -115,7 +116,7 @@ class ScopeController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$scope = $em->getRepository(\Chill\MainBundle\Entity\Scope::class)->find($id);
|
$scope = $em->getRepository(Scope::class)->find($id);
|
||||||
|
|
||||||
if (!$scope) {
|
if (!$scope) {
|
||||||
throw $this->createNotFoundException('Unable to find Scope entity.');
|
throw $this->createNotFoundException('Unable to find Scope entity.');
|
||||||
|
@ -45,7 +45,7 @@ class SearchController extends AbstractController
|
|||||||
/** @var Chill\MainBundle\Search\HasAdvancedSearchFormInterface $variable */
|
/** @var Chill\MainBundle\Search\HasAdvancedSearchFormInterface $variable */
|
||||||
$search = $this->searchProvider
|
$search = $this->searchProvider
|
||||||
->getHasAdvancedFormByName($name);
|
->getHasAdvancedFormByName($name);
|
||||||
} catch (\Chill\MainBundle\Search\UnknowSearchNameException) {
|
} catch (UnknowSearchNameException) {
|
||||||
throw $this->createNotFoundException('no advanced search for '."{$name}");
|
throw $this->createNotFoundException('no advanced search for '."{$name}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ class UserController extends CRUDController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$user = $em->getRepository(\Chill\MainBundle\Entity\User::class)->find($uid);
|
$user = $em->getRepository(User::class)->find($uid);
|
||||||
|
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
throw $this->createNotFoundException('Unable to find User entity.');
|
throw $this->createNotFoundException('Unable to find User entity.');
|
||||||
@ -110,13 +110,13 @@ class UserController extends CRUDController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$user = $em->getRepository(\Chill\MainBundle\Entity\User::class)->find($uid);
|
$user = $em->getRepository(User::class)->find($uid);
|
||||||
|
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
throw $this->createNotFoundException('Unable to find User entity.');
|
throw $this->createNotFoundException('Unable to find User entity.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$groupCenter = $em->getRepository(\Chill\MainBundle\Entity\GroupCenter::class)
|
$groupCenter = $em->getRepository(GroupCenter::class)
|
||||||
->find($gcid);
|
->find($gcid);
|
||||||
|
|
||||||
if (!$groupCenter) {
|
if (!$groupCenter) {
|
||||||
@ -434,7 +434,7 @@ class UserController extends CRUDController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$groupCenterManaged = $em->getRepository(\Chill\MainBundle\Entity\GroupCenter::class)
|
$groupCenterManaged = $em->getRepository(GroupCenter::class)
|
||||||
->findOneBy([
|
->findOneBy([
|
||||||
'center' => $groupCenter->getCenter(),
|
'center' => $groupCenter->getCenter(),
|
||||||
'permissionsGroup' => $groupCenter->getPermissionsGroup(),
|
'permissionsGroup' => $groupCenter->getPermissionsGroup(),
|
||||||
|
@ -570,7 +570,7 @@ class ChillMainExtension extends Extension implements
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'class' => \Chill\MainBundle\Entity\UserJob::class,
|
'class' => UserJob::class,
|
||||||
'name' => 'user_job',
|
'name' => 'user_job',
|
||||||
'base_path' => '/api/1.0/main/user-job',
|
'base_path' => '/api/1.0/main/user-job',
|
||||||
'base_role' => 'ROLE_USER',
|
'base_role' => 'ROLE_USER',
|
||||||
@ -634,7 +634,7 @@ class ChillMainExtension extends Extension implements
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'class' => \Chill\MainBundle\Entity\Country::class,
|
'class' => Country::class,
|
||||||
'name' => 'country',
|
'name' => 'country',
|
||||||
'base_path' => '/api/1.0/main/country',
|
'base_path' => '/api/1.0/main/country',
|
||||||
'base_role' => 'ROLE_USER',
|
'base_role' => 'ROLE_USER',
|
||||||
@ -654,7 +654,7 @@ class ChillMainExtension extends Extension implements
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'class' => \Chill\MainBundle\Entity\User::class,
|
'class' => User::class,
|
||||||
'controller' => \Chill\MainBundle\Controller\UserApiController::class,
|
'controller' => \Chill\MainBundle\Controller\UserApiController::class,
|
||||||
'name' => 'user',
|
'name' => 'user',
|
||||||
'base_path' => '/api/1.0/main/user',
|
'base_path' => '/api/1.0/main/user',
|
||||||
@ -696,7 +696,7 @@ class ChillMainExtension extends Extension implements
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'class' => \Chill\MainBundle\Entity\Location::class,
|
'class' => Location::class,
|
||||||
'controller' => \Chill\MainBundle\Controller\LocationApiController::class,
|
'controller' => \Chill\MainBundle\Controller\LocationApiController::class,
|
||||||
'name' => 'location',
|
'name' => 'location',
|
||||||
'base_path' => '/api/1.0/main/location',
|
'base_path' => '/api/1.0/main/location',
|
||||||
@ -718,7 +718,7 @@ class ChillMainExtension extends Extension implements
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'class' => \Chill\MainBundle\Entity\LocationType::class,
|
'class' => LocationType::class,
|
||||||
'controller' => \Chill\MainBundle\Controller\LocationTypeApiController::class,
|
'controller' => \Chill\MainBundle\Controller\LocationTypeApiController::class,
|
||||||
'name' => 'location_type',
|
'name' => 'location_type',
|
||||||
'base_path' => '/api/1.0/main/location-type',
|
'base_path' => '/api/1.0/main/location-type',
|
||||||
@ -739,7 +739,7 @@ class ChillMainExtension extends Extension implements
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'class' => \Chill\MainBundle\Entity\Civility::class,
|
'class' => Civility::class,
|
||||||
'name' => 'civility',
|
'name' => 'civility',
|
||||||
'base_path' => '/api/1.0/main/civility',
|
'base_path' => '/api/1.0/main/civility',
|
||||||
'base_role' => 'ROLE_USER',
|
'base_role' => 'ROLE_USER',
|
||||||
|
@ -73,8 +73,8 @@ class PermissionsGroup
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->roleScopes = new \Doctrine\Common\Collections\ArrayCollection();
|
$this->roleScopes = new ArrayCollection();
|
||||||
$this->groupCenters = new \Doctrine\Common\Collections\ArrayCollection();
|
$this->groupCenters = new ArrayCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRoleScope(RoleScope $roleScope)
|
public function addRoleScope(RoleScope $roleScope)
|
||||||
|
@ -189,7 +189,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Chill\MainBundle\Entity\User
|
* @return User
|
||||||
*/
|
*/
|
||||||
public function addGroupCenter(GroupCenter $groupCenter)
|
public function addGroupCenter(GroupCenter $groupCenter)
|
||||||
{
|
{
|
||||||
|
@ -100,7 +100,7 @@ class CSVListFormatter implements FormatterInterface
|
|||||||
* @param array $filtersData an array containing the filters data. The key are the filters id, and the value are the data
|
* @param array $filtersData an array containing the filters data. The key are the filters id, and the value are the data
|
||||||
* @param array $aggregatorsData an array containing the aggregators data. The key are the filters id, and the value are the data
|
* @param array $aggregatorsData an array containing the aggregators data. The key are the filters id, and the value are the data
|
||||||
*
|
*
|
||||||
* @return \Symfony\Component\HttpFoundation\Response The response to be shown
|
* @return Response The response to be shown
|
||||||
*/
|
*/
|
||||||
public function getResponse(
|
public function getResponse(
|
||||||
$result,
|
$result,
|
||||||
|
@ -99,7 +99,7 @@ class CSVPivotedListFormatter implements FormatterInterface
|
|||||||
* @param array $filtersData an array containing the filters data. The key are the filters id, and the value are the data
|
* @param array $filtersData an array containing the filters data. The key are the filters id, and the value are the data
|
||||||
* @param array $aggregatorsData an array containing the aggregators data. The key are the filters id, and the value are the data
|
* @param array $aggregatorsData an array containing the aggregators data. The key are the filters id, and the value are the data
|
||||||
*
|
*
|
||||||
* @return \Symfony\Component\HttpFoundation\Response The response to be shown
|
* @return Response The response to be shown
|
||||||
*/
|
*/
|
||||||
public function getResponse(
|
public function getResponse(
|
||||||
$result,
|
$result,
|
||||||
|
@ -112,7 +112,7 @@ class SpreadsheetListFormatter implements FormatterInterface
|
|||||||
* @param array $filtersData an array containing the filters data. The key are the filters id, and the value are the data
|
* @param array $filtersData an array containing the filters data. The key are the filters id, and the value are the data
|
||||||
* @param array $aggregatorsData an array containing the aggregators data. The key are the filters id, and the value are the data
|
* @param array $aggregatorsData an array containing the aggregators data. The key are the filters id, and the value are the data
|
||||||
*
|
*
|
||||||
* @return \Symfony\Component\HttpFoundation\Response The response to be shown
|
* @return Response The response to be shown
|
||||||
*/
|
*/
|
||||||
public function getResponse(
|
public function getResponse(
|
||||||
$result,
|
$result,
|
||||||
|
@ -83,7 +83,7 @@ trait AppendScopeChoiceTypeTrait
|
|||||||
{
|
{
|
||||||
$resolver
|
$resolver
|
||||||
->setRequired(['center', 'role'])
|
->setRequired(['center', 'role'])
|
||||||
->setAllowedTypes('center', \Chill\MainBundle\Entity\Center::class)
|
->setAllowedTypes('center', Center::class)
|
||||||
->setAllowedTypes('role', 'string');
|
->setAllowedTypes('role', 'string');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,10 +23,10 @@ class ComposedGroupCenterType extends AbstractType
|
|||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder->add('permissionsgroup', EntityType::class, [
|
$builder->add('permissionsgroup', EntityType::class, [
|
||||||
'class' => \Chill\MainBundle\Entity\PermissionsGroup::class,
|
'class' => PermissionsGroup::class,
|
||||||
'choice_label' => static fn (PermissionsGroup $group) => $group->getName(),
|
'choice_label' => static fn (PermissionsGroup $group) => $group->getName(),
|
||||||
])->add('center', EntityType::class, [
|
])->add('center', EntityType::class, [
|
||||||
'class' => \Chill\MainBundle\Entity\Center::class,
|
'class' => Center::class,
|
||||||
'choice_label' => static fn (Center $center) => $center->getName(),
|
'choice_label' => static fn (Center $center) => $center->getName(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ class Select2CountryType extends AbstractType
|
|||||||
asort($choices, \SORT_STRING | \SORT_FLAG_CASE);
|
asort($choices, \SORT_STRING | \SORT_FLAG_CASE);
|
||||||
|
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
'class' => \Chill\MainBundle\Entity\Country::class,
|
'class' => Country::class,
|
||||||
'choices' => array_combine(array_values($choices), array_keys($choices)),
|
'choices' => array_combine(array_values($choices), array_keys($choices)),
|
||||||
'preferred_choices' => array_combine(array_values($preferredChoices), array_keys($preferredChoices)),
|
'preferred_choices' => array_combine(array_values($preferredChoices), array_keys($preferredChoices)),
|
||||||
]);
|
]);
|
||||||
|
@ -52,7 +52,7 @@ class Select2LanguageType extends AbstractType
|
|||||||
asort($choices, \SORT_STRING | \SORT_FLAG_CASE);
|
asort($choices, \SORT_STRING | \SORT_FLAG_CASE);
|
||||||
|
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
'class' => \Chill\MainBundle\Entity\Language::class,
|
'class' => Language::class,
|
||||||
'choices' => array_combine(array_values($choices), array_keys($choices)),
|
'choices' => array_combine(array_values($choices), array_keys($choices)),
|
||||||
'preferred_choices' => array_combine(array_values($preferredChoices), array_keys($preferredChoices)),
|
'preferred_choices' => array_combine(array_values($preferredChoices), array_keys($preferredChoices)),
|
||||||
]);
|
]);
|
||||||
|
@ -38,7 +38,7 @@ class WorkflowStepType extends AbstractType
|
|||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
/** @var \Chill\MainBundle\Entity\Workflow\EntityWorkflow $entityWorkflow */
|
/** @var EntityWorkflow $entityWorkflow */
|
||||||
$entityWorkflow = $options['entity_workflow'];
|
$entityWorkflow = $options['entity_workflow'];
|
||||||
$handler = $this->entityWorkflowManager->getHandler($entityWorkflow);
|
$handler = $this->entityWorkflowManager->getHandler($entityWorkflow);
|
||||||
$workflow = $this->registry->get($entityWorkflow, $entityWorkflow->getWorkflowName());
|
$workflow = $this->registry->get($entityWorkflow, $entityWorkflow->getWorkflowName());
|
||||||
|
@ -137,7 +137,7 @@ class Paginator implements PaginatorInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Chill\MainBundle\Pagination\Page
|
* @return Page
|
||||||
*
|
*
|
||||||
* @throws \RuntimeException if the next page does not exists
|
* @throws \RuntimeException if the next page does not exists
|
||||||
*/
|
*/
|
||||||
|
@ -43,7 +43,7 @@ class GeographicalUnitByAddressApiControllerTest extends WebTestCase
|
|||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
$nb = $em->createQuery('SELECT COUNT(a) FROM '.Address::class.' a')->getSingleScalarResult();
|
$nb = $em->createQuery('SELECT COUNT(a) FROM '.Address::class.' a')->getSingleScalarResult();
|
||||||
/** @var \Chill\MainBundle\Entity\Address $random */
|
/** @var Address $random */
|
||||||
$random = $em->createQuery('SELECT a FROM '.Address::class.' a')
|
$random = $em->createQuery('SELECT a FROM '.Address::class.' a')
|
||||||
->setFirstResult(random_int(0, $nb))
|
->setFirstResult(random_int(0, $nb))
|
||||||
->setMaxResults(1)
|
->setMaxResults(1)
|
||||||
|
@ -58,7 +58,7 @@ final class ExportManagerTest extends KernelTestCase
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->prophet = new \Prophecy\Prophet();
|
$this->prophet = new Prophet();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function tearDown(): void
|
protected function tearDown(): void
|
||||||
@ -370,7 +370,7 @@ final class ExportManagerTest extends KernelTestCase
|
|||||||
$user = $this->prepareUser([]);
|
$user = $this->prepareUser([]);
|
||||||
|
|
||||||
$authorizationChecker = $this->prophet->prophesize();
|
$authorizationChecker = $this->prophet->prophesize();
|
||||||
$authorizationChecker->willImplement(\Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface::class);
|
$authorizationChecker->willImplement(AuthorizationCheckerInterface::class);
|
||||||
$authorizationChecker->isGranted('CHILL_STAT_DUMMY', $center)
|
$authorizationChecker->isGranted('CHILL_STAT_DUMMY', $center)
|
||||||
->willReturn(true);
|
->willReturn(true);
|
||||||
|
|
||||||
@ -399,7 +399,7 @@ final class ExportManagerTest extends KernelTestCase
|
|||||||
$user = $this->prepareUser([]);
|
$user = $this->prepareUser([]);
|
||||||
|
|
||||||
$authorizationChecker = $this->prophet->prophesize();
|
$authorizationChecker = $this->prophet->prophesize();
|
||||||
$authorizationChecker->willImplement(\Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface::class);
|
$authorizationChecker->willImplement(AuthorizationCheckerInterface::class);
|
||||||
$authorizationChecker->isGranted('CHILL_STAT_DUMMY', $center)
|
$authorizationChecker->isGranted('CHILL_STAT_DUMMY', $center)
|
||||||
->willReturn(true);
|
->willReturn(true);
|
||||||
$authorizationChecker->isGranted('CHILL_STAT_DUMMY', $centerB)
|
$authorizationChecker->isGranted('CHILL_STAT_DUMMY', $centerB)
|
||||||
@ -435,7 +435,7 @@ final class ExportManagerTest extends KernelTestCase
|
|||||||
);
|
);
|
||||||
|
|
||||||
$export = $this->prophet->prophesize();
|
$export = $this->prophet->prophesize();
|
||||||
$export->willImplement(\Chill\MainBundle\Export\ExportInterface::class);
|
$export->willImplement(ExportInterface::class);
|
||||||
$export->requiredRole()->willReturn('CHILL_STAT_DUMMY');
|
$export->requiredRole()->willReturn('CHILL_STAT_DUMMY');
|
||||||
|
|
||||||
$result = $exportManager->isGrantedForElement($export->reveal(), null, []);
|
$result = $exportManager->isGrantedForElement($export->reveal(), null, []);
|
||||||
|
@ -258,8 +258,8 @@ final class AuthorizationHelperTest extends KernelTestCase
|
|||||||
]);
|
]);
|
||||||
$helper = $this->getAuthorizationHelper();
|
$helper = $this->getAuthorizationHelper();
|
||||||
$entity = $this->prophesize();
|
$entity = $this->prophesize();
|
||||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class);
|
$entity->willImplement('\\'.HasCenterInterface::class);
|
||||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasScopeInterface::class);
|
$entity->willImplement('\\'.HasScopeInterface::class);
|
||||||
$entity->getCenter()->willReturn($center);
|
$entity->getCenter()->willReturn($center);
|
||||||
$entity->getScope()->willReturn($scope);
|
$entity->getScope()->willReturn($scope);
|
||||||
|
|
||||||
@ -383,7 +383,7 @@ final class AuthorizationHelperTest extends KernelTestCase
|
|||||||
]);
|
]);
|
||||||
$helper = $this->getAuthorizationHelper();
|
$helper = $this->getAuthorizationHelper();
|
||||||
$entity = $this->prophesize();
|
$entity = $this->prophesize();
|
||||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class);
|
$entity->willImplement('\\'.HasCenterInterface::class);
|
||||||
$entity->getCenter()->willReturn($center);
|
$entity->getCenter()->willReturn($center);
|
||||||
|
|
||||||
$this->assertTrue($helper->userHasAccess(
|
$this->assertTrue($helper->userHasAccess(
|
||||||
@ -407,7 +407,7 @@ final class AuthorizationHelperTest extends KernelTestCase
|
|||||||
|
|
||||||
$helper = $this->getAuthorizationHelper();
|
$helper = $this->getAuthorizationHelper();
|
||||||
$entity = $this->prophesize();
|
$entity = $this->prophesize();
|
||||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class);
|
$entity->willImplement('\\'.HasCenterInterface::class);
|
||||||
$entity->getCenter()->willReturn($center);
|
$entity->getCenter()->willReturn($center);
|
||||||
|
|
||||||
$this->assertTrue($helper->userHasAccess(
|
$this->assertTrue($helper->userHasAccess(
|
||||||
@ -431,8 +431,8 @@ final class AuthorizationHelperTest extends KernelTestCase
|
|||||||
]);
|
]);
|
||||||
$helper = $this->getAuthorizationHelper();
|
$helper = $this->getAuthorizationHelper();
|
||||||
$entity = $this->prophesize();
|
$entity = $this->prophesize();
|
||||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class);
|
$entity->willImplement('\\'.HasCenterInterface::class);
|
||||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasScopeInterface::class);
|
$entity->willImplement('\\'.HasScopeInterface::class);
|
||||||
$entity->getCenter()->willReturn($centerB);
|
$entity->getCenter()->willReturn($centerB);
|
||||||
$entity->getScope()->willReturn($scope);
|
$entity->getScope()->willReturn($scope);
|
||||||
|
|
||||||
@ -452,7 +452,7 @@ final class AuthorizationHelperTest extends KernelTestCase
|
|||||||
]);
|
]);
|
||||||
$helper = $this->getAuthorizationHelper();
|
$helper = $this->getAuthorizationHelper();
|
||||||
$entity = $this->prophesize();
|
$entity = $this->prophesize();
|
||||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class);
|
$entity->willImplement('\\'.HasCenterInterface::class);
|
||||||
$entity->getCenter()->willReturn($center);
|
$entity->getCenter()->willReturn($center);
|
||||||
|
|
||||||
$this->assertFalse($helper->userHasAccess($user, $entity->reveal(), 'CHILL_ROLE'));
|
$this->assertFalse($helper->userHasAccess($user, $entity->reveal(), 'CHILL_ROLE'));
|
||||||
@ -471,8 +471,8 @@ final class AuthorizationHelperTest extends KernelTestCase
|
|||||||
]);
|
]);
|
||||||
$helper = $this->getAuthorizationHelper();
|
$helper = $this->getAuthorizationHelper();
|
||||||
$entity = $this->prophesize();
|
$entity = $this->prophesize();
|
||||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class);
|
$entity->willImplement('\\'.HasCenterInterface::class);
|
||||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasScopeInterface::class);
|
$entity->willImplement('\\'.HasScopeInterface::class);
|
||||||
$entity->getCenter()->willReturn($center);
|
$entity->getCenter()->willReturn($center);
|
||||||
$entity->getScope()->willReturn($scope);
|
$entity->getScope()->willReturn($scope);
|
||||||
|
|
||||||
@ -503,7 +503,7 @@ final class AuthorizationHelperTest extends KernelTestCase
|
|||||||
]);
|
]);
|
||||||
$helper = $this->getAuthorizationHelper();
|
$helper = $this->getAuthorizationHelper();
|
||||||
$entity = $this->prophesize();
|
$entity = $this->prophesize();
|
||||||
$entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class);
|
$entity->willImplement('\\'.HasCenterInterface::class);
|
||||||
$entity->getCenter()->willReturn($centerA);
|
$entity->getCenter()->willReturn($centerA);
|
||||||
|
|
||||||
$this->assertFalse($helper->userHasAccess($user, $entity->reveal(), 'CHILL_ROLE'));
|
$this->assertFalse($helper->userHasAccess($user, $entity->reveal(), 'CHILL_ROLE'));
|
||||||
@ -577,7 +577,7 @@ final class AuthorizationHelperTest extends KernelTestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Chill\MainBundle\Security\Authorization\AuthorizationHelper
|
* @return AuthorizationHelper
|
||||||
*/
|
*/
|
||||||
private function getAuthorizationHelper()
|
private function getAuthorizationHelper()
|
||||||
{
|
{
|
||||||
|
@ -23,9 +23,8 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
*/
|
*/
|
||||||
class EntityPersonCRUDController extends CRUDController
|
class EntityPersonCRUDController extends CRUDController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Override the base method to add a filtering step to a person.
|
* Override the base method to add a filtering step to a person.
|
||||||
*
|
*
|
||||||
|
@ -20,9 +20,8 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
|
|
||||||
class OneToOneEntityPersonCRUDController extends CRUDController
|
class OneToOneEntityPersonCRUDController extends CRUDController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
protected function generateRedirectOnCreateRoute($action, Request $request, $entity): string
|
protected function generateRedirectOnCreateRoute($action, Request $request, $entity): string
|
||||||
{
|
{
|
||||||
throw new \BadMethodCallException('Not implemented yet.');
|
throw new \BadMethodCallException('Not implemented yet.');
|
||||||
|
@ -224,7 +224,7 @@ final class AccompanyingCourseWorkController extends AbstractController
|
|||||||
|
|
||||||
if (1 < count($types)) {
|
if (1 < count($types)) {
|
||||||
$filterBuilder
|
$filterBuilder
|
||||||
->addEntityChoice('typesFilter', 'accompanying_course_work.types_filter', \Chill\PersonBundle\Entity\SocialWork\SocialAction::class, $types, [
|
->addEntityChoice('typesFilter', 'accompanying_course_work.types_filter', SocialAction::class, $types, [
|
||||||
'choice_label' => fn (SocialAction $sa) => $this->translatableStringHelper->localize($sa->getTitle()),
|
'choice_label' => fn (SocialAction $sa) => $this->translatableStringHelper->localize($sa->getTitle()),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -432,7 +432,7 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
private function _getPerson(int $id): Person
|
private function _getPerson(int $id): Person
|
||||||
{
|
{
|
||||||
$person = $this->managerRegistry->getManager()
|
$person = $this->managerRegistry->getManager()
|
||||||
->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($id);
|
->getRepository(Person::class)->find($id);
|
||||||
|
|
||||||
if (null === $person) {
|
if (null === $person) {
|
||||||
throw $this->createNotFoundException('Person not found');
|
throw $this->createNotFoundException('Person not found');
|
||||||
|
@ -21,9 +21,8 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
*/
|
*/
|
||||||
class ClosingMotiveController extends CRUDController
|
class ClosingMotiveController extends CRUDController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @param string $action
|
* @param string $action
|
||||||
*/
|
*/
|
||||||
|
@ -37,7 +37,7 @@ class PersonAddressController extends AbstractController
|
|||||||
public function createAction(mixed $person_id, Request $request)
|
public function createAction(mixed $person_id, Request $request)
|
||||||
{
|
{
|
||||||
$person = $this->managerRegistry->getManager()
|
$person = $this->managerRegistry->getManager()
|
||||||
->getRepository(\Chill\PersonBundle\Entity\Person::class)
|
->getRepository(Person::class)
|
||||||
->find($person_id);
|
->find($person_id);
|
||||||
|
|
||||||
if (null === $person) {
|
if (null === $person) {
|
||||||
@ -94,7 +94,7 @@ class PersonAddressController extends AbstractController
|
|||||||
public function editAction(mixed $person_id, mixed $address_id)
|
public function editAction(mixed $person_id, mixed $address_id)
|
||||||
{
|
{
|
||||||
$person = $this->managerRegistry->getManager()
|
$person = $this->managerRegistry->getManager()
|
||||||
->getRepository(\Chill\PersonBundle\Entity\Person::class)
|
->getRepository(Person::class)
|
||||||
->find($person_id);
|
->find($person_id);
|
||||||
|
|
||||||
if (null === $person) {
|
if (null === $person) {
|
||||||
@ -124,7 +124,7 @@ class PersonAddressController extends AbstractController
|
|||||||
public function listAction(mixed $person_id)
|
public function listAction(mixed $person_id)
|
||||||
{
|
{
|
||||||
$person = $this->managerRegistry->getManager()
|
$person = $this->managerRegistry->getManager()
|
||||||
->getRepository(\Chill\PersonBundle\Entity\Person::class)
|
->getRepository(Person::class)
|
||||||
->find($person_id);
|
->find($person_id);
|
||||||
|
|
||||||
if (null === $person) {
|
if (null === $person) {
|
||||||
@ -148,7 +148,7 @@ class PersonAddressController extends AbstractController
|
|||||||
public function newAction(mixed $person_id)
|
public function newAction(mixed $person_id)
|
||||||
{
|
{
|
||||||
$person = $this->managerRegistry->getManager()
|
$person = $this->managerRegistry->getManager()
|
||||||
->getRepository(\Chill\PersonBundle\Entity\Person::class)
|
->getRepository(Person::class)
|
||||||
->find($person_id);
|
->find($person_id);
|
||||||
|
|
||||||
if (null === $person) {
|
if (null === $person) {
|
||||||
@ -177,7 +177,7 @@ class PersonAddressController extends AbstractController
|
|||||||
public function updateAction(mixed $person_id, mixed $address_id, Request $request)
|
public function updateAction(mixed $person_id, mixed $address_id, Request $request)
|
||||||
{
|
{
|
||||||
$person = $this->managerRegistry->getManager()
|
$person = $this->managerRegistry->getManager()
|
||||||
->getRepository(\Chill\PersonBundle\Entity\Person::class)
|
->getRepository(Person::class)
|
||||||
->find($person_id);
|
->find($person_id);
|
||||||
|
|
||||||
if (null === $person) {
|
if (null === $person) {
|
||||||
|
@ -106,7 +106,7 @@ final class PersonController extends AbstractController
|
|||||||
$cFGroup = null;
|
$cFGroup = null;
|
||||||
|
|
||||||
$cFDefaultGroup = $this->em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsDefaultGroup::class)
|
$cFDefaultGroup = $this->em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsDefaultGroup::class)
|
||||||
->findOneByEntity(\Chill\PersonBundle\Entity\Person::class);
|
->findOneByEntity(Person::class);
|
||||||
|
|
||||||
if ($cFDefaultGroup) {
|
if ($cFDefaultGroup) {
|
||||||
$cFGroup = $cFDefaultGroup->getCustomFieldsGroup();
|
$cFGroup = $cFDefaultGroup->getCustomFieldsGroup();
|
||||||
@ -281,7 +281,7 @@ final class PersonController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* easy getting a person by his id.
|
* easy getting a person by his id.
|
||||||
*
|
*
|
||||||
* @return \Chill\PersonBundle\Entity\Person
|
* @return Person
|
||||||
*/
|
*/
|
||||||
private function _getPerson(int $id)
|
private function _getPerson(int $id)
|
||||||
{
|
{
|
||||||
|
@ -401,16 +401,16 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
],
|
],
|
||||||
'apis' => [
|
'apis' => [
|
||||||
[
|
[
|
||||||
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod::class,
|
'class' => AccompanyingPeriod::class,
|
||||||
'name' => 'accompanying_course',
|
'name' => 'accompanying_course',
|
||||||
'base_path' => '/api/1.0/person/accompanying-course',
|
'base_path' => '/api/1.0/person/accompanying-course',
|
||||||
'controller' => \Chill\PersonBundle\Controller\AccompanyingCourseApiController::class,
|
'controller' => \Chill\PersonBundle\Controller\AccompanyingCourseApiController::class,
|
||||||
'actions' => [
|
'actions' => [
|
||||||
'_entity' => [
|
'_entity' => [
|
||||||
'roles' => [
|
'roles' => [
|
||||||
Request::METHOD_GET => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE,
|
Request::METHOD_GET => AccompanyingPeriodVoter::SEE,
|
||||||
Request::METHOD_PATCH => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE,
|
Request::METHOD_PATCH => AccompanyingPeriodVoter::SEE,
|
||||||
Request::METHOD_PUT => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE,
|
Request::METHOD_PUT => AccompanyingPeriodVoter::SEE,
|
||||||
],
|
],
|
||||||
'methods' => [
|
'methods' => [
|
||||||
Request::METHOD_GET => true,
|
Request::METHOD_GET => true,
|
||||||
@ -426,8 +426,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
Request::METHOD_HEAD => false,
|
Request::METHOD_HEAD => false,
|
||||||
],
|
],
|
||||||
'roles' => [
|
'roles' => [
|
||||||
Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE,
|
Request::METHOD_POST => AccompanyingPeriodVoter::SEE,
|
||||||
Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE,
|
Request::METHOD_DELETE => AccompanyingPeriodVoter::SEE,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'resource' => [
|
'resource' => [
|
||||||
@ -438,8 +438,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
Request::METHOD_HEAD => false,
|
Request::METHOD_HEAD => false,
|
||||||
],
|
],
|
||||||
'roles' => [
|
'roles' => [
|
||||||
Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE,
|
Request::METHOD_POST => AccompanyingPeriodVoter::SEE,
|
||||||
Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE,
|
Request::METHOD_DELETE => AccompanyingPeriodVoter::SEE,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'comment' => [
|
'comment' => [
|
||||||
@ -450,8 +450,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
Request::METHOD_HEAD => false,
|
Request::METHOD_HEAD => false,
|
||||||
],
|
],
|
||||||
'roles' => [
|
'roles' => [
|
||||||
Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE,
|
Request::METHOD_POST => AccompanyingPeriodVoter::SEE,
|
||||||
Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE,
|
Request::METHOD_DELETE => AccompanyingPeriodVoter::SEE,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'requestor' => [
|
'requestor' => [
|
||||||
@ -462,8 +462,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
Request::METHOD_HEAD => false,
|
Request::METHOD_HEAD => false,
|
||||||
],
|
],
|
||||||
'roles' => [
|
'roles' => [
|
||||||
Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE,
|
Request::METHOD_POST => AccompanyingPeriodVoter::SEE,
|
||||||
Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE,
|
Request::METHOD_DELETE => AccompanyingPeriodVoter::SEE,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'scope' => [
|
'scope' => [
|
||||||
@ -474,8 +474,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
Request::METHOD_HEAD => false,
|
Request::METHOD_HEAD => false,
|
||||||
],
|
],
|
||||||
'roles' => [
|
'roles' => [
|
||||||
Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE,
|
Request::METHOD_POST => AccompanyingPeriodVoter::SEE,
|
||||||
Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE,
|
Request::METHOD_DELETE => AccompanyingPeriodVoter::SEE,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'socialissue' => [
|
'socialissue' => [
|
||||||
@ -487,8 +487,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
],
|
],
|
||||||
'controller_action' => 'socialIssueApi',
|
'controller_action' => 'socialIssueApi',
|
||||||
'roles' => [
|
'roles' => [
|
||||||
Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE,
|
Request::METHOD_POST => AccompanyingPeriodVoter::SEE,
|
||||||
Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE,
|
Request::METHOD_DELETE => AccompanyingPeriodVoter::SEE,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'work' => [
|
'work' => [
|
||||||
@ -500,7 +500,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
],
|
],
|
||||||
'controller_action' => 'workApi',
|
'controller_action' => 'workApi',
|
||||||
'roles' => [
|
'roles' => [
|
||||||
Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE,
|
Request::METHOD_POST => AccompanyingPeriodVoter::SEE,
|
||||||
Request::METHOD_DELETE => 'ALWAYS_FAILS',
|
Request::METHOD_DELETE => 'ALWAYS_FAILS',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -511,7 +511,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
Request::METHOD_HEAD => false,
|
Request::METHOD_HEAD => false,
|
||||||
],
|
],
|
||||||
'roles' => [
|
'roles' => [
|
||||||
Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE,
|
Request::METHOD_POST => AccompanyingPeriodVoter::SEE,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
// 'confidential' => [
|
// 'confidential' => [
|
||||||
@ -618,7 +618,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
'class' => \Chill\PersonBundle\Entity\Person::class,
|
'class' => \Chill\PersonBundle\Entity\Person::class,
|
||||||
'name' => 'person',
|
'name' => 'person',
|
||||||
'base_path' => '/api/1.0/person/person',
|
'base_path' => '/api/1.0/person/person',
|
||||||
'base_role' => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE,
|
'base_role' => PersonVoter::SEE,
|
||||||
'controller' => \Chill\PersonBundle\Controller\PersonApiController::class,
|
'controller' => \Chill\PersonBundle\Controller\PersonApiController::class,
|
||||||
'actions' => [
|
'actions' => [
|
||||||
'_entity' => [
|
'_entity' => [
|
||||||
@ -629,10 +629,10 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
Request::METHOD_PATCH => true,
|
Request::METHOD_PATCH => true,
|
||||||
],
|
],
|
||||||
'roles' => [
|
'roles' => [
|
||||||
Request::METHOD_GET => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE,
|
Request::METHOD_GET => PersonVoter::SEE,
|
||||||
Request::METHOD_HEAD => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE,
|
Request::METHOD_HEAD => PersonVoter::SEE,
|
||||||
Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\PersonVoter::CREATE,
|
Request::METHOD_POST => PersonVoter::CREATE,
|
||||||
Request::METHOD_PATCH => \Chill\PersonBundle\Security\Authorization\PersonVoter::CREATE,
|
Request::METHOD_PATCH => PersonVoter::CREATE,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'address' => [
|
'address' => [
|
||||||
@ -1001,7 +1001,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
'property' => 'step',
|
'property' => 'step',
|
||||||
],
|
],
|
||||||
'supports' => [
|
'supports' => [
|
||||||
\Chill\PersonBundle\Entity\AccompanyingPeriod::class,
|
AccompanyingPeriod::class,
|
||||||
],
|
],
|
||||||
'initial_marking' => 'DRAFT',
|
'initial_marking' => 'DRAFT',
|
||||||
'places' => [
|
'places' => [
|
||||||
|
@ -532,7 +532,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
|||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->calendars = new \Doctrine\Common\Collections\ArrayCollection();
|
$this->calendars = new ArrayCollection();
|
||||||
$this->accompanyingPeriodParticipations = new ArrayCollection();
|
$this->accompanyingPeriodParticipations = new ArrayCollection();
|
||||||
$this->spokenLanguages = new ArrayCollection();
|
$this->spokenLanguages = new ArrayCollection();
|
||||||
$this->addresses = new ArrayCollection();
|
$this->addresses = new ArrayCollection();
|
||||||
|
@ -29,13 +29,13 @@ class Select2MaritalStatusType extends AbstractType
|
|||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$transformer = new ObjectToIdTransformer($this->em, \Chill\PersonBundle\Entity\MaritalStatus::class);
|
$transformer = new ObjectToIdTransformer($this->em, MaritalStatus::class);
|
||||||
$builder->addModelTransformer($transformer);
|
$builder->addModelTransformer($transformer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
{
|
{
|
||||||
$maritalStatuses = $this->em->getRepository(\Chill\PersonBundle\Entity\MaritalStatus::class)->findAll();
|
$maritalStatuses = $this->em->getRepository(MaritalStatus::class)->findAll();
|
||||||
$choices = [];
|
$choices = [];
|
||||||
|
|
||||||
foreach ($maritalStatuses as $ms) {
|
foreach ($maritalStatuses as $ms) {
|
||||||
|
@ -196,7 +196,7 @@ final class PersonAddressControllerTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
protected function refreshPerson()
|
protected function refreshPerson()
|
||||||
{
|
{
|
||||||
self::$person = $this->em->getRepository(\Chill\PersonBundle\Entity\Person::class)
|
self::$person = $this->em->getRepository(Person::class)
|
||||||
->find(self::$person->getId());
|
->find(self::$person->getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ final class PersonControllerCreateTest extends WebTestCase
|
|||||||
$form = $crawler->selectButton("Créer l'usager")->form();
|
$form = $crawler->selectButton("Créer l'usager")->form();
|
||||||
|
|
||||||
$this->assertInstanceOf(
|
$this->assertInstanceOf(
|
||||||
\Symfony\Component\DomCrawler\Form::class,
|
Form::class,
|
||||||
$form,
|
$form,
|
||||||
'The page contains a button'
|
'The page contains a button'
|
||||||
);
|
);
|
||||||
|
@ -205,7 +205,7 @@ final class PersonControllerUpdateWithHiddenFieldsTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
protected function refreshPerson()
|
protected function refreshPerson()
|
||||||
{
|
{
|
||||||
$this->person = $this->em->getRepository(\Chill\PersonBundle\Entity\Person::class)
|
$this->person = $this->em->getRepository(Person::class)
|
||||||
->find($this->person->getId());
|
->find($this->person->getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ final class PersonControllerViewWithHiddenFieldsTest extends WebTestCase
|
|||||||
*/
|
*/
|
||||||
protected function refreshPerson()
|
protected function refreshPerson()
|
||||||
{
|
{
|
||||||
$this->person = $this->em->getRepository(\Chill\PersonBundle\Entity\Person::class)
|
$this->person = $this->em->getRepository(Person::class)
|
||||||
->find($this->person->getId());
|
->find($this->person->getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ class ReportController extends AbstractController
|
|||||||
$cFGroup = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
|
$cFGroup = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
|
||||||
->find($cf_group_id);
|
->find($cf_group_id);
|
||||||
|
|
||||||
$person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)
|
$person = $em->getRepository(Person::class)
|
||||||
->find($person_id);
|
->find($person_id);
|
||||||
|
|
||||||
if (null === $person || null === $cFGroup) {
|
if (null === $person || null === $cFGroup) {
|
||||||
@ -183,7 +183,7 @@ class ReportController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($person_id);
|
$person = $em->getRepository(Person::class)->find($person_id);
|
||||||
|
|
||||||
$this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
|
$this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
|
||||||
|
|
||||||
@ -240,7 +240,7 @@ class ReportController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($person_id);
|
$person = $em->getRepository(Person::class)->find($person_id);
|
||||||
$cFGroup = $em
|
$cFGroup = $em
|
||||||
->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
|
->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
|
||||||
->find($cf_group_id);
|
->find($cf_group_id);
|
||||||
@ -288,7 +288,7 @@ class ReportController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)
|
$person = $em->getRepository(Person::class)
|
||||||
->find($person_id);
|
->find($person_id);
|
||||||
|
|
||||||
if (null === $person) {
|
if (null === $person) {
|
||||||
@ -310,7 +310,7 @@ class ReportController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$cFGroups = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
|
$cFGroups = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
|
||||||
->findByEntity(\Chill\ReportBundle\Entity\Report::class);
|
->findByEntity(Report::class);
|
||||||
|
|
||||||
if (1 === \count($cFGroups)) {
|
if (1 === \count($cFGroups)) {
|
||||||
return $this->redirectToRoute('report_new', ['person_id' => $person_id, 'cf_group_id' => $cFGroups[0]->getId()]);
|
return $this->redirectToRoute('report_new', ['person_id' => $person_id, 'cf_group_id' => $cFGroups[0]->getId()]);
|
||||||
@ -332,7 +332,7 @@ class ReportController extends AbstractController
|
|||||||
])
|
])
|
||||||
->getForm();
|
->getForm();
|
||||||
|
|
||||||
$person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($person_id);
|
$person = $em->getRepository(Person::class)->find($person_id);
|
||||||
|
|
||||||
return $this->render('@ChillReport/Report/select_report_type.html.twig', [
|
return $this->render('@ChillReport/Report/select_report_type.html.twig', [
|
||||||
'form' => $form->createView(),
|
'form' => $form->createView(),
|
||||||
@ -359,7 +359,7 @@ class ReportController extends AbstractController
|
|||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$cFGroups = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
|
$cFGroups = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
|
||||||
->findByEntity(\Chill\ReportBundle\Entity\Report::class);
|
->findByEntity(Report::class);
|
||||||
|
|
||||||
if (1 === \count($cFGroups)) {
|
if (1 === \count($cFGroups)) {
|
||||||
return $this->redirectToRoute('report_export_list', ['cf_group_id' => $cFGroups[0]->getId()]);
|
return $this->redirectToRoute('report_export_list', ['cf_group_id' => $cFGroups[0]->getId()]);
|
||||||
@ -459,7 +459,7 @@ class ReportController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($person_id);
|
$person = $em->getRepository(Person::class)->find($person_id);
|
||||||
|
|
||||||
$entity = $em->getRepository('ChillReportBundle:Report')->find($report_id);
|
$entity = $em->getRepository('ChillReportBundle:Report')->find($report_id);
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ final class ReportControllerNextTest extends WebTestCase
|
|||||||
->get('doctrine.orm.entity_manager');
|
->get('doctrine.orm.entity_manager');
|
||||||
|
|
||||||
$this->person = $em
|
$this->person = $em
|
||||||
->getRepository(\Chill\PersonBundle\Entity\Person::class)
|
->getRepository(Person::class)
|
||||||
->findOneBy(
|
->findOneBy(
|
||||||
[
|
[
|
||||||
'lastName' => 'Charline',
|
'lastName' => 'Charline',
|
||||||
@ -58,7 +58,7 @@ final class ReportControllerNextTest extends WebTestCase
|
|||||||
// get custom fields group from fixture
|
// get custom fields group from fixture
|
||||||
$customFieldsGroups = self::$kernel->getContainer()
|
$customFieldsGroups = self::$kernel->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
|
->getRepository(CustomFieldsGroup::class)
|
||||||
->findBy(['entity' => \Chill\ReportBundle\Entity\Report::class]);
|
->findBy(['entity' => \Chill\ReportBundle\Entity\Report::class]);
|
||||||
// filter customFieldsGroup to get only "situation de logement"
|
// filter customFieldsGroup to get only "situation de logement"
|
||||||
$filteredCustomFieldsGroupHouse = array_filter(
|
$filteredCustomFieldsGroupHouse = array_filter(
|
||||||
|
@ -43,7 +43,7 @@ final class ReportControllerTest extends WebTestCase
|
|||||||
private static $group;
|
private static $group;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \Chill\PersonBundle\Entity\Person
|
* @var Person
|
||||||
*/
|
*/
|
||||||
private static $person;
|
private static $person;
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ final class ReportControllerTest extends WebTestCase
|
|||||||
// get a random person
|
// get a random person
|
||||||
self::$person = self::$kernel->getContainer()
|
self::$person = self::$kernel->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository(\Chill\PersonBundle\Entity\Person::class)
|
->getRepository(Person::class)
|
||||||
->findOneBy(
|
->findOneBy(
|
||||||
[
|
[
|
||||||
'lastName' => 'Charline',
|
'lastName' => 'Charline',
|
||||||
@ -73,7 +73,7 @@ final class ReportControllerTest extends WebTestCase
|
|||||||
|
|
||||||
$customFieldsGroups = self::$kernel->getContainer()
|
$customFieldsGroups = self::$kernel->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)
|
->getRepository(CustomFieldsGroup::class)
|
||||||
->findBy(['entity' => \Chill\ReportBundle\Entity\Report::class]);
|
->findBy(['entity' => \Chill\ReportBundle\Entity\Report::class]);
|
||||||
// filter customFieldsGroup to get only "situation de logement"
|
// filter customFieldsGroup to get only "situation de logement"
|
||||||
$filteredCustomFieldsGroupHouse = array_filter(
|
$filteredCustomFieldsGroupHouse = array_filter(
|
||||||
@ -123,7 +123,7 @@ final class ReportControllerTest extends WebTestCase
|
|||||||
$form = $crawlerAddAReportPage->selectButton('Créer un nouveau rapport')->form();
|
$form = $crawlerAddAReportPage->selectButton('Créer un nouveau rapport')->form();
|
||||||
|
|
||||||
$this->assertInstanceOf(
|
$this->assertInstanceOf(
|
||||||
\Symfony\Component\DomCrawler\Form::class,
|
Form::class,
|
||||||
$form,
|
$form,
|
||||||
'I can see a form with a button "add a new report" '
|
'I can see a form with a button "add a new report" '
|
||||||
);
|
);
|
||||||
@ -242,7 +242,7 @@ final class ReportControllerTest extends WebTestCase
|
|||||||
|
|
||||||
$link = $crawlerPersonPage->selectLink("AJOUT D'UN RAPPORT")->link();
|
$link = $crawlerPersonPage->selectLink("AJOUT D'UN RAPPORT")->link();
|
||||||
$this->assertInstanceOf(
|
$this->assertInstanceOf(
|
||||||
\Symfony\Component\DomCrawler\Link::class,
|
Link::class,
|
||||||
$link,
|
$link,
|
||||||
'There is a "add a report" link in menu'
|
'There is a "add a report" link in menu'
|
||||||
);
|
);
|
||||||
@ -270,7 +270,7 @@ final class ReportControllerTest extends WebTestCase
|
|||||||
->form();
|
->form();
|
||||||
|
|
||||||
$this->assertInstanceOf(
|
$this->assertInstanceOf(
|
||||||
\Symfony\Component\DomCrawler\Form::class,
|
Form::class,
|
||||||
$addForm,
|
$addForm,
|
||||||
'I have a report form'
|
'I have a report form'
|
||||||
);
|
);
|
||||||
|
@ -58,7 +58,7 @@ final class TimelineProviderTest extends WebTestCase
|
|||||||
|
|
||||||
$scopesSocial = array_filter(
|
$scopesSocial = array_filter(
|
||||||
self::$em
|
self::$em
|
||||||
->getRepository(\Chill\MainBundle\Entity\Scope::class)
|
->getRepository(Scope::class)
|
||||||
->findAll(),
|
->findAll(),
|
||||||
static fn (Scope $scope) => 'social' === $scope->getName()['en']
|
static fn (Scope $scope) => 'social' === $scope->getName()['en']
|
||||||
);
|
);
|
||||||
|
@ -636,7 +636,7 @@ final class SingleTaskController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Symfony\Component\Form\FormInterface
|
* @return FormInterface
|
||||||
*/
|
*/
|
||||||
protected function setCreateForm(SingleTask $task, string $role)
|
protected function setCreateForm(SingleTask $task, string $role)
|
||||||
{
|
{
|
||||||
|
@ -103,9 +103,6 @@ class SingleTask extends AbstractTask
|
|||||||
private Collection $taskPlaceEvents;
|
private Collection $taskPlaceEvents;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateInterval
|
|
||||||
* and this.getEndDate() === null
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="warning_interval", type="dateinterval", nullable=true)
|
* @ORM\Column(name="warning_interval", type="dateinterval", nullable=true)
|
||||||
*
|
*
|
||||||
* @Serializer\Groups({"read"})
|
* @Serializer\Groups({"read"})
|
||||||
|
@ -127,7 +127,7 @@ class ChillThirdPartyExtension extends Extension implements PrependExtensionInte
|
|||||||
],
|
],
|
||||||
'apis' => [
|
'apis' => [
|
||||||
[
|
[
|
||||||
'class' => \Chill\ThirdPartyBundle\Entity\ThirdParty::class,
|
'class' => ThirdParty::class,
|
||||||
'name' => 'thirdparty',
|
'name' => 'thirdparty',
|
||||||
'base_path' => '/api/1.0/thirdparty/thirdparty',
|
'base_path' => '/api/1.0/thirdparty/thirdparty',
|
||||||
// 'base_role' => \Chill\ThirdPartyBundle\Security\Authorization\ThirdPartyVoter::SHOW,
|
// 'base_role' => \Chill\ThirdPartyBundle\Security\Authorization\ThirdPartyVoter::SHOW,
|
||||||
@ -142,11 +142,11 @@ class ChillThirdPartyExtension extends Extension implements PrependExtensionInte
|
|||||||
Request::METHOD_PATCH => true,
|
Request::METHOD_PATCH => true,
|
||||||
],
|
],
|
||||||
'roles' => [
|
'roles' => [
|
||||||
Request::METHOD_GET => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::SHOW,
|
Request::METHOD_GET => ThirdPartyVoter::SHOW,
|
||||||
Request::METHOD_HEAD => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::SHOW,
|
Request::METHOD_HEAD => ThirdPartyVoter::SHOW,
|
||||||
Request::METHOD_POST => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::CREATE,
|
Request::METHOD_POST => ThirdPartyVoter::CREATE,
|
||||||
Request::METHOD_PUT => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::CREATE,
|
Request::METHOD_PUT => ThirdPartyVoter::CREATE,
|
||||||
Request::METHOD_PATCH => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::CREATE,
|
Request::METHOD_PATCH => ThirdPartyVoter::CREATE,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
@ -149,7 +149,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
|
|||||||
*
|
*
|
||||||
* @ORM\JoinTable(name="chill_3party.party_center")
|
* @ORM\JoinTable(name="chill_3party.party_center")
|
||||||
*/
|
*/
|
||||||
private Collection $centers;
|
private readonly Collection $centers;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contact Persons: One Institutional ThirdParty has Many Contact Persons.
|
* Contact Persons: One Institutional ThirdParty has Many Contact Persons.
|
||||||
|
@ -100,7 +100,7 @@ class ThirdPartyType extends AbstractType
|
|||||||
'label' => 'thirdparty.Contact data are confidential',
|
'label' => 'thirdparty.Contact data are confidential',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Institutional ThirdParty (parent)
|
// Institutional ThirdParty (parent)
|
||||||
} else {
|
} else {
|
||||||
$builder
|
$builder
|
||||||
->add('nameCompany', TextType::class, [
|
->add('nameCompany', TextType::class, [
|
||||||
|
@ -19,5 +19,5 @@ return static function (RoutingConfigurator $routes) {
|
|||||||
|
|
||||||
$routes
|
$routes
|
||||||
->add('chill_wopi_object_convert', '/convert/{uuid}')
|
->add('chill_wopi_object_convert', '/convert/{uuid}')
|
||||||
->controller(\Chill\WopiBundle\Controller\Convert::class);
|
->controller(Chill\WopiBundle\Controller\Convert::class);
|
||||||
};
|
};
|
||||||
|
@ -10,5 +10,5 @@ declare(strict_types=1);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
return static function (Rector\Config\RectorConfig $rectorConfig): void {
|
return static function (Rector\Config\RectorConfig $rectorConfig): void {
|
||||||
$rectorConfig->rule(\Chill\Utils\Rector\Rector\ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector::class);
|
$rectorConfig->rule(Chill\Utils\Rector\Rector\ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector::class);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user