Compare commits

...

232 Commits

Author SHA1 Message Date
0c75514ec4 Fix validation of household address history 2024-04-29 15:53:08 +02:00
9a010f76cc Fix some translations (already existing in v2) 2024-04-29 15:28:44 +02:00
73d6578a3a Fix workflow configuration 2024-04-29 15:28:24 +02:00
ce655ed435 fix cs 2024-04-10 21:15:57 +02:00
b2eb2b0968 Update calendar authorization checks
The CalendarDocVoter now also supports Calendar instances, not only CalendarDoc instances. This allows refining permissions checks based on the actual instance type. In addition, the ChillCalendarBundle's view has been updated to correctly use permissions when displaying action buttons. Obsolete TODO comments are also removed.
2024-04-10 21:15:49 +02:00
ca398195b0 Add missing label for pick-entity / AddPerson 2024-04-10 16:27:23 +02:00
38e5d9c7cc fix task for symfony 5.4 2024-04-10 16:08:35 +02:00
680513a3a6 fix missing librairies 2024-04-10 16:08:09 +02:00
3df57c1569 Remove nullable parameter from createNamedBuilder call
The call to createNamedBuilder in EventController.php and ExportController.php was originally passing null as a parameter. This was generating PHPStan warnings. This commit replaces null with an empty string to comply with the method's expected types.
2024-04-10 12:43:25 +02:00
0b40d807bc Implement HasCentersInterface in Household class (will fix access control)
The Household class now implements the HasCentersInterface and includes a method to get all centers associated with current persons in the household. This enhancement will allow fetching of all household-associated centers easier.
2024-04-10 12:43:04 +02:00
a3efae7831 Update budget element voter and improve form handling in permissions group
The base class of BudgetElementVoter has been changed to Voter, and the form handling in PermissionsGroupController has been improved for better validation. In addition, minor changes were made for better menu building and service configuration was updated. Unnecessary date validation in AbstractElement has been removed as well.
2024-04-10 10:31:00 +02:00
76fdd6d889 Add explicit controller definition requirement for APIs
Updated API creation to require an explicit controller definition. This change has been reflected in the ChillMainExtension and ChillPersonExtension files. Also, it has introduced a new exception, the InvalidCrudConfiguration, which will be thrown when a new API or CRUD is created without this explicit controller definition.
2024-04-08 19:06:47 +02:00
78a3dfd65e Add validation for household metadata
A new validation group 'household_metadata' has been added to the Household form. The 'waitingForBirth' field now has a type check, and for the 'waitingForBirthDate' field, an expression is added to ensure it's set if 'waitingForBirth' is true. Simultaneously, error handling for form submission has been enriched in the HouseholdController to display specific error messages.
2024-04-08 14:52:40 +02:00
29d53c53a4 fixup! Fix configuration and usage of password hasher 2024-04-08 13:45:37 +02:00
e3bd68112e fix test for editing household metadata 2024-04-08 13:44:22 +02:00
8700352cf8 Fix configuration and usage of password hasher 2024-04-08 13:21:34 +02:00
2b3f8948f8 On AsyncFileExists, checks on null value for the customization of the message 2024-04-08 13:21:14 +02:00
19ffef156b Fix use of Ordering constant in doctrine orm association
See https://github.com/doctrine/orm/issues/11313 for a follow-up
2024-04-08 13:10:38 +02:00
e8c7623a1e Refactor Relationship entity to use traits
The Relationship entity in ChillPersonBundle has been refactored to use TrackCreationTrait and TrackUpdateTrait. As a result, the redundant code for handling creation and update tracking has been removed. This change will simplify future development by reusing core functionality from the trait instead of manually controlling the process in each entity.
2024-04-08 12:13:39 +02:00
5be85a4fc6 Refactored code to use PHP8 attributes instead of annotations
In this change, Doctrine and validation annotations have been replaced with PHP8 Attributes. The Rector tool has been configured with a list of annotations to convert to attributes. As a consequence, the PHPStan's rules have been updated to reflect these changes. The PHP8's nullable operator (?) has been added where required, and comments in field declaration have been replaced with #[Attribute] syntax.
2024-04-08 12:11:29 +02:00
0ff4593863 Apply rector rules: add annotation for doctrine mapping 2024-04-05 13:11:42 +02:00
a3f775a69b Apply rector rules: add annotation for doctrine mapping 2024-04-05 00:19:30 +02:00
72016e1a21 Apply rector rules: add annotation for doctrine mapping 2024-04-05 00:01:30 +02:00
579bd829f8 Apply rector rules: symfony up to 54 2024-04-04 23:30:25 +02:00
1ee3b9e2f0 Remove the tearDown method, because we are not able to delete entities linked with materialized views 2024-04-04 23:00:27 +02:00
e5e9ba6d31 make static required method in AbstractExportTests 2024-04-04 22:46:13 +02:00
3e676c235e remove option in phpunit.xml.dist 2024-04-04 22:37:56 +02:00
a497c3ffca fix return type of getFormData 2024-04-04 22:37:44 +02:00
553fb271e4 fix container operations within tests 2024-04-04 22:26:42 +02:00
92800f5dd0 fix cs 2024-04-04 22:19:56 +02:00
409a571010 fix upgrade in document generation request 2024-04-04 22:17:51 +02:00
828304d983 Replace getUsername with getUserIdentifier in activity checks
Updated activity checks in ListActivitiesByAccompanyingPeriodContext to use getUserIdentifier method instead of getUsername. This change corresponds to check for both activity users and work referrers. The getUserIdentifier method grants a more reliable way to identify users.
2024-04-04 22:12:49 +02:00
931c69eee4 Merge remote-tracking branch 'origin/master' into upgrade-sf5 2024-04-04 18:45:01 +02:00
d6a6cc2572 Rename chill.role tag to chill_main.provide_role and optimize role provider
The `chill.role` tag has been renamed to `chill_main.provide_role` to prevent any confusion and make the namespaces more consistent. During this process, the class RoleProvidersCompilerPass was deleted, simplifying the role provision process by injecting tagged services directly into the RoleProvider. The change is also reflected in multiple YAML service configurations and explained in the MIGRATION.md file.
2024-04-03 17:14:02 +02:00
8fd6986c47 Release 2.18.1 2024-03-26 22:10:18 +01:00
807f1b4aa1 Fix layout in admin document generation
A layout issue in the admin document generation has been fixed, particularly in the ChillDocGeneratorBundle. Unnecessary elements such as table headers and multiple entity data rows in DocGeneratorTemplate have been removed, simplifying the view page and improving its performance.
2024-03-26 22:10:01 +01:00
f3002631ea Release 2.18.0 2024-03-26 18:10:18 +01:00
9e667d4de4 Merge branch '268-improve-ux-when-configuring-documents' into 'master'
Improve admin UX for configuration of document template (document generation)

Closes #268

See merge request Chill-Projet/chill-bundles!670
2024-03-26 17:06:49 +00:00
fc88a5f40d Improve admin UX for configuration of document template (document generation) 2024-03-26 17:06:49 +00:00
9ff7aef3fc Merge branch '267-Fix-the-join-with-the-user-list' into 'master'
Fix the join in the user list (admin): show only current user job

Closes #267

See merge request Chill-Projet/chill-bundles!669
2024-03-20 12:34:13 +00:00
4f08019618 Fix the join in the user list (admin): show only current user job 2024-03-20 12:45:08 +01:00
2a58330832 Update v2.17.0.md: add missing changie line 2024-03-19 20:46:50 +00:00
a2cea3df02 Release 2.17.0 2024-03-19 21:00:38 +01:00
9ac43ecf5b Merge branch '238-custom-column-export-person' into 'master'
Liste des usagers: permettre d'ajouter des colonnes custom

Closes #238

See merge request Chill-Projet/chill-bundles!668
2024-03-19 19:59:38 +00:00
f78f5e8419 Fix cs with php-cs-fixer version 3.52 2024-03-19 20:49:39 +01:00
ccf3324bc2 Refactor ListPersonHelper and ListPerson to simplify process and allow to add customization of fields 2024-03-19 20:49:39 +01:00
dfe780f0f5 Merge branch '258-centers-parcours-export' into 'master'
In the accompanying period list, add person's centers and duration

Closes #258

See merge request Chill-Projet/chill-bundles!661
2024-03-14 21:35:00 +00:00
dd056efa0d In the accompanying period list, add person's centers and duration 2024-03-14 21:35:00 +00:00
18c0b6a47f Merge branch '259-Génération-de-document-avoir-un-comportement-coherent' into 'master'
Fix activity filter inconsistency in document generation

Closes #259

See merge request Chill-Projet/chill-bundles!667
2024-03-14 20:25:59 +00:00
df0afcd228 Fix activity filter inconsistency in document generation
This commit resolves issue 259 where the filtering of activities differed within the document generation and in the list of activities for an accompanying period. This amendment to the Chill Activity Bundle ensures consistent behavior. Additionally, new test methods and query adjustments were applied to the ActivityACLAwareRepository for better functionality.
2024-03-14 21:16:05 +01:00
d66933c8b5 Merge branch '264-repair-loading-languages' into 'master'
Fix the command which load language

Closes #264

See merge request Chill-Projet/chill-bundles!666
2024-03-14 15:12:30 +00:00
0ff51b0a5c Force new parameter to be readonly in LoadAndUpdateLanguagesCommand constructor 2024-03-14 15:05:30 +00:00
d7f4895248 Fix the command which load language
The command load the languages in the configured languages in chill's configuration.
2024-03-14 15:46:32 +01:00
7aee722957 Merge branch '237-filter-evaluations-between-dates' into 'master'
Resolve "Nouveau filtre: Filtrer les actions ayant reçu une nouvelle évaluation créée entre deux dates"

Closes #237

See merge request Chill-Projet/chill-bundles!663
2024-03-08 10:37:44 +00:00
5880858191 Resolve "Nouveau filtre: Filtrer les actions ayant reçu une nouvelle évaluation créée entre deux dates" 2024-03-08 10:37:43 +00:00
96105b101f Merge branch 'issue159_page_acceuil' into 'master'
Allow users to display news on homepage (+ configuring a dashboard homepage)

See merge request Chill-Projet/chill-bundles!604
2024-03-07 21:08:00 +00:00
d29415317b Allow users to display news on homepage (+ configuring a dashboard homepage) 2024-03-07 21:08:00 +00:00
2ad3bbe96f Merge branch '00585-fix-deprecations-doctrine-2024-03' into 'master'
Fix deprecations and code style issues (2024-03-07)

See merge request Chill-Projet/chill-bundles!665
2024-03-07 14:33:58 +00:00
1d636f5e9e Fix deprecations and code style issues 2024-03-07 15:26:58 +01:00
f0dbb17172 Update exports.rst: fix typo 2024-03-06 11:40:19 +00:00
f1dbc17dad Merge branch 'Doc-why-use-exists-in-exports' into 'master'
Update documentation to explain use of EXISTS in SQL queries

See merge request Chill-Projet/chill-bundles!664
2024-03-06 11:36:01 +00:00
09578a775c Update documentation to explain use of EXISTS in SQL queries
Added an explanatory section to the "exports.rst" doc to clarify why to use an EXISTS subquery instead of a JOIN clause in SQL queries involving many-to-* relationships. This explanation includes sample SQL queries and results to illustrate the potential issue of duplicates with JOIN and count, and how EXISTS can help avoid this issue. Also updated the ".editorconfig" file for .rst files.
2024-03-06 12:34:36 +01:00
c888b5b84f Update chill bundles version to 2.16.3 2024-02-26 14:53:20 +01:00
27d76d9579 Merge branch '232-filters-uj-and-serv-order-alphabetical' into 'master'
Resolve "Filtres sur les données: classer par ordre alphabétique les items à sélectionner"

Closes #232

See merge request Chill-Projet/chill-bundles!662
2024-02-26 13:51:25 +00:00
5b714f17be order scopes alphabetically 2024-02-26 14:40:41 +01:00
bbb167bb85 order user jobs alphabetically when returning all active user jobs 2024-02-26 13:36:44 +01:00
d713087dcb Changie and php style fixes 2024-02-26 13:30:26 +01:00
569aeeef87 Fix wrong translation of user job service -> métier 2024-02-26 12:23:11 +01:00
97f2c75de8 Change syntax of check on null for closing motive 2024-02-21 20:14:18 +01:00
4a2078dc65 upgrade to 2.16.2 2024-02-21 19:49:43 +01:00
00444e1e56 Add check on null value in template for closing motive 2024-02-20 10:10:44 +01:00
0081146a78 Change non-static class-level variables and methods to static in tests's data providers
The update modifies several test classes within the "chill-project" to change non-static class-level variables and methods to static ones. This change has been made to improve readability, performance, and to eliminate unnecessary instantiation of class objects in test scenarios. Also, flush and clear actions on the entity manager are moved to individual data providers.
2024-02-19 15:38:28 +01:00
d0f23eb6b1 fixup! Make all existing export test data provider static 2024-02-18 23:17:33 +01:00
d135b2ba0a Refactor rector rules to simplify code and fix rule definition 2024-02-18 23:14:33 +01:00
bb4b7e9735 Make all existing export test data provider static 2024-02-16 21:52:47 +01:00
07f03ab715 Make data providers static on AbstractExportTest.php and Write a rector rule to adapt existing 2024-02-16 21:49:27 +01:00
b9ae878791 Aggregators: Update test methods to static and return array
Modified aggregator test methods throughout the Chill project to be now static methods. Also updated yield construction to array returns for more standardised code.
2024-02-16 21:33:57 +01:00
94725bc92f fixup! Update test methods to static in AbstractFilterTest 2024-02-16 19:17:10 +01:00
11f6b78b26 Make static some methods in AbstractAggregatorTest.php + rector rule to adapt existing 2024-02-16 19:16:07 +01:00
35d55cced4 Update test methods to static in AbstractFilterTest
The methods getFormData() and getQueryBuilders() across multiple test classes have been updated to static methods. This refactoring is part of a broader effort to improve code structure and readability. A rector rule has been employed to assist in the systematic update of these existing methods.
2024-02-16 19:09:15 +01:00
1f460916b6 fixup! Update PHPUnit configuration and reorganize test files for rector rules 2024-02-14 22:31:43 +01:00
fa0204adbc Refactor test methods in AbstractFilterTest to be static + rector rules for updating existing
All test methods in AbstractFilterTest class have been refactored to be static.

A rector rule has been created to refactor existing test.
2024-02-14 22:30:16 +01:00
edcf78d6cc Update PHPUnit configuration and reorganize test files for rector rules 2024-02-14 22:28:39 +01:00
f251e6f100 upgrade phpunit: make data provider static 2024-02-14 12:28:14 +01:00
d5115b3718 upgrade rector and adapt list 2024-02-14 11:10:31 +01:00
9064356bd1 allow 45 direct deprecations 2024-02-14 10:08:53 +01:00
8a2f3d3dd0 Simplify setCenters method and remove readonly property
The commit simplifies the setCenters method in the ThirdParty class by directly assigning the incoming centers collection to the $centers property. Additionally, the readonly keyword has been removed from the $centers property declaration, allowing its value to be modified.
2024-02-13 21:04:22 +01:00
510023d630 fix cs 2024-02-13 21:04:09 +01:00
2ddfd56401 fix phpstan and rector errors, fix path for rector rules 2024-02-13 19:12:14 +01:00
f889d67e94 fixes after merge of master into upgrade-sf4 2024-02-12 22:31:16 +01:00
37af488f69 Merge branch 'master' into upgrade-sf5 2024-02-12 21:50:34 +01:00
f02c5bca13 release 2.16.1 2024-02-09 00:11:11 +01:00
0d56828ebd force boostrap version to 5.2.3 2024-02-09 00:10:26 +01:00
8b28667fe5 prepare release 2.16.0 2024-02-08 21:21:49 +01:00
72f73ec8e7 prepare release 2.16.0 2024-02-08 21:21:34 +01:00
b3d1320c94 Merge branch '149-150-events-improve' into 'master'
Modernisation fonctionnement module Evénement

Closes #149, #150, and #225

See merge request Chill-Projet/chill-bundles!621
2024-02-08 20:19:30 +00:00
2ed42e1a2c Fix cs with php-cs-fier version 3.49 2024-02-08 21:12:27 +01:00
d0e5ba16fe Merge branch 'issue115_social_action_versioning' into 'master'
Add versioning and optimistic locking on accompanying period work

Closes #115

See merge request Chill-Projet/chill-bundles!627
2024-02-08 20:02:05 +00:00
8e65ad9476 Add changie file 2024-02-08 21:01:53 +01:00
cf7338b690 Fix issues with inexisting fields 2024-02-08 21:00:16 +01:00
63dd71037a Add changie file 2024-02-08 14:33:30 +01:00
cc281762b3 Translate message on conflict in AccompanyingPeriodWorkEdit App 2024-02-08 14:33:30 +01:00
aa0cadfa84 Add conflict resolution for generated API + add test
Implemented additional code to handle version conflicts when editing accompanying period work. By keeping track of the current version and returning an HTTP conflict response when it doesn't match with the provided entity version, users are properly alerted to update their entity before continuing. Furthermore, adjusted BadRequestHttpException to match correct arguments order and introduced entity version as query parameter for the URL.

ensure kernel is shutdown after generating data
2024-02-08 14:33:30 +01:00
6e2cce9531 Event: add more fields: documents, organizationCost, note, and location 2024-02-08 12:59:52 +01:00
1fbbf2b2ad fixup! Fix migrations to take into account the change in table name for Person's entity 2024-02-08 12:59:52 +01:00
e586b8ee5e Event: move validation to annotation and add UniqueEntity constraint on Participation 2024-02-08 12:59:51 +01:00
6d04e477f8 Clean database, to avoid double participations on event 2024-02-08 12:59:51 +01:00
6b7b2ae522 fixup! Fix migrations to take into account the change in table name for Person's entity 2024-02-08 12:59:51 +01:00
9b9c2774ad Allow Pick*Type to submit the form when selection an entity, and apply inside Event 2024-02-08 12:59:50 +01:00
e902b6d409 Create a page which list events 2024-02-08 12:59:50 +01:00
d8bf6a195f add creation and update information on events and participation 2024-02-08 12:59:50 +01:00
7c3152f277 Fix migration when executed after the person entity table name change 2024-02-08 12:59:50 +01:00
cef218fed5 Add interface for pagination 2024-02-08 12:59:47 +01:00
930a76cc66 use a PickPersonDynamic type in event bundle 2024-02-08 12:57:17 +01:00
f11f7498d7 Add new option "as_id" to Pick*DynamicType
This option will make the app return a single id of the entity in data, and not the entity json.
2024-02-08 12:54:44 +01:00
1a9af6b0b1 activate Event Bundle in test app 2024-02-08 12:54:44 +01:00
d347f6ae60 Fix migrations to take into account the change in table name for Person's entity 2024-02-08 12:54:44 +01:00
3bb911b4d0 Update version within PUT request
Try to add api logic

check for version being the same instead of smaller

implementing optimistic locking and displaying correct message in frontend

rector fixes

adjust violation message and add translation in translation.yaml

add translator in apiController
2024-02-08 12:09:51 +01:00
f00b39980c Add version of the social action to the state
put correct serialization groups
2024-02-08 12:08:36 +01:00
09882bb4be Add translations that were missing according to console error 2024-02-08 12:08:35 +01:00
1d21499eab add version property to accompanyingperiodwork for optimistic locking 2024-02-08 12:08:35 +01:00
8ef001e67e Merge branch '260-order-centers-dropdown' into 'master'
Resolve "Mettre en ordre alphabétique la liste des centres dans le dropdown du section 'utilisateurs' dans l'admin"

Closes #260

See merge request Chill-Projet/chill-bundles!657
2024-02-08 10:33:09 +00:00
458df45fa5 Add changie 2024-02-08 11:22:48 +01:00
2b968b9a5b order centers dropdown alphabetically 2024-02-08 11:21:33 +01:00
f1fa4d415e Fix messages+intl-icu.fr.yaml file, which was altered during multiple git merge 2024-02-07 21:28:18 +01:00
2312a8d46f Merge branch '229-Export-des-échanges-on-doit-pouvoir-regrouper-par-sujet-des-échanges-aussi-dans-les-échanges-liés-au-parcours' into 'master'
Refactor ActivityReasonAggregator: can be applied also on export for activites linked with accompanying period

Closes #229

See merge request Chill-Projet/chill-bundles!656
2024-02-07 15:49:18 +00:00
67c3de733f Refactor ActivityReasonAggregator: can be applied also on export for Activities linked with accompanying period
This commit renames the ActivityReasonAggregator's namespace from PersonAggregators to Aggregator and modifies its methods. The join method in the query builder has been changed from innerJoin to leftJoin, 'group by' part is simplified, and the applyOn method now returns Declarations::ACTIVITY instead of Declarations::ACTIVITY_PERSON. Further modifications apply to the getFormDefaultData method and the corresponding test.
2024-02-07 16:47:33 +01:00
c05451bfe9 Update 'calc_date' field option in HasTemporaryLocationFilter.php
This commit makes the 'calc_date' field in HasTemporaryLocationFilter.php required. This field was previously optional; this change ensures that a calculation date is always provided when filtering accompanying courses by temporary location.
2024-02-07 16:38:41 +01:00
8be9fb6553 Merge branch '244-record-closing-motive-on-acc-period-closing' into 'master'
[Export] Ajout de la comptabilisation du nombre de changements de statuts du parcours

Closes #244

See merge request Chill-Projet/chill-bundles!650
2024-02-07 15:09:09 +00:00
f5f6eb78a2 fix incorrect merge of messages+intl-icu.fr.yaml 2024-02-07 16:00:55 +01:00
7a7e66146b Merge branch '240-add-filter-by-referrer-between-dates' into 'master'
[export] Add referrer on accompanying course filter between dates feature and relevant tests

Closes #240

See merge request Chill-Projet/chill-bundles!649
2024-02-07 14:41:07 +00:00
4bbad4fc61 fix cs with php-cs-fixer 3.49 2024-02-07 15:38:56 +01:00
86613a9be9 Add changie for the whole feature 2024-02-07 15:38:10 +01:00
21bd6478ad Add DI configuration for the export of period step history data within the ChillPersonBundle
This commit adds dependency injection configuration for the export of period step history data within the ChillPersonBundle. It specifically configures exports, filters, and aggregators, all related to the accompanying period step history. Additionally, it updates ChillPersonExtension to load this newly created configuration.
2024-02-07 15:38:10 +01:00
5849d8d670 fix typo 2024-02-07 15:38:10 +01:00
568ee079b5 Add ByClosingMotiveAggregator on AccompanyingPeriodStepHistory exports and corresponding tests
Added a new class ByClosingMotiveAggregator to the AccompanyingPeriodStepHistoryAggregators for grouping status changes by closing motive. This also includes a corresponding test class. Additionally, updated relevant translations in the messages.fr.yml file.
2024-02-07 15:38:09 +01:00
bf97b2a50c Add ByDateAggregator to AccompanyingPeriodStepHistoryAggregators
Implemented a new ByDateAggregator in the AccompanyingPeriodStepHistoryAggregators for grouping status changes by date. A corresponding test suite has been included to verify its function. Necessary translations have also been updated.
2024-02-07 15:38:09 +01:00
01785ed494 Add ByStepAggregator to AccompanyingPeriodStepHistoryAggregators
Added a new ByStepAggregator to the AccompanyingPeriodStepHistoryAggregators, allowing to group status changes in the course by step. The corresponding test suite ensures the correct operation of this new class. Updates in the translations file have also been made as part of this addition.
2024-02-07 15:38:09 +01:00
97d401b7f6 Implement ByStepFilter for AccompanyingPeriodStepHistoryFilters and its tests
A new feature has been added, the ByStepFilter, to the Chill project. The ByStepFilter provides a way to filter data in AccompanyingPeriodStepHistoryFilters based on certain steps. In addition, a new test suite has been introduced to ensure the correct functionality of this filter. The necessary translations for completing this feature have also been included.
2024-02-07 15:38:09 +01:00
44ccfe92b6 Add ByDateFilter and its test for AccompanyingPeriodStepHistoryFilters
A new filter called ByDateFilter has been added under AccompanyingPeriodStepHistoryFilters. This filter allows users to filter data based on a date range on the start date. Corresponding unit tests for ByDateFilter are included in this commit. Both English and French translations for the new filter are also added.
2024-02-07 15:38:07 +01:00
b6ea857389 Add AccompanyingCourseStepHistory counting capabilities
The newly created CountAccompanyingCourseStepHistory class counts changes in AccompanyingPeriod status. Corresponding test file ensures the correct functionality. Supporting translations and necessary export declarations have been added to facilitate this change.
2024-02-07 15:35:44 +01:00
f8840d89bf Add capability to store closing motive when closing accompanying period
The commit introduces new functionality in the bundle that allows storing the closing motive when a course is closed. This is achieved by modifying the model and database schema to include a new `closingMotive` field in AccompanyingPeriodStepHistory entity.
2024-02-07 15:35:44 +01:00
813f2f1e12 Fix call within DI for referrer filter test 2024-02-07 15:34:33 +01:00
4a15a89102 [export] Add referrer on accompanying course filter between dates feature and relevant tests
Implemented a new filter to the software for social workers. This filter, ReferrerFilterBetweenDates, enables filtering of query results based on a range of dates and accepted referrers. Tests for this new functionality have also been added to ensure the feature works as expected.
2024-02-07 15:31:48 +01:00
c707a34f16 [export] Add referrer on accompanying course filter between dates feature and relevant tests
Implemented a new filter to the software for social workers. This filter, ReferrerFilterBetweenDates, enables filtering of query results based on a range of dates and accepted referrers. Tests for this new functionality have also been added to ensure the feature works as expected.
2024-02-07 15:31:45 +01:00
0c9010f065 Merge branch '242-export-add-filter-course-having-temporary-location' into 'master'
Add HasTemporaryLocationFilter test and update filter parameters

