diff --git a/src/Bundle/ChillPersonBundle/Export/Helper/FilterListAccompanyingPeriodHelper.php b/src/Bundle/ChillPersonBundle/Export/Helper/FilterListAccompanyingPeriodHelper.php index 87426b16a..e631051a0 100644 --- a/src/Bundle/ChillPersonBundle/Export/Helper/FilterListAccompanyingPeriodHelper.php +++ b/src/Bundle/ChillPersonBundle/Export/Helper/FilterListAccompanyingPeriodHelper.php @@ -13,7 +13,6 @@ namespace Chill\PersonBundle\Export\Helper; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Repository\CenterRepositoryInterface; -use Chill\MainBundle\Security\Authorization\AuthorizationHelperForCurrentUserInterface; use Chill\MainBundle\Security\Authorization\AuthorizationHelperInterface; use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation; use Chill\PersonBundle\Entity\Person\PersonCenterHistory; @@ -61,15 +60,16 @@ final readonly class FilterListAccompanyingPeriodHelper implements FilterListAcc foreach ($scopes as $scope) { $scopeCondition = match (in_array($scope, $scopesConfidential, true)) { - true => ":scope_{$i} MEMBER OF acp.scopes", + true => sprintf(':scope_%s MEMBER OF acp.scopes', $i), false => $qb->expr()->andX( 'acp.confidential = FALSE', - ":scope_{$i} MEMBER OF acp.scopes", + sprintf(':scope_%s MEMBER OF acp.scopes', $i), ), }; - $orScopes->add($scopeCondition); + $orScopes->add($qb->expr()->orX(sprintf('acp.user = :user_%d', $i), $scopeCondition)); $qb->setParameter("scope_{$i}", $scope); + $qb->setParameter("user_{$i}", $user); ++$i; }