Merge remote-tracking branch 'origin/export-2023-01-fixes'

This commit is contained in:
2023-01-16 12:06:55 +01:00
48 changed files with 96 additions and 50 deletions

View File

@@ -60,7 +60,7 @@ class ByCreatorAggregator implements AggregatorInterface
return 'Created by';
}
if (null === $value) {
if (null === $value || '' === $value) {
return '';
}

View File

@@ -65,7 +65,7 @@ class BySocialActionAggregator implements AggregatorInterface
return 'Social action';
}
if (null === $value) {
if (null === $value || '' === $value) {
return '';
}

View File

@@ -65,7 +65,7 @@ class BySocialIssueAggregator implements AggregatorInterface
return 'Social issues';
}
if (null === $value) {
if (null === $value || '' === $value) {
return '';
}

View File

@@ -65,7 +65,7 @@ class ByThirdpartyAggregator implements AggregatorInterface
return 'Accepted thirdparty';
}
if (null === $value) {
if (null === $value || '' === $value) {
return '';
}

View File

@@ -65,7 +65,7 @@ class CreatorScopeAggregator implements AggregatorInterface
return 'Scope';
}
if (null === $value) {
if (null === $value || '' === $value) {
return '';
}

View File

@@ -65,11 +65,13 @@ class LocationTypeAggregator implements AggregatorInterface
return 'Accepted locationtype';
}
if (null === $value) {
if (null === $value || '' === $value) {
return '';
}
$lt = $this->locationTypeRepository->find($value);
if (null === $lt = $this->locationTypeRepository->find($value)) {
return '';
}
return $this->translatableStringHelper->localize(
$lt->getTitle()

View File

@@ -71,7 +71,7 @@ class ActivityTypeAggregator implements AggregatorInterface
return 'Activity type';
}
if (null === $value) {
if (null === $value || '' === $value) {
return '';
}

View File

@@ -66,7 +66,7 @@ class ActivityUserAggregator implements AggregatorInterface
return 'Activity user';
}
if (null === $value) {
if (null === $value || '' === $value) {
return '';
}

View File

@@ -64,7 +64,7 @@ class ActivityUsersAggregator implements AggregatorInterface
return 'Activity users';
}
if (null === $value) {
if (null === $value || '' === $value) {
return '';
}

View File

@@ -63,7 +63,7 @@ class ActivityUsersJobAggregator implements \Chill\MainBundle\Export\AggregatorI
return 'Users \'s job';
}
if (null === $value) {
if (null === $value || '' === $value) {
return '';
}

View File

@@ -63,7 +63,7 @@ class ActivityUsersScopeAggregator implements \Chill\MainBundle\Export\Aggregato
return 'Users \'s scope';
}
if (null === $value) {
if (null === $value || '' === $value) {
return '';
}

View File

@@ -134,6 +134,10 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
return 'reasons' === $data['level'] ? 'Group by reasons' : 'Group by categories of reason';
}
if (null === $value || '' === $value) {
return '';
}
switch ($data['level']) {
case 'reasons':
$r = $this->activityReasonRepository->find($value);

View File

@@ -57,6 +57,7 @@ class SentReceivedAggregator implements AggregatorInterface
switch ($value) {
case null:
case '':
return '';
case 'sent':

View File

@@ -17,11 +17,9 @@ use Chill\ActivityBundle\Repository\ActivityTypeRepositoryInterface;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Chill\PersonBundle\Export\Declarations;
use Doctrine\ORM\Query\Expr;
use Doctrine\ORM\QueryBuilder;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\FormBuilderInterface;
use function in_array;
class ActivityTypeFilter implements FilterInterface
{
@@ -44,14 +42,13 @@ class ActivityTypeFilter implements FilterInterface
public function alterQuery(QueryBuilder $qb, $data)
{
if (!in_array('activity', $qb->getAllAliases(), true)) {
$qb->join(Activity::class, 'activity', Expr\Join::WITH, 'activity.accompanyingPeriod = acp');
}
$clause = $qb->expr()->in('activity.activityType', ':selected_activity_types');
$qb->andWhere($clause);
$qb->setParameter('selected_activity_types', $data['types']);
$qb->andWhere(
$qb->expr()->exists(
'SELECT 1 FROM ' . Activity::class . ' act_type_filter_activity
WHERE act_type_filter_activity.activityType IN (:act_type_filter_activity_types) AND act_type_filter_activity.accompanyingPeriod = acp'
)
);
$qb->setParameter('act_type_filter_activity_types', $data['accepted_activitytypes']);
}
public function applyOn()