Closes #242

See merge request Chill-Projet/chill-bundles!645
2024-02-07 13:35:52 +00:00
3871299346 Merge branch '256_activity_form_admin' into 'master'
Fix activity form admin bug

See merge request Chill-Projet/chill-bundles!651
2024-02-07 13:30:59 +00:00
e2e0b08210 Add HasTemporaryLocationFilter test and update filter parameters
A new test HasTemporaryLocationFilterTest has been added under ChillPersonBundle. This test mainly focuses on checking the filter functionalities related to temporary locations. In addition, the 'having_temporarily' parameter has been added to 'calc_date' field in HasTemporaryLocationFilter class.
2024-02-07 14:28:24 +01:00
4df0542932 Merge branch 'issue220_fix_notification_event_error' into 'master'
Fix typing of doctrine events on Notification

Closes #220

See merge request Chill-Projet/chill-bundles!626
2024-02-07 13:23:54 +00:00
13854e59de Add grouping parenthesis on condition about social issue and social action visibility
This improve readability and avoid errors with boolean operator precedence
2024-02-07 14:22:28 +01:00
574ad42a76 Add changie for fix in activity entity/form 2024-02-07 14:22:28 +01:00
4736fca679 Fix the conditions upon which social actions should be optional or required in relation to social issues within the activity creation form 2024-02-07 14:22:27 +01:00
32ae2f8f0d Add a separate method for onPersist, use same private resetCache method 2024-02-07 13:55:31 +01:00
d58c0a867d add changie 2024-02-07 13:55:30 +01:00
15f8432ce0 Use PostUpdateEventArgs typing instead of PostPersistEventArgs 2024-02-07 13:55:29 +01:00
ae7637acc6 Merge branch '243-missing-filter-acc-period-not-associated-with-address-reference' into 'master'
Add filter for courses not linked to a reference address

Closes #243

See merge request Chill-Projet/chill-bundles!655
2024-02-07 12:45:12 +00:00
ce391a6de8 Merge branch '241-export-list-acc-period-add-column-persons' into 'master'
[Export][List of accompanying periods] Add a column with a list of persons, names and ids

Closes #241

See merge request Chill-Projet/chill-bundles!647
2024-02-07 12:40:57 +00:00
950835c10b Add filter for courses not linked to a reference address
This commit introduces a new filter to the Accompanying Course section. It allows users to filter for courses that are not associated with a reference address. The accompanying test and translation changes are also included in this update.
2024-02-07 13:38:15 +01:00
9ba557a5bf Merge branch '253-group-course-by-person' into 'master'
Export: group accompanying period by person participating

Closes #253

See merge request Chill-Projet/chill-bundles!653
2024-02-07 12:32:52 +00:00
439fecd69f fix cs 2024-02-07 13:25:49 +01:00
f02168950f Export: group accompanying period by person participating 2024-02-07 13:16:07 +01:00
58c2235b88 Merge branch 'issue231_person_with_participation_filter' into 'master'
Add WithParticipationBetweenDatesFilter to ChillPersonBundle

See merge request Chill-Projet/chill-bundles!639
2024-02-07 10:54:30 +00:00
42c5577027 Merge branch 'upgrade-php-cs-3.49' into 'master'
Upgrade php-cs 3.49

See merge request Chill-Projet/chill-bundles!654
2024-02-07 09:57:20 +00:00
036fe8d6f8 upgrade php-cs 3.49 2024-02-07 10:43:53 +01:00
51ebc253aa fix url of the base skeleton 2024-01-24 15:07:24 +00:00
4fdc7fd210 Merge branch 'fix-testContextGenerationDataNormalizeDenormalizeGetData' into 'master'
Fix the test "testContextGenerationDataNormalizeDenormalizeGetData"

See merge request Chill-Projet/chill-bundles!648
2024-01-23 12:31:37 +00:00
0bf6c07e8d Add Symfony Deprecations Helper to Gitlab CI configuration
The Gitlab CI configuration for the Chill Project has been updated to include the Symfony Deprecations Helper setting. This addition helps to avoid direct deprecations and provide a more efficient testing process. The helper is integrated using Symfony's PHPUnit bridge.
2024-01-23 11:32:22 +01:00
7a12602699 fix testContextGenerationDataNormalizeDenormalizeGetData
The method `Relationship::getOpposite` does not only compare the object equality, but also the object id.
2024-01-23 10:56:55 +01:00
15a927a9f8 [Export][List of accompanying periods] Add a list of persons, names and ids 2024-01-22 14:13:27 +01:00
0a2805f23f Merge branch 'upgrade-php-cs-fixer-to-3.47.0' into 'master'
CS: pgrade php-cs-fixer to 3.47.0

See merge request Chill-Projet/chill-bundles!646
2024-01-22 11:21:58 +00:00
27ce322690 upgrade php-cs-fixer to 3.47.0 2024-01-22 12:14:39 +01:00
fdfc3fb7ec Update changelog and master release version 2024-01-11 16:17:04 +01:00
aee245cd04 raise the expire term for artifacts in the gitlab pipeline 2024-01-11 13:42:02 +01:00
adcf183469 Merge branch 'adjust_field_required_behaviour_in_forms' into 'master'
Adjust form for activity type presence field, setting placeholder to false

See merge request Chill-Projet/chill-bundles!643
2024-01-11 11:53:07 +00:00
86bf5eba4f Merge branch 'fix_duplicate_acp_participation_handler' into 'master'
Use the correct id_seq to explicitly assign id to new row in accompanying...

See merge request Chill-Projet/chill-bundles!644
2024-01-11 11:48:41 +00:00
db130ef9df add changie 2024-01-11 11:59:21 +01:00
2b903c4d6e Use the correct id_seq to explicitly assign id to new row in accompanying period participation table 2024-01-11 11:55:03 +01:00
2c6b5dfee1 Add changie 2024-01-10 13:20:38 +01:00
0b50cbfe4c adjust form for activity type presence field, setting placeholder to false 2024-01-10 13:12:59 +01:00
3a6a125bb1 Merge branch 'test_branch' into 'master'
Apply code styling according to new rules php-cs-fixer

See merge request Chill-Projet/chill-bundles!642
2024-01-10 11:22:13 +00:00
e67c5d98ef force pipeline to run again 2024-01-10 11:09:33 +01:00
3c8e59e088 php cs fixes after updating php cs fixer 2024-01-10 10:31:25 +01:00
825cd127d1 update php-cs-fixer and rector + fix rules 2024-01-09 13:50:45 +01:00
a63b40fb6c use service subscriber injection to inject manager registry 2024-01-09 13:48:14 +01:00
60ede58af0 Update chill-bundles version 2023-12-20 11:49:38 +01:00
afb79141f0 Merge branch 'fix_household_export' into 'master'
Fix household export

See merge request Chill-Projet/chill-bundles!640
2023-12-20 10:46:30 +00:00
4d72933edb Add condition to household export queries to exclude accompanying periods that are in draft. 2023-12-20 10:46:29 +00:00
469e379166 php cs fixes 2023-12-18 17:05:18 +01:00
f103b228e4 Create test for the participationBetweenDatesFilter 2023-12-18 17:04:42 +01:00
d2a31de1be Add a missing translation for the filter description 2023-12-18 17:04:16 +01:00
138a537d2b Add changie 2023-12-18 15:51:52 +01:00
c06c861e17 Php cs fixes 2023-12-18 15:38:20 +01:00
34cbd2605c Add a changie 2023-12-18 15:32:04 +01:00
044bab45ad Fix query : was missing parenthesis. 2023-12-18 15:29:59 +01:00
b9890d1302 Minor fixes 2023-12-18 10:33:30 +01:00
5703fd0046 Refactor code to directly use Doctrine's ManagerRegistry
Replaced most of the invocations of getDoctrine()->getManager() with ManagerRegistry->getManager(), and added ManagerRegistry injection to controllers where needed. This is part of an ongoing effort to improve code clarity, and avoid unnecessary method chaining in various parts of the codebase.
2023-12-16 19:09:34 +01:00
655dc02538 CRUDRoutesLoader: use the syntax controller::method instead of the deprecated controller:method 2023-12-14 23:57:20 +01:00
1098bafd3d Replaced the deprecated 'self::$container->get' with 'self::getContainer()->get' using rector
This change is made to comply with the new Symfony standards and to avoid deprecation warnings for future versions. The update touches various functionalities, including retrieving EntityManagerInterface instance and various service classes within the test files.
2023-12-14 23:36:56 +01:00
4a99480f50 fixup! Fix some tests 2023-12-14 23:22:48 +01:00
8fcdb58556 Adjust SYMFONY_DEPRECATIONS_HELPER value in phpunit.xml.dist
Modified the `SYMFONY_DEPRECATIONS_HELPER` value from 'max[direct]=0' to 'max[direct]=93' in the PHPUnit configuration file. This change allows up to 93 direct deprecations before the PHPUnit test suite will return a failure, helping to manage the process of upgrading Symfony components and maintaining compatibility.

This number of 93 match the current number of deprecations in the CI for the execution of whole tests.
2023-12-14 23:18:03 +01:00
4e1f46154c Remove ReportSearch class and update services config
Removed the ReportSearch class from ChillReportBundle and updated the corresponding services configuration. This removal is part of a larger refactoring process to enhance maintainability, eliminate unused code and simplify application architecture. This will not affect the application's functionality as the class was not used.
2023-12-14 23:05:36 +01:00
312eb5ec7c Refactor parseDate function signature in AbstractSearch
Removed unnecessary comments and added type hinting to the function parseDate in the AbstractSearch class. Any string passed to this function will now explicitly be expected as a string data type, increasing code robustness and easing debugging process.
2023-12-14 23:05:36 +01:00
2dd1b7c943 Fix some tests 2023-12-14 23:05:35 +01:00
d5476df14c rename main firewall 2023-12-14 22:56:50 +01:00
7ba3435c41 Refactor PrepareClientTrait to use the loginUser method 2023-12-14 22:56:50 +01:00
5030b67c5d fix gitlab-ci configuration 2023-12-14 18:14:02 +01:00
d6ff3f422f change messenger configuration 2023-12-14 14:33:23 +01:00
912f7d3211 remove some deprecations 2023-12-14 14:09:57 +01:00
5b2a2a1bc5 Add WithParticipationBetweenDatesFilter to ChillPersonBundle
This update adds a new filter, WithParticipationBetweenDatesFilter, to the ChillPersonBundle. This filter helps to find persons who participated in any parcours between specified date ranges. Additionally, relevant French translations have been updated and the filter has been registered in the services configuration file.
2023-12-13 17:45:08 +01:00
47c3be6217 Merge remote-tracking branch 'origin/master' into upgrade-sf5 2023-12-13 16:04:48 +01:00
0da12cdc2e Merge branch '245-rewrite-test-relationship-api' into 'master'
Refactor RelationshipApiControllerTest to avoid failures

Closes #245

See merge request Chill-Projet/chill-bundles!635
2023-12-13 15:02:42 +00:00
9c17261175 update phpunit configuration file 2023-12-13 15:54:33 +01:00
8c2dc490d0 re-configure test app with new scripts (wip) 2023-12-13 15:47:38 +01:00
b4063bf1df Update path for Symfony container XML in rector.php
The path for Symfony container XML in the rector configuration file has been updated. This adjustment specifically refers to the internal testing application. By updating this path, consistency and efficiency within the testing process will be promoted.
2023-12-13 15:27:27 +01:00
de6277494a update configuration of app for internal testing app 2023-12-13 15:00:31 +01:00
d1ce99e6d3 Merge branch '167build_the_docs' into 'master'
DX: re-instate the build of documentation on read-the-docs

See merge request Chill-Projet/chill-bundles!638
2023-12-13 08:39:56 +00:00
juminet
0ad27328c9 DX: re-instate the build of documentation on read-the-docs 2023-12-13 08:39:56 +00:00
da997badd9 Fix phpstan issues 2023-12-12 22:43:44 +01:00
af663cf27c Create the helper ChillSecurity
En symfony 5.4 le typage a été vraiment amélioré, et phpstan peut détecter plus d'erreur potentielles.

Mais le problème est que Symfony "type" les `User` avec son propre `Symfony\Component\Security\Core\User\UserInterface` alors qu'on a besoin de `Chill\MainBundle\Entity\User`.

Imaginons qu'on a ceci:

```php

namespace Chill\Bundle\Service;

final readonly class SomeService
{
    public function myMethod(\Chill\MainBundle\Entity\User $user): void
    {
        // ...
    }
}
```

Quand on l'appelle dans un contrôleur ou dans un service:

```php

namespace Chill\Bundle\Service;

use Symfony\Component\Security\Core\Security;

final readonly OtherService
{
    public function __construct(private Security $security, private SomeService $service) {}

    public function __invoke(): void
    {
        $this->service->myMethod($this->security->getUser());
    }
}
```

PHPstan va se plaindre:

```
Parameter #1 $user of method SomeService::myMethod() expects Chill\MainBundle\Entity\User, Symfony\Component\Security\Core\User\UserInterface|null given.
```

Du coup, j'ai créé ce service:

```php
<?php

namespace Chill\MainBundle\Security;

use Chill\MainBundle\Entity\User;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Security\Core\Security;

/**
 * Security helper for Chill user
 *
 * Provides security-related functionality such as user retrieval, authorization checks,
 * and token retrieval, in a context where only an authenticated @see{User::class} is expected.
 *
 */
final readonly class ChillSecurity implements AuthorizationCheckerInterface
{

    public function hasUser(): bool
    {
        // implementation detail not shown here
    }

    public function getUser(): User
    {
        // implementation detail not shown here
    }

    public function isGranted($attribute, $subject = null): bool
    {
        // implementation detail not shown here
    }

    public function getToken(): ?TokenInterface
    {
        // implementation detail not shown here
    }
}
```

Et maintenant, on peut faire:

```php

namespace Chill\Bundle\Service;

use Chill\MainBundle\Security\ChillSecurity;

final readonly OtherService
{
    public function __construct(private ChillSecurity $security, private SomeService $service) {}

    public function __invoke(): void
    {
        $this->service->myMethod($this->security->getUser());
    }
}
```

Et tout va bien se passer.

Ca sera dans la version de chill qui fait passer à symfony 5.4.
2023-12-12 22:43:24 +01:00
ac98ba4555 re-organize phpstan deprecations files, with a baseline of deprecations for symfony 5.4 2023-12-12 17:56:27 +01:00
f35f5f0876 fixup! fix typo in classname (Phonenumber => PhoneNumber) 2023-12-12 17:19:28 +01:00
99b7b2ec88 upgrade rector rules and apply them 2023-12-12 17:17:15 +01:00
e2a37fd80b fix typo in classname (Phonenumber => PhoneNumber) 2023-12-12 17:12:01 +01:00
b64ac8fd20 Merge MR !636 into master: Merge async upload bundle into chill-bundles
See https://gitlab.com/Chill-Projet/chill-bundles/-/merge_requests/636

Merge remote-tracking branch 'origin/async-upload-merge' into upgrade-sf5
2023-12-12 16:18:49 +01:00
f68deca992 Fix icu message 2023-12-12 16:13:58 +01:00
f9a2d7f2d5 Add symfony runtime to composer.json 2023-12-12 16:08:47 +01:00
2f8de4bf01 Upgrade recipes: symfony/security-bundle 2023-12-12 16:08:46 +01:00
c6bb7b1d98 Rector rules: apply rules for 5.0 types 2023-12-12 16:08:46 +01:00
4c52aa366a Rector rules: add rules for 5.0 types 2023-12-12 16:08:46 +01:00
ceaabfb034 Downgrade symfony bundle to ^5.4 (some were on 6.3)
composer: restrict missing bundle to symfony 5.4
2023-12-12 16:08:46 +01:00
16a5745df9 Update composer to symfony 5 (without config) 2023-12-12 16:08:45 +01:00
f02873c6e0 Refactor RelationshipApiControllerTest
The codebase has been improved by refining and optimizing the test methods in the RelationshipApiControllerTest class. The check for relations was also added to exclude persons without any relationship, this may exclude duplicate relations. This change should avoid errors on this test.
2023-12-08 11:07:14 +01:00
1114 changed files with 14923 additions and 11739 deletions

View File

@@ -0,0 +1,6 @@
kind: Fixed
body: Fix resolving of centers for an household, which will fix in turn the access
control
time: 2024-04-10T10:37:36.462484988+02:00
custom:
Issue: ""

5
.changes/v2.15.1.md Normal file
View File

