mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-28 17:44:58 +00:00
exports: test all activity filters/aggregators and fix errors
This commit is contained in:
@@ -61,7 +61,11 @@ class BySocialActionAggregator implements AggregatorInterface
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
$qb->addSelect('IDENTITY(activity.socialActions) AS socialaction_aggregator');
|
||||
if(!in_array('socialaction', $qb->getAllAliases())) {
|
||||
$qb->join('activity.socialActions', 'socialaction');
|
||||
}
|
||||
|
||||
$qb->addSelect('socialaction.id AS socialaction_aggregator');
|
||||
|
||||
$groupBy = $qb->getDQLPart('groupBy');
|
||||
|
||||
|
@@ -62,7 +62,11 @@ class BySocialIssueAggregator implements AggregatorInterface
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
$qb->addSelect('IDENTITY(activity.socialIssues) AS socialissue_aggregator');
|
||||
if (!in_array('socialissue', $qb->getAllAliases())) {
|
||||
$qb->join('activity.socialIssues', 'socialissue');
|
||||
}
|
||||
|
||||
$qb->addSelect('socialissue.id AS socialissue_aggregator');
|
||||
|
||||
$groupBy = $qb->getDQLPart('groupBy');
|
||||
|
||||
|
@@ -30,7 +30,7 @@ class ByThirdpartyAggregator implements AggregatorInterface
|
||||
{
|
||||
return function ($value): string {
|
||||
if ($value === '_header') {
|
||||
return 'Thirdparty';
|
||||
return 'Accepted thirdparty';
|
||||
}
|
||||
|
||||
$tp = $this->thirdPartyRepository->find($value);
|
||||
@@ -61,7 +61,11 @@ class ByThirdpartyAggregator implements AggregatorInterface
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
$qb->addSelect('IDENTITY(activity.thirdParties) AS thirdparty_aggregator');
|
||||
if (!in_array('thirdparty', $qb->getAllAliases())) {
|
||||
$qb->join('activity.thirdParties', 'thirdparty');
|
||||
}
|
||||
|
||||
$qb->addSelect('thirdparty.id AS thirdparty_aggregator');
|
||||
|
||||
$groupBy = $qb->getDQLPart('groupBy');
|
||||
|
||||
|
@@ -61,7 +61,11 @@ class ByUserAggregator implements AggregatorInterface
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
$qb->addSelect('IDENTITY(activity.users) AS users_aggregator');
|
||||
if (!in_array('user', $qb->getAllAliases())) {
|
||||
$qb->join('activity.users', 'user');
|
||||
}
|
||||
|
||||
$qb->addSelect('user.id AS users_aggregator');
|
||||
|
||||
$groupBy = $qb->getDQLPart('groupBy');
|
||||
|
||||
|
@@ -16,7 +16,7 @@ class DateAggregator implements AggregatorInterface
|
||||
{
|
||||
private const CHOICES = [
|
||||
'by month' => 'month',
|
||||
'by week' => 'week', // sur base du numéro de la semaine
|
||||
'by week' => 'week', // numéro de la semaine
|
||||
'by year' => 'year',
|
||||
];
|
||||
|
||||
@@ -60,6 +60,7 @@ class DateAggregator implements AggregatorInterface
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
$builder->add('by_date', ChoiceType::class, [
|
||||
'label' => 'Frequency',
|
||||
'choices' => self::CHOICES,
|
||||
'multiple' => false,
|
||||
'expanded' => true,
|
||||
|
@@ -63,7 +63,11 @@ class LocationTypeAggregator implements AggregatorInterface
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
$qb->addSelect('IDENTITY(activity.location) AS locationtype_aggregator');
|
||||
if (!in_array('location', $qb->getAllAliases())) {
|
||||
$qb->join('activity.location', 'location');
|
||||
}
|
||||
|
||||
$qb->addSelect('IDENTITY(location.locationType) AS locationtype_aggregator');
|
||||
|
||||
$groupBy = $qb->getDQLPart('groupBy');
|
||||
|
||||
|
Reference in New Issue
Block a user