diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php index f63be8b5d..583153a7d 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php @@ -60,6 +60,7 @@ class CancelReasonAggregator implements AggregatorInterface public function alterQuery(QueryBuilder $qb, $data) { + // TODO: still needs to take into account appointments without a cancel reason somehow $qb->join('cal.cancelReason', 'cr'); $qb->addSelect('IDENTITY(cal.cancelReason) as cancel_reason_aggregator'); diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php index 424010138..fc602f973 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\PersonBundle\Export\Aggregator\SocialWorkAggregators; use Chill\MainBundle\Export\AggregatorInterface; +use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\PersonBundle\Export\Declarations; use Chill\PersonBundle\Repository\SocialWork\ResultRepository; use Doctrine\ORM\QueryBuilder; @@ -21,9 +22,12 @@ final class ResultAggregator implements AggregatorInterface { private ResultRepository $resultRepository; - public function __construct(ResultRepository $resultRepository) + private TranslatableStringHelper $translatableStringHelper; + + public function __construct(ResultRepository $resultRepository, TranslatableStringHelper $translatableStringHelper) { $this->resultRepository = $resultRepository; + $this->translatableStringHelper = $translatableStringHelper; } public function addRole() @@ -34,7 +38,9 @@ final class ResultAggregator implements AggregatorInterface public function alterQuery(QueryBuilder $qb, $data) { $qb->join('acpw.results', 'res'); - $qb->addSelect('res.id as result_aggregator'); + $qb->join('acpw.goals', 'g'); + $qb->join('g.results', 'gres'); + $qb->addSelect('res.id, IDENTITY(g.results) as result_aggregator'); $groupBy = $qb->getDQLPart('groupBy'); diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php index 4eec8dd69..efd8c93af 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php @@ -11,6 +11,7 @@ use Doctrine\ORM\Query\Expr\Andx; use Doctrine\ORM\QueryBuilder; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\FormBuilderInterface; use Chill\PersonBundle\Entity\SocialWork\SocialAction; use Chill\PersonBundle\Templating\Entity\SocialActionRender; @@ -68,21 +69,21 @@ class SocialWorkTypeFilter implements FilterInterface ]); }; - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($refreshGoals) { + $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($refreshGoals) { $data = $event->getData(); dump($data); $refreshGoals($event->getForm(), $data); }); - $builder->get('actionType')->addEventListener( +/* $builder->get('actionType')->addEventListener( FormEvents::POST_SUBMIT, function (FormEvent $event) use ($refreshGoals) { $actionType = $event->getForm()->getData(); dump($actionType); $refreshGoals($event->getForm()->getParent(), $actionType); } - ); + );*/ } public function getTitle(): string