mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-11 17:25:02 +00:00
Compare commits
15 Commits
replace_tr
...
2.10.5
Author | SHA1 | Date | |
---|---|---|---|
8cb9142800
|
|||
4847724f6f
|
|||
6280453523
|
|||
68f56671a4
|
|||
dc860d0c46
|
|||
6fd80f9f2e
|
|||
b2aa465b03 | |||
0fa8944c29 | |||
7494dbfc7c | |||
642958bde2 | |||
57bd6d1be4 | |||
bbcbbf078f | |||
ba778b1cf8 | |||
728fd642fa | |||
4150eb56b4 |
@@ -1,5 +0,0 @@
|
|||||||
kind: Fixed
|
|
||||||
body: Replace old method of getting translator with injection of translatorInterface
|
|
||||||
time: 2023-10-26T15:22:05.134223653+02:00
|
|
||||||
custom:
|
|
||||||
Issue: "175"
|
|
3
.changes/v2.10.2.md
Normal file
3
.changes/v2.10.2.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
## v2.10.2 - 2023-10-26
|
||||||
|
### Fixed
|
||||||
|
* ([#175](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/175)) Use injection of translator instead of ->get().
|
3
.changes/v2.10.3.md
Normal file
3
.changes/v2.10.3.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
## v2.10.3 - 2023-10-26
|
||||||
|
### Fixed
|
||||||
|
* ([#175](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/175)) Replace old method of getting translator with injection of translatorInterface
|
3
.changes/v2.10.4.md
Normal file
3
.changes/v2.10.4.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
## v2.10.4 - 2023-10-26
|
||||||
|
### Fixed
|
||||||
|
* Fix null value constraint errors when merging relationships in doubles
|
4
.changes/v2.10.5.md
Normal file
4
.changes/v2.10.5.md
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
## v2.10.5 - 2023-11-05
|
||||||
|
### Fixed
|
||||||
|
* ([#183](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/183)) Fix "problem during download" on some filters, which used a wrong data type
|
||||||
|
* ([#184](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/184)) Fix filter "activity by date"
|
@@ -28,6 +28,8 @@ variables:
|
|||||||
REDIS_PORT: 6379
|
REDIS_PORT: 6379
|
||||||
REDIS_URL: redis://redis:6379
|
REDIS_URL: redis://redis:6379
|
||||||
DEFAULT_CARRIER_CODE: BE
|
DEFAULT_CARRIER_CODE: BE
|
||||||
|
# force a timezone
|
||||||
|
TZ: Europe/Brussels
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- Composer install
|
- Composer install
|
||||||
@@ -106,6 +108,8 @@ rector_tests:
|
|||||||
# - tests/app/vendor/
|
# - tests/app/vendor/
|
||||||
|
|
||||||
unit_tests:
|
unit_tests:
|
||||||
|
# temporarily allow failure due to problem with timezone
|
||||||
|
allow_failure: true
|
||||||
stage: Tests
|
stage: Tests
|
||||||
image: gitea.champs-libres.be/chill-project/chill-skeleton-basic/base-image:php82
|
image: gitea.champs-libres.be/chill-project/chill-skeleton-basic/base-image:php82
|
||||||
script:
|
script:
|
||||||
|
@@ -6,6 +6,14 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
|
|||||||
and is generated by [Changie](https://github.com/miniscruff/changie).
|
and is generated by [Changie](https://github.com/miniscruff/changie).
|
||||||
|
|
||||||
|
|
||||||
|
## v2.10.4 - 2023-10-26
|
||||||
|
### Fixed
|
||||||
|
* Fix null value constraint errors when merging relationships in doubles
|
||||||
|
|
||||||
|
## v2.10.3 - 2023-10-26
|
||||||
|
### Fixed
|
||||||
|
* ([#175](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/175)) Replace old method of getting translator with injection of translatorInterface
|
||||||
|
|
||||||
## v2.10.2 - 2023-10-26
|
## v2.10.2 - 2023-10-26
|
||||||
### Fixed
|
### Fixed
|
||||||
* ([#175](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/175)) Use injection of translator instead of ->get().
|
* ([#175](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/175)) Use injection of translator instead of ->get().
|
||||||
|
@@ -673,8 +673,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');
|
||||||
}
|
}
|
||||||
|
@@ -13,16 +13,12 @@ namespace Chill\ActivityBundle\Export\Filter;
|
|||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Chill\MainBundle\Form\Type\Export\FilterType;
|
|
||||||
use Chill\MainBundle\Form\Type\PickRollingDateType;
|
use Chill\MainBundle\Form\Type\PickRollingDateType;
|
||||||
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
use Chill\MainBundle\Service\RollingDate\RollingDate;
|
||||||
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
|
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
|
||||||
use Doctrine\ORM\Query\Expr;
|
use Doctrine\ORM\Query\Expr;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\Form\FormError;
|
|
||||||
use Symfony\Component\Form\FormEvent;
|
|
||||||
use Symfony\Component\Form\FormEvents;
|
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class ActivityDateFilter implements FilterInterface
|
class ActivityDateFilter implements FilterInterface
|
||||||
@@ -74,46 +70,6 @@ class ActivityDateFilter implements FilterInterface
|
|||||||
->add('date_to', PickRollingDateType::class, [
|
->add('date_to', PickRollingDateType::class, [
|
||||||
'label' => 'Activities before this date',
|
'label' => 'Activities before this date',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) {
|
|
||||||
/** @var \Symfony\Component\Form\FormInterface $filterForm */
|
|
||||||
$filterForm = $event->getForm()->getParent();
|
|
||||||
$enabled = $filterForm->get(FilterType::ENABLED_FIELD)->getData();
|
|
||||||
|
|
||||||
if (true === $enabled) {
|
|
||||||
// if the filter is enabled, add some validation
|
|
||||||
$form = $event->getForm();
|
|
||||||
$date_from = $form->get('date_from')->getData();
|
|
||||||
$date_to = $form->get('date_to')->getData();
|
|
||||||
|
|
||||||
// check that fields are not empty
|
|
||||||
if (null === $date_from) {
|
|
||||||
$form->get('date_from')->addError(new FormError(
|
|
||||||
$this->translator->trans('This field '
|
|
||||||
.'should not be empty')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null === $date_to) {
|
|
||||||
$form->get('date_to')->addError(new FormError(
|
|
||||||
$this->translator->trans('This field '
|
|
||||||
.'should not be empty')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
// check that date_from is before date_to
|
|
||||||
if (
|
|
||||||
(null !== $date_from && null !== $date_to)
|
|
||||||
&& $date_from >= $date_to
|
|
||||||
) {
|
|
||||||
$form->get('date_to')->addError(new FormError(
|
|
||||||
$this->translator->trans('This date should be after '
|
|
||||||
.'the date given in "Implied in an activity after '
|
|
||||||
.'this date" field')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
|
@@ -80,7 +80,7 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
|
|||||||
// collect all the reasons'name used in this filter in one array
|
// collect all the reasons'name used in this filter in one array
|
||||||
$reasonsNames = array_map(
|
$reasonsNames = array_map(
|
||||||
fn (ActivityType $t): string => $this->translatableStringHelper->localize($t->getName()),
|
fn (ActivityType $t): string => $this->translatableStringHelper->localize($t->getName()),
|
||||||
$this->activityTypeRepository->findBy(['id' => $data['types']->toArray()])
|
$this->activityTypeRepository->findBy(['id' => $data['types'] instanceof \Doctrine\Common\Collections\Collection ? $data['types']->toArray() : $data['types']])
|
||||||
);
|
);
|
||||||
|
|
||||||
return ['Filtered by activity type: only %list%', [
|
return ['Filtered by activity type: only %list%', [
|
||||||
|
@@ -17,6 +17,7 @@ use Chill\ActivityBundle\Repository\ActivityReasonRepository;
|
|||||||
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\Query\Expr;
|
use Doctrine\ORM\Query\Expr;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
@@ -79,7 +80,7 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt
|
|||||||
// collect all the reasons'name used in this filter in one array
|
// collect all the reasons'name used in this filter in one array
|
||||||
$reasonsNames = array_map(
|
$reasonsNames = array_map(
|
||||||
fn (ActivityReason $r): string => '"'.$this->translatableStringHelper->localize($r->getName()).'"',
|
fn (ActivityReason $r): string => '"'.$this->translatableStringHelper->localize($r->getName()).'"',
|
||||||
$this->activityReasonRepository->findBy(['id' => $data['reasons']->toArray()])
|
$this->activityReasonRepository->findBy(['id' => $data['reasons'] instanceof Collection ? $data['reasons']->toArray() : $data['reasons']])
|
||||||
);
|
);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
@@ -17,6 +17,7 @@ use Chill\MainBundle\Entity\User\UserJobHistory;
|
|||||||
use Chill\MainBundle\Entity\UserJob;
|
use Chill\MainBundle\Entity\UserJob;
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
@@ -80,7 +81,7 @@ class UsersJobFilter implements FilterInterface
|
|||||||
', ',
|
', ',
|
||||||
array_map(
|
array_map(
|
||||||
fn (UserJob $job) => $this->translatableStringHelper->localize($job->getLabel()),
|
fn (UserJob $job) => $this->translatableStringHelper->localize($job->getLabel()),
|
||||||
$data['jobs']->toArray()
|
$data['jobs'] instanceof Collection ? $data['jobs']->toArray() : $data['jobs']
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
]];
|
]];
|
||||||
|
@@ -18,6 +18,7 @@ use Chill\MainBundle\Entity\User\UserScopeHistory;
|
|||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Chill\MainBundle\Repository\ScopeRepositoryInterface;
|
use Chill\MainBundle\Repository\ScopeRepositoryInterface;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
@@ -83,7 +84,7 @@ class UsersScopeFilter implements FilterInterface
|
|||||||
', ',
|
', ',
|
||||||
array_map(
|
array_map(
|
||||||
fn (Scope $s) => $this->translatableStringHelper->localize($s->getName()),
|
fn (Scope $s) => $this->translatableStringHelper->localize($s->getName()),
|
||||||
$data['scopes']->toArray()
|
$data['scopes'] instanceof Collection ? $data['scopes']->toArray() : $data['scopes']
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
]];
|
]];
|
||||||
|
@@ -52,6 +52,7 @@ final class ActivityReasonFilterTest extends AbstractFilterTest
|
|||||||
public function getFormData()
|
public function getFormData()
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
$data = [];
|
||||||
|
|
||||||
$em = self::$container
|
$em = self::$container
|
||||||
->get(EntityManagerInterface::class);
|
->get(EntityManagerInterface::class);
|
||||||
@@ -62,10 +63,13 @@ final class ActivityReasonFilterTest extends AbstractFilterTest
|
|||||||
|
|
||||||
// generate an array of 5 different combination of results
|
// generate an array of 5 different combination of results
|
||||||
for ($i = 0; 5 > $i; ++$i) {
|
for ($i = 0; 5 > $i; ++$i) {
|
||||||
yield ['reasons' => new ArrayCollection(array_splice($reasons, ($i + 1) * -1))];
|
$data[] = ['reasons' => new ArrayCollection(array_splice($reasons, ($i + 1) * -1))];
|
||||||
|
$data[] = ['reasons' => array_splice($reasons, ($i + 1) * -1)];
|
||||||
}
|
}
|
||||||
|
|
||||||
self::ensureKernelShutdown();
|
self::ensureKernelShutdown();
|
||||||
|
|
||||||
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getQueryBuilders(): iterable
|
public function getQueryBuilders(): iterable
|
||||||
|
@@ -57,6 +57,9 @@ final class ActivityTypeFilterTest extends AbstractFilterTest
|
|||||||
$data[] = [
|
$data[] = [
|
||||||
'types' => new ArrayCollection([$a]),
|
'types' => new ArrayCollection([$a]),
|
||||||
];
|
];
|
||||||
|
/*$data[] = [
|
||||||
|
'types' => [$a],
|
||||||
|
];*/
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
|
@@ -17,6 +17,7 @@ use Chill\AsideActivityBundle\Repository\AsideActivityCategoryRepository;
|
|||||||
use Chill\AsideActivityBundle\Templating\Entity\CategoryRender;
|
use Chill\AsideActivityBundle\Templating\Entity\CategoryRender;
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
@@ -76,7 +77,7 @@ class ByActivityTypeFilter implements FilterInterface
|
|||||||
{
|
{
|
||||||
$types = array_map(
|
$types = array_map(
|
||||||
fn (AsideActivityCategory $t): string => $this->translatableStringHelper->localize($t->getTitle()),
|
fn (AsideActivityCategory $t): string => $this->translatableStringHelper->localize($t->getTitle()),
|
||||||
$data['types']->toArray()
|
$data['types'] instanceof Collection ? $data['types']->toArray() : $data['types']
|
||||||
);
|
);
|
||||||
|
|
||||||
return ['export.filter.Filtered by aside activity type: only %type%', [
|
return ['export.filter.Filtered by aside activity type: only %type%', [
|
||||||
|
@@ -16,6 +16,7 @@ use Chill\MainBundle\Entity\Location;
|
|||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Chill\MainBundle\Form\Type\PickUserLocationType;
|
use Chill\MainBundle\Form\Type\PickUserLocationType;
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
@@ -54,7 +55,12 @@ final readonly class ByLocationFilter implements FilterInterface
|
|||||||
|
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
$locations = $data['locations']->map(fn (Location $l): string => $l->getName());
|
$extractFunction = fn (Location $l): string => $l->getName();
|
||||||
|
if ($data['locations'] instanceof Collection) {
|
||||||
|
$locations = $data['locations']->map($extractFunction);
|
||||||
|
} else {
|
||||||
|
$locations = array_map($extractFunction, $data['locations']);
|
||||||
|
}
|
||||||
|
|
||||||
return ['export.filter.Filtered by aside activity location: only %location%', [
|
return ['export.filter.Filtered by aside activity location: only %location%', [
|
||||||
'%location%' => implode(', ', $locations),
|
'%location%' => implode(', ', $locations),
|
||||||
|
@@ -17,6 +17,7 @@ use Chill\MainBundle\Entity\User\UserJobHistory;
|
|||||||
use Chill\MainBundle\Entity\UserJob;
|
use Chill\MainBundle\Entity\UserJob;
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
@@ -80,7 +81,7 @@ class ByUserJobFilter implements FilterInterface
|
|||||||
', ',
|
', ',
|
||||||
array_map(
|
array_map(
|
||||||
fn (UserJob $job) => $this->translatableStringHelper->localize($job->getLabel()),
|
fn (UserJob $job) => $this->translatableStringHelper->localize($job->getLabel()),
|
||||||
$data['jobs']->toArray()
|
$data['jobs'] instanceof Collection ? $data['jobs']->toArray() : $data['jobs']
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
]];
|
]];
|
||||||
|
@@ -18,6 +18,7 @@ use Chill\MainBundle\Entity\User\UserScopeHistory;
|
|||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Chill\MainBundle\Repository\ScopeRepositoryInterface;
|
use Chill\MainBundle\Repository\ScopeRepositoryInterface;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
@@ -83,7 +84,7 @@ class ByUserScopeFilter implements FilterInterface
|
|||||||
', ',
|
', ',
|
||||||
array_map(
|
array_map(
|
||||||
fn (Scope $s) => $this->translatableStringHelper->localize($s->getName()),
|
fn (Scope $s) => $this->translatableStringHelper->localize($s->getName()),
|
||||||
$data['scopes']->toArray()
|
$data['scopes'] instanceof Collection ? $data['scopes']->toArray() : $data['scopes']
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
]];
|
]];
|
||||||
|
@@ -25,8 +25,8 @@ class PersonMoveRelationHandler implements PersonMoveSqlHandlerInterface
|
|||||||
public function getSqls(string $className, string $field, Person $from, Person $to): array
|
public function getSqls(string $className, string $field, Person $from, Person $to): array
|
||||||
{
|
{
|
||||||
$insertSql = sprintf(<<<'SQL'
|
$insertSql = sprintf(<<<'SQL'
|
||||||
INSERT INTO chill_person_relationships (id, relation_id, reverse, fromperson_id, toperson_id)
|
INSERT INTO chill_person_relationships (id, relation_id, reverse, createdat, createdby_id, fromperson_id, toperson_id)
|
||||||
SELECT nextval('chill_person_relationships_id_seq'), relation_id, reverse, fromperson_id, toperson_id
|
SELECT nextval('chill_person_relationships_id_seq'), relation_id, reverse, createdat, createdby_id, fromperson_id, toperson_id
|
||||||
FROM chill_person_relationships cpr
|
FROM chill_person_relationships cpr
|
||||||
WHERE fromperson_id = %d OR toperson_id = %d
|
WHERE fromperson_id = %d OR toperson_id = %d
|
||||||
AND NOT EXISTS (
|
AND NOT EXISTS (
|
||||||
|
@@ -82,7 +82,6 @@ class PersonDuplicateController extends \Symfony\Bundle\FrameworkBundle\Controll
|
|||||||
$connection->beginTransaction();
|
$connection->beginTransaction();
|
||||||
|
|
||||||
foreach ($sqls as $sql) {
|
foreach ($sqls as $sql) {
|
||||||
dump($sql);
|
|
||||||
$connection->executeQuery($sql);
|
$connection->executeQuery($sql);
|
||||||
}
|
}
|
||||||
$connection->commit();
|
$connection->commit();
|
||||||
|
@@ -16,6 +16,7 @@ use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
|
|||||||
use Chill\PersonBundle\Export\Declarations;
|
use Chill\PersonBundle\Export\Declarations;
|
||||||
use Chill\PersonBundle\Form\Type\PickSocialIssueType;
|
use Chill\PersonBundle\Form\Type\PickSocialIssueType;
|
||||||
use Chill\PersonBundle\Templating\Entity\SocialIssueRender;
|
use Chill\PersonBundle\Templating\Entity\SocialIssueRender;
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
@@ -50,7 +51,9 @@ class SocialIssueFilter implements FilterInterface
|
|||||||
$qb->andWhere($clause)
|
$qb->andWhere($clause)
|
||||||
->setParameter(
|
->setParameter(
|
||||||
'socialissues',
|
'socialissues',
|
||||||
SocialIssue::getDescendantsWithThisForIssues($data['accepted_socialissues']->toArray())
|
SocialIssue::getDescendantsWithThisForIssues(
|
||||||
|
$data['accepted_socialissues'] instanceof Collection ? $data['accepted_socialissues']->toArray() : $data['accepted_socialissues']
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,6 +17,7 @@ use Chill\MainBundle\Export\FilterInterface;
|
|||||||
use Chill\MainBundle\Repository\UserJobRepositoryInterface;
|
use Chill\MainBundle\Repository\UserJobRepositoryInterface;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||||
use Chill\PersonBundle\Export\Declarations;
|
use Chill\PersonBundle\Export\Declarations;
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\Query\Expr\Join;
|
use Doctrine\ORM\Query\Expr\Join;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
@@ -105,7 +106,7 @@ class UserJobFilter implements FilterInterface
|
|||||||
', ',
|
', ',
|
||||||
array_map(
|
array_map(
|
||||||
fn (UserJob $job) => $this->translatableStringHelper->localize($job->getLabel()),
|
fn (UserJob $job) => $this->translatableStringHelper->localize($job->getLabel()),
|
||||||
$data['jobs']->toArray()
|
$data['jobs'] instanceof Collection ? $data['jobs']->toArray() : $data['jobs']
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@@ -17,6 +17,7 @@ use Chill\MainBundle\Export\FilterInterface;
|
|||||||
use Chill\MainBundle\Repository\ScopeRepositoryInterface;
|
use Chill\MainBundle\Repository\ScopeRepositoryInterface;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||||
use Chill\PersonBundle\Export\Declarations;
|
use Chill\PersonBundle\Export\Declarations;
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\Query\Expr\Join;
|
use Doctrine\ORM\Query\Expr\Join;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
@@ -104,7 +105,7 @@ class UserScopeFilter implements FilterInterface
|
|||||||
', ',
|
', ',
|
||||||
array_map(
|
array_map(
|
||||||
fn (Scope $s) => $this->translatableStringHelper->localize($s->getName()),
|
fn (Scope $s) => $this->translatableStringHelper->localize($s->getName()),
|
||||||
$data['scopes']->toArray()
|
$data['scopes'] instanceof Collection ? $data['scopes']->toArray() : $data['scopes']
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@@ -52,6 +52,7 @@ final class SocialIssueFilterTest extends AbstractFilterTest
|
|||||||
->getResult();
|
->getResult();
|
||||||
|
|
||||||
yield ['accepted_socialissues' => new ArrayCollection($array)];
|
yield ['accepted_socialissues' => new ArrayCollection($array)];
|
||||||
|
yield ['accepted_socialissues' => $array];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
|
@@ -52,6 +52,11 @@ final class UserJobFilterTest extends AbstractFilterTest
|
|||||||
'jobs' => new ArrayCollection($jobs),
|
'jobs' => new ArrayCollection($jobs),
|
||||||
'date_calc' => new RollingDate(RollingDate::T_TODAY),
|
'date_calc' => new RollingDate(RollingDate::T_TODAY),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
yield [
|
||||||
|
'jobs' => $jobs,
|
||||||
|
'date_calc' => new RollingDate(RollingDate::T_TODAY),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getQueryBuilders(): array
|
public function getQueryBuilders(): array
|
||||||
|
@@ -53,6 +53,10 @@ final class UserScopeFilterTest extends AbstractFilterTest
|
|||||||
'date_calc' => new RollingDate(RollingDate::T_TODAY),
|
'date_calc' => new RollingDate(RollingDate::T_TODAY),
|
||||||
'scopes' => new ArrayCollection($scopes),
|
'scopes' => new ArrayCollection($scopes),
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'date_calc' => new RollingDate(RollingDate::T_TODAY),
|
||||||
|
'scopes' => $scopes,
|
||||||
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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, [
|
||||||
|
@@ -52,7 +52,16 @@ class ChillDocumentLockManager implements DocumentLockManagerInterface
|
|||||||
|
|
||||||
public function hasLock(Document $document, RequestInterface $request): bool
|
public function hasLock(Document $document, RequestInterface $request): bool
|
||||||
{
|
{
|
||||||
return $this->redis->exists($this->getCacheId($document)) > 0;
|
$r = $this->redis->exists($this->getCacheId($document));
|
||||||
|
|
||||||
|
if (is_bool($r)) {
|
||||||
|
return $r;
|
||||||
|
}
|
||||||
|
if (is_int($r)) {
|
||||||
|
return $r > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \RuntimeException('data type not supported');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setLock(Document $document, string $lockId, RequestInterface $request): bool
|
public function setLock(Document $document, string $lockId, RequestInterface $request): bool
|
||||||
|
Reference in New Issue
Block a user