mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-26 16:45:01 +00:00
Compare commits
3 Commits
manage-tra
...
v4.0.0-RC1
Author | SHA1 | Date | |
---|---|---|---|
72a91d0864 | |||
8251587288 | |||
f3ac864233 |
@@ -1,7 +0,0 @@
|
|||||||
kind: Feature
|
|
||||||
body: "Implementation of new translation management with one source of truth for both
|
|
||||||
twig and vue component templates using YAML files. \nDuplicate translation keys
|
|
||||||
can also be detected with new command."
|
|
||||||
time: 2024-11-18T15:06:27.929549251+01:00
|
|
||||||
custom:
|
|
||||||
Issue: ""
|
|
@@ -8,7 +8,7 @@
|
|||||||
"social worker"
|
"social worker"
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.2",
|
"php": "^8.3",
|
||||||
"ext-dom": "*",
|
"ext-dom": "*",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-openssl": "*",
|
"ext-openssl": "*",
|
||||||
@@ -30,51 +30,48 @@
|
|||||||
"ovh/ovh": "^3.0",
|
"ovh/ovh": "^3.0",
|
||||||
"phpoffice/phpspreadsheet": "^1.16",
|
"phpoffice/phpspreadsheet": "^1.16",
|
||||||
"ramsey/uuid-doctrine": "^1.7",
|
"ramsey/uuid-doctrine": "^1.7",
|
||||||
"sensio/framework-extra-bundle": "^5.5",
|
"sensio/framework-extra-bundle": "^6.0",
|
||||||
"spomky-labs/base64url": "^2.0",
|
"spomky-labs/base64url": "^2.0",
|
||||||
"symfony/asset": "^5.4",
|
"symfony/asset": "6.0.*",
|
||||||
"symfony/browser-kit": "^5.4",
|
"symfony/browser-kit": "6.0.*",
|
||||||
"symfony/cache": "^5.4",
|
"symfony/cache": "6.0.*",
|
||||||
"symfony/clock": "^6.2",
|
"symfony/clock": "^6.2",
|
||||||
"symfony/config": "^5.4",
|
"symfony/config": "^6.0",
|
||||||
"symfony/console": "^5.4",
|
"symfony/console": "6.0.*",
|
||||||
"symfony/css-selector": "^5.4",
|
"symfony/css-selector": "6.0.*",
|
||||||
"symfony/dom-crawler": "^5.4",
|
"symfony/dom-crawler": "6.0.*",
|
||||||
"symfony/error-handler": "^5.4",
|
"symfony/error-handler": "6.0.*",
|
||||||
"symfony/event-dispatcher": "^5.4",
|
"symfony/event-dispatcher": "6.0.*",
|
||||||
"symfony/expression-language": "^5.4",
|
"symfony/expression-language": "6.0.*",
|
||||||
"symfony/filesystem": "^5.4",
|
"symfony/filesystem": "6.0.*",
|
||||||
"symfony/finder": "^5.4",
|
"symfony/finder": "6.0.*",
|
||||||
"symfony/form": "^5.4",
|
"symfony/form": "6.0.*",
|
||||||
"symfony/framework-bundle": "^5.4",
|
"symfony/framework-bundle": "6.0.*",
|
||||||
"symfony/http-client": "^5.4",
|
"symfony/http-client": "6.0.*",
|
||||||
"symfony/http-foundation": "^5.4",
|
"symfony/http-foundation": "6.0.*",
|
||||||
"symfony/intl": "^5.4",
|
"symfony/intl": "6.0.*",
|
||||||
"symfony/mailer": "^5.4",
|
"symfony/mailer": "6.0.*",
|
||||||
"symfony/messenger": "^5.4",
|
"symfony/messenger": "6.0.*",
|
||||||
"symfony/mime": "^5.4",
|
"symfony/mime": "6.0.*",
|
||||||
"symfony/monolog-bundle": "^3.5",
|
"symfony/monolog-bundle": "^3.5",
|
||||||
"symfony/options-resolver": "^5.4",
|
"symfony/options-resolver": "6.0.*",
|
||||||
"symfony/process": "^5.4",
|
"symfony/process": "6.0.*",
|
||||||
"symfony/property-access": "^5.4",
|
"symfony/property-access": "6.0.*",
|
||||||
"symfony/property-info": "^5.4",
|
"symfony/property-info": "6.0.*",
|
||||||
"symfony/routing": "^5.4",
|
"symfony/routing": "6.0.*",
|
||||||
"symfony/security-bundle": "^5.4",
|
"symfony/security-bundle": "^6.0",
|
||||||
"symfony/security-core": "^5.4",
|
"symfony/security-core": "6.0.*",
|
||||||
"symfony/security-csrf": "^5.4",
|
"symfony/security-csrf": "6.0.*",
|
||||||
"symfony/security-guard": "^5.4",
|
"symfony/security-http": "6.0.*",
|
||||||
"symfony/security-http": "^5.4",
|
"symfony/serializer": "6.0.*",
|
||||||
"symfony/serializer": "^5.4",
|
"symfony/string": "6.0.*",
|
||||||
"symfony/stimulus-bundle": "^2.19",
|
"symfony/templating": "6.0.*",
|
||||||
"symfony/string": "^5.4",
|
"symfony/translation": "6.0.*",
|
||||||
"symfony/templating": "^5.4",
|
"symfony/twig-bundle": "6.0.*",
|
||||||
"symfony/translation": "^5.4",
|
"symfony/validator": "6.0.*",
|
||||||
"symfony/twig-bundle": "^5.4",
|
|
||||||
"symfony/ux-translator": "^2.19",
|
|
||||||
"symfony/validator": "^5.4",
|
|
||||||
"symfony/webpack-encore-bundle": "^1.11",
|
"symfony/webpack-encore-bundle": "^1.11",
|
||||||
"symfony/workflow": "^5.4",
|
"symfony/workflow": "6.0.*",
|
||||||
"symfony/yaml": "^5.4",
|
"symfony/yaml": "6.0.*",
|
||||||
"thenetworg/oauth2-azure": "^2.0",
|
"thenetworg/oauth2-azure": "^2.0",
|
||||||
"twig/extra-bundle": "^3.0",
|
"twig/extra-bundle": "^3.0",
|
||||||
"twig/intl-extra": "^3.0",
|
"twig/intl-extra": "^3.0",
|
||||||
@@ -95,13 +92,13 @@
|
|||||||
"phpstan/phpstan-strict-rules": "^1.0",
|
"phpstan/phpstan-strict-rules": "^1.0",
|
||||||
"phpunit/phpunit": "^10.5.24",
|
"phpunit/phpunit": "^10.5.24",
|
||||||
"rector/rector": "^1.1.0",
|
"rector/rector": "^1.1.0",
|
||||||
"symfony/debug-bundle": "^5.4",
|
"symfony/debug-bundle": "6.0.*",
|
||||||
"symfony/dotenv": "^5.4",
|
"symfony/dotenv": "6.0.*",
|
||||||
"symfony/maker-bundle": "^1.20",
|
"symfony/maker-bundle": "^1.20",
|
||||||
"symfony/phpunit-bridge": "^7.1",
|
"symfony/phpunit-bridge": "^7.1",
|
||||||
"symfony/runtime": "^5.4",
|
"symfony/runtime": "6.0.*",
|
||||||
"symfony/stopwatch": "^5.4",
|
"symfony/stopwatch": "6.0.*",
|
||||||
"symfony/var-dumper": "^5.4"
|
"symfony/var-dumper": "6.0.*"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"symfony/symfony": "*"
|
"symfony/symfony": "*"
|
||||||
@@ -154,5 +151,11 @@
|
|||||||
"cache:clear": "symfony-cmd"
|
"cache:clear": "symfony-cmd"
|
||||||
},
|
},
|
||||||
"php-cs-fixer": "php-cs-fixer fix --config=./.php-cs-fixer.dist.php --show-progress=none"
|
"php-cs-fixer": "php-cs-fixer fix --config=./.php-cs-fixer.dist.php --show-progress=none"
|
||||||
|
},
|
||||||
|
"extra": {
|
||||||
|
"symfony": {
|
||||||
|
"allow-contrib": false,
|
||||||
|
"require": "6.0.*"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -21,6 +21,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
|||||||
class BirthdateFilter implements ExportElementValidatedInterface, FilterInterface
|
class BirthdateFilter implements ExportElementValidatedInterface, FilterInterface
|
||||||
{
|
{
|
||||||
// add specific role for this filter
|
// add specific role for this filter
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
// we do not need any new role for this filter, so we return null
|
// we do not need any new role for this filter, so we return null
|
||||||
@@ -28,6 +29,7 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
|
|||||||
}
|
}
|
||||||
|
|
||||||
// here, we alter the query created by Export
|
// here, we alter the query created by Export
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data)
|
public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$where = $qb->getDQLPart('where');
|
$where = $qb->getDQLPart('where');
|
||||||
@@ -52,12 +54,14 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
|
|||||||
}
|
}
|
||||||
|
|
||||||
// we give information on which type of export this filter applies
|
// we give information on which type of export this filter applies
|
||||||
|
#[\Override]
|
||||||
public function applyOn()
|
public function applyOn()
|
||||||
{
|
{
|
||||||
return 'person';
|
return 'person';
|
||||||
}
|
}
|
||||||
|
|
||||||
// we build a form to collect some parameters from the users
|
// we build a form to collect some parameters from the users
|
||||||
|
#[\Override]
|
||||||
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder)
|
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('date_from', DateType::class, [
|
$builder->add('date_from', DateType::class, [
|
||||||
@@ -74,6 +78,7 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
|
|||||||
'format' => 'dd-MM-yyyy',
|
'format' => 'dd-MM-yyyy',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return ['date_from' => new DateTime(), 'date_to' => new DateTime()];
|
return ['date_from' => new DateTime(), 'date_to' => new DateTime()];
|
||||||
@@ -81,6 +86,7 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
|
|||||||
|
|
||||||
// here, we create a simple string which will describe the action of
|
// here, we create a simple string which will describe the action of
|
||||||
// the filter in the Response
|
// the filter in the Response
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string')
|
public function describeAction($data, $format = 'string')
|
||||||
{
|
{
|
||||||
return ['Filtered by person\'s birtdate: '
|
return ['Filtered by person\'s birtdate: '
|
||||||
@@ -90,6 +96,7 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
|
|||||||
], ];
|
], ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'Filter by person\'s birthdate';
|
return 'Filter by person\'s birthdate';
|
||||||
@@ -99,6 +106,7 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
|
|||||||
// is executed here. This function is added by the interface
|
// is executed here. This function is added by the interface
|
||||||
// `ExportElementValidatedInterface`, and can be ignore if there is
|
// `ExportElementValidatedInterface`, and can be ignore if there is
|
||||||
// no need for a validation
|
// no need for a validation
|
||||||
|
#[\Override]
|
||||||
public function validateForm($data, ExecutionContextInterface $context)
|
public function validateForm($data, ExecutionContextInterface $context)
|
||||||
{
|
{
|
||||||
$date_from = $data['date_from'];
|
$date_from = $data['date_from'];
|
||||||
|
@@ -32,25 +32,30 @@ class CountPerson implements ExportInterface
|
|||||||
$this->entityManager = $em;
|
$this->entityManager = $em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
// this export does not add any form
|
// this export does not add any form
|
||||||
}
|
}
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getAllowedFormattersTypes()
|
public function getAllowedFormattersTypes()
|
||||||
{
|
{
|
||||||
return [FormatterInterface::TYPE_TABULAR];
|
return [FormatterInterface::TYPE_TABULAR];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getDescription()
|
public function getDescription()
|
||||||
{
|
{
|
||||||
return 'Count peoples by various parameters.';
|
return 'Count peoples by various parameters.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
// the Closure which will be executed by the formatter.
|
// the Closure which will be executed by the formatter.
|
||||||
@@ -60,6 +65,7 @@ class CountPerson implements ExportInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data)
|
||||||
{
|
{
|
||||||
// this array match the result keys in the query. We have only
|
// this array match the result keys in the query. We have only
|
||||||
@@ -67,21 +73,25 @@ class CountPerson implements ExportInterface
|
|||||||
return ['export_result'];
|
return ['export_result'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getResult($query, $data)
|
public function getResult($query, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'Count peoples';
|
return 'Count peoples';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getType()
|
public function getType()
|
||||||
{
|
{
|
||||||
return Declarations::PERSON_TYPE;
|
return Declarations::PERSON_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
// we gather all center the user choose.
|
// we gather all center the user choose.
|
||||||
@@ -98,11 +108,13 @@ class CountPerson implements ExportInterface
|
|||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function requiredRole(): string
|
public function requiredRole(): string
|
||||||
{
|
{
|
||||||
return PersonVoter::STATS;
|
return PersonVoter::STATS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function supportsModifiers()
|
public function supportsModifiers()
|
||||||
{
|
{
|
||||||
// explain the export manager which formatters and filters are allowed
|
// explain the export manager which formatters and filters are allowed
|
||||||
|
@@ -1,31 +0,0 @@
|
|||||||
Translations
|
|
||||||
*************
|
|
||||||
|
|
||||||
Translator-UX: one source of truth
|
|
||||||
==================================
|
|
||||||
|
|
||||||
The Translator-ux integration streamlines the process of managing and using translation keys dynamically in our views, whether they be in twig or vue components. The goal is to have one source of truth
|
|
||||||
for all translations and avoid having to add translation keys in the YAML files as well as in i18ns files.
|
|
||||||
|
|
||||||
To add new translation keys, you can define them in your translation YAML files. Running `symfony console cache:clear` will subsequently update the compiled translation keys which can then also be imported and
|
|
||||||
used within any vue component. For use within a twig template they can be leveraged by using the |trans function.
|
|
||||||
Within vue components you will have to import the translation keys you require and then they can be used in the template with the trans() function.
|
|
||||||
|
|
||||||
It is advisable, before adding a translation key to do a search on the existing translation keys of the translation you require. An IDE will allow you to do so easily.
|
|
||||||
However to avoid the creation of duplicate translation keys a command also exists to detect them. We also strongly advise you to use this command as explained below.
|
|
||||||
|
|
||||||
Detect duplicates command
|
|
||||||
=========================
|
|
||||||
|
|
||||||
The DetectTranslationDuplicatesCommand `chill:detect-duplicate-translations` is a Symfony console command designed to identify duplicate translations across YAML files in a project.
|
|
||||||
It checks for repeated translation values linked to different keys within a specified locale.
|
|
||||||
The command accepts two main options:
|
|
||||||
|
|
||||||
1. `--locale`: to specify the language locale to check (defaulting to 'en')
|
|
||||||
2. `--exclude-namespaces`: to list namespaces to ignore during the check.
|
|
||||||
3. [optional] `--verify-hash`: can be used to ensure that the hash of current duplicates matches a given expected value,
|
|
||||||
aiding in maintaining translation integrity.
|
|
||||||
|
|
||||||
When duplicates are detected, they are displayed in a table format, listing the repeated translations alongside the keys where they are found.
|
|
||||||
If a mismatch occurs between the computed and expected hash values, an error message is displayed to signal a potential issue in translation consistency.
|
|
||||||
This command is useful for maintaining clean and consistent translations, avoiding redundancy in your YAML files.
|
|
@@ -31,6 +31,7 @@ class ChillMainConfiguration implements ConfigurationInterface
|
|||||||
$this->setWidgetFactories($widgetFactories);
|
$this->setWidgetFactories($widgetFactories);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getConfigTreeBuilder()
|
public function getConfigTreeBuilder()
|
||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder('chill_main');
|
$treeBuilder = new TreeBuilder('chill_main');
|
||||||
|
@@ -27,11 +27,13 @@ class ChillMainExtension extends Extension implements Widget\HasWidgetFactoriesE
|
|||||||
*/
|
*/
|
||||||
protected $widgetFactories = [];
|
protected $widgetFactories = [];
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addWidgetFactory(WidgetFactoryInterface $factory)
|
public function addWidgetFactory(WidgetFactoryInterface $factory)
|
||||||
{
|
{
|
||||||
$this->widgetFactories[] = $factory;
|
$this->widgetFactories[] = $factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getConfiguration(array $config, ContainerBuilder $container)
|
public function getConfiguration(array $config, ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
return new Configuration($this->widgetFactories, $container);
|
return new Configuration($this->widgetFactories, $container);
|
||||||
@@ -40,11 +42,13 @@ class ChillMainExtension extends Extension implements Widget\HasWidgetFactoriesE
|
|||||||
/**
|
/**
|
||||||
* @return WidgetFactoryInterface[]
|
* @return WidgetFactoryInterface[]
|
||||||
*/
|
*/
|
||||||
|
#[\Override]
|
||||||
public function getWidgetFactories()
|
public function getWidgetFactories()
|
||||||
{
|
{
|
||||||
return $this->widgetFactories;
|
return $this->widgetFactories;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function load(array $configs, ContainerBuilder $container)
|
public function load(array $configs, ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
// configuration for main bundle
|
// configuration for main bundle
|
||||||
|
@@ -25,6 +25,7 @@ class ChillPersonAddAPersonListWidgetFactory extends AbstractWidgetFactory
|
|||||||
* see http://symfony.com/doc/current/components/config/definition.html
|
* see http://symfony.com/doc/current/components/config/definition.html
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#[\Override]
|
||||||
public function configureOptions($place, NodeBuilder $node)
|
public function configureOptions($place, NodeBuilder $node)
|
||||||
{
|
{
|
||||||
$node->booleanNode('only_active')
|
$node->booleanNode('only_active')
|
||||||
@@ -56,6 +57,7 @@ class ChillPersonAddAPersonListWidgetFactory extends AbstractWidgetFactory
|
|||||||
* the service must exists in the container, and it is not required that the service
|
* the service must exists in the container, and it is not required that the service
|
||||||
* has the `chill_main` tag.
|
* has the `chill_main` tag.
|
||||||
*/
|
*/
|
||||||
|
#[\Override]
|
||||||
public function getServiceId(ContainerBuilder $containerBuilder, $place, $order, array $config)
|
public function getServiceId(ContainerBuilder $containerBuilder, $place, $order, array $config)
|
||||||
{
|
{
|
||||||
return 'chill_person.widget.person_list';
|
return 'chill_person.widget.person_list';
|
||||||
@@ -66,6 +68,7 @@ class ChillPersonAddAPersonListWidgetFactory extends AbstractWidgetFactory
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
#[\Override]
|
||||||
public function getWidgetAlias()
|
public function getWidgetAlias()
|
||||||
{
|
{
|
||||||
return 'person_list';
|
return 'person_list';
|
||||||
|
@@ -79,6 +79,7 @@ class ChillPersonAddAPersonWidget implements WidgetInterface
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
#[\Override]
|
||||||
public function render(Twig_Environment $env, $place, array $context, array $config)
|
public function render(Twig_Environment $env, $place, array $context, array $config)
|
||||||
{
|
{
|
||||||
$qb = $this->personRepository
|
$qb = $this->personRepository
|
||||||
|
@@ -22,6 +22,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
|||||||
*/
|
*/
|
||||||
class ChillPersonExtension extends Extension implements PrependExtensionInterface
|
class ChillPersonExtension extends Extension implements PrependExtensionInterface
|
||||||
{
|
{
|
||||||
|
#[\Override]
|
||||||
public function load(array $configs, ContainerBuilder $container)
|
public function load(array $configs, ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
// ...
|
// ...
|
||||||
@@ -32,6 +33,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
*
|
*
|
||||||
* @param \Chill\PersonBundle\DependencyInjection\containerBuilder $container
|
* @param \Chill\PersonBundle\DependencyInjection\containerBuilder $container
|
||||||
*/
|
*/
|
||||||
|
#[\Override]
|
||||||
public function prepend(ContainerBuilder $container)
|
public function prepend(ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
$container->prependExtensionConfig('chill_main', [
|
$container->prependExtensionConfig('chill_main', [
|
||||||
|
21
rector.php
21
rector.php
@@ -39,14 +39,19 @@ return static function (RectorConfig $rectorConfig): void {
|
|||||||
|
|
||||||
//define sets of rules
|
//define sets of rules
|
||||||
$rectorConfig->sets([
|
$rectorConfig->sets([
|
||||||
LevelSetList::UP_TO_PHP_82,
|
LevelSetList::UP_TO_PHP_83,
|
||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_40,
|
// \Rector\Symfony\Set\SymfonySetList::SYMFONY_40,
|
||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_41,
|
// \Rector\Symfony\Set\SymfonySetList::SYMFONY_41,
|
||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_42,
|
// \Rector\Symfony\Set\SymfonySetList::SYMFONY_42,
|
||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_43,
|
// \Rector\Symfony\Set\SymfonySetList::SYMFONY_43,
|
||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_44,
|
// \Rector\Symfony\Set\SymfonySetList::SYMFONY_44,
|
||||||
\Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY,
|
\Rector\Symfony\Set\SymfonySetList::SYMFONY_50,
|
||||||
\Rector\PHPUnit\Set\PHPUnitSetList::PHPUNIT_90,
|
\Rector\Symfony\Set\SymfonySetList::SYMFONY_51,
|
||||||
|
\Rector\Symfony\Set\SymfonySetList::SYMFONY_52,
|
||||||
|
\Rector\Symfony\Set\SymfonySetList::SYMFONY_53,
|
||||||
|
\Rector\Symfony\Set\SymfonySetList::SYMFONY_54,
|
||||||
|
// \Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY,
|
||||||
|
// \Rector\PHPUnit\Set\PHPUnitSetList::PHPUNIT_90,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$rectorConfig->ruleWithConfiguration(\Rector\Php80\Rector\Class_\AnnotationToAttributeRector::class, [
|
$rectorConfig->ruleWithConfiguration(\Rector\Php80\Rector\Class_\AnnotationToAttributeRector::class, [
|
||||||
|
@@ -22,6 +22,7 @@ class AdminActivityPresenceController extends CRUDController
|
|||||||
*
|
*
|
||||||
* @return \Doctrine\ORM\QueryBuilder|mixed
|
* @return \Doctrine\ORM\QueryBuilder|mixed
|
||||||
*/
|
*/
|
||||||
|
#[\Override]
|
||||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||||
{
|
{
|
||||||
/* @var \Doctrine\ORM\QueryBuilder $query */
|
/* @var \Doctrine\ORM\QueryBuilder $query */
|
||||||
|
@@ -22,6 +22,7 @@ class AdminActivityTypeCategoryController extends CRUDController
|
|||||||
*
|
*
|
||||||
* @return \Doctrine\ORM\QueryBuilder|mixed
|
* @return \Doctrine\ORM\QueryBuilder|mixed
|
||||||
*/
|
*/
|
||||||
|
#[\Override]
|
||||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||||
{
|
{
|
||||||
/* @var \Doctrine\ORM\QueryBuilder $query */
|
/* @var \Doctrine\ORM\QueryBuilder $query */
|
||||||
|
@@ -22,6 +22,7 @@ class AdminActivityTypeController extends CRUDController
|
|||||||
*
|
*
|
||||||
* @return \Doctrine\ORM\QueryBuilder|mixed
|
* @return \Doctrine\ORM\QueryBuilder|mixed
|
||||||
*/
|
*/
|
||||||
|
#[\Override]
|
||||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||||
{
|
{
|
||||||
/* @var \Doctrine\ORM\QueryBuilder $query */
|
/* @var \Doctrine\ORM\QueryBuilder $query */
|
||||||
|
@@ -32,11 +32,13 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface
|
|||||||
$this->faker = FakerFactory::create('fr_FR');
|
$this->faker = FakerFactory::create('fr_FR');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getOrder()
|
public function getOrder()
|
||||||
{
|
{
|
||||||
return 16400;
|
return 16400;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function load(ObjectManager $manager)
|
public function load(ObjectManager $manager)
|
||||||
{
|
{
|
||||||
$persons = $this->em
|
$persons = $this->em
|
||||||
|
@@ -38,6 +38,7 @@ class LoadActivityNotifications extends AbstractFixture implements DependentFixt
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getDependencies()
|
public function getDependencies()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@@ -23,11 +23,13 @@ class LoadActivityReason extends AbstractFixture implements OrderedFixtureInterf
|
|||||||
{
|
{
|
||||||
public static $references = [];
|
public static $references = [];
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getOrder()
|
public function getOrder()
|
||||||
{
|
{
|
||||||
return 16300;
|
return 16300;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function load(ObjectManager $manager)
|
public function load(ObjectManager $manager)
|
||||||
{
|
{
|
||||||
$reasons = [
|
$reasons = [
|
||||||
|
@@ -21,11 +21,13 @@ use Doctrine\Persistence\ObjectManager;
|
|||||||
*/
|
*/
|
||||||
class LoadActivityReasonCategory extends AbstractFixture implements OrderedFixtureInterface
|
class LoadActivityReasonCategory extends AbstractFixture implements OrderedFixtureInterface
|
||||||
{
|
{
|
||||||
|
#[\Override]
|
||||||
public function getOrder()
|
public function getOrder()
|
||||||
{
|
{
|
||||||
return 16200;
|
return 16200;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function load(ObjectManager $manager)
|
public function load(ObjectManager $manager)
|
||||||
{
|
{
|
||||||
$categs = [
|
$categs = [
|
||||||
|
@@ -23,11 +23,13 @@ class LoadActivityType extends Fixture implements OrderedFixtureInterface
|
|||||||
{
|
{
|
||||||
public static $references = [];
|
public static $references = [];
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getOrder()
|
public function getOrder()
|
||||||
{
|
{
|
||||||
return 16100;
|
return 16100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function load(ObjectManager $manager)
|
public function load(ObjectManager $manager)
|
||||||
{
|
{
|
||||||
$types = [
|
$types = [
|
||||||
|
@@ -23,11 +23,13 @@ class LoadActivityTypeCategory extends Fixture implements OrderedFixtureInterfac
|
|||||||
{
|
{
|
||||||
public static $references = [];
|
public static $references = [];
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getOrder()
|
public function getOrder()
|
||||||
{
|
{
|
||||||
return 16050;
|
return 16050;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function load(ObjectManager $manager)
|
public function load(ObjectManager $manager)
|
||||||
{
|
{
|
||||||
$categories = [
|
$categories = [
|
||||||
|
@@ -26,11 +26,13 @@ use Doctrine\Persistence\ObjectManager;
|
|||||||
*/
|
*/
|
||||||
class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterface
|
class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterface
|
||||||
{
|
{
|
||||||
|
#[\Override]
|
||||||
public function getOrder()
|
public function getOrder()
|
||||||
{
|
{
|
||||||
return 16000;
|
return 16000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function load(ObjectManager $manager)
|
public function load(ObjectManager $manager)
|
||||||
{
|
{
|
||||||
foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) {
|
foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) {
|
||||||
|
@@ -25,6 +25,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
|||||||
*/
|
*/
|
||||||
class ChillActivityExtension extends Extension implements PrependExtensionInterface
|
class ChillActivityExtension extends Extension implements PrependExtensionInterface
|
||||||
{
|
{
|
||||||
|
#[\Override]
|
||||||
public function load(array $configs, ContainerBuilder $container)
|
public function load(array $configs, ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
$configuration = new Configuration();
|
$configuration = new Configuration();
|
||||||
@@ -44,6 +45,7 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf
|
|||||||
$loader->load('services/doctrine.entitylistener.yaml');
|
$loader->load('services/doctrine.entitylistener.yaml');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function prepend(ContainerBuilder $container)
|
public function prepend(ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
$this->prependRoutes($container);
|
$this->prependRoutes($container);
|
||||||
|
@@ -22,6 +22,7 @@ use function is_int;
|
|||||||
*/
|
*/
|
||||||
class Configuration implements ConfigurationInterface
|
class Configuration implements ConfigurationInterface
|
||||||
{
|
{
|
||||||
|
#[\Override]
|
||||||
public function getConfigTreeBuilder()
|
public function getConfigTreeBuilder()
|
||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder('chill_activity');
|
$treeBuilder = new TreeBuilder('chill_activity');
|
||||||
|
@@ -53,9 +53,9 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
|||||||
|
|
||||||
use TrackUpdateTrait;
|
use TrackUpdateTrait;
|
||||||
|
|
||||||
final public const SENTRECEIVED_RECEIVED = 'received';
|
final public const string SENTRECEIVED_RECEIVED = 'received';
|
||||||
|
|
||||||
final public const SENTRECEIVED_SENT = 'sent';
|
final public const string SENTRECEIVED_SENT = 'sent';
|
||||||
|
|
||||||
#[Groups(['read'])]
|
#[Groups(['read'])]
|
||||||
#[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class)]
|
#[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class)]
|
||||||
@@ -262,6 +262,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getAccompanyingPeriod(): ?AccompanyingPeriod
|
public function getAccompanyingPeriod(): ?AccompanyingPeriod
|
||||||
{
|
{
|
||||||
return $this->accompanyingPeriod;
|
return $this->accompanyingPeriod;
|
||||||
@@ -281,6 +282,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
|||||||
* get the center
|
* get the center
|
||||||
* center is extracted from person.
|
* center is extracted from person.
|
||||||
*/
|
*/
|
||||||
|
#[\Override]
|
||||||
public function getCenters(): iterable
|
public function getCenters(): iterable
|
||||||
{
|
{
|
||||||
if ($this->person instanceof Person) {
|
if ($this->person instanceof Person) {
|
||||||
@@ -399,6 +401,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
|||||||
return $this->scope;
|
return $this->scope;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getScopes(): iterable
|
public function getScopes(): iterable
|
||||||
{
|
{
|
||||||
if (null !== $this->getAccompanyingPeriod()) {
|
if (null !== $this->getAccompanyingPeriod()) {
|
||||||
@@ -422,6 +425,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
|||||||
return $this->socialActions;
|
return $this->socialActions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getSocialIssues(): Collection
|
public function getSocialIssues(): Collection
|
||||||
{
|
{
|
||||||
return $this->socialIssues;
|
return $this->socialIssues;
|
||||||
@@ -492,6 +496,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function removeSocialIssue(SocialIssue $socialIssue): self
|
public function removeSocialIssue(SocialIssue $socialIssue): self
|
||||||
{
|
{
|
||||||
$this->socialIssues->removeElement($socialIssue);
|
$this->socialIssues->removeElement($socialIssue);
|
||||||
|
@@ -53,6 +53,7 @@ class ActivityReasonCategory implements \Stringable
|
|||||||
$this->reasons = new ArrayCollection();
|
$this->reasons = new ArrayCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function __toString(): string
|
public function __toString(): string
|
||||||
{
|
{
|
||||||
return 'ActivityReasonCategory('.$this->getName('x').')';
|
return 'ActivityReasonCategory('.$this->getName('x').')';
|
||||||
|
@@ -25,11 +25,11 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
|||||||
#[ORM\Table(name: 'activitytype')]
|
#[ORM\Table(name: 'activitytype')]
|
||||||
class ActivityType
|
class ActivityType
|
||||||
{
|
{
|
||||||
final public const FIELD_INVISIBLE = 0;
|
final public const int FIELD_INVISIBLE = 0;
|
||||||
|
|
||||||
final public const FIELD_OPTIONAL = 1;
|
final public const int FIELD_OPTIONAL = 1;
|
||||||
|
|
||||||
final public const FIELD_REQUIRED = 2;
|
final public const int FIELD_REQUIRED = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated not in use
|
* @deprecated not in use
|
||||||
|
@@ -19,11 +19,13 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class ByActivityNumberAggregator implements AggregatorInterface
|
class ByActivityNumberAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data): void
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$qb
|
$qb
|
||||||
@@ -31,21 +33,25 @@ class ByActivityNumberAggregator implements AggregatorInterface
|
|||||||
->addGroupBy('activity_by_number_aggregator');
|
->addGroupBy('activity_by_number_aggregator');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACP_TYPE;
|
return Declarations::ACP_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder): void
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// No form needed
|
// No form needed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
return static function ($value) {
|
return static function ($value) {
|
||||||
@@ -61,11 +67,13 @@ class ByActivityNumberAggregator implements AggregatorInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return ['activity_by_number_aggregator'];
|
return ['activity_by_number_aggregator'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Group acp by activity number';
|
return 'Group acp by activity number';
|
||||||
|
@@ -25,7 +25,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
final readonly class ByActivityTypeAggregator implements AggregatorInterface
|
final readonly class ByActivityTypeAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
private const PREFIX = 'acp_by_activity_type_agg';
|
private const string PREFIX = 'acp_by_activity_type_agg';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private RollingDateConverterInterface $rollingDateConverter,
|
private RollingDateConverterInterface $rollingDateConverter,
|
||||||
@@ -33,6 +33,7 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface
|
|||||||
private TranslatableStringHelperInterface $translatableStringHelper,
|
private TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
@@ -46,6 +47,7 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -54,6 +56,7 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, mixed $data)
|
public function getLabels($key, array $values, mixed $data)
|
||||||
{
|
{
|
||||||
return function (int|string|null $value): string {
|
return function (int|string|null $value): string {
|
||||||
@@ -69,21 +72,25 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data)
|
||||||
{
|
{
|
||||||
return [self::PREFIX.'_actype_id'];
|
return [self::PREFIX.'_actype_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'export.aggregator.acp.by_activity_type.title';
|
return 'export.aggregator.acp.by_activity_type.title';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
@@ -115,6 +122,7 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface
|
|||||||
->addGroupBy("{$p}_actype_id");
|
->addGroupBy("{$p}_actype_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn()
|
public function applyOn()
|
||||||
{
|
{
|
||||||
return Declarations::ACP_TYPE;
|
return Declarations::ACP_TYPE;
|
||||||
|
@@ -22,11 +22,13 @@ class BySocialActionAggregator implements AggregatorInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly SocialActionRender $actionRender, private readonly SocialActionRepository $actionRepository) {}
|
public function __construct(private readonly SocialActionRender $actionRender, private readonly SocialActionRepository $actionRepository) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
if (!\in_array('actsocialaction', $qb->getAllAliases(), true)) {
|
if (!\in_array('actsocialaction', $qb->getAllAliases(), true)) {
|
||||||
@@ -37,21 +39,25 @@ class BySocialActionAggregator implements AggregatorInterface
|
|||||||
$qb->addGroupBy('socialaction_aggregator');
|
$qb->addGroupBy('socialaction_aggregator');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY_ACP;
|
return Declarations::ACTIVITY_ACP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
// no form
|
// no form
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
return function ($value) {
|
return function ($value) {
|
||||||
@@ -69,11 +75,13 @@ class BySocialActionAggregator implements AggregatorInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return ['socialaction_aggregator'];
|
return ['socialaction_aggregator'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Group activity by linked socialaction';
|
return 'Group activity by linked socialaction';
|
||||||
|
@@ -22,11 +22,13 @@ class BySocialIssueAggregator implements AggregatorInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly SocialIssueRepository $issueRepository, private readonly SocialIssueRender $issueRender) {}
|
public function __construct(private readonly SocialIssueRepository $issueRepository, private readonly SocialIssueRender $issueRender) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
if (!\in_array('actsocialissue', $qb->getAllAliases(), true)) {
|
if (!\in_array('actsocialissue', $qb->getAllAliases(), true)) {
|
||||||
@@ -37,21 +39,25 @@ class BySocialIssueAggregator implements AggregatorInterface
|
|||||||
$qb->addGroupBy('socialissue_aggregator');
|
$qb->addGroupBy('socialissue_aggregator');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY_ACP;
|
return Declarations::ACTIVITY_ACP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
// no form
|
// no form
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
return function ($value): string {
|
return function ($value): string {
|
||||||
@@ -69,11 +75,13 @@ class BySocialIssueAggregator implements AggregatorInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return ['socialissue_aggregator'];
|
return ['socialissue_aggregator'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Group activity by linked socialissue';
|
return 'Group activity by linked socialissue';
|
||||||
|
@@ -18,13 +18,15 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
final readonly class ActivityLocationAggregator implements AggregatorInterface
|
final readonly class ActivityLocationAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
public const KEY = 'activity_location_aggregator';
|
public const string KEY = 'activity_location_aggregator';
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
if (!\in_array('actloc', $qb->getAllAliases(), true)) {
|
if (!\in_array('actloc', $qb->getAllAliases(), true)) {
|
||||||
@@ -34,21 +36,25 @@ final readonly class ActivityLocationAggregator implements AggregatorInterface
|
|||||||
$qb->addGroupBy(self::KEY);
|
$qb->addGroupBy(self::KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
// no form required for this aggregator
|
// no form required for this aggregator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data): \Closure
|
public function getLabels($key, array $values, $data): \Closure
|
||||||
{
|
{
|
||||||
return function ($value): string {
|
return function ($value): string {
|
||||||
@@ -64,11 +70,13 @@ final readonly class ActivityLocationAggregator implements AggregatorInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return [self::KEY];
|
return [self::KEY];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'export.aggregator.activity.by_location.Title';
|
return 'export.aggregator.activity.by_location.Title';
|
||||||
|
@@ -22,13 +22,16 @@ final readonly class ActivityPresenceAggregator implements AggregatorInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private ActivityPresenceRepositoryInterface $activityPresenceRepository, private TranslatableStringHelperInterface $translatableStringHelper) {}
|
public function __construct(private ActivityPresenceRepositoryInterface $activityPresenceRepository, private TranslatableStringHelperInterface $translatableStringHelper) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder) {}
|
public function buildForm(FormBuilderInterface $builder) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, mixed $data)
|
public function getLabels($key, array $values, mixed $data)
|
||||||
{
|
{
|
||||||
return function (int|string|null $value): string {
|
return function (int|string|null $value): string {
|
||||||
@@ -44,27 +47,32 @@ final readonly class ActivityPresenceAggregator implements AggregatorInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data)
|
||||||
{
|
{
|
||||||
return ['activity_presence_aggregator_attendee'];
|
return ['activity_presence_aggregator_attendee'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'export.aggregator.activity.by_activity_presence.Group activity by presence';
|
return 'export.aggregator.activity.by_activity_presence.Group activity by presence';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data): void
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$qb->addSelect('IDENTITY(activity.attendee) AS activity_presence_aggregator_attendee');
|
$qb->addSelect('IDENTITY(activity.attendee) AS activity_presence_aggregator_attendee');
|
||||||
$qb->addGroupBy('activity_presence_aggregator_attendee');
|
$qb->addGroupBy('activity_presence_aggregator_attendee');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn()
|
public function applyOn()
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
|
@@ -31,11 +31,13 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
|||||||
protected TranslatableStringHelper $translatableStringHelper
|
protected TranslatableStringHelper $translatableStringHelper
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
// add select element
|
// add select element
|
||||||
@@ -67,11 +69,13 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
|||||||
$qb->addGroupBy($alias);
|
$qb->addGroupBy($alias);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add(
|
$builder->add(
|
||||||
@@ -89,6 +93,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -96,6 +101,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
return function ($value) use ($data) {
|
return function ($value) use ($data) {
|
||||||
@@ -125,6 +131,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data)
|
||||||
{
|
{
|
||||||
// add select element
|
// add select element
|
||||||
@@ -139,11 +146,13 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
|||||||
throw new \RuntimeException('The data provided are not recognised.');
|
throw new \RuntimeException('The data provided are not recognised.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'Aggregate by activity reason';
|
return 'Aggregate by activity reason';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function validateForm($data, ExecutionContextInterface $context)
|
public function validateForm($data, ExecutionContextInterface $context)
|
||||||
{
|
{
|
||||||
if (null === $data['level']) {
|
if (null === $data['level']) {
|
||||||
|
@@ -20,15 +20,17 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class ActivityTypeAggregator implements AggregatorInterface
|
class ActivityTypeAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
final public const KEY = 'activity_type_aggregator';
|
final public const string KEY = 'activity_type_aggregator';
|
||||||
|
|
||||||
public function __construct(protected ActivityTypeRepositoryInterface $activityTypeRepository, protected TranslatableStringHelperInterface $translatableStringHelper) {}
|
public function __construct(protected ActivityTypeRepositoryInterface $activityTypeRepository, protected TranslatableStringHelperInterface $translatableStringHelper) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
if (!\in_array('acttype', $qb->getAllAliases(), true)) {
|
if (!\in_array('acttype', $qb->getAllAliases(), true)) {
|
||||||
@@ -39,21 +41,25 @@ class ActivityTypeAggregator implements AggregatorInterface
|
|||||||
$qb->addGroupBy(self::KEY);
|
$qb->addGroupBy(self::KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
// no form required for this aggregator
|
// no form required for this aggregator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data): \Closure
|
public function getLabels($key, array $values, $data): \Closure
|
||||||
{
|
{
|
||||||
return function (int|string|null $value): string {
|
return function (int|string|null $value): string {
|
||||||
@@ -69,11 +75,13 @@ class ActivityTypeAggregator implements AggregatorInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return [self::KEY];
|
return [self::KEY];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'Aggregate by activity type';
|
return 'Aggregate by activity type';
|
||||||
|
@@ -20,15 +20,17 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class ActivityUserAggregator implements AggregatorInterface
|
class ActivityUserAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
final public const KEY = 'activity_user_id';
|
final public const string KEY = 'activity_user_id';
|
||||||
|
|
||||||
public function __construct(private readonly UserRepository $userRepository, private readonly UserRender $userRender) {}
|
public function __construct(private readonly UserRepository $userRepository, private readonly UserRender $userRender) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
// add select element
|
// add select element
|
||||||
@@ -38,21 +40,25 @@ class ActivityUserAggregator implements AggregatorInterface
|
|||||||
$qb->addGroupBy(self::KEY);
|
$qb->addGroupBy(self::KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
// nothing to add
|
// nothing to add
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, $values, $data): \Closure
|
public function getLabels($key, $values, $data): \Closure
|
||||||
{
|
{
|
||||||
return function ($value) {
|
return function ($value) {
|
||||||
@@ -70,11 +76,13 @@ class ActivityUserAggregator implements AggregatorInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data)
|
||||||
{
|
{
|
||||||
return [self::KEY];
|
return [self::KEY];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Aggregate by activity user';
|
return 'Aggregate by activity user';
|
||||||
|
@@ -22,11 +22,13 @@ class ActivityUsersAggregator implements AggregatorInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) {}
|
public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
if (!\in_array('actusers', $qb->getAllAliases(), true)) {
|
if (!\in_array('actusers', $qb->getAllAliases(), true)) {
|
||||||
@@ -38,21 +40,25 @@ class ActivityUsersAggregator implements AggregatorInterface
|
|||||||
->addGroupBy('activity_users_aggregator');
|
->addGroupBy('activity_users_aggregator');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
// nothing to add on the form
|
// nothing to add on the form
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
return function ($value) {
|
return function ($value) {
|
||||||
@@ -70,11 +76,13 @@ class ActivityUsersAggregator implements AggregatorInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data)
|
||||||
{
|
{
|
||||||
return ['activity_users_aggregator'];
|
return ['activity_users_aggregator'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'Aggregate by activity users';
|
return 'Aggregate by activity users';
|
||||||
|
@@ -22,18 +22,20 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class ActivityUsersJobAggregator implements AggregatorInterface
|
class ActivityUsersJobAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
private const PREFIX = 'act_agg_user_job';
|
private const string PREFIX = 'act_agg_user_job';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly UserJobRepositoryInterface $userJobRepository,
|
private readonly UserJobRepositoryInterface $userJobRepository,
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
@@ -60,18 +62,22 @@ class ActivityUsersJobAggregator implements AggregatorInterface
|
|||||||
->addGroupBy("{$p}_select");
|
->addGroupBy("{$p}_select");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder) {}
|
public function buildForm(FormBuilderInterface $builder) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
return function ($value): string {
|
return function ($value): string {
|
||||||
@@ -91,11 +97,13 @@ class ActivityUsersJobAggregator implements AggregatorInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return [self::PREFIX.'_select'];
|
return [self::PREFIX.'_select'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'export.aggregator.activity.by_user_job.Aggregate by users job';
|
return 'export.aggregator.activity.by_user_job.Aggregate by users job';
|
||||||
|
@@ -22,18 +22,20 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class ActivityUsersScopeAggregator implements AggregatorInterface
|
class ActivityUsersScopeAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
private const PREFIX = 'act_agg_user_scope';
|
private const string PREFIX = 'act_agg_user_scope';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly ScopeRepositoryInterface $scopeRepository,
|
private readonly ScopeRepositoryInterface $scopeRepository,
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
@@ -60,18 +62,22 @@ class ActivityUsersScopeAggregator implements AggregatorInterface
|
|||||||
->addGroupBy("{$p}_select");
|
->addGroupBy("{$p}_select");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder) {}
|
public function buildForm(FormBuilderInterface $builder) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
return function ($value): string {
|
return function ($value): string {
|
||||||
@@ -91,11 +97,13 @@ class ActivityUsersScopeAggregator implements AggregatorInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return [self::PREFIX.'_select'];
|
return [self::PREFIX.'_select'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'export.aggregator.activity.by_user_scope.Aggregate by users scope';
|
return 'export.aggregator.activity.by_user_scope.Aggregate by users scope';
|
||||||
|
@@ -22,32 +22,38 @@ class ByCreatorAggregator implements AggregatorInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) {}
|
public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$qb->addSelect('IDENTITY(activity.createdBy) AS creator_aggregator');
|
$qb->addSelect('IDENTITY(activity.createdBy) AS creator_aggregator');
|
||||||
$qb->addGroupBy('creator_aggregator');
|
$qb->addGroupBy('creator_aggregator');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
// no form
|
// no form
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
return function ($value): string {
|
return function ($value): string {
|
||||||
@@ -65,11 +71,13 @@ class ByCreatorAggregator implements AggregatorInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return ['creator_aggregator'];
|
return ['creator_aggregator'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Group activity by creator';
|
return 'Group activity by creator';
|
||||||
|
@@ -22,11 +22,13 @@ class ByThirdpartyAggregator implements AggregatorInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly ThirdPartyRepository $thirdPartyRepository, private readonly ThirdPartyRender $thirdPartyRender) {}
|
public function __construct(private readonly ThirdPartyRepository $thirdPartyRepository, private readonly ThirdPartyRender $thirdPartyRender) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
if (!\in_array('acttparty', $qb->getAllAliases(), true)) {
|
if (!\in_array('acttparty', $qb->getAllAliases(), true)) {
|
||||||
@@ -37,21 +39,25 @@ class ByThirdpartyAggregator implements AggregatorInterface
|
|||||||
$qb->addGroupBy('thirdparty_aggregator');
|
$qb->addGroupBy('thirdparty_aggregator');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
// no form
|
// no form
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
return function ($value): string {
|
return function ($value): string {
|
||||||
@@ -69,11 +75,13 @@ class ByThirdpartyAggregator implements AggregatorInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return ['thirdparty_aggregator'];
|
return ['thirdparty_aggregator'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Group activity by linked thirdparties';
|
return 'Group activity by linked thirdparties';
|
||||||
|
@@ -22,18 +22,20 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class CreatorJobAggregator implements AggregatorInterface
|
class CreatorJobAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
private const PREFIX = 'acp_agg_creator_job';
|
private const string PREFIX = 'acp_agg_creator_job';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly UserJobRepositoryInterface $userJobRepository,
|
private readonly UserJobRepositoryInterface $userJobRepository,
|
||||||
private readonly TranslatableStringHelper $translatableStringHelper
|
private readonly TranslatableStringHelper $translatableStringHelper
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
@@ -60,18 +62,22 @@ class CreatorJobAggregator implements AggregatorInterface
|
|||||||
->addGroupBy("{$p}_select");
|
->addGroupBy("{$p}_select");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder) {}
|
public function buildForm(FormBuilderInterface $builder) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
return function ($value): string {
|
return function ($value): string {
|
||||||
@@ -89,11 +95,13 @@ class CreatorJobAggregator implements AggregatorInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return [self::PREFIX.'_select'];
|
return [self::PREFIX.'_select'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'export.aggregator.activity.by_creator_job.Group activity by creator job';
|
return 'export.aggregator.activity.by_creator_job.Group activity by creator job';
|
||||||
|
@@ -22,18 +22,20 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class CreatorScopeAggregator implements AggregatorInterface
|
class CreatorScopeAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
private const PREFIX = 'acp_agg_creator_scope';
|
private const string PREFIX = 'acp_agg_creator_scope';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly ScopeRepository $scopeRepository,
|
private readonly ScopeRepository $scopeRepository,
|
||||||
private readonly TranslatableStringHelper $translatableStringHelper
|
private readonly TranslatableStringHelper $translatableStringHelper
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
@@ -60,18 +62,22 @@ class CreatorScopeAggregator implements AggregatorInterface
|
|||||||
->addGroupBy("{$p}_select");
|
->addGroupBy("{$p}_select");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder) {}
|
public function buildForm(FormBuilderInterface $builder) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
return function ($value): string {
|
return function ($value): string {
|
||||||
@@ -91,11 +97,13 @@ class CreatorScopeAggregator implements AggregatorInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return [self::PREFIX.'_select'];
|
return [self::PREFIX.'_select'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'export.aggregator.activity.by_creator_scope.Group activity by creator scope';
|
return 'export.aggregator.activity.by_creator_scope.Group activity by creator scope';
|
||||||
|
@@ -19,19 +19,21 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class DateAggregator implements AggregatorInterface
|
class DateAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
private const CHOICES = [
|
private const array CHOICES = [
|
||||||
'by month' => 'month',
|
'by month' => 'month',
|
||||||
'by week' => 'week',
|
'by week' => 'week',
|
||||||
'by year' => 'year',
|
'by year' => 'year',
|
||||||
];
|
];
|
||||||
|
|
||||||
private const DEFAULT_CHOICE = 'year';
|
private const string DEFAULT_CHOICE = 'year';
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$order = null;
|
$order = null;
|
||||||
@@ -62,11 +64,13 @@ class DateAggregator implements AggregatorInterface
|
|||||||
$qb->addOrderBy('date_aggregator', $order);
|
$qb->addOrderBy('date_aggregator', $order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('frequency', ChoiceType::class, [
|
$builder->add('frequency', ChoiceType::class, [
|
||||||
@@ -76,11 +80,13 @@ class DateAggregator implements AggregatorInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return ['frequency' => self::DEFAULT_CHOICE];
|
return ['frequency' => self::DEFAULT_CHOICE];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
return static function ($value) use ($data): string {
|
return static function ($value) use ($data): string {
|
||||||
@@ -98,11 +104,13 @@ class DateAggregator implements AggregatorInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return ['date_aggregator'];
|
return ['date_aggregator'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Group activity by date';
|
return 'Group activity by date';
|
||||||
|
@@ -22,11 +22,13 @@ class LocationTypeAggregator implements AggregatorInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly LocationTypeRepository $locationTypeRepository, private readonly TranslatableStringHelper $translatableStringHelper) {}
|
public function __construct(private readonly LocationTypeRepository $locationTypeRepository, private readonly TranslatableStringHelper $translatableStringHelper) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
if (!\in_array('actloc', $qb->getAllAliases(), true)) {
|
if (!\in_array('actloc', $qb->getAllAliases(), true)) {
|
||||||
@@ -37,21 +39,25 @@ class LocationTypeAggregator implements AggregatorInterface
|
|||||||
$qb->addGroupBy('locationtype_aggregator');
|
$qb->addGroupBy('locationtype_aggregator');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
// no form
|
// no form
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
return function ($value): string {
|
return function ($value): string {
|
||||||
@@ -73,11 +79,13 @@ class LocationTypeAggregator implements AggregatorInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return ['locationtype_aggregator'];
|
return ['locationtype_aggregator'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Group activity by locationtype';
|
return 'Group activity by locationtype';
|
||||||
|
@@ -21,36 +21,43 @@ final readonly class PersonAggregator implements AggregatorInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private LabelPersonHelper $labelPersonHelper) {}
|
public function __construct(private LabelPersonHelper $labelPersonHelper) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
// nothing to add here
|
// nothing to add here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, mixed $data)
|
public function getLabels($key, array $values, mixed $data)
|
||||||
{
|
{
|
||||||
return $this->labelPersonHelper->getLabel($key, $values, 'export.aggregator.person.by_person.person');
|
return $this->labelPersonHelper->getLabel($key, $values, 'export.aggregator.person.by_person.person');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data)
|
||||||
{
|
{
|
||||||
return ['activity_by_person_agg'];
|
return ['activity_by_person_agg'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'export.aggregator.person.by_person.title';
|
return 'export.aggregator.person.by_person.title';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$qb
|
$qb
|
||||||
@@ -58,6 +65,7 @@ final readonly class PersonAggregator implements AggregatorInterface
|
|||||||
->addGroupBy('activity_by_person_agg');
|
->addGroupBy('activity_by_person_agg');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn()
|
public function applyOn()
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY_PERSON;
|
return Declarations::ACTIVITY_PERSON;
|
||||||
|
@@ -23,20 +23,23 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
*/
|
*/
|
||||||
final readonly class PersonsAggregator implements AggregatorInterface
|
final readonly class PersonsAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
private const PREFIX = 'act_persons_agg';
|
private const string PREFIX = 'act_persons_agg';
|
||||||
|
|
||||||
public function __construct(private LabelPersonHelper $labelPersonHelper) {}
|
public function __construct(private LabelPersonHelper $labelPersonHelper) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
// nothing to add here
|
// nothing to add here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, mixed $data)
|
public function getLabels($key, array $values, mixed $data)
|
||||||
{
|
{
|
||||||
if ($key !== self::PREFIX.'_pid') {
|
if ($key !== self::PREFIX.'_pid') {
|
||||||
@@ -46,21 +49,25 @@ final readonly class PersonsAggregator implements AggregatorInterface
|
|||||||
return $this->labelPersonHelper->getLabel($key, $values, 'export.aggregator.activity.by_persons.Persons');
|
return $this->labelPersonHelper->getLabel($key, $values, 'export.aggregator.activity.by_persons.Persons');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data)
|
||||||
{
|
{
|
||||||
return [self::PREFIX.'_pid'];
|
return [self::PREFIX.'_pid'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'export.aggregator.activity.by_persons.Group activity by persons';
|
return 'export.aggregator.activity.by_persons.Group activity by persons';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
@@ -71,6 +78,7 @@ final readonly class PersonsAggregator implements AggregatorInterface
|
|||||||
->addGroupBy("{$p}_pid");
|
->addGroupBy("{$p}_pid");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn()
|
public function applyOn()
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
|
@@ -21,32 +21,38 @@ class SentReceivedAggregator implements AggregatorInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly TranslatorInterface $translator) {}
|
public function __construct(private readonly TranslatorInterface $translator) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data): void
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
$qb->addSelect('activity.sentReceived AS activity_sentreceived_aggregator')
|
$qb->addSelect('activity.sentReceived AS activity_sentreceived_aggregator')
|
||||||
->addGroupBy('activity_sentreceived_aggregator');
|
->addGroupBy('activity_sentreceived_aggregator');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder): void
|
public function buildForm(FormBuilderInterface $builder): void
|
||||||
{
|
{
|
||||||
// No form needed
|
// No form needed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data): callable
|
public function getLabels($key, array $values, $data): callable
|
||||||
{
|
{
|
||||||
return function (?string $value): string {
|
return function (?string $value): string {
|
||||||
@@ -71,11 +77,13 @@ class SentReceivedAggregator implements AggregatorInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return ['activity_sentreceived_aggregator'];
|
return ['activity_sentreceived_aggregator'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'export.aggregator.activity.by_sent_received.Group activity by sentreceived';
|
return 'export.aggregator.activity.by_sent_received.Group activity by sentreceived';
|
||||||
|
@@ -36,28 +36,34 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder) {}
|
public function buildForm(FormBuilderInterface $builder) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getAllowedFormattersTypes(): array
|
public function getAllowedFormattersTypes(): array
|
||||||
{
|
{
|
||||||
return [FormatterInterface::TYPE_TABULAR];
|
return [FormatterInterface::TYPE_TABULAR];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getDescription(): string
|
public function getDescription(): string
|
||||||
{
|
{
|
||||||
return 'Average activities linked to an accompanying period duration by various parameters.';
|
return 'Average activities linked to an accompanying period duration by various parameters.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getGroup(): string
|
public function getGroup(): string
|
||||||
{
|
{
|
||||||
return 'Exports of activities linked to an accompanying period';
|
return 'Exports of activities linked to an accompanying period';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
if ('export_avg_activity_duration' !== $key) {
|
if ('export_avg_activity_duration' !== $key) {
|
||||||
@@ -67,26 +73,31 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
return static fn ($value) => '_header' === $value ? 'Average activities linked to an accompanying period duration' : $value;
|
return static fn ($value) => '_header' === $value ? 'Average activities linked to an accompanying period duration' : $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return ['export_avg_activity_duration'];
|
return ['export_avg_activity_duration'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getResult($query, $data)
|
public function getResult($query, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Average activity linked to an accompanying period duration';
|
return 'Average activity linked to an accompanying period duration';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getType(): string
|
public function getType(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
@@ -116,11 +127,13 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function requiredRole(): string
|
public function requiredRole(): string
|
||||||
{
|
{
|
||||||
return ActivityStatsVoter::STATS;
|
return ActivityStatsVoter::STATS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function supportsModifiers(): array
|
public function supportsModifiers(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@@ -41,31 +41,37 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
// TODO: Implement buildForm() method.
|
// TODO: Implement buildForm() method.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getAllowedFormattersTypes(): array
|
public function getAllowedFormattersTypes(): array
|
||||||
{
|
{
|
||||||
return [FormatterInterface::TYPE_TABULAR];
|
return [FormatterInterface::TYPE_TABULAR];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getDescription(): string
|
public function getDescription(): string
|
||||||
{
|
{
|
||||||
return 'Average activities linked to an accompanying period visit duration by various parameters.';
|
return 'Average activities linked to an accompanying period visit duration by various parameters.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getGroup(): string
|
public function getGroup(): string
|
||||||
{
|
{
|
||||||
return 'Exports of activities linked to an accompanying period';
|
return 'Exports of activities linked to an accompanying period';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
if ('export_avg_activity_visit_duration' !== $key) {
|
if ('export_avg_activity_visit_duration' !== $key) {
|
||||||
@@ -75,26 +81,31 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
return static fn ($value) => '_header' === $value ? 'Average activities linked to an accompanying period visit duration' : $value;
|
return static fn ($value) => '_header' === $value ? 'Average activities linked to an accompanying period visit duration' : $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return ['export_avg_activity_visit_duration'];
|
return ['export_avg_activity_visit_duration'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getResult($query, $data)
|
public function getResult($query, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Average activity linked to an accompanying period visit duration';
|
return 'Average activity linked to an accompanying period visit duration';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getType(): string
|
public function getType(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
@@ -124,11 +135,13 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function requiredRole(): string
|
public function requiredRole(): string
|
||||||
{
|
{
|
||||||
return ActivityStatsVoter::STATS;
|
return ActivityStatsVoter::STATS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function supportsModifiers(): array
|
public function supportsModifiers(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@@ -41,28 +41,34 @@ class CountActivity implements ExportInterface, GroupedExportInterface
|
|||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder) {}
|
public function buildForm(FormBuilderInterface $builder) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getAllowedFormattersTypes(): array
|
public function getAllowedFormattersTypes(): array
|
||||||
{
|
{
|
||||||
return [FormatterInterface::TYPE_TABULAR];
|
return [FormatterInterface::TYPE_TABULAR];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getDescription(): string
|
public function getDescription(): string
|
||||||
{
|
{
|
||||||
return 'Count activities linked to an accompanying period by various parameters.';
|
return 'Count activities linked to an accompanying period by various parameters.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getGroup(): string
|
public function getGroup(): string
|
||||||
{
|
{
|
||||||
return 'Exports of activities linked to an accompanying period';
|
return 'Exports of activities linked to an accompanying period';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
if ('export_count_activity' !== $key) {
|
if ('export_count_activity' !== $key) {
|
||||||
@@ -72,26 +78,31 @@ class CountActivity implements ExportInterface, GroupedExportInterface
|
|||||||
return static fn ($value) => '_header' === $value ? 'Number of activities linked to an accompanying period' : $value;
|
return static fn ($value) => '_header' === $value ? 'Number of activities linked to an accompanying period' : $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return ['export_count_activity'];
|
return ['export_count_activity'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getResult($query, $data)
|
public function getResult($query, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Count activities linked to an accompanying period';
|
return 'Count activities linked to an accompanying period';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getType(): string
|
public function getType(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
@@ -120,11 +131,13 @@ class CountActivity implements ExportInterface, GroupedExportInterface
|
|||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function requiredRole(): string
|
public function requiredRole(): string
|
||||||
{
|
{
|
||||||
return ActivityStatsVoter::STATS;
|
return ActivityStatsVoter::STATS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function supportsModifiers(): array
|
public function supportsModifiers(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@@ -42,28 +42,34 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
|
|||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder) {}
|
public function buildForm(FormBuilderInterface $builder) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getAllowedFormattersTypes(): array
|
public function getAllowedFormattersTypes(): array
|
||||||
{
|
{
|
||||||
return [FormatterInterface::TYPE_TABULAR];
|
return [FormatterInterface::TYPE_TABULAR];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getDescription(): string
|
public function getDescription(): string
|
||||||
{
|
{
|
||||||
return 'export.export.count_household_on_activity.description';
|
return 'export.export.count_household_on_activity.description';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getGroup(): string
|
public function getGroup(): string
|
||||||
{
|
{
|
||||||
return 'Exports of activities linked to an accompanying period';
|
return 'Exports of activities linked to an accompanying period';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
if ('export_count_activity' !== $key) {
|
if ('export_count_activity' !== $key) {
|
||||||
@@ -73,26 +79,31 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
|
|||||||
return static fn ($value) => '_header' === $value ? 'export.export.count_household_on_activity.header' : $value;
|
return static fn ($value) => '_header' === $value ? 'export.export.count_household_on_activity.header' : $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return ['export_count_activity'];
|
return ['export_count_activity'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getResult($query, $data)
|
public function getResult($query, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'export.export.count_household_on_activity.title';
|
return 'export.export.count_household_on_activity.title';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getType(): string
|
public function getType(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
@@ -129,11 +140,13 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
|
|||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function requiredRole(): string
|
public function requiredRole(): string
|
||||||
{
|
{
|
||||||
return ActivityStatsVoter::STATS;
|
return ActivityStatsVoter::STATS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function supportsModifiers(): array
|
public function supportsModifiers(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@@ -41,28 +41,34 @@ class CountPersonsOnActivity implements ExportInterface, GroupedExportInterface
|
|||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder) {}
|
public function buildForm(FormBuilderInterface $builder) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getAllowedFormattersTypes(): array
|
public function getAllowedFormattersTypes(): array
|
||||||
{
|
{
|
||||||
return [FormatterInterface::TYPE_TABULAR];
|
return [FormatterInterface::TYPE_TABULAR];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getDescription(): string
|
public function getDescription(): string
|
||||||
{
|
{
|
||||||
return 'export.export.count_person_on_activity.description';
|
return 'export.export.count_person_on_activity.description';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getGroup(): string
|
public function getGroup(): string
|
||||||
{
|
{
|
||||||
return 'Exports of activities linked to an accompanying period';
|
return 'Exports of activities linked to an accompanying period';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
if ('export_count_activity' !== $key) {
|
if ('export_count_activity' !== $key) {
|
||||||
@@ -72,26 +78,31 @@ class CountPersonsOnActivity implements ExportInterface, GroupedExportInterface
|
|||||||
return static fn ($value) => '_header' === $value ? 'export.export.count_person_on_activity.header' : $value;
|
return static fn ($value) => '_header' === $value ? 'export.export.count_person_on_activity.header' : $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return ['export_count_activity'];
|
return ['export_count_activity'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getResult($query, $data)
|
public function getResult($query, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'export.export.count_person_on_activity.title';
|
return 'export.export.count_person_on_activity.title';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getType(): string
|
public function getType(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
@@ -121,11 +132,13 @@ class CountPersonsOnActivity implements ExportInterface, GroupedExportInterface
|
|||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function requiredRole(): string
|
public function requiredRole(): string
|
||||||
{
|
{
|
||||||
return ActivityStatsVoter::STATS;
|
return ActivityStatsVoter::STATS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function supportsModifiers(): array
|
public function supportsModifiers(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@@ -33,31 +33,37 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa
|
|||||||
private FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper,
|
private FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$this->helper->buildForm($builder);
|
$this->helper->buildForm($builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getAllowedFormattersTypes()
|
public function getAllowedFormattersTypes()
|
||||||
{
|
{
|
||||||
return $this->helper->getAllowedFormattersTypes();
|
return $this->helper->getAllowedFormattersTypes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getDescription()
|
public function getDescription()
|
||||||
{
|
{
|
||||||
return ListActivityHelper::MSG_KEY.'List activities linked to an accompanying course';
|
return ListActivityHelper::MSG_KEY.'List activities linked to an accompanying course';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getGroup(): string
|
public function getGroup(): string
|
||||||
{
|
{
|
||||||
return 'Exports of activities linked to an accompanying period';
|
return 'Exports of activities linked to an accompanying period';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
return match ($key) {
|
return match ($key) {
|
||||||
@@ -73,6 +79,7 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
@@ -85,21 +92,25 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getResult($query, $data)
|
public function getResult($query, $data)
|
||||||
{
|
{
|
||||||
return $this->helper->getResult($query, $data);
|
return $this->helper->getResult($query, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return ListActivityHelper::MSG_KEY.'List activity linked to a course';
|
return ListActivityHelper::MSG_KEY.'List activity linked to a course';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getType()
|
public function getType()
|
||||||
{
|
{
|
||||||
return $this->helper->getType();
|
return $this->helper->getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
@@ -135,11 +146,13 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa
|
|||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function requiredRole(): string
|
public function requiredRole(): string
|
||||||
{
|
{
|
||||||
return ActivityStatsVoter::LISTS;
|
return ActivityStatsVoter::LISTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function supportsModifiers()
|
public function supportsModifiers()
|
||||||
{
|
{
|
||||||
return array_merge(
|
return array_merge(
|
||||||
|
@@ -40,31 +40,37 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
// TODO: Implement buildForm() method.
|
// TODO: Implement buildForm() method.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getAllowedFormattersTypes(): array
|
public function getAllowedFormattersTypes(): array
|
||||||
{
|
{
|
||||||
return [FormatterInterface::TYPE_TABULAR];
|
return [FormatterInterface::TYPE_TABULAR];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getDescription(): string
|
public function getDescription(): string
|
||||||
{
|
{
|
||||||
return 'Sum activities linked to an accompanying period duration by various parameters.';
|
return 'Sum activities linked to an accompanying period duration by various parameters.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getGroup(): string
|
public function getGroup(): string
|
||||||
{
|
{
|
||||||
return 'Exports of activities linked to an accompanying period';
|
return 'Exports of activities linked to an accompanying period';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
if ('export_sum_activity_duration' !== $key) {
|
if ('export_sum_activity_duration' !== $key) {
|
||||||
@@ -74,26 +80,31 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period duration' : $value;
|
return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period duration' : $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return ['export_sum_activity_duration'];
|
return ['export_sum_activity_duration'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getResult($query, $data)
|
public function getResult($query, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Sum activity linked to an accompanying period duration';
|
return 'Sum activity linked to an accompanying period duration';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getType(): string
|
public function getType(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
@@ -123,11 +134,13 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function requiredRole(): string
|
public function requiredRole(): string
|
||||||
{
|
{
|
||||||
return ActivityStatsVoter::STATS;
|
return ActivityStatsVoter::STATS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function supportsModifiers(): array
|
public function supportsModifiers(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@@ -40,31 +40,37 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
// TODO: Implement buildForm() method.
|
// TODO: Implement buildForm() method.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getAllowedFormattersTypes(): array
|
public function getAllowedFormattersTypes(): array
|
||||||
{
|
{
|
||||||
return [FormatterInterface::TYPE_TABULAR];
|
return [FormatterInterface::TYPE_TABULAR];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getDescription(): string
|
public function getDescription(): string
|
||||||
{
|
{
|
||||||
return 'Sum activities linked to an accompanying period visit duration by various parameters.';
|
return 'Sum activities linked to an accompanying period visit duration by various parameters.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getGroup(): string
|
public function getGroup(): string
|
||||||
{
|
{
|
||||||
return 'Exports of activities linked to an accompanying period';
|
return 'Exports of activities linked to an accompanying period';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
if ('export_sum_activity_visit_duration' !== $key) {
|
if ('export_sum_activity_visit_duration' !== $key) {
|
||||||
@@ -74,26 +80,31 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period visit duration' : $value;
|
return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period visit duration' : $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return ['export_sum_activity_visit_duration'];
|
return ['export_sum_activity_visit_duration'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getResult($query, $data)
|
public function getResult($query, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Sum activity linked to an accompanying period visit duration';
|
return 'Sum activity linked to an accompanying period visit duration';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getType(): string
|
public function getType(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
@@ -123,11 +134,13 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function requiredRole(): string
|
public function requiredRole(): string
|
||||||
{
|
{
|
||||||
return ActivityStatsVoter::STATS;
|
return ActivityStatsVoter::STATS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function supportsModifiers(): array
|
public function supportsModifiers(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@@ -33,28 +33,34 @@ class CountActivity implements ExportInterface, GroupedExportInterface
|
|||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder) {}
|
public function buildForm(FormBuilderInterface $builder) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getAllowedFormattersTypes()
|
public function getAllowedFormattersTypes()
|
||||||
{
|
{
|
||||||
return [FormatterInterface::TYPE_TABULAR];
|
return [FormatterInterface::TYPE_TABULAR];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getDescription()
|
public function getDescription()
|
||||||
{
|
{
|
||||||
return 'Count activities linked to a person by various parameters.';
|
return 'Count activities linked to a person by various parameters.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getGroup(): string
|
public function getGroup(): string
|
||||||
{
|
{
|
||||||
return 'Exports of activities linked to a person';
|
return 'Exports of activities linked to a person';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
if ('export_count_activity' !== $key) {
|
if ('export_count_activity' !== $key) {
|
||||||
@@ -64,26 +70,31 @@ class CountActivity implements ExportInterface, GroupedExportInterface
|
|||||||
return static fn ($value) => '_header' === $value ? 'Number of activities linked to a person' : $value;
|
return static fn ($value) => '_header' === $value ? 'Number of activities linked to a person' : $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data)
|
||||||
{
|
{
|
||||||
return ['export_count_activity'];
|
return ['export_count_activity'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getResult($query, $data)
|
public function getResult($query, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'Count activities linked to a person';
|
return 'Count activities linked to a person';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getType(): string
|
public function getType(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
@@ -113,11 +124,13 @@ class CountActivity implements ExportInterface, GroupedExportInterface
|
|||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function requiredRole(): string
|
public function requiredRole(): string
|
||||||
{
|
{
|
||||||
return ActivityStatsVoter::STATS;
|
return ActivityStatsVoter::STATS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function supportsModifiers()
|
public function supportsModifiers()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@@ -34,28 +34,34 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
|
|||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder) {}
|
public function buildForm(FormBuilderInterface $builder) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getAllowedFormattersTypes()
|
public function getAllowedFormattersTypes()
|
||||||
{
|
{
|
||||||
return [FormatterInterface::TYPE_TABULAR];
|
return [FormatterInterface::TYPE_TABULAR];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getDescription()
|
public function getDescription()
|
||||||
{
|
{
|
||||||
return 'export.export.count_household_on_activity_person.description';
|
return 'export.export.count_household_on_activity_person.description';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getGroup(): string
|
public function getGroup(): string
|
||||||
{
|
{
|
||||||
return 'Exports of activities linked to a person';
|
return 'Exports of activities linked to a person';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
if ('export_count_activity' !== $key) {
|
if ('export_count_activity' !== $key) {
|
||||||
@@ -65,26 +71,31 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
|
|||||||
return static fn ($value) => '_header' === $value ? 'export.export.count_household_on_activity_person.header' : $value;
|
return static fn ($value) => '_header' === $value ? 'export.export.count_household_on_activity_person.header' : $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data)
|
||||||
{
|
{
|
||||||
return ['export_count_activity'];
|
return ['export_count_activity'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getResult($query, $data)
|
public function getResult($query, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'export.export.count_household_on_activity_person.title';
|
return 'export.export.count_household_on_activity_person.title';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getType(): string
|
public function getType(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
@@ -121,11 +132,13 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe
|
|||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function requiredRole(): string
|
public function requiredRole(): string
|
||||||
{
|
{
|
||||||
return ActivityStatsVoter::STATS;
|
return ActivityStatsVoter::STATS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function supportsModifiers()
|
public function supportsModifiers()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@@ -57,6 +57,7 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
|||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('fields', ChoiceType::class, [
|
$builder->add('fields', ChoiceType::class, [
|
||||||
@@ -76,26 +77,31 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getAllowedFormattersTypes()
|
public function getAllowedFormattersTypes()
|
||||||
{
|
{
|
||||||
return [FormatterInterface::TYPE_LIST];
|
return [FormatterInterface::TYPE_LIST];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getDescription()
|
public function getDescription()
|
||||||
{
|
{
|
||||||
return 'List activities linked to a person description';
|
return 'List activities linked to a person description';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getGroup(): string
|
public function getGroup(): string
|
||||||
{
|
{
|
||||||
return 'Exports of activities linked to a person';
|
return 'Exports of activities linked to a person';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
switch ($key) {
|
switch ($key) {
|
||||||
@@ -165,26 +171,31 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data)
|
||||||
{
|
{
|
||||||
return $data['fields'];
|
return $data['fields'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getResult($query, $data)
|
public function getResult($query, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'List activity linked to a person';
|
return 'List activity linked to a person';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getType(): string
|
public function getType(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
@@ -279,11 +290,13 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
|||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function requiredRole(): string
|
public function requiredRole(): string
|
||||||
{
|
{
|
||||||
return ActivityStatsVoter::LISTS;
|
return ActivityStatsVoter::LISTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function supportsModifiers()
|
public function supportsModifiers()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@@ -30,7 +30,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
*/
|
*/
|
||||||
class StatActivityDuration implements ExportInterface, GroupedExportInterface
|
class StatActivityDuration implements ExportInterface, GroupedExportInterface
|
||||||
{
|
{
|
||||||
final public const SUM = 'sum';
|
final public const string SUM = 'sum';
|
||||||
private readonly bool $filterStatsByCenters;
|
private readonly bool $filterStatsByCenters;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,18 +47,22 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder) {}
|
public function buildForm(FormBuilderInterface $builder) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getAllowedFormattersTypes()
|
public function getAllowedFormattersTypes()
|
||||||
{
|
{
|
||||||
return [FormatterInterface::TYPE_TABULAR];
|
return [FormatterInterface::TYPE_TABULAR];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getDescription()
|
public function getDescription()
|
||||||
{
|
{
|
||||||
if (self::SUM === $this->action) {
|
if (self::SUM === $this->action) {
|
||||||
@@ -68,11 +72,13 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
throw new \LogicException('this action is not supported: '.$this->action);
|
throw new \LogicException('this action is not supported: '.$this->action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getGroup(): string
|
public function getGroup(): string
|
||||||
{
|
{
|
||||||
return 'Exports of activities linked to a person';
|
return 'Exports of activities linked to a person';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
if ('export_stat_activity' !== $key) {
|
if ('export_stat_activity' !== $key) {
|
||||||
@@ -84,16 +90,19 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
return static fn (string $value) => '_header' === $value ? $header : $value;
|
return static fn (string $value) => '_header' === $value ? $header : $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data)
|
||||||
{
|
{
|
||||||
return ['export_stat_activity'];
|
return ['export_stat_activity'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getResult($query, $data)
|
public function getResult($query, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
if (self::SUM === $this->action) {
|
if (self::SUM === $this->action) {
|
||||||
@@ -103,11 +112,13 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
throw new \LogicException('This action is not supported: '.$this->action);
|
throw new \LogicException('This action is not supported: '.$this->action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getType(): string
|
public function getType(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(
|
$centers = array_map(
|
||||||
@@ -145,11 +156,13 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function requiredRole(): string
|
public function requiredRole(): string
|
||||||
{
|
{
|
||||||
return ActivityStatsVoter::STATS;
|
return ActivityStatsVoter::STATS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function supportsModifiers()
|
public function supportsModifiers()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@@ -28,7 +28,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
|
|
||||||
class ListActivityHelper
|
class ListActivityHelper
|
||||||
{
|
{
|
||||||
final public const MSG_KEY = 'export.list.activity.';
|
final public const string MSG_KEY = 'export.list.activity.';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly ActivityPresenceRepositoryInterface $activityPresenceRepository,
|
private readonly ActivityPresenceRepositoryInterface $activityPresenceRepository,
|
||||||
|
@@ -25,7 +25,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
final readonly class ActivityTypeFilter implements FilterInterface
|
final readonly class ActivityTypeFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private const BASE_EXISTS = 'SELECT 1 FROM '.Activity::class.' act_type_filter_activity WHERE act_type_filter_activity.accompanyingPeriod = acp';
|
private const string BASE_EXISTS = 'SELECT 1 FROM '.Activity::class.' act_type_filter_activity WHERE act_type_filter_activity.accompanyingPeriod = acp';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ActivityTypeRepositoryInterface $activityTypeRepository,
|
private ActivityTypeRepositoryInterface $activityTypeRepository,
|
||||||
@@ -33,11 +33,13 @@ final readonly class ActivityTypeFilter implements FilterInterface
|
|||||||
private RollingDateConverterInterface $rollingDateConverter,
|
private RollingDateConverterInterface $rollingDateConverter,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$exists = self::BASE_EXISTS;
|
$exists = self::BASE_EXISTS;
|
||||||
@@ -62,11 +64,13 @@ final readonly class ActivityTypeFilter implements FilterInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn()
|
public function applyOn()
|
||||||
{
|
{
|
||||||
return Declarations::ACP_TYPE;
|
return Declarations::ACP_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('accepted_activitytypes', EntityType::class, [
|
$builder->add('accepted_activitytypes', EntityType::class, [
|
||||||
@@ -92,6 +96,7 @@ final readonly class ActivityTypeFilter implements FilterInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -101,6 +106,7 @@ final readonly class ActivityTypeFilter implements FilterInterface
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
$types = [];
|
$types = [];
|
||||||
@@ -118,6 +124,7 @@ final readonly class ActivityTypeFilter implements FilterInterface
|
|||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Filter accompanying course by activity type';
|
return 'Filter accompanying course by activity type';
|
||||||
|
@@ -23,11 +23,13 @@ class BySocialActionFilter implements FilterInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly SocialActionRender $actionRender) {}
|
public function __construct(private readonly SocialActionRender $actionRender) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
if (!\in_array('actsocialaction', $qb->getAllAliases(), true)) {
|
if (!\in_array('actsocialaction', $qb->getAllAliases(), true)) {
|
||||||
@@ -43,11 +45,13 @@ class BySocialActionFilter implements FilterInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY_ACP;
|
return Declarations::ACTIVITY_ACP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('accepted_socialactions', PickSocialActionType::class, [
|
$builder->add('accepted_socialactions', PickSocialActionType::class, [
|
||||||
@@ -55,11 +59,13 @@ class BySocialActionFilter implements FilterInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
$actions = [];
|
$actions = [];
|
||||||
@@ -75,6 +81,7 @@ class BySocialActionFilter implements FilterInterface
|
|||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Filter activity by linked socialaction';
|
return 'Filter activity by linked socialaction';
|
||||||
|
@@ -23,11 +23,13 @@ class BySocialIssueFilter implements FilterInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly SocialIssueRender $issueRender) {}
|
public function __construct(private readonly SocialIssueRender $issueRender) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
if (!\in_array('actsocialissue', $qb->getAllAliases(), true)) {
|
if (!\in_array('actsocialissue', $qb->getAllAliases(), true)) {
|
||||||
@@ -43,11 +45,13 @@ class BySocialIssueFilter implements FilterInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY_ACP;
|
return Declarations::ACTIVITY_ACP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('accepted_socialissues', PickSocialIssueType::class, [
|
$builder->add('accepted_socialissues', PickSocialIssueType::class, [
|
||||||
@@ -55,11 +59,13 @@ class BySocialIssueFilter implements FilterInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
$issues = [];
|
$issues = [];
|
||||||
@@ -75,6 +81,7 @@ class BySocialIssueFilter implements FilterInterface
|
|||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Filter activity by linked socialissue';
|
return 'Filter activity by linked socialissue';
|
||||||
|
@@ -22,11 +22,13 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
*/
|
*/
|
||||||
class HasNoActivityFilter implements FilterInterface
|
class HasNoActivityFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$qb
|
$qb
|
||||||
@@ -38,26 +40,31 @@ class HasNoActivityFilter implements FilterInterface
|
|||||||
');
|
');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACP_TYPE;
|
return Declarations::ACP_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
// no form needed
|
// no form needed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
return ['Filtered acp which has no activities', []];
|
return ['Filtered acp which has no activities', []];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Filter acp which has no activity';
|
return 'Filter acp which has no activity';
|
||||||
|
@@ -25,11 +25,13 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
|
|||||||
private RollingDateConverterInterface $rollingDateConverter,
|
private RollingDateConverterInterface $rollingDateConverter,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'export.filter.activity.course_having_activity_between_date.Title';
|
return 'export.filter.activity.course_having_activity_between_date.Title';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
@@ -41,6 +43,7 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -49,6 +52,7 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string')
|
public function describeAction($data, $format = 'string')
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -60,11 +64,13 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$alias = 'act_period_having_act_betw_date_alias';
|
$alias = 'act_period_having_act_betw_date_alias';
|
||||||
@@ -82,6 +88,7 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
|
|||||||
->setParameter($to, $this->rollingDateConverter->convert($data['end_date']));
|
->setParameter($to, $this->rollingDateConverter->convert($data['end_date']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn()
|
public function applyOn()
|
||||||
{
|
{
|
||||||
return \Chill\PersonBundle\Export\Declarations::ACP_TYPE;
|
return \Chill\PersonBundle\Export\Declarations::ACP_TYPE;
|
||||||
|
@@ -25,11 +25,13 @@ class ActivityDateFilter implements FilterInterface
|
|||||||
{
|
{
|
||||||
public function __construct(protected TranslatorInterface $translator, private readonly RollingDateConverterInterface $rollingDateConverter) {}
|
public function __construct(protected TranslatorInterface $translator, private readonly RollingDateConverterInterface $rollingDateConverter) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$where = $qb->getDQLPart('where');
|
$where = $qb->getDQLPart('where');
|
||||||
@@ -56,11 +58,13 @@ class ActivityDateFilter implements FilterInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
@@ -72,11 +76,13 @@ class ActivityDateFilter implements FilterInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)];
|
return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string')
|
public function describeAction($data, $format = 'string')
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -88,6 +94,7 @@ class ActivityDateFilter implements FilterInterface
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'Filtered by date activity';
|
return 'Filtered by date activity';
|
||||||
|
@@ -28,11 +28,13 @@ final readonly class ActivityPresenceFilter implements FilterInterface
|
|||||||
private TranslatorInterface $translator
|
private TranslatorInterface $translator
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'export.filter.activity.by_presence.Filter activity by activity presence';
|
return 'export.filter.activity.by_presence.Filter activity by activity presence';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('presences', EntityType::class, [
|
$builder->add('presences', EntityType::class, [
|
||||||
@@ -45,11 +47,13 @@ final readonly class ActivityPresenceFilter implements FilterInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string')
|
public function describeAction($data, $format = 'string')
|
||||||
{
|
{
|
||||||
$presences = array_map(
|
$presences = array_map(
|
||||||
@@ -63,11 +67,13 @@ final readonly class ActivityPresenceFilter implements FilterInterface
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$qb
|
$qb
|
||||||
@@ -75,6 +81,7 @@ final readonly class ActivityPresenceFilter implements FilterInterface
|
|||||||
->setParameter('activity_presence_filter_presences', $data['presences']);
|
->setParameter('activity_presence_filter_presences', $data['presences']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn()
|
public function applyOn()
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
|
@@ -29,11 +29,13 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
|
|||||||
protected ActivityTypeRepositoryInterface $activityTypeRepository
|
protected ActivityTypeRepositoryInterface $activityTypeRepository
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$clause = $qb->expr()->in('activity.activityType', ':selected_activity_types');
|
$clause = $qb->expr()->in('activity.activityType', ':selected_activity_types');
|
||||||
@@ -42,11 +44,13 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
|
|||||||
$qb->setParameter('selected_activity_types', $data['types']);
|
$qb->setParameter('selected_activity_types', $data['types']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('types', EntityType::class, [
|
$builder->add('types', EntityType::class, [
|
||||||
@@ -70,11 +74,13 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string')
|
public function describeAction($data, $format = 'string')
|
||||||
{
|
{
|
||||||
// collect all the reasons'name used in this filter in one array
|
// collect all the reasons'name used in this filter in one array
|
||||||
@@ -88,11 +94,13 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
|
|||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'Filter by activity type';
|
return 'Filter by activity type';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function validateForm($data, ExecutionContextInterface $context)
|
public function validateForm($data, ExecutionContextInterface $context)
|
||||||
{
|
{
|
||||||
if (null === $data['types'] || 0 === \count($data['types'])) {
|
if (null === $data['types'] || 0 === \count($data['types'])) {
|
||||||
|
@@ -22,11 +22,13 @@ class ActivityUsersFilter implements FilterInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly UserRender $userRender) {}
|
public function __construct(private readonly UserRender $userRender) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$orX = $qb->expr()->orX();
|
$orX = $qb->expr()->orX();
|
||||||
@@ -39,11 +41,13 @@ class ActivityUsersFilter implements FilterInterface
|
|||||||
$qb->andWhere($orX);
|
$qb->andWhere($orX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn()
|
public function applyOn()
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('accepted_users', PickUserDynamicType::class, [
|
$builder->add('accepted_users', PickUserDynamicType::class, [
|
||||||
@@ -52,11 +56,13 @@ class ActivityUsersFilter implements FilterInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string')
|
public function describeAction($data, $format = 'string')
|
||||||
{
|
{
|
||||||
$users = [];
|
$users = [];
|
||||||
@@ -70,6 +76,7 @@ class ActivityUsersFilter implements FilterInterface
|
|||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Filter activity by users';
|
return 'Filter activity by users';
|
||||||
|
@@ -22,11 +22,13 @@ class ByCreatorFilter implements FilterInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly UserRender $userRender) {}
|
public function __construct(private readonly UserRender $userRender) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$qb
|
$qb
|
||||||
@@ -36,11 +38,13 @@ class ByCreatorFilter implements FilterInterface
|
|||||||
->setParameter('users', $data['accepted_users']);
|
->setParameter('users', $data['accepted_users']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('accepted_users', PickUserDynamicType::class, [
|
$builder->add('accepted_users', PickUserDynamicType::class, [
|
||||||
@@ -48,11 +52,13 @@ class ByCreatorFilter implements FilterInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
$users = [];
|
$users = [];
|
||||||
@@ -66,6 +72,7 @@ class ByCreatorFilter implements FilterInterface
|
|||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Filter activity by creator';
|
return 'Filter activity by creator';
|
||||||
|
@@ -26,7 +26,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
|
|
||||||
final readonly class CreatorJobFilter implements FilterInterface
|
final readonly class CreatorJobFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private const PREFIX = 'acp_act_filter_creator_job';
|
private const string PREFIX = 'acp_act_filter_creator_job';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private TranslatableStringHelper $translatableStringHelper,
|
private TranslatableStringHelper $translatableStringHelper,
|
||||||
@@ -34,11 +34,13 @@ final readonly class CreatorJobFilter implements FilterInterface
|
|||||||
private UserJobRepositoryInterface $userJobRepository,
|
private UserJobRepositoryInterface $userJobRepository,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
@@ -70,11 +72,13 @@ final readonly class CreatorJobFilter implements FilterInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
@@ -90,6 +94,7 @@ final readonly class CreatorJobFilter implements FilterInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
$jobs = array_map(
|
$jobs = array_map(
|
||||||
@@ -102,6 +107,7 @@ final readonly class CreatorJobFilter implements FilterInterface
|
|||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -109,6 +115,7 @@ final readonly class CreatorJobFilter implements FilterInterface
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'export.filter.activity.by_creator_job.Filter activity by user job';
|
return 'export.filter.activity.by_creator_job.Filter activity by user job';
|
||||||
|
@@ -24,18 +24,20 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class CreatorScopeFilter implements FilterInterface
|
class CreatorScopeFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private const PREFIX = 'acp_act_filter_creator_scope';
|
private const string PREFIX = 'acp_act_filter_creator_scope';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly TranslatableStringHelper $translatableStringHelper,
|
private readonly TranslatableStringHelper $translatableStringHelper,
|
||||||
private readonly ScopeRepositoryInterface $scopeRepository,
|
private readonly ScopeRepositoryInterface $scopeRepository,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
@@ -67,11 +69,13 @@ class CreatorScopeFilter implements FilterInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
@@ -86,6 +90,7 @@ class CreatorScopeFilter implements FilterInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
$scopes = [];
|
$scopes = [];
|
||||||
@@ -101,6 +106,7 @@ class CreatorScopeFilter implements FilterInterface
|
|||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -108,6 +114,7 @@ class CreatorScopeFilter implements FilterInterface
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'export.filter.activity.by_creator_scope.Filter activity by user scope';
|
return 'export.filter.activity.by_creator_scope.Filter activity by user scope';
|
||||||
|
@@ -21,20 +21,22 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
|
|
||||||
class EmergencyFilter implements FilterInterface
|
class EmergencyFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private const CHOICES = [
|
private const array CHOICES = [
|
||||||
'activity is emergency' => 'true',
|
'activity is emergency' => 'true',
|
||||||
'activity is not emergency' => 'false',
|
'activity is not emergency' => 'false',
|
||||||
];
|
];
|
||||||
|
|
||||||
private const DEFAULT_CHOICE = 'false';
|
private const string DEFAULT_CHOICE = 'false';
|
||||||
|
|
||||||
public function __construct(private readonly TranslatorInterface $translator) {}
|
public function __construct(private readonly TranslatorInterface $translator) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$where = $qb->getDQLPart('where');
|
$where = $qb->getDQLPart('where');
|
||||||
@@ -51,11 +53,13 @@ class EmergencyFilter implements FilterInterface
|
|||||||
$qb->setParameter('emergency', $data['accepted_emergency']);
|
$qb->setParameter('emergency', $data['accepted_emergency']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('accepted_emergency', ChoiceType::class, [
|
$builder->add('accepted_emergency', ChoiceType::class, [
|
||||||
@@ -66,11 +70,13 @@ class EmergencyFilter implements FilterInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return ['accepted_emergency' => self::DEFAULT_CHOICE];
|
return ['accepted_emergency' => self::DEFAULT_CHOICE];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -82,6 +88,7 @@ class EmergencyFilter implements FilterInterface
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Filter activity by emergency';
|
return 'Filter activity by emergency';
|
||||||
|
@@ -19,11 +19,13 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class LocationFilter implements FilterInterface
|
class LocationFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$qb->andWhere(
|
$qb->andWhere(
|
||||||
@@ -33,11 +35,13 @@ class LocationFilter implements FilterInterface
|
|||||||
$qb->setParameter('location', $data['accepted_location']);
|
$qb->setParameter('location', $data['accepted_location']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('accepted_location', PickUserLocationType::class, [
|
$builder->add('accepted_location', PickUserLocationType::class, [
|
||||||
@@ -46,11 +50,13 @@ class LocationFilter implements FilterInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
$locations = [];
|
$locations = [];
|
||||||
@@ -64,6 +70,7 @@ class LocationFilter implements FilterInterface
|
|||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Filter activity by location';
|
return 'Filter activity by location';
|
||||||
|
@@ -23,11 +23,13 @@ class LocationTypeFilter implements FilterInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
|
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
if (!\in_array('actloc', $qb->getAllAliases(), true)) {
|
if (!\in_array('actloc', $qb->getAllAliases(), true)) {
|
||||||
@@ -47,11 +49,13 @@ class LocationTypeFilter implements FilterInterface
|
|||||||
$qb->setParameter('locationtype', $data['accepted_locationtype']);
|
$qb->setParameter('locationtype', $data['accepted_locationtype']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('accepted_locationtype', PickLocationTypeType::class, [
|
$builder->add('accepted_locationtype', PickLocationTypeType::class, [
|
||||||
@@ -60,11 +64,13 @@ class LocationTypeFilter implements FilterInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
$types = [];
|
$types = [];
|
||||||
@@ -80,6 +86,7 @@ class LocationTypeFilter implements FilterInterface
|
|||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Filter activity by locationtype';
|
return 'Filter activity by locationtype';
|
||||||
|
@@ -28,11 +28,13 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt
|
|||||||
{
|
{
|
||||||
public function __construct(protected TranslatableStringHelper $translatableStringHelper, protected ActivityReasonRepository $activityReasonRepository) {}
|
public function __construct(protected TranslatableStringHelper $translatableStringHelper, protected ActivityReasonRepository $activityReasonRepository) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$where = $qb->getDQLPart('where');
|
$where = $qb->getDQLPart('where');
|
||||||
@@ -53,11 +55,13 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt
|
|||||||
$qb->setParameter('selected_activity_reasons', $data['reasons']);
|
$qb->setParameter('selected_activity_reasons', $data['reasons']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY_PERSON;
|
return Declarations::ACTIVITY_PERSON;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('reasons', EntityType::class, [
|
$builder->add('reasons', EntityType::class, [
|
||||||
@@ -70,11 +74,13 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string')
|
public function describeAction($data, $format = 'string')
|
||||||
{
|
{
|
||||||
// collect all the reasons'name used in this filter in one array
|
// collect all the reasons'name used in this filter in one array
|
||||||
@@ -91,11 +97,13 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'Filter by reason';
|
return 'Filter by reason';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function validateForm($data, ExecutionContextInterface $context)
|
public function validateForm($data, ExecutionContextInterface $context)
|
||||||
{
|
{
|
||||||
if (null === $data['reasons'] || 0 === \count($data['reasons'])) {
|
if (null === $data['reasons'] || 0 === \count($data['reasons'])) {
|
||||||
|
@@ -34,11 +34,13 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem
|
|||||||
private RollingDateConverterInterface $rollingDateConverter,
|
private RollingDateConverterInterface $rollingDateConverter,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
// create a subquery for activity
|
// create a subquery for activity
|
||||||
@@ -83,11 +85,13 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::PERSON_TYPE;
|
return Declarations::PERSON_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('date_from_rolling', PickRollingDateType::class, [
|
$builder->add('date_from_rolling', PickRollingDateType::class, [
|
||||||
@@ -112,6 +116,7 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -121,6 +126,7 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string')
|
public function describeAction($data, $format = 'string')
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -141,11 +147,13 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'export.filter.activity.person_between_dates.title';
|
return 'export.filter.activity.person_between_dates.title';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function validateForm($data, ExecutionContextInterface $context)
|
public function validateForm($data, ExecutionContextInterface $context)
|
||||||
{
|
{
|
||||||
if ($this->rollingDateConverter->convert($data['date_from_rolling'])
|
if ($this->rollingDateConverter->convert($data['date_from_rolling'])
|
||||||
|
@@ -24,15 +24,17 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
*/
|
*/
|
||||||
final readonly class PersonsFilter implements FilterInterface
|
final readonly class PersonsFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private const PREFIX = 'act_persons_filter';
|
private const string PREFIX = 'act_persons_filter';
|
||||||
|
|
||||||
public function __construct(private PersonRenderInterface $personRender) {}
|
public function __construct(private PersonRenderInterface $personRender) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
@@ -47,11 +49,13 @@ final readonly class PersonsFilter implements FilterInterface
|
|||||||
$qb->andWhere($orX);
|
$qb->andWhere($orX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn()
|
public function applyOn()
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('accepted_persons', PickPersonDynamicType::class, [
|
$builder->add('accepted_persons', PickPersonDynamicType::class, [
|
||||||
@@ -60,6 +64,7 @@ final readonly class PersonsFilter implements FilterInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -67,6 +72,7 @@ final readonly class PersonsFilter implements FilterInterface
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string')
|
public function describeAction($data, $format = 'string')
|
||||||
{
|
{
|
||||||
$users = [];
|
$users = [];
|
||||||
@@ -80,6 +86,7 @@ final readonly class PersonsFilter implements FilterInterface
|
|||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'export.filter.activity.by_persons.Filter activity by persons';
|
return 'export.filter.activity.by_persons.Filter activity by persons';
|
||||||
|
@@ -22,20 +22,22 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
|
|
||||||
class SentReceivedFilter implements FilterInterface
|
class SentReceivedFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private const CHOICES = [
|
private const array CHOICES = [
|
||||||
'export.filter.activity.by_sent_received.is sent' => Activity::SENTRECEIVED_SENT,
|
'export.filter.activity.by_sent_received.is sent' => Activity::SENTRECEIVED_SENT,
|
||||||
'export.filter.activity.by_sent_received.is received' => Activity::SENTRECEIVED_RECEIVED,
|
'export.filter.activity.by_sent_received.is received' => Activity::SENTRECEIVED_RECEIVED,
|
||||||
];
|
];
|
||||||
|
|
||||||
private const DEFAULT_CHOICE = Activity::SENTRECEIVED_SENT;
|
private const string DEFAULT_CHOICE = Activity::SENTRECEIVED_SENT;
|
||||||
|
|
||||||
public function __construct(private readonly TranslatorInterface $translator) {}
|
public function __construct(private readonly TranslatorInterface $translator) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$where = $qb->getDQLPart('where');
|
$where = $qb->getDQLPart('where');
|
||||||
@@ -52,11 +54,13 @@ class SentReceivedFilter implements FilterInterface
|
|||||||
$qb->setParameter('sentreceived', $data['accepted_sentreceived']);
|
$qb->setParameter('sentreceived', $data['accepted_sentreceived']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('accepted_sentreceived', ChoiceType::class, [
|
$builder->add('accepted_sentreceived', ChoiceType::class, [
|
||||||
@@ -68,11 +72,13 @@ class SentReceivedFilter implements FilterInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return ['accepted_sentreceived' => self::DEFAULT_CHOICE];
|
return ['accepted_sentreceived' => self::DEFAULT_CHOICE];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
$sentreceived = array_flip(self::CHOICES)[$data['accepted_sentreceived']];
|
$sentreceived = array_flip(self::CHOICES)[$data['accepted_sentreceived']];
|
||||||
@@ -82,6 +88,7 @@ class SentReceivedFilter implements FilterInterface
|
|||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Filter activity by sentreceived';
|
return 'Filter activity by sentreceived';
|
||||||
|
@@ -23,11 +23,13 @@ class UserFilter implements FilterInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly UserRender $userRender) {}
|
public function __construct(private readonly UserRender $userRender) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$where = $qb->getDQLPart('where');
|
$where = $qb->getDQLPart('where');
|
||||||
@@ -44,11 +46,13 @@ class UserFilter implements FilterInterface
|
|||||||
$qb->setParameter('users', $data['accepted_users']);
|
$qb->setParameter('users', $data['accepted_users']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('accepted_users', PickUserDynamicType::class, [
|
$builder->add('accepted_users', PickUserDynamicType::class, [
|
||||||
@@ -57,11 +61,13 @@ class UserFilter implements FilterInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
$users = [];
|
$users = [];
|
||||||
@@ -75,6 +81,7 @@ class UserFilter implements FilterInterface
|
|||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Filter activity by user';
|
return 'Filter activity by user';
|
||||||
|
@@ -25,18 +25,20 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class UsersJobFilter implements FilterInterface
|
class UsersJobFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private const PREFIX = 'act_filter_user_job';
|
private const string PREFIX = 'act_filter_user_job';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
private readonly UserJobRepositoryInterface $userJobRepository
|
private readonly UserJobRepositoryInterface $userJobRepository
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
@@ -60,11 +62,13 @@ class UsersJobFilter implements FilterInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn()
|
public function applyOn()
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
@@ -77,6 +81,7 @@ class UsersJobFilter implements FilterInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string')
|
public function describeAction($data, $format = 'string')
|
||||||
{
|
{
|
||||||
return ['export.filter.activity.by_users_job.Filtered activity by users job: only %jobs%', [
|
return ['export.filter.activity.by_users_job.Filtered activity by users job: only %jobs%', [
|
||||||
@@ -90,6 +95,7 @@ class UsersJobFilter implements FilterInterface
|
|||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -97,6 +103,7 @@ class UsersJobFilter implements FilterInterface
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'export.filter.activity.by_users_job.Filter by users job';
|
return 'export.filter.activity.by_users_job.Filter by users job';
|
||||||
|
@@ -25,18 +25,20 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class UsersScopeFilter implements FilterInterface
|
class UsersScopeFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private const PREFIX = 'act_filter_user_scope';
|
private const string PREFIX = 'act_filter_user_scope';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly ScopeRepositoryInterface $scopeRepository,
|
private readonly ScopeRepositoryInterface $scopeRepository,
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$p = self::PREFIX;
|
$p = self::PREFIX;
|
||||||
@@ -60,11 +62,13 @@ class UsersScopeFilter implements FilterInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
@@ -77,6 +81,7 @@ class UsersScopeFilter implements FilterInterface
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
return ['export.filter.activity.by_users_scope.Filtered activity by users scope: only %scopes%', [
|
return ['export.filter.activity.by_users_scope.Filtered activity by users scope: only %scopes%', [
|
||||||
@@ -90,6 +95,7 @@ class UsersScopeFilter implements FilterInterface
|
|||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -97,6 +103,7 @@ class UsersScopeFilter implements FilterInterface
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'export.filter.activity.by_users_scope.Filter by users scope';
|
return 'export.filter.activity.by_users_scope.Filter by users scope';
|
||||||
|
@@ -20,6 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||||||
|
|
||||||
class ActivityPresenceType extends AbstractType
|
class ActivityPresenceType extends AbstractType
|
||||||
{
|
{
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
@@ -33,6 +34,7 @@ class ActivityPresenceType extends AbstractType
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function configureOptions(OptionsResolver $resolver): void
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
{
|
{
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
|
@@ -19,6 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||||||
|
|
||||||
class ActivityReasonCategoryType extends AbstractType
|
class ActivityReasonCategoryType extends AbstractType
|
||||||
{
|
{
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
@@ -29,6 +30,7 @@ class ActivityReasonCategoryType extends AbstractType
|
|||||||
/**
|
/**
|
||||||
* @param OptionsResolverInterface $resolver
|
* @param OptionsResolverInterface $resolver
|
||||||
*/
|
*/
|
||||||
|
#[\Override]
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
{
|
{
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
@@ -39,6 +41,7 @@ class ActivityReasonCategoryType extends AbstractType
|
|||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
#[\Override]
|
||||||
public function getBlockPrefix()
|
public function getBlockPrefix()
|
||||||
{
|
{
|
||||||
return 'chill_activitybundle_activityreasoncategory';
|
return 'chill_activitybundle_activityreasoncategory';
|
||||||
|
@@ -21,6 +21,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||||||
|
|
||||||
class ActivityReasonType extends AbstractType
|
class ActivityReasonType extends AbstractType
|
||||||
{
|
{
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
@@ -29,6 +30,7 @@ class ActivityReasonType extends AbstractType
|
|||||||
->add('category', TranslatableActivityReasonCategoryType::class);
|
->add('category', TranslatableActivityReasonCategoryType::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
{
|
{
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
@@ -39,6 +41,7 @@ class ActivityReasonType extends AbstractType
|
|||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
#[\Override]
|
||||||
public function getBlockPrefix()
|
public function getBlockPrefix()
|
||||||
{
|
{
|
||||||
return 'chill_activitybundle_activityreason';
|
return 'chill_activitybundle_activityreason';
|
||||||
|
@@ -68,6 +68,7 @@ class ActivityType extends AbstractType
|
|||||||
$this->user = $tokenStorage->getToken()->getUser();
|
$this->user = $tokenStorage->getToken()->getUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||||
{
|
{
|
||||||
// handle times choices
|
// handle times choices
|
||||||
@@ -386,6 +387,7 @@ class ActivityType extends AbstractType
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function configureOptions(OptionsResolver $resolver): void
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
{
|
{
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
@@ -400,6 +402,7 @@ class ActivityType extends AbstractType
|
|||||||
->setAllowedTypes('accompanyingPeriod', [AccompanyingPeriod::class, 'null']);
|
->setAllowedTypes('accompanyingPeriod', [AccompanyingPeriod::class, 'null']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getBlockPrefix(): string
|
public function getBlockPrefix(): string
|
||||||
{
|
{
|
||||||
return 'chill_activitybundle_activity';
|
return 'chill_activitybundle_activity';
|
||||||
|
@@ -21,6 +21,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||||||
|
|
||||||
class ActivityTypeCategoryType extends AbstractType
|
class ActivityTypeCategoryType extends AbstractType
|
||||||
{
|
{
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
@@ -38,6 +39,7 @@ class ActivityTypeCategoryType extends AbstractType
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function configureOptions(OptionsResolver $resolver): void
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
{
|
{
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
|
@@ -27,6 +27,7 @@ class ActivityTypeType extends AbstractType
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
|
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
@@ -67,6 +68,7 @@ class ActivityTypeType extends AbstractType
|
|||||||
->add('commentVisible', ActivityFieldPresence::class);
|
->add('commentVisible', ActivityFieldPresence::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
{
|
{
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
|
@@ -18,6 +18,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||||||
|
|
||||||
class ActivityFieldPresence extends AbstractType
|
class ActivityFieldPresence extends AbstractType
|
||||||
{
|
{
|
||||||
|
#[\Override]
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
{
|
{
|
||||||
$resolver->setDefaults(
|
$resolver->setDefaults(
|
||||||
@@ -31,6 +32,7 @@ class ActivityFieldPresence extends AbstractType
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getParent()
|
public function getParent()
|
||||||
{
|
{
|
||||||
return ChoiceType::class;
|
return ChoiceType::class;
|
||||||
|
@@ -30,6 +30,7 @@ class PickActivityReasonType extends AbstractType
|
|||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
{
|
{
|
||||||
$resolver->setDefaults(
|
$resolver->setDefaults(
|
||||||
@@ -49,11 +50,13 @@ class PickActivityReasonType extends AbstractType
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getBlockPrefix()
|
public function getBlockPrefix()
|
||||||
{
|
{
|
||||||
return 'translatable_activity_reason';
|
return 'translatable_activity_reason';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getParent()
|
public function getParent()
|
||||||
{
|
{
|
||||||
return EntityType::class;
|
return EntityType::class;
|
||||||
|
@@ -25,6 +25,7 @@ class TranslatableActivityReasonCategoryType extends AbstractType
|
|||||||
{
|
{
|
||||||
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) {}
|
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
{
|
{
|
||||||
$resolver->setDefaults(
|
$resolver->setDefaults(
|
||||||
@@ -36,6 +37,7 @@ class TranslatableActivityReasonCategoryType extends AbstractType
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getParent()
|
public function getParent()
|
||||||
{
|
{
|
||||||
return EntityType::class;
|
return EntityType::class;
|
||||||
|
@@ -22,6 +22,7 @@ class TranslatableActivityType extends AbstractType
|
|||||||
{
|
{
|
||||||
public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, protected ActivityTypeRepositoryInterface $activityTypeRepository) {}
|
public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, protected ActivityTypeRepositoryInterface $activityTypeRepository) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
{
|
{
|
||||||
$resolver->setDefaults(
|
$resolver->setDefaults(
|
||||||
@@ -34,11 +35,13 @@ class TranslatableActivityType extends AbstractType
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getBlockPrefix()
|
public function getBlockPrefix()
|
||||||
{
|
{
|
||||||
return 'translatable_activity_type';
|
return 'translatable_activity_type';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getParent()
|
public function getParent()
|
||||||
{
|
{
|
||||||
return EntityType::class;
|
return EntityType::class;
|
||||||
|
@@ -25,6 +25,7 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
{
|
{
|
||||||
public function __construct(protected Security $security, protected TranslatorInterface $translator) {}
|
public function __construct(protected Security $security, protected TranslatorInterface $translator) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
{
|
{
|
||||||
$period = $parameters['accompanyingCourse'];
|
$period = $parameters['accompanyingCourse'];
|
||||||
@@ -42,6 +43,7 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public static function getMenuIds(): array
|
public static function getMenuIds(): array
|
||||||
{
|
{
|
||||||
return ['accompanyingCourse'];
|
return ['accompanyingCourse'];
|
||||||
|
@@ -20,11 +20,13 @@ final readonly class AccompanyingCourseQuickMenuBuilder implements LocalMenuBuil
|
|||||||
{
|
{
|
||||||
public function __construct(private Security $security) {}
|
public function __construct(private Security $security) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public static function getMenuIds(): array
|
public static function getMenuIds(): array
|
||||||
{
|
{
|
||||||
return ['accompanying_course_quick_menu'];
|
return ['accompanying_course_quick_menu'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
{
|
{
|
||||||
/** @var \Chill\PersonBundle\Entity\AccompanyingPeriod $accompanyingCourse */
|
/** @var \Chill\PersonBundle\Entity\AccompanyingPeriod $accompanyingCourse */
|
||||||
|
@@ -22,6 +22,7 @@ final readonly class AdminMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private Security $security) {}
|
public function __construct(private Security $security) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
{
|
{
|
||||||
if (!$this->security->isGranted('ROLE_ADMIN')) {
|
if (!$this->security->isGranted('ROLE_ADMIN')) {
|
||||||
@@ -57,6 +58,7 @@ final readonly class AdminMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
])->setExtras(['order' => 5050]);
|
])->setExtras(['order' => 5050]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public static function getMenuIds(): array
|
public static function getMenuIds(): array
|
||||||
{
|
{
|
||||||
return ['admin_section', 'admin_activity'];
|
return ['admin_section', 'admin_activity'];
|
||||||
|
@@ -25,6 +25,7 @@ final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
{
|
{
|
||||||
public function __construct(private AuthorizationCheckerInterface $authorizationChecker, private TranslatorInterface $translator) {}
|
public function __construct(private AuthorizationCheckerInterface $authorizationChecker, private TranslatorInterface $translator) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
{
|
{
|
||||||
/** @var Person $person */
|
/** @var Person $person */
|
||||||
@@ -42,6 +43,7 @@ final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public static function getMenuIds(): array
|
public static function getMenuIds(): array
|
||||||
{
|
{
|
||||||
return ['person'];
|
return ['person'];
|
||||||
|
@@ -20,11 +20,13 @@ final readonly class ActivityNotificationHandler implements NotificationHandlerI
|
|||||||
{
|
{
|
||||||
public function __construct(private ActivityRepository $activityRepository) {}
|
public function __construct(private ActivityRepository $activityRepository) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTemplate(Notification $notification, array $options = []): string
|
public function getTemplate(Notification $notification, array $options = []): string
|
||||||
{
|
{
|
||||||
return '@ChillActivity/Activity/showInNotification.html.twig';
|
return '@ChillActivity/Activity/showInNotification.html.twig';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getTemplateData(Notification $notification, array $options = []): array
|
public function getTemplateData(Notification $notification, array $options = []): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -33,6 +35,7 @@ final readonly class ActivityNotificationHandler implements NotificationHandlerI
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function supports(Notification $notification, array $options = []): bool
|
public function supports(Notification $notification, array $options = []): bool
|
||||||
{
|
{
|
||||||
return Activity::class === $notification->getRelatedEntityClass();
|
return Activity::class === $notification->getRelatedEntityClass();
|
||||||
|
@@ -50,6 +50,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos
|
|||||||
* @throws NonUniqueResultException
|
* @throws NonUniqueResultException
|
||||||
* @throws NoResultException
|
* @throws NoResultException
|
||||||
*/
|
*/
|
||||||
|
#[\Override]
|
||||||
public function countByAccompanyingPeriod(AccompanyingPeriod $period, string $role, array $filters = []): int
|
public function countByAccompanyingPeriod(AccompanyingPeriod $period, string $role, array $filters = []): int
|
||||||
{
|
{
|
||||||
$qb = $this->buildBaseQuery($filters);
|
$qb = $this->buildBaseQuery($filters);
|
||||||
@@ -61,6 +62,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos
|
|||||||
return $qb->getQuery()->getSingleScalarResult();
|
return $qb->getQuery()->getSingleScalarResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function countByPerson(Person $person, string $role, array $filters = []): int
|
public function countByPerson(Person $person, string $role, array $filters = []): int
|
||||||
{
|
{
|
||||||
$qb = $this->buildBaseQuery($filters);
|
$qb = $this->buildBaseQuery($filters);
|
||||||
@@ -72,6 +74,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos
|
|||||||
return $qb->getQuery()->getSingleScalarResult();
|
return $qb->getQuery()->getSingleScalarResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function findByAccompanyingPeriod(AccompanyingPeriod $period, string $role, ?int $start = 0, ?int $limit = 1000, array $orderBy = ['date' => 'DESC'], array $filters = []): array
|
public function findByAccompanyingPeriod(AccompanyingPeriod $period, string $role, ?int $start = 0, ?int $limit = 1000, array $orderBy = ['date' => 'DESC'], array $filters = []): array
|
||||||
{
|
{
|
||||||
$qb = $this->buildBaseQuery($filters);
|
$qb = $this->buildBaseQuery($filters);
|
||||||
@@ -161,6 +164,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos
|
|||||||
/**
|
/**
|
||||||
* @return array<ActivityType>
|
* @return array<ActivityType>
|
||||||
*/
|
*/
|
||||||
|
#[\Override]
|
||||||
public function findActivityTypeByAssociated(AccompanyingPeriod|Person $associated): array
|
public function findActivityTypeByAssociated(AccompanyingPeriod|Person $associated): array
|
||||||
{
|
{
|
||||||
$in = $this->em->createQueryBuilder();
|
$in = $this->em->createQueryBuilder();
|
||||||
@@ -188,6 +192,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos
|
|||||||
return $qb->getQuery()->getResult();
|
return $qb->getQuery()->getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function findUserJobByAssociated(AccompanyingPeriod|Person $associated): array
|
public function findUserJobByAssociated(AccompanyingPeriod|Person $associated): array
|
||||||
{
|
{
|
||||||
$in = $this->em->createQueryBuilder();
|
$in = $this->em->createQueryBuilder();
|
||||||
@@ -220,6 +225,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos
|
|||||||
return $qb->getQuery()->getResult();
|
return $qb->getQuery()->getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function findByAccompanyingPeriodSimplified(AccompanyingPeriod $period, ?int $limit = 1000): array
|
public function findByAccompanyingPeriodSimplified(AccompanyingPeriod $period, ?int $limit = 1000): array
|
||||||
{
|
{
|
||||||
$rsm = new ResultSetMappingBuilder($this->em);
|
$rsm = new ResultSetMappingBuilder($this->em);
|
||||||
@@ -302,6 +308,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos
|
|||||||
return $nq->getResult(AbstractQuery::HYDRATE_ARRAY);
|
return $nq->getResult(AbstractQuery::HYDRATE_ARRAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function findByPerson(Person $person, string $role, ?int $start = 0, ?int $limit = 1000, ?array $orderBy = [], array $filters = []): array
|
public function findByPerson(Person $person, string $role, ?int $start = 0, ?int $limit = 1000, ?array $orderBy = [], array $filters = []): array
|
||||||
{
|
{
|
||||||
$qb = $this->buildBaseQuery($filters);
|
$qb = $this->buildBaseQuery($filters);
|
||||||
|
@@ -35,6 +35,7 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum
|
|||||||
private Security $security
|
private Security $security
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface
|
public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface
|
||||||
{
|
{
|
||||||
$query = $this->buildBaseFetchQueryActivityDocumentLinkedToPersonFromPersonContext($person, $startDate, $endDate, $content);
|
$query = $this->buildBaseFetchQueryActivityDocumentLinkedToPersonFromPersonContext($person, $startDate, $endDate, $content);
|
||||||
@@ -71,6 +72,7 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum
|
|||||||
return $this->addWhereClauses($query, $startDate, $endDate, $content);
|
return $this->addWhereClauses($query, $startDate, $endDate, $content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery
|
public function buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery
|
||||||
{
|
{
|
||||||
$storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class);
|
$storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class);
|
||||||
|
@@ -24,26 +24,31 @@ class ActivityPresenceRepository implements ActivityPresenceRepositoryInterface
|
|||||||
$this->repository = $entityManager->getRepository($this->getClassName());
|
$this->repository = $entityManager->getRepository($this->getClassName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function find($id): ?ActivityPresence
|
public function find($id): ?ActivityPresence
|
||||||
{
|
{
|
||||||
return $this->repository->find($id);
|
return $this->repository->find($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function findAll(): array
|
public function findAll(): array
|
||||||
{
|
{
|
||||||
return $this->repository->findAll();
|
return $this->repository->findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
|
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
|
||||||
{
|
{
|
||||||
return $this->findBy($criteria, $orderBy, $limit, $offset);
|
return $this->findBy($criteria, $orderBy, $limit, $offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function findOneBy(array $criteria): ?ActivityPresence
|
public function findOneBy(array $criteria): ?ActivityPresence
|
||||||
{
|
{
|
||||||
return $this->findOneBy($criteria);
|
return $this->findOneBy($criteria);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getClassName(): string
|
public function getClassName(): string
|
||||||
{
|
{
|
||||||
return ActivityPresence::class;
|
return ActivityPresence::class;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user