Compare commits

..

2 Commits
2.8.0 ... 2.5.1

Author SHA1 Message Date
2750be1703 release 2.5.1 2023-07-14 13:02:01 +02:00
15f6659404 [collate addresses] block collating addresses to another address reference
where the address reference is already the best match
2023-07-14 13:01:03 +02:00
256 changed files with 1125 additions and 2412 deletions

View File

@@ -7,7 +7,6 @@
* ([#128](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/128)) [Export] allow to group activities by localisation * ([#128](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/128)) [Export] allow to group activities by localisation
* ([#129](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/129)) [export] Add a filter "filter course having an activity between two dates" * ([#129](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/129)) [export] Add a filter "filter course having an activity between two dates"
* ([#112](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/112)) [addresses] Add a cronjob to re-associate addresses with addresses reference every 6 hours * ([#112](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/112)) [addresses] Add a cronjob to re-associate addresses with addresses reference every 6 hours
* Improve filtering layout
### Fixed ### Fixed
* reimplement the visualization of all calculator results * reimplement the visualization of all calculator results
@@ -36,4 +35,3 @@
* meilleure intégration du bouton "détail d'une adresse": améliration de la taille et de la position * meilleure intégration du bouton "détail d'une adresse": améliration de la taille et de la position
* bouton permettant de visualiser les détails d'une adresse (modale avec carte) dans la bannière "Usager" et "Ménage" * bouton permettant de visualiser les détails d'une adresse (modale avec carte) dans la bannière "Usager" et "Ménage"
* amélioration de la modale permettant de voir les détails d'un usager: les adresses de résidence sont dans la continuité des autres adresses, et non plus dans une colonne séparée * amélioration de la modale permettant de voir les détails d'un usager: les adresses de résidence sont dans la continuité des autres adresses, et non plus dans une colonne séparée
* améliore le design et l'expérience utilisateur des filtres

View File

@@ -1,3 +0,0 @@
## v2.5.2 - 2023-07-15
### Fixed
* [Collate Address] when updating address point, do not use the point's address reference if the similarity is below the requirement for associating the address reference and the address (it uses the postcode's center instead)

View File

@@ -1,3 +0,0 @@
## v2.5.3 - 2023-07-20
### Fixed
* ([#132](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/132)) Rendez-vous documents created would appear in all documents lists of all persons with an accompanying period. Or statements are now added to the where clause to filter out documents that come from unrelated accompanying period/ or person rendez-vous.

View File

@@ -1,21 +0,0 @@
## v2.6.0 - 2023-09-14
### Feature
* ([#133](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/133)) Add locations in Aside Activity. By default, suggest user location, otherwise a select with all locations.
* ([#133](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/133)) Adapt Aside Activity exports: display location, filter by location, group by location
* Use the CRUD controller for center entity + add the isActive property to be able to mask instances of Center that are no longer in use.
### Fixed
* ([#107](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/107)) reinstate the fusion of duplicate persons
* Missing translation in Work Actions exports
* Reimplement the mission type filter on tasks, only for instances that have a config parameter indicating true for this.
* ([#135](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/135)) Corrects a typing error in 2 filters, which caused an
error when trying to reedit a saved export
* ([#136](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/136)) [household] when moving a person to a sharing position to a not-sharing position on the same household on the same date, remove the previous household membership on the same household. This fix duplicate member.
* Add missing translation for comment field placeholder in repositionning household editor.
* Do not send an email to creator twice when adding a comment to a notification
* ([#107](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/107)) Fix gestion doublon functionality to work with chill bundles v2
### UX
* Uniformize badge-person in household banner (background, size)

View File

@@ -1,3 +0,0 @@
## v2.6.1 - 2023-09-14
### Fixed
* Filter out active centers in exports, which uses a different PickCenterType.

View File

@@ -1,3 +0,0 @@
## v2.6.2 - 2023-09-18
### Fixed
* Fix doctrine mapping of AbstractTaskPlaceEvent and SingleTaskPlaceEvent: id property moved.

View File

@@ -1,4 +0,0 @@
## v2.6.3 - 2023-09-19
### Fixed
* Remove id property from document
mappedsuperclass

View File

@@ -1,6 +0,0 @@
## v2.7.0 - 2023-09-27
### Feature
* ([#155](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/155)) The regulation list load accompanying periods by exact postal code (address associated with postal code), and not by the content of the postal code (postal code with same code's string)
### Fixed
* ([#142](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/142)) Fix the label of filter ActivityTypeFilter to a more obvious one
* ([#140](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/140)) [export] Fix association of filter "filter location by type" which did not appears on "list of activities"

View File

@@ -1,19 +0,0 @@
## v2.8.0 - 2023-10-05
### Feature
* ([#162](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/162)) Reassigning list: when reassigning courses to a new user, the job associated with the course become the one of the new user (if any)
* Reassining list: the length of the list is increased to 100 courses
### Fixed
* ([#143](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/143)) Fix filter "accompanying course by social action" to avoid duplication in list
* ([#164](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/164)) View a third party: avoid errors when a contact has a civility
* ([#163](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/163)) Fix the filters and aggregators on exports "count peoples"
* ([#143](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/143)) From the database, avoid the creation of location history for same period and at same dates
### Traduction francophone des principaux changements
- Fonctionnalité: Réassigner les parcours en lot: lorsque des parcours sont réassignés "en lot", les parcours sont maintenant associés au métier du nouveau référent;
- Correction: certaines causes qui créaient des doublons dans les listes ont été corrigées;
- Correction des associations entre l'export "nombre de personnes" et les filtres et regroupements associés

View File

@@ -6,76 +6,6 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie). and is generated by [Changie](https://github.com/miniscruff/changie).
## v2.8.0 - 2023-10-05
### Feature
* ([#162](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/162)) Reassigning list: when reassigning courses to a new user, the job associated with the course become the one of the new user (if any)
* Reassining list: the length of the list is increased to 100 courses
### Fixed
* ([#143](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/143)) Fix filter "accompanying course by social action" to avoid duplication in list
* ([#164](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/164)) View a third party: avoid errors when a contact has a civility
* ([#163](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/163)) Fix the filters and aggregators on exports "count peoples"
* ([#143](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/143)) From the database, avoid the creation of location history for same period and at same dates
### Traduction francophone des principaux changements
- Fonctionnalité: Réassigner les parcours en lot: lorsque des parcours sont réassignés "en lot", les parcours sont maintenant associés au métier du nouveau référent;
- Correction: certaines causes qui créaient des doublons dans les listes ont été corrigées;
- Correction des associations entre l'export "nombre de personnes" et les filtres et regroupements associés
## v2.7.0 - 2023-09-27
### Feature
* ([#155](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/155)) The regulation list load accompanying periods by exact postal code (address associated with postal code), and not by the content of the postal code (postal code with same code's string)
### Fixed
* ([#142](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/142)) Fix the label of filter ActivityTypeFilter to a more obvious one
* ([#140](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/140)) [export] Fix association of filter "filter location by type" which did not appears on "list of activities"
## v2.6.3 - 2023-09-19
### Fixed
* Remove id property from document
mappedsuperclass
## v2.6.2 - 2023-09-18
### Fixed
* Fix doctrine mapping of AbstractTaskPlaceEvent and SingleTaskPlaceEvent: id property moved.
## v2.6.1 - 2023-09-14
### Fixed
* Filter out active centers in exports, which uses a different PickCenterType.
## v2.6.0 - 2023-09-14
### Feature
* ([#133](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/133)) Add locations in Aside Activity. By default, suggest user location, otherwise a select with all locations.
* ([#133](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/133)) Adapt Aside Activity exports: display location, filter by location, group by location
* Use the CRUD controller for center entity + add the isActive property to be able to mask instances of Center that are no longer in use.
### Fixed
* ([#107](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/107)) reinstate the fusion of duplicate persons
* Missing translation in Work Actions exports
* Reimplement the mission type filter on tasks, only for instances that have a config parameter indicating true for this.
* ([#135](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/135)) Corrects a typing error in 2 filters, which caused an
error when trying to reedit a saved export
* ([#136](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/136)) [household] when moving a person to a sharing position to a not-sharing position on the same household on the same date, remove the previous household membership on the same household. This fix duplicate member.
* Add missing translation for comment field placeholder in repositionning household editor.
* Do not send an email to creator twice when adding a comment to a notification
* ([#107](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/107)) Fix gestion doublon functionality to work with chill bundles v2
### UX
* Uniformize badge-person in household banner (background, size)
## v2.5.3 - 2023-07-20
### Fixed
* ([#132](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/132)) Rendez-vous documents created would appear in all documents lists of all persons with an accompanying period. Or statements are now added to the where clause to filter out documents that come from unrelated accompanying period/ or person rendez-vous.
## v2.5.2 - 2023-07-15
### Fixed
* [Collate Address] when updating address point, do not use the point's address reference if the similarity is below the requirement for associating the address reference and the address (it uses the postcode's center instead)
## v2.5.1 - 2023-07-14 ## v2.5.1 - 2023-07-14
### Fixed ### Fixed
* [collate addresses] block collating addresses to another address reference where the address reference is already the best match * [collate addresses] block collating addresses to another address reference where the address reference is already the best match
@@ -89,7 +19,6 @@ error when trying to reedit a saved export
* ([#128](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/128)) [Export] allow to group activities by localisation * ([#128](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/128)) [Export] allow to group activities by localisation
* ([#129](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/129)) [export] Add a filter "filter course having an activity between two dates" * ([#129](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/129)) [export] Add a filter "filter course having an activity between two dates"
* ([#112](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/112)) [addresses] Add a cronjob to re-associate addresses with addresses reference every 6 hours * ([#112](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/112)) [addresses] Add a cronjob to re-associate addresses with addresses reference every 6 hours
* Improve filtering layout
### Fixed ### Fixed
* reimplement the visualization of all calculator results * reimplement the visualization of all calculator results
@@ -118,7 +47,6 @@ error when trying to reedit a saved export
* meilleure intégration du bouton "détail d'une adresse": améliration de la taille et de la position * meilleure intégration du bouton "détail d'une adresse": améliration de la taille et de la position
* bouton permettant de visualiser les détails d'une adresse (modale avec carte) dans la bannière "Usager" et "Ménage" * bouton permettant de visualiser les détails d'une adresse (modale avec carte) dans la bannière "Usager" et "Ménage"
* amélioration de la modale permettant de voir les détails d'un usager: les adresses de résidence sont dans la continuité des autres adresses, et non plus dans une colonne séparée * amélioration de la modale permettant de voir les détails d'un usager: les adresses de résidence sont dans la continuité des autres adresses, et non plus dans une colonne séparée
* améliore le design et l'expérience utilisateur des filtres
## v2.4.0 - 2023-07-07 ## v2.4.0 - 2023-07-07

View File

@@ -1,80 +0,0 @@
# Contributing
Chill is an open source, community-driven project.
If you'd like to contribute, please read the following.
## What can you do ?
Chill is an open-source project driven by a community of developers, users and social workers. If you don't feel ready to contribute code or patches, reviewing issues and pull requests (PRs) can be a great start to get involved and give back.
If you don't have your own instance or don't want to use it, you can try to reproduce bugs using the instance https://demo.chill.social
## Core team
The core team is the group of developers that determine the direction and evolution of the Chill project. Their votes rule if the features and patches proposed by the community are approved or rejected.
All the Chill Core members are long-time contributors with solid technical expertise and they have demonstrated a strong commitment to drive the project forward.
The core team:
- elects his own members;
- merge pull requests;
### members
Project leader: [julienfastre](https://gitlab.com/julienfastre)
Core members:
- [tchama](https://gitlab.com/tchama)
- [LenaertsJ](https://gitlab.com/LenaertsJ)
- [nobohan](https://gitlab.com/nobohan)
### Becoming a project member
About once a year, the core team discusses the opportunity to invite new members. To become a core team member, you must:
- take part on the development for at least 6 month: propose multiple merge requests and participate to the peer review process;
- through this participation, demonstrate your technical skills and your knowledge of the software and any of their dependencies;
### Core Membership Revocation
A Chill Core membership can be revoked for any of the following reasons:
- Refusal to follow the rules and policies stated in this document;
- Lack of activity for the past six months;
- Willful negligence or intent to harm the Chill project;
The decision is taken by the majority of project members.
## Code development rules
### Merge requests
Every merge request must contains:
- one more entries suitable for generating a changelog. This is done using the [changie utility](https://changie.dev);
- a comprehensible description of the changes;
- if applicable, automated tests should be adapted or created;
- the code style must pass the project's rules, and non phpstan errors must be raised nor rector refactoring suggestion.
The pipelines must pass.
In case of emergency, some rules may be temporarily ignored.
### Merge Request Voting Policy
- -1 votes must always be justified by technical and objective reasons;
- +1 (technically: approbation on the merge request) votes do not require justification, unless there is at least one -1 vote;
- Core members can change their votes as many times as they desire during the course of a merge request discussion;
- Core members are not allowed to vote on their own merge requests.
### Merge Request Merging Process
All code must be committed to the repository through merge requests, except for minor changes which can be committed directly to the repository.
### Release Policy
The Core members are also the release manager for every Chill version.

View File

@@ -123,8 +123,7 @@
"ocramius/package-versions": true, "ocramius/package-versions": true,
"phpro/grumphp": true, "phpro/grumphp": true,
"phpstan/extension-installer": true, "phpstan/extension-installer": true,
"roave/you-are-using-it-wrong": true, "roave/you-are-using-it-wrong": true
"symfony/runtime": true
}, },
"bin-dir": "bin", "bin-dir": "bin",
"optimize-autoloader": true, "optimize-autoloader": true,

View File

@@ -1,36 +0,0 @@
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
.. _faq:
Frequently asked questions
####################
Continuous integration
***********
Pipeline fails, but php-cs-fixer doesn't alert me when running it locally ?
========================================
It is possible that you run php-cs-fixer on your local instance of chill and no fixes are made.
Everything seems fine, so you push. However once the pipeline is run in gitlab, you're notified that it failed due to php
cs errors.
In this case it's likely that you have to update your version of php-cs-fixer.
php-cs-fixer is installed when building the docker image: https://gitea.champs-libres.be/Chill-project/chill-skeleton-basic/src/branch/main/Dockerfile#L50
Consequently, to update php-cs-fixer we have to update the image by building it again.
For this the following commands can be used,
.. code-block:: php
docker compose build --pull php
# replace existing containers
docker compose up -d --force-recreate php

View File

@@ -9,7 +9,7 @@
Development Development
########### ###########
As Chill relies on the `symfony <http://symfony.com>`_ framework, reading the framework's documentation should answer most of your questions. We are explaining here some tips to work with Chill, and help with things we've encountered. As Chill rely on the `symfony <http://symfony.com>`_ framework, reading the framework's documentation should answer most of your questions. We are explaining here some tips to work with Chill, and things we provide to encounter our needs.
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
@@ -37,7 +37,6 @@ As Chill relies on the `symfony <http://symfony.com>`_ framework, reading the fr
Cron Jobs <cronjob.rst> Cron Jobs <cronjob.rst>
Info about entities <entity-info.rst> Info about entities <entity-info.rst>
Info about database (in French) <database-principles.rst> Info about database (in French) <database-principles.rst>
Developer FAQ <FAQ.rst>
Layout and UI Layout and UI
************** **************

View File

@@ -2,13 +2,6 @@
declare(strict_types=1); declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig; use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\LevelSetList;

View File

@@ -13,4 +13,6 @@ namespace Chill\ActivityBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\HttpKernel\Bundle\Bundle;
class ChillActivityBundle extends Bundle {} class ChillActivityBundle extends Bundle
{
}

View File

@@ -72,7 +72,8 @@ final class ActivityController extends AbstractController
private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory, private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory,
private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatableStringHelperInterface $translatableStringHelper,
private readonly PaginatorFactory $paginatorFactory, private readonly PaginatorFactory $paginatorFactory,
) {} ) {
}
/** /**
* Deletes a Activity entity. * Deletes a Activity entity.
@@ -319,6 +320,7 @@ final class ActivityController extends AbstractController
private function buildFilterOrder(AccompanyingPeriod|Person $associated): FilterOrderHelper private function buildFilterOrder(AccompanyingPeriod|Person $associated): FilterOrderHelper
{ {
$filterBuilder = $this->filterOrderHelperFactory->create(self::class); $filterBuilder = $this->filterOrderHelperFactory->create(self::class);
$types = $this->activityACLAwareRepository->findActivityTypeByAssociated($associated); $types = $this->activityACLAwareRepository->findActivityTypeByAssociated($associated);
$jobs = $this->activityACLAwareRepository->findUserJobByAssociated($associated); $jobs = $this->activityACLAwareRepository->findUserJobByAssociated($associated);

View File

@@ -9,7 +9,7 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Export\Aggregator; namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
use Chill\ActivityBundle\Export\Declarations; use Chill\ActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\AggregatorInterface; use Chill\MainBundle\Export\AggregatorInterface;
@@ -45,7 +45,7 @@ class ByCreatorAggregator implements AggregatorInterface
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY_ACP;
} }
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)

View File

@@ -9,7 +9,7 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Export\Aggregator; namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
use Chill\ActivityBundle\Export\Declarations; use Chill\ActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\AggregatorInterface; use Chill\MainBundle\Export\AggregatorInterface;
@@ -50,7 +50,7 @@ class ByThirdpartyAggregator implements AggregatorInterface
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY_ACP;
} }
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)

View File

@@ -9,7 +9,7 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Export\Aggregator; namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
use Chill\ActivityBundle\Export\Declarations; use Chill\ActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\AggregatorInterface; use Chill\MainBundle\Export\AggregatorInterface;
@@ -50,7 +50,7 @@ class CreatorScopeAggregator implements AggregatorInterface
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY_ACP;
} }
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)

View File

@@ -9,7 +9,7 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Export\Aggregator; namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
use Chill\ActivityBundle\Export\Declarations; use Chill\ActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\AggregatorInterface; use Chill\MainBundle\Export\AggregatorInterface;
@@ -66,7 +66,7 @@ class DateAggregator implements AggregatorInterface
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY_ACP;
} }
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)

View File

@@ -9,7 +9,7 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Export\Aggregator; namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
use Chill\ActivityBundle\Export\Declarations; use Chill\ActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\AggregatorInterface; use Chill\MainBundle\Export\AggregatorInterface;
@@ -50,7 +50,7 @@ class LocationTypeAggregator implements AggregatorInterface
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY_ACP;
} }
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)

View File

@@ -36,7 +36,9 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
$this->repository = $em->getRepository(Activity::class); $this->repository = $em->getRepository(Activity::class);
} }
public function buildForm(FormBuilderInterface $builder) {} public function buildForm(FormBuilderInterface $builder)
{
}
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];

View File

@@ -36,7 +36,9 @@ class CountActivity implements ExportInterface, GroupedExportInterface
$this->repository = $em->getRepository(Activity::class); $this->repository = $em->getRepository(Activity::class);
} }
public function buildForm(FormBuilderInterface $builder) {} public function buildForm(FormBuilderInterface $builder)
{
}
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];

View File

@@ -12,7 +12,6 @@ declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Export\LinkedToACP; namespace Chill\ActivityBundle\Export\Export\LinkedToACP;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Declarations;
use Chill\ActivityBundle\Export\Export\ListActivityHelper; use Chill\ActivityBundle\Export\Export\ListActivityHelper;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\Scope;
@@ -161,7 +160,6 @@ class ListActivity implements ListInterface, GroupedExportInterface
return array_merge( return array_merge(
$this->helper->supportsModifiers(), $this->helper->supportsModifiers(),
[ [
Declarations::ACTIVITY,
\Chill\PersonBundle\Export\Declarations::ACP_TYPE, \Chill\PersonBundle\Export\Declarations::ACP_TYPE,
] ]
); );

View File

@@ -32,7 +32,9 @@ class CountActivity implements ExportInterface, GroupedExportInterface
$this->activityRepository = $activityRepository; $this->activityRepository = $activityRepository;
} }
public function buildForm(FormBuilderInterface $builder) {} public function buildForm(FormBuilderInterface $builder)
{
}
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];

View File

@@ -299,7 +299,7 @@ class ListActivity implements ListInterface, GroupedExportInterface
return [ return [
Declarations::ACTIVITY, Declarations::ACTIVITY,
Declarations::ACTIVITY_PERSON, Declarations::ACTIVITY_PERSON,
PersonDeclarations::PERSON_TYPE, //PersonDeclarations::PERSON_TYPE,
]; ];
} }
} }

View File

@@ -50,7 +50,9 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
$this->activityRepository = $activityRepository; $this->activityRepository = $activityRepository;
} }
public function buildForm(FormBuilderInterface $builder) {} public function buildForm(FormBuilderInterface $builder)
{
}
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
@@ -155,7 +157,7 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
return [ return [
Declarations::ACTIVITY, Declarations::ACTIVITY,
Declarations::ACTIVITY_PERSON, Declarations::ACTIVITY_PERSON,
PersonDeclarations::PERSON_TYPE, //PersonDeclarations::PERSON_TYPE,
]; ];
} }
} }

View File

@@ -104,7 +104,9 @@ class ListActivityHelper
->addGroupBy('location.id'); ->addGroupBy('location.id');
} }
public function buildForm(FormBuilderInterface $builder) {} public function buildForm(FormBuilderInterface $builder)
{
}
public function getAllowedFormattersTypes() public function getAllowedFormattersTypes()
{ {

View File

@@ -21,15 +21,19 @@ use Doctrine\ORM\QueryBuilder;
use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
/**
* Filter accompanying period to keep only the one having at list one activity from the given ActivityType.
*/
class ActivityTypeFilter implements FilterInterface class ActivityTypeFilter implements FilterInterface
{ {
private ActivityTypeRepositoryInterface $activityTypeRepository;
private TranslatableStringHelperInterface $translatableStringHelper;
public function __construct( public function __construct(
private readonly ActivityTypeRepositoryInterface $activityTypeRepository, ActivityTypeRepositoryInterface $activityTypeRepository,
private readonly TranslatableStringHelperInterface $translatableStringHelper TranslatableStringHelperInterface $translatableStringHelper
) {} ) {
$this->activityTypeRepository = $activityTypeRepository;
$this->translatableStringHelper = $translatableStringHelper;
}
public function addRole(): ?string public function addRole(): ?string
{ {
@@ -77,7 +81,7 @@ class ActivityTypeFilter implements FilterInterface
$types[] = $this->translatableStringHelper->localize($aty->getName()); $types[] = $this->translatableStringHelper->localize($aty->getName());
} }
return ['export.filter.activity.acp_by_activity_type.acp_containing_at_least_one_%activitytypes%', [ return ['Filtered by activity types: only %activitytypes%', [
'%activitytypes%' => implode(', ', $types), '%activitytypes%' => implode(', ', $types),
]]; ]];
} }

View File

@@ -9,7 +9,7 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Export\Filter; namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
use Chill\ActivityBundle\Export\Declarations; use Chill\ActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\FilterInterface; use Chill\MainBundle\Export\FilterInterface;
@@ -43,7 +43,7 @@ class ByCreatorFilter implements FilterInterface
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY_ACP;
} }
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)

View File

@@ -9,7 +9,7 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Export\Filter; namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
use Chill\ActivityBundle\Export\Declarations; use Chill\ActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\FilterInterface; use Chill\MainBundle\Export\FilterInterface;
@@ -22,11 +22,11 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class EmergencyFilter implements FilterInterface class EmergencyFilter implements FilterInterface
{ {
private const CHOICES = [ private const 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 DEFAULT_CHOICE = false;
private TranslatorInterface $translator; private TranslatorInterface $translator;
@@ -58,7 +58,7 @@ class EmergencyFilter implements FilterInterface
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY_ACP;
} }
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)

View File

@@ -17,9 +17,6 @@ use Chill\PersonBundle\Export\Declarations;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
/**
* Filter accompanying periods to keep only the one without any activity
*/
class HasNoActivityFilter implements FilterInterface class HasNoActivityFilter implements FilterInterface
{ {
public function addRole(): ?string public function addRole(): ?string

View File

@@ -9,7 +9,7 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Export\Filter; namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
use Chill\ActivityBundle\Export\Declarations; use Chill\ActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\FilterInterface; use Chill\MainBundle\Export\FilterInterface;
@@ -36,7 +36,7 @@ class LocationFilter implements FilterInterface
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY_ACP;
} }
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)

View File

@@ -9,7 +9,7 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Export\Filter; namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
use Chill\ActivityBundle\Export\Declarations; use Chill\ActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\FilterInterface; use Chill\MainBundle\Export\FilterInterface;
@@ -55,7 +55,7 @@ class LocationTypeFilter implements FilterInterface
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY_ACP;
} }
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)

View File

@@ -23,7 +23,8 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
{ {
public function __construct( public function __construct(
private RollingDateConverterInterface $rollingDateConverter, private RollingDateConverterInterface $rollingDateConverter,
) {} ) {
}
public function getTitle() public function getTitle()
{ {

View File

@@ -9,7 +9,7 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Export\Filter; namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Declarations; use Chill\ActivityBundle\Export\Declarations;
@@ -59,7 +59,7 @@ class SentReceivedFilter implements FilterInterface
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY_ACP;
} }
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)

View File

@@ -9,7 +9,7 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Export\Filter; namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
use Chill\ActivityBundle\Export\Declarations; use Chill\ActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\FilterInterface; use Chill\MainBundle\Export\FilterInterface;
@@ -51,7 +51,7 @@ class UserFilter implements FilterInterface
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY_ACP;
} }
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)

View File

@@ -9,7 +9,7 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Export\Filter; namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
use Chill\ActivityBundle\Export\Declarations; use Chill\ActivityBundle\Export\Declarations;
use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\Scope;
@@ -57,7 +57,7 @@ class UserScopeFilter implements FilterInterface
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY; return Declarations::ACTIVITY_ACP;
} }
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)

View File

@@ -17,9 +17,6 @@ use Chill\ActivityBundle\Repository\ActivityReasonRepository;
use Chill\MainBundle\Export\ExportElementValidatedInterface; use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Chill\MainBundle\Export\FilterInterface; use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Form\Type\Export\FilterType; use Chill\MainBundle\Form\Type\Export\FilterType;
use Chill\MainBundle\Form\Type\PickRollingDateType;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface; use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Chill\PersonBundle\Export\Declarations; use Chill\PersonBundle\Export\Declarations;
@@ -49,8 +46,7 @@ class PersonHavingActivityBetweenDateFilter implements ExportElementValidatedInt
public function __construct( public function __construct(
TranslatableStringHelper $translatableStringHelper, TranslatableStringHelper $translatableStringHelper,
ActivityReasonRepository $activityReasonRepository, ActivityReasonRepository $activityReasonRepository,
TranslatorInterface $translator, TranslatorInterface $translator
private readonly RollingDateConverterInterface $rollingDateConverter,
) { ) {
$this->translatableStringHelper = $translatableStringHelper; $this->translatableStringHelper = $translatableStringHelper;
$this->activityReasonRepository = $activityReasonRepository; $this->activityReasonRepository = $activityReasonRepository;
@@ -66,19 +62,16 @@ class PersonHavingActivityBetweenDateFilter implements ExportElementValidatedInt
{ {
// create a subquery for activity // create a subquery for activity
$sqb = $qb->getEntityManager()->createQueryBuilder(); $sqb = $qb->getEntityManager()->createQueryBuilder();
$sqb->select('1') $sqb->select('person_person_having_activity.id')
->from(Activity::class, 'activity_person_having_activity') ->from(Activity::class, 'activity_person_having_activity')
->leftJoin('activity_person_having_activity.person', 'person_person_having_activity'); ->join('activity_person_having_activity.person', 'person_person_having_activity');
// add clause between date // add clause between date
$sqb->where('activity_person_having_activity.date BETWEEN ' $sqb->where('activity_person_having_activity.date BETWEEN '
. ':person_having_activity_between_date_from' . ':person_having_activity_between_date_from'
. ' AND ' . ' AND '
. ':person_having_activity_between_date_to' . ':person_having_activity_between_date_to');
. ' AND '
. '(person_person_having_activity.id = person.id OR person MEMBER OF activity_person_having_activity.persons)');
if (isset($data['reasons']) && [] !== $data['reasons']) {
// add clause activity reason // add clause activity reason
$sqb->join('activity_person_having_activity.reasons', 'reasons_person_having_activity'); $sqb->join('activity_person_having_activity.reasons', 'reasons_person_having_activity');
@@ -89,70 +82,111 @@ class PersonHavingActivityBetweenDateFilter implements ExportElementValidatedInt
) )
); );
$qb->setParameter('person_having_activity_reasons', $data['reasons']); $where = $qb->getDQLPart('where');
$clause = $qb->expr()->in('person.id', $sqb->getDQL());
if ($where instanceof Expr\Andx) {
$where->add($clause);
} else {
$where = $qb->expr()->andX($clause);
} }
$qb->andWhere( $qb->add('where', $where);
$qb->expr()->exists($sqb->getDQL())
);
$qb->setParameter( $qb->setParameter(
'person_having_activity_between_date_from', 'person_having_activity_between_date_from',
$this->rollingDateConverter->convert($data['date_from_rolling']) $data['date_from']
); );
$qb->setParameter( $qb->setParameter(
'person_having_activity_between_date_to', 'person_having_activity_between_date_to',
$this->rollingDateConverter->convert($data['date_to_rolling']) $data['date_to']
); );
$qb->setParameter('person_having_activity_reasons', $data['reasons']);
} }
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::PERSON_TYPE; return Declarations::PERSON_IMPLIED_IN;
} }
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$builder->add('date_from_rolling', PickRollingDateType::class, [ $builder->add('date_from', DateType::class, [
'label' => 'export.filter.activity.person_between_dates.Implied in an activity after this date', 'label' => 'Implied in an activity after this date',
'attr' => ['class' => 'datepicker'],
'widget' => 'single_text',
'format' => 'dd-MM-yyyy',
]); ]);
$builder->add('date_to_rolling', PickRollingDateType::class, [ $builder->add('date_to', DateType::class, [
'label' => 'export.filter.activity.person_between_dates.Implied in an activity before this date', 'label' => 'Implied in an activity before this date',
'attr' => ['class' => 'datepicker'],
'widget' => 'single_text',
'format' => 'dd-MM-yyyy',
]); ]);
if ([] !== $reasons = $this->activityReasonRepository->findAll()) {
$builder->add('reasons', EntityType::class, [ $builder->add('reasons', EntityType::class, [
'class' => ActivityReason::class, 'class' => ActivityReason::class,
'choices' => $reasons,
'choice_label' => fn (ActivityReason $reason): ?string => $this->translatableStringHelper->localize($reason->getName()), 'choice_label' => fn (ActivityReason $reason): ?string => $this->translatableStringHelper->localize($reason->getName()),
'group_by' => fn (ActivityReason $reason): ?string => $this->translatableStringHelper->localize($reason->getCategory()->getName()), 'group_by' => fn (ActivityReason $reason): ?string => $this->translatableStringHelper->localize($reason->getCategory()->getName()),
'multiple' => true, 'multiple' => true,
'expanded' => false, 'expanded' => false,
'label' => 'export.filter.activity.person_between_dates.Activity reasons for those activities', 'label' => 'Activity reasons for those activities',
'help' => 'export.filter.activity.person_between_dates.if no reasons',
]); ]);
$builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) {
/** @var FormInterface $filterForm */
$filterForm = $event->getForm()->getParent();
$enabled = $filterForm->get(FilterType::ENABLED_FIELD)->getData();
if (true === $enabled) {
// if the filter is enabled, add some validation
$form = $event->getForm();
$date_from = $form->get('date_from')->getData();
$date_to = $form->get('date_to')->getData();
// check that fields are not empty
if (null === $date_from) {
$form->get('date_from')->addError(new FormError(
$this->translator->trans('This field '
. 'should not be empty')
));
} }
if (null === $date_to) {
$form->get('date_to')->addError(new FormError(
$this->translator->trans('This field '
. 'should not be empty')
));
}
// check that date_from is before date_to
if (
(null !== $date_from && null !== $date_to)
&& $date_from >= $date_to
) {
$form->get('date_to')->addError(new FormError(
$this->translator->trans('This date '
. 'should be after the date given in "Implied in an '
. 'activity after this date" field')
));
}
}
});
} }
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return [ return ['date_from' => new DateTime(), 'date_to' => new DateTime(), 'reasons' => $this->activityReasonRepository->findAll()];
'date_from_rolling' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START),
'date_to_rolling' => new RollingDate(RollingDate::T_TODAY),
'reasons' => [],
];
} }
public function describeAction($data, $format = 'string') public function describeAction($data, $format = 'string')
{ {
return [ return [
[] === $data['reasons'] ? 'Filtered by person having an activity between %date_from% and '
'export.filter.person_between_dates.describe_action_with_no_subject' . '%date_to% with reasons %reasons_name%',
: 'export.filter.person_between_dates.describe_action_with_subject',
[ [
'date_from' => $this->rollingDateConverter->convert($data['date_from_rolling']), '%date_from%' => $data['date_from']->format('d-m-Y'),
'date_to' => $this->rollingDateConverter->convert($data['date_to_rolling']), '%date_to%' => $data['date_to']->format('d-m-Y'),
'reasons' => implode( '%reasons_name%' => implode(
', ', ', ',
array_map( array_map(
fn (ActivityReason $r): string => '"' . $this->translatableStringHelper->localize($r->getName()) . '"', fn (ActivityReason $r): string => '"' . $this->translatableStringHelper->localize($r->getName()) . '"',
@@ -165,15 +199,13 @@ class PersonHavingActivityBetweenDateFilter implements ExportElementValidatedInt
public function getTitle() public function getTitle()
{ {
return 'export.filter.activity.person_between_dates.title'; return 'Filter by person having an activity in a period';
} }
public function validateForm($data, ExecutionContextInterface $context) public function validateForm($data, ExecutionContextInterface $context)
{ {
if ($this->rollingDateConverter->convert($data['date_from_rolling']) if (null === $data['reasons'] || count($data['reasons']) === 0) {
>= $this->rollingDateConverter->convert($data['date_to_rolling'])) { $context->buildViolation('At least one reason must be chosen')
$context->buildViolation('export.filter.activity.person_between_dates.date mismatch')
->setTranslationDomain('messages')
->addViolation(); ->addViolation();
} }
} }

View File

@@ -47,7 +47,8 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos
private EntityManagerInterface $em, private EntityManagerInterface $em,
private Security $security, private Security $security,
private RequestStack $requestStack, private RequestStack $requestStack,
) {} ) {
}
/** /**
* @throws NonUniqueResultException * @throws NonUniqueResultException

View File

@@ -43,7 +43,8 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum
private CenterResolverManagerInterface $centerResolverManager, private CenterResolverManagerInterface $centerResolverManager,
private AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser, private AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser,
private Security $security private Security $security
) {} ) {
}
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
{ {

View File

@@ -36,7 +36,8 @@ final class AccompanyingPeriodActivityGenericDocProvider implements GenericDocFo
private EntityManagerInterface $em, private EntityManagerInterface $em,
private Security $security, private Security $security,
private ActivityDocumentACLAwareRepositoryInterface $activityDocumentACLAwareRepository, private ActivityDocumentACLAwareRepositoryInterface $activityDocumentACLAwareRepository,
) {} ) {
}
public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
{ {

View File

@@ -29,7 +29,8 @@ final readonly class PersonActivityGenericDocProvider implements GenericDocForPe
public function __construct( public function __construct(
private Security $security, private Security $security,
private ActivityDocumentACLAwareRepositoryInterface $personActivityDocumentACLAwareRepository, private ActivityDocumentACLAwareRepositoryInterface $personActivityDocumentACLAwareRepository,
) {} ) {
}
public function buildFetchQueryForPerson(Person $person, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface public function buildFetchQueryForPerson(Person $person, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
{ {

View File

@@ -12,7 +12,7 @@ declare(strict_types=1);
namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators; namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Aggregator\BySocialActionAggregator; use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\BySocialActionAggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;

View File

@@ -12,7 +12,7 @@ declare(strict_types=1);
namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators; namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Aggregator\BySocialIssueAggregator; use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\BySocialIssueAggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;

View File

@@ -9,10 +9,10 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Tests\Export\Aggregator; namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Aggregator\ByThirdpartyAggregator; use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\ByThirdpartyAggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@@ -28,7 +28,7 @@ final class ByThirdpartyAggregatorTest extends AbstractAggregatorTest
{ {
self::bootKernel(); self::bootKernel();
$this->aggregator = self::$container->get(ByThirdpartyAggregator::class); $this->aggregator = self::$container->get('chill.activity.export.bythirdparty_aggregator');
} }
public function getAggregator() public function getAggregator()

View File

@@ -9,10 +9,10 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Tests\Export\Aggregator; namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Aggregator\ByCreatorAggregator; use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\ByCreatorAggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;

View File

@@ -9,10 +9,10 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Tests\Export\Aggregator; namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Aggregator\DateAggregator; use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\DateAggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@@ -28,7 +28,7 @@ final class DateAggregatorTest extends AbstractAggregatorTest
{ {
self::bootKernel(); self::bootKernel();
$this->aggregator = self::$container->get(DateAggregator::class); $this->aggregator = self::$container->get('chill.activity.export.date_aggregator');
} }
public function getAggregator() public function getAggregator()

View File

@@ -9,10 +9,10 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Tests\Export\Aggregator; namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Aggregator\LocationTypeAggregator; use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\LocationTypeAggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@@ -28,7 +28,7 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest
{ {
self::bootKernel(); self::bootKernel();
$this->aggregator = self::$container->get(LocationTypeAggregator::class); $this->aggregator = self::$container->get('chill.activity.export.locationtype_aggregator');
} }
public function getAggregator() public function getAggregator()

View File

@@ -9,10 +9,10 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Tests\Export\Aggregator; namespace Chill\ActivityBundle\Tests\Export\Aggregator\ACPAggregators;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Aggregator\CreatorScopeAggregator; use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\CreatorScopeAggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@@ -20,7 +20,7 @@ use Doctrine\ORM\EntityManagerInterface;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
final class CreatorScopeAggregatorTest extends AbstractAggregatorTest final class UserScopeAggregatorTest extends AbstractAggregatorTest
{ {
private CreatorScopeAggregator $aggregator; private CreatorScopeAggregator $aggregator;

View File

@@ -13,10 +13,9 @@ namespace Chill\ActivityBundle\Tests\Export\Filter\ACPFilters;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Entity\ActivityType; use Chill\ActivityBundle\Entity\ActivityType;
use Chill\ActivityBundle\Export\Filter\ActivityTypeFilter; use Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter;
use Chill\MainBundle\Test\Export\AbstractFilterTest; use Chill\MainBundle\Test\Export\AbstractFilterTest;
use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Query\Expr; use Doctrine\ORM\Query\Expr;
@@ -26,13 +25,13 @@ use Doctrine\ORM\Query\Expr;
*/ */
final class ActivityTypeFilterTest extends AbstractFilterTest final class ActivityTypeFilterTest extends AbstractFilterTest
{ {
private \Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter $filter; private ActivityTypeFilter $filter;
protected function setUp(): void protected function setUp(): void
{ {
self::bootKernel(); self::bootKernel();
$this->filter = self::$container->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter::class); $this->filter = self::$container->get('chill.activity.export.filter_activitytype');
} }
public function getFilter() public function getFilter()
@@ -48,14 +47,13 @@ final class ActivityTypeFilterTest extends AbstractFilterTest
->from(ActivityType::class, 'at') ->from(ActivityType::class, 'at')
->select('at') ->select('at')
->getQuery() ->getQuery()
->setMaxResults(1)
->getResult(); ->getResult();
$data = []; $data = [];
foreach ($array as $a) { foreach ($array as $a) {
$data[] = [ $data[] = [
'accepted_activitytypes' => new ArrayCollection([$a]), 'accepted_activitytypes' => $a,
]; ];
} }

View File

@@ -12,9 +12,9 @@ declare(strict_types=1);
namespace Chill\ActivityBundle\Tests\Export\Filter\ACPFilters; namespace Chill\ActivityBundle\Tests\Export\Filter\ACPFilters;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter;
use Chill\MainBundle\Test\Export\AbstractFilterTest; use Chill\MainBundle\Test\Export\AbstractFilterTest;
use Chill\PersonBundle\Entity\SocialWork\SocialAction; use Chill\PersonBundle\Entity\SocialWork\SocialAction;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
/** /**
@@ -23,13 +23,13 @@ use Doctrine\ORM\EntityManagerInterface;
*/ */
final class BySocialActionFilterTest extends AbstractFilterTest final class BySocialActionFilterTest extends AbstractFilterTest
{ {
private \Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter $filter; private BySocialActionFilter $filter;
protected function setUp(): void protected function setUp(): void
{ {
self::bootKernel(); self::bootKernel();
$this->filter = self::$container->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter::class); $this->filter = self::$container->get('chill.activity.export.bysocialaction_filter');
} }
public function getFilter() public function getFilter()
@@ -39,22 +39,19 @@ final class BySocialActionFilterTest extends AbstractFilterTest
public function getFormData(): array public function getFormData(): array
{ {
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class); $em = self::$container->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder() $array = $em->createQueryBuilder()
->from(SocialAction::class, 'sa') ->from(SocialAction::class, 'sa')
->select('sa') ->select('sa')
->getQuery() ->getQuery()
->setMaxResults(1)
->getResult(); ->getResult();
$data = []; $data = [];
foreach ($array as $a) { foreach ($array as $a) {
$data[] = [ $data[] = [
'accepted_socialactions' => new ArrayCollection([$a]), 'accepted_socialactions' => $a,
]; ];
} }
@@ -63,7 +60,9 @@ final class BySocialActionFilterTest extends AbstractFilterTest
public function getQueryBuilders(): array public function getQueryBuilders(): array
{ {
if (null === self::$kernel) {
self::bootKernel(); self::bootKernel();
}
$em = self::$container->get(EntityManagerInterface::class); $em = self::$container->get(EntityManagerInterface::class);

View File

@@ -15,7 +15,6 @@ use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialIssueFilter; use Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialIssueFilter;
use Chill\MainBundle\Test\Export\AbstractFilterTest; use Chill\MainBundle\Test\Export\AbstractFilterTest;
use Chill\PersonBundle\Entity\SocialWork\SocialIssue; use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
/** /**
@@ -30,7 +29,7 @@ final class BySocialIssueFilterTest extends AbstractFilterTest
{ {
self::bootKernel(); self::bootKernel();
$this->filter = self::$container->get(BySocialIssueFilter::class); $this->filter = self::$container->get('chill.activity.export.bysocialissue_filter');
} }
public function getFilter() public function getFilter()
@@ -40,21 +39,19 @@ final class BySocialIssueFilterTest extends AbstractFilterTest
public function getFormData(): array public function getFormData(): array
{ {
self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class); $em = self::$container->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder() $array = $em->createQueryBuilder()
->from(SocialIssue::class, 'si') ->from(SocialIssue::class, 'si')
->select('si') ->select('si')
->getQuery() ->getQuery()
->setMaxResults(2)
->getResult(); ->getResult();
$data = []; $data = [];
foreach ($array as $a) { foreach ($array as $a) {
$data[] = [ $data[] = [
'accepted_socialissues' => new ArrayCollection([$a]), 'accepted_socialissues' => $a,
]; ];
} }

View File

@@ -9,10 +9,10 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Tests\Export\Filter; namespace Chill\ActivityBundle\Tests\Export\Filter\ACPFilters;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Filter\ByCreatorFilter; use Chill\ActivityBundle\Export\Filter\ACPFilters\ByCreatorFilter;
use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Test\Export\AbstractFilterTest; use Chill\MainBundle\Test\Export\AbstractFilterTest;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@@ -29,7 +29,7 @@ final class ByUserFilterTest extends AbstractFilterTest
{ {
self::bootKernel(); self::bootKernel();
$this->filter = self::$container->get(ByCreatorFilter::class); $this->filter = self::$container->get('chill.activity.export.byuser_filter');
} }
public function getFilter() public function getFilter()

View File

@@ -9,10 +9,10 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Tests\Export\Filter; namespace Chill\ActivityBundle\Tests\Export\Filter\ACPFilters;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Filter\EmergencyFilter; use Chill\ActivityBundle\Export\Filter\ACPFilters\EmergencyFilter;
use Chill\MainBundle\Test\Export\AbstractFilterTest; use Chill\MainBundle\Test\Export\AbstractFilterTest;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@@ -28,7 +28,7 @@ final class EmergencyFilterTest extends AbstractFilterTest
{ {
self::bootKernel(); self::bootKernel();
$this->filter = self::$container->get(EmergencyFilter::class); $this->filter = self::$container->get('chill.activity.export.emergency_filter');
} }
public function getFilter() public function getFilter()

View File

@@ -9,10 +9,10 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Tests\Export\Filter; namespace Chill\ActivityBundle\Tests\Export\Filter\ACPFilters;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Filter\LocationTypeFilter; use Chill\ActivityBundle\Export\Filter\ACPFilters\LocationTypeFilter;
use Chill\MainBundle\Entity\LocationType; use Chill\MainBundle\Entity\LocationType;
use Chill\MainBundle\Test\Export\AbstractFilterTest; use Chill\MainBundle\Test\Export\AbstractFilterTest;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@@ -29,7 +29,7 @@ final class LocationTypeFilterTest extends AbstractFilterTest
{ {
self::bootKernel(); self::bootKernel();
$this->filter = self::$container->get(LocationTypeFilter::class); $this->filter = self::$container->get('chill.activity.export.locationtype_filter');
} }
public function getFilter() public function getFilter()

View File

@@ -9,10 +9,10 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Tests\Export\Filter; namespace Chill\ActivityBundle\Tests\Export\Filter\ACPFilters;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Filter\SentReceivedFilter; use Chill\ActivityBundle\Export\Filter\ACPFilters\SentReceivedFilter;
use Chill\MainBundle\Test\Export\AbstractFilterTest; use Chill\MainBundle\Test\Export\AbstractFilterTest;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@@ -28,7 +28,7 @@ final class SentReceivedFilterTest extends AbstractFilterTest
{ {
self::bootKernel(); self::bootKernel();
$this->filter = self::$container->get(SentReceivedFilter::class); $this->filter = self::$container->get('chill.activity.export.sentreceived_filter');
} }
public function getFilter() public function getFilter()

View File

@@ -9,10 +9,10 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Tests\Export\Filter; namespace Chill\ActivityBundle\Tests\Export\Filter\ACPFilters;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Filter\UserFilter; use Chill\ActivityBundle\Export\Filter\ACPFilters\UserFilter;
use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Test\Export\AbstractFilterTest; use Chill\MainBundle\Test\Export\AbstractFilterTest;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@@ -29,7 +29,7 @@ final class UserFilterTest extends AbstractFilterTest
{ {
self::bootKernel(); self::bootKernel();
$this->filter = self::$container->get(UserFilter::class); $this->filter = self::$container->get('chill.activity.export.user_filter');
} }
public function getFilter() public function getFilter()

View File

@@ -9,10 +9,10 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Tests\Export\Filter; namespace Chill\ActivityBundle\Tests\Export\Filter\ACPFilters;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Filter\UserScopeFilter; use Chill\ActivityBundle\Export\Filter\ACPFilters\UserScopeFilter;
use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Test\Export\AbstractFilterTest; use Chill\MainBundle\Test\Export\AbstractFilterTest;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@@ -29,7 +29,7 @@ final class UserScopeFilterTest extends AbstractFilterTest
{ {
self::bootKernel(); self::bootKernel();
$this->filter = self::$container->get(UserScopeFilter::class); $this->filter = self::$container->get('chill.activity.export.userscope_filter');
} }
public function getFilter() public function getFilter()

View File

@@ -29,7 +29,7 @@ final class ActivityDateFilterTest extends AbstractFilterTest
{ {
self::bootKernel(); self::bootKernel();
$this->filter = self::$container->get(ActivityDateFilter::class); $this->filter = self::$container->get('chill.activity.export.date_filter');
} }
public function getFilter() public function getFilter()

View File

@@ -54,7 +54,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest
$data[] = [ $data[] = [
'date_from' => DateTime::createFromFormat('Y-m-d', '2021-07-01'), 'date_from' => DateTime::createFromFormat('Y-m-d', '2021-07-01'),
'date_to' => DateTime::createFromFormat('Y-m-d', '2022-07-01'), 'date_to' => DateTime::createFromFormat('Y-m-d', '2022-07-01'),
'reasons' => [$a], 'reasons' => $a,
]; ];
} }
@@ -72,9 +72,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()
->select('count(activity.id)') ->select('count(activity.id)')
->from(Activity::class, 'activity') ->from(Activity::class, 'activity'),
->join('activity.person', 'person')
,
]; ];
} }
} }

View File

@@ -122,4 +122,5 @@ class ActivityDocumentACLAwareRepositoryTest extends KernelTestCase
yield [$person, $scopes, true, null, new \DateTimeImmutable("1 week ago"), "content"]; yield [$person, $scopes, true, null, new \DateTimeImmutable("1 week ago"), "content"];
yield [$person, [], true, new \DateTimeImmutable("1 month ago"), new \DateTimeImmutable("1 week ago"), "content"]; yield [$person, [], true, new \DateTimeImmutable("1 month ago"), new \DateTimeImmutable("1 week ago"), "content"];
} }
} }

View File

@@ -53,7 +53,8 @@ services:
tags: tags:
- { name: chill.export_filter, alias: 'activity_type_filter' } - { name: chill.export_filter, alias: 'activity_type_filter' }
Chill\ActivityBundle\Export\Filter\ActivityDateFilter: chill.activity.export.date_filter:
class: Chill\ActivityBundle\Export\Filter\ActivityDateFilter
tags: tags:
- { name: chill.export_filter, alias: 'activity_date_filter' } - { name: chill.export_filter, alias: 'activity_date_filter' }
@@ -73,43 +74,52 @@ services:
name: chill.export_filter name: chill.export_filter
alias: 'activity_person_having_ac_bw_date_filter' alias: 'activity_person_having_ac_bw_date_filter'
Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter: chill.activity.export.filter_activitytype:
class: Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter
tags: tags:
- { name: chill.export_filter, alias: 'accompanyingcourse_activitytype_filter' } - { name: chill.export_filter, alias: 'accompanyingcourse_activitytype_filter' }
Chill\ActivityBundle\Export\Filter\LocationFilter: chill.activity.export.location_filter:
class: Chill\ActivityBundle\Export\Filter\ACPFilters\LocationFilter
tags: tags:
- { name: chill.export_filter, alias: 'activity_location_filter' } - { name: chill.export_filter, alias: 'activity_location_filter' }
Chill\ActivityBundle\Export\Filter\LocationTypeFilter: chill.activity.export.locationtype_filter:
class: Chill\ActivityBundle\Export\Filter\ACPFilters\LocationTypeFilter
tags: tags:
- { name: chill.export_filter, alias: 'activity_locationtype_filter' } - { name: chill.export_filter, alias: 'activity_locationtype_filter' }
Chill\ActivityBundle\Export\Filter\ByCreatorFilter: Chill\ActivityBundle\Export\Filter\ACPFilters\ByCreatorFilter:
tags: tags:
- { name: chill.export_filter, alias: 'activity_bycreator_filter' } - { name: chill.export_filter, alias: 'activity_bycreator_filter' }
Chill\ActivityBundle\Export\Filter\EmergencyFilter: chill.activity.export.emergency_filter:
class: Chill\ActivityBundle\Export\Filter\ACPFilters\EmergencyFilter
tags: tags:
- { name: chill.export_filter, alias: 'activity_emergency_filter' } - { name: chill.export_filter, alias: 'activity_emergency_filter' }
Chill\ActivityBundle\Export\Filter\SentReceivedFilter: chill.activity.export.sentreceived_filter:
class: Chill\ActivityBundle\Export\Filter\ACPFilters\SentReceivedFilter
tags: tags:
- { name: chill.export_filter, alias: 'activity_sentreceived_filter' } - { name: chill.export_filter, alias: 'activity_sentreceived_filter' }
Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter: chill.activity.export.bysocialaction_filter:
class: Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter
tags: tags:
- { name: chill.export_filter, alias: 'activity_bysocialaction_filter' } - { name: chill.export_filter, alias: 'activity_bysocialaction_filter' }
Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialIssueFilter: chill.activity.export.bysocialissue_filter:
class: Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialIssueFilter
tags: tags:
- { name: chill.export_filter, alias: 'activity_bysocialissue_filter' } - { name: chill.export_filter, alias: 'activity_bysocialissue_filter' }
Chill\ActivityBundle\Export\Filter\UserFilter: chill.activity.export.user_filter: # Creator (M2O)
class: Chill\ActivityBundle\Export\Filter\ACPFilters\UserFilter
tags: tags:
- { name: chill.export_filter, alias: 'activity_user_filter' } - { name: chill.export_filter, alias: 'activity_user_filter' }
Chill\ActivityBundle\Export\Filter\UserScopeFilter: chill.activity.export.userscope_filter:
class: Chill\ActivityBundle\Export\Filter\ACPFilters\UserScopeFilter
tags: tags:
- { name: chill.export_filter, alias: 'activity_userscope_filter' } - { name: chill.export_filter, alias: 'activity_userscope_filter' }
@@ -147,19 +157,22 @@ services:
tags: tags:
- { name: chill.export_aggregator, alias: activity_user_aggregator } - { name: chill.export_aggregator, alias: activity_user_aggregator }
Chill\ActivityBundle\Export\Aggregator\LocationTypeAggregator: chill.activity.export.locationtype_aggregator:
class: Chill\ActivityBundle\Export\Aggregator\ACPAggregators\LocationTypeAggregator
tags: tags:
- { name: chill.export_aggregator, alias: activity_locationtype_aggregator } - { name: chill.export_aggregator, alias: activity_locationtype_aggregator }
Chill\ActivityBundle\Export\Aggregator\DateAggregator: chill.activity.export.date_aggregator:
class: Chill\ActivityBundle\Export\Aggregator\ACPAggregators\DateAggregator
tags: tags:
- { name: chill.export_aggregator, alias: activity_date_aggregator } - { name: chill.export_aggregator, alias: activity_date_aggregator }
Chill\ActivityBundle\Export\Aggregator\ByCreatorAggregator: Chill\ActivityBundle\Export\Aggregator\ACPAggregators\ByCreatorAggregator:
tags: tags:
- { name: chill.export_aggregator, alias: activity_by_creator_aggregator } - { name: chill.export_aggregator, alias: activity_by_creator_aggregator }
Chill\ActivityBundle\Export\Aggregator\ByThirdpartyAggregator: chill.activity.export.bythirdparty_aggregator:
class: Chill\ActivityBundle\Export\Aggregator\ACPAggregators\ByThirdpartyAggregator
tags: tags:
- { name: chill.export_aggregator, alias: activity_bythirdparty_aggregator } - { name: chill.export_aggregator, alias: activity_bythirdparty_aggregator }
@@ -173,7 +186,7 @@ services:
tags: tags:
- { name: chill.export_aggregator, alias: activity_bysocialissue_aggregator } - { name: chill.export_aggregator, alias: activity_bysocialissue_aggregator }
Chill\ActivityBundle\Export\Aggregator\CreatorScopeAggregator: Chill\ActivityBundle\Export\Aggregator\ACPAggregators\CreatorScopeAggregator:
tags: tags:
- { name: chill.export_aggregator, alias: activity_creator_scope_aggregator } - { name: chill.export_aggregator, alias: activity_creator_scope_aggregator }

View File

@@ -3,9 +3,3 @@ export:
activity: activity:
course_having_activity_between_date: course_having_activity_between_date:
Only course having an activity between from and to: Seulement les parcours ayant reçu au moins un échange entre le {from, date, short} et le {to, date, short} Only course having an activity between from and to: Seulement les parcours ayant reçu au moins un échange entre le {from, date, short} et le {to, date, short}
person_between_dates:
describe_action_with_no_subject: >-
Filtré par personne ayant eu un échange entre le {date_from, date} et le {date_to, date}
describe_action_with_subject: >-
Filtré par personne ayant eu un échange entre le {date_from, date} et le {date_to, date}, et un de ces sujets choisis: {reasons}

View File

@@ -255,6 +255,11 @@ Activities before this date: Échanges avant cette date
"Filtered by date of activity: only between %date_from% and %date_to%": "Filtré par date de l'échange: uniquement entre %date_from% et %date_to%" "Filtered by date of activity: only between %date_from% and %date_to%": "Filtré par date de l'échange: uniquement entre %date_from% et %date_to%"
This date should be after the date given in "Implied in an activity after this date" field: Cette date devrait être postérieure à la date donnée dans le champ "échanges après cette date" This date should be after the date given in "Implied in an activity after this date" field: Cette date devrait être postérieure à la date donnée dans le champ "échanges après cette date"
Filtered by person having an activity in a period: Uniquement les usagers ayant eu un échange dans la période donnée
Implied in an activity after this date: Impliqué dans un échange après cette date
Implied in an activity before this date: Impliqué dans un échange avant cette date
Filtered by person having an activity between %date_from% and %date_to% with reasons %reasons_name%: Filtré par usager associées à un échange entre %date_from% et %date_to% avec les sujets %reasons_name%
Activity reasons for those activities: Sujets de ces échanges
Filter by activity type: Filtrer les échanges par type Filter by activity type: Filtrer les échanges par type
@@ -372,15 +377,7 @@ export:
Title: Filtre les parcours ayant reçu un échange entre deux dates Title: Filtre les parcours ayant reçu un échange entre deux dates
Receiving an activity after: Ayant reçu un échange après le Receiving an activity after: Ayant reçu un échange après le
Receiving an activity before: Ayant reçu un échange avant le Receiving an activity before: Ayant reçu un échange avant le
acp_by_activity_type:
'acp_containing_at_least_one_%activitytypes%': 'Parcours filtrés: uniquement ceux qui contiennent au moins un échange d''un des types suivants: %activitytypes%'
person_between_dates:
Implied in an activity after this date: Impliqué dans un échange après cette date
Implied in an activity before this date: Impliqué dans un échange avant cette date
Activity reasons for those activities: Sujets de ces échanges
if no reasons: Si aucun sujet n'est coché, tous les sujets seront pris en compte
title: Filtrer les personnes ayant été associés à un échange au cours de la période
date mismatch: La date de fin de la période doit être supérieure à la date du début
aggregator: aggregator:
activity: activity:

View File

@@ -13,4 +13,6 @@ namespace Chill\AsideActivityBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\HttpKernel\Bundle\Bundle;
class ChillAsideActivityBundle extends Bundle {} class ChillAsideActivityBundle extends Bundle
{
}

View File

@@ -33,7 +33,6 @@ final class AsideActivityController extends CRUDController
$asideActivity = new AsideActivity(); $asideActivity = new AsideActivity();
$asideActivity->setAgent($this->getUser()); $asideActivity->setAgent($this->getUser());
$asideActivity->setLocation($this->getUser()->getCurrentLocation());
$duration = $request->query->get('duration', '300'); $duration = $request->query->get('duration', '300');
$duration = DateTime::createFromFormat('U', $duration); $duration = DateTime::createFromFormat('U', $duration);

View File

@@ -14,7 +14,6 @@ namespace Chill\AsideActivityBundle\Entity;
use Chill\MainBundle\Doctrine\Model\TrackCreationInterface; use Chill\MainBundle\Doctrine\Model\TrackCreationInterface;
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface; use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\Location;
use DateTimeInterface; use DateTimeInterface;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
@@ -61,10 +60,9 @@ class AsideActivity implements TrackCreationInterface, TrackUpdateInterface
private ?int $id = null; private ?int $id = null;
/** /**
* @ORM\ManyToOne(targetEntity=Location::class) * @ORM\Column(type="string", length=100, nullable=true)
* @ORM\JoinColumn(nullable=true)
*/ */
private ?Location $location = null; private $location;
/** /**
* @ORM\Column(type="text", nullable=true) * @ORM\Column(type="text", nullable=true)
@@ -117,7 +115,7 @@ class AsideActivity implements TrackCreationInterface, TrackUpdateInterface
return $this->id; return $this->id;
} }
public function getLocation(): ?Location public function getLocation(): ?string
{ {
return $this->location; return $this->location;
} }
@@ -177,7 +175,7 @@ class AsideActivity implements TrackCreationInterface, TrackUpdateInterface
return $this; return $this;
} }
public function setLocation(?Location $location): self public function setLocation(?string $location): self
{ {
$this->location = $location; $this->location = $location;

View File

@@ -1,98 +0,0 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AsideActivityBundle\Export\Aggregator;
use Chill\AsideActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\MainBundle\Repository\LocationRepository;
use Closure;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
class ByLocationAggregator implements AggregatorInterface
{
public function __construct(private LocationRepository $locationRepository) {}
/**
* @inheritDoc
*/
public function buildForm(FormBuilderInterface $builder): void
{
// no form
}
/**
* @inheritDoc
*/
public function getFormDefaultData(): array
{
return [];
}
/**
* @inheritDoc
*/
public function getLabels($key, array $values, $data)
{
return function ($value): string {
if ('_header' === $value) {
return 'export.aggregator.Aside activity localisation';
}
if (null === $value || '' === $value || null === $l = $this->locationRepository->find($value)) {
return '';
}
return $l->getName();
};
}
/**
* @inheritDoc
*/
public function getQueryKeys($data): array
{
return ['by_aside_activity_location_aggregator'];
}
/**
* @inheritDoc
*/
public function getTitle(): string
{
return 'export.aggregator.Group by aside activity location';
}
/**
* @inheritDoc
*/
public function addRole(): ?string
{
return null;
}
/**
* @inheritDoc
*/
public function alterQuery(QueryBuilder $qb, $data): void
{
$qb->addSelect('IDENTITY(aside.location) AS by_aside_activity_location_aggregator')
->addGroupBy('by_aside_activity_location_aggregator');
}
/**
* @inheritDoc
*/
public function applyOn(): string
{
return Declarations::ASIDE_ACTIVITY_TYPE;
}
}

View File

@@ -31,7 +31,9 @@ class AvgAsideActivityDuration implements ExportInterface, GroupedExportInterfac
$this->repository = $repository; $this->repository = $repository;
} }
public function buildForm(FormBuilderInterface $builder) {} public function buildForm(FormBuilderInterface $builder)
{
}
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];

View File

@@ -31,7 +31,9 @@ class CountAsideActivity implements ExportInterface, GroupedExportInterface
$this->repository = $repository; $this->repository = $repository;
} }
public function buildForm(FormBuilderInterface $builder) {} public function buildForm(FormBuilderInterface $builder)
{
}
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];

View File

@@ -23,7 +23,6 @@ use Chill\MainBundle\Export\Helper\DateTimeHelper;
use Chill\MainBundle\Export\Helper\UserHelper; use Chill\MainBundle\Export\Helper\UserHelper;
use Chill\MainBundle\Export\ListInterface; use Chill\MainBundle\Export\ListInterface;
use Chill\MainBundle\Repository\CenterRepositoryInterface; use Chill\MainBundle\Repository\CenterRepositoryInterface;
use Chill\MainBundle\Repository\LocationRepository;
use Chill\MainBundle\Repository\ScopeRepositoryInterface; use Chill\MainBundle\Repository\ScopeRepositoryInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface; use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use DateTimeInterface; use DateTimeInterface;
@@ -59,7 +58,6 @@ final class ListAsideActivity implements ListInterface, GroupedExportInterface
CenterRepositoryInterface $centerRepository, CenterRepositoryInterface $centerRepository,
AsideActivityCategoryRepository $asideActivityCategoryRepository, AsideActivityCategoryRepository $asideActivityCategoryRepository,
CategoryRender $categoryRender, CategoryRender $categoryRender,
private LocationRepository $locationRepository,
TranslatableStringHelperInterface $translatableStringHelper TranslatableStringHelperInterface $translatableStringHelper
) { ) {
$this->em = $em; $this->em = $em;
@@ -72,8 +70,9 @@ final class ListAsideActivity implements ListInterface, GroupedExportInterface
$this->translatableStringHelper = $translatableStringHelper; $this->translatableStringHelper = $translatableStringHelper;
} }
public function buildForm(FormBuilderInterface $builder) {} public function buildForm(FormBuilderInterface $builder)
{
}
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];
@@ -146,19 +145,6 @@ final class ListAsideActivity implements ListInterface, GroupedExportInterface
return $this->categoryRender->renderString($c, []); return $this->categoryRender->renderString($c, []);
}; };
case 'location':
return function ($value) {
if ('_header' === $value) {
return 'export.aside_activity.location';
}
if (null === $value || '' === $value || null === $l = $this->locationRepository->find($value)) {
return '';
}
return $l->getName();
};
case 'main_scope': case 'main_scope':
return function ($value) { return function ($value) {
if ('_header' === $value) { if ('_header' === $value) {
@@ -205,7 +191,6 @@ final class ListAsideActivity implements ListInterface, GroupedExportInterface
'date', 'date',
'duration', 'duration',
'note', 'note',
'location',
]; ];
} }
@@ -241,7 +226,6 @@ final class ListAsideActivity implements ListInterface, GroupedExportInterface
->addSelect('IDENTITY(aside.type) AS aside_activity_type') ->addSelect('IDENTITY(aside.type) AS aside_activity_type')
->addSelect('aside.date') ->addSelect('aside.date')
->addSelect('aside.duration') ->addSelect('aside.duration')
->addSelect('IDENTITY(aside.location) AS location')
->addSelect('aside.note'); ->addSelect('aside.note');
return $qb; return $qb;

View File

@@ -31,7 +31,9 @@ class SumAsideActivityDuration implements ExportInterface, GroupedExportInterfac
$this->repository = $repository; $this->repository = $repository;
} }
public function buildForm(FormBuilderInterface $builder) {} public function buildForm(FormBuilderInterface $builder)
{
}
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [];

View File

@@ -1,104 +0,0 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AsideActivityBundle\Export\Filter;
use Chill\AsideActivityBundle\Export\Declarations;
use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Form\Type\PickUserLocationType;
use Chill\MainBundle\Repository\LocationRepository;
use Doctrine\ORM\QueryBuilder;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Security;
final readonly class ByLocationFilter implements FilterInterface
{
public function __construct(
private Security $security
) {}
/**
* @inheritDoc
*/
public function getTitle(): string
{
return 'export.filter.Filter by aside activity location';
}
/**
* @inheritDoc
*/
public function buildForm(FormBuilderInterface $builder): void
{
$builder
->add('locations', PickUserLocationType::class);
}
/**
* @inheritDoc
*/
public function getFormDefaultData(): array
{
$user = $this->security->getUser();
if ($user instanceof User) {
return [
'locations' => $user->getCurrentLocation(),
];
}
return [
'locations' => null,
];
}
/**
* @inheritDoc
*/
public function describeAction($data, $format = 'string'): array
{
$locations = $data['locations']->map(fn (Location $l): string => $l->getName());
return ['export.filter.Filtered by aside activity location: only %location%', [
'%location%' => implode(', ', $locations),
]];
}
/**
* @inheritDoc
*/
public function addRole(): ?string
{
return null;
}
/**
* @inheritDoc
*/
public function alterQuery(QueryBuilder $qb, $data): void
{
$clause = $qb->expr()->in('aside.location', ':locations');
$qb->andWhere($clause);
$qb->setParameter('locations', $data['locations']);
}
/**
* @inheritDoc
*/
public function applyOn(): string
{
return Declarations::ASIDE_ACTIVITY_TYPE;
}
}

View File

@@ -13,16 +13,13 @@ namespace Chill\AsideActivityBundle\Form;
use Chill\AsideActivityBundle\Entity\AsideActivity; use Chill\AsideActivityBundle\Entity\AsideActivity;
use Chill\AsideActivityBundle\Form\Type\PickAsideActivityCategoryType; use Chill\AsideActivityBundle\Form\Type\PickAsideActivityCategoryType;
use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Form\Type\ChillTextareaType; use Chill\MainBundle\Form\Type\ChillTextareaType;
use Chill\MainBundle\Form\Type\PickUserDynamicType; use Chill\MainBundle\Form\Type\PickUserDynamicType;
use Chill\MainBundle\Form\Type\PickUserLocationType;
use DateInterval; use DateInterval;
use DateTime; use DateTime;
use DateTimeImmutable; use DateTimeImmutable;
use DateTimeZone; use DateTimeZone;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTransformer; use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTransformer;
@@ -80,9 +77,7 @@ final class AsideActivityFormType extends AbstractType
->add('note', ChillTextareaType::class, [ ->add('note', ChillTextareaType::class, [
'label' => 'Note', 'label' => 'Note',
'required' => false, 'required' => false,
]) ]);
->add('location', PickUserLocationType::class)
;
foreach (['duration'] as $fieldName) { foreach (['duration'] as $fieldName) {
$builder->get($fieldName) $builder->get($fieldName)

View File

@@ -39,9 +39,6 @@
</span> </span>
{% endif %} {% endif %}
</div> </div>
{%- if entity.location.name is defined -%}
<div><i class="fa fa-fw fa-map-marker"></i>{{ entity.location.name }}</div>
{%- endif -%}
</div> </div>
<div class="item-col" style="justify-content: flex-end;"> <div class="item-col" style="justify-content: flex-end;">
<div class="box"> <div class="box">

View File

@@ -23,13 +23,6 @@
<dt class="inline">{{ 'Created for'|trans }}</dt> <dt class="inline">{{ 'Created for'|trans }}</dt>
<dd>{{ entity.agent }}</dd> <dd>{{ entity.agent }}</dd>
<dt class="inline">{{ 'Asideactivity location'|trans }}</dt>
{%- if entity.location.name is defined -%}
<dd>{{ entity.location.name }}</dd>
{%- else -%}
<dd><span class="chill-no-data-statement">{{ 'No data given'|trans }}</span></dd>
{%- endif -%}
<h2 class="chill-red">{{ 'Activity data'|trans }}</h2> <h2 class="chill-red">{{ 'Activity data'|trans }}</h2>
<dt class="inline">{{ 'Date'|trans }}</dt> <dt class="inline">{{ 'Date'|trans }}</dt>

View File

@@ -46,27 +46,19 @@ services:
tags: tags:
- { name: chill.export_filter, alias: 'aside_activity_user_filter' } - { name: chill.export_filter, alias: 'aside_activity_user_filter' }
Chill\AsideActivityBundle\Export\Filter\ByLocationFilter:
tags:
- { name: chill.export_filter, alias: 'aside_activity_location_filter' }
## Aggregators ## Aggregators
chill.aside_activity.export.type_aggregator: chill.aside_activity.export.type_aggregator:
class: Chill\AsideActivityBundle\Export\Aggregator\ByActivityTypeAggregator class: Chill\AsideActivityBundle\Export\Aggregator\ByActivityTypeAggregator
tags: tags:
- { name: chill.export_aggregator, alias: 'activity_type_aggregator' } - { name: chill.export_aggregator, alias: activity_type_aggregator }
chill.aside_activity.export.user_job_aggregator: chill.aside_activity.export.user_job_aggregator:
class: Chill\AsideActivityBundle\Export\Aggregator\ByUserJobAggregator class: Chill\AsideActivityBundle\Export\Aggregator\ByUserJobAggregator
tags: tags:
- { name: chill.export_aggregator, alias: 'aside_activity_user_job_aggregator' } - { name: chill.export_aggregator, alias: aside_activity_user_job_aggregator }
chill.aside_activity.export.user_scope_aggregator: chill.aside_activity.export.user_scope_aggregator:
class: Chill\AsideActivityBundle\Export\Aggregator\ByUserScopeAggregator class: Chill\AsideActivityBundle\Export\Aggregator\ByUserScopeAggregator
tags: tags:
- { name: chill.export_aggregator, alias: 'aside_activity_user_scope_aggregator' } - { name: chill.export_aggregator, alias: aside_activity_user_scope_aggregator }
Chill\AsideActivityBundle\Export\Aggregator\ByLocationAggregator:
tags:
- { name: chill.export_aggregator, alias: 'aside_activity_location_aggregator' }

View File

@@ -1,39 +0,0 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\Migrations\AsideActivity;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230816112809 extends AbstractMigration
{
public function getDescription(): string
{
return 'Update location attribute in asideactivity';
}
public function down(Schema $schema): void
{
$this->addSql('DROP INDEX chill_asideactivity.IDX_A866DA0E64D218E');
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity DROP CONSTRAINT FK_A866DA0E64D218E');
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity DROP location_id');
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ADD location VARCHAR(100) DEFAULT NULL');
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_asideactivity.asideactivity ADD location_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_asideactivity.asideactivity DROP location');
$this->addSql('ALTER TABLE chill_asideactivity.asideactivity ADD CONSTRAINT FK_A866DA0E64D218E FOREIGN KEY (location_id) REFERENCES chill_main_location (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_A866DA0E64D218E ON chill_asideactivity.asideactivity (location_id)');
}
}

View File

@@ -26,7 +26,6 @@ Users: Utilisateurs
Emergency: Urgent Emergency: Urgent
by: "Par " by: "Par "
location: Lieu location: Lieu
Asideactivity location: Localisation de l'activité
# Crud # Crud
crud: crud:
@@ -183,7 +182,6 @@ export:
duration: Durée duration: Durée
note: Note note: Note
id: Identifiant id: Identifiant
location: Localisation
Exports of aside activities: Exports des activités annexes Exports of aside activities: Exports des activités annexes
Count aside activities: Nombre d'activités annexes Count aside activities: Nombre d'activités annexes
@@ -204,16 +202,11 @@ export:
Filter by user jobs: Filtrer les activités annexes par métier des utilisateurs Filter by user jobs: Filtrer les activités annexes par métier des utilisateurs
'Filtered aside activities by user scope: only %scopes%': "Filtré par service des utilisateur: uniquement %scopes%" 'Filtered aside activities by user scope: only %scopes%': "Filtré par service des utilisateur: uniquement %scopes%"
Filter by user scope: Filtrer les activités annexes par service d'utilisateur Filter by user scope: Filtrer les activités annexes par service d'utilisateur
Filter by aside activity location: Filtrer les activités annexes par localisation
'Filtered by aside activity location: only %location%': "Filtré par localisation: uniquement %location%"
aggregator: aggregator:
Group by aside activity type: Grouper les activités annexes par type d'activité Group by aside activity type: Grouper les activités annexes par type d'activité
Aside activity type: Type d'activité annexe Aside activity type: Type d'activité annexe
Aggregate by user job: Grouper les activités annexes par métier des utilisateurs Aggregate by user job: Grouper les activités annexes par métier des utilisateurs
Aggregate by user scope: Grouper les activités annexes par service des utilisateurs Aggregate by user scope: Grouper les activités annexes par service des utilisateurs
Aside activity location: Localisation des activités annexe
Group by aside activity location: Grouper les activités annexes par localisation
Aside activity localisation: Localisation
# ROLES # ROLES
CHILL_ASIDE_ACTIVITY_STATS: Statistiques pour les activités annexes CHILL_ASIDE_ACTIVITY_STATS: Statistiques pour les activités annexes

View File

@@ -29,11 +29,11 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class CalendarRangeFilter implements FilterInterface class CalendarRangeFilter implements FilterInterface
{ {
private const CHOICES = [ private const CHOICES = [
'Not made within a calendar range' => 'true', 'Not made within a calendar range' => true,
'Made within a calendar range' => 'false', 'Made within a calendar range' => false,
]; ];
private const DEFAULT_CHOICE = 'false'; private const DEFAULT_CHOICE = false;
private TranslatorInterface $translator; private TranslatorInterface $translator;

View File

@@ -28,7 +28,8 @@ final readonly class MSUserAbsenceReader implements MSUserAbsenceReaderInterface
private HttpClientInterface $machineHttpClient, private HttpClientInterface $machineHttpClient,
private MapCalendarToUser $mapCalendarToUser, private MapCalendarToUser $mapCalendarToUser,
private ClockInterface $clock, private ClockInterface $clock,
) {} ) {
}
/** /**
* @throw UserAbsenceSyncException when the data cannot be reached or is not valid from microsoft * @throw UserAbsenceSyncException when the data cannot be reached or is not valid from microsoft
@@ -64,4 +65,5 @@ final readonly class MSUserAbsenceReader implements MSUserAbsenceReaderInterface
default => throw new UserAbsenceSyncException("this status is not documented by Microsoft") default => throw new UserAbsenceSyncException("this status is not documented by Microsoft")
}; };
} }
} }

View File

@@ -21,7 +21,8 @@ readonly class MSUserAbsenceSync
private MSUserAbsenceReaderInterface $absenceReader, private MSUserAbsenceReaderInterface $absenceReader,
private ClockInterface $clock, private ClockInterface $clock,
private LoggerInterface $logger, private LoggerInterface $logger,
) {} ) {
}
public function syncUserAbsence(User $user): void public function syncUserAbsence(User $user): void
{ {

View File

@@ -48,13 +48,23 @@ class NullRemoteCalendarConnector implements RemoteCalendarConnectorInterface
return []; return [];
} }
public function removeCalendar(string $remoteId, array $remoteAttributes, User $user, ?CalendarRange $associatedCalendarRange = null): void {} public function removeCalendar(string $remoteId, array $remoteAttributes, User $user, ?CalendarRange $associatedCalendarRange = null): void
{
public function removeCalendarRange(string $remoteId, array $remoteAttributes, User $user): void {} }
public function syncCalendar(Calendar $calendar, string $action, ?CalendarRange $previousCalendarRange, ?User $previousMainUser, ?array $oldInvites, ?array $newInvites): void {} public function removeCalendarRange(string $remoteId, array $remoteAttributes, User $user): void
{
public function syncCalendarRange(CalendarRange $calendarRange): void {} }
public function syncInvite(Invite $invite): void {} public function syncCalendar(Calendar $calendar, string $action, ?CalendarRange $previousCalendarRange, ?User $previousMainUser, ?array $oldInvites, ?array $newInvites): void
{
}
public function syncCalendarRange(CalendarRange $calendarRange): void
{
}
public function syncInvite(Invite $invite): void
{
}
} }

View File

@@ -23,4 +23,6 @@ use Symfony\Component\Form\FormBuilderInterface;
* @extends DocGeneratorContextWithPublicFormInterface<Calendar> * @extends DocGeneratorContextWithPublicFormInterface<Calendar>
* @extends DocGeneratorContextWithAdminFormInterface<Calendar> * @extends DocGeneratorContextWithAdminFormInterface<Calendar>
*/ */
interface CalendarContextInterface extends DocGeneratorContextWithPublicFormInterface, DocGeneratorContextWithAdminFormInterface {} interface CalendarContextInterface extends DocGeneratorContextWithPublicFormInterface, DocGeneratorContextWithAdminFormInterface
{
}

View File

@@ -39,7 +39,8 @@ final readonly class AccompanyingPeriodCalendarGenericDocProvider implements Gen
public function __construct( public function __construct(
private Security $security, private Security $security,
private EntityManagerInterface $em private EntityManagerInterface $em
) {} ) {
}
/** /**
* @throws MappingException * @throws MappingException
@@ -146,9 +147,6 @@ final readonly class AccompanyingPeriodCalendarGenericDocProvider implements Gen
return $query; return $query;
} }
$query->addWhereClause(implode(" OR ", $or), $orParams, $orTypes);
return $this->addWhereClausesToQuery($query, $startDate, $endDate, $content); return $this->addWhereClausesToQuery($query, $startDate, $endDate, $content);
} }
@@ -189,4 +187,6 @@ final readonly class AccompanyingPeriodCalendarGenericDocProvider implements Gen
return $query; return $query;
} }
} }

View File

@@ -39,7 +39,8 @@ final readonly class PersonCalendarGenericDocProvider implements GenericDocForPe
public function __construct( public function __construct(
private Security $security, private Security $security,
private EntityManagerInterface $em private EntityManagerInterface $em
) {} ) {
}
private function addWhereClausesToQuery(FetchQuery $query, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery private function addWhereClausesToQuery(FetchQuery $query, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery
{ {

View File

@@ -172,4 +172,5 @@ class MSUserAbsenceReaderTest extends TestCase
"User is absent: absence is always enabled" "User is absent: absence is always enabled"
]; ];
} }
} }

View File

@@ -16,7 +16,9 @@ use Symfony\Component\Form\FormBuilderInterface;
class CustomFieldsTitleType extends AbstractType class CustomFieldsTitleType extends AbstractType
{ {
public function buildForm(FormBuilderInterface $builder, array $options) {} public function buildForm(FormBuilderInterface $builder, array $options)
{
}
public function getBlockPrefix() public function getBlockPrefix()
{ {

View File

@@ -31,7 +31,8 @@ final readonly class GenericDocForAccompanyingPeriodController
private PaginatorFactory $paginator, private PaginatorFactory $paginator,
private Security $security, private Security $security,
private EngineInterface $twig, private EngineInterface $twig,
) {} ) {
}
/** /**
* @param AccompanyingPeriod $accompanyingPeriod * @param AccompanyingPeriod $accompanyingPeriod
@@ -93,4 +94,5 @@ final readonly class GenericDocForAccompanyingPeriodController
] ]
)); ));
} }
} }

View File

@@ -30,7 +30,8 @@ final readonly class GenericDocForPerson
private PaginatorFactory $paginator, private PaginatorFactory $paginator,
private Security $security, private Security $security,
private EngineInterface $twig, private EngineInterface $twig,
) {} ) {
}
/** /**
* @throws \Doctrine\DBAL\Exception * @throws \Doctrine\DBAL\Exception
@@ -90,4 +91,5 @@ final readonly class GenericDocForPerson
] ]
)); ));
} }
} }

View File

@@ -28,13 +28,6 @@ class AccompanyingCourseDocument extends Document implements HasScopesInterface,
*/ */
private ?AccompanyingPeriod $course = null; private ?AccompanyingPeriod $course = null;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private ?int $id = null;
public function getCenters(): ?iterable public function getCenters(): ?iterable
{ {
return $this->course->getCenters(); return $this->course->getCenters();
@@ -45,11 +38,6 @@ class AccompanyingCourseDocument extends Document implements HasScopesInterface,
return $this->course; return $this->course;
} }
public function getId()
{
return $this->id;
}
public function getScopes(): iterable public function getScopes(): iterable
{ {
if (null === $this->course) { if (null === $this->course) {
@@ -65,5 +53,4 @@ class AccompanyingCourseDocument extends Document implements HasScopesInterface,
return $this; return $this;
} }
} }

View File

@@ -49,6 +49,13 @@ class Document implements TrackCreationInterface, TrackUpdateInterface
*/ */
private $description = ''; private $description = '';
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/** /**
* @ORM\ManyToOne( * @ORM\ManyToOne(
* targetEntity="Chill\DocStoreBundle\Entity\StoredObject", * targetEntity="Chill\DocStoreBundle\Entity\StoredObject",
@@ -96,6 +103,11 @@ class Document implements TrackCreationInterface, TrackUpdateInterface
return $this->description; return $this->description;
} }
public function getId()
{
return $this->id;
}
public function getObject(): ?StoredObject public function getObject(): ?StoredObject
{ {
return $this->object; return $this->object;

View File

@@ -23,13 +23,6 @@ use Doctrine\ORM\Mapping as ORM;
*/ */
class PersonDocument extends Document implements HasCenterInterface, HasScopeInterface class PersonDocument extends Document implements HasCenterInterface, HasScopeInterface
{ {
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private ?int $id = null;
/** /**
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person") * @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person")
*/ */
@@ -47,11 +40,6 @@ class PersonDocument extends Document implements HasCenterInterface, HasScopeInt
return $this->getPerson()->getCenter(); return $this->getPerson()->getCenter();
} }
public function getId()
{
return $this->id;
}
public function getPerson(): Person public function getPerson(): Person
{ {
return $this->person; return $this->person;

View File

@@ -54,7 +54,8 @@ class FetchQuery implements FetchQueryInterface
private array $selectIdentifierTypes = [], private array $selectIdentifierTypes = [],
private array $selectDateParams = [], private array $selectDateParams = [],
private array $selectDateTypes = [], private array $selectDateTypes = [],
) {} ) {
}
public function addJoinClause(string $sql, array $params = [], array $types = []): int public function addJoinClause(string $sql, array $params = [], array $types = []): int
{ {
@@ -81,6 +82,7 @@ class FetchQuery implements FetchQueryInterface
} }
unset($this->wheres[$index], $this->whereParams[$index], $this->whereTypes[$index]); unset($this->wheres[$index], $this->whereParams[$index], $this->whereTypes[$index]);
} }
public function removeJoinClause(int $index): void public function removeJoinClause(int $index): void
@@ -90,6 +92,7 @@ class FetchQuery implements FetchQueryInterface
} }
unset($this->joins[$index], $this->joinParams[$index], $this->joinTypes[$index]); unset($this->joins[$index], $this->joinParams[$index], $this->joinTypes[$index]);
} }
public function getSelectKeyString(): string public function getSelectKeyString(): string

View File

@@ -21,7 +21,8 @@ final readonly class GenericDocDTO
public array $identifiers, public array $identifiers,
public \DateTimeImmutable $docDate, public \DateTimeImmutable $docDate,
public AccompanyingPeriod|Person $linked, public AccompanyingPeriod|Person $linked,
) {} ) {
}
public function getContext(): string public function getContext(): string
{ {

View File

@@ -27,4 +27,5 @@ interface GenericDocForAccompanyingPeriodProviderInterface
* Return true if the user is allowed to see some documents for this provider. * Return true if the user is allowed to see some documents for this provider.
*/ */
public function isAllowedForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod): bool; public function isAllowedForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod): bool;
} }

View File

@@ -32,7 +32,8 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen
public function __construct( public function __construct(
private Security $security, private Security $security,
private EntityManagerInterface $entityManager, private EntityManagerInterface $entityManager,
) {} ) {
}
public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
{ {
@@ -142,4 +143,5 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen
return $query; return $query;
} }
} }

View File

@@ -28,7 +28,8 @@ final readonly class PersonDocumentGenericDocProvider implements GenericDocForPe
public function __construct( public function __construct(
private Security $security, private Security $security,
private PersonDocumentACLAwareRepositoryInterface $personDocumentACLAwareRepository, private PersonDocumentACLAwareRepositoryInterface $personDocumentACLAwareRepository,
) {} ) {
}
public function buildFetchQueryForPerson( public function buildFetchQueryForPerson(
Person $person, Person $person,

Some files were not shown because too many files have changed in this diff Show More