This commit is contained in:
2022-09-05 14:49:07 +02:00
parent 6dbee02d82
commit c442529799
144 changed files with 3683 additions and 3809 deletions

View File

@@ -1,11 +1,21 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\CalendarBundle\Export\Aggregator;
use Chill\CalendarBundle\Export\Declarations;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\MainBundle\Repository\UserJobRepository;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Closure;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
@@ -23,36 +33,6 @@ final class JobAggregator implements AggregatorInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function getLabels($key, array $values, $data): \Closure
{
return function($value): string {
if ($value === '_header') {
return 'Job';
}
$j = $this->jobRepository->find($value);
return $this->translatableStringHelper->localize(
$j->getLabel()
);
};
}
public function getQueryKeys($data): array
{
return ['job_aggregator'];
}
public function buildForm(FormBuilderInterface $builder)
{
// no form
}
public function getTitle(): string
{
return 'Group by agent job';
}
public function addRole()
{
return null;
@@ -77,4 +57,34 @@ final class JobAggregator implements AggregatorInterface
{
return Declarations::CALENDAR_TYPE;
}
}
public function buildForm(FormBuilderInterface $builder)
{
// no form
}
public function getLabels($key, array $values, $data): Closure
{
return function ($value): string {
if ('_header' === $value) {
return 'Job';
}
$j = $this->jobRepository->find($value);
return $this->translatableStringHelper->localize(
$j->getLabel()
);
};
}
public function getQueryKeys($data): array
{
return ['job_aggregator'];
}
public function getTitle(): string
{
return 'Group by agent job';
}
}