-
+
{{ include('@ChillMain/Export/_breadcrumb.html.twig') }}
-
+
-{% endblock content %}
\ No newline at end of file
+{% endblock content %}
diff --git a/src/Bundle/ChillMainBundle/Resources/views/SavedExport/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/SavedExport/index.html.twig
index fd0cda2a7..7e0517e31 100644
--- a/src/Bundle/ChillMainBundle/Resources/views/SavedExport/index.html.twig
+++ b/src/Bundle/ChillMainBundle/Resources/views/SavedExport/index.html.twig
@@ -22,18 +22,28 @@
{{ s.export.title|trans }}
{{ s.saved.title }}
-
+
{{ 'saved_export.Created on %date%'|trans({'%date%': s.saved.createdAt|format_datetime('long', 'short')}) }}
-
+
{{ s.saved.description|chill_markdown_to_html }}
-
+
{{ s.export.title|trans }}
{{ s.saved.title }}
-
+
{{ 'saved_export.Created on %date%'|trans({'%date%': s.saved.createdAt|format_datetime('long', 'short')}) }}
-
+
{{ s.saved.description|chill_markdown_to_html }}
-
+
diff --git a/src/Bundle/ChillMainBundle/config/services/export.yaml b/src/Bundle/ChillMainBundle/config/services/export.yaml
index ea7328839..b0dbf934d 100644
--- a/src/Bundle/ChillMainBundle/config/services/export.yaml
+++ b/src/Bundle/ChillMainBundle/config/services/export.yaml
@@ -6,6 +6,8 @@ services:
Chill\MainBundle\Export\Helper\:
resource: '../../Export/Helper'
+ Chill\MainBundle\Export\ExportFormHelper: ~
+
chill.main.export_element_validator:
class: Chill\MainBundle\Validator\Constraints\Export\ExportElementConstraintValidator
tags:
diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml
index 78de523c4..bbe3d23fb 100644
--- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml
+++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml
@@ -598,7 +598,10 @@ saved_export:
Export is deleted: L'export est supprimé
Saved export is saved!: L'export est enregistré
Created on %date%: Créé le %date%
-
+ update_title_and_description: Modifier le titre et la description
+ update_filters_aggregators_and_execute: Modifier les filtres et regroupements et télécharger
+ execute: Télécharger
+ Update existing: Mettre à jour le rapport enregistré existant
absence:
# single letter for absence
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php
index 96deac574..56fdc07d7 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php
@@ -57,6 +57,10 @@ class AdministrativeLocationAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByActionNumberAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByActionNumberAggregator.php
index 2dffccbbb..104b934ca 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByActionNumberAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByActionNumberAggregator.php
@@ -39,6 +39,10 @@ class ByActionNumberAggregator implements AggregatorInterface
{
// No form needed
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php
index 342958361..73cfdc7b9 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php
@@ -52,6 +52,10 @@ class ClosingMotiveAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php
index e9b9e28fa..4ad18030e 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php
@@ -48,6 +48,10 @@ class ConfidentialAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php
index c336a8887..5a060bcd7 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php
@@ -57,6 +57,10 @@ class CreatorJobAggregator implements AggregatorInterface
{
// No form needed
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php
index 0dc66e81e..581c7d6e5 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php
@@ -84,6 +84,10 @@ final class DurationAggregator implements AggregatorInterface
'expanded' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php
index 02f9f5cd9..4429c7b62 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php
@@ -48,6 +48,10 @@ class EmergencyAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php
index b6436efc0..119fa50b7 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php
@@ -61,6 +61,10 @@ final class EvaluationAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php
index d001cbef7..a83634830 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php
@@ -121,7 +121,6 @@ final class GeographicalUnitStatAggregator implements AggregatorInterface
->add('date_calc', PickRollingDateType::class, [
'label' => 'Compute geographical location at date',
'required' => true,
- 'data' => new RollingDate(RollingDate::T_TODAY),
])
->add('level', EntityType::class, [
'label' => 'Geographical layer',
@@ -133,6 +132,10 @@ final class GeographicalUnitStatAggregator implements AggregatorInterface
'expanded' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['date_calc' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php
index a3618f40f..ac55d7734 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php
@@ -48,6 +48,10 @@ class IntensityAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregator.php
index 37d0c7b20..1d01920d5 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregator.php
@@ -59,6 +59,10 @@ final class OriginAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php
index a09097fd2..7b826600a 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php
@@ -81,11 +81,14 @@ final class ReferrerAggregator implements AggregatorInterface
{
$builder
->add('date_calc', PickRollingDateType::class, [
- 'data' => new RollingDate(RollingDate::T_TODAY),
'label' => 'export.aggregator.course.by_referrer.Computation date for referrer',
'required' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['date_calc' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php
index ccbd21da1..adfd9b489 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php
@@ -88,11 +88,14 @@ class ReferrerScopeAggregator implements AggregatorInterface
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('date_calc', PickRollingDateType::class, [
- 'data' => new RollingDate(RollingDate::T_TODAY),
'label' => 'export.aggregator.course.by_user_scope.Computation date for referrer',
'required' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['date_calc' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php
index 7b5cf0edd..3baf9bd33 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php
@@ -69,6 +69,10 @@ final class RequestorAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php
index 8f34661bb..253727c89 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php
@@ -57,6 +57,10 @@ final class ScopeAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php
index 3bdd6549e..b82b47ad0 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php
@@ -58,6 +58,10 @@ final class SocialActionAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php
index 12fa5a454..29fcba4a2 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php
@@ -58,6 +58,10 @@ final class SocialIssueAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php
index 85cfc3190..7632f72f0 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php
@@ -76,9 +76,11 @@ final class StepAggregator implements AggregatorInterface
public function buildForm(FormBuilderInterface $builder)
{
- $builder->add('on_date', PickRollingDateType::class, [
- 'data' => new RollingDate(RollingDate::T_TODAY),
- ]);
+ $builder->add('on_date', PickRollingDateType::class, []);
+ }
+ public function getFormDefaultData(): array
+ {
+ return ['on_date' => new RollingDate(RollingDate::T_TODAY)];
}
public function getLabels($key, array $values, $data)
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php
index a8acdcf12..13d1e3f83 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php
@@ -57,6 +57,10 @@ final class UserJobAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php
index 2f4275c49..cb66fa600 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php
@@ -75,9 +75,12 @@ class ByEndDateAggregator implements AggregatorInterface
'multiple' => false,
'expanded' => true,
'empty_data' => self::DEFAULT_CHOICE,
- 'data' => self::DEFAULT_CHOICE,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['frequency' => self::DEFAULT_CHOICE];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php
index 9283fd9dc..af6dfc465 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php
@@ -75,9 +75,12 @@ class ByMaxDateAggregator implements AggregatorInterface
'multiple' => false,
'expanded' => true,
'empty_data' => self::DEFAULT_CHOICE,
- 'data' => self::DEFAULT_CHOICE,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['frequency' => self::DEFAULT_CHOICE];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php
index cd183b25e..87a6a672b 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php
@@ -75,9 +75,12 @@ class ByStartDateAggregator implements AggregatorInterface
'multiple' => false,
'expanded' => true,
'empty_data' => self::DEFAULT_CHOICE,
- 'data' => self::DEFAULT_CHOICE,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['frequency' => self::DEFAULT_CHOICE];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php
index 0c13611cb..a48ed763d 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php
@@ -52,6 +52,10 @@ class EvaluationTypeAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php
index e33bb326f..e710949fd 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php
@@ -48,6 +48,10 @@ class HavingEndDateAggregator implements AggregatorInterface
{
// No form needed
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php
index 0c9bc623f..1c5b3dc2c 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php
@@ -72,9 +72,11 @@ class ChildrenNumberAggregator implements AggregatorInterface
public function buildForm(FormBuilderInterface $builder)
{
- $builder->add('on_date', PickRollingDateType::class, [
- 'data' => new RollingDate(RollingDate::T_TODAY),
- ]);
+ $builder->add('on_date', PickRollingDateType::class, []);
+ }
+ public function getFormDefaultData(): array
+ {
+ return ['on_date' => new RollingDate(RollingDate::T_TODAY)];
}
public function getLabels($key, array $values, $data)
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php
index 52bcd88e5..62fc20173 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php
@@ -77,9 +77,11 @@ class CompositionAggregator implements AggregatorInterface
public function buildForm(FormBuilderInterface $builder)
{
- $builder->add('on_date', PickRollingDateType::class, [
- 'data' => new RollingDate(RollingDate::T_TODAY),
- ]);
+ $builder->add('on_date', PickRollingDateType::class, []);
+ }
+ public function getFormDefaultData(): array
+ {
+ return ['on_date' => new RollingDate(RollingDate::T_TODAY)];
}
public function getLabels($key, array $values, $data)
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php
index 365a73704..2a63e475a 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php
@@ -50,12 +50,15 @@ final class AgeAggregator implements AggregatorInterface, ExportElementValidated
{
$builder->add('date_age_calculation', DateType::class, [
'label' => 'Calculate age in relation to this date',
- 'data' => new DateTime(),
'attr' => ['class' => 'datepicker'],
'widget' => 'single_text',
'format' => 'dd-MM-yyyy',
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['date_age_calculation' => new DateTime()];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php
index 80f0faa17..16b62c2b5 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php
@@ -94,9 +94,12 @@ class ByHouseholdCompositionAggregator implements AggregatorInterface
{
$builder->add('date_calc', PickRollingDateType::class, [
'label' => 'export.aggregator.person.by_household_composition.Calc date',
- 'data' => new RollingDate(RollingDate::T_TODAY),
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['date_calc' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php
index 3d785b586..90882245e 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php
@@ -108,6 +108,10 @@ final class CountryOfBirthAggregator implements AggregatorInterface, ExportEleme
'multiple' => false,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php
index f76420047..dbe3d19d3 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php
@@ -48,6 +48,10 @@ final class GenderAggregator implements AggregatorInterface
public function buildForm(FormBuilderInterface $builder)
{
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php
index 5d73c1fdd..a72d91db2 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php
@@ -93,7 +93,6 @@ class GeographicalUnitAggregator implements AggregatorInterface
->add('date_calc', PickRollingDateType::class, [
'label' => 'Address valid at this date',
'required' => true,
- 'data' => new RollingDate(RollingDate::T_TODAY),
])
->add('level', EntityType::class, [
'label' => 'Geographical layer',
@@ -105,6 +104,10 @@ class GeographicalUnitAggregator implements AggregatorInterface
'expanded' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['date_calc' => new RollingDate(RollingDate::T_TODAY)];
+ }
public static function getDefaultAlias(): string
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php
index 107634803..63d84d4da 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php
@@ -90,9 +90,12 @@ final class HouseholdPositionAggregator implements AggregatorInterface, ExportEl
{
$builder->add('date_position', PickRollingDateType::class, [
'label' => 'Household position in relation to this date',
- 'data' => new RollingDate(RollingDate::T_TODAY),
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['date_position' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php
index 08bde4bda..508efd3ad 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php
@@ -56,6 +56,11 @@ final class MaritalStatusAggregator implements AggregatorInterface
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
+
public function getLabels($key, array $values, $data)
{
return function ($value): string {
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php
index d7c4097af..57721f55c 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php
@@ -103,6 +103,13 @@ final class NationalityAggregator implements AggregatorInterface, ExportElementV
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [
+ 'group_by_level' => 'country',
+ ];
+ }
+
public function getLabels($key, array $values, $data)
{
$labels = [];
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php
index c1fccb968..66c87d94f 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php
@@ -75,6 +75,10 @@ final class ActionTypeAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php
index 58fcb2874..539c9f286 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php
@@ -51,6 +51,10 @@ class CurrentActionAggregator implements AggregatorInterface
{
// No form needed
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php
index 8cc6a25da..4c0e8b393 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php
@@ -55,6 +55,10 @@ final class GoalAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php
index 17b263d7e..c99ee85ea 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php
@@ -68,6 +68,10 @@ class GoalResultAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php
index cbf07091f..8271c90e3 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php
@@ -57,6 +57,10 @@ final class JobAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php
index 0fe53b707..047504224 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php
@@ -57,6 +57,10 @@ final class ReferrerAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php
index 2e46673da..3cce7b283 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php
@@ -55,6 +55,10 @@ final class ResultAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php
index 243263b83..0828b5d0d 100644
--- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php
+++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php
@@ -57,6 +57,10 @@ final class ScopeAggregator implements AggregatorInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getLabels($key, array $values, $data)
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php
index 978f88a10..75583dfa0 100644
--- a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php
+++ b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php
@@ -39,6 +39,10 @@ class CountAccompanyingCourse implements ExportInterface, GroupedExportInterface
{
// Nothing to add here
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getAllowedFormattersTypes(): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWork.php
index 122ee14d9..8a035bdcd 100644
--- a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWork.php
+++ b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWork.php
@@ -38,6 +38,10 @@ class CountAccompanyingPeriodWork implements ExportInterface, GroupedExportInter
{
// No form necessary?
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getAllowedFormattersTypes(): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php b/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php
index 1613b63d3..3de433e2e 100644
--- a/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php
+++ b/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php
@@ -37,6 +37,10 @@ class CountEvaluation implements ExportInterface, GroupedExportInterface
{
// TODO: Implement buildForm() method.
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getAllowedFormattersTypes(): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountHousehold.php b/src/Bundle/ChillPersonBundle/Export/Export/CountHousehold.php
index 0b693b9d8..05e32fde6 100644
--- a/src/Bundle/ChillPersonBundle/Export/Export/CountHousehold.php
+++ b/src/Bundle/ChillPersonBundle/Export/Export/CountHousehold.php
@@ -46,11 +46,14 @@ class CountHousehold implements ExportInterface, GroupedExportInterface
{
$builder
->add('calc_date', PickRollingDateType::class, [
- 'data' => new RollingDate(RollingDate::T_TODAY),
'label' => self::TR_PREFIX . 'Date of calculation of household members',
'required' => false,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['calc_date' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function getAllowedFormattersTypes(): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php b/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php
index 60429ae55..c1800395c 100644
--- a/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php
+++ b/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php
@@ -38,6 +38,11 @@ class CountPerson implements ExportInterface, GroupedExportInterface
// No form necessary
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
+
public function getAllowedFormattersTypes()
{
return [FormatterInterface::TYPE_TABULAR];
@@ -115,9 +120,9 @@ class CountPerson implements ExportInterface, GroupedExportInterface
public function supportsModifiers()
{
return [
- Declarations::PERSON_TYPE,
- Declarations::PERSON_IMPLIED_IN,
- //Declarations::ACP_TYPE
+ 'abcde',
+ //Declarations::PERSON_TYPE,
+ //Declarations::PERSON_IMPLIED_IN,
];
}
}
diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php b/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php
index e52cc83b1..ae7238d4e 100644
--- a/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php
+++ b/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php
@@ -39,6 +39,10 @@ class CountPersonWithAccompanyingCourse implements ExportInterface, GroupedExpor
{
// TODO: Implement buildForm() method.
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getAllowedFormattersTypes(): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php
index 0647460dd..294b9ce9a 100644
--- a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php
+++ b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php
@@ -20,6 +20,7 @@ use Chill\MainBundle\Export\Helper\ExportAddressHelper;
use Chill\MainBundle\Export\Helper\UserHelper;
use Chill\MainBundle\Export\ListInterface;
use Chill\MainBundle\Form\Type\PickRollingDateType;
+use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
@@ -144,6 +145,12 @@ class ListAccompanyingPeriod implements ListInterface, GroupedExportInterface
'required' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [
+ 'calc_date' => new RollingDate(RollingDate::T_TODAY)
+ ];
+ }
public function getAllowedFormattersTypes()
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWork.php
index 00fa8adb1..c437454c2 100644
--- a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWork.php
+++ b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWork.php
@@ -135,9 +135,12 @@ class ListAccompanyingPeriodWork implements ListInterface, GroupedExportInterfac
'label' => 'export.list.acpw.Date of calculation for associated elements',
'help' => 'export.list.acpw.help_description',
'required' => true,
- 'data' => new RollingDate(RollingDate::T_TODAY),
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['calc_date' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function getAllowedFormattersTypes()
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php b/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php
index f0985436b..c3e273733 100644
--- a/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php
+++ b/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php
@@ -123,9 +123,12 @@ class ListEvaluation implements ListInterface, GroupedExportInterface
'label' => 'export.list.eval.Date of calculation for associated elements',
'help' => 'export.list.eval.help_description',
'required' => true,
- 'data' => new RollingDate(RollingDate::T_TODAY),
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['calc_date' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function getAllowedFormattersTypes()
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php
index 8894d145d..4dcc89495 100644
--- a/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php
+++ b/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php
@@ -75,10 +75,13 @@ class ListHouseholdInPeriod implements ListInterface, GroupedExportInterface
->add('calc_date', PickRollingDateType::class, [
'label' => 'export.list.household.Date of calculation for associated elements',
'help' => 'export.list.household.help_description',
- 'data' => new RollingDate(RollingDate::T_TODAY),
'required' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['calc_date' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function getAllowedFormattersTypes()
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php
index 8145fd658..467bc02ea 100644
--- a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php
+++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php
@@ -107,17 +107,27 @@ class ListPerson implements ExportElementValidatedInterface, ListInterface, Grou
}
},
])],
- 'data' => array_values($choices),
]);
// add a date field for addresses
$builder->add('address_date', ChillDateType::class, [
'label' => 'Data valid at this date',
'help' => 'Data regarding center, addresses, and so on will be computed at this date',
- 'data' => new DateTimeImmutable(),
'input' => 'datetime_immutable',
]);
}
+ public function getFormDefaultData(): array
+ {
+ $choices = array_combine(ListPersonHelper::FIELDS, ListPersonHelper::FIELDS);
+
+ foreach ($this->getCustomFields() as $cf) {
+ $choices[$this->translatableStringHelper->localize($cf->getName())]
+ =
+ $cf->getSlug();
+ }
+
+ return ['fields' => array_values($choices), 'address_date' => new DateTimeImmutable()];
+ }
public function getAllowedFormattersTypes()
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php
index e40ffccce..e7c105604 100644
--- a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php
+++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php
@@ -74,9 +74,12 @@ class ListPersonDuplicate implements DirectExportInterface, ExportElementValidat
{
$builder->add('precision', NumberType::class, [
'label' => 'Precision',
- 'data' => self::PRECISION_DEFAULT_VALUE,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['precision' => self::PRECISION_DEFAULT_VALUE];
+ }
public function generate(array $acl, array $data = []): Response
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriod.php
index 7cb066e87..370046232 100644
--- a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriod.php
+++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriod.php
@@ -57,7 +57,6 @@ class ListPersonWithAccompanyingPeriod implements ExportElementValidatedInterfac
{
$choices = array_combine(ListPersonHelper::FIELDS, ListPersonHelper::FIELDS);
- // Add a checkbox to select fields
$builder->add('fields', ChoiceType::class, [
'multiple' => true,
'expanded' => true,
@@ -80,17 +79,20 @@ class ListPersonWithAccompanyingPeriod implements ExportElementValidatedInterfac
}
},
])],
- 'data' => array_values($choices),
]);
- // add a date field for addresses
$builder->add('address_date', ChillDateType::class, [
'label' => 'Data valid at this date',
'help' => 'Data regarding center, addresses, and so on will be computed at this date',
- 'data' => new DateTimeImmutable(),
'input' => 'datetime_immutable',
]);
}
+ public function getFormDefaultData(): array
+ {
+ $choices = array_combine(ListPersonHelper::FIELDS, ListPersonHelper::FIELDS);
+
+ return ['fields' => array_values($choices), 'address_date' => new DateTimeImmutable()];
+ }
public function getAllowedFormattersTypes()
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php b/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php
index 31ca41cbb..66b47131d 100644
--- a/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php
+++ b/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php
@@ -41,9 +41,12 @@ class StatAccompanyingCourseDuration implements ExportInterface, GroupedExportIn
{
$builder->add('closingdate', ChillDateType::class, [
'label' => 'Closingdate to apply',
- 'data' => new DateTime('now'),
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['closingdate' => new DateTime('now')];
+ }
public function getAllowedFormattersTypes(): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php
index 3fa8d711f..fcb4d67fb 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php
@@ -67,9 +67,11 @@ class ActiveOnDateFilter implements FilterInterface
public function buildForm(FormBuilderInterface $builder)
{
$builder
- ->add('on_date', PickRollingDateType::class, [
- 'data' => new RollingDate(RollingDate::T_TODAY),
- ]);
+ ->add('on_date', PickRollingDateType::class, []);
+ }
+ public function getFormDefaultData(): array
+ {
+ return ['on_date' => new RollingDate(RollingDate::T_TODAY)];
}
public function describeAction($data, $format = 'string'): array
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php
index f713e8a97..ae21dc724 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php
@@ -56,12 +56,12 @@ class ActiveOneDayBetweenDatesFilter implements FilterInterface
public function buildForm(FormBuilderInterface $builder)
{
$builder
- ->add('date_from', PickRollingDateType::class, [
- 'data' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START),
- ])
- ->add('date_to', PickRollingDateType::class, [
- 'data' => new RollingDate(RollingDate::T_TODAY),
- ]);
+ ->add('date_from', PickRollingDateType::class, [])
+ ->add('date_to', PickRollingDateType::class, []);
+ }
+ public function getFormDefaultData(): array
+ {
+ return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)];
}
public function describeAction($data, $format = 'string'): array
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php
index c74e309b2..aa1abb36e 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php
@@ -53,6 +53,10 @@ class AdministrativeLocationFilter implements FilterInterface
'multiple' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php
index e57370f30..153b2ecbd 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php
@@ -64,6 +64,10 @@ class ClosingMotiveFilter implements FilterInterface
'expanded' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php
index 8fcd874fe..8811b9930 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php
@@ -22,11 +22,11 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class ConfidentialFilter implements FilterInterface
{
private const CHOICES = [
- 'is not confidential' => false,
- 'is confidential' => true,
+ 'is not confidential' => 'false',
+ 'is confidential' => 'true',
];
- private const DEFAULT_CHOICE = false;
+ private const DEFAULT_CHOICE = 'false';
private TranslatorInterface $translator;
@@ -67,9 +67,12 @@ class ConfidentialFilter implements FilterInterface
'multiple' => false,
'expanded' => true,
'empty_data' => self::DEFAULT_CHOICE,
- 'data' => self::DEFAULT_CHOICE,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['accepted_confidentials' => self::DEFAULT_CHOICE];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorFilter.php
index b13947e60..8a8a24013 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorFilter.php
@@ -50,6 +50,10 @@ class CreatorFilter implements FilterInterface
'label' => false,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php
index f585cfafb..5faeb850f 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php
@@ -69,6 +69,10 @@ class CreatorJobFilter implements FilterInterface
'label' => 'Job',
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php
index afdb717f0..f9d45c9d7 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php
@@ -22,11 +22,11 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class EmergencyFilter implements FilterInterface
{
private const CHOICES = [
- 'is emergency' => true,
- 'is not emergency' => false,
+ 'is emergency' => 'true',
+ 'is not emergency' => 'false',
];
- private const DEFAULT_CHOICE = false;
+ private const DEFAULT_CHOICE = 'false';
private TranslatorInterface $translator;
@@ -67,9 +67,12 @@ class EmergencyFilter implements FilterInterface
'multiple' => false,
'expanded' => true,
'empty_data' => self::DEFAULT_CHOICE,
- 'data' => self::DEFAULT_CHOICE,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['accepted_emergency' => self::DEFAULT_CHOICE];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php
index ab7f4257e..a6fb3583d 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php
@@ -75,6 +75,10 @@ class EvaluationFilter implements FilterInterface
'attr' => ['class' => 'select2'],
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php
index d35565c80..a20cfc08f 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php
@@ -100,7 +100,6 @@ class GeographicalUnitStatFilter implements FilterInterface
->add('date_calc', PickRollingDateType::class, [
'label' => 'Compute geographical location at date',
'required' => true,
- 'data' => new RollingDate(RollingDate::T_TODAY),
])
->add('units', ChoiceType::class, [
'label' => 'Geographical unit',
@@ -114,6 +113,10 @@ class GeographicalUnitStatFilter implements FilterInterface
'multiple' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['date_calc' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php
index 54c28d027..4820116c0 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php
@@ -38,6 +38,10 @@ class HasNoActionFilter implements FilterInterface
{
// no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php
index 4c682a56a..6d01ea7c2 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php
@@ -65,9 +65,12 @@ class HasNoReferrerFilter implements FilterInterface
$builder
->add('calc_date', PickRollingDateType::class, [
'label' => 'Has no referrer on this date',
- 'data' => new RollingDate(RollingDate::T_TODAY),
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['calc_date' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php
index 615ace4c6..ec3b4e417 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php
@@ -92,9 +92,12 @@ class HasTemporaryLocationFilter implements FilterInterface
])
->add('calc_date', PickRollingDateType::class, [
'label' => 'export.filter.course.having_temporarily.Calculation date',
- 'data' => new RollingDate(RollingDate::T_TODAY),
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['calc_date' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php
index 7069a1d80..d50622502 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php
@@ -38,13 +38,14 @@ final readonly class HavingAnAccompanyingPeriodInfoWithinDatesFilter implements
$builder
->add('start_date', PickRollingDateType::class, [
'label' => 'export.filter.course.having_info_within_interval.start_date',
- 'data' => new RollingDate(RollingDate::T_TODAY),
])
->add('end_date', PickRollingDateType::class, [
'label' => 'export.filter.course.having_info_within_interval.end_date',
- 'data' => new RollingDate(RollingDate::T_TODAY),
- ])
- ;
+ ]);
+ }
+ public function getFormDefaultData(): array
+ {
+ return ['start_date' => new RollingDate(RollingDate::T_TODAY), 'end_date' => new RollingDate(RollingDate::T_TODAY)];
}
public function getTitle(): string
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php
index b0c2205a0..1fd05d2b4 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php
@@ -67,9 +67,12 @@ class IntensityFilter implements FilterInterface
'multiple' => false,
'expanded' => true,
'empty_data' => self::DEFAULT_CHOICE,
- 'data' => self::DEFAULT_CHOICE,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['accepted_intensities' => self::DEFAULT_CHOICE];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php
index 07ca1de75..e9413083f 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php
@@ -54,12 +54,12 @@ class OpenBetweenDatesFilter implements FilterInterface
public function buildForm(FormBuilderInterface $builder)
{
$builder
- ->add('date_from', PickRollingDateType::class, [
- 'data' => new RollingDate(RollingDate::T_MONTH_PREVIOUS_START),
- ])
- ->add('date_to', PickRollingDateType::class, [
- 'data' => new RollingDate(RollingDate::T_TODAY),
- ]);
+ ->add('date_from', PickRollingDateType::class, [])
+ ->add('date_to', PickRollingDateType::class, []);
+ }
+ public function getFormDefaultData(): array
+ {
+ return ['date_from' => new RollingDate(RollingDate::T_MONTH_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)];
}
public function describeAction($data, $format = 'string'): array
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php
index 00febc640..8395c79f8 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php
@@ -64,6 +64,10 @@ class OriginFilter implements FilterInterface
'expanded' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php
index 2a3e5d17e..f0bf65d49 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php
@@ -77,11 +77,14 @@ class ReferrerFilter implements FilterInterface
'multiple' => true,
])
->add('date_calc', PickRollingDateType::class, [
- 'data' => new RollingDate(RollingDate::T_TODAY),
'label' => 'export.filter.course.by_referrer.Computation date for referrer',
'required' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['date_calc' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php
index 3295a5b57..614889c27 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php
@@ -126,9 +126,12 @@ final class RequestorFilter implements FilterInterface
'multiple' => false,
'expanded' => true,
'empty_data' => self::DEFAULT_CHOICE,
- 'data' => self::DEFAULT_CHOICE,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['accepted_choices' => self::DEFAULT_CHOICE];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php
index bc1f368da..0c14ba73a 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php
@@ -70,6 +70,10 @@ class SocialActionFilter implements FilterInterface
'multiple' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialIssueFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialIssueFilter.php
index 917e129bf..a793bc548 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialIssueFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialIssueFilter.php
@@ -69,6 +69,10 @@ class SocialIssueFilter implements FilterInterface
'multiple' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php
index 05d84d7b2..e7685fe4d 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php
@@ -96,11 +96,14 @@ class UserJobFilter implements FilterInterface
'label' => 'Job',
])
->add('date_calc', PickRollingDateType::class, [
- 'data' => new RollingDate(RollingDate::T_TODAY),
'label' => 'export.filter.course.by_user_scope.Computation date for referrer',
'required' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['date_calc' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function describeAction($data, $format = 'string')
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php
index bbffa4bca..7c8d84499 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php
@@ -100,11 +100,14 @@ class UserScopeFilter implements FilterInterface
'expanded' => true,
])
->add('date_calc', PickRollingDateType::class, [
- 'data' => new RollingDate(RollingDate::T_TODAY),
'label' => 'export.filter.course.by_user_scope.Computation date for referrer',
'required' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['date_calc' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function describeAction($data, $format = 'string')
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php
index 586bb645d..d078443af 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php
@@ -42,6 +42,10 @@ readonly class UserWorkingOnCourseFilter implements FilterInterface
'multiple' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function getTitle(): string
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php
index de86604e6..4c019cc73 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php
@@ -57,13 +57,15 @@ class ByEndDateFilter implements FilterInterface
$builder
->add('start_date', PickRollingDateType::class, [
'label' => 'start period date',
- 'data' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START),
])
->add('end_date', PickRollingDateType::class, [
'label' => 'end period date',
- 'data' => new RollingDate(RollingDate::T_TODAY),
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['start_date' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'end_date' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php
index 27518599c..ea221e87b 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php
@@ -57,13 +57,15 @@ class ByStartDateFilter implements FilterInterface
$builder
->add('start_date', PickRollingDateType::class, [
'label' => 'start period date',
- 'data' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START),
])
->add('end_date', PickRollingDateType::class, [
'label' => 'end period date',
- 'data' => new RollingDate(RollingDate::T_TODAY),
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['start_date' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'end_date' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/CurrentEvaluationsFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/CurrentEvaluationsFilter.php
index 140f6c3cb..8841c7b9e 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/CurrentEvaluationsFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/CurrentEvaluationsFilter.php
@@ -37,6 +37,10 @@ class CurrentEvaluationsFilter implements FilterInterface
{
//no form needed
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php
index 6a0c71d55..77bae1b56 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php
@@ -64,6 +64,10 @@ final class EvaluationTypeFilter implements FilterInterface
'expanded' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php
index 4a65452a1..daa7d1954 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php
@@ -61,6 +61,10 @@ class MaxDateFilter implements FilterInterface
'expanded' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php
index 22761c158..3a2cb5337 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php
@@ -84,9 +84,11 @@ class CompositionFilter implements FilterInterface
'multiple' => true,
'expanded' => true,
])
- ->add('on_date', PickRollingDateType::class, [
- 'data' => new RollingDate(RollingDate::T_TODAY),
- ]);
+ ->add('on_date', PickRollingDateType::class, []);
+ }
+ public function getFormDefaultData(): array
+ {
+ return ['on_date' => new RollingDate(RollingDate::T_TODAY)];
}
public function describeAction($data, $format = 'string'): array
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php
index 7580a37a3..5588d8c15 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php
@@ -76,17 +76,19 @@ class AddressRefStatusFilter implements \Chill\MainBundle\Export\FilterInterface
->add('date_calc', PickRollingDateType::class, [
'label' => 'Compute address at date',
'required' => true,
- 'data' => new RollingDate(RollingDate::T_TODAY),
])
->add('ref_statuses', ChoiceType::class, [
'label' => 'export.filter.person.by_address_ref_status.Status',
'choices' => [Address::ADDR_REFERENCE_STATUS_TO_REVIEW, Address::ADDR_REFERENCE_STATUS_REVIEWED, Address::ADDR_REFERENCE_STATUS_MATCH],
'choice_label' => fn (string $item) => 'export.filter.person.by_address_ref_status.'.$item,
'multiple' => true,
- 'expanded' => true,
- 'data' => [Address::ADDR_REFERENCE_STATUS_TO_REVIEW]
+ 'expanded' => true
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['date_calc' => new RollingDate(RollingDate::T_TODAY), 'ref_statuses' => [Address::ADDR_REFERENCE_STATUS_TO_REVIEW]];
+ }
public function describeAction($data, $format = 'string')
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php
index c05f97ca8..f06e42c1f 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php
@@ -92,6 +92,15 @@ class AgeFilter implements ExportElementValidatedInterface, FilterInterface
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [
+ 'min_age' => 0,
+ 'max_age' => 120,
+ 'date_calc' => new RollingDate(RollingDate::T_TODAY),
+ ];
+ }
+
public function describeAction($data, $format = 'string')
{
return ['Filtered by person\'s age: '
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php
index 7ae22ddd8..9a0478b6c 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php
@@ -71,14 +71,16 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
{
$builder->add('date_from', PickRollingDateType::class, [
'label' => 'Born after this date',
- 'data' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START),
]);
$builder->add('date_to', PickRollingDateType::class, [
'label' => 'Born before this date',
- 'data' => new RollingDate(RollingDate::T_TODAY),
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function describeAction($data, $format = 'string')
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php
index 9b59549f1..749897a53 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php
@@ -86,9 +86,12 @@ class ByHouseholdCompositionFilter implements FilterInterface
])
->add('calc_date', PickRollingDateType::class, [
'label' => 'export.filter.person.by_composition.Date calc',
- 'data' => new RollingDate(RollingDate::T_TODAY),
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['calc_date' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function describeAction($data, $format = 'string')
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php
index 384d6698a..8b2444ca2 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php
@@ -102,9 +102,12 @@ class DeadOrAliveFilter implements FilterInterface
$builder->add('date_calc', PickRollingDateType::class, [
'label' => 'Filter in relation to this date',
- 'data' => new RollingDate(RollingDate::T_TODAY),
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['date_calc' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function describeAction($data, $format = 'string')
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php
index 0ac4b3173..7805331a5 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php
@@ -72,14 +72,16 @@ class DeathdateFilter implements ExportElementValidatedInterface, FilterInterfac
{
$builder->add('date_from', PickRollingDateType::class, [
'label' => 'Death after this date',
- 'data' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START),
]);
$builder->add('date_to', PickRollingDateType::class, [
'label' => 'Deathdate before',
- 'data' => new RollingDate(RollingDate::T_TODAY),
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function describeAction($data, $format = 'string')
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GenderFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GenderFilter.php
index 739945b98..182006bbc 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GenderFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GenderFilter.php
@@ -89,6 +89,10 @@ class GenderFilter implements
'expanded' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function describeAction($data, $format = 'string')
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php
index 79f5cb2d4..ab9bb08ab 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php
@@ -91,7 +91,6 @@ class GeographicalUnitFilter implements \Chill\MainBundle\Export\FilterInterface
->add('date_calc', PickRollingDateType::class, [
'label' => 'Compute geographical location at date',
'required' => true,
- 'data' => new RollingDate(RollingDate::T_TODAY),
])
->add('units', ChoiceType::class, [
'label' => 'Geographical unit',
@@ -105,6 +104,10 @@ class GeographicalUnitFilter implements \Chill\MainBundle\Export\FilterInterface
'multiple' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['date_calc' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function describeAction($data, $format = 'string')
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php
index 47a75871c..021c22fc6 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php
@@ -56,6 +56,10 @@ class MaritalStatusFilter implements FilterInterface
'expanded' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function describeAction($data, $format = 'string')
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php
index b1d77d60e..e5102128b 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php
@@ -67,6 +67,10 @@ class NationalityFilter implements
'placeholder' => 'Choose countries',
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function describeAction($data, $format = 'string')
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php
index 21bb40947..8f22750a5 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php
@@ -107,9 +107,12 @@ class ResidentialAddressAtThirdpartyFilter implements FilterInterface
$builder->add('date_calc', PickRollingDateType::class, [
'label' => 'Date during which residential address was valid',
- 'data' => new RollingDate(RollingDate::T_TODAY),
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['date_calc' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function describeAction($data, $format = 'string')
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php
index bd55c5b80..62b142420 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php
@@ -82,9 +82,12 @@ class ResidentialAddressAtUserFilter implements FilterInterface
{
$builder->add('date_calc', PickRollingDateType::class, [
'label' => 'Date during which residential address was valid',
- 'data' => new RollingDate(RollingDate::T_TODAY),
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['date_calc' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function describeAction($data, $format = 'string')
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php
index c4644fc11..9f5ed90b5 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php
@@ -66,9 +66,12 @@ class WithoutHouseholdComposition implements FilterInterface
$builder
->add('calc_date', PickRollingDateType::class, [
'label' => 'export.filter.person.by_no_composition.Date calc',
- 'data' => new RollingDate(RollingDate::T_TODAY),
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['calc_date' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function describeAction($data, $format = 'string')
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php
index b13c49e9a..e78b1d021 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php
@@ -32,17 +32,18 @@ final readonly class AccompanyingPeriodWorkEndDateBetweenDateFilter implements F
$builder
->add('start_date', PickRollingDateType::class, [
'label' => 'export.filter.work.end_between_dates.start_date',
- 'data' => new RollingDate(RollingDate::T_TODAY),
])
->add('end_date', PickRollingDateType::class, [
'label' => 'export.filter.work.end_between_dates.end_date',
- 'data' => new RollingDate(RollingDate::T_TODAY),
])
->add('keep_null', CheckboxType::class, [
'label' => 'export.filter.work.end_between_dates.keep_null',
'help' => 'export.filter.work.end_between_dates.keep_null_help',
- ])
- ;
+ ]);
+ }
+ public function getFormDefaultData(): array
+ {
+ return ['start_date' => new RollingDate(RollingDate::T_TODAY), 'end_date' => new RollingDate(RollingDate::T_TODAY)];
}
public function getTitle(): string
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php
index e9526a9a5..947e6c57c 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php
@@ -32,17 +32,18 @@ final readonly class AccompanyingPeriodWorkStartDateBetweenDateFilter implements
$builder
->add('start_date', PickRollingDateType::class, [
'label' => 'export.filter.work.start_between_dates.start_date',
- 'data' => new RollingDate(RollingDate::T_TODAY),
])
->add('end_date', PickRollingDateType::class, [
'label' => 'export.filter.work.start_between_dates.end_date',
- 'data' => new RollingDate(RollingDate::T_TODAY),
])
->add('keep_null', CheckboxType::class, [
'label' => 'export.filter.work.start_between_dates.keep_null',
'help' => 'export.filter.work.start_between_dates.keep_null_help',
- ])
- ;
+ ]);
+ }
+ public function getFormDefaultData(): array
+ {
+ return ['start_date' => new RollingDate(RollingDate::T_TODAY), 'end_date' => new RollingDate(RollingDate::T_TODAY)];
}
public function getTitle(): string
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CurrentActionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CurrentActionFilter.php
index cbdb64d8d..e99590025 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CurrentActionFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CurrentActionFilter.php
@@ -37,6 +37,10 @@ class CurrentActionFilter implements FilterInterface
{
//no form
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php
index 144bf3260..265c8e24d 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php
@@ -76,6 +76,10 @@ class JobFilter implements FilterInterface
'expanded' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function describeAction($data, $format = 'string')
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ReferrerFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ReferrerFilter.php
index 8d0da32fb..bddcfbf9b 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ReferrerFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ReferrerFilter.php
@@ -57,6 +57,10 @@ class ReferrerFilter implements FilterInterface
'multiple' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function describeAction($data, $format = 'string'): array
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php
index 315025722..737759c3e 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php
@@ -76,6 +76,10 @@ class ScopeFilter implements FilterInterface
'expanded' => true,
]);
}
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
public function describeAction($data, $format = 'string')
{
diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php
index 11fd0ed9d..e97834319 100644
--- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php
+++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php
@@ -111,6 +111,11 @@ class SocialWorkTypeFilter implements FilterInterface
);
}
+ public function getFormDefaultData(): array
+ {
+ return ['action_type' => [], 'goal' => [], 'result' => []];
+ }
+
public function describeAction($data, $format = 'string'): array
{
$actionTypes = [];
diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml
index bdb93afc0..188c31f1a 100644
--- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml
+++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml
@@ -555,22 +555,22 @@ is regular: le parcours est régulier
Intensity: Intensité
Group by intensity: Grouper les parcours par intensité
-Filter by active on date: Filtrer les parcours actifs à une date
-On date: Actifs à cette date
-"Filtered by actives courses: active on %ondate%": "Filtrer les parcours actifs: actifs le %ondate%"
+Filter by active on date: Filtrer les parcours ouverts à une date
+On date: A l'état ouvert à cette date
+"Filtered by actives courses: active on %ondate%": "Filtrer les parcours ouverts: actifs le %ondate%"
-Filter by active at least one day between dates: Filtrer les parcours actifs au moins un jour dans la période
-"Filtered by actives courses: at least one day between %datefrom% and %dateto%": "Filtrer les parcours actifs: au moins un jour entre le %datefrom% et le %dateto%"
+Filter by active at least one day between dates: Filtrer les parcours ouverts au moins un jour dans la période
+"Filtered by actives courses: at least one day between %datefrom% and %dateto%": "Filtrer les parcours ouverts: au moins un jour entre le %datefrom% et le %dateto%"
Filter by referrers: Filtrer les parcours par référent
Accepted referrers: Référents
"Filtered by referrer: only %referrers%": "Filtré par référent: uniquement %referrers%"
Group by referrers: Grouper les parcours par référent
-Filter by opened between dates: Filtrer les parcours ouverts entre deux dates
+Filter by opened between dates: Filtrer les parcours dont la date d'ouverture est comprise entre deux dates
Date from: Date de début
Date to: Date de fin
-"Filtered by opening dates: between %datefrom% and %dateto%": "Filtrer les parcours ouverts entre deux dates: entre le %datefrom% et le %dateto%"
+"Filtered by opening dates: between %datefrom% and %dateto%": "Filtrer les parcours dont la date d'ouverture est comprise entre le %datefrom% et le %dateto%"
Filter by temporary location: Filtrer les parcours avec une localisation temporaire
Filter by which has no referrer: Filtrer les parcours sans référent
diff --git a/src/Bundle/ChillReportBundle/Export/Export/ReportList.php b/src/Bundle/ChillReportBundle/Export/Export/ReportList.php
index 9adae0097..9d99b7e62 100644
--- a/src/Bundle/ChillReportBundle/Export/Export/ReportList.php
+++ b/src/Bundle/ChillReportBundle/Export/Export/ReportList.php
@@ -94,7 +94,6 @@ class ReportList implements ExportElementValidatedInterface, ListInterface
$cf->getSlug();
}
- // Add a checkbox to select fields
$builder->add('fields', ChoiceType::class, [
'multiple' => true,
'expanded' => true,
@@ -134,14 +133,16 @@ class ReportList implements ExportElementValidatedInterface, ListInterface
])],
]);
- // add a date field for addresses
$builder->add('address_date', ChillDateType::class, [
'label' => 'Address valid at this date',
- 'data' => new DateTime(),
'required' => false,
'block_name' => 'list_export_form_address_date',
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['address_date' => new DateTime()];
+ }
public function getAllowedFormattersTypes()
{
diff --git a/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php b/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php
index 79bad4f52..cb8e7d1d0 100644
--- a/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php
+++ b/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php
@@ -67,14 +67,16 @@ class ReportDateFilter implements FilterInterface
{
$builder->add('date_from', PickRollingDateType::class, [
'label' => 'Report is after this date',
- 'data' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START),
]);
$builder->add('date_to', PickRollingDateType::class, [
'label' => 'Report is before this date',
- 'data' => new RollingDate(RollingDate::T_TODAY),
]);
}
+ public function getFormDefaultData(): array
+ {
+ return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)];
+ }
public function describeAction($data, $format = 'string')
{
diff --git a/utils/rector/src/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector.php b/utils/rector/src/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector.php
new file mode 100644
index 000000000..4718aedac
--- /dev/null
+++ b/utils/rector/src/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector.php
@@ -0,0 +1,273 @@
+add('foo', PickRollingDateType::class, [
+ 'label' => 'Test thing',
+ 'data' => new RollingDate(RollingDate::T_TODAY)
+ ]);
+
+ $builder->add('baz', TextType::class, [
+ 'label' => 'OrNiCar',
+ 'data' => 'Castor'
+ ]);
+ }
+}
+PHP,
+<<add('foo', PickRollingDateType::class, [
+ 'label' => 'Test thing',
+ 'data' => new RollingDate(RollingDate::T_TODAY)
+ ]);
+
+ $builder->add('baz', TextType::class, [
+ 'label' => 'OrNiCar',
+ 'data' => 'Castor'
+ ]);
+ }
+ public function getFormDefaultData(): array
+ {
+ return ['foo' => new RollingDate(RollingDate::T_TODAY), 'baz' => 'Castor'];
+ }
+}
+PHP */
+ ]
+ );
+ }
+
+ public function getNodeTypes(): array
+ {
+ return [Node\Stmt\Class_::class];
+ }
+
+ public function refactor(Node $node): ?Node
+ {
+ if (!$node instanceof Node\Stmt\Class_) {
+ return null;
+ }
+
+ if (
+ !$this->classAnalyzer->hasImplements($node, FilterInterface::class)
+ && !$this->classAnalyzer->hasImplements($node, AggregatorInterface::class)
+ && !$this->classAnalyzer->hasImplements($node, ExportInterface::class)
+ && !$this->classAnalyzer->hasImplements($node, DirectExportInterface::class)
+ && !$this->classAnalyzer->hasImplements($node, ListInterface::class)
+ ) {
+ return null;
+ }
+
+ $buildFormStmtIndex = null;
+ $hasGetFormDefaultDataMethod = false;
+ foreach ($node->stmts as $k => $stmt) {
+ if (!$stmt instanceof Node\Stmt\ClassMethod) {
+ continue;
+ }
+
+ if ('buildForm' === $stmt->name->name) {
+ $buildFormStmtIndex = $k;
+ }
+
+ if ('getFormDefaultData' === $stmt->name->name) {
+ $hasGetFormDefaultDataMethod = true;
+ }
+ }
+
+ if ($hasGetFormDefaultDataMethod || null === $buildFormStmtIndex) {
+ return null;
+ }
+
+ $stmtBefore = array_slice($node->stmts, 0, $buildFormStmtIndex, false);
+ $stmtAfter = array_slice($node->stmts, $buildFormStmtIndex + 1);
+
+ // lines to satisfay phpstan parser
+ if (!$node->stmts[$buildFormStmtIndex] instanceof Node\Stmt\ClassMethod) {
+ throw new \LogicException();
+ }
+
+ ['build_form_method' => $buildFormMethod, 'empty_to_replace' => $emptyToReplace]
+ = $this->filterBuildFormMethod($node->stmts[$buildFormStmtIndex], $node);
+
+ $node->stmts = [
+ ...$stmtBefore,
+ $buildFormMethod,
+ $this->makeGetFormDefaultData($node->stmts[$buildFormStmtIndex], $emptyToReplace),
+ ...$stmtAfter,
+ ];
+
+ return $node;
+ }
+
+ private function makeGetFormDefaultData(Node\Stmt\ClassMethod $buildFormMethod, array $emptyToReplace): Node\Stmt\ClassMethod
+ {
+ $method = new Node\Stmt\ClassMethod('getFormDefaultData');
+ $method->flags = Node\Stmt\Class_::MODIFIER_PUBLIC;
+ $method->returnType = new Node\Identifier('array');
+
+ $data = new Node\Expr\Array_([]);
+
+ foreach ($emptyToReplace as $key => $value) {
+ $item = new Node\Expr\ArrayItem($value, new Node\Scalar\String_($key));
+ $data->items[] = $item;
+ }
+
+ $method->stmts[] = new Node\Stmt\Return_($data);
+
+ return $method;
+ }
+
+ /**
+ * @param Node\Stmt\ClassMethod $buildFormMethod
+ * @return array{"build_form_method": Node\Stmt\ClassMethod, "empty_to_replace": array}
+ */
+ private function filterBuildFormMethod(Node\Stmt\ClassMethod $buildFormMethod, Node\Stmt\Class_ $node): array
+ {
+ $builderName = $buildFormMethod->params[0]->var->name;
+
+ $newStmts = [];
+ $emptyDataToReplace = [];
+
+ foreach ($buildFormMethod->stmts as $stmt) {
+ if ($stmt instanceof Node\Stmt\Expression
+ // it must be a method call
+ && $stmt->expr instanceof Node\Expr\MethodCall
+ && false !== ($results = $this->handleMethodCallBuilderAdd($stmt->expr, $builderName, $node))
+ ) {
+ ['stmt' => $newMethodCAll, 'emptyDataToReplace' => $newEmptyDataToReplace] = $results;
+ $newStmts[] = new Node\Stmt\Expression($newMethodCAll);
+ $emptyDataToReplace = [...$emptyDataToReplace, ...$newEmptyDataToReplace];
+ } else {
+ $newStmts[] = $stmt;
+ }
+ }
+
+ $buildFormMethod->stmts = $newStmts;
+
+ return ['build_form_method' => $buildFormMethod, "empty_to_replace" => $emptyDataToReplace];
+ }
+
+ private function handleMethodCallBuilderAdd(Node\Expr\MethodCall $methodCall, string $builderName, Node\Stmt\Class_ $node): array|false
+ {
+ $emptyDataToReplace = [];
+ // check for chained method call
+ if (
+ // this means that the MethodCall apply on another method call: a chained
+ $methodCall->var instanceof Node\Expr\MethodCall
+ ) {
+ // as this is chained, we make a recursion on this method
+
+ $resultFormDeepMethodCall = $this->handleMethodCallBuilderAdd($methodCall->var, $builderName, $node);
+
+ if (false === $resultFormDeepMethodCall) {
+ return false;
+ }
+
+ ['stmt' => $chainedMethodCall, 'emptyDataToReplace' => $newEmptyDataToReplace] = $resultFormDeepMethodCall;
+ $emptyDataToReplace = $newEmptyDataToReplace;
+ $methodCall->var = $chainedMethodCall;
+ }
+
+ if (
+ $methodCall->var instanceof Node\Expr\Variable
+ ) {
+ if ($methodCall->var->name !== $builderName) {
+ // ho, this does not apply on a builder, so we cancel all the method calls
+ return false;
+ }
+ }
+
+ if ($methodCall->name instanceof Node\Identifier && $methodCall->name->name !== 'add') {
+ return ['stmt' => $methodCall, 'emptyDataToReplace' => $emptyDataToReplace];
+ }
+
+ if (
+ // the method call must be "add"
+ $methodCall->name instanceof Node\Identifier
+ && $methodCall->name->name === 'add'
+ // it must have a first argument, a string
+ // TODO what happens if a value, or a const ?
+ && ($methodCall->args[0] ?? null) instanceof Node\Arg
+ && $methodCall->args[0]->value instanceof Node\Scalar\String_
+ // and a third argument, an array
+ && ($methodCall->args[2] ?? null) instanceof Node\Arg
+ && $methodCall->args[2]->value instanceof Node\Expr\Array_
+ ) {
+ // we parse on the 3rd argument, to find if there is an 'empty_data' key
+ $emptyDataIndex = null;
+ foreach ($methodCall->args[2]->value->items as $arrayItemIndex => $item) {
+ /* @phpstan-ignore-next-line */
+ if ($item->key->value === 'data' or $item->key->value === 'empty_data') {
+ $k = $methodCall->args[0]->value->value;
+ $emptyDataToReplace[$k] = $item->value;
+ $emptyDataIndex = $arrayItemIndex;
+ }
+ }
+
+ if (null !== $emptyDataIndex) {
+ $methodCall->args[2]->value->items = array_values(
+ array_filter(
+ $methodCall->args[2]->value->items,
+ /* @phpstan-ignore-next-line */
+ fn (Node\Expr\ArrayItem $item) => $item->key->value !== 'data'
+ )
+ );
+ }
+
+ return ['stmt' => $methodCall, 'emptyDataToReplace' => $emptyDataToReplace];
+ }
+
+ return ['stmt' => $methodCall, 'emptyDataToReplace' => $emptyDataToReplace];
+ }
+}
diff --git a/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRectorTest.php b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRectorTest.php
new file mode 100644
index 000000000..89606e970
--- /dev/null
+++ b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRectorTest.php
@@ -0,0 +1,40 @@
+doTestFile($file);
+ }
+
+ public function provideData(): \Iterator
+ {
+ return self::yieldFilesFromDirectory(__DIR__.'/Fixture');
+ }
+
+ public function provideConfigFilePath(): string
+ {
+ return __DIR__.'/config/config.php';
+ }
+}
diff --git a/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/aggregator-with-no-method-get-form-default-data.php.inc b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/aggregator-with-no-method-get-form-default-data.php.inc
new file mode 100644
index 000000000..aa373e629
--- /dev/null
+++ b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/aggregator-with-no-method-get-form-default-data.php.inc
@@ -0,0 +1,133 @@
+
+-----
+
diff --git a/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/direct-export-with-no-method-get-form-default-data.php.inc b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/direct-export-with-no-method-get-form-default-data.php.inc
new file mode 100644
index 000000000..d60f62dcb
--- /dev/null
+++ b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/direct-export-with-no-method-get-form-default-data.php.inc
@@ -0,0 +1,77 @@
+
+-----
+
diff --git a/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/export-with-no-method-get-form-default-data.php.inc b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/export-with-no-method-get-form-default-data.php.inc
new file mode 100644
index 000000000..ba5a6d4ec
--- /dev/null
+++ b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/export-with-no-method-get-form-default-data.php.inc
@@ -0,0 +1,95 @@
+
+-----
+
diff --git a/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/filter-multiple-reuse-data-on-form-default-data-with-chained-builder.php.inc b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/filter-multiple-reuse-data-on-form-default-data-with-chained-builder.php.inc
new file mode 100644
index 000000000..ed46f6381
--- /dev/null
+++ b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/filter-multiple-reuse-data-on-form-default-data-with-chained-builder.php.inc
@@ -0,0 +1,111 @@
+add('foo', PickRollingDateType::class, [
+ 'label' => 'Test thing',
+ 'data' => new RollingDate(RollingDate::T_TODAY)
+ ])
+ ->anotherCall('test')
+ ->add('baz', TextType::class, [
+ 'label' => 'OrNiCar',
+ 'data' => 'Castor'
+ ])
+ ->baz('foo');
+ }
+
+ public function getTitle()
+ {
+ // TODO: Implement getTitle() method.
+ }
+
+ public function addRole(): ?string
+ {
+ // TODO: Implement addRole() method.
+ }
+
+ public function alterQuery(QueryBuilder $qb, $data)
+ {
+ // TODO: Implement alterQuery() method.
+ }
+
+ public function applyOn()
+ {
+ // TODO: Implement applyOn() method.
+ }
+}
+?>
+-----
+add('foo', PickRollingDateType::class, [
+ 'label' => 'Test thing'
+ ])
+ ->anotherCall('test')
+ ->add('baz', TextType::class, [
+ 'label' => 'OrNiCar'
+ ])
+ ->baz('foo');
+ }
+ public function getFormDefaultData(): array
+ {
+ return ['foo' => new RollingDate(RollingDate::T_TODAY), 'baz' => 'Castor'];
+ }
+
+ public function getTitle()
+ {
+ // TODO: Implement getTitle() method.
+ }
+
+ public function addRole(): ?string
+ {
+ // TODO: Implement addRole() method.
+ }
+
+ public function alterQuery(QueryBuilder $qb, $data)
+ {
+ // TODO: Implement alterQuery() method.
+ }
+
+ public function applyOn()
+ {
+ // TODO: Implement applyOn() method.
+ }
+}
+?>
diff --git a/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/filter-multiple-reuse-data-on-form-default-data.php.inc b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/filter-multiple-reuse-data-on-form-default-data.php.inc
new file mode 100644
index 000000000..5429d3c82
--- /dev/null
+++ b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/filter-multiple-reuse-data-on-form-default-data.php.inc
@@ -0,0 +1,107 @@
+add('foo', PickRollingDateType::class, [
+ 'label' => 'Test thing',
+ 'data' => new RollingDate(RollingDate::T_TODAY)
+ ]);
+
+ $builder->add('baz', TextType::class, [
+ 'label' => 'OrNiCar',
+ 'data' => 'Castor'
+ ]);
+ }
+
+ public function getTitle()
+ {
+ // TODO: Implement getTitle() method.
+ }
+
+ public function addRole(): ?string
+ {
+ // TODO: Implement addRole() method.
+ }
+
+ public function alterQuery(QueryBuilder $qb, $data)
+ {
+ // TODO: Implement alterQuery() method.
+ }
+
+ public function applyOn()
+ {
+ // TODO: Implement applyOn() method.
+ }
+}
+?>
+-----
+add('foo', PickRollingDateType::class, [
+ 'label' => 'Test thing'
+ ]);
+
+ $builder->add('baz', TextType::class, [
+ 'label' => 'OrNiCar'
+ ]);
+ }
+ public function getFormDefaultData(): array
+ {
+ return ['foo' => new RollingDate(RollingDate::T_TODAY), 'baz' => 'Castor'];
+ }
+
+ public function getTitle()
+ {
+ // TODO: Implement getTitle() method.
+ }
+
+ public function addRole(): ?string
+ {
+ // TODO: Implement addRole() method.
+ }
+
+ public function alterQuery(QueryBuilder $qb, $data)
+ {
+ // TODO: Implement alterQuery() method.
+ }
+
+ public function applyOn()
+ {
+ // TODO: Implement applyOn() method.
+ }
+}
+?>
diff --git a/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/filter-no-data-on-builder.php.inc b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/filter-no-data-on-builder.php.inc
new file mode 100644
index 000000000..285c16b50
--- /dev/null
+++ b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/filter-no-data-on-builder.php.inc
@@ -0,0 +1,105 @@
+add('foo', PickRollingDateType::class, [
+ 'label' => 'Test thing',
+ ]);
+
+ $builder->add('baz', TextType::class, [
+ 'label' => 'OrNiCar',
+ ]);
+ }
+
+ public function getTitle()
+ {
+ // TODO: Implement getTitle() method.
+ }
+
+ public function addRole(): ?string
+ {
+ // TODO: Implement addRole() method.
+ }
+
+ public function alterQuery(QueryBuilder $qb, $data)
+ {
+ // TODO: Implement alterQuery() method.
+ }
+
+ public function applyOn()
+ {
+ // TODO: Implement applyOn() method.
+ }
+}
+?>
+-----
+add('foo', PickRollingDateType::class, [
+ 'label' => 'Test thing',
+ ]);
+
+ $builder->add('baz', TextType::class, [
+ 'label' => 'OrNiCar',
+ ]);
+ }
+ public function getFormDefaultData(): array
+ {
+ return [];
+ }
+
+ public function getTitle()
+ {
+ // TODO: Implement getTitle() method.
+ }
+
+ public function addRole(): ?string
+ {
+ // TODO: Implement addRole() method.
+ }
+
+ public function alterQuery(QueryBuilder $qb, $data)
+ {
+ // TODO: Implement alterQuery() method.
+ }
+
+ public function applyOn()
+ {
+ // TODO: Implement applyOn() method.
+ }
+}
+?>
diff --git a/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/filter-reuse-data-on-form-default-data.php.inc b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/filter-reuse-data-on-form-default-data.php.inc
new file mode 100644
index 000000000..b2e78e49c
--- /dev/null
+++ b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/filter-reuse-data-on-form-default-data.php.inc
@@ -0,0 +1,96 @@
+add('test', PickRollingDateType::class, [
+ 'label' => 'Test thing',
+ 'data' => new RollingDate(RollingDate::T_TODAY)
+ ]);
+ }
+
+ public function getTitle()
+ {
+ // TODO: Implement getTitle() method.
+ }
+
+ public function addRole(): ?string
+ {
+ // TODO: Implement addRole() method.
+ }
+
+ public function alterQuery(QueryBuilder $qb, $data)
+ {
+ // TODO: Implement alterQuery() method.
+ }
+
+ public function applyOn()
+ {
+ // TODO: Implement applyOn() method.
+ }
+}
+?>
+-----
+add('test', PickRollingDateType::class, [
+ 'label' => 'Test thing'
+ ]);
+ }
+ public function getFormDefaultData(): array
+ {
+ return ['test' => new RollingDate(RollingDate::T_TODAY)];
+ }
+
+ public function getTitle()
+ {
+ // TODO: Implement getTitle() method.
+ }
+
+ public function addRole(): ?string
+ {
+ // TODO: Implement addRole() method.
+ }
+
+ public function alterQuery(QueryBuilder $qb, $data)
+ {
+ // TODO: Implement alterQuery() method.
+ }
+
+ public function applyOn()
+ {
+ // TODO: Implement applyOn() method.
+ }
+}
+?>
diff --git a/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/filter-with-no-method-get-form-default-data.php.inc b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/filter-with-no-method-get-form-default-data.php.inc
new file mode 100644
index 000000000..687bd9d0c
--- /dev/null
+++ b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/filter-with-no-method-get-form-default-data.php.inc
@@ -0,0 +1,87 @@
+
+-----
+
diff --git a/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/list-with-no-method-get-form-default-data.php.inc b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/list-with-no-method-get-form-default-data.php.inc
new file mode 100644
index 000000000..99cea7155
--- /dev/null
+++ b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/list-with-no-method-get-form-default-data.php.inc
@@ -0,0 +1,135 @@
+
+-----
+
diff --git a/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/skip-filter-existing-get-form-default-data-method.php.inc b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/skip-filter-existing-get-form-default-data-method.php.inc
new file mode 100644
index 000000000..2fefc908d
--- /dev/null
+++ b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/Fixture/skip-filter-existing-get-form-default-data-method.php.inc
@@ -0,0 +1,46 @@
+rule(\Chill\Utils\Rector\Rector\ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector::class);
+};