mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-27 00:55:01 +00:00
Compare commits
28 Commits
146_parcou
...
2.8.0
Author | SHA1 | Date | |
---|---|---|---|
f0b3e3af14
|
|||
dbc19ca692
|
|||
cffad6219f | |||
a625260c36 | |||
28006374fb | |||
b35838f840 | |||
e08ab0666f
|
|||
217232fe4f
|
|||
e5a449118e
|
|||
9c436d5c69
|
|||
981be7b363
|
|||
74e25e706e
|
|||
5562f418a5
|
|||
05a8dba912
|
|||
27c1bb03ff
|
|||
2e5954f6fd
|
|||
7eec366292
|
|||
48b3ed0a1f | |||
df3781a993
|
|||
5dde58e175 | |||
d10dc7344e
|
|||
4e27d71bea
|
|||
fcc00fdf8f
|
|||
044aac0a56
|
|||
9e017b0d66
|
|||
c2c14be9d7 | |||
b7119a2733 | |||
eca26a15e6 |
@@ -1,6 +0,0 @@
|
|||||||
kind: Feature
|
|
||||||
body: Allow closing motives to be identified as 'canceling the accompanying period'
|
|
||||||
+ don't take canceled accompanying periods into account in exports
|
|
||||||
time: 2023-10-04T12:08:57.586865276+02:00
|
|
||||||
custom:
|
|
||||||
Issue: "146"
|
|
4
.changes/v2.6.3.md
Normal file
4
.changes/v2.6.3.md
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
## v2.6.3 - 2023-09-19
|
||||||
|
### Fixed
|
||||||
|
* Remove id property from document
|
||||||
|
mappedsuperclass
|
6
.changes/v2.7.0.md
Normal file
6
.changes/v2.7.0.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
## 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"
|
19
.changes/v2.8.0.md
Normal file
19
.changes/v2.8.0.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
## 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
|
32
CHANGELOG.md
32
CHANGELOG.md
@@ -6,6 +6,38 @@ 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
|
## v2.6.2 - 2023-09-18
|
||||||
### Fixed
|
### Fixed
|
||||||
* Fix doctrine mapping of AbstractTaskPlaceEvent and SingleTaskPlaceEvent: id property moved.
|
* Fix doctrine mapping of AbstractTaskPlaceEvent and SingleTaskPlaceEvent: id property moved.
|
||||||
|
@@ -40,7 +40,7 @@ About once a year, the core team discusses the opportunity to invite new members
|
|||||||
|
|
||||||
### Core Membership Revocation
|
### Core Membership Revocation
|
||||||
|
|
||||||
A Symfony Core membership can be revoked for any of the following reasons:
|
A Chill Core membership can be revoked for any of the following reasons:
|
||||||
|
|
||||||
- Refusal to follow the rules and policies stated in this document;
|
- Refusal to follow the rules and policies stated in this document;
|
||||||
- Lack of activity for the past six months;
|
- Lack of activity for the past six months;
|
||||||
|
@@ -123,7 +123,8 @@
|
|||||||
"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,
|
||||||
|
@@ -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\ACPAggregators;
|
namespace Chill\ActivityBundle\Export\Aggregator;
|
||||||
|
|
||||||
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_ACP;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
@@ -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\ACPAggregators;
|
namespace Chill\ActivityBundle\Export\Aggregator;
|
||||||
|
|
||||||
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_ACP;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
@@ -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\ACPAggregators;
|
namespace Chill\ActivityBundle\Export\Aggregator;
|
||||||
|
|
||||||
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_ACP;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
@@ -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\ACPAggregators;
|
namespace Chill\ActivityBundle\Export\Aggregator;
|
||||||
|
|
||||||
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_ACP;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
@@ -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\ACPAggregators;
|
namespace Chill\ActivityBundle\Export\Aggregator;
|
||||||
|
|
||||||
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_ACP;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
@@ -14,7 +14,6 @@ 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\Declarations;
|
||||||
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
@@ -32,7 +31,7 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
protected EntityRepository $repository;
|
protected EntityRepository $repository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManagerInterface $em,
|
EntityManagerInterface $em
|
||||||
) {
|
) {
|
||||||
$this->repository = $em->getRepository(Activity::class);
|
$this->repository = $em->getRepository(Activity::class);
|
||||||
}
|
}
|
||||||
@@ -109,8 +108,6 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
)
|
)
|
||||||
->setParameter('authorized_centers', $centers);
|
->setParameter('authorized_centers', $centers);
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -14,7 +14,6 @@ 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\Declarations;
|
||||||
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
@@ -32,7 +31,7 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
protected EntityRepository $repository;
|
protected EntityRepository $repository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManagerInterface $em,
|
EntityManagerInterface $em
|
||||||
) {
|
) {
|
||||||
$this->repository = $em->getRepository(Activity::class);
|
$this->repository = $em->getRepository(Activity::class);
|
||||||
}
|
}
|
||||||
@@ -112,8 +111,6 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
)
|
)
|
||||||
->setParameter('authorized_centers', $centers);
|
->setParameter('authorized_centers', $centers);
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -14,7 +14,6 @@ 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\Declarations;
|
||||||
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
@@ -32,7 +31,7 @@ class CountActivity implements ExportInterface, GroupedExportInterface
|
|||||||
protected EntityRepository $repository;
|
protected EntityRepository $repository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManagerInterface $em,
|
EntityManagerInterface $em
|
||||||
) {
|
) {
|
||||||
$this->repository = $em->getRepository(Activity::class);
|
$this->repository = $em->getRepository(Activity::class);
|
||||||
}
|
}
|
||||||
@@ -106,8 +105,6 @@ class CountActivity implements ExportInterface, GroupedExportInterface
|
|||||||
)
|
)
|
||||||
->setParameter('authorized_centers', $centers);
|
->setParameter('authorized_centers', $centers);
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
$qb->select('COUNT(DISTINCT activity.id) as export_count_activity');
|
$qb->select('COUNT(DISTINCT activity.id) as export_count_activity');
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
|
@@ -12,10 +12,10 @@ 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;
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
use Chill\MainBundle\Export\Helper\TranslatableStringExportLabelHelper;
|
use Chill\MainBundle\Export\Helper\TranslatableStringExportLabelHelper;
|
||||||
use Chill\MainBundle\Export\ListInterface;
|
use Chill\MainBundle\Export\ListInterface;
|
||||||
@@ -34,7 +34,7 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
ListActivityHelper $helper,
|
ListActivityHelper $helper,
|
||||||
EntityManagerInterface $entityManager,
|
EntityManagerInterface $entityManager,
|
||||||
TranslatableStringExportLabelHelper $translatableStringExportLabelHelper,
|
TranslatableStringExportLabelHelper $translatableStringExportLabelHelper
|
||||||
) {
|
) {
|
||||||
$this->helper = $helper;
|
$this->helper = $helper;
|
||||||
$this->entityManager = $entityManager;
|
$this->entityManager = $entityManager;
|
||||||
@@ -148,8 +148,6 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
|||||||
->addSelect('(SELECT AGGREGATE(acpScope.name) FROM ' . Scope::class . ' acpScope WHERE acpScope MEMBER OF acp.scopes) AS scopesNames')
|
->addSelect('(SELECT AGGREGATE(acpScope.name) FROM ' . Scope::class . ' acpScope WHERE acpScope MEMBER OF acp.scopes) AS scopesNames')
|
||||||
->addGroupBy('scopesNames');
|
->addGroupBy('scopesNames');
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,6 +161,7 @@ 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,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@@ -14,7 +14,6 @@ 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\Declarations;
|
||||||
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
@@ -32,7 +31,7 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
protected EntityRepository $repository;
|
protected EntityRepository $repository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManagerInterface $em,
|
EntityManagerInterface $em
|
||||||
) {
|
) {
|
||||||
$this->repository = $em->getRepository(Activity::class);
|
$this->repository = $em->getRepository(Activity::class);
|
||||||
}
|
}
|
||||||
@@ -112,8 +111,6 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
)
|
)
|
||||||
->setParameter('authorized_centers', $centers);
|
->setParameter('authorized_centers', $centers);
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -14,7 +14,6 @@ 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\Declarations;
|
||||||
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
@@ -32,7 +31,7 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
protected EntityRepository $repository;
|
protected EntityRepository $repository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManagerInterface $em,
|
EntityManagerInterface $em
|
||||||
) {
|
) {
|
||||||
$this->repository = $em->getRepository(Activity::class);
|
$this->repository = $em->getRepository(Activity::class);
|
||||||
}
|
}
|
||||||
@@ -112,8 +111,6 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
)
|
)
|
||||||
->setParameter('authorized_centers', $centers);
|
->setParameter('authorized_centers', $centers);
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -155,7 +155,7 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
return [
|
return [
|
||||||
Declarations::ACTIVITY,
|
Declarations::ACTIVITY,
|
||||||
Declarations::ACTIVITY_PERSON,
|
Declarations::ACTIVITY_PERSON,
|
||||||
//PersonDeclarations::PERSON_TYPE,
|
PersonDeclarations::PERSON_TYPE,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -21,19 +21,15 @@ 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(
|
||||||
ActivityTypeRepositoryInterface $activityTypeRepository,
|
private readonly ActivityTypeRepositoryInterface $activityTypeRepository,
|
||||||
TranslatableStringHelperInterface $translatableStringHelper
|
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
||||||
) {
|
) {}
|
||||||
$this->activityTypeRepository = $activityTypeRepository;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
@@ -81,7 +77,7 @@ class ActivityTypeFilter implements FilterInterface
|
|||||||
$types[] = $this->translatableStringHelper->localize($aty->getName());
|
$types[] = $this->translatableStringHelper->localize($aty->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
return ['Filtered by activity types: only %activitytypes%', [
|
return ['export.filter.activity.acp_by_activity_type.acp_containing_at_least_one_%activitytypes%', [
|
||||||
'%activitytypes%' => implode(', ', $types),
|
'%activitytypes%' => implode(', ', $types),
|
||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
@@ -17,6 +17,9 @@ 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
|
||||||
|
@@ -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\ACPFilters;
|
namespace Chill\ActivityBundle\Export\Filter;
|
||||||
|
|
||||||
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_ACP;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
@@ -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\ACPFilters;
|
namespace Chill\ActivityBundle\Export\Filter;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
@@ -58,7 +58,7 @@ class EmergencyFilter implements FilterInterface
|
|||||||
|
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY_ACP;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
@@ -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\ACPFilters;
|
namespace Chill\ActivityBundle\Export\Filter;
|
||||||
|
|
||||||
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_ACP;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
@@ -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\ACPFilters;
|
namespace Chill\ActivityBundle\Export\Filter;
|
||||||
|
|
||||||
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_ACP;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
@@ -17,6 +17,9 @@ 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;
|
||||||
@@ -44,9 +47,10 @@ class PersonHavingActivityBetweenDateFilter implements ExportElementValidatedInt
|
|||||||
protected TranslatorInterface $translator;
|
protected TranslatorInterface $translator;
|
||||||
|
|
||||||
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;
|
||||||
@@ -62,131 +66,93 @@ class PersonHavingActivityBetweenDateFilter implements ExportElementValidatedInt
|
|||||||
{
|
{
|
||||||
// create a subquery for activity
|
// create a subquery for activity
|
||||||
$sqb = $qb->getEntityManager()->createQueryBuilder();
|
$sqb = $qb->getEntityManager()->createQueryBuilder();
|
||||||
$sqb->select('person_person_having_activity.id')
|
$sqb->select('1')
|
||||||
->from(Activity::class, 'activity_person_having_activity')
|
->from(Activity::class, 'activity_person_having_activity')
|
||||||
->join('activity_person_having_activity.person', 'person_person_having_activity');
|
->leftJoin('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)');
|
||||||
|
|
||||||
// add clause activity reason
|
if (isset($data['reasons']) && [] !== $data['reasons']) {
|
||||||
$sqb->join('activity_person_having_activity.reasons', 'reasons_person_having_activity');
|
// add clause activity reason
|
||||||
|
$sqb->join('activity_person_having_activity.reasons', 'reasons_person_having_activity');
|
||||||
|
|
||||||
$sqb->andWhere(
|
$sqb->andWhere(
|
||||||
$sqb->expr()->in(
|
$sqb->expr()->in(
|
||||||
'reasons_person_having_activity',
|
'reasons_person_having_activity',
|
||||||
':person_having_activity_reasons'
|
':person_having_activity_reasons'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$where = $qb->getDQLPart('where');
|
$qb->setParameter('person_having_activity_reasons', $data['reasons']);
|
||||||
$clause = $qb->expr()->in('person.id', $sqb->getDQL());
|
|
||||||
|
|
||||||
if ($where instanceof Expr\Andx) {
|
|
||||||
$where->add($clause);
|
|
||||||
} else {
|
|
||||||
$where = $qb->expr()->andX($clause);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$qb->add('where', $where);
|
$qb->andWhere(
|
||||||
|
$qb->expr()->exists($sqb->getDQL())
|
||||||
|
);
|
||||||
|
|
||||||
$qb->setParameter(
|
$qb->setParameter(
|
||||||
'person_having_activity_between_date_from',
|
'person_having_activity_between_date_from',
|
||||||
$data['date_from']
|
$this->rollingDateConverter->convert($data['date_from_rolling'])
|
||||||
);
|
);
|
||||||
$qb->setParameter(
|
$qb->setParameter(
|
||||||
'person_having_activity_between_date_to',
|
'person_having_activity_between_date_to',
|
||||||
$data['date_to']
|
$this->rollingDateConverter->convert($data['date_to_rolling'])
|
||||||
);
|
);
|
||||||
$qb->setParameter('person_having_activity_reasons', $data['reasons']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::PERSON_IMPLIED_IN;
|
return Declarations::PERSON_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('date_from', DateType::class, [
|
$builder->add('date_from_rolling', PickRollingDateType::class, [
|
||||||
'label' => 'Implied in an activity after this date',
|
'label' => 'export.filter.activity.person_between_dates.Implied in an activity after this date',
|
||||||
'attr' => ['class' => 'datepicker'],
|
|
||||||
'widget' => 'single_text',
|
|
||||||
'format' => 'dd-MM-yyyy',
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$builder->add('date_to', DateType::class, [
|
$builder->add('date_to_rolling', PickRollingDateType::class, [
|
||||||
'label' => 'Implied in an activity before this date',
|
'label' => 'export.filter.activity.person_between_dates.Implied in an activity before this date',
|
||||||
'attr' => ['class' => 'datepicker'],
|
|
||||||
'widget' => 'single_text',
|
|
||||||
'format' => 'dd-MM-yyyy',
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$builder->add('reasons', EntityType::class, [
|
if ([] !== $reasons = $this->activityReasonRepository->findAll()) {
|
||||||
'class' => ActivityReason::class,
|
$builder->add('reasons', EntityType::class, [
|
||||||
'choice_label' => fn (ActivityReason $reason): ?string => $this->translatableStringHelper->localize($reason->getName()),
|
'class' => ActivityReason::class,
|
||||||
'group_by' => fn (ActivityReason $reason): ?string => $this->translatableStringHelper->localize($reason->getCategory()->getName()),
|
'choices' => $reasons,
|
||||||
'multiple' => true,
|
'choice_label' => fn (ActivityReason $reason): ?string => $this->translatableStringHelper->localize($reason->getName()),
|
||||||
'expanded' => false,
|
'group_by' => fn (ActivityReason $reason): ?string => $this->translatableStringHelper->localize($reason->getCategory()->getName()),
|
||||||
'label' => 'Activity reasons for those activities',
|
'multiple' => true,
|
||||||
]);
|
'expanded' => false,
|
||||||
|
'label' => 'export.filter.activity.person_between_dates.Activity reasons for those activities',
|
||||||
$builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) {
|
'help' => 'export.filter.activity.person_between_dates.if no reasons',
|
||||||
/** @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 ['date_from' => new DateTime(), 'date_to' => new DateTime(), 'reasons' => $this->activityReasonRepository->findAll()];
|
return [
|
||||||
|
'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 [
|
||||||
'Filtered by person having an activity between %date_from% and '
|
[] === $data['reasons'] ?
|
||||||
. '%date_to% with reasons %reasons_name%',
|
'export.filter.person_between_dates.describe_action_with_no_subject'
|
||||||
|
: 'export.filter.person_between_dates.describe_action_with_subject',
|
||||||
[
|
[
|
||||||
'%date_from%' => $data['date_from']->format('d-m-Y'),
|
'date_from' => $this->rollingDateConverter->convert($data['date_from_rolling']),
|
||||||
'%date_to%' => $data['date_to']->format('d-m-Y'),
|
'date_to' => $this->rollingDateConverter->convert($data['date_to_rolling']),
|
||||||
'%reasons_name%' => implode(
|
'reasons' => implode(
|
||||||
', ',
|
', ',
|
||||||
array_map(
|
array_map(
|
||||||
fn (ActivityReason $r): string => '"' . $this->translatableStringHelper->localize($r->getName()) . '"',
|
fn (ActivityReason $r): string => '"' . $this->translatableStringHelper->localize($r->getName()) . '"',
|
||||||
@@ -199,13 +165,15 @@ class PersonHavingActivityBetweenDateFilter implements ExportElementValidatedInt
|
|||||||
|
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return 'Filter by person having an activity in a period';
|
return 'export.filter.activity.person_between_dates.title';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validateForm($data, ExecutionContextInterface $context)
|
public function validateForm($data, ExecutionContextInterface $context)
|
||||||
{
|
{
|
||||||
if (null === $data['reasons'] || count($data['reasons']) === 0) {
|
if ($this->rollingDateConverter->convert($data['date_from_rolling'])
|
||||||
$context->buildViolation('At least one reason must be chosen')
|
>= $this->rollingDateConverter->convert($data['date_to_rolling'])) {
|
||||||
|
$context->buildViolation('export.filter.activity.person_between_dates.date mismatch')
|
||||||
|
->setTranslationDomain('messages')
|
||||||
->addViolation();
|
->addViolation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -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\ACPFilters;
|
namespace Chill\ActivityBundle\Export\Filter;
|
||||||
|
|
||||||
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_ACP;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
@@ -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\ACPFilters;
|
namespace Chill\ActivityBundle\Export\Filter;
|
||||||
|
|
||||||
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_ACP;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
@@ -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\ACPFilters;
|
namespace Chill\ActivityBundle\Export\Filter;
|
||||||
|
|
||||||
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_ACP;
|
return Declarations::ACTIVITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
@@ -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\ACPAggregators\BySocialActionAggregator;
|
use Chill\ActivityBundle\Export\Aggregator\BySocialActionAggregator;
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
||||||
|
@@ -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\ACPAggregators\BySocialIssueAggregator;
|
use Chill\ActivityBundle\Export\Aggregator\BySocialIssueAggregator;
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
||||||
|
@@ -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\ACPAggregators;
|
namespace Chill\ActivityBundle\Tests\Export\Aggregator;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\ByThirdpartyAggregator;
|
use Chill\ActivityBundle\Export\Aggregator\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('chill.activity.export.bythirdparty_aggregator');
|
$this->aggregator = self::$container->get(ByThirdpartyAggregator::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
@@ -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\ACPAggregators;
|
namespace Chill\ActivityBundle\Tests\Export\Aggregator;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\ByCreatorAggregator;
|
use Chill\ActivityBundle\Export\Aggregator\ByCreatorAggregator;
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
@@ -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\ACPAggregators;
|
namespace Chill\ActivityBundle\Tests\Export\Aggregator;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\CreatorScopeAggregator;
|
use Chill\ActivityBundle\Export\Aggregator\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 UserScopeAggregatorTest extends AbstractAggregatorTest
|
final class CreatorScopeAggregatorTest extends AbstractAggregatorTest
|
||||||
{
|
{
|
||||||
private CreatorScopeAggregator $aggregator;
|
private CreatorScopeAggregator $aggregator;
|
||||||
|
|
@@ -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\ACPAggregators;
|
namespace Chill\ActivityBundle\Tests\Export\Aggregator;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\DateAggregator;
|
use Chill\ActivityBundle\Export\Aggregator\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('chill.activity.export.date_aggregator');
|
$this->aggregator = self::$container->get(DateAggregator::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
@@ -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\ACPAggregators;
|
namespace Chill\ActivityBundle\Tests\Export\Aggregator;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Chill\ActivityBundle\Export\Aggregator\ACPAggregators\LocationTypeAggregator;
|
use Chill\ActivityBundle\Export\Aggregator\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('chill.activity.export.locationtype_aggregator');
|
$this->aggregator = self::$container->get(LocationTypeAggregator::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
@@ -13,9 +13,10 @@ 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\ACPFilters\ActivityTypeFilter;
|
use Chill\ActivityBundle\Export\Filter\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;
|
||||||
|
|
||||||
@@ -25,13 +26,13 @@ use Doctrine\ORM\Query\Expr;
|
|||||||
*/
|
*/
|
||||||
final class ActivityTypeFilterTest extends AbstractFilterTest
|
final class ActivityTypeFilterTest extends AbstractFilterTest
|
||||||
{
|
{
|
||||||
private ActivityTypeFilter $filter;
|
private \Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter $filter;
|
||||||
|
|
||||||
protected function setUp(): void
|
protected function setUp(): void
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->filter = self::$container->get('chill.activity.export.filter_activitytype');
|
$this->filter = self::$container->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFilter()
|
public function getFilter()
|
||||||
@@ -47,13 +48,14 @@ 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' => $a,
|
'accepted_activitytypes' => new ArrayCollection([$a]),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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 BySocialActionFilter $filter;
|
private \Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter $filter;
|
||||||
|
|
||||||
protected function setUp(): void
|
protected function setUp(): void
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->filter = self::$container->get('chill.activity.export.bysocialaction_filter');
|
$this->filter = self::$container->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFilter()
|
public function getFilter()
|
||||||
@@ -39,19 +39,22 @@ 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' => $a,
|
'accepted_socialactions' => new ArrayCollection([$a]),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,9 +63,7 @@ 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);
|
||||||
|
|
||||||
|
@@ -15,6 +15,7 @@ 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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -29,7 +30,7 @@ final class BySocialIssueFilterTest extends AbstractFilterTest
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->filter = self::$container->get('chill.activity.export.bysocialissue_filter');
|
$this->filter = self::$container->get(BySocialIssueFilter::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFilter()
|
public function getFilter()
|
||||||
@@ -39,19 +40,21 @@ 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' => $a,
|
'accepted_socialissues' => new ArrayCollection([$a]),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ final class ActivityDateFilterTest extends AbstractFilterTest
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->filter = self::$container->get('chill.activity.export.date_filter');
|
$this->filter = self::$container->get(ActivityDateFilter::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFilter()
|
public function getFilter()
|
||||||
|
@@ -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\ACPFilters;
|
namespace Chill\ActivityBundle\Tests\Export\Filter;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Chill\ActivityBundle\Export\Filter\ACPFilters\ByCreatorFilter;
|
use Chill\ActivityBundle\Export\Filter\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('chill.activity.export.byuser_filter');
|
$this->filter = self::$container->get(ByCreatorFilter::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFilter()
|
public function getFilter()
|
@@ -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\ACPFilters;
|
namespace Chill\ActivityBundle\Tests\Export\Filter;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Chill\ActivityBundle\Export\Filter\ACPFilters\EmergencyFilter;
|
use Chill\ActivityBundle\Export\Filter\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('chill.activity.export.emergency_filter');
|
$this->filter = self::$container->get(EmergencyFilter::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFilter()
|
public function getFilter()
|
@@ -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\ACPFilters;
|
namespace Chill\ActivityBundle\Tests\Export\Filter;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Chill\ActivityBundle\Export\Filter\ACPFilters\LocationTypeFilter;
|
use Chill\ActivityBundle\Export\Filter\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('chill.activity.export.locationtype_filter');
|
$this->filter = self::$container->get(LocationTypeFilter::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFilter()
|
public function getFilter()
|
@@ -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,7 +72,9 @@ 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')
|
||||||
|
,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -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\ACPFilters;
|
namespace Chill\ActivityBundle\Tests\Export\Filter;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Chill\ActivityBundle\Export\Filter\ACPFilters\SentReceivedFilter;
|
use Chill\ActivityBundle\Export\Filter\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('chill.activity.export.sentreceived_filter');
|
$this->filter = self::$container->get(SentReceivedFilter::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFilter()
|
public function getFilter()
|
@@ -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\ACPFilters;
|
namespace Chill\ActivityBundle\Tests\Export\Filter;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Chill\ActivityBundle\Export\Filter\ACPFilters\UserFilter;
|
use Chill\ActivityBundle\Export\Filter\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('chill.activity.export.user_filter');
|
$this->filter = self::$container->get(UserFilter::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFilter()
|
public function getFilter()
|
@@ -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\ACPFilters;
|
namespace Chill\ActivityBundle\Tests\Export\Filter;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Chill\ActivityBundle\Export\Filter\ACPFilters\UserScopeFilter;
|
use Chill\ActivityBundle\Export\Filter\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('chill.activity.export.userscope_filter');
|
$this->filter = self::$container->get(UserScopeFilter::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFilter()
|
public function getFilter()
|
@@ -53,8 +53,7 @@ services:
|
|||||||
tags:
|
tags:
|
||||||
- { name: chill.export_filter, alias: 'activity_type_filter' }
|
- { name: chill.export_filter, alias: 'activity_type_filter' }
|
||||||
|
|
||||||
chill.activity.export.date_filter:
|
Chill\ActivityBundle\Export\Filter\ActivityDateFilter:
|
||||||
class: Chill\ActivityBundle\Export\Filter\ActivityDateFilter
|
|
||||||
tags:
|
tags:
|
||||||
- { name: chill.export_filter, alias: 'activity_date_filter' }
|
- { name: chill.export_filter, alias: 'activity_date_filter' }
|
||||||
|
|
||||||
@@ -74,52 +73,43 @@ 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.activity.export.filter_activitytype:
|
Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter:
|
||||||
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.activity.export.location_filter:
|
Chill\ActivityBundle\Export\Filter\LocationFilter:
|
||||||
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.activity.export.locationtype_filter:
|
Chill\ActivityBundle\Export\Filter\LocationTypeFilter:
|
||||||
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\ACPFilters\ByCreatorFilter:
|
Chill\ActivityBundle\Export\Filter\ByCreatorFilter:
|
||||||
tags:
|
tags:
|
||||||
- { name: chill.export_filter, alias: 'activity_bycreator_filter' }
|
- { name: chill.export_filter, alias: 'activity_bycreator_filter' }
|
||||||
|
|
||||||
chill.activity.export.emergency_filter:
|
Chill\ActivityBundle\Export\Filter\EmergencyFilter:
|
||||||
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.activity.export.sentreceived_filter:
|
Chill\ActivityBundle\Export\Filter\SentReceivedFilter:
|
||||||
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.activity.export.bysocialaction_filter:
|
Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter:
|
||||||
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.activity.export.bysocialissue_filter:
|
Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialIssueFilter:
|
||||||
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.activity.export.user_filter: # Creator (M2O)
|
Chill\ActivityBundle\Export\Filter\UserFilter:
|
||||||
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.activity.export.userscope_filter:
|
Chill\ActivityBundle\Export\Filter\UserScopeFilter:
|
||||||
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' }
|
||||||
|
|
||||||
@@ -157,22 +147,19 @@ services:
|
|||||||
tags:
|
tags:
|
||||||
- { name: chill.export_aggregator, alias: activity_user_aggregator }
|
- { name: chill.export_aggregator, alias: activity_user_aggregator }
|
||||||
|
|
||||||
chill.activity.export.locationtype_aggregator:
|
Chill\ActivityBundle\Export\Aggregator\LocationTypeAggregator:
|
||||||
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.activity.export.date_aggregator:
|
Chill\ActivityBundle\Export\Aggregator\DateAggregator:
|
||||||
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\ACPAggregators\ByCreatorAggregator:
|
Chill\ActivityBundle\Export\Aggregator\ByCreatorAggregator:
|
||||||
tags:
|
tags:
|
||||||
- { name: chill.export_aggregator, alias: activity_by_creator_aggregator }
|
- { name: chill.export_aggregator, alias: activity_by_creator_aggregator }
|
||||||
|
|
||||||
chill.activity.export.bythirdparty_aggregator:
|
Chill\ActivityBundle\Export\Aggregator\ByThirdpartyAggregator:
|
||||||
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 }
|
||||||
|
|
||||||
@@ -186,7 +173,7 @@ services:
|
|||||||
tags:
|
tags:
|
||||||
- { name: chill.export_aggregator, alias: activity_bysocialissue_aggregator }
|
- { name: chill.export_aggregator, alias: activity_bysocialissue_aggregator }
|
||||||
|
|
||||||
Chill\ActivityBundle\Export\Aggregator\ACPAggregators\CreatorScopeAggregator:
|
Chill\ActivityBundle\Export\Aggregator\CreatorScopeAggregator:
|
||||||
tags:
|
tags:
|
||||||
- { name: chill.export_aggregator, alias: activity_creator_scope_aggregator }
|
- { name: chill.export_aggregator, alias: activity_creator_scope_aggregator }
|
||||||
|
|
||||||
|
@@ -3,3 +3,9 @@ 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}
|
||||||
|
|
||||||
|
@@ -255,11 +255,6 @@ 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
|
||||||
|
|
||||||
@@ -377,7 +372,15 @@ 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:
|
||||||
|
@@ -13,7 +13,6 @@ namespace Chill\CalendarBundle\Export\Export;
|
|||||||
|
|
||||||
use Chill\CalendarBundle\Export\Declarations;
|
use Chill\CalendarBundle\Export\Declarations;
|
||||||
use Chill\CalendarBundle\Repository\CalendarRepository;
|
use Chill\CalendarBundle\Repository\CalendarRepository;
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
@@ -28,9 +27,8 @@ class CountCalendars implements ExportInterface, GroupedExportInterface
|
|||||||
{
|
{
|
||||||
private CalendarRepository $calendarRepository;
|
private CalendarRepository $calendarRepository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(CalendarRepository $calendarRepository)
|
||||||
CalendarRepository $calendarRepository,
|
{
|
||||||
) {
|
|
||||||
$this->calendarRepository = $calendarRepository;
|
$this->calendarRepository = $calendarRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,9 +98,6 @@ class CountCalendars implements ExportInterface, GroupedExportInterface
|
|||||||
$qb = $this->calendarRepository->createQueryBuilder('cal');
|
$qb = $this->calendarRepository->createQueryBuilder('cal');
|
||||||
|
|
||||||
$qb->select('COUNT(cal.id) AS export_result');
|
$qb->select('COUNT(cal.id) AS export_result');
|
||||||
$qb->leftJoin('cal.accompanyingPeriod', 'acp');
|
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,6 @@ namespace Chill\CalendarBundle\Export\Export;
|
|||||||
|
|
||||||
use Chill\CalendarBundle\Export\Declarations;
|
use Chill\CalendarBundle\Export\Declarations;
|
||||||
use Chill\CalendarBundle\Repository\CalendarRepository;
|
use Chill\CalendarBundle\Repository\CalendarRepository;
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
@@ -28,7 +27,7 @@ class StatCalendarAvgDuration implements ExportInterface, GroupedExportInterface
|
|||||||
private CalendarRepository $calendarRepository;
|
private CalendarRepository $calendarRepository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
CalendarRepository $calendarRepository,
|
CalendarRepository $calendarRepository
|
||||||
) {
|
) {
|
||||||
$this->calendarRepository = $calendarRepository;
|
$this->calendarRepository = $calendarRepository;
|
||||||
}
|
}
|
||||||
@@ -93,10 +92,8 @@ class StatCalendarAvgDuration implements ExportInterface, GroupedExportInterface
|
|||||||
{
|
{
|
||||||
$qb = $this->calendarRepository->createQueryBuilder('cal');
|
$qb = $this->calendarRepository->createQueryBuilder('cal');
|
||||||
|
|
||||||
$qb->select('AVG(cal.endDate - cal.startDate) AS export_result');
|
$qb
|
||||||
$qb->join('cal.accompanyingPeriod', 'acp');
|
->select('AVG(cal.endDate - cal.startDate) AS export_result');
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,6 @@ namespace Chill\CalendarBundle\Export\Export;
|
|||||||
|
|
||||||
use Chill\CalendarBundle\Export\Declarations;
|
use Chill\CalendarBundle\Export\Declarations;
|
||||||
use Chill\CalendarBundle\Repository\CalendarRepository;
|
use Chill\CalendarBundle\Repository\CalendarRepository;
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
@@ -28,7 +27,7 @@ class StatCalendarSumDuration implements ExportInterface, GroupedExportInterface
|
|||||||
private CalendarRepository $calendarRepository;
|
private CalendarRepository $calendarRepository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
CalendarRepository $calendarRepository,
|
CalendarRepository $calendarRepository
|
||||||
) {
|
) {
|
||||||
$this->calendarRepository = $calendarRepository;
|
$this->calendarRepository = $calendarRepository;
|
||||||
}
|
}
|
||||||
@@ -93,10 +92,8 @@ class StatCalendarSumDuration implements ExportInterface, GroupedExportInterface
|
|||||||
{
|
{
|
||||||
$qb = $this->calendarRepository->createQueryBuilder('cal');
|
$qb = $this->calendarRepository->createQueryBuilder('cal');
|
||||||
|
|
||||||
$qb->select('SUM(cal.endDate - cal.startDate) AS export_result');
|
$qb
|
||||||
$qb->join('cal.accompanyingPeriod', 'acp');
|
->select('SUM(cal.endDate - cal.startDate) AS export_result');
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
@@ -28,6 +28,13 @@ 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();
|
||||||
@@ -38,6 +45,11 @@ 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) {
|
||||||
@@ -53,4 +65,5 @@ class AccompanyingCourseDocument extends Document implements HasScopesInterface,
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -49,13 +49,6 @@ 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",
|
||||||
@@ -103,11 +96,6 @@ 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;
|
||||||
|
@@ -23,6 +23,13 @@ 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")
|
||||||
*/
|
*/
|
||||||
@@ -40,6 +47,11 @@ 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;
|
||||||
|
@@ -1,31 +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\MainBundle\Export;
|
|
||||||
|
|
||||||
use Doctrine\ORM\QueryBuilder;
|
|
||||||
|
|
||||||
final readonly class AccompanyingCourseExportHelper
|
|
||||||
{
|
|
||||||
public static function addClosingMotiveExclusionClause(QueryBuilder $qb): QueryBuilder
|
|
||||||
{
|
|
||||||
$qb->leftJoin('acp.closingMotive', 'acpmotive')
|
|
||||||
->andWhere(
|
|
||||||
$qb->expr()->orX(
|
|
||||||
$qb->expr()->eq('acpmotive.isCanceledAccompanyingPeriod', 'false'),
|
|
||||||
$qb->expr()->isNull('acpmotive.closingMotive')
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
return $qb;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -1,122 +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 Export;
|
|
||||||
|
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive;
|
|
||||||
use Chill\PersonBundle\Repository\AccompanyingPeriodACLAwareRepositoryInterface;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
|
||||||
use Doctrine\ORM\EntityRepository;
|
|
||||||
use Doctrine\ORM\QueryBuilder;
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @internal
|
|
||||||
* @coversNothing
|
|
||||||
*/
|
|
||||||
class AccompanyingCourseExportHelperTest extends KernelTestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var list<array{0: class-string, 1: int}>
|
|
||||||
*/
|
|
||||||
private static array $entitiesToDelete = [];
|
|
||||||
|
|
||||||
private EntityManagerInterface $em;
|
|
||||||
|
|
||||||
private AccompanyingCourseExportHelper $accompanyingCourseExportHelper;
|
|
||||||
|
|
||||||
protected function setUp(): void
|
|
||||||
{
|
|
||||||
self::bootKernel();
|
|
||||||
$this->em = self::$container->get(EntityManagerInterface::class);
|
|
||||||
$this->accompanyingCourseExportHelper = self::$container->get(AccompanyingCourseExportHelper::class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function tearDownAfterClass(): void
|
|
||||||
{
|
|
||||||
self::bootKernel();
|
|
||||||
$em = self::$container->get(EntityManagerInterface::class);
|
|
||||||
|
|
||||||
foreach (self::$entitiesToDelete as [$class, $id]) {
|
|
||||||
$entity = $em->find($class, $id);
|
|
||||||
|
|
||||||
if (null !== $entity) {
|
|
||||||
$em->remove($entity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$em->flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testExclusionOnClosingMotive(): void
|
|
||||||
{
|
|
||||||
[$periodA, $periodB, $periodC] = $this->prepareData();
|
|
||||||
|
|
||||||
$qb = $this->em->getRepository(AccompanyingPeriod::class)->createQueryBuilder('acp');
|
|
||||||
$this->accompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
$qb->select('acp.id');
|
|
||||||
|
|
||||||
$periodIdsFound = array_map(fn ($el) => $el['id'], $qb->getQuery()->getResult());
|
|
||||||
|
|
||||||
$periodA = $this->em->find(AccompanyingPeriod::class, $periodA->getId());
|
|
||||||
$periodB = $this->em->find(AccompanyingPeriod::class, $periodB->getId());
|
|
||||||
$periodC = $this->em->find(AccompanyingPeriod::class, $periodC->getId());
|
|
||||||
|
|
||||||
self::assertContains($periodA->getId(), $periodIdsFound, 'Period without canceled closing motive has been found');
|
|
||||||
self::assertNotContains($periodB->getId(), $periodIdsFound, 'Period with canceled closing motive has not been found');
|
|
||||||
self::assertNotContains($periodC->getId(), $periodIdsFound, 'Period with child canceled closing motive has not been found');
|
|
||||||
}
|
|
||||||
|
|
||||||
private function prepareData()
|
|
||||||
{
|
|
||||||
$cmA = new ClosingMotive();
|
|
||||||
$cmA->setIsCanceledAccompanyingPeriod(false);
|
|
||||||
|
|
||||||
$cmB = new ClosingMotive();
|
|
||||||
$cmB->setIsCanceledAccompanyingPeriod(true);
|
|
||||||
|
|
||||||
$cmChild = new ClosingMotive();
|
|
||||||
$cmB->addChildren($cmChild);
|
|
||||||
|
|
||||||
$this->em->persist($cmA);
|
|
||||||
$this->em->persist($cmB);
|
|
||||||
$this->em->persist($cmChild);
|
|
||||||
|
|
||||||
$periodA = new AccompanyingPeriod();
|
|
||||||
$periodB = new AccompanyingPeriod();
|
|
||||||
$periodC = new AccompanyingPeriod();
|
|
||||||
|
|
||||||
$periodA->setClosingMotive($cmA);
|
|
||||||
$periodB->setClosingMotive($cmB);
|
|
||||||
$periodC->setClosingMotive($cmChild);
|
|
||||||
|
|
||||||
$this->em->persist($periodA);
|
|
||||||
$this->em->persist($periodB);
|
|
||||||
$this->em->persist($periodC);
|
|
||||||
|
|
||||||
self::$entitiesToDelete[] = [ClosingMotive::class, $cmChild];
|
|
||||||
self::$entitiesToDelete[] = [ClosingMotive::class, $cmA];
|
|
||||||
self::$entitiesToDelete[] = [ClosingMotive::class, $cmB];
|
|
||||||
|
|
||||||
self::$entitiesToDelete[] = [AccompanyingPeriod::class, $periodA];
|
|
||||||
self::$entitiesToDelete[] = [AccompanyingPeriod::class, $periodB];
|
|
||||||
self::$entitiesToDelete[] = [AccompanyingPeriod::class, $periodC];
|
|
||||||
|
|
||||||
$this->em->flush();
|
|
||||||
$this->em->clear();
|
|
||||||
|
|
||||||
return [$periodA, $periodB, $periodC];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -52,4 +52,3 @@ services:
|
|||||||
$exportManager: '@Chill\MainBundle\Export\ExportManager'
|
$exportManager: '@Chill\MainBundle\Export\ExportManager'
|
||||||
tags:
|
tags:
|
||||||
- { name: chill.export_formatter, alias: 'csv_pivoted_list' }
|
- { name: chill.export_formatter, alias: 'csv_pivoted_list' }
|
||||||
|
|
||||||
|
@@ -100,7 +100,7 @@ class ReassignAccompanyingPeriodController extends AbstractController
|
|||||||
|
|
||||||
$total = $this->accompanyingPeriodACLAwareRepository->countByUserAndPostalCodesOpenedAccompanyingPeriod($userFrom, $postalCodes);
|
$total = $this->accompanyingPeriodACLAwareRepository->countByUserAndPostalCodesOpenedAccompanyingPeriod($userFrom, $postalCodes);
|
||||||
$paginator = $this->paginatorFactory->create($total);
|
$paginator = $this->paginatorFactory->create($total);
|
||||||
$paginator->setItemsPerPage(50);
|
$paginator->setItemsPerPage(100);
|
||||||
$periods = $this->accompanyingPeriodACLAwareRepository
|
$periods = $this->accompanyingPeriodACLAwareRepository
|
||||||
->findByUserAndPostalCodesOpenedAccompanyingPeriod(
|
->findByUserAndPostalCodesOpenedAccompanyingPeriod(
|
||||||
$userFrom,
|
$userFrom,
|
||||||
@@ -123,6 +123,7 @@ class ReassignAccompanyingPeriodController extends AbstractController
|
|||||||
|
|
||||||
if ($assignForm->isSubmitted() && $assignForm->isValid()) {
|
if ($assignForm->isSubmitted() && $assignForm->isValid()) {
|
||||||
$assignPeriodIds = json_decode($assignForm->get('periods')->getData(), true, 512, JSON_THROW_ON_ERROR);
|
$assignPeriodIds = json_decode($assignForm->get('periods')->getData(), true, 512, JSON_THROW_ON_ERROR);
|
||||||
|
/** @var User $userTo */
|
||||||
$userTo = $assignForm->get('userTo')->getData();
|
$userTo = $assignForm->get('userTo')->getData();
|
||||||
$userFrom = $assignForm->get('userFrom')->getData();
|
$userFrom = $assignForm->get('userFrom')->getData();
|
||||||
|
|
||||||
@@ -131,6 +132,10 @@ class ReassignAccompanyingPeriodController extends AbstractController
|
|||||||
|
|
||||||
if ($period->getUser() === $userFrom) {
|
if ($period->getUser() === $userFrom) {
|
||||||
$period->setUser($userTo, true);
|
$period->setUser($userTo, true);
|
||||||
|
|
||||||
|
if (null !== $userTo->getUserJob() && $period->getJob() !== $userTo->getUserJob()) {
|
||||||
|
$period->setJob($userTo->getUserJob());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -69,11 +69,6 @@ class ClosingMotive
|
|||||||
*/
|
*/
|
||||||
private ?ClosingMotive $parent = null;
|
private ?ClosingMotive $parent = null;
|
||||||
|
|
||||||
/**
|
|
||||||
* @ORM\Column(type="boolean", nullable=false, options={"default": false})
|
|
||||||
*/
|
|
||||||
private bool $isCanceledAccompanyingPeriod = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClosingMotive constructor.
|
* ClosingMotive constructor.
|
||||||
*/
|
*/
|
||||||
@@ -89,7 +84,7 @@ class ClosingMotive
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->children->add($child);
|
$this->children->add($child);
|
||||||
$child->setParent($this)->setIsCanceledAccompanyingPeriod($this->getIsCanceledAccompanyingPeriod());
|
$child->setParent($this);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@@ -132,11 +127,6 @@ class ClosingMotive
|
|||||||
return $this->parent;
|
return $this->parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIsCanceledAccompanyingPeriod(): bool
|
|
||||||
{
|
|
||||||
return $this->isCanceledAccompanyingPeriod;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function hasParent(): bool
|
public function hasParent(): bool
|
||||||
{
|
{
|
||||||
return null !== $this->parent;
|
return null !== $this->parent;
|
||||||
@@ -162,11 +152,6 @@ class ClosingMotive
|
|||||||
return $this->children->count() > 0;
|
return $this->children->count() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isCanceledAccompanyingPeriod(): bool
|
|
||||||
{
|
|
||||||
return $this->isCanceledAccompanyingPeriod;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function removeChildren(ClosingMotive $child): ClosingMotive
|
public function removeChildren(ClosingMotive $child): ClosingMotive
|
||||||
{
|
{
|
||||||
if ($this->children->removeElement($child)) {
|
if ($this->children->removeElement($child)) {
|
||||||
@@ -233,15 +218,4 @@ class ClosingMotive
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setIsCanceledAccompanyingPeriod(bool $isCanceledAP): ClosingMotive
|
|
||||||
{
|
|
||||||
$this->isCanceledAccompanyingPeriod = $isCanceledAP;
|
|
||||||
|
|
||||||
foreach ($this->getChildren() as $child) {
|
|
||||||
$child->setIsCanceledAccompanyingPeriod($isCanceledAP);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -224,7 +224,7 @@ class SocialIssue
|
|||||||
/**
|
/**
|
||||||
* @param array|SocialIssue[] $socialIssues
|
* @param array|SocialIssue[] $socialIssues
|
||||||
*/
|
*/
|
||||||
public static function getDescendantsWithThisForIssues(array $socialIssues): Collection
|
public static function getDescendantsWithThisForIssues(array|Collection $socialIssues): Collection
|
||||||
{
|
{
|
||||||
$unique = [];
|
$unique = [];
|
||||||
|
|
||||||
|
@@ -22,6 +22,9 @@ abstract class Declarations
|
|||||||
|
|
||||||
public const HOUSEHOLD_TYPE = 'household';
|
public const HOUSEHOLD_TYPE = 'household';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated consider using the PERSON_TYPE instead
|
||||||
|
*/
|
||||||
public const PERSON_IMPLIED_IN = 'person_implied_in';
|
public const PERSON_IMPLIED_IN = 'person_implied_in';
|
||||||
|
|
||||||
public const PERSON_TYPE = 'person';
|
public const PERSON_TYPE = 'person';
|
||||||
|
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Export\Export;
|
namespace Chill\PersonBundle\Export\Export;
|
||||||
|
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
@@ -31,7 +30,7 @@ class CountAccompanyingCourse implements ExportInterface, GroupedExportInterface
|
|||||||
protected EntityRepository $repository;
|
protected EntityRepository $repository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManagerInterface $em,
|
EntityManagerInterface $em
|
||||||
) {
|
) {
|
||||||
$this->repository = $em->getRepository(AccompanyingPeriod::class);
|
$this->repository = $em->getRepository(AccompanyingPeriod::class);
|
||||||
}
|
}
|
||||||
@@ -112,8 +111,6 @@ class CountAccompanyingCourse implements ExportInterface, GroupedExportInterface
|
|||||||
->setParameter('count_acp_step', AccompanyingPeriod::STEP_DRAFT)
|
->setParameter('count_acp_step', AccompanyingPeriod::STEP_DRAFT)
|
||||||
->setParameter('authorized_centers', $centers);
|
->setParameter('authorized_centers', $centers);
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
$qb->select('COUNT(DISTINCT acp.id) AS export_result');
|
$qb->select('COUNT(DISTINCT acp.id) AS export_result');
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
|
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Export\Export;
|
namespace Chill\PersonBundle\Export\Export;
|
||||||
|
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
@@ -30,7 +29,7 @@ class CountAccompanyingPeriodWork implements ExportInterface, GroupedExportInter
|
|||||||
protected EntityManagerInterface $em;
|
protected EntityManagerInterface $em;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManagerInterface $em,
|
EntityManagerInterface $em
|
||||||
) {
|
) {
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
}
|
}
|
||||||
@@ -113,8 +112,6 @@ class CountAccompanyingPeriodWork implements ExportInterface, GroupedExportInter
|
|||||||
|
|
||||||
$qb->select('COUNT(DISTINCT acpw.id) as export_result');
|
$qb->select('COUNT(DISTINCT acpw.id) as export_result');
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Export\Export;
|
namespace Chill\PersonBundle\Export\Export;
|
||||||
|
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
@@ -29,7 +28,7 @@ class CountEvaluation implements ExportInterface, GroupedExportInterface
|
|||||||
private EntityManagerInterface $entityManager;
|
private EntityManagerInterface $entityManager;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManagerInterface $em,
|
EntityManagerInterface $em
|
||||||
) {
|
) {
|
||||||
$this->entityManager = $em;
|
$this->entityManager = $em;
|
||||||
}
|
}
|
||||||
@@ -111,8 +110,6 @@ class CountEvaluation implements ExportInterface, GroupedExportInterface
|
|||||||
)
|
)
|
||||||
->setParameter('authorized_centers', $centers);
|
->setParameter('authorized_centers', $centers);
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
$qb->select('COUNT(DISTINCT workeval.id) AS export_result');
|
$qb->select('COUNT(DISTINCT workeval.id) AS export_result');
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
|
@@ -120,9 +120,7 @@ class CountPerson implements ExportInterface, GroupedExportInterface
|
|||||||
public function supportsModifiers()
|
public function supportsModifiers()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'abcde',
|
Declarations::PERSON_TYPE,
|
||||||
//Declarations::PERSON_TYPE,
|
|
||||||
//Declarations::PERSON_IMPLIED_IN,
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Export\Export;
|
namespace Chill\PersonBundle\Export\Export;
|
||||||
|
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
@@ -31,7 +30,7 @@ class CountPersonWithAccompanyingCourse implements ExportInterface, GroupedExpor
|
|||||||
private EntityRepository $repository;
|
private EntityRepository $repository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManagerInterface $em,
|
EntityManagerInterface $em
|
||||||
) {
|
) {
|
||||||
$this->repository = $em->getRepository(AccompanyingPeriod::class);
|
$this->repository = $em->getRepository(AccompanyingPeriod::class);
|
||||||
}
|
}
|
||||||
@@ -112,8 +111,6 @@ class CountPersonWithAccompanyingCourse implements ExportInterface, GroupedExpor
|
|||||||
)
|
)
|
||||||
)->setParameter('authorized_centers', $centers);
|
)->setParameter('authorized_centers', $centers);
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
$qb->select('COUNT(DISTINCT person.id) AS export_result');
|
$qb->select('COUNT(DISTINCT person.id) AS export_result');
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
|
@@ -13,7 +13,6 @@ namespace Chill\PersonBundle\Export\Export;
|
|||||||
|
|
||||||
use Chill\MainBundle\Entity\Address;
|
use Chill\MainBundle\Entity\Address;
|
||||||
use Chill\MainBundle\Entity\Scope;
|
use Chill\MainBundle\Entity\Scope;
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
use Chill\MainBundle\Export\Helper\DateTimeHelper;
|
use Chill\MainBundle\Export\Helper\DateTimeHelper;
|
||||||
@@ -133,8 +132,6 @@ final readonly class ListAccompanyingPeriod implements ListInterface, GroupedExp
|
|||||||
|
|
||||||
$this->listAccompanyingPeriodHelper->addSelectClauses($qb, $this->rollingDateConverter->convert($data['calc_date']));
|
$this->listAccompanyingPeriodHelper->addSelectClauses($qb, $this->rollingDateConverter->convert($data['calc_date']));
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
$qb
|
$qb
|
||||||
->addOrderBy('acp.openingDate')
|
->addOrderBy('acp.openingDate')
|
||||||
->addOrderBy('acp.closingDate')
|
->addOrderBy('acp.closingDate')
|
||||||
|
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Export\Export;
|
namespace Chill\PersonBundle\Export\Export;
|
||||||
|
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
use Chill\MainBundle\Export\Helper\AggregateStringHelper;
|
use Chill\MainBundle\Export\Helper\AggregateStringHelper;
|
||||||
@@ -113,7 +112,7 @@ class ListAccompanyingPeriodWork implements ListInterface, GroupedExportInterfac
|
|||||||
SocialActionRender $socialActionRender,
|
SocialActionRender $socialActionRender,
|
||||||
RollingDateConverterInterface $rollingDateConverter,
|
RollingDateConverterInterface $rollingDateConverter,
|
||||||
AggregateStringHelper $aggregateStringHelper,
|
AggregateStringHelper $aggregateStringHelper,
|
||||||
SocialActionRepository $socialActionRepository,
|
SocialActionRepository $socialActionRepository
|
||||||
) {
|
) {
|
||||||
$this->entityManager = $entityManager;
|
$this->entityManager = $entityManager;
|
||||||
$this->dateTimeHelper = $dateTimeHelper;
|
$this->dateTimeHelper = $dateTimeHelper;
|
||||||
@@ -292,8 +291,6 @@ class ListAccompanyingPeriodWork implements ListInterface, GroupedExportInterfac
|
|||||||
->setParameter('authorized_centers', $centers)
|
->setParameter('authorized_centers', $centers)
|
||||||
->setParameter('calc_date', $this->rollingDateConverter->convert($data['calc_date']));
|
->setParameter('calc_date', $this->rollingDateConverter->convert($data['calc_date']));
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
$this->addSelectClauses($qb, $this->rollingDateConverter->convert($data['calc_date']));
|
$this->addSelectClauses($qb, $this->rollingDateConverter->convert($data['calc_date']));
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
|
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Export\Export;
|
namespace Chill\PersonBundle\Export\Export;
|
||||||
|
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
use Chill\MainBundle\Export\Helper\AggregateStringHelper;
|
use Chill\MainBundle\Export\Helper\AggregateStringHelper;
|
||||||
@@ -102,7 +101,7 @@ class ListEvaluation implements ListInterface, GroupedExportInterface
|
|||||||
DateTimeHelper $dateTimeHelper,
|
DateTimeHelper $dateTimeHelper,
|
||||||
TranslatableStringExportLabelHelper $translatableStringExportLabelHelper,
|
TranslatableStringExportLabelHelper $translatableStringExportLabelHelper,
|
||||||
AggregateStringHelper $aggregateStringHelper,
|
AggregateStringHelper $aggregateStringHelper,
|
||||||
RollingDateConverterInterface $rollingDateConverter,
|
RollingDateConverterInterface $rollingDateConverter
|
||||||
) {
|
) {
|
||||||
$this->entityManager = $entityManager;
|
$this->entityManager = $entityManager;
|
||||||
$this->socialIssueRender = $socialIssueRender;
|
$this->socialIssueRender = $socialIssueRender;
|
||||||
@@ -271,8 +270,6 @@ class ListEvaluation implements ListInterface, GroupedExportInterface
|
|||||||
->setParameter('authorized_centers', $centers)
|
->setParameter('authorized_centers', $centers)
|
||||||
->setParameter('calc_date', $this->rollingDateConverter->convert($data['calc_date']));
|
->setParameter('calc_date', $this->rollingDateConverter->convert($data['calc_date']));
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
$this->addSelectClauses($qb, $this->rollingDateConverter->convert($data['calc_date']));
|
$this->addSelectClauses($qb, $this->rollingDateConverter->convert($data['calc_date']));
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
|
@@ -266,7 +266,7 @@ class ListPerson implements ExportElementValidatedInterface, ListInterface, Grou
|
|||||||
|
|
||||||
public function supportsModifiers()
|
public function supportsModifiers()
|
||||||
{
|
{
|
||||||
return [Declarations::PERSON_TYPE, Declarations::PERSON_IMPLIED_IN];
|
return [Declarations::PERSON_TYPE];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validateForm($data, ExecutionContextInterface $context)
|
public function validateForm($data, ExecutionContextInterface $context)
|
||||||
|
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Export\Export;
|
namespace Chill\PersonBundle\Export\Export;
|
||||||
|
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
@@ -52,7 +51,7 @@ class ListPersonHavingAccompanyingPeriod implements ExportElementValidatedInterf
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
ExportAddressHelper $addressHelper,
|
ExportAddressHelper $addressHelper,
|
||||||
ListPersonHelper $listPersonHelper,
|
ListPersonHelper $listPersonHelper,
|
||||||
EntityManagerInterface $em,
|
EntityManagerInterface $em
|
||||||
) {
|
) {
|
||||||
$this->addressHelper = $addressHelper;
|
$this->addressHelper = $addressHelper;
|
||||||
$this->listPersonHelper = $listPersonHelper;
|
$this->listPersonHelper = $listPersonHelper;
|
||||||
@@ -191,8 +190,6 @@ class ListPersonHavingAccompanyingPeriod implements ExportElementValidatedInterf
|
|||||||
|
|
||||||
$this->listPersonHelper->addSelect($qb, $fields, $data['address_date']);
|
$this->listPersonHelper->addSelect($qb, $fields, $data['address_date']);
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
$qb
|
$qb
|
||||||
->addOrderBy('person.lastName')
|
->addOrderBy('person.lastName')
|
||||||
->addOrderBy('person.firstName')
|
->addOrderBy('person.firstName')
|
||||||
@@ -208,7 +205,7 @@ class ListPersonHavingAccompanyingPeriod implements ExportElementValidatedInterf
|
|||||||
|
|
||||||
public function supportsModifiers()
|
public function supportsModifiers()
|
||||||
{
|
{
|
||||||
return [Declarations::PERSON_TYPE, Declarations::PERSON_IMPLIED_IN, Declarations::ACP_TYPE];
|
return [Declarations::PERSON_TYPE, Declarations::ACP_TYPE];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validateForm($data, ExecutionContextInterface $context)
|
public function validateForm($data, ExecutionContextInterface $context)
|
||||||
|
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Export\Export;
|
namespace Chill\PersonBundle\Export\Export;
|
||||||
|
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
@@ -134,8 +133,6 @@ final readonly class ListPersonWithAccompanyingPeriodDetails implements ListInte
|
|||||||
$this->listPersonHelper->addSelect($qb, ListPersonHelper::FIELDS, $this->rollingDateConverter->convert($data['address_date']));
|
$this->listPersonHelper->addSelect($qb, ListPersonHelper::FIELDS, $this->rollingDateConverter->convert($data['address_date']));
|
||||||
$this->listAccompanyingPeriodHelper->addSelectClauses($qb, $this->rollingDateConverter->convert($data['address_date']));
|
$this->listAccompanyingPeriodHelper->addSelectClauses($qb, $this->rollingDateConverter->convert($data['address_date']));
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
$qb
|
$qb
|
||||||
->addOrderBy('person.lastName')
|
->addOrderBy('person.lastName')
|
||||||
->addOrderBy('person.firstName')
|
->addOrderBy('person.firstName')
|
||||||
@@ -152,6 +149,6 @@ final readonly class ListPersonWithAccompanyingPeriodDetails implements ListInte
|
|||||||
|
|
||||||
public function supportsModifiers()
|
public function supportsModifiers()
|
||||||
{
|
{
|
||||||
return [Declarations::PERSON_TYPE, Declarations::PERSON_IMPLIED_IN, Declarations::ACP_TYPE];
|
return [Declarations::PERSON_TYPE, Declarations::ACP_TYPE];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Export\Export;
|
namespace Chill\PersonBundle\Export\Export;
|
||||||
|
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
@@ -33,7 +32,7 @@ class StatAccompanyingCourseDuration implements ExportInterface, GroupedExportIn
|
|||||||
private EntityRepository $repository;
|
private EntityRepository $repository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManagerInterface $em,
|
EntityManagerInterface $em
|
||||||
) {
|
) {
|
||||||
$this->repository = $em->getRepository(AccompanyingPeriod::class);
|
$this->repository = $em->getRepository(AccompanyingPeriod::class);
|
||||||
}
|
}
|
||||||
@@ -143,8 +142,6 @@ class StatAccompanyingCourseDuration implements ExportInterface, GroupedExportIn
|
|||||||
->setParameter('count_acp_step', AccompanyingPeriod::STEP_DRAFT)
|
->setParameter('count_acp_step', AccompanyingPeriod::STEP_DRAFT)
|
||||||
->setParameter('authorized_centers', $centers);
|
->setParameter('authorized_centers', $centers);
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -12,28 +12,17 @@ declare(strict_types=1);
|
|||||||
namespace Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters;
|
namespace Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters;
|
||||||
|
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
||||||
use Chill\PersonBundle\Export\Declarations;
|
use Chill\PersonBundle\Export\Declarations;
|
||||||
use Chill\PersonBundle\Form\Type\PickSocialActionType;
|
use Chill\PersonBundle\Form\Type\PickSocialActionType;
|
||||||
use Chill\PersonBundle\Templating\Entity\SocialActionRender;
|
use Chill\PersonBundle\Templating\Entity\SocialActionRender;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use function in_array;
|
|
||||||
|
|
||||||
class SocialActionFilter implements FilterInterface
|
final readonly class SocialActionFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private SocialActionRender $actionRender;
|
public function __construct(private SocialActionRender $actionRender) {}
|
||||||
|
|
||||||
private TranslatableStringHelper $translatableStringHelper;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
TranslatableStringHelper $translatableStringHelper,
|
|
||||||
SocialActionRender $actionRender
|
|
||||||
) {
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
$this->actionRender = $actionRender;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
@@ -42,21 +31,17 @@ class SocialActionFilter implements FilterInterface
|
|||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
if (!in_array('acpw', $qb->getAllAliases(), true)) {
|
$qb->andWhere(
|
||||||
$qb->join('acp.works', 'acpw');
|
$qb->expr()->exists(
|
||||||
}
|
sprintf(
|
||||||
|
"SELECT 1 FROM %s acp_by_social_action_filter WHERE acp_by_social_action_filter.socialAction "
|
||||||
|
. "IN (:acp_by_social_action_filter_actions) AND acp_by_social_action_filter.accompanyingPeriod = acp",
|
||||||
|
AccompanyingPeriod\AccompanyingPeriodWork::class
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
if (!in_array('acpwsocialaction', $qb->getAllAliases(), true)) {
|
$qb->setParameter('acp_by_social_action_filter_actions', SocialAction::getDescendantsWithThisForActions($data['accepted_socialactions']));
|
||||||
$qb->join('acpw.socialAction', 'acpwsocialaction');
|
|
||||||
}
|
|
||||||
|
|
||||||
$clause = $qb->expr()->in('acpwsocialaction.id', ':socialactions');
|
|
||||||
|
|
||||||
$qb->andWhere($clause)
|
|
||||||
->setParameter(
|
|
||||||
'socialactions',
|
|
||||||
SocialAction::getDescendantsWithThisForActions($data['accepted_socialactions'])->toArray()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
|
@@ -45,23 +45,22 @@ class CompositionFilter implements FilterInterface
|
|||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
if (!in_array('composition_type_filter', $qb->getAllAliases(), true)) {
|
// there is no test on the aliases here: the name should be unique
|
||||||
$clause =
|
$clause =
|
||||||
$qb->expr()->andX(
|
$qb->expr()->andX(
|
||||||
$qb->expr()->lte('composition_type_filter.startDate', ':ondate_composition_type_filter'),
|
$qb->expr()->lte('composition_type_filter_composition.startDate', ':ondate_composition_type_filter'),
|
||||||
$qb->expr()->orX(
|
$qb->expr()->orX(
|
||||||
$qb->expr()->gt('composition_type_filter.endDate', ':ondate_composition_type_filter'),
|
$qb->expr()->gt('composition_type_filter_composition.endDate', ':ondate_composition_type_filter'),
|
||||||
$qb->expr()->isNull('composition_type_filter.endDate')
|
$qb->expr()->isNull('composition_type_filter_composition.endDate')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$qb->join('household.compositions', 'composition', Expr\Join::WITH, $clause);
|
$qb->join('household.compositions', 'composition_type_filter_composition', Expr\Join::WITH, $clause);
|
||||||
}
|
|
||||||
|
|
||||||
$whereClause = $qb->expr()->in('composition_type_filter.householdCompositionType', ':compositions');
|
$whereClause = $qb->expr()->in('composition_type_filter_composition.householdCompositionType', ':compositions_composition_type_filter');
|
||||||
|
|
||||||
$qb->andWhere($whereClause);
|
$qb->andWhere($whereClause);
|
||||||
$qb->setParameter('compositions', $data['accepted_composition']);
|
$qb->setParameter('compositions_composition_type_filter', $data['accepted_composition']);
|
||||||
$qb->setParameter(
|
$qb->setParameter(
|
||||||
'ondate_composition_type_filter',
|
'ondate_composition_type_filter',
|
||||||
$this->rollingDateConverter->convert($data['on_date'])
|
$this->rollingDateConverter->convert($data['on_date'])
|
||||||
|
@@ -19,20 +19,12 @@ use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ClosingMotiveType.
|
* Class ClosingMotiveType.
|
||||||
*/
|
*/
|
||||||
class ClosingMotiveType extends AbstractType
|
class ClosingMotiveType extends AbstractType
|
||||||
{
|
{
|
||||||
private TranslatorInterface $translator;
|
|
||||||
|
|
||||||
public function __construct(TranslatorInterface $translator)
|
|
||||||
{
|
|
||||||
$this->translator = $translator;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
@@ -54,11 +46,6 @@ class ClosingMotiveType extends AbstractType
|
|||||||
'placeholder' => 'closing_motive.any parent',
|
'placeholder' => 'closing_motive.any parent',
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'only_leaf' => false,
|
'only_leaf' => false,
|
||||||
])
|
|
||||||
->add('isCanceledAccompanyingPeriod', CheckboxType::class, [
|
|
||||||
'label' => $this->translator->trans('Consider canceled'),
|
|
||||||
'required' => false,
|
|
||||||
'help' => $this->translator->trans('Canceled parcours help')
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -122,7 +122,7 @@ final class AccompanyingPeriodWorkRepository implements ObjectRepository
|
|||||||
. ")";
|
. ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql .= " AND daterange(:after::date, :before::date) && daterange(w.startDate, w.endDate)";
|
$sql .= " AND daterange(:after::date, :before::date) && daterange(w.startDate, w.endDate, '[]')";
|
||||||
|
|
||||||
// if the start and end date were inversed, we inverse the order to avoid an error
|
// if the start and end date were inversed, we inverse the order to avoid an error
|
||||||
if (null !== ($filters['after'] ?? null) && null !== ($filters['before']) && $filters['after'] > $filters['before']) {
|
if (null !== ($filters['after'] ?? null) && null !== ($filters['before']) && $filters['after'] > $filters['before']) {
|
||||||
|
@@ -79,11 +79,10 @@ final readonly class AccompanyingPeriodACLAwareRepository implements Accompanyin
|
|||||||
Join::WITH,
|
Join::WITH,
|
||||||
'COALESCE(IDENTITY(person_address.address), IDENTITY(location_history.addressLocation)) = address.id'
|
'COALESCE(IDENTITY(person_address.address), IDENTITY(location_history.addressLocation)) = address.id'
|
||||||
)
|
)
|
||||||
->join('address.postcode', 'postcode')
|
|
||||||
->andWhere(
|
->andWhere(
|
||||||
$qb->expr()->in('postcode.code', ':postal_codes')
|
$qb->expr()->in('address.postcode', ':postal_codes')
|
||||||
)
|
)
|
||||||
->setParameter('postal_codes', array_map(fn (PostalCode $postalCode) => $postalCode->getCode(), $postalCodes));
|
->setParameter('postal_codes', $postalCodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
|
@@ -16,7 +16,6 @@ use Chill\MainBundle\Templating\Entity\BoxUtilsChillEntityRenderTrait;
|
|||||||
use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
|
use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render closing motive.
|
* Render closing motive.
|
||||||
@@ -33,7 +32,7 @@ class ClosingMotiveRender implements ChillEntityRenderInterface
|
|||||||
*/
|
*/
|
||||||
private $translatableStringHelper;
|
private $translatableStringHelper;
|
||||||
|
|
||||||
public function __construct(TranslatableStringHelper $translatableStringHelper, private TranslatorInterface $translator)
|
public function __construct(TranslatableStringHelper $translatableStringHelper)
|
||||||
{
|
{
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
}
|
}
|
||||||
@@ -63,7 +62,6 @@ class ClosingMotiveRender implements ChillEntityRenderInterface
|
|||||||
private function renderStringRecursive(ClosingMotive $motive, string $existing, array $options)
|
private function renderStringRecursive(ClosingMotive $motive, string $existing, array $options)
|
||||||
{
|
{
|
||||||
$newExisting = $this->translatableStringHelper->localize($motive->getName());
|
$newExisting = $this->translatableStringHelper->localize($motive->getName());
|
||||||
$isCancled = $motive->getIsCanceledAccompanyingPeriod() ? $this->translator->trans('( Canceled period )') : '';
|
|
||||||
|
|
||||||
if ($motive->hasParent()) {
|
if ($motive->hasParent()) {
|
||||||
if ('' !== $existing) {
|
if ('' !== $existing) {
|
||||||
@@ -72,7 +70,7 @@ class ClosingMotiveRender implements ChillEntityRenderInterface
|
|||||||
|
|
||||||
return $this->renderStringRecursive(
|
return $this->renderStringRecursive(
|
||||||
$motive->getParent(),
|
$motive->getParent(),
|
||||||
$newExisting . ' ' . $isCancled,
|
$newExisting,
|
||||||
$options
|
$options
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -81,6 +79,6 @@ class ClosingMotiveRender implements ChillEntityRenderInterface
|
|||||||
return $newExisting . self::SEPARATOR . $existing;
|
return $newExisting . self::SEPARATOR . $existing;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $newExisting . ' ' . $isCancled;
|
return $newExisting;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,6 @@ use Chill\MainBundle\Test\Export\AbstractFilterTest;
|
|||||||
use Chill\PersonBundle\Entity\Household\Household;
|
use Chill\PersonBundle\Entity\Household\Household;
|
||||||
use Chill\PersonBundle\Entity\Household\HouseholdCompositionType;
|
use Chill\PersonBundle\Entity\Household\HouseholdCompositionType;
|
||||||
use Chill\PersonBundle\Export\Filter\HouseholdFilters\CompositionFilter;
|
use Chill\PersonBundle\Export\Filter\HouseholdFilters\CompositionFilter;
|
||||||
use DateTime;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,36 +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\Person;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add isCanceledAccompanyingPeriod property to ClosingMotive
|
|
||||||
*/
|
|
||||||
final class Version20230918115305 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return 'Add isCanceledAccompanyingPeriod property to ClosingMotive';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql('ALTER TABLE chill_person_accompanying_period_closingmotive ADD isCanceledAccompanyingPeriod BOOLEAN DEFAULT FALSE NOT NULL');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql('ALTER TABLE chill_person_accompanying_period_closingmotive DROP isCanceledAccompanyingPeriod');
|
|
||||||
}
|
|
||||||
}
|
|
@@ -0,0 +1,60 @@
|
|||||||
|
<?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\Person;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
final class Version20231002094521 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'Remove doublons in chill_person_accompanying_period_location_history and add a constraint on startdate / endDate by period';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql(
|
||||||
|
<<<'SQL'
|
||||||
|
WITH doublons_ordered AS (
|
||||||
|
SELECT h2.id AS h2id, h2.createdAt AS h2createdAt, h2.startDate AS h2start, h2.endDate AS h2end, h1.*,
|
||||||
|
rank() OVER (partition by h1.period_id ORDER BY h1.id, h2.id) AS ranking
|
||||||
|
FROM chill_person_accompanying_period_location_history h1
|
||||||
|
JOIN chill_person_accompanying_period_location_history h2 ON h1.period_id = h2.period_id AND h1.id <> h2.id
|
||||||
|
WHERE daterange(h1.startdate, h1.enddate) && daterange(h2.startdate, h2.enddate) ORDER BY h1.period_id, h1.id
|
||||||
|
),
|
||||||
|
keep_only_first AS (
|
||||||
|
SELECT id FROM doublons_ordered WHERE ranking > 1
|
||||||
|
)
|
||||||
|
DELETE FROM chill_person_accompanying_period_location_history WHERE id IN (SELECT id FROM doublons_ordered);
|
||||||
|
SQL
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->addSql(
|
||||||
|
<<<'SQL'
|
||||||
|
ALTER TABLE chill_person_accompanying_period_location_history
|
||||||
|
ADD CONSTRAINT acc_period_location_history_not_overlaps
|
||||||
|
EXCLUDE USING GIST (period_id with =, tsrange(startdate, enddate) with &&)
|
||||||
|
DEFERRABLE INITIALLY DEFERRED
|
||||||
|
SQL
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql(
|
||||||
|
<<<'SQL'
|
||||||
|
ALTER TABLE chill_person_accompanying_period_location_history DROP CONSTRAINT acc_period_location_history_not_overlaps
|
||||||
|
SQL
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@@ -349,9 +349,6 @@ CHILL_PERSON_HOUSEHOLD_STATS: Statistiques sur les ménages
|
|||||||
#period
|
#period
|
||||||
Period closed!: Parcours clôturé!
|
Period closed!: Parcours clôturé!
|
||||||
Pediod closing form is not valide: Le formulaire de fermeture n'est pas valide
|
Pediod closing form is not valide: Le formulaire de fermeture n'est pas valide
|
||||||
Consider canceled: Permet de considérer les parcours comme annulés
|
|
||||||
Canceled parcours help: Si coché, les parcours avec ce motif de cloture seront considérés comme annulés et ne seront pas pris en compte pour les statistiques. La modification se reflétera pour tous les motifs enfants
|
|
||||||
( Canceled period ): ( annulé )
|
|
||||||
|
|
||||||
#widget
|
#widget
|
||||||
|
|
||||||
|
@@ -463,7 +463,7 @@ class ReportList implements ExportElementValidatedInterface, ListInterface
|
|||||||
|
|
||||||
public function supportsModifiers()
|
public function supportsModifiers()
|
||||||
{
|
{
|
||||||
return [Declarations::PERSON_IMPLIED_IN, Declarations::PERSON_TYPE, 'report'];
|
return [Declarations::PERSON_TYPE, 'report'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validateForm($data, ExecutionContextInterface $context)
|
public function validateForm($data, ExecutionContextInterface $context)
|
||||||
|
@@ -38,7 +38,7 @@ class SingleTaskPlaceEvent extends AbstractTaskPlaceEvent
|
|||||||
* @ORM\Id
|
* @ORM\Id
|
||||||
* @ORM\GeneratedValue(strategy="AUTO")
|
* @ORM\GeneratedValue(strategy="AUTO")
|
||||||
*/
|
*/
|
||||||
private $id;
|
private ?int $id = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var SingleTask
|
* @var SingleTask
|
||||||
@@ -70,11 +70,4 @@ class SingleTaskPlaceEvent extends AbstractTaskPlaceEvent
|
|||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setId($id): self
|
|
||||||
{
|
|
||||||
$this->id = $id;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
<dt>{{ 'Name'|trans }}</dt>
|
<dt>{{ 'Name'|trans }}</dt>
|
||||||
<dd>
|
<dd>
|
||||||
{% if thirdParty.isLeaf == true %}{{ thirdParty.civility }}{% endif %}
|
{% if thirdParty.isLeaf == true and thirdParty.civility is not same as null %}{{ thirdParty.civility.name|localize_translatable_string }}{% endif %}
|
||||||
{{ thirdParty.firstname ~ ' ' ~ thirdParty.name }}
|
{{ thirdParty.firstname ~ ' ' ~ thirdParty.name }}
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user