@@ -0,0 +1,5 @@
## v2.15.1 - 2023-12-20
### Fixed
* Fix the household export query to exclude accompanying periods that are in draft state.
### DX
* ([#167](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/167)) Fixed readthedocs compilation by updating readthedocs config file and requirements for Sphinx

5
.changes/v2.15.2.md Normal file
View File

@@ -0,0 +1,5 @@
## v2.15.2 - 2024-01-11
### Fixed
* Fix the id_seq used when creating a new accompanying period participation during fusion of two person files
### DX
* Set placeholder to False for expanded EntityType form fields where required is set to False.

15
.changes/v2.16.0.md Normal file
View File

@@ -0,0 +1,15 @@
## v2.16.0 - 2024-02-08
### Feature
* ([#231](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/231)) Create new filter for persons having a participation in an accompanying period during a certain time span
* ([#241](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/241)) [Export][List of accompanyign period] Add two columns: the list of persons participating to the period, and their ids
* ([#244](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/244)) Add capability to generate export about change of steps of accompanying period, and generate exports for this
* ([#253](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/253)) Export: group accompanying period by person participating
* ([#243](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/243)) Export: add filter for courses not linked to a reference address
* ([#229](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/229)) Allow to group activities linked with accompanying period by reason
* ([#115](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/115)) Prevent social work to be saved when another user edited conccurently the social work
* Modernize the event bundle, with some new fields and multiple improvements
### Fixed
* ([#220](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/220)) Fix error in logs about wrong typing of eventArgs in onEditNotificationComment method
* ([#256](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/256)) Fix the conditions upon which social actions should be optional or required in relation to social issues within the activity creation form
### UX
* ([#260](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/260)) Order list of centers alphabetically in dropdown 'user' section admin.

3
.changes/v2.16.1.md Normal file
View File

@@ -0,0 +1,3 @@
## v2.16.1 - 2024-02-09
### Fixed
* Force bootstrap version to avoid error in builds with newer version

3
.changes/v2.16.2.md Normal file
View File

@@ -0,0 +1,3 @@
## v2.16.2 - 2024-02-21
### Fixed
* Check for null values in closing motive of parcours d'accompagnement for correct rendering of template

5
.changes/v2.16.3.md Normal file
View File

@@ -0,0 +1,5 @@
## v2.16.3 - 2024-02-26
### Fixed
* ([#236](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/236)) Fix translation of user job -> 'service' must be 'métier'
### UX
* ([#232](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/232)) Order user jobs and services alphabetically in export filters

9
.changes/v2.17.0.md Normal file
View File

@@ -0,0 +1,9 @@
## v2.17.0 - 2024-03-19
### Feature
* ([#237](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/237)) New export filter for social actions with an evaluation created between two dates
* ([#258](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/258)) In the list of accompangying period, add the list of person's centers and the duration of the course
* ([#238](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/238)) Allow to customize list person with new fields
* ([#159](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/159)) Admin can publish news on the homepage
### Fixed
* ([#264](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/264)) Fix languages: load the languages in all availables languages configured for Chill
* ([#259](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/259)) Keep a consistent behaviour between the filtering of activities within the document generation (model "accompanying period with activities"), and the same filter in the list of activities for an accompanying period

5
.changes/v2.18.0.md Normal file
View File

@@ -0,0 +1,5 @@
## v2.18.0 - 2024-03-26
### Feature
* ([#268](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/268)) Improve admin UX to configure document templates for document generation
### Fixed
* ([#267](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/267)) Fix the join between job and user in the user list (admin): show only the current user job

3
.changes/v2.18.1.md Normal file
View File

@@ -0,0 +1,3 @@
## v2.18.1 - 2024-03-26
### Fixed
* Fix layout issue in document generation for admin (minor)

View File

@@ -23,3 +23,7 @@ max_line_length = 0
indent_size = 2 indent_size = 2
indent_style = space indent_style = space
[.rst]
ident_size = 3
ident_style = space

94
.env Normal file
View File

@@ -0,0 +1,94 @@
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
# https://symfony.com/doc/current/configuration/secrets.html
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
## Locale
LOCALE=fr
###> symfony/framework-bundle ###
# this should be set in docker-compose.yml file
APP_ENV=prod
APP_SECRET=ChangeItf2b58287ef7f9976409d3f6c72529e99ChangeIt
TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
TRUSTED_HOSTS='^(localhost|example\.com|nginx)$'
###< symfony/framework-bundle ###
## Wopi server for editing documents online
WOPI_SERVER=http://collabora:9980
# must be manually set in .env.local
# ADMIN_PASSWORD=
###> symfony/mailer ###
# MAILER_DSN=null://null
###< symfony/mailer ###
## Notifications
NOTIFICATION_HOST=localhost:8001
NOTIFICATION_FROM_EMAIL=admin@chill.social
NOTIFICATION_FROM_NAME="Chill <admin@chill.social>"
## Pgadmin credential
PGADMIN_DEFAULT_EMAIL=
PGADMIN_DEFAULT_PASSWORD=
## OVH OpenStack Storage Container
ASYNC_UPLOAD_TEMP_URL_KEY=
ASYNC_UPLOAD_TEMP_URL_BASE_PATH=
ASYNC_UPLOAD_TEMP_URL_CONTAINER=
## Redis Cache
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_URL=redis://${REDIS_HOST}:${REDIS_PORT}
## Twilio
TWILIO_SID=~
TWILIO_SECRET=~
DEFAULT_CARRIER_CODE=BE
ADD_ADDRESS_DEFAULT_COUNTRY=BE
ADD_ADDRESS_MAP_CENTER_X=50.8443
ADD_ADDRESS_MAP_CENTER_Y=4.3523
ADD_ADDRESS_MAP_CENTER_Z=15
SHORT_MESSAGE_DSN=null://null
## DOCKER IMAGES REGISTRY
#IMAGE_PHP=
#IMAGE_NGINX=
## DOCKER IMAGES TAG
#VERSION=test
#VERSION=prod
###> symfony/messenger ###
# Choose one of the transports below
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
MESSENGER_TRANSPORT_DSN=sync://
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
###< symfony/messenger ###
###> doctrine/doctrine-bundle ###
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
DATABASE_URL="postgresql://postgres:postgres@db:5432/postgres?serverVersion=14&charset=utf8"
###< doctrine/doctrine-bundle ###
###> lexik/jwt-authentication-bundle ###
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
JWT_PASSPHRASE=2a30f6ba26521a2613821da35f28386e
###< lexik/jwt-authentication-bundle ###

View File

@@ -4,6 +4,8 @@
KERNEL_CLASS='App\Kernel' KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st' APP_SECRET='$ecretf0rt3st'
TRUSTED_HOSTS=
ADMIN_PASSWORD=password ADMIN_PASSWORD=password
LOCALE=fr LOCALE=fr

View File

@@ -20,6 +20,7 @@ services:
# Set any variables we need # Set any variables we need
variables: variables:
APP_ENV: test
GIT_DEPTH: 1 GIT_DEPTH: 1
# Configure postgres environment variables (https://hub.docker.com/r/_/postgres/) # Configure postgres environment variables (https://hub.docker.com/r/_/postgres/)
POSTGRES_USER: postgres POSTGRES_USER: postgres
@@ -34,6 +35,8 @@ variables:
DEFAULT_CARRIER_CODE: BE DEFAULT_CARRIER_CODE: BE
# force a timezone # force a timezone
TZ: Europe/Brussels TZ: Europe/Brussels
# avoid direct deprecations (using symfony phpunit bridge: https://symfony.com/doc/4.x/components/phpunit_bridge.html#internal-deprecations
SYMFONY_DEPRECATIONS_HELPER: max[total]=99999999&max[self]=0&max[direct]=45&verbose=0
stages: stages:
- Composer install - Composer install
@@ -51,7 +54,7 @@ build:
paths: paths:
- .cache/ - .cache/
artifacts: artifacts:
expire_in: 30 min expire_in: 1 day
paths: paths:
- bin - bin
- vendor/ - vendor/
@@ -65,7 +68,7 @@ code_style:
paths: paths:
- .cache/ - .cache/
artifacts: artifacts:
expire_in: 30 min expire_in: 1 day
paths: paths:
- bin - bin
- vendor/ - vendor/
@@ -79,7 +82,7 @@ phpstan_tests:
paths: paths:
- .cache/ - .cache/
artifacts: artifacts:
expire_in: 30 min expire_in: 1 day
paths: paths:
- bin - bin
- vendor/ - vendor/
@@ -94,7 +97,7 @@ rector_tests:
paths: paths:
- .cache/ - .cache/
artifacts: artifacts:
expire_in: 30 min expire_in: 1 day
paths: paths:
- bin - bin
- vendor/ - vendor/
@@ -118,10 +121,10 @@ unit_tests:
- php tests/console doctrine:migrations:migrate -n --env=test - php tests/console doctrine:migrations:migrate -n --env=test
- php tests/console chill:db:sync-views --env=test - php tests/console chill:db:sync-views --env=test
- php -d memory_limit=2G tests/console cache:clear --env=test - php -d memory_limit=2G tests/console cache:clear --env=test
- php -d memory_limit=3G tests/console doctrine:fixtures:load -n - php -d memory_limit=3G tests/console doctrine:fixtures:load -n --env=test
- php -d memory_limit=4G bin/phpunit --colors=never --exclude-group dbIntensive - php -d memory_limit=4G bin/phpunit --colors=never --exclude-group dbIntensive
artifacts: artifacts:
expire_in: 30 min expire_in: 1 day
paths: paths:
- bin - bin
- vendor/ - vendor/

View File

@@ -112,6 +112,7 @@ $rules = array_merge(
], ],
'sort_algorithm' => 'alpha', 'sort_algorithm' => 'alpha',
], ],
'single_line_empty_body' => true,
], ],
$rules, $rules,
$riskyRules, $riskyRules,

View File

@@ -1,10 +1,14 @@
--- ---
version: 2 version: 2
build:
os: ubuntu-22.04
tools:
python: "3.7"
sphinx: sphinx:
configuration: docs/source/conf.py configuration: docs/source/conf.py
python: python:
version: 3.7
install: install:
- requirements: docs/requirements.txt - requirements: docs/requirements.txt

View File

@@ -6,6 +6,68 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie). and is generated by [Changie](https://github.com/miniscruff/changie).
## v2.18.1 - 2024-03-26
### Fixed
* Fix layout issue in document generation for admin (minor)
## v2.18.0 - 2024-03-26
### Feature
* ([#268](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/268)) Improve admin UX to configure document templates for document generation
### Fixed
* ([#267](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/267)) Fix the join between job and user in the user list (admin): show only the current user job
## v2.17.0 - 2024-03-19
### Feature
* ([#237](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/237)) New export filter for social actions with an evaluation created between two dates
* ([#258](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/258)) In the list of accompangying period, add the list of person's centers and the duration of the course
* ([#238](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/238)) Allow to customize list person with new fields
* ([#159](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/159)) Admin can publish news on the homepage
### Fixed
* ([#264](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/264)) Fix languages: load the languages in all availables languages configured for Chill
* ([#259](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/259)) Keep a consistent behaviour between the filtering of activities within the document generation (model "accompanying period with activities"), and the same filter in the list of activities for an accompanying period
## v2.16.3 - 2024-02-26
### Fixed
* ([#236](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/236)) Fix translation of user job -> 'service' must be 'métier'
### UX
* ([#232](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/232)) Order user jobs and services alphabetically in export filters
## v2.16.2 - 2024-02-21
### Fixed
* Check for null values in closing motive of parcours d'accompagnement for correct rendering of template
## v2.16.1 - 2024-02-09
### Fixed
* Force bootstrap version to avoid error in builds with newer version
## v2.16.0 - 2024-02-08
### Feature
* ([#231](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/231)) Create new filter for persons having a participation in an accompanying period during a certain time span
* ([#241](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/241)) [Export][List of accompanyign period] Add two columns: the list of persons participating to the period, and their ids
* ([#244](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/244)) Add capability to generate export about change of steps of accompanying period, and generate exports for this
* ([#253](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/253)) Export: group accompanying period by person participating
* ([#243](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/243)) Export: add filter for courses not linked to a reference address
* ([#229](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/229)) Allow to group activities linked with accompanying period by reason
* ([#115](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/115)) Prevent social work to be saved when another user edited conccurently the social work
* Modernize the event bundle, with some new fields and multiple improvements
### Fixed
* ([#220](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/220)) Fix error in logs about wrong typing of eventArgs in onEditNotificationComment method
* ([#256](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/256)) Fix the conditions upon which social actions should be optional or required in relation to social issues within the activity creation form
### UX
* ([#260](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/260)) Order list of centers alphabetically in dropdown 'user' section admin.
## v2.15.2 - 2024-01-11
### Fixed
* Fix the id_seq used when creating a new accompanying period participation during fusion of two person files
### DX
* Set placeholder to False for expanded EntityType form fields where required is set to False.
## v2.15.1 - 2023-12-20
### Fixed
* Fix the household export query to exclude accompanying periods that are in draft state.
### DX
* ([#167](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/167)) Fixed readthedocs compilation by updating readthedocs config file and requirements for Sphinx
## v2.15.0 - 2023-12-11 ## v2.15.0 - 2023-12-11
### Feature ### Feature
* ([#191](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/191)) Add export "number of household associate with an exchange" * ([#191](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/191)) Add export "number of household associate with an exchange"

117
MIGRATION.md Normal file
View File

@@ -0,0 +1,117 @@
# Switch to symfony 5.0
- the tag `chill.role` is now renamed to `chill_main.provide_role`.
**Note**: It is not necessary to apply this tag on service definition: the tag is automatically applyied if the
service implements `\Chill\MainBundle\Security\ProvideRoleInterface`.
- those annotation can be converted to attribute:
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\AccompanyingPeriodValidity`
- `Chill\PersonBundle\Validator\Constraints\Household\HouseholdMembershipSequential`
- `Chill\PersonBundle\Validator\Constraints\Household\MaxHolder`
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ConfidentialCourseMustHaveReferrer`
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\LocationValidity`
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ParticipationOverlap`
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ResourceDuplicateCheck`
- `Chill\PersonBundle\Validator\Constraints\Person\Birthdate`
- `Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenter`
- `Chill\PersonBundle\Validator\Constraints\Relationship\RelationshipNoDuplicate`
- `Chill\ActivityBundle\Validator\Constraints\ActivityValidity`
- `Chill\DocStoreBundle\Validator\Constraints\AsyncFileExists`
- `Chill\MainBundle\Validation\Constraint\PhonenumberConstraint`
- `Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency`
- `Chill\MainBundle\Workflow\Validator\EntityWorkflowCreation`
Here is the rector rule that can be used to switch attributes to annotations:
```php
$rectorConfig->ruleWithConfiguration(\Rector\Php80\Rector\Class_\AnnotationToAttributeRector::class, [
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\AccompanyingPeriodValidity'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Household\HouseholdMembershipSequential'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Household\MaxHolder'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ConfidentialCourseMustHaveReferrer'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\LocationValidity'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ParticipationOverlap'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ResourceDuplicateCheck'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Person\Birthdate'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenter'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Relationship\RelationshipNoDuplicate'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\ActivityBundle\Validator\Constraints\ActivityValidity'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\DocStoreBundle\Validator\Constraints\AsyncFileExists'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Validation\Constraint\PhonenumberConstraint'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Workflow\Validator\EntityWorkflowCreation'),
]);
```
- to keep cleaner definition in container's dependency injection and framework bundle, the definition of crud or api
requires to define explicitly a controller.
Before:
```php
$container->prependExtensionConfig('chill_main', [
'apis' => [
[
'class' => ThirdParty::class,
'name' => 'thirdparty',
'base_path' => '/api/1.0/thirdparty/thirdparty',
'actions' => [
'_entity' => [
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true,
Request::METHOD_POST => true,
Request::METHOD_PUT => true,
Request::METHOD_PATCH => true,
],
'roles' => [
Request::METHOD_GET => ThirdPartyVoter::SHOW,
Request::METHOD_HEAD => ThirdPartyVoter::SHOW,
Request::METHOD_POST => ThirdPartyVoter::CREATE,
Request::METHOD_PUT => ThirdPartyVoter::CREATE,
Request::METHOD_PATCH => ThirdPartyVoter::CREATE,
],
],
],
],
],
]);
After:
```php
$container->prependExtensionConfig('chill_main', [
'apis' => [
[
'class' => ThirdParty::class,
'controller' => ThirdPartyApiController::class,
'name' => 'thirdparty',
'base_path' => '/api/1.0/thirdparty/thirdparty',
'actions' => [
'_entity' => [
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true,
Request::METHOD_POST => true,
Request::METHOD_PUT => true,
Request::METHOD_PATCH => true,
],
'roles' => [
Request::METHOD_GET => ThirdPartyVoter::SHOW,
Request::METHOD_HEAD => ThirdPartyVoter::SHOW,
Request::METHOD_POST => ThirdPartyVoter::CREATE,
Request::METHOD_PUT => ThirdPartyVoter::CREATE,
Request::METHOD_PATCH => ThirdPartyVoter::CREATE,
],
],
],
],
],
]);
```

View File

@@ -32,27 +32,47 @@
"ramsey/uuid-doctrine": "^1.7", "ramsey/uuid-doctrine": "^1.7",
"sensio/framework-extra-bundle": "^5.5", "sensio/framework-extra-bundle": "^5.5",
"spomky-labs/base64url": "^2.0", "spomky-labs/base64url": "^2.0",
"symfony/browser-kit": "^4.4", "symfony/asset": "^5.4",
"symfony/browser-kit": "^5.4",
"symfony/cache": "^5.4",
"symfony/clock": "^6.2", "symfony/clock": "^6.2",
"symfony/css-selector": "^4.4", "symfony/config": "^5.4",
"symfony/expression-language": "^4.4", "symfony/console": "^5.4",
"symfony/form": "^4.4", "symfony/css-selector": "^5.4",
"symfony/framework-bundle": "^4.4", "symfony/dom-crawler": "^5.4",
"symfony/http-client": "^4.4 || ^5", "symfony/error-handler": "^5.4",
"symfony/http-foundation": "^4.4", "symfony/event-dispatcher": "^5.4",
"symfony/intl": "^4.4", "symfony/expression-language": "^5.4",
"symfony/filesystem": "^5.4",
"symfony/finder": "^5.4",
"symfony/form": "^5.4",
"symfony/framework-bundle": "^5.4",
"symfony/http-client": "^5.4",
"symfony/http-foundation": "^5.4",
"symfony/intl": "^5.4",
"symfony/mailer": "^5.4", "symfony/mailer": "^5.4",
"symfony/messenger": "^5.4", "symfony/messenger": "^5.4",
"symfony/mime": "^5.4", "symfony/mime": "^5.4",
"symfony/monolog-bundle": "^3.5", "symfony/monolog-bundle": "^3.5",
"symfony/security-bundle": "^4.4", "symfony/options-resolver": "^5.4",
"symfony/serializer": "^5.3", "symfony/process": "^5.4",
"symfony/translation": "^4.4", "symfony/property-access": "^5.4",
"symfony/twig-bundle": "^4.4", "symfony/property-info": "^5.4",
"symfony/validator": "^4.4", "symfony/routing": "^5.4",
"symfony/security-bundle": "^5.4",
"symfony/security-core": "^5.4",
"symfony/security-csrf": "^5.4",
"symfony/security-guard": "^5.4",
"symfony/security-http": "^5.4",
"symfony/serializer": "^5.4",
"symfony/string": "^5.4",
"symfony/templating": "^5.4",
"symfony/translation": "^5.4",
"symfony/twig-bundle": "^5.4",
"symfony/validator": "^5.4",
"symfony/webpack-encore-bundle": "^1.11", "symfony/webpack-encore-bundle": "^1.11",
"symfony/workflow": "^4.4", "symfony/workflow": "^5.4",
"symfony/yaml": "^4.4", "symfony/yaml": "^5.4",
"thenetworg/oauth2-azure": "^2.0", "thenetworg/oauth2-azure": "^2.0",
"twig/extra-bundle": "^3.0", "twig/extra-bundle": "^3.0",
"twig/intl-extra": "^3.0", "twig/intl-extra": "^3.0",
@@ -72,16 +92,14 @@
"phpstan/phpstan-deprecation-rules": "^1.1", "phpstan/phpstan-deprecation-rules": "^1.1",
"phpstan/phpstan-strict-rules": "^1.0", "phpstan/phpstan-strict-rules": "^1.0",
"phpunit/phpunit": ">= 7.5", "phpunit/phpunit": ">= 7.5",
"psalm/plugin-phpunit": "^0.18.4", "rector/rector": "^1.0.0",
"psalm/plugin-symfony": "^4.0.2", "symfony/debug-bundle": "^5.4",
"rector/rector": "^0.17.7", "symfony/dotenv": "^5.4",
"symfony/debug-bundle": "^5.1",
"symfony/dotenv": "^4.4",
"symfony/maker-bundle": "^1.20", "symfony/maker-bundle": "^1.20",
"symfony/phpunit-bridge": "^4.4", "symfony/phpunit-bridge": "^5.4",
"symfony/stopwatch": "^4.4", "symfony/runtime": "^5.4",
"symfony/var-dumper": "^4.4", "symfony/stopwatch": "^5.4",
"vimeo/psalm": "^4.30.0" "symfony/var-dumper": "^5.4"
}, },
"conflict": { "conflict": {
"symfony/symfony": "*" "symfony/symfony": "*"

View File

@@ -27,7 +27,7 @@ To compile this documentation :
Contribute Contribute
=========== ===========
Issue tracker : https://git.framasoft.org/groups/Chill-project/issues Issue tracker : https://gitlab.com/Chill-Projet/chill-bundles/-/issues
Licence Licence
======= =======

View File

@@ -1,6 +1,7 @@
docutils==0.13.1 docutils==0.13.1
Pygments==2.2.0 Pygments==2.2.0
sphinx==1.8.5 sphinx==1.8.5
Jinja2<3.1
git+https://github.com/fabpot/sphinx-php.git@v2.0.2#egg_name=sphinx-php git+https://github.com/fabpot/sphinx-php.git@v2.0.2#egg_name=sphinx-php
jsx-lexer===0.0.8 jsx-lexer===0.0.8
sphinx_rtd_theme==0.5.0 sphinx_rtd_theme==0.5.0

View File

@@ -242,3 +242,129 @@ This is an example of the *filter by birthdate*. This filter asks some informati
Continue to explain the export framework Continue to explain the export framework
.. _main bundle: https://git.framasoft.org/Chill-project/Chill-Main .. _main bundle: https://git.framasoft.org/Chill-project/Chill-Main
With many-to-* relationship, why should we set WHERE clauses in an EXISTS subquery instead of a JOIN ?
``````````````````````````````````````````````````````````````````````````````````````````````````````
As we described above, the doctrine builder is converted into a sql query. Let's see how to compute the "number of course
which count at least one activity type with the id 7". For the purpose of this demonstration, we will restrict this on
two accompanying period only: the ones with id 329 and 334.
Let's see the list of activities associated with those accompanying period:
.. code-block:: sql
SELECT id, accompanyingperiod_id, type_id FROM activity WHERE accompanyingperiod_id IN (329, 334) AND type_id = 7
ORDER BY accompanyingperiod_id;
We see that we have 6 activities for the accompanying period with id 329, and only one for the 334's one.
.. csv-table::
:header: id, accompanyingperiod_id, type_id
990,329,7
986,329,7
987,329,7
993,329,7
991,329,7
992,329,7
1000,334,7
Let's calculate the average duration for those accompanying periods, and the number of period:
.. code-block:: sql
SELECT AVG(age(COALESCE(closingdate, CURRENT_DATE), openingdate)), COUNT(id) from chill_person_accompanying_period WHERE id IN (329, 334);
The result of this query is:
.. csv-table::
:header: AVG, COUNT
2 years 2 mons 21 days 12 hours 0 mins 0.0 secs,2
Now, we count the number of accompanying period, adding a :code:`JOIN` clause which make a link to the :code:`activity` table, and add a :code:`WHERE` clause to keep
only the accompanying period which contains the given activity type:
.. code-block:: sql
SELECT COUNT(chill_person_accompanying_period.id) from chill_person_accompanying_period
JOIN activity ON chill_person_accompanying_period.id = activity.accompanyingperiod_id
WHERE chill_person_accompanying_period.id IN (329, 334) AND activity.type_id = 7;
What are the results here ?
.. csv-table::
:header: COUNT
7
:code:`7` ! Why this result ? Because the number of lines is duplicated for each activity. Let's see the list of rows which
are taken into account for the computation:
.. code-block:: sql
SELECT chill_person_accompanying_period.id, activity.id from chill_person_accompanying_period
JOIN activity ON chill_person_accompanying_period.id = activity.accompanyingperiod_id
WHERE chill_person_accompanying_period.id IN (329, 334) AND activity.type_id = 7;
.. csv-table::
:header: accompanyingperiod.id, activity.id
329,993
334,1000
329,987
329,990
329,991
329,992
329,986
For each activity, a row is created and, as we count the number of non-null :code:`accompanyingperiod.id` columns, we
count one entry for each activity (actually, we count the number of activities).
So, let's use the :code:`DISTINCT` keyword to count only once the equal ids:
.. code-block::
SELECT COUNT(DISTINCT chill_person_accompanying_period.id) from chill_person_accompanying_period
JOIN activity ON chill_person_accompanying_period.id = activity.accompanyingperiod_id
WHERE chill_person_accompanying_period.id IN (329, 334) AND activity.type_id = 7;
Now, it works again...
.. csv-table::
:header: COUNT
2
But, for the average duration, this won't work: the duration which are equals (because the :code:`openingdate` is the same and
:code:`closingdate` is still :code:`NULL`, for instance) will be counted only once, which will give unexpected result.
The solution is to move the condition "having an activity with activity type with id 7" in a :code:`EXISTS` clause:
.. code-block:: sql
SELECT COUNT(chill_person_accompanying_period.id) from chill_person_accompanying_period
WHERE chill_person_accompanying_period.id IN (329, 334) AND EXISTS (SELECT 1 FROM activity WHERE type_id = 7 AND accompanyingperiod_id = chill_person_accompanying_period.id);
The result is correct without :code:`DISTINCT` keyword:
.. csv-table::
:header: COUNT
2
And we can now compute the average duration without fear:
.. code-block:: sql
SELECT AVG(age(COALESCE(closingdate, CURRENT_DATE), openingdate)) from chill_person_accompanying_period
WHERE chill_person_accompanying_period.id IN (329, 334) AND EXISTS (SELECT 1 FROM activity WHERE type_id = 7 AND accompanyingperiod_id = chill_person_accompanying_period.id);
Give the result:
.. csv-table::
:header: AVG
2 years 2 mons 21 days 12 hours 0 mins 0.0 secs

View File

@@ -15,9 +15,12 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class example extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController class example extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController
{ {
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
{
}
public function yourAction() public function yourAction()
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->managerRegistry->getManager();
// first, get the number of total item are available // first, get the number of total item are available
$total = $em $total = $em
->createQuery('SELECT COUNT (item.id) FROM ChillMyBundle:Item item') ->createQuery('SELECT COUNT (item.id) FROM ChillMyBundle:Item item')

View File

@@ -18,6 +18,9 @@ use Symfony\Component\Security\Core\Role\Role;
class ConsultationController extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController class ConsultationController extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController
{ {
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
{
}
/** /**
* @param int $id personId * @param int $id personId
* *
@@ -48,7 +51,7 @@ class ConsultationController extends \Symfony\Bundle\FrameworkBundle\Controller\
); );
// create a query which take circles into account // create a query which take circles into account
$consultations = $this->getDoctrine()->getManager() $consultations = $this->managerRegistry->getManager()
->createQuery('SELECT c FROM ChillHealthBundle:Consultation c ' ->createQuery('SELECT c FROM ChillHealthBundle:Consultation c '
. 'WHERE c.patient = :person AND c.circle IN(:circles) ' . 'WHERE c.patient = :person AND c.circle IN(:circles) '
. 'ORDER BY c.date DESC') . 'ORDER BY c.date DESC')

View File

@@ -48,8 +48,8 @@ Clone or download the chill-skeleton project and `cd` into the main directory.
.. code-block:: bash .. code-block:: bash
git clone https://gitlab.com/Chill-Projet/chill-skeleton-basic.git git clone https://gitea.champs-libres.be/Chill-project/chill-skeleton-basic.git
cd chill-app cd chill-skeleton-basic
As a developer, the code will stay on your computer and will be executed in docker container. To avoid permission problem, the code should be run with the same uid/gid from your current user. This is why we get your current user id with the command ``id -u`` in each following scripts. As a developer, the code will stay on your computer and will be executed in docker container. To avoid permission problem, the code should be run with the same uid/gid from your current user. This is why we get your current user id with the command ``id -u`` in each following scripts.

View File

@@ -5,72 +5,74 @@ Add condition with distinct alias on each export join clauses (Indicators + Filt
These are alias conventions : These are alias conventions :
| Entity | Join | Attribute | Alias | | Entity | Join | Attribute | Alias |
|:----------------------------------------|:----------------------------------------|:-------------------------------------------|:---------------------------------------| |:----------------------------------------|:----------------------------------------|:-------------------------------------------|:-------------------------------------------|
| AccompanyingPeriod::class | | | acp | | AccompanyingPeriodStepHistory::class | | | acpstephistory (contexte ACP_STEP_HISTORY) |
| | AccompanyingPeriodWork::class | acp.works | acpw | | | AccompanyingPeriod::class | acpstephistory.period | acp |
| | AccompanyingPeriodParticipation::class | acp.participations | acppart | | AccompanyingPeriod::class | | | acp |
| | Location::class | acp.administrativeLocation | acploc | | | AccompanyingPeriodWork::class | acp.works | acpw |
| | ClosingMotive::class | acp.closingMotive | acpmotive | | | AccompanyingPeriodParticipation::class | acp.participations | acppart |
| | UserJob::class | acp.job | acpjob | | | Location::class | acp.administrativeLocation | acploc |
| | Origin::class | acp.origin | acporigin | | | ClosingMotive::class | acp.closingMotive | acpmotive |
| | Scope::class | acp.scopes | acpscope | | | UserJob::class | acp.job | acpjob |
| | SocialIssue::class | acp.socialIssues | acpsocialissue | | | Origin::class | acp.origin | acporigin |
| | User::class | acp.user | acpuser | | | Scope::class | acp.scopes | acpscope |
| | AccompanyingPeriopStepHistory::class | acp.stepHistories | acpstephistories | | | SocialIssue::class | acp.socialIssues | acpsocialissue |
| | AccompanyingPeriodInfo::class | not existing (using custom WITH clause) | acpinfo | | | User::class | acp.user | acpuser |
| AccompanyingPeriodWork::class | | | acpw | | | AccompanyingPeriopStepHistory::class | acp.stepHistories | acpstephistories |
| | AccompanyingPeriodWorkEvaluation::class | acpw.accompanyingPeriodWorkEvaluations | workeval | | | AccompanyingPeriodInfo::class | not existing (using custom WITH clause) | acpinfo |
| | SocialAction::class | acpw.socialAction | acpwsocialaction | | AccompanyingPeriodWork::class | | | acpw |
| | Goal::class | acpw.goals | goal | | | AccompanyingPeriodWorkEvaluation::class | acpw.accompanyingPeriodWorkEvaluations | workeval |
| | Result::class | acpw.results | result | | | SocialAction::class | acpw.socialAction | acpwsocialaction |
| AccompanyingPeriodParticipation::class | | | acppart | | | Goal::class | acpw.goals | goal |
| | Person::class | acppart.person | partperson | | | Result::class | acpw.results | result |
| AccompanyingPeriodWorkEvaluation::class | | | workeval | | AccompanyingPeriodParticipation::class | | | acppart |
| | Evaluation::class | workeval.evaluation | eval | | | Person::class | acppart.person | partperson |
| AccompanyingPeriodInfo::class | | | acpinfo | | AccompanyingPeriodWorkEvaluation::class | | | workeval |
| | User::class | acpinfo.user | acpinfo_user | | | Evaluation::class | workeval.evaluation | eval |
| Goal::class | | | goal | | AccompanyingPeriodInfo::class | | | acpinfo |
| | Result::class | goal.results | goalresult | | | User::class | acpinfo.user | acpinfo_user |
| Person::class | | | person | | Goal::class | | | goal |
| | Center::class | person.center | center | | | Result::class | goal.results | goalresult |
| | HouseholdMember::class | partperson.householdParticipations | householdmember | | Person::class | | | person |
| | MaritalStatus::class | person.maritalStatus | personmarital | | | Center::class | person.center | center |
| | VendeePerson::class | | vp | | | HouseholdMember::class | partperson.householdParticipations | householdmember |
| | VendeePersonMineur::class | | vpm | | | MaritalStatus::class | person.maritalStatus | personmarital |
| | CurrentPersonAddress::class | person.currentPersonAddress | currentPersonAddress (on a given date) | | | VendeePerson::class | | vp |
| ResidentialAddress::class | | | resaddr | | | VendeePersonMineur::class | | vpm |
| | ThirdParty::class | resaddr.hostThirdParty | tparty | | | CurrentPersonAddress::class | person.currentPersonAddress | currentPersonAddress (on a given date) |
| ThirdParty::class | | | tparty | | ResidentialAddress::class | | | resaddr |
| | ThirdPartyCategory::class | tparty.categories | tpartycat | | | ThirdParty::class | resaddr.hostThirdParty | tparty |
| HouseholdMember::class | | | householdmember | | ThirdParty::class | | | tparty |
| | Household::class | householdmember.household | household | | | ThirdPartyCategory::class | tparty.categories | tpartycat |
| | Person::class | householdmember.person | memberperson | | HouseholdMember::class | | | householdmember |
| | | memberperson.center | membercenter | | | Household::class | householdmember.household | household |
| Household::class | | | household | | | Person::class | householdmember.person | memberperson |
| | HouseholdComposition::class | household.compositions | composition | | | | memberperson.center | membercenter |
| Activity::class | | | activity | | Household::class | | | household |
| | Person::class | activity.person | actperson | | | HouseholdComposition::class | household.compositions | composition |
| | AccompanyingPeriod::class | activity.accompanyingPeriod | acp | | Activity::class | | | activity |
| | Person::class | activity\_person\_having\_activity.person | person\_person\_having\_activity | | | Person::class | activity.person | actperson |
| | ActivityReason::class | activity\_person\_having\_activity.reasons | reasons\_person\_having\_activity | | | AccompanyingPeriod::class | activity.accompanyingPeriod | acp |
| | ActivityType::class | activity.activityType | acttype | | | Person::class | activity\_person\_having\_activity.person | person\_person\_having\_activity |
| | Location::class | activity.location | actloc | | | ActivityReason::class | activity\_person\_having\_activity.reasons | reasons\_person\_having\_activity |
| | SocialAction::class | activity.socialActions | actsocialaction | | | ActivityType::class | activity.activityType | acttype |
| | SocialIssue::class | activity.socialIssues | actsocialssue | | | Location::class | activity.location | actloc |
| | ThirdParty::class | activity.thirdParties | acttparty | | | SocialAction::class | activity.socialActions | actsocialaction |
| | User::class | activity.user | actuser | | | SocialIssue::class | activity.socialIssues | actsocialssue |
| | User::class | activity.users | actusers | | | ThirdParty::class | activity.thirdParties | acttparty |
| | ActivityReason::class | activity.reasons | actreasons | | | User::class | activity.user | actuser |
| | Center::class | actperson.center | actcenter | | | User::class | activity.users | actusers |
| | Person::class | activity.createdBy | actcreator | | | ActivityReason::class | activity.reasons | actreasons |
| ActivityReason::class | | | actreasons | | | Center::class | actperson.center | actcenter |
| | ActivityReasonCategory::class | actreason.category | actreasoncat | | | Person::class | activity.createdBy | actcreator |
| Calendar::class | | | cal | | ActivityReason::class | | | actreasons |
| | CancelReason::class | cal.cancelReason | calcancel | | | ActivityReasonCategory::class | actreason.category | actreasoncat |
| | Location::class | cal.location | calloc | | Calendar::class | | | cal |
| | User::class | cal.user | caluser | | | CancelReason::class | cal.cancelReason | calcancel |
| VendeePerson::class | | | vp | | | Location::class | cal.location | calloc |
| | SituationProfessionelle::class | vp.situationProfessionelle | vpprof | | | User::class | cal.user | caluser |
| | StatutLogement::class | vp.statutLogement | vplog | | VendeePerson::class | | | vp |
| | TempsDeTravail::class | vp.tempsDeTravail | vptt | | | SituationProfessionelle::class | vp.situationProfessionelle | vpprof |
| | StatutLogement::class | vp.statutLogement | vplog |
| | TempsDeTravail::class | vp.tempsDeTravail | vptt |

View File

@@ -14,12 +14,15 @@
"@ckeditor/ckeditor5-vue": "^4.0.1", "@ckeditor/ckeditor5-vue": "^4.0.1",
"@symfony/webpack-encore": "^4.1.0", "@symfony/webpack-encore": "^4.1.0",
"@tsconfig/node14": "^1.0.1", "@tsconfig/node14": "^1.0.1",
"@types/dompurify": "^3.0.5",
"bindings": "^1.5.0", "bindings": "^1.5.0",
"bootstrap": "^5.0.1", "bootstrap": "5.2.3",
"chokidar": "^3.5.1", "chokidar": "^3.5.1",
"dompurify": "^3.1.0",
"fork-awesome": "^1.1.7", "fork-awesome": "^1.1.7",
"jquery": "^3.6.0", "jquery": "^3.6.0",
"node-sass": "^8.0.0", "node-sass": "^8.0.0",
"marked": "^12.0.1",
"popper.js": "^1.16.1", "popper.js": "^1.16.1",
"postcss-loader": "^7.0.2", "postcss-loader": "^7.0.2",
"raw-loader": "^4.0.2", "raw-loader": "^4.0.2",
@@ -46,7 +49,7 @@
"es6-promise": "^4.2.8", "es6-promise": "^4.2.8",
"leaflet": "^1.7.1", "leaflet": "^1.7.1",
"masonry-layout": "^4.2.2", "masonry-layout": "^4.2.2",
"mime": "^3.0.0", "mime": "^4.0.0",
"swagger-ui": "^4.15.5", "swagger-ui": "^4.15.5",
"vis-network": "^9.1.0", "vis-network": "^9.1.0",
"vue": "^3.2.37", "vue": "^3.2.37",

View File

@@ -0,0 +1,58 @@
# See https://github.com/doctrine/orm/issues/11313 for a follow-up
parameters:
ignoreErrors:
-
message: """
#^Fetching deprecated class constant ASC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
use Order\\:\\:Ascending instead$#
"""
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php
-
message: """
#^Fetching deprecated class constant ASC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
use Order\\:\\:Ascending instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Entity/Notification.php
-
message: """
#^Fetching deprecated class constant DESC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
use Order\\:\\:Descending instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php
-
message: """
#^Fetching deprecated class constant DESC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
use Order\\:\\:Descending instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php
-
message: """
#^Fetching deprecated class constant DESC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
use Order\\:\\:Descending instead$#
"""
count: 2
path: src/Bundle/ChillPersonBundle/Entity/Household/Household.php
-
message: """
#^Fetching deprecated class constant DESC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
use Order\\:\\:Descending instead$#
"""
count: 2
path: src/Bundle/ChillPersonBundle/Entity/Person.php
-
message: """
#^Fetching deprecated class constant DESC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
use Order\\:\\:Descending instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php

View File

@@ -100,11 +100,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillEventBundle/Controller/EventController.php path: src/Bundle/ChillEventBundle/Controller/EventController.php
-
message: "#^Parameter \\#1 \\$name of method Symfony\\\\Component\\\\Form\\\\FormFactoryInterface\\:\\:createNamedBuilder\\(\\) expects string, null given\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Controller/EventController.php
- -
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, Chill\\\\MainBundle\\\\Entity\\\\Center given\\.$#" message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, Chill\\\\MainBundle\\\\Entity\\\\Center given\\.$#"
count: 1 count: 1
@@ -165,11 +160,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Controller/ExportController.php path: src/Bundle/ChillMainBundle/Controller/ExportController.php
-
message: "#^Parameter \\#1 \\$name of method Symfony\\\\Component\\\\Form\\\\FormFactoryInterface\\:\\:createNamedBuilder\\(\\) expects string, null given\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Controller/ExportController.php
- -
message: "#^Parameter \\#3 \\$alias of method Chill\\\\MainBundle\\\\Controller\\\\ExportController\\:\\:exportFormStep\\(\\) expects string, Symfony\\\\Component\\\\HttpFoundation\\\\Request given\\.$#" message: "#^Parameter \\#3 \\$alias of method Chill\\\\MainBundle\\\\Controller\\\\ExportController\\:\\:exportFormStep\\(\\) expects string, Symfony\\\\Component\\\\HttpFoundation\\\\Request given\\.$#"
count: 1 count: 1

View File

@@ -1,5 +1,30 @@
parameters: parameters:
ignoreErrors: ignoreErrors:
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Form/PersonType.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Repository/NotificationRepository.php
- -
message: "#^Foreach overwrites \\$key with its key variable\\.$#" message: "#^Foreach overwrites \\$key with its key variable\\.$#"
count: 1 count: 1

View File

@@ -0,0 +1,153 @@
parameters:
ignoreErrors:
-
message: """
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
"""
count: 2
path: src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php
-
message: """
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php
-
message: """
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php
-
message: """
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
"""
count: 3
path: src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php
-
message: """
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
"""
count: 2
path: src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php
-
message: """
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php
-
message: """
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Encoder\\\\EncoderFactory\\:
since Symfony 5\\.3, use \\{@link PasswordHasherFactory\\} instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php
-
message: """
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Controller/MenuController.php
-
message: """
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Controller/SearchController.php
-
message: """
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Controller/UserController.php
-
message: """
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Encoder\\\\EncoderFactory\\:
since Symfony 5\\.3, use \\{@link PasswordHasherFactory\\} instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php
-
message: """
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
"""
count: 2
path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
-
message: """
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php
-
message: """
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
"""
count: 3
path: src/Bundle/ChillMainBundle/Validation/Validator/UserUniqueEmailAndUsername.php
-
message: """
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Validator/Constraints/Entity/UserCircleConsistencyValidator.php
-
message: """
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
"""
count: 13
path: src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php
-
message: """
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
"""
count: 4
path: src/Bundle/ChillPersonBundle/Controller/PersonController.php
-
message: """
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
"""
count: 7
path: src/Bundle/ChillReportBundle/Controller/ReportController.php
-
message: """
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
"""
count: 1
path: src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php

View File

@@ -1,36 +1,5 @@
parameters: parameters:
ignoreErrors: ignoreErrors:
-
message: """
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 2
path: src/Bundle/ChillActivityBundle/Controller/ActivityController.php
-
message: "#^Call to deprecated method setType\\(\\) of class Chill\\\\ActivityBundle\\\\Entity\\\\Activity\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Entity/ActivityReason.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php
-
message: """
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillActivityBundle/Form/ActivityType.php
- -
message: """ message: """
@@ -40,201 +9,10 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php path: src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php
-
message: """
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php
-
message: """
#^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldChoice\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bridge\\\\Twig\\\\TwigEngine\\:
since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$#
"""
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php
-
message: "#^Used function LogicException not found\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php
-
message: """
#^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldDate\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\:
since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$#
"""
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php
-
message: """
#^Parameter \\$twigEngine of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldLongChoice\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bridge\\\\Twig\\\\TwigEngine\\:
since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$#
"""
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php
-
message: """
#^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldNumber\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\:
since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$#
"""
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php
-
message: """
#^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldText\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\:
since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$#
"""
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php
-
message: """
#^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldTitle\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\:
since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$#
"""
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php
- -
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1 count: 1
path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php path: src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php
-
message: """
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 6
path: src/Bundle/ChillEventBundle/Controller/EventController.php
-
message: """
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillEventBundle/Form/EventType.php
-
message: """
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillEventBundle/Form/Type/PickEventType.php
-
message: """
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillFamilyMembersBundle/Security/Voter/FamilyMemberVoter.php
-
message: """
#^Parameter \\$role of method Chill\\\\MainBundle\\\\CRUD\\\\Controller\\\\CRUDController\\:\\:getReachableCenters\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php
-
message: """
#^Call to deprecated method getLanguageBundle\\(\\) of class Symfony\\\\Component\\\\Intl\\\\Intl\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use \\{@see Languages\\} or \\{@see Scripts\\} instead\\.$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php
-
message: """
#^Call to deprecated method getRegionBundle\\(\\) of class Symfony\\\\Component\\\\Intl\\\\Intl\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use \\{@see Countries\\} instead\\.$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php
-
message: """
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php
-
message: """
#^Parameter \\$role of anonymous function has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php
-
message: """
#^Call to deprecated method getLanguageBundle\\(\\) of class Symfony\\\\Component\\\\Intl\\\\Intl\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use \\{@see Languages\\} or \\{@see Scripts\\} instead\\.$#
"""
count: 2
path: src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php
-
message: """
#^Return type of method Chill\\\\MainBundle\\\\Entity\\\\User\\:\\:getRoles\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Entity/User.php
-
message: """
#^Class Chill\\\\MainBundle\\\\Form\\\\Event\\\\CustomizeFormEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Form/Event/CustomizeFormEvent.php
-
message: """
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php
-
message: """
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Form/Type/UserPickerType.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Repository/NotificationRepository.php
-
message: """
#^Parameter \\$attribute of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:userHasAccess\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
- -
message: """ message: """
@@ -244,14 +22,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
-
message: """
#^Parameter \\$role of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:getReachableCircles\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
- -
message: """ message: """
#^Parameter \\$centerResolverDispatcher of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\DefaultVoterHelper\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: #^Parameter \\$centerResolverDispatcher of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\DefaultVoterHelper\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
@@ -276,14 +46,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperGenerator.php path: src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperGenerator.php
-
message: """
#^Class Chill\\\\MainBundle\\\\Security\\\\PasswordRecover\\\\PasswordRecoverEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php
- -
message: """ message: """
#^Class Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcher implements deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: #^Class Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcher implements deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
@@ -292,35 +54,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php path: src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php
-
message: """
#^Class Chill\\\\MainBundle\\\\Templating\\\\Events\\\\DelegatedBlockRenderingEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Templating/Events/DelegatedBlockRenderingEvent.php
-
message: """
#^Class Chill\\\\PersonBundle\\\\Actions\\\\ActionEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Actions/ActionEvent.php
-
message: """
#^Class Chill\\\\PersonBundle\\\\Controller\\\\AccompanyingCourseController extends deprecated class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\Controller\\:
since Symfony 4\\.2, use "Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController" instead\\.$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php
- -
message: """ message: """
#^Call to deprecated method getCurrentAccompanyingPeriod\\(\\) of class Chill\\\\PersonBundle\\\\Entity\\\\Person\\: #^Call to deprecated method getCurrentAccompanyingPeriod\\(\\) of class Chill\\\\PersonBundle\\\\Entity\\\\Person\\:
@@ -329,56 +62,10 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php path: src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php
-
message: """
#^Class Chill\\\\PersonBundle\\\\Controller\\\\PersonDuplicateController extends deprecated class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\Controller\\:
since Symfony 4\\.2, use "Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController" instead\\.$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php
- -
message: "#^Access to deprecated property \\$proxyAccompanyingPeriodOpenState of class Chill\\\\PersonBundle\\\\Entity\\\\Person\\.$#" message: "#^Access to deprecated property \\$proxyAccompanyingPeriodOpenState of class Chill\\\\PersonBundle\\\\Entity\\\\Person\\.$#"
count: 2 count: 2
path: src/Bundle/ChillPersonBundle/Entity/Person.php path: src/Bundle/ChillPersonBundle/Entity/Person.php
-
message: """
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Form/AccompanyingPeriodType.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Form/PersonType.php
-
message: """
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php
-
message: """
#^Class Chill\\\\PersonBundle\\\\Privacy\\\\AccompanyingPeriodPrivacyEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Privacy/AccompanyingPeriodPrivacyEvent.php
-
message: """
#^Class Chill\\\\PersonBundle\\\\Privacy\\\\PrivacyEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Privacy/PrivacyEvent.php
- -
message: """ message: """
#^Parameter \\$centerResolverDispatcher of method Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriodACLAwareRepository\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: #^Parameter \\$centerResolverDispatcher of method Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriodACLAwareRepository\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
@@ -387,48 +74,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php
-
message: """
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Widget/PersonListWidget.php
-
message: """
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 3
path: src/Bundle/ChillReportBundle/Controller/ReportController.php
-
message: """
#^Parameter \\$role of method Chill\\\\ReportBundle\\\\Form\\\\ReportType\\:\\:appendScopeChoices\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillReportBundle/Form/ReportType.php
-
message: """
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillReportBundle/Search/ReportSearch.php
-
message: """
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 2
path: src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php
- -
message: """ message: """
#^Parameter \\$centerResolverDispatcher of method Chill\\\\TaskBundle\\\\Controller\\\\SingleTaskController\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: #^Parameter \\$centerResolverDispatcher of method Chill\\\\TaskBundle\\\\Controller\\\\SingleTaskController\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
@@ -437,46 +82,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php path: src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php
-
message: """
#^Parameter \\$role of method Chill\\\\TaskBundle\\\\Controller\\\\SingleTaskController\\:\\:setCreateForm\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php
-
message: """
#^Class Chill\\\\TaskBundle\\\\Event\\\\TaskEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
"""
count: 1
path: src/Bundle/ChillTaskBundle/Event/TaskEvent.php
-
message: """
#^Class Chill\\\\TaskBundle\\\\Event\\\\UI\\\\UIEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
"""
count: 1
path: src/Bundle/ChillTaskBundle/Event/UI/UIEvent.php
-
message: """
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 4
path: src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php
-
message: """
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillTaskBundle/Form/SingleTaskType.php
- -
message: """ message: """
#^Parameter \\$centerResolverDispatcher of method Chill\\\\TaskBundle\\\\Form\\\\SingleTaskType\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\: #^Parameter \\$centerResolverDispatcher of method Chill\\\\TaskBundle\\\\Form\\\\SingleTaskType\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
@@ -484,28 +89,3 @@ parameters:
""" """
count: 1 count: 1
path: src/Bundle/ChillTaskBundle/Form/SingleTaskType.php path: src/Bundle/ChillTaskBundle/Form/SingleTaskType.php
-
message: """
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 1
path: src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php
-
message: """
#^Class Chill\\\\TaskBundle\\\\Security\\\\Authorization\\\\AuthorizationEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
"""
count: 1
path: src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php
-
message: """
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
"""
count: 3
path: src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php

View File

@@ -31,4 +31,5 @@ includes:
- phpstan-baseline-level-3.neon - phpstan-baseline-level-3.neon
- phpstan-baseline-level-4.neon - phpstan-baseline-level-4.neon
- phpstan-baseline-level-5.neon - phpstan-baseline-level-5.neon
- phpstan-deprecations-sf54.neon
- phpstan-baseline-deprecations-doctrine-orm.neon

View File

@@ -1,29 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="vendor/autoload.php" executionOrder="depends,defects" beStrictAboutOutputDuringTests="true" failOnRisky="true" failOnWarning="true" colors="true" cacheDirectory="var/cache/phpunit.rector.cache" requireCoverageMetadata="true" beStrictAboutCoverageMetadata="true">
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd" <testsuites>
bootstrap="tests/app/vendor/autoload.php" <testsuite name="default">
cacheResultFile=".cache/phpunit/test-results-rector" <directory>utils/rector/tests</directory>
executionOrder="depends,defects" </testsuite>
forceCoversAnnotation="true" </testsuites>
beStrictAboutCoversAnnotation="true" <source>
beStrictAboutOutputDuringTests="true" <include>
beStrictAboutTodoAnnotatedTests="true" <directory suffix=".php">utils/rector/src</directory>
convertDeprecationsToExceptions="true" </include>
failOnRisky="true" </source>
failOnWarning="true"
verbose="true"
colors="true"
>
<testsuites>
<testsuite name="default">
<directory>utils/rector/tests</directory>
</testsuite>
</testsuites>
<coverage cacheDirectory=".cache/phpunit/code-coverage-rector"
processUncoveredFiles="true">
<include>
<directory suffix=".php">utils/rector/src</directory>
</include>
</coverage>
</phpunit> </phpunit>

View File

@@ -1,85 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html --> <!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="tests/bootstrap.php">
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" <php>
backupGlobals="false" <ini name="error_reporting" value="-1"/>
colors="true" <server name="APP_ENV" value="test" force="true"/>
bootstrap="tests/bootstrap.php" <env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=93&amp;max[indirect]=999999"/>
> <server name="SHELL_VERBOSITY" value="-1"/>
<php> <env name="KERNEL_CLASS" value="\App\Kernel"/>
<ini name="error_reporting" value="-1" /> </php>
<server name="APP_ENV" value="test" force="true" /> <testsuites>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=0&amp;max[indirect]=999999" /> <!--
<server name="SHELL_VERBOSITY" value="-1" />
<env name="KERNEL_CLASS" value="\App\Kernel" />
</php>
<testsuites>
<!--
<testsuite name="ActivityBundle"> <testsuite name="ActivityBundle">
<directory suffix="Test.php">src/Bundle/ChillActivityBundle/Tests/</directory> <directory suffix="Test.php">src/Bundle/ChillActivityBundle/Tests/</directory>
</testsuite> </testsuite>
--> -->
<testsuite name="AsideActivityBundle"> <testsuite name="AsideActivityBundle">
<directory suffix="Test.php">src/Bundle/ChillAsideActivityBundle/src/Tests/</directory> <directory suffix="Test.php">src/Bundle/ChillAsideActivityBundle/src/Tests/</directory>
</testsuite> </testsuite>
<testsuite name="BudgetBundle"> <testsuite name="BudgetBundle">
<directory suffix="Test.php">src/Bundle/ChillBudgetBundle/Tests/</directory> <directory suffix="Test.php">src/Bundle/ChillBudgetBundle/Tests/</directory>
</testsuite> </testsuite>
<testsuite name="CalendarBundle"> <testsuite name="CalendarBundle">
<directory suffix="Test.php">src/Bundle/ChillCalendarBundle/Tests/</directory> <directory suffix="Test.php">src/Bundle/ChillCalendarBundle/Tests/</directory>
</testsuite> </testsuite>
<!-- Missing CustomFieldBundle --> <!-- Missing CustomFieldBundle -->
<testsuite name="DocGeneratorBundle"> <testsuite name="DocGeneratorBundle">
<directory suffix="Test.php">src/Bundle/ChillDocGeneratorBundle/tests/</directory> <directory suffix="Test.php">src/Bundle/ChillDocGeneratorBundle/tests/</directory>
</testsuite> </testsuite>
<testsuite name="DocStoreBundle"> <testsuite name="DocStoreBundle">
<directory suffix="Test.php">src/Bundle/ChillDocStoreBundle/Tests/</directory> <directory suffix="Test.php">src/Bundle/ChillDocStoreBundle/Tests/</directory>
</testsuite> </testsuite>
<!-- <!--
<testsuite name="EventBundle"> <testsuite name="EventBundle">
<directory suffix="Test.php">src/Bundle/ChillEventBundle/tests/</directory> <directory suffix="Test.php">src/Bundle/ChillEventBundle/tests/</directory>
</testsuite> </testsuite>
--> -->
<testsuite name="MainBundle"> <testsuite name="MainBundle">
<directory suffix="Test.php">src/Bundle/ChillMainBundle/Tests/</directory> <directory suffix="Test.php">src/Bundle/ChillMainBundle/Tests/</directory>
</testsuite> </testsuite>
<testsuite name="PersonBundle"> <testsuite name="PersonBundle">
<directory suffix="Test.php">src/Bundle/ChillPersonBundle/Tests/</directory> <directory suffix="Test.php">src/Bundle/ChillPersonBundle/Tests/</directory>
<!-- we are rewriting accompanying periods... Work in progress --> <!-- we are rewriting accompanying periods... Work in progress -->
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php</exclude> <exclude>src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php</exclude>
<!-- we are rewriting address, Work in progress --> <!-- we are rewriting address, Work in progress -->
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php</exclude> <exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php</exclude>
<!-- find a solution to create multiple configs --> <!-- find a solution to create multiple configs -->
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php</exclude> <exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php</exclude>
<!-- temporarily removed, the time to find a fix --> <!-- temporarily removed, the time to find a fix -->
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonDuplicateControllerViewTest.php</exclude> <exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonDuplicateControllerViewTest.php</exclude>
</testsuite> </testsuite>
<!-- <!--
<testsuite name="ReportBundle"> <testsuite name="ReportBundle">
<directory suffix="Test.php">src/Bundle/ChillReportBundle/Tests/</directory> <directory suffix="Test.php">src/Bundle/ChillReportBundle/Tests/</directory>
</testsuite> </testsuite>
--> -->
<!-- <!--
<testsuite name="TaskBundle"> <testsuite name="TaskBundle">
<directory suffix="Test.php">src/Bundle/ChillTaskBundle/Tests</directory> <directory suffix="Test.php">src/Bundle/ChillTaskBundle/Tests</directory>
</testsuite> </testsuite>
--> -->
<testsuite name="ThirdPartyBundle"> <testsuite name="ThirdPartyBundle">
<directory suffix="Test.php">src/Bundle/ChillThirdPartyBundle/Tests</directory> <directory suffix="Test.php">src/Bundle/ChillThirdPartyBundle/Tests</directory>
</testsuite> </testsuite>
<testsuite name="WopiBundle"> <testsuite name="WopiBundle">
<directory suffix="Test.php">src/Bundle/ChillWopiBundle/tests/</directory> <directory suffix="Test.php">src/Bundle/ChillWopiBundle/tests/</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<!-- Run `composer require symfony/panther` before enabling this extension -->
<listeners> <!--
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
<!-- Run `composer require symfony/panther` before enabling this extension -->
<!--
<extensions> <extensions>
<extension class="Symfony\Component\Panther\ServerExtension" /> <extension class="Symfony\Component\Panther\ServerExtension" />
</extensions> </extensions>

View File

@@ -11,6 +11,7 @@ declare(strict_types=1);
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig; use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Class_\AnnotationToAttributeRector;
use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\LevelSetList;
return static function (RectorConfig $rectorConfig): void { return static function (RectorConfig $rectorConfig): void {
@@ -19,7 +20,7 @@ return static function (RectorConfig $rectorConfig): void {
__DIR__ . '/src', __DIR__ . '/src',
]); ]);
$rectorConfig->symfonyContainerXml(__DIR__ . '/var/cache/dev/testsApp_KernelDevDebugContainer.xml'); $rectorConfig->symfonyContainerXml(__DIR__ . '/var/cache/dev/test/App_KernelTestDebugContainer.xml ');
$rectorConfig->symfonyContainerPhp(__DIR__ . '/tests/symfony-container.php'); $rectorConfig->symfonyContainerPhp(__DIR__ . '/tests/symfony-container.php');
//$rectorConfig->cacheClass(\Rector\Caching\ValueObject\Storage\FileCacheStorage::class); //$rectorConfig->cacheClass(\Rector\Caching\ValueObject\Storage\FileCacheStorage::class);
@@ -27,29 +28,64 @@ return static function (RectorConfig $rectorConfig): void {
// register a single rule // register a single rule
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
// part of the symfony 54 rules
$rectorConfig->rule(\Rector\Symfony\Symfony53\Rector\StaticPropertyFetch\KernelTestCaseContainerPropertyDeprecationRector::class);
$rectorConfig->rule(\Rector\Symfony\Symfony60\Rector\MethodCall\GetHelperControllerToServiceRector::class);
$rectorConfig->disableParallel(); $rectorConfig->disableParallel();
//define sets of rules //define sets of rules
$rectorConfig->sets([ $rectorConfig->sets([
LevelSetList::UP_TO_PHP_82, \Rector\Symfony\Set\SymfonySetList::SYMFONY_50,
\Rector\Symfony\Set\SymfonyLevelSetList::UP_TO_SYMFONY_44, \Rector\Symfony\Set\SymfonySetList::SYMFONY_50_TYPES,
\Rector\Symfony\Set\SymfonySetList::SYMFONY_51,
\Rector\Symfony\Set\SymfonySetList::SYMFONY_52,
\Rector\Symfony\Set\SymfonySetList::SYMFONY_53,
\Rector\Symfony\Set\SymfonySetList::SYMFONY_54,
\Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY, \Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY,
\Rector\PHPUnit\Set\PHPUnitLevelSetList::UP_TO_PHPUNIT_90, \Rector\Doctrine\Set\DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
]);
$rectorConfig->ruleWithConfiguration(\Rector\Php80\Rector\Class_\AnnotationToAttributeRector::class, [
new \Rector\Php80\ValueObject\AnnotationToAttribute('Symfony\Component\Serializer\Annotation\Context'),
]);
// migrate for phpunit
$rectorConfig->rules([
\Rector\PHPUnit\PHPUnit100\Rector\Class_\StaticDataProviderClassMethodRector::class,
\Rector\PHPUnit\PHPUnit100\Rector\Class_\PublicDataProviderClassMethodRector::class
]); ]);
// some routes are added twice if it remains activated // some routes are added twice if it remains activated
// $rectorConfig->rule(\Rector\Symfony\Configs\Rector\ClassMethod\AddRouteAnnotationRector::class); // $rectorConfig->rule(\Rector\Symfony\Configs\Rector\ClassMethod\AddRouteAnnotationRector::class);
// chill rules // chill rules
//$rectorConfig->rule(\Chill\Utils\Rector\Rector\ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector::class); $rectorConfig->rules([
\Chill\Utils\Rector\Rector\ChillBundleMakeDataProviderStaticForAbstractExportTestRector::class,
]);
// skip some path... // skip some path...
$rectorConfig->skip([ $rectorConfig->skip([
// we need to discuss this: are we going to have FALSE in tests instead of an error ?
\Rector\Php71\Rector\FuncCall\CountOnNullRector::class,
// we must adapt service definition // we must adapt service definition
\Rector\Symfony\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector::class, \Rector\Symfony\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector::class,
\Rector\Symfony\Symfony34\Rector\Closure\ContainerGetNameToTypeInTestsRector::class, \Rector\Symfony\Symfony34\Rector\Closure\ContainerGetNameToTypeInTestsRector::class,
]); ]);
$rectorConfig->ruleWithConfiguration(AnnotationToAttributeRector::class, [
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\AccompanyingPeriodValidity'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Household\HouseholdMembershipSequential'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Household\MaxHolder'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ConfidentialCourseMustHaveReferrer'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\LocationValidity'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ParticipationOverlap'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ResourceDuplicateCheck'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Person\Birthdate'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenter'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Relationship\RelationshipNoDuplicate'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\ActivityBundle\Validator\Constraints\ActivityValidity'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\DocStoreBundle\Validator\Constraints\AsyncFileExists'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Validation\Constraint\PhonenumberConstraint'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency'),
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Workflow\Validator\EntityWorkflowCreation'),
]);
}; };

View File

@@ -28,3 +28,4 @@ Version 1.5.5
- [activity] replace dropdown for selecting reasons and use chillEntity for reason rendering - [activity] replace dropdown for selecting reasons and use chillEntity for reason rendering
- fix bug: error when trying to edit activity of which the type has been deactivated - fix bug: error when trying to edit activity of which the type has been deactivated

View File

@@ -24,6 +24,7 @@ use Chill\MainBundle\Entity\UserJob;
use Chill\MainBundle\Pagination\PaginatorFactory; use Chill\MainBundle\Pagination\PaginatorFactory;
use Chill\MainBundle\Repository\LocationRepository; use Chill\MainBundle\Repository\LocationRepository;
use Chill\MainBundle\Repository\UserRepositoryInterface; use Chill\MainBundle\Repository\UserRepositoryInterface;
use Chill\MainBundle\Security\ChillSecurity;
use Chill\MainBundle\Security\Resolver\CenterResolverManagerInterface; use Chill\MainBundle\Security\Resolver\CenterResolverManagerInterface;
use Chill\MainBundle\Templating\Listing\FilterOrderHelper; use Chill\MainBundle\Templating\Listing\FilterOrderHelper;
use Chill\MainBundle\Templating\Listing\FilterOrderHelperFactoryInterface; use Chill\MainBundle\Templating\Listing\FilterOrderHelperFactoryInterface;
@@ -67,13 +68,13 @@ final class ActivityController extends AbstractController
private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory, private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory,
private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatableStringHelperInterface $translatableStringHelper,
private readonly PaginatorFactory $paginatorFactory, private readonly PaginatorFactory $paginatorFactory,
private readonly ChillSecurity $security
) {} ) {}
/** /**
* Deletes a Activity entity. * Deletes a Activity entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/activity/{id}/delete", name="chill_activity_activity_delete", methods={"GET", "POST", "DELETE"})
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/{id}/delete', name: 'chill_activity_activity_delete', methods: ['GET', 'POST', 'DELETE'])]
public function deleteAction(Request $request, mixed $id) public function deleteAction(Request $request, mixed $id)
{ {
$view = null; $view = null;
@@ -141,9 +142,8 @@ final class ActivityController extends AbstractController
/** /**
* Displays a form to edit an existing Activity entity. * Displays a form to edit an existing Activity entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/activity/{id}/edit", name="chill_activity_activity_edit", methods={"GET", "POST", "PUT"})
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/{id}/edit', name: 'chill_activity_activity_edit', methods: ['GET', 'POST', 'PUT'])]
public function editAction(int $id, Request $request): Response public function editAction(int $id, Request $request): Response
{ {
$view = null; $view = null;
@@ -236,9 +236,8 @@ final class ActivityController extends AbstractController
/** /**
* Lists all Activity entities. * Lists all Activity entities.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/activity/", name="chill_activity_activity_list")
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/', name: 'chill_activity_activity_list')]
public function listAction(Request $request): Response public function listAction(Request $request): Response
{ {
$view = null; $view = null;
@@ -342,9 +341,7 @@ final class ActivityController extends AbstractController
return $filterBuilder->build(); return $filterBuilder->build();
} }
/** #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/new', name: 'chill_activity_activity_new', methods: ['POST', 'GET'])]
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/activity/new", name="chill_activity_activity_new", methods={"POST", "GET"})
*/
public function newAction(Request $request): Response public function newAction(Request $request): Response
{ {
$view = null; $view = null;
@@ -384,7 +381,7 @@ final class ActivityController extends AbstractController
} }
$entity = new Activity(); $entity = new Activity();
$entity->setUser($this->getUser()); $entity->setUser($this->security->getUser());
if ($person instanceof Person) { if ($person instanceof Person) {
$entity->setPerson($person); $entity->setPerson($person);
@@ -399,7 +396,7 @@ final class ActivityController extends AbstractController
$entity->setDate(new \DateTime('now')); $entity->setDate(new \DateTime('now'));
if ($request->query->has('activityData')) { if ($request->query->has('activityData')) {
$activityData = $request->query->get('activityData'); $activityData = $request->query->all('activityData');
if (\array_key_exists('durationTime', $activityData) && $activityType->getDurationTimeVisible() > 0) { if (\array_key_exists('durationTime', $activityData) && $activityType->getDurationTimeVisible() > 0) {
$durationTimeInMinutes = $activityData['durationTime']; $durationTimeInMinutes = $activityData['durationTime'];
@@ -452,7 +449,7 @@ final class ActivityController extends AbstractController
if (\array_key_exists('comment', $activityData) && $activityType->getCommentVisible() > 0) { if (\array_key_exists('comment', $activityData) && $activityType->getCommentVisible() > 0) {
$comment = new CommentEmbeddable(); $comment = new CommentEmbeddable();
$comment->setComment($activityData['comment']); $comment->setComment($activityData['comment']);
$comment->setUserId($this->getUser()->getid()); $comment->setUserId($this->security->getUser()->getId());
$comment->setDate(new \DateTime('now')); $comment->setDate(new \DateTime('now'));
$entity->setComment($comment); $entity->setComment($comment);
} }
@@ -513,7 +510,7 @@ final class ActivityController extends AbstractController
$activity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']); $activity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']);
$defaultLocation = $this->getUser()->getCurrentLocation(); $defaultLocation = $this->security->getUser()->getCurrentLocation();
return $this->render($view, [ return $this->render($view, [
'person' => $person, 'person' => $person,
@@ -525,9 +522,7 @@ final class ActivityController extends AbstractController
]); ]);
} }
/** #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/select-type', name: 'chill_activity_activity_select_type')]
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/activity/select-type", name="chill_activity_activity_select_type")
*/
public function selectTypeAction(Request $request): Response public function selectTypeAction(Request $request): Response
{ {
$view = null; $view = null;
@@ -568,13 +563,11 @@ final class ActivityController extends AbstractController
'person' => $person, 'person' => $person,
'accompanyingCourse' => $accompanyingPeriod, 'accompanyingCourse' => $accompanyingPeriod,
'data' => $data, 'data' => $data,
'activityData' => $request->query->get('activityData', []), 'activityData' => $request->query->all('activityData'),
]); ]);
} }
/** #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/{id}/show', name: 'chill_activity_activity_show')]
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/activity/{id}/show", name="chill_activity_activity_show")
*/
public function showAction(Request $request, int $id): Response public function showAction(Request $request, int $id): Response
{ {
$entity = $this->activityRepository->find($id); $entity = $this->activityRepository->find($id);
@@ -673,8 +666,8 @@ final class ActivityController extends AbstractController
throw $this->createNotFoundException('Accompanying Period not found'); throw $this->createNotFoundException('Accompanying Period not found');
} }
// TODO Add permission // TODO Add permission
// $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); // $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
} else { } else {
throw $this->createNotFoundException('Person or Accompanying Period not found'); throw $this->createNotFoundException('Person or Accompanying Period not found');
} }

View File

@@ -22,11 +22,12 @@ use Symfony\Component\HttpFoundation\Request;
*/ */
class ActivityReasonCategoryController extends AbstractController class ActivityReasonCategoryController extends AbstractController
{ {
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
/** /**
* Creates a new ActivityReasonCategory entity. * Creates a new ActivityReasonCategory entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreasoncategory/create", name="chill_activity_activityreasoncategory_create", methods={"POST"})
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/create', name: 'chill_activity_activityreasoncategory_create', methods: ['POST'])]
public function createAction(Request $request) public function createAction(Request $request)
{ {
$entity = new ActivityReasonCategory(); $entity = new ActivityReasonCategory();
@@ -34,7 +35,7 @@ class ActivityReasonCategoryController extends AbstractController
$form->handleRequest($request); $form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) { if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager(); $em = $this->managerRegistry->getManager();
$em->persist($entity); $em->persist($entity);
$em->flush(); $em->flush();
@@ -49,14 +50,13 @@ class ActivityReasonCategoryController extends AbstractController
/** /**
* Displays a form to edit an existing ActivityReasonCategory entity. * Displays a form to edit an existing ActivityReasonCategory entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreasoncategory/{id}/edit", name="chill_activity_activityreasoncategory_edit")
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/edit', name: 'chill_activity_activityreasoncategory_edit')]
public function editAction(mixed $id) public function editAction(mixed $id)
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->managerRegistry->getManager();
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->find($id); $entity = $em->getRepository(ActivityReasonCategory::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
@@ -72,14 +72,13 @@ class ActivityReasonCategoryController extends AbstractController
/** /**
* Lists all ActivityReasonCategory entities. * Lists all ActivityReasonCategory entities.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreasoncategory/", name="chill_activity_activityreasoncategory")
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/', name: 'chill_activity_activityreasoncategory')]
public function indexAction() public function indexAction()
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->managerRegistry->getManager();
$entities = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->findAll(); $entities = $em->getRepository(ActivityReasonCategory::class)->findAll();
return $this->render('@ChillActivity/ActivityReasonCategory/index.html.twig', [ return $this->render('@ChillActivity/ActivityReasonCategory/index.html.twig', [
'entities' => $entities, 'entities' => $entities,
@@ -88,9 +87,8 @@ class ActivityReasonCategoryController extends AbstractController
/** /**
* Displays a form to create a new ActivityReasonCategory entity. * Displays a form to create a new ActivityReasonCategory entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreasoncategory/new", name="chill_activity_activityreasoncategory_new")
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/new', name: 'chill_activity_activityreasoncategory_new')]
public function newAction() public function newAction()
{ {
$entity = new ActivityReasonCategory(); $entity = new ActivityReasonCategory();
@@ -104,14 +102,13 @@ class ActivityReasonCategoryController extends AbstractController
/** /**
* Finds and displays a ActivityReasonCategory entity. * Finds and displays a ActivityReasonCategory entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreasoncategory/{id}/show", name="chill_activity_activityreasoncategory_show")
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/show', name: 'chill_activity_activityreasoncategory_show')]
public function showAction(mixed $id) public function showAction(mixed $id)
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->managerRegistry->getManager();
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->find($id); $entity = $em->getRepository(ActivityReasonCategory::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
@@ -124,14 +121,13 @@ class ActivityReasonCategoryController extends AbstractController
/** /**
* Edits an existing ActivityReasonCategory entity. * Edits an existing ActivityReasonCategory entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreasoncategory/{id}/update", name="chill_activity_activityreasoncategory_update", methods={"POST", "PUT"})
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/update', name: 'chill_activity_activityreasoncategory_update', methods: ['POST', 'PUT'])]
public function updateAction(Request $request, mixed $id) public function updateAction(Request $request, mixed $id)
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->managerRegistry->getManager();
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->find($id); $entity = $em->getRepository(ActivityReasonCategory::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');

View File

@@ -24,13 +24,12 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
*/ */
class ActivityReasonController extends AbstractController class ActivityReasonController extends AbstractController
{ {
public function __construct(private readonly ActivityReasonRepository $activityReasonRepository) {} public function __construct(private readonly ActivityReasonRepository $activityReasonRepository, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
/** /**
* Creates a new ActivityReason entity. * Creates a new ActivityReason entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreason/create", name="chill_activity_activityreason_create", methods={"POST"})
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/create', name: 'chill_activity_activityreason_create', methods: ['POST'])]
public function createAction(Request $request) public function createAction(Request $request)
{ {
$entity = new ActivityReason(); $entity = new ActivityReason();
@@ -38,7 +37,7 @@ class ActivityReasonController extends AbstractController
$form->handleRequest($request); $form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) { if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager(); $em = $this->managerRegistry->getManager();
$em->persist($entity); $em->persist($entity);
$em->flush(); $em->flush();
@@ -53,14 +52,13 @@ class ActivityReasonController extends AbstractController
/** /**
* Displays a form to edit an existing ActivityReason entity. * Displays a form to edit an existing ActivityReason entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreason/{id}/edit", name="chill_activity_activityreason_edit")
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/edit', name: 'chill_activity_activityreason_edit')]
public function editAction(mixed $id) public function editAction(mixed $id)
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->managerRegistry->getManager();
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id); $entity = $em->getRepository(ActivityReason::class)->find($id);
if (null === $entity) { if (null === $entity) {
throw new NotFoundHttpException('Unable to find ActivityReason entity.'); throw new NotFoundHttpException('Unable to find ActivityReason entity.');
@@ -76,12 +74,11 @@ class ActivityReasonController extends AbstractController
/** /**
* Lists all ActivityReason entities. * Lists all ActivityReason entities.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreason/", name="chill_activity_activityreason")
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/', name: 'chill_activity_activityreason')]
public function indexAction() public function indexAction()
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->managerRegistry->getManager();
$entities = $this->activityReasonRepository->findAll(); $entities = $this->activityReasonRepository->findAll();
@@ -92,9 +89,8 @@ class ActivityReasonController extends AbstractController
/** /**
* Displays a form to create a new ActivityReason entity. * Displays a form to create a new ActivityReason entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreason/new", name="chill_activity_activityreason_new")
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/new', name: 'chill_activity_activityreason_new')]
public function newAction() public function newAction()
{ {
$entity = new ActivityReason(); $entity = new ActivityReason();
@@ -108,14 +104,13 @@ class ActivityReasonController extends AbstractController
/** /**
* Finds and displays a ActivityReason entity. * Finds and displays a ActivityReason entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreason/{id}/show", name="chill_activity_activityreason_show")
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/show', name: 'chill_activity_activityreason_show')]
public function showAction(mixed $id) public function showAction(mixed $id)
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->managerRegistry->getManager();
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id); $entity = $em->getRepository(ActivityReason::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityReason entity.'); throw $this->createNotFoundException('Unable to find ActivityReason entity.');
@@ -128,14 +123,13 @@ class ActivityReasonController extends AbstractController
/** /**
* Edits an existing ActivityReason entity. * Edits an existing ActivityReason entity.
*
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreason/{id}/update", name="chill_activity_activityreason_update", methods={"POST", "PUT"})
*/ */
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/update', name: 'chill_activity_activityreason_update', methods: ['POST', 'PUT'])]
public function updateAction(Request $request, mixed $id) public function updateAction(Request $request, mixed $id)
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->managerRegistry->getManager();
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id); $entity = $em->getRepository(ActivityReason::class)->find($id);
if (!$entity) { if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityReason entity.'); throw $this->createNotFoundException('Unable to find ActivityReason entity.');

View File

@@ -18,18 +18,14 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
*/ */
class AdminController extends AbstractController class AdminController extends AbstractController
{ {
/** #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activity', name: 'chill_activity_admin_index')]
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activity", name="chill_activity_admin_index")
*/
public function indexActivityAction() public function indexActivityAction()
{ {
return $this->render('@ChillActivity/Admin/layout_activity.html.twig'); return $this->render('@ChillActivity/Admin/layout_activity.html.twig');
} }
/** #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activity_redirect_to_main', name: 'chill_admin_aside_activity_redirect_to_admin_index', options: [null])]
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activity_redirect_to_main", name="chill_admin_aside_activity_redirect_to_admin_index", options={null}) #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activity_redirect_to_main', name: 'chill_admin_activity_redirect_to_admin_index')]
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activity_redirect_to_main", name="chill_admin_activity_redirect_to_admin_index")
*/
public function redirectToAdminIndexAction() public function redirectToAdminIndexAction()
{ {
return $this->redirectToRoute('chill_main_admin_central'); return $this->redirectToRoute('chill_main_admin_central');

View File

@@ -64,7 +64,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface
->setPerson($person) ->setPerson($person)
->setDate($this->faker->dateTimeThisYear()) ->setDate($this->faker->dateTimeThisYear())
->setDurationTime($this->faker->dateTime(36000)) ->setDurationTime($this->faker->dateTime(36000))
->setType($this->getRandomActivityType()) ->setActivityType($this->getRandomActivityType())
->setScope($this->getRandomScope()); ->setScope($this->getRandomScope());
// ->setAttendee($this->faker->boolean()) // ->setAttendee($this->faker->boolean())

View File

@@ -25,14 +25,12 @@ use Chill\MainBundle\Entity\HasScopesInterface;
use Chill\MainBundle\Entity\Location; use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency;
use Chill\PersonBundle\AccompanyingPeriod\SocialIssueConsistency\AccompanyingPeriodLinkedWithSocialIssuesEntityInterface; use Chill\PersonBundle\AccompanyingPeriod\SocialIssueConsistency\AccompanyingPeriodLinkedWithSocialIssuesEntityInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Entity\SocialWork\SocialAction; use Chill\PersonBundle\Entity\SocialWork\SocialAction;
use Chill\PersonBundle\Entity\SocialWork\SocialIssue; use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
use Chill\ThirdPartyBundle\Entity\ThirdParty; use Chill\ThirdPartyBundle\Entity\ThirdParty;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
@@ -43,25 +41,12 @@ use Symfony\Component\Validator\Constraints as Assert;
/** /**
* Class Activity. * Class Activity.
*
* @ORM\Entity(repositoryClass="Chill\ActivityBundle\Repository\ActivityRepository")
*
* @ORM\Table(name="activity")
*
* @ORM\HasLifecycleCallbacks
*
* @DiscriminatorMap(typeProperty="type", mapping={
* "activity": Activity::class
* })
*
* @ActivityValidator\ActivityValidity
*
* TODO see if necessary
* UserCircleConsistency(
* "CHILL_ACTIVITY_SEE_DETAILS",
* getUserFunction="getUser",
* path="scope")
*/ */
#[DiscriminatorMap(typeProperty: 'type', mapping: ['activity' => Activity::class])]
#[ORM\Entity(repositoryClass: \Chill\ActivityBundle\Repository\ActivityRepository::class)]
#[ORM\HasLifecycleCallbacks]
#[ORM\Table(name: 'activity')]
#[ActivityValidator\ActivityValidity] // TODO see if necessary
class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface, HasCentersInterface, HasScopesInterface, TrackCreationInterface, TrackUpdateInterface class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface, HasCentersInterface, HasScopesInterface, TrackCreationInterface, TrackUpdateInterface
{ {
use TrackCreationTrait; use TrackCreationTrait;
@@ -72,176 +57,115 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
final public const SENTRECEIVED_SENT = 'sent'; final public const SENTRECEIVED_SENT = 'sent';
/** #[Groups(['read'])]
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod") #[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class)]
*
* @Groups({"read"})
*/
private ?AccompanyingPeriod $accompanyingPeriod = null; private ?AccompanyingPeriod $accompanyingPeriod = null;
/** #[Groups(['read', 'docgen:read'])]
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityType") #[SerializedName('activityType')]
* #[ORM\ManyToOne(targetEntity: ActivityType::class)]
* @Groups({"read", "docgen:read"}) #[ORM\JoinColumn(name: 'type_id')]
*
* @SerializedName("activityType")
*
* @ORM\JoinColumn(name="type_id")
*/
private ActivityType $activityType; private ActivityType $activityType;
/** #[Groups(['docgen:read'])]
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityPresence") #[ORM\ManyToOne(targetEntity: ActivityPresence::class)]
*
* @Groups({"docgen:read"})
*/
private ?ActivityPresence $attendee = null; private ?ActivityPresence $attendee = null;
/** #[Groups(['docgen:read'])]
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\CommentEmbeddable", columnPrefix="comment_") #[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'comment_')]
*
* @Groups({"docgen:read"})
*/
private CommentEmbeddable $comment; private CommentEmbeddable $comment;
/** #[Groups(['docgen:read'])]
* @ORM\Column(type="datetime") #[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE)]
*
* @Groups({"docgen:read"})
*/
private \DateTime $date; private \DateTime $date;
/** /**
* @ORM\ManyToMany(targetEntity="Chill\DocStoreBundle\Entity\StoredObject", cascade={"persist"})
*
* @Assert\Valid(traverse=true)
*
* @var Collection<StoredObject> * @var Collection<StoredObject>
*/ */
#[Assert\Valid(traverse: true)]
#[ORM\ManyToMany(targetEntity: StoredObject::class, cascade: ['persist'])]
private Collection $documents; private Collection $documents;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::TIME_MUTABLE, nullable: true)]
* @ORM\Column(type="time", nullable=true)
*/
private ?\DateTime $durationTime = null; private ?\DateTime $durationTime = null;
/** #[Groups(['docgen:read'])]
* @ORM\Column(type="boolean", options={"default": false}) #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => false])]
*
* @Groups({"docgen:read"})
*/
private bool $emergency = false; private bool $emergency = false;
/** #[Groups(['read', 'docgen:read'])]
* @ORM\Id #[ORM\Id]
* #[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
* @ORM\Column(name="id", type="integer") #[ORM\GeneratedValue(strategy: 'AUTO')]
*
* @ORM\GeneratedValue(strategy="AUTO")
*
* @Groups({"read", "docgen:read"})
*/
private ?int $id = null; private ?int $id = null;
/** #[Groups(['read', 'docgen:read'])]
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Location") #[ORM\ManyToOne(targetEntity: Location::class)]
*
* @groups({"read", "docgen:read"})
*/
private ?Location $location = null; private ?Location $location = null;
/** #[ORM\ManyToOne(targetEntity: Person::class)]
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person")
*/
private ?Person $person = null; private ?Person $person = null;
/** /**
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\Person")
*
* @Groups({"read", "docgen:read"})
*
* @var Collection<Person> * @var Collection<Person>
*/ */
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToMany(targetEntity: Person::class)]
private Collection $persons; private Collection $persons;
/** #[ORM\Embedded(class: PrivateCommentEmbeddable::class, columnPrefix: 'privateComment_')]
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable", columnPrefix="privateComment_")
*/
private PrivateCommentEmbeddable $privateComment; private PrivateCommentEmbeddable $privateComment;
/** /**
* @ORM\ManyToMany(targetEntity="Chill\ActivityBundle\Entity\ActivityReason")
*
* @Groups({"docgen:read"})
*
* @var Collection<ActivityReason> * @var Collection<ActivityReason>
*/ */
#[Groups(['docgen:read'])]
#[ORM\ManyToMany(targetEntity: ActivityReason::class)]
private Collection $reasons; private Collection $reasons;
/** #[Groups(['docgen:read'])]
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Scope") #[ORM\ManyToOne(targetEntity: Scope::class)]
*
* @Groups({"docgen:read"})
*/
private ?Scope $scope = null; private ?Scope $scope = null;
/** #[Groups(['docgen:read'])]
* @ORM\Column(type="string", options={"default": ""}) #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, options: ['default' => ''])]
*
* @Groups({"docgen:read"})
*/
private string $sentReceived = ''; private string $sentReceived = '';
/** /**
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialAction")
*
* @ORM\JoinTable(name="chill_activity_activity_chill_person_socialaction")
*
* @Groups({"read", "docgen:read"})
*
* @var Collection<SocialAction> * @var Collection<SocialAction>
*/ */
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToMany(targetEntity: SocialAction::class)]
#[ORM\JoinTable(name: 'chill_activity_activity_chill_person_socialaction')]
private Collection $socialActions; private Collection $socialActions;
/** /**
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialIssue")
*
* @ORM\JoinTable(name="chill_activity_activity_chill_person_socialissue")
*
* @Groups({"read", "docgen:read"})
*
* @var Collection<SocialIssue> * @var Collection<SocialIssue>
*/ */
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToMany(targetEntity: SocialIssue::class)]
#[ORM\JoinTable(name: 'chill_activity_activity_chill_person_socialissue')]
private Collection $socialIssues; private Collection $socialIssues;
/** /**
* @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty")
*
* @Groups({"read", "docgen:read"})
*
* @var Collection<ThirdParty> * @var Collection<ThirdParty>
*/ */
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToMany(targetEntity: ThirdParty::class)]
private Collection $thirdParties; private Collection $thirdParties;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::TIME_MUTABLE, nullable: true)]
* @ORM\Column(type="time", nullable=true)
*/
private ?\DateTime $travelTime = null; private ?\DateTime $travelTime = null;
/** #[Groups(['docgen:read'])]
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User") #[ORM\ManyToOne(targetEntity: User::class)]
*
* @Groups({"docgen:read"})
*/
private ?User $user = null; private ?User $user = null;
/** /**
* @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\User")
*
* @Groups({"read", "docgen:read"})
*
* @var Collection<User> * @var Collection<User>
*/ */
#[Groups(['read', 'docgen:read'])]
#[ORM\ManyToMany(targetEntity: User::class)]
private Collection $users; private Collection $users;
public function __construct() public function __construct()
@@ -385,9 +309,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
return $this->documents; return $this->documents;
} }
/** #[Groups(['docgen:read'])]
* @Groups({"docgen:read"})
*/
public function getDurationMinute(): int public function getDurationMinute(): int
{ {
if (null === $this->durationTime) { if (null === $this->durationTime) {
@@ -515,9 +437,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
return $this->travelTime; return $this->travelTime;
} }
/** #[Groups(['docgen:read'])]
* @Groups({"docgen:read"})
*/
public function getTravelTimeMinute(): int public function getTravelTimeMinute(): int
{ {
if (null === $this->travelTime) { if (null === $this->travelTime) {

View File

@@ -16,38 +16,24 @@ use Symfony\Component\Serializer\Annotation as Serializer;
/** /**
* Class ActivityPresence. * Class ActivityPresence.
*
* @ORM\Entity
*
* @ORM\Table(name="activitytpresence")
*
* @ORM\HasLifecycleCallbacks
*/ */
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
#[ORM\Table(name: 'activitytpresence')]
class ActivityPresence class ActivityPresence
{ {
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
* @ORM\Column(type="boolean")
*/
private bool $active = true; private bool $active = true;
/** #[Serializer\Groups(['docgen:read'])]
* @ORM\Id #[ORM\Id]
* #[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
* @ORM\Column(name="id", type="integer") #[ORM\GeneratedValue(strategy: 'AUTO')]
*
* @ORM\GeneratedValue(strategy="AUTO")
*
* @Serializer\Groups({"docgen:read"})
*/
private ?int $id = null; private ?int $id = null;
/** #[Serializer\Groups(['docgen:read'])]
* @ORM\Column(type="json") #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
* #[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])]
* @Serializer\Groups({"docgen:read"})
*
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
*/
private array $name = []; private array $name = [];
/** /**

View File

@@ -15,39 +15,24 @@ use Doctrine\ORM\Mapping as ORM;
/** /**
* Class ActivityReason. * Class ActivityReason.
*
* @ORM\Entity
*
* @ORM\Table(name="activityreason")
*
* @ORM\HasLifecycleCallbacks
*/ */
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
#[ORM\Table(name: 'activityreason')]
class ActivityReason class ActivityReason
{ {
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
* @ORM\Column(type="boolean")
*/
private bool $active = true; private bool $active = true;
/** #[ORM\ManyToOne(targetEntity: ActivityReasonCategory::class, inversedBy: 'reasons')]
* @ORM\ManyToOne(
* targetEntity="Chill\ActivityBundle\Entity\ActivityReasonCategory",
* inversedBy="reasons")
*/
private ?ActivityReasonCategory $category = null; private ?ActivityReasonCategory $category = null;
/** #[ORM\Id]
* @ORM\Id #[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
* #[ORM\GeneratedValue(strategy: 'AUTO')]
* @ORM\Column(name="id", type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
private ?int $id = null; private ?int $id = null;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
* @ORM\Column(type="json")
*/
private array $name; private array $name;
/** /**

View File

@@ -17,45 +17,32 @@ use Doctrine\ORM\Mapping as ORM;
/** /**
* Class ActivityReasonCategory. * Class ActivityReasonCategory.
*
* @ORM\Entity
*
* @ORM\Table(name="activityreasoncategory")
*
* @ORM\HasLifecycleCallbacks
*/ */
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
#[ORM\Table(name: 'activityreasoncategory')]
class ActivityReasonCategory implements \Stringable class ActivityReasonCategory implements \Stringable
{ {
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
* @ORM\Column(type="boolean")
*/
private bool $active = true; private bool $active = true;
/** #[ORM\Id]
* @ORM\Id #[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
* #[ORM\GeneratedValue(strategy: 'AUTO')]
* @ORM\Column(name="id", type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
private ?int $id = null; private ?int $id = null;
/** /**
* @var string * @var string
*
* @ORM\Column(type="json")
*/ */
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
private $name; private $name;
/** /**
* Array of ActivityReason. * Array of ActivityReason.
* *
* @var Collection<ActivityReason> * @var Collection<ActivityReason>
*
* @ORM\OneToMany(
* targetEntity="Chill\ActivityBundle\Entity\ActivityReason",
* mappedBy="category")
*/ */
#[ORM\OneToMany(targetEntity: ActivityReason::class, mappedBy: 'category')]
private Collection $reasons; private Collection $reasons;
/** /**

View File

@@ -19,13 +19,10 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
/** /**
* Class ActivityType. * Class ActivityType.
*
* @ORM\Entity
*
* @ORM\Table(name="activitytype")
*
* @ORM\HasLifecycleCallbacks
*/ */
#[ORM\Entity]
#[ORM\HasLifecycleCallbacks]
#[ORM\Table(name: 'activitytype')]
class ActivityType class ActivityType
{ {
final public const FIELD_INVISIBLE = 0; final public const FIELD_INVISIBLE = 0;
@@ -36,262 +33,169 @@ class ActivityType
/** /**
* @deprecated not in use * @deprecated not in use
*
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/ */
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
private string $accompanyingPeriodLabel = ''; private string $accompanyingPeriodLabel = '';
/** /**
* @deprecated not in use * @deprecated not in use
*
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/ */
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
private int $accompanyingPeriodVisible = self::FIELD_INVISIBLE; private int $accompanyingPeriodVisible = self::FIELD_INVISIBLE;
/** #[Groups(['read'])]
* @ORM\Column(type="boolean") #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
*
* @Groups({"read"})
*/
private bool $active = true; private bool $active = true;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $attendeeLabel = ''; private string $attendeeLabel = '';
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $attendeeVisible = self::FIELD_OPTIONAL; private int $attendeeVisible = self::FIELD_OPTIONAL;
/** #[ORM\ManyToOne(targetEntity: ActivityTypeCategory::class)]
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityTypeCategory")
*/
private ?ActivityTypeCategory $category = null; private ?ActivityTypeCategory $category = null;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $commentLabel = ''; private string $commentLabel = '';
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $commentVisible = self::FIELD_OPTIONAL; private int $commentVisible = self::FIELD_OPTIONAL;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $dateLabel = ''; private string $dateLabel = '';
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 2])]
* @ORM\Column(type="smallint", nullable=false, options={"default": 2})
*/
private int $dateVisible = self::FIELD_REQUIRED; private int $dateVisible = self::FIELD_REQUIRED;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $documentsLabel = ''; private string $documentsLabel = '';
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $documentsVisible = self::FIELD_OPTIONAL; private int $documentsVisible = self::FIELD_OPTIONAL;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $durationTimeLabel = ''; private string $durationTimeLabel = '';
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $durationTimeVisible = self::FIELD_OPTIONAL; private int $durationTimeVisible = self::FIELD_OPTIONAL;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $emergencyLabel = ''; private string $emergencyLabel = '';
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $emergencyVisible = self::FIELD_INVISIBLE; private int $emergencyVisible = self::FIELD_INVISIBLE;
/** #[Groups(['docgen:read'])]
* @ORM\Id #[ORM\Id]
* #[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
* @ORM\Column(name="id", type="integer") #[ORM\GeneratedValue(strategy: 'AUTO')]
*
* @ORM\GeneratedValue(strategy="AUTO")
*
* @Groups({"docgen:read"})
*/
private ?int $id = null; private ?int $id = null;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $locationLabel = ''; private string $locationLabel = '';
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $locationVisible = self::FIELD_INVISIBLE; private int $locationVisible = self::FIELD_INVISIBLE;
/** #[Groups(['read', 'docgen:read'])]
* @ORM\Column(type="json") #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
* #[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])]
* @Groups({"read", "docgen:read"})
*
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
*/
private array $name = []; private array $name = [];
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, options: ['default' => '0.0'])]
* @ORM\Column(type="float", options={"default": "0.0"})
*/
private float $ordering = 0.0; private float $ordering = 0.0;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $personLabel = ''; private string $personLabel = '';
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $personsLabel = ''; private string $personsLabel = '';
/** #[Groups(['read'])]
* @ORM\Column(type="smallint", nullable=false, options={"default": 1}) #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
*
* @Groups({"read"})
*/
private int $personsVisible = self::FIELD_OPTIONAL; private int $personsVisible = self::FIELD_OPTIONAL;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 2])]
* @ORM\Column(type="smallint", nullable=false, options={"default": 2})
*/
private int $personVisible = self::FIELD_REQUIRED; private int $personVisible = self::FIELD_REQUIRED;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $privateCommentLabel = ''; private string $privateCommentLabel = '';
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $privateCommentVisible = self::FIELD_OPTIONAL; private int $privateCommentVisible = self::FIELD_OPTIONAL;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $reasonsLabel = ''; private string $reasonsLabel = '';
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $reasonsVisible = self::FIELD_OPTIONAL; private int $reasonsVisible = self::FIELD_OPTIONAL;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $sentReceivedLabel = ''; private string $sentReceivedLabel = '';
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $sentReceivedVisible = self::FIELD_OPTIONAL; private int $sentReceivedVisible = self::FIELD_OPTIONAL;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $socialActionsLabel = ''; private string $socialActionsLabel = '';
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $socialActionsVisible = self::FIELD_INVISIBLE; private int $socialActionsVisible = self::FIELD_INVISIBLE;
/** /**
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*
* @deprecated not in use * @deprecated not in use
*/ */
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
private string $socialDataLabel = ''; private string $socialDataLabel = '';
/** /**
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*
* @deprecated not in use * @deprecated not in use
*/ */
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
private int $socialDataVisible = self::FIELD_INVISIBLE; private int $socialDataVisible = self::FIELD_INVISIBLE;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $socialIssuesLabel = ''; private string $socialIssuesLabel = '';
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $socialIssuesVisible = self::FIELD_INVISIBLE; private int $socialIssuesVisible = self::FIELD_INVISIBLE;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $thirdPartiesLabel = ''; private string $thirdPartiesLabel = '';
/** #[Groups(['read'])]
* @ORM\Column(type="smallint", nullable=false, options={"default": 1}) #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
*
* @Groups({"read"})
*/
private int $thirdPartiesVisible = self::FIELD_INVISIBLE; private int $thirdPartiesVisible = self::FIELD_INVISIBLE;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $travelTimeLabel = ''; private string $travelTimeLabel = '';
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
*/
private int $travelTimeVisible = self::FIELD_OPTIONAL; private int $travelTimeVisible = self::FIELD_OPTIONAL;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $userLabel = ''; private string $userLabel = '';
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
* @ORM\Column(type="string", nullable=false, options={"default": ""})
*/
private string $usersLabel = ''; private string $usersLabel = '';
/** #[Groups(['read'])]
* @ORM\Column(type="smallint", nullable=false, options={"default": 1}) #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
*
* @Groups({"read"})
*/
private int $usersVisible = self::FIELD_OPTIONAL; private int $usersVisible = self::FIELD_OPTIONAL;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 2])]
* @ORM\Column(type="smallint", nullable=false, options={"default": 2})
*/
private int $userVisible = self::FIELD_REQUIRED; private int $userVisible = self::FIELD_REQUIRED;
/** #[Assert\Callback]
* @Assert\Callback
*/
public function checkSocialActionsVisibility(ExecutionContextInterface $context, mixed $payload) public function checkSocialActionsVisibility(ExecutionContextInterface $context, mixed $payload)
{ {
if ($this->socialIssuesVisible !== $this->socialActionsVisible) { if ($this->socialIssuesVisible !== $this->socialActionsVisible) {
if (!(2 === $this->socialIssuesVisible && 1 === $this->socialActionsVisible)) { // if social issues are invisible then social actions cannot be optional or required + if social issues are optional then social actions shouldn't be required
if (
(0 === $this->socialIssuesVisible && (1 === $this->socialActionsVisible || 2 === $this->socialActionsVisible))
|| (1 === $this->socialIssuesVisible && 2 === $this->socialActionsVisible)
) {
$context $context
->buildViolation('The socialActionsVisible value is not compatible with the socialIssuesVisible value') ->buildViolation('The socialActionsVisible value is not compatible with the socialIssuesVisible value')
->atPath('socialActionsVisible') ->atPath('socialActionsVisible')

View File

@@ -13,37 +13,23 @@ namespace Chill\ActivityBundle\Entity;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** #[ORM\Entity]
* @ORM\Entity #[ORM\HasLifecycleCallbacks]
* #[ORM\Table(name: 'activitytypecategory')]
* @ORM\Table(name="activitytypecategory")
*
* @ORM\HasLifecycleCallbacks
*/
class ActivityTypeCategory class ActivityTypeCategory
{ {
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
* @ORM\Column(type="boolean")
*/
private bool $active = true; private bool $active = true;
/** #[ORM\Id]
* @ORM\Id #[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
* #[ORM\GeneratedValue(strategy: 'AUTO')]
* @ORM\Column(name="id", type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
private ?int $id = null; private ?int $id = null;
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
* @ORM\Column(type="json")
*/
private array $name = []; private array $name = [];
/** #[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, options: ['default' => '0.0'])]
* @ORM\Column(type="float", options={"default": "0.0"})
*/
private float $ordering = 0.0; private float $ordering = 0.0;
/** /**

View File

@@ -56,7 +56,7 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface
public function getLabels($key, array $values, mixed $data) public function getLabels($key, array $values, mixed $data)
{ {
return function (null|int|string $value): string { return function (int|string|null $value): string {
if ('_header' === $value) { if ('_header' === $value) {
return 'export.aggregator.acp.by_activity_type.activity_type'; return 'export.aggregator.acp.by_activity_type.activity_type';
} }

View File

@@ -31,7 +31,7 @@ final readonly class ActivityPresenceAggregator implements AggregatorInterface
public function getLabels($key, array $values, mixed $data) public function getLabels($key, array $values, mixed $data)
{ {
return function (null|int|string $value): string { return function (int|string|null $value): string {
if ('_header' === $value) { if ('_header' === $value) {
return 'export.aggregator.activity.by_activity_presence.header'; return 'export.aggregator.activity.by_activity_presence.header';
} }

View File

@@ -9,7 +9,7 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Export\Aggregator\PersonAggregators; namespace Chill\ActivityBundle\Export\Aggregator;
use Chill\ActivityBundle\Export\Declarations; use Chill\ActivityBundle\Export\Declarations;
use Chill\ActivityBundle\Repository\ActivityReasonCategoryRepository; use Chill\ActivityBundle\Repository\ActivityReasonCategoryRepository;
@@ -25,7 +25,11 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
class ActivityReasonAggregator implements AggregatorInterface, ExportElementValidatedInterface class ActivityReasonAggregator implements AggregatorInterface, ExportElementValidatedInterface
{ {
public function __construct(protected ActivityReasonCategoryRepository $activityReasonCategoryRepository, protected ActivityReasonRepository $activityReasonRepository, protected TranslatableStringHelper $translatableStringHelper) {} public function __construct(
protected ActivityReasonCategoryRepository $activityReasonCategoryRepository,
protected ActivityReasonRepository $activityReasonRepository,
protected TranslatableStringHelper $translatableStringHelper
) {}
public function addRole(): ?string public function addRole(): ?string
{ {
@@ -49,7 +53,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
// make a jointure only if needed // make a jointure only if needed
if (!\in_array('actreasons', $qb->getAllAliases(), true)) { if (!\in_array('actreasons', $qb->getAllAliases(), true)) {
$qb->innerJoin('activity.reasons', 'actreasons'); $qb->leftJoin('activity.reasons', 'actreasons');
} }
// join category if necessary // join category if necessary
@@ -60,19 +64,12 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
} }
} }
// add the "group by" part $qb->addGroupBy($alias);
$groupBy = $qb->getDQLPart('groupBy');
if (\count($groupBy) > 0) {
$qb->addGroupBy($alias);
} else {
$qb->groupBy($alias);
}
} }
public function applyOn(): string public function applyOn(): string
{ {
return Declarations::ACTIVITY_PERSON; return Declarations::ACTIVITY;
} }
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
@@ -94,7 +91,9 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
public function getFormDefaultData(): array public function getFormDefaultData(): array
{ {
return []; return [
'level' => 'reasons',
];
} }
public function getLabels($key, array $values, $data) public function getLabels($key, array $values, $data)

View File

@@ -56,7 +56,7 @@ class ActivityTypeAggregator implements AggregatorInterface
public function getLabels($key, array $values, $data): \Closure public function getLabels($key, array $values, $data): \Closure
{ {
return function (null|int|string $value): string { return function (int|string|null $value): string {
if ('_header' === $value) { if ('_header' === $value) {
return 'Activity type'; return 'Activity type';
} }

View File

@@ -79,7 +79,7 @@ final readonly class CreatorJobFilter implements FilterInterface
{ {
$builder $builder
->add('jobs', EntityType::class, [ ->add('jobs', EntityType::class, [
'choices' => $this->userJobRepository->findAllOrderedByName(), 'choices' => $this->userJobRepository->findAllActive(),
'class' => UserJob::class, 'class' => UserJob::class,
'choice_label' => fn (UserJob $s) => $this->translatableStringHelper->localize( 'choice_label' => fn (UserJob $s) => $this->translatableStringHelper->localize(
$s->getLabel() $s->getLabel()

View File

@@ -15,6 +15,7 @@ use Chill\ActivityBundle\Export\Declarations;
use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Entity\User\UserScopeHistory; use Chill\MainBundle\Entity\User\UserScopeHistory;
use Chill\MainBundle\Export\FilterInterface; use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Repository\ScopeRepositoryInterface;
use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\MainBundle\Templating\TranslatableStringHelper;
use Doctrine\ORM\Query\Expr\Join; use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
@@ -26,7 +27,8 @@ class CreatorScopeFilter implements FilterInterface
private const PREFIX = 'acp_act_filter_creator_scope'; private const PREFIX = 'acp_act_filter_creator_scope';
public function __construct( public function __construct(
private readonly TranslatableStringHelper $translatableStringHelper private readonly TranslatableStringHelper $translatableStringHelper,
private readonly ScopeRepositoryInterface $scopeRepository,
) {} ) {}
public function addRole(): ?string public function addRole(): ?string
@@ -75,6 +77,7 @@ class CreatorScopeFilter implements FilterInterface
$builder $builder
->add('scopes', EntityType::class, [ ->add('scopes', EntityType::class, [
'class' => Scope::class, 'class' => Scope::class,
'choices' => $this->scopeRepository->findAllActive(),
'choice_label' => fn (Scope $s) => $this->translatableStringHelper->localize( 'choice_label' => fn (Scope $s) => $this->translatableStringHelper->localize(
$s->getName() $s->getName()
), ),

View File

@@ -16,6 +16,7 @@ use Chill\ActivityBundle\Export\Declarations;
use Chill\MainBundle\Entity\User\UserJobHistory; use Chill\MainBundle\Entity\User\UserJobHistory;
use Chill\MainBundle\Entity\UserJob; use Chill\MainBundle\Entity\UserJob;
use Chill\MainBundle\Export\FilterInterface; use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Repository\UserJobRepositoryInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface; use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
@@ -27,7 +28,8 @@ class UsersJobFilter implements FilterInterface
private const PREFIX = 'act_filter_user_job'; private const PREFIX = 'act_filter_user_job';
public function __construct( public function __construct(
private readonly TranslatableStringHelperInterface $translatableStringHelper private readonly TranslatableStringHelperInterface $translatableStringHelper,
private readonly UserJobRepositoryInterface $userJobRepository
) {} ) {}
public function addRole(): ?string public function addRole(): ?string
@@ -68,6 +70,7 @@ class UsersJobFilter implements FilterInterface
$builder $builder
->add('jobs', EntityType::class, [ ->add('jobs', EntityType::class, [
'class' => UserJob::class, 'class' => UserJob::class,
'choices' => $this->userJobRepository->findAllActive(),
'choice_label' => fn (UserJob $j) => $this->translatableStringHelper->localize($j->getLabel()), 'choice_label' => fn (UserJob $j) => $this->translatableStringHelper->localize($j->getLabel()),
'multiple' => true, 'multiple' => true,
'expanded' => true, 'expanded' => true,

View File

@@ -95,7 +95,7 @@ class ActivityType extends AbstractType
]); ]);
} }
/** @var \Chill\PersonBundle\Entity\AccompanyingPeriod|null $accompanyingPeriod */ /** @var AccompanyingPeriod|null $accompanyingPeriod */
$accompanyingPeriod = null; $accompanyingPeriod = null;
if ($options['accompanyingPeriod'] instanceof AccompanyingPeriod) { if ($options['accompanyingPeriod'] instanceof AccompanyingPeriod) {
@@ -183,6 +183,7 @@ class ActivityType extends AbstractType
$builder->add('attendee', EntityType::class, [ $builder->add('attendee', EntityType::class, [
'label' => $activityType->getLabel('attendee'), 'label' => $activityType->getLabel('attendee'),
'required' => $activityType->isRequired('attendee'), 'required' => $activityType->isRequired('attendee'),
'placeholder' => false,
'expanded' => true, 'expanded' => true,
'class' => ActivityPresence::class, 'class' => ActivityPresence::class,
'choice_label' => fn (ActivityPresence $activityPresence) => $this->translatableStringHelper->localize($activityPresence->getName()), 'choice_label' => fn (ActivityPresence $activityPresence) => $this->translatableStringHelper->localize($activityPresence->getName()),
@@ -404,7 +405,7 @@ class ActivityType extends AbstractType
->setAllowedTypes('center', ['null', Center::class, 'array']) ->setAllowedTypes('center', ['null', Center::class, 'array'])
->setAllowedTypes('role', ['string']) ->setAllowedTypes('role', ['string'])
->setAllowedTypes('activityType', \Chill\ActivityBundle\Entity\ActivityType::class) ->setAllowedTypes('activityType', \Chill\ActivityBundle\Entity\ActivityType::class)
->setAllowedTypes('accompanyingPeriod', [\Chill\PersonBundle\Entity\AccompanyingPeriod::class, 'null']); ->setAllowedTypes('accompanyingPeriod', [AccompanyingPeriod::class, 'null']);
} }
public function getBlockPrefix(): string public function getBlockPrefix(): string

View File

@@ -27,7 +27,7 @@ final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface
public function buildMenu($menuId, MenuItem $menu, array $parameters) public function buildMenu($menuId, MenuItem $menu, array $parameters)
{ {
/** @var \Chill\PersonBundle\Entity\Person $person */ /** @var Person $person */
$person = $parameters['person']; $person = $parameters['person'];
if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) { if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) {

View File

@@ -242,7 +242,8 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos
thirdparties.thirdpartyids, thirdparties.thirdpartyids,
persons.personids, persons.personids,
actions.socialactionids, actions.socialactionids,
issues.socialissueids issues.socialissueids,
a.user_id
FROM activity a FROM activity a
LEFT JOIN chill_main_location location ON a.location_id = location.id LEFT JOIN chill_main_location location ON a.location_id = location.id
@@ -282,6 +283,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos
->addJoinedEntityResult(ActivityPresence::class, 'activityPresence', 'a', 'attendee') ->addJoinedEntityResult(ActivityPresence::class, 'activityPresence', 'a', 'attendee')
->addFieldResult('activityPresence', 'presence_id', 'id') ->addFieldResult('activityPresence', 'presence_id', 'id')
->addFieldResult('activityPresence', 'presence_name', 'name') ->addFieldResult('activityPresence', 'presence_name', 'name')
->addScalarResult('user_id', 'userId', Types::INTEGER)
// results which cannot be mapped into entity // results which cannot be mapped into entity
->addScalarResult('comment_comment', 'comment', Types::TEXT) ->addScalarResult('comment_comment', 'comment', Types::TEXT)

View File

@@ -35,14 +35,14 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum
private Security $security private Security $security
) {} ) {}
public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQueryInterface public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface
{ {
$query = $this->buildBaseFetchQueryActivityDocumentLinkedToPersonFromPersonContext($person, $startDate, $endDate, $content); $query = $this->buildBaseFetchQueryActivityDocumentLinkedToPersonFromPersonContext($person, $startDate, $endDate, $content);
return $this->addFetchQueryByPersonACL($query, $person); return $this->addFetchQueryByPersonACL($query, $person);
} }
public function buildBaseFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery public function buildBaseFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery
{ {
$storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class); $storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class);
$activityMetadata = $this->em->getClassMetadata(Activity::class); $activityMetadata = $this->em->getClassMetadata(Activity::class);
@@ -71,7 +71,7 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum
return $this->addWhereClauses($query, $startDate, $endDate, $content); return $this->addWhereClauses($query, $startDate, $endDate, $content);
} }
public function buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery public function buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery
{ {
$storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class); $storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class);
$activityMetadata = $this->em->getClassMetadata(Activity::class); $activityMetadata = $this->em->getClassMetadata(Activity::class);
@@ -122,7 +122,7 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum
return $this->addWhereClauses($query, $startDate, $endDate, $content); return $this->addWhereClauses($query, $startDate, $endDate, $content);
} }
private function addWhereClauses(FetchQuery $query, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery private function addWhereClauses(FetchQuery $query, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery
{ {
$storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class); $storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class);

View File

@@ -25,12 +25,12 @@ interface ActivityDocumentACLAwareRepositoryInterface
* *
* This method must check the rights to see a document: the user must be allowed to see the given activities * This method must check the rights to see a document: the user must be allowed to see the given activities
*/ */
public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQueryInterface; public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface;
/** /**
* Return a fetch query for querying document's activities for an activity in accompanying periods, but for a given person. * Return a fetch query for querying document's activities for an activity in accompanying periods, but for a given person.
* *
* This method must check the rights to see a document: the user must be allowed to see the given accompanying periods * This method must check the rights to see a document: the user must be allowed to see the given accompanying periods
*/ */
public function buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery; public function buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery;
} }

View File

@@ -34,7 +34,7 @@ class ActivityPresenceRepository implements ActivityPresenceRepositoryInterface
return $this->repository->findAll(); return $this->repository->findAll();
} }
public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
{ {
return $this->findBy($criteria, $orderBy, $limit, $offset); return $this->findBy($criteria, $orderBy, $limit, $offset);
} }

View File

@@ -25,7 +25,7 @@ interface ActivityPresenceRepositoryInterface
/** /**
* @return array|ActivityPresence[] * @return array|ActivityPresence[]
*/ */
public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array; public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array;
public function findOneBy(array $criteria): ?ActivityPresence; public function findOneBy(array $criteria): ?ActivityPresence;

View File

@@ -48,7 +48,7 @@ final class ActivityTypeRepository implements ActivityTypeRepositoryInterface
/** /**
* @return array|ActivityType[] * @return array|ActivityType[]
*/ */
public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
{ {
return $this->repository->findBy($criteria, $orderBy, $limit, $offset); return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
} }

View File

@@ -11,6 +11,7 @@ declare(strict_types=1);
namespace Chill\ActivityBundle\Service\DocGenerator; namespace Chill\ActivityBundle\Service\DocGenerator;
use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Entity\ActivityPresence; use Chill\ActivityBundle\Entity\ActivityPresence;
use Chill\ActivityBundle\Entity\ActivityType; use Chill\ActivityBundle\Entity\ActivityType;
use Chill\ActivityBundle\Repository\ActivityACLAwareRepositoryInterface; use Chill\ActivityBundle\Repository\ActivityACLAwareRepositoryInterface;
@@ -111,7 +112,7 @@ class ListActivitiesByAccompanyingPeriodContext implements
} }
/** /**
* @return list * @return list<Activity>
*/ */
private function filterActivitiesByUser(array $activities, User $user): array private function filterActivitiesByUser(array $activities, User $user): array
{ {
@@ -119,16 +120,22 @@ class ListActivitiesByAccompanyingPeriodContext implements
array_filter( array_filter(
$activities, $activities,
function ($activity) use ($user) { function ($activity) use ($user) {
$u = $activity['user'];
if (null !== $u && $u['username'] === $user->getUserIdentifier()) {
return true;
}
$activityUsernames = array_map(static fn ($user) => $user['username'], $activity['users'] ?? []); $activityUsernames = array_map(static fn ($user) => $user['username'], $activity['users'] ?? []);
return \in_array($user->getUsername(), $activityUsernames, true); return \in_array($user->getUserIdentifier(), $activityUsernames, true);
} }
) )
); );
} }
/** /**
* @return list * @return list<AccompanyingPeriod\AccompanyingPeriodWork>
*/ */
private function filterWorksByUser(array $works, User $user): array private function filterWorksByUser(array $works, User $user): array
{ {
@@ -136,9 +143,9 @@ class ListActivitiesByAccompanyingPeriodContext implements
array_filter( array_filter(
$works, $works,
function ($work) use ($user) { function ($work) use ($user) {
$workUsernames = array_map(static fn ($user) => $user['username'], $work['referrers'] ?? []); $workUsernames = array_map(static fn (User $user) => $user['username'], $work['referrers'] ?? []);
return \in_array($user->getUsername(), $workUsernames, true); return \in_array($user->getUserIdentifier(), $workUsernames, true);
} }
) )
); );
@@ -215,6 +222,15 @@ class ListActivitiesByAccompanyingPeriodContext implements
foreach ($activities as $row) { foreach ($activities as $row) {
$activity = $row[0]; $activity = $row[0];
$user = match (null === $row['userId']) {
false => $this->userRepository->find($row['userId']),
true => null,
};
$activity['user'] = $this->normalizer->normalize($user, 'docgen', [
AbstractNormalizer::GROUPS => ['docgen:read'], 'docgen:expects' => User::class,
]);
$activity['date'] = $this->normalizer->normalize($activity['date'], 'docgen', [ $activity['date'] = $this->normalizer->normalize($activity['date'], 'docgen', [
AbstractNormalizer::GROUPS => ['docgen:read'], 'docgen:expects' => \DateTime::class, AbstractNormalizer::GROUPS => ['docgen:read'], 'docgen:expects' => \DateTime::class,
]); ]);

View File

@@ -36,7 +36,7 @@ final readonly class AccompanyingPeriodActivityGenericDocProvider implements Gen
private ActivityDocumentACLAwareRepositoryInterface $activityDocumentACLAwareRepository, private ActivityDocumentACLAwareRepositoryInterface $activityDocumentACLAwareRepository,
) {} ) {}
public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
{ {
$storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class); $storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class);
$activityMetadata = $this->em->getClassMetadata(Activity::class); $activityMetadata = $this->em->getClassMetadata(Activity::class);
@@ -99,7 +99,7 @@ final readonly class AccompanyingPeriodActivityGenericDocProvider implements Gen
return $this->security->isGranted(AccompanyingPeriodVoter::SEE, $person); return $this->security->isGranted(AccompanyingPeriodVoter::SEE, $person);
} }
public function buildFetchQueryForPerson(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
{ {
return $this->activityDocumentACLAwareRepository return $this->activityDocumentACLAwareRepository
->buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext($person, $startDate, $endDate, $content); ->buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext($person, $startDate, $endDate, $content);

View File

@@ -27,7 +27,7 @@ final readonly class PersonActivityGenericDocProvider implements GenericDocForPe
private ActivityDocumentACLAwareRepositoryInterface $personActivityDocumentACLAwareRepository, private ActivityDocumentACLAwareRepositoryInterface $personActivityDocumentACLAwareRepository,
) {} ) {}
public function buildFetchQueryForPerson(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
{ {
return $this->personActivityDocumentACLAwareRepository->buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext( return $this->personActivityDocumentACLAwareRepository->buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(
$person, $person,

View File

@@ -310,7 +310,7 @@ final class ActivityControllerTest extends WebTestCase
} }
/** /**
* @return \Chill\ActivityBundle\Entity\ActivityType * @return ActivityType
*/ */
private function getRandomActivityType() private function getRandomActivityType()
{ {

View File

@@ -36,9 +36,9 @@ class ByActivityTypeAggregatorTest extends AbstractAggregatorTest
parent::setUp(); parent::setUp();
self::bootKernel(); self::bootKernel();
$this->rollingDateConverter = self::$container->get(RollingDateConverterInterface::class); $this->rollingDateConverter = self::getContainer()->get(RollingDateConverterInterface::class);
$this->activityTypeRepository = self::$container->get(ActivityTypeRepositoryInterface::class); $this->activityTypeRepository = self::getContainer()->get(ActivityTypeRepositoryInterface::class);
$this->translatableStringHelper = self::$container->get(TranslatableStringHelperInterface::class); $this->translatableStringHelper = self::getContainer()->get(TranslatableStringHelperInterface::class);
} }
public function getAggregator() public function getAggregator()
@@ -50,7 +50,7 @@ class ByActivityTypeAggregatorTest extends AbstractAggregatorTest
); );
} }
public function getFormData() public static function getFormData(): array
{ {
return [ return [
[ [
@@ -72,11 +72,10 @@ class ByActivityTypeAggregatorTest extends AbstractAggregatorTest
]; ];
} }
public function getQueryBuilders() public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ final class BySocialActionAggregatorTest extends AbstractAggregatorTest
{ {
self::bootKernel(); self::bootKernel();
$this->aggregator = self::$container->get('chill.activity.export.bysocialaction_aggregator'); $this->aggregator = self::getContainer()->get('chill.activity.export.bysocialaction_aggregator');
} }
public function getAggregator() public function getAggregator()
@@ -37,18 +37,17 @@ final class BySocialActionAggregatorTest extends AbstractAggregatorTest
return $this->aggregator; return $this->aggregator;
} }
public function getFormData(): array public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getQueryBuilders(): array public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ final class BySocialIssueAggregatorTest extends AbstractAggregatorTest
{ {
self::bootKernel(); self::bootKernel();
$this->aggregator = self::$container->get('chill.activity.export.bysocialissue_aggregator'); $this->aggregator = self::getContainer()->get('chill.activity.export.bysocialissue_aggregator');
} }
public function getAggregator() public function getAggregator()
@@ -37,18 +37,17 @@ final class BySocialIssueAggregatorTest extends AbstractAggregatorTest
return $this->aggregator; return $this->aggregator;
} }
public function getFormData(): array public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getQueryBuilders(): array public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()

View File

@@ -31,8 +31,8 @@ class ActivityPresenceAggregatorTest extends AbstractAggregatorTest
protected function setUp(): void protected function setUp(): void
{ {
self::bootKernel(); self::bootKernel();
$this->translatableStringHelper = self::$container->get(TranslatableStringHelperInterface::class); $this->translatableStringHelper = self::getContainer()->get(TranslatableStringHelperInterface::class);
$this->activityPresenceRepository = self::$container->get(ActivityPresenceRepositoryInterface::class); $this->activityPresenceRepository = self::getContainer()->get(ActivityPresenceRepositoryInterface::class);
} }
public function getAggregator() public function getAggregator()
@@ -40,18 +40,17 @@ class ActivityPresenceAggregatorTest extends AbstractAggregatorTest
return new ActivityPresenceAggregator($this->activityPresenceRepository, $this->translatableStringHelper); return new ActivityPresenceAggregator($this->activityPresenceRepository, $this->translatableStringHelper);
} }
public function getFormData() public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getQueryBuilders() public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()

View File

@@ -9,10 +9,10 @@ declare(strict_types=1);
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
namespace Chill\ActivityBundle\Tests\Export\Aggregator\PersonAggregators; namespace Chill\ActivityBundle\Tests\Export\Aggregator;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Export\Aggregator\PersonAggregators\ActivityReasonAggregator; use Chill\ActivityBundle\Export\Aggregator\ActivityReasonAggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Prophecy\PhpUnit\ProphecyTrait; use Prophecy\PhpUnit\ProphecyTrait;
@@ -32,15 +32,16 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
{ {
self::bootKernel(); self::bootKernel();
$this->aggregator = self::$container->get(ActivityReasonAggregator::class); $this->aggregator = self::getContainer()->get(ActivityReasonAggregator::class);
/*
$request = $this->prophesize()
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
$this->aggregator = self::$container->get(ActivityReasonAggregator::class);
$request = $this->prophesize() $request->getLocale()->willReturn('fr');
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
$request->getLocale()->willReturn('fr'); self::getContainer()->get('request_stack')
->push($request->reveal());*/
self::$container->get('request_stack')
->push($request->reveal());
} }
public function getAggregator() public function getAggregator()
@@ -48,7 +49,7 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
return $this->aggregator; return $this->aggregator;
} }
public function getFormData(): array public static function getFormData(): array
{ {
return [ return [
['level' => 'reasons'], ['level' => 'reasons'],
@@ -56,16 +57,20 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
]; ];
} }
public function getQueryBuilders(): array public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()
->select('count(activity.id)') ->select('count(activity.id)')
->from(Activity::class, 'activity'), ->from(Activity::class, 'activity')
->join('activity.person', 'person'),
$em->createQueryBuilder()
->select('count(activity.id)')
->from(Activity::class, 'activity')
->join('activity.accompanyingPeriod', 'accompanyingPeriod'),
$em->createQueryBuilder() $em->createQueryBuilder()
->select('count(activity.id)') ->select('count(activity.id)')
->from(Activity::class, 'activity') ->from(Activity::class, 'activity')

View File

@@ -34,14 +34,14 @@ final class ActivityTypeAggregatorTest extends AbstractAggregatorTest
{ {
self::bootKernel(); self::bootKernel();
$this->aggregator = self::$container->get(ActivityTypeAggregator::class); $this->aggregator = self::getContainer()->get(ActivityTypeAggregator::class);
$request = $this->prophesize() $request = $this->prophesize()
->willExtend(\Symfony\Component\HttpFoundation\Request::class); ->willExtend(\Symfony\Component\HttpFoundation\Request::class);
$request->getLocale()->willReturn('fr'); $request->getLocale()->willReturn('fr');
self::$container->get('request_stack') self::getContainer()->get('request_stack')
->push($request->reveal()); ->push($request->reveal());
} }
@@ -50,18 +50,17 @@ final class ActivityTypeAggregatorTest extends AbstractAggregatorTest
return $this->aggregator; return $this->aggregator;
} }
public function getFormData() public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getQueryBuilders() public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()

View File

@@ -34,14 +34,14 @@ final class ActivityUserAggregatorTest extends AbstractAggregatorTest
{ {
self::bootKernel(); self::bootKernel();
$this->aggregator = self::$container->get('chill.activity.export.user_aggregator'); $this->aggregator = self::getContainer()->get('chill.activity.export.user_aggregator');
$request = $this->prophesize() $request = $this->prophesize()
->willExtend(\Symfony\Component\HttpFoundation\Request::class); ->willExtend(\Symfony\Component\HttpFoundation\Request::class);
$request->getLocale()->willReturn('fr'); $request->getLocale()->willReturn('fr');
self::$container->get('request_stack') self::getContainer()->get('request_stack')
->push($request->reveal()); ->push($request->reveal());
} }
@@ -50,18 +50,17 @@ final class ActivityUserAggregatorTest extends AbstractAggregatorTest
return $this->aggregator; return $this->aggregator;
} }
public function getFormData(): array public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getQueryBuilders(): array public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ final class ByThirdpartyAggregatorTest extends AbstractAggregatorTest
{ {
self::bootKernel(); self::bootKernel();
$this->aggregator = self::$container->get(ByThirdpartyAggregator::class); $this->aggregator = self::getContainer()->get(ByThirdpartyAggregator::class);
} }
public function getAggregator() public function getAggregator()
@@ -37,18 +37,17 @@ final class ByThirdpartyAggregatorTest extends AbstractAggregatorTest
return $this->aggregator; return $this->aggregator;
} }
public function getFormData(): array public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getQueryBuilders(): array public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ final class ByUserAggregatorTest extends AbstractAggregatorTest
{ {
self::bootKernel(); self::bootKernel();
$this->aggregator = self::$container->get(ByCreatorAggregator::class); $this->aggregator = self::getContainer()->get(ByCreatorAggregator::class);
} }
public function getAggregator() public function getAggregator()
@@ -37,18 +37,17 @@ final class ByUserAggregatorTest extends AbstractAggregatorTest
return $this->aggregator; return $this->aggregator;
} }
public function getFormData(): array public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getQueryBuilders(): array public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ final class CreatorJobAggregatorTest extends AbstractAggregatorTest
{ {
self::bootKernel(); self::bootKernel();
$this->aggregator = self::$container->get(CreatorJobAggregator::class); $this->aggregator = self::getContainer()->get(CreatorJobAggregator::class);
} }
public function getAggregator() public function getAggregator()
@@ -37,18 +37,17 @@ final class CreatorJobAggregatorTest extends AbstractAggregatorTest
return $this->aggregator; return $this->aggregator;
} }
public function getFormData(): array public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getQueryBuilders(): array public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ final class CreatorScopeAggregatorTest extends AbstractAggregatorTest
{ {
self::bootKernel(); self::bootKernel();
$this->aggregator = self::$container->get(CreatorScopeAggregator::class); $this->aggregator = self::getContainer()->get(CreatorScopeAggregator::class);
} }
public function getAggregator() public function getAggregator()
@@ -37,18 +37,17 @@ final class CreatorScopeAggregatorTest extends AbstractAggregatorTest
return $this->aggregator; return $this->aggregator;
} }
public function getFormData(): array public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getQueryBuilders(): array public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ final class DateAggregatorTest extends AbstractAggregatorTest
{ {
self::bootKernel(); self::bootKernel();
$this->aggregator = self::$container->get(DateAggregator::class); $this->aggregator = self::getContainer()->get(DateAggregator::class);
} }
public function getAggregator() public function getAggregator()
@@ -37,7 +37,7 @@ final class DateAggregatorTest extends AbstractAggregatorTest
return $this->aggregator; return $this->aggregator;
} }
public function getFormData(): array public static function getFormData(): array
{ {
return [ return [
[ [
@@ -52,11 +52,10 @@ final class DateAggregatorTest extends AbstractAggregatorTest
]; ];
} }
public function getQueryBuilders(): array public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest
{ {
self::bootKernel(); self::bootKernel();
$this->aggregator = self::$container->get(LocationTypeAggregator::class); $this->aggregator = self::getContainer()->get(LocationTypeAggregator::class);
} }
public function getAggregator() public function getAggregator()
@@ -37,18 +37,17 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest
return $this->aggregator; return $this->aggregator;
} }
public function getFormData(): array public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getQueryBuilders(): array public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()

View File

@@ -29,7 +29,7 @@ class PersonAggregatorTest extends AbstractAggregatorTest
protected function setUp(): void protected function setUp(): void
{ {
self::bootKernel(); self::bootKernel();
$this->labelPersonHelper = self::$container->get(LabelPersonHelper::class); $this->labelPersonHelper = self::getContainer()->get(LabelPersonHelper::class);
} }
public function getAggregator() public function getAggregator()
@@ -37,16 +37,15 @@ class PersonAggregatorTest extends AbstractAggregatorTest
return new PersonAggregator($this->labelPersonHelper); return new PersonAggregator($this->labelPersonHelper);
} }
public function getFormData() public static function getFormData(): array
{ {
return [[]]; return [[]];
} }
public function getQueryBuilders() public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()

View File

@@ -30,7 +30,7 @@ class PersonsAggregatorTest extends AbstractAggregatorTest
{ {
parent::setUp(); parent::setUp();
self::bootKernel(); self::bootKernel();
$this->labelPersonHelper = self::$container->get(LabelPersonHelper::class); $this->labelPersonHelper = self::getContainer()->get(LabelPersonHelper::class);
} }
public function getAggregator() public function getAggregator()
@@ -38,18 +38,17 @@ class PersonsAggregatorTest extends AbstractAggregatorTest
return new PersonsAggregator($this->labelPersonHelper); return new PersonsAggregator($this->labelPersonHelper);
} }
public function getFormData() public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getQueryBuilders() public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()

View File

@@ -29,20 +29,20 @@ final class AvgActivityDurationTest extends AbstractExportTest
public function getExport() public function getExport()
{ {
$activityRepository = self::$container->get(ActivityRepository::class); $activityRepository = self::getContainer()->get(ActivityRepository::class);
yield new AvgActivityDuration($activityRepository, $this->getParameters(true)); yield new AvgActivityDuration($activityRepository, $this->getParameters(true));
yield new AvgActivityDuration($activityRepository, $this->getParameters(false)); yield new AvgActivityDuration($activityRepository, $this->getParameters(false));
} }
public function getFormData(): array public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getModifiersCombination(): array public static function getModifiersCombination(): array
{ {
return [ return [
['activity'], ['activity'],

View File

@@ -29,20 +29,20 @@ final class AvgActivityVisitDurationTest extends AbstractExportTest
public function getExport() public function getExport()
{ {
$em = self::$container->get(EntityManagerInterface::class); $em = self::getContainer()->get(EntityManagerInterface::class);
yield new AvgActivityVisitDuration($em, $this->getParameters(true)); yield new AvgActivityVisitDuration($em, $this->getParameters(true));
yield new AvgActivityVisitDuration($em, $this->getParameters(false)); yield new AvgActivityVisitDuration($em, $this->getParameters(false));
} }
public function getFormData(): array public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getModifiersCombination(): array public static function getModifiersCombination(): array
{ {
return [ return [
['activity'], ['activity'],

View File

@@ -29,20 +29,20 @@ final class CountActivityTest extends AbstractExportTest
public function getExport() public function getExport()
{ {
$em = self::$container->get(EntityManagerInterface::class); $em = self::getContainer()->get(EntityManagerInterface::class);
yield new CountActivity($em, $this->getParameters(true)); yield new CountActivity($em, $this->getParameters(true));
yield new CountActivity($em, $this->getParameters(false)); yield new CountActivity($em, $this->getParameters(false));
} }
public function getFormData(): array public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getModifiersCombination(): array public static function getModifiersCombination(): array
{ {
return [ return [
['activity'], ['activity'],

View File

@@ -29,7 +29,7 @@ class CountHouseholdOnActivityTest extends AbstractExportTest
protected function setUp(): void protected function setUp(): void
{ {
self::bootKernel(); self::bootKernel();
$this->entityManager = self::$container->get(EntityManagerInterface::class); $this->entityManager = self::getContainer()->get(EntityManagerInterface::class);
} }
public function getExport() public function getExport()
@@ -38,14 +38,14 @@ class CountHouseholdOnActivityTest extends AbstractExportTest
yield new CountHouseholdOnActivity($this->entityManager, $this->getParameters(false)); yield new CountHouseholdOnActivity($this->entityManager, $this->getParameters(false));
} }
public function getFormData() public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getModifiersCombination() public static function getModifiersCombination(): array
{ {
return [ return [
[ [

View File

@@ -31,18 +31,18 @@ class CountPersonsOnActivityTest extends AbstractExportTest
public function getExport() public function getExport()
{ {
$em = self::$container->get(EntityManagerInterface::class); $em = self::getContainer()->get(EntityManagerInterface::class);
yield new CountPersonsOnActivity($em, $this->getParameters(true)); yield new CountPersonsOnActivity($em, $this->getParameters(true));
yield new CountPersonsOnActivity($em, $this->getParameters(false)); yield new CountPersonsOnActivity($em, $this->getParameters(false));
} }
public function getFormData() public static function getFormData(): array
{ {
return [[]]; return [[]];
} }
public function getModifiersCombination() public static function getModifiersCombination(): array
{ {
return [[ return [[
Declarations::ACTIVITY, Declarations::ACTIVITY,

View File

@@ -29,20 +29,20 @@ final class SumActivityDurationTest extends AbstractExportTest
public function getExport() public function getExport()
{ {
$em = self::$container->get(EntityManagerInterface::class); $em = self::getContainer()->get(EntityManagerInterface::class);
yield new SumActivityDuration($em, $this->getParameters(true)); yield new SumActivityDuration($em, $this->getParameters(true));
yield new SumActivityDuration($em, $this->getParameters(false)); yield new SumActivityDuration($em, $this->getParameters(false));
} }
public function getFormData(): array public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getModifiersCombination(): array public static function getModifiersCombination(): array
{ {
return [ return [
['activity'], ['activity'],

View File

@@ -28,25 +28,25 @@ final class SumActivityVisitDurationTest extends AbstractExportTest
{ {
self::bootKernel(); self::bootKernel();
$this->export = self::$container->get('chill.activity.export.sum_activity_visit_duration_linked_to_acp'); $this->export = self::getContainer()->get('chill.activity.export.sum_activity_visit_duration_linked_to_acp');
} }
public function getExport() public function getExport()
{ {
$em = self::$container->get(EntityManagerInterface::class); $em = self::getContainer()->get(EntityManagerInterface::class);
yield new SumActivityVisitDuration($em, $this->getParameters(true)); yield new SumActivityVisitDuration($em, $this->getParameters(true));
yield new SumActivityVisitDuration($em, $this->getParameters(false)); yield new SumActivityVisitDuration($em, $this->getParameters(false));
} }
public function getFormData(): array public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getModifiersCombination(): array public static function getModifiersCombination(): array
{ {
return [ return [
['activity'], ['activity'],

View File

@@ -29,20 +29,20 @@ final class CountActivityTest extends AbstractExportTest
public function getExport() public function getExport()
{ {
$activityRepository = self::$container->get(ActivityRepository::class); $activityRepository = self::getContainer()->get(ActivityRepository::class);
yield new CountActivity($activityRepository, $this->getParameters(true)); yield new CountActivity($activityRepository, $this->getParameters(true));
yield new CountActivity($activityRepository, $this->getParameters(false)); yield new CountActivity($activityRepository, $this->getParameters(false));
} }
public function getFormData(): array public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getModifiersCombination(): array public static function getModifiersCombination(): array
{ {
return [ return [
['activity'], ['activity'],

View File

@@ -29,7 +29,7 @@ class CountHouseholdOnActivityTest extends AbstractExportTest
protected function setUp(): void protected function setUp(): void
{ {
self::bootKernel(); self::bootKernel();
$this->activityRepository = self::$container->get(ActivityRepository::class); $this->activityRepository = self::getContainer()->get(ActivityRepository::class);
} }
public function getExport() public function getExport()
@@ -38,14 +38,14 @@ class CountHouseholdOnActivityTest extends AbstractExportTest
yield new CountHouseholdOnActivity($this->activityRepository, $this->getParameters(false)); yield new CountHouseholdOnActivity($this->activityRepository, $this->getParameters(false));
} }
public function getFormData() public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getModifiersCombination() public static function getModifiersCombination(): array
{ {
return [ return [
[ [

View File

@@ -39,16 +39,16 @@ final class ListActivityTest extends AbstractExportTest
$request->getLocale()->willReturn('fr'); $request->getLocale()->willReturn('fr');
self::$container->get('request_stack') self::getContainer()->get('request_stack')
->push($request->reveal()); ->push($request->reveal());
} }
public function getExport() public function getExport()
{ {
$em = self::$container->get(EntityManagerInterface::class); $em = self::getContainer()->get(EntityManagerInterface::class);
$translator = self::$container->get(TranslatorInterface::class); $translator = self::getContainer()->get(TranslatorInterface::class);
$translatableStringHelper = self::$container->get(TranslatableStringHelperInterface::class); $translatableStringHelper = self::getContainer()->get(TranslatableStringHelperInterface::class);
$activityRepository = self::$container->get(ActivityRepository::class); $activityRepository = self::getContainer()->get(ActivityRepository::class);
yield new ListActivity( yield new ListActivity(
$em, $em,
@@ -67,7 +67,7 @@ final class ListActivityTest extends AbstractExportTest
); );
} }
public function getFormData() public static function getFormData(): array
{ {
return [ return [
['fields' => [ ['fields' => [
@@ -89,7 +89,7 @@ final class ListActivityTest extends AbstractExportTest
]; ];
} }
public function getModifiersCombination() public static function getModifiersCombination(): array
{ {
return [ return [
['activity'], ['activity'],

View File

@@ -33,19 +33,19 @@ final class StatActivityDurationTest extends AbstractExportTest
public function getExport() public function getExport()
{ {
$activityRepository = self::$container->get(ActivityRepository::class); $activityRepository = self::getContainer()->get(ActivityRepository::class);
yield new StatActivityDuration($activityRepository, $this->getParameters(true), 'sum'); yield new StatActivityDuration($activityRepository, $this->getParameters(true), 'sum');
yield new StatActivityDuration($activityRepository, $this->getParameters(false), 'sum'); yield new StatActivityDuration($activityRepository, $this->getParameters(false), 'sum');
} }
public function getFormData(): array public static function getFormData(): array
{ {
return [ return [
[], [],
]; ];
} }
public function getModifiersCombination(): array public static function getModifiersCombination(): array
{ {
return [ return [
['activity'], ['activity'],

View File

@@ -33,7 +33,7 @@ final class ActivityTypeFilterTest extends AbstractFilterTest
{ {
self::bootKernel(); self::bootKernel();
$this->filter = self::$container->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter::class); $this->filter = self::getContainer()->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter::class);
} }
public function getFilter() public function getFilter()
@@ -41,20 +41,17 @@ final class ActivityTypeFilterTest extends AbstractFilterTest
return $this->filter; return $this->filter;
} }
public function getFormData(): array public static function getFormData(): array
{ {
self::bootKernel(); self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class); $em = self::getContainer()->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder() $array = $em->createQueryBuilder()
->from(ActivityType::class, 'at') ->from(ActivityType::class, 'at')
->select('at') ->select('at')
->getQuery() ->getQuery()
->setMaxResults(1) ->setMaxResults(1)
->getResult(); ->getResult();
$data = []; $data = [];
foreach ($array as $a) { foreach ($array as $a) {
$data[] = [ $data[] = [
'accepted_activitytypes' => [], 'accepted_activitytypes' => [],
@@ -86,11 +83,10 @@ final class ActivityTypeFilterTest extends AbstractFilterTest
return $data; return $data;
} }
public function getQueryBuilders(): array public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()

View File

@@ -30,7 +30,7 @@ final class ByCreatorFilterTest extends AbstractFilterTest
{ {
self::bootKernel(); self::bootKernel();
$this->filter = self::$container->get(ByCreatorFilter::class); $this->filter = self::getContainer()->get(ByCreatorFilter::class);
} }
public function getFilter() public function getFilter()
@@ -38,20 +38,17 @@ final class ByCreatorFilterTest extends AbstractFilterTest
return $this->filter; return $this->filter;
} }
public function getFormData(): array public static function getFormData(): array
{ {
self::bootKernel(); self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class); $em = self::getContainer()->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder() $array = $em->createQueryBuilder()
->from(User::class, 'u') ->from(User::class, 'u')
->select('u') ->select('u')
->getQuery() ->getQuery()
->setMaxResults(2) ->setMaxResults(2)
->getResult(); ->getResult();
$data = []; $data = [];
foreach ($array as $a) { foreach ($array as $a) {
$data[] = [ $data[] = [
'accepted_users' => $a, 'accepted_users' => $a,
@@ -61,11 +58,10 @@ final class ByCreatorFilterTest extends AbstractFilterTest
return $data; return $data;
} }
public function getQueryBuilders(): array public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()

View File

@@ -30,7 +30,7 @@ final class BySocialActionFilterTest extends AbstractFilterTest
{ {
self::bootKernel(); self::bootKernel();
$this->filter = self::$container->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter::class); $this->filter = self::getContainer()->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter::class);
} }
public function getFilter() public function getFilter()
@@ -38,20 +38,16 @@ final class BySocialActionFilterTest extends AbstractFilterTest
return $this->filter; return $this->filter;
} }
public function getFormData(): array public static function getFormData(): array
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder() $array = $em->createQueryBuilder()
->from(SocialAction::class, 'sa') ->from(SocialAction::class, 'sa')
->select('sa') ->select('sa')
->getQuery() ->getQuery()
->getResult(); ->getResult();
$data = []; $data = [];
foreach ($array as $a) { foreach ($array as $a) {
$data[] = [ $data[] = [
'accepted_socialactions' => new ArrayCollection([$a]), 'accepted_socialactions' => new ArrayCollection([$a]),
@@ -61,11 +57,10 @@ final class BySocialActionFilterTest extends AbstractFilterTest
return $data; return $data;
} }
public function getQueryBuilders(): array public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()

View File

@@ -31,7 +31,7 @@ final class BySocialIssueFilterTest extends AbstractFilterTest
{ {
self::bootKernel(); self::bootKernel();
$this->filter = self::$container->get(BySocialIssueFilter::class); $this->filter = self::getContainer()->get(BySocialIssueFilter::class);
} }
public function getFilter() public function getFilter()
@@ -39,20 +39,17 @@ final class BySocialIssueFilterTest extends AbstractFilterTest
return $this->filter; return $this->filter;
} }
public function getFormData(): array public static function getFormData(): array
{ {
self::bootKernel(); self::bootKernel();
$em = self::$container->get(EntityManagerInterface::class); $em = self::getContainer()->get(EntityManagerInterface::class);
$array = $em->createQueryBuilder() $array = $em->createQueryBuilder()
->from(SocialIssue::class, 'si') ->from(SocialIssue::class, 'si')
->select('si') ->select('si')
->getQuery() ->getQuery()
->setMaxResults(2) ->setMaxResults(2)
->getResult(); ->getResult();
$data = []; $data = [];
foreach ($array as $a) { foreach ($array as $a) {
$data[] = [ $data[] = [
'accepted_socialissues' => new ArrayCollection([$a]), 'accepted_socialissues' => new ArrayCollection([$a]),
@@ -62,13 +59,12 @@ final class BySocialIssueFilterTest extends AbstractFilterTest
return $data; return $data;
} }
public function getQueryBuilders(): array public static function getQueryBuilders(): iterable
{ {
if (null === self::$kernel) { if (null === self::$kernel) {
self::bootKernel(); self::bootKernel();
} }
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
return [ return [
$em->createQueryBuilder() $em->createQueryBuilder()

View File

@@ -30,7 +30,7 @@ final class ActivityDateFilterTest extends AbstractFilterTest
{ {
self::bootKernel(); self::bootKernel();
$this->filter = self::$container->get(ActivityDateFilter::class); $this->filter = self::getContainer()->get(ActivityDateFilter::class);
} }
public function getFilter() public function getFilter()
@@ -38,7 +38,7 @@ final class ActivityDateFilterTest extends AbstractFilterTest
return $this->filter; return $this->filter;
} }
public function getFormData(): array public static function getFormData(): array
{ {
return [ return [
[ [
@@ -48,16 +48,13 @@ final class ActivityDateFilterTest extends AbstractFilterTest
]; ];
} }
public function getQueryBuilders(): iterable public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
yield $em->createQueryBuilder() yield $em->createQueryBuilder()
->select('count(activity.id)') ->select('count(activity.id)')
->from(Activity::class, 'activity'); ->from(Activity::class, 'activity');
self::ensureKernelShutdown(); self::ensureKernelShutdown();
} }
} }

View File

@@ -35,8 +35,8 @@ class ActivityPresenceFilterTest extends AbstractFilterTest
parent::setUp(); parent::setUp();
self::bootKernel(); self::bootKernel();
$this->translator = self::$container->get(TranslatorInterface::class); $this->translator = self::getContainer()->get(TranslatorInterface::class);
$this->translatableStringHelper = self::$container->get(TranslatableStringHelperInterface::class); $this->translatableStringHelper = self::getContainer()->get(TranslatableStringHelperInterface::class);
} }
public function getFilter() public function getFilter()
@@ -44,11 +44,10 @@ class ActivityPresenceFilterTest extends AbstractFilterTest
return new ActivityPresenceFilter($this->translatableStringHelper, $this->translator); return new ActivityPresenceFilter($this->translatableStringHelper, $this->translator);
} }
public function getFormData() public static function getFormData(): array
{ {
self::bootKernel(); self::bootKernel();
$presences = self::getContainer()->get(ActivityPresenceRepositoryInterface::class)
$presences = self::$container->get(ActivityPresenceRepositoryInterface::class)
->findAll(); ->findAll();
return [ return [
@@ -61,16 +60,13 @@ class ActivityPresenceFilterTest extends AbstractFilterTest
]; ];
} }
public function getQueryBuilders() public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
yield $em->createQueryBuilder() yield $em->createQueryBuilder()
->select('count(activity.id)') ->select('count(activity.id)')
->from(Activity::class, 'activity'); ->from(Activity::class, 'activity');
self::ensureKernelShutdown(); self::ensureKernelShutdown();
} }
} }

View File

@@ -33,14 +33,14 @@ final class ActivityReasonFilterTest extends AbstractFilterTest
{ {
self::bootKernel(); self::bootKernel();
$this->filter = self::$container->get('chill.activity.export.reason_filter'); $this->filter = self::getContainer()->get('chill.activity.export.reason_filter');
$request = $this->prophesize() $request = $this->prophesize()
->willExtend(\Symfony\Component\HttpFoundation\Request::class); ->willExtend(\Symfony\Component\HttpFoundation\Request::class);
$request->getLocale()->willReturn('fr'); $request->getLocale()->willReturn('fr');
self::$container->get(RequestStack::class) self::getContainer()->get(RequestStack::class)
->push($request->reveal()); ->push($request->reveal());
} }
@@ -49,35 +49,29 @@ final class ActivityReasonFilterTest extends AbstractFilterTest
return $this->filter; return $this->filter;
} }
public function getFormData() public static function getFormData(): array
{ {
self::bootKernel(); self::bootKernel();
$data = []; $data = [];
$em = self::getContainer()
$em = self::$container
->get(EntityManagerInterface::class); ->get(EntityManagerInterface::class);
$reasons = $em->createQuery('SELECT reason ' $reasons = $em->createQuery('SELECT reason '
.'FROM ChillActivityBundle:ActivityReason reason') .'FROM ChillActivityBundle:ActivityReason reason')
->getResult(); ->getResult();
// generate an array of 5 different combination of results // generate an array of 5 different combination of results
for ($i = 0; 5 > $i; ++$i) { for ($i = 0; 5 > $i; ++$i) {
$data[] = ['reasons' => new ArrayCollection(array_splice($reasons, ($i + 1) * -1))]; $data[] = ['reasons' => new ArrayCollection(array_splice($reasons, ($i + 1) * -1))];
$data[] = ['reasons' => array_splice($reasons, ($i + 1) * -1)]; $data[] = ['reasons' => array_splice($reasons, ($i + 1) * -1)];
} }
self::ensureKernelShutdown(); self::ensureKernelShutdown();
return $data; return $data;
} }
public function getQueryBuilders(): iterable public static function getQueryBuilders(): iterable
{ {
self::bootKernel(); self::bootKernel();
$em = self::getContainer()->get(EntityManagerInterface::class);
$em = self::$container->get(EntityManagerInterface::class);
yield $em->createQueryBuilder() yield $em->createQueryBuilder()
->select('count(activity.id)') ->select('count(activity.id)')
->from('ChillActivityBundle:Activity', 'activity'); ->from('ChillActivityBundle:Activity', 'activity');
@@ -90,7 +84,6 @@ final class ActivityReasonFilterTest extends AbstractFilterTest
->from('ChillActivityBundle:Activity', 'activity') ->from('ChillActivityBundle:Activity', 'activity')
->join('activity.reasons', 'reasons') ->join('activity.reasons', 'reasons')
->join('reasons.category', 'category'); ->join('reasons.category', 'category');
self::ensureKernelShutdown(); self::ensureKernelShutdown();
} }
} }

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