mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
implement new export service for accompanyingcourse exports
This commit is contained in:
@@ -14,6 +14,7 @@ namespace Chill\ActivityBundle\Export\Export\LinkedToACP;
|
||||
use Chill\ActivityBundle\Entity\Activity;
|
||||
use Chill\ActivityBundle\Export\Declarations;
|
||||
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
||||
use Chill\MainBundle\Export\ExportInterface;
|
||||
use Chill\MainBundle\Export\FormatterInterface;
|
||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||
@@ -30,10 +31,14 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
|
||||
{
|
||||
protected EntityRepository $repository;
|
||||
|
||||
private AccompanyingCourseExportHelper $accompanyingCourseExportHelper;
|
||||
|
||||
public function __construct(
|
||||
EntityManagerInterface $em
|
||||
EntityManagerInterface $em,
|
||||
AccompanyingCourseExportHelper $accompanyingCourseExportHelper
|
||||
) {
|
||||
$this->repository = $em->getRepository(Activity::class);
|
||||
$this->accompanyingCourseExportHelper = $accompanyingCourseExportHelper;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder) {}
|
||||
@@ -108,6 +113,8 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
|
||||
)
|
||||
->setParameter('authorized_centers', $centers);
|
||||
|
||||
$this->accompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
||||
|
||||
return $qb;
|
||||
}
|
||||
|
||||
|
@@ -14,6 +14,7 @@ namespace Chill\ActivityBundle\Export\Export\LinkedToACP;
|
||||
use Chill\ActivityBundle\Entity\Activity;
|
||||
use Chill\ActivityBundle\Export\Declarations;
|
||||
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
||||
use Chill\MainBundle\Export\ExportInterface;
|
||||
use Chill\MainBundle\Export\FormatterInterface;
|
||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||
@@ -30,10 +31,14 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
||||
{
|
||||
protected EntityRepository $repository;
|
||||
|
||||
private AccompanyingCourseExportHelper $accompanyingCourseExportHelper;
|
||||
|
||||
public function __construct(
|
||||
EntityManagerInterface $em
|
||||
EntityManagerInterface $em,
|
||||
AccompanyingCourseExportHelper $accompanyingCourseExportHelper
|
||||
) {
|
||||
$this->repository = $em->getRepository(Activity::class);
|
||||
$this->accompanyingCourseExportHelper = $accompanyingCourseExportHelper;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
@@ -111,6 +116,8 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
||||
)
|
||||
->setParameter('authorized_centers', $centers);
|
||||
|
||||
$this->accompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
||||
|
||||
return $qb;
|
||||
}
|
||||
|
||||
|
@@ -14,6 +14,7 @@ namespace Chill\ActivityBundle\Export\Export\LinkedToACP;
|
||||
use Chill\ActivityBundle\Entity\Activity;
|
||||
use Chill\ActivityBundle\Export\Declarations;
|
||||
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
||||
use Chill\MainBundle\Export\ExportInterface;
|
||||
use Chill\MainBundle\Export\FormatterInterface;
|
||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||
@@ -30,10 +31,15 @@ class CountActivity implements ExportInterface, GroupedExportInterface
|
||||
{
|
||||
protected EntityRepository $repository;
|
||||
|
||||
private AccompanyingCourseExportHelper $accompanyingCourseExportHelper;
|
||||
|
||||
public function __construct(
|
||||
EntityManagerInterface $em
|
||||
) {
|
||||
EntityManagerInterface $em,
|
||||
AccompanyingCourseExportHelper $accompanyingCourseExportHelper
|
||||
|
||||
) {
|
||||
$this->repository = $em->getRepository(Activity::class);
|
||||
$this->accompanyingCourseExportHelper = $accompanyingCourseExportHelper;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder) {}
|
||||
@@ -105,6 +111,8 @@ class CountActivity implements ExportInterface, GroupedExportInterface
|
||||
)
|
||||
->setParameter('authorized_centers', $centers);
|
||||
|
||||
$this->accompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
||||
|
||||
$qb->select('COUNT(DISTINCT activity.id) as export_count_activity');
|
||||
|
||||
return $qb;
|
||||
|
@@ -15,6 +15,7 @@ use Chill\ActivityBundle\Entity\Activity;
|
||||
use Chill\ActivityBundle\Export\Export\ListActivityHelper;
|
||||
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||
use Chill\MainBundle\Export\Helper\TranslatableStringExportLabelHelper;
|
||||
use Chill\MainBundle\Export\ListInterface;
|
||||
@@ -30,14 +31,18 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
||||
|
||||
private TranslatableStringExportLabelHelper $translatableStringExportLabelHelper;
|
||||
|
||||
private AccompanyingCourseExportHelper $accompanyingCourseExportHelper;
|
||||
|
||||
public function __construct(
|
||||
ListActivityHelper $helper,
|
||||
EntityManagerInterface $entityManager,
|
||||
TranslatableStringExportLabelHelper $translatableStringExportLabelHelper
|
||||
TranslatableStringExportLabelHelper $translatableStringExportLabelHelper,
|
||||
AccompanyingCourseExportHelper $accompanyingCourseExportHelper
|
||||
) {
|
||||
$this->helper = $helper;
|
||||
$this->entityManager = $entityManager;
|
||||
$this->translatableStringExportLabelHelper = $translatableStringExportLabelHelper;
|
||||
$this->accompanyingCourseExportHelper = $accompanyingCourseExportHelper;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
@@ -147,6 +152,8 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
||||
->addSelect('(SELECT AGGREGATE(acpScope.name) FROM ' . Scope::class . ' acpScope WHERE acpScope MEMBER OF acp.scopes) AS scopesNames')
|
||||
->addGroupBy('scopesNames');
|
||||
|
||||
$this->accompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
||||
|
||||
return $qb;
|
||||
}
|
||||
|
||||
|
@@ -14,6 +14,7 @@ namespace Chill\ActivityBundle\Export\Export\LinkedToACP;
|
||||
use Chill\ActivityBundle\Entity\Activity;
|
||||
use Chill\ActivityBundle\Export\Declarations;
|
||||
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
||||
use Chill\MainBundle\Export\ExportInterface;
|
||||
use Chill\MainBundle\Export\FormatterInterface;
|
||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||
@@ -30,10 +31,14 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
|
||||
{
|
||||
protected EntityRepository $repository;
|
||||
|
||||
private AccompanyingCourseExportHelper $accompanyingCourseExportHelper;
|
||||
|
||||
public function __construct(
|
||||
EntityManagerInterface $em
|
||||
EntityManagerInterface $em,
|
||||
AccompanyingCourseExportHelper $accompanyingCourseExportHelper
|
||||
) {
|
||||
$this->repository = $em->getRepository(Activity::class);
|
||||
$this->accompanyingCourseExportHelper = $accompanyingCourseExportHelper;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
@@ -111,6 +116,8 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
|
||||
)
|
||||
->setParameter('authorized_centers', $centers);
|
||||
|
||||
$this->accompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
||||
|
||||
return $qb;
|
||||
}
|
||||
|
||||
|
@@ -14,6 +14,7 @@ namespace Chill\ActivityBundle\Export\Export\LinkedToACP;
|
||||
use Chill\ActivityBundle\Entity\Activity;
|
||||
use Chill\ActivityBundle\Export\Declarations;
|
||||
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
||||
use Chill\MainBundle\Export\ExportInterface;
|
||||
use Chill\MainBundle\Export\FormatterInterface;
|
||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||
@@ -30,10 +31,14 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
||||
{
|
||||
protected EntityRepository $repository;
|
||||
|
||||
private AccompanyingCourseExportHelper $accompanyingCourseExportHelper;
|
||||
|
||||
public function __construct(
|
||||
EntityManagerInterface $em
|
||||
EntityManagerInterface $em,
|
||||
AccompanyingCourseExportHelper $accompanyingCourseExportHelper
|
||||
) {
|
||||
$this->repository = $em->getRepository(Activity::class);
|
||||
$this->accompanyingCourseExportHelper = $accompanyingCourseExportHelper;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
@@ -111,6 +116,8 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
||||
)
|
||||
->setParameter('authorized_centers', $centers);
|
||||
|
||||
$this->accompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
||||
|
||||
return $qb;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user