mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-10-25 06:32:50 +00:00 
			
		
		
		
	Compare commits
	
		
			163 Commits
		
	
	
		
			2.12.1
			...
			fix-compil
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 88c6e0e0d3 | |||
| f02c5bca13 | |||
| 0d56828ebd | |||
| 8b28667fe5 | |||
| 72f73ec8e7 | |||
| b3d1320c94 | |||
| 2ed42e1a2c | |||
| d0e5ba16fe | |||
| 8e65ad9476 | |||
| cf7338b690 | |||
| 63dd71037a | |||
| cc281762b3 | |||
| aa0cadfa84 | |||
| 6e2cce9531 | |||
| 1fbbf2b2ad | |||
| e586b8ee5e | |||
| 6d04e477f8 | |||
| 6b7b2ae522 | |||
| 9b9c2774ad | |||
| e902b6d409 | |||
| d8bf6a195f | |||
| 7c3152f277 | |||
| cef218fed5 | |||
| 930a76cc66 | |||
| f11f7498d7 | |||
| 1a9af6b0b1 | |||
| d347f6ae60 | |||
| 3bb911b4d0 | |||
| f00b39980c | |||
| 09882bb4be | |||
| 1d21499eab | |||
| 8ef001e67e | |||
| 458df45fa5 | |||
| 2b968b9a5b | |||
| f1fa4d415e | |||
| 2312a8d46f | |||
| 67c3de733f | |||
| c05451bfe9 | |||
| 8be9fb6553 | |||
| f5f6eb78a2 | |||
| 7a7e66146b | |||
| 4bbad4fc61 | |||
| 86613a9be9 | |||
| 21bd6478ad | |||
| 5849d8d670 | |||
| 568ee079b5 | |||
| bf97b2a50c | |||
| 01785ed494 | |||
| 97d401b7f6 | |||
| 44ccfe92b6 | |||
| b6ea857389 | |||
| f8840d89bf | |||
| 813f2f1e12 | |||
| 4a15a89102 | |||
| c707a34f16 | |||
| 0c9010f065 | |||
| 3871299346 | |||
| e2e0b08210 | |||
| 4df0542932 | |||
| 13854e59de | |||
| 574ad42a76 | |||
| 4736fca679 | |||
| 32ae2f8f0d | |||
| d58c0a867d | |||
| 15f8432ce0 | |||
| ae7637acc6 | |||
| ce391a6de8 | |||
| 950835c10b | |||
| 9ba557a5bf | |||
| 439fecd69f | |||
| f02168950f | |||
| 58c2235b88 | |||
| 42c5577027 | |||
| 036fe8d6f8 | |||
| 51ebc253aa | |||
| 4fdc7fd210 | |||
| 0bf6c07e8d | |||
| 7a12602699 | |||
| 15a927a9f8 | |||
| 0a2805f23f | |||
| 27ce322690 | |||
| fdfc3fb7ec | |||
| aee245cd04 | |||
| adcf183469 | |||
| 86bf5eba4f | |||
| db130ef9df | |||
| 2b903c4d6e | |||
| 2c6b5dfee1 | |||
| 0b50cbfe4c | |||
| 3a6a125bb1 | |||
| e67c5d98ef | |||
| 3c8e59e088 | |||
| 60ede58af0 | |||
| afb79141f0 | |||
| 4d72933edb | |||
| 469e379166 | |||
| f103b228e4 | |||
| d2a31de1be | |||
| 138a537d2b | |||
| c06c861e17 | |||
| 34cbd2605c | |||
| 044bab45ad | |||
| b9890d1302 | |||
| 5b2a2a1bc5 | |||
| 0da12cdc2e | |||
| d1ce99e6d3 | |||
|  | 0ad27328c9 | ||
| 91e6b035bd | |||
| 2adb6105eb | |||
| 33d187f329 | |||
| f02873c6e0 | |||
| 8cc93a8b07 | |||
| f7184ca7bb | |||
| dab80a84d8 | |||
| 68e00dc42f | |||
| 5fae49821f | |||
| 0e599a99a7 | |||
| f0605c6b08 | |||
| 54606403b4 | |||
| 47d829d72d | |||
| fa3b305ab9 | |||
| b26b7a2706 | |||
| fe54e51362 | |||
| 179e3e92ed | |||
| c00c6066a9 | |||
| f424c5464f | |||
| b17b2a8cfb | |||
| 00de657cae | |||
| 673518e0eb | |||
| 4700a0fef7 | |||
| f4d258882f | |||
| fffc4a9c33 | |||
| a344f36592 | |||
| eef93b8a0d | |||
| 75b78d3c99 | |||
| 3d4c439be4 | |||
| 4727a57825 | |||
| 5f441eb5ac | |||
| 2e4e5ee79a | |||
| 1467c708f2 | |||
| 170bb9586d | |||
| c704ffa379 | |||
| 947b7b90e2 | |||
| 992f7761bb | |||
| 35170e1f7c | |||
| 7132dfa3f6 | |||
| 7e09e0ea54 | |||
| ccf8cc4d6e | |||
| 63124f8f92 | |||
| 75d80ebd98 | |||
| 0ea6f36297 | |||
| 975ea417b7 | |||
| af8e02f76b | |||
| cbaeb3d7e8 | |||
| f609ddb315 | |||
| d0bceb59dc | |||
| 2883e085ed | |||
| b05ed86d1e | |||
| c855d0badc | |||
| be57c96a2f | |||
| eb01c7c203 | |||
| 53b4747697 | |||
| 89e19502d3 | 
							
								
								
									
										9
									
								
								.changes/v2.13.0.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								.changes/v2.13.0.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| ## v2.13.0 - 2023-11-21 | ||||
| ### Feature | ||||
| * ([#173](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/173)) Allow user to add a phonenumber to their profile which will be included in automatically generated documents | ||||
| ### Fixed | ||||
| * ([#211](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/211)) Export: fix loading of "Group activity by type" | ||||
| * ([#190](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/190)) Export: fix loading of "group activity by reasons" | ||||
| * ([#213](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/213)) Export: fix usage of some Collection returned instead of array in export filters | ||||
| * ([#215](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/215)) Use only the string 'both' for gender (with a database migration) | ||||
| * ([#212](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/212)) Clean the database to make working the "Group people by gender" aggregator | ||||
							
								
								
									
										8
									
								
								.changes/v2.14.0.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								.changes/v2.14.0.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| ## v2.14.0 - 2023-11-24 | ||||
| ### Feature | ||||
| * ([#161](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/161)) Export: in filter "Filter accompanying period work (social action) by type, goal and result", order the items alphabetically or with the defined order  | ||||
| ### Fixed | ||||
| * ([#141](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/141)) Export: on filter "action by type goals, and results", restore the fields when editing a saved export  | ||||
| * ([#219](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/219)) Export: fix the list of accompanying period work, when the "calc date" is null  | ||||
| * ([#222](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/222)) Fix rendering of custom fields  | ||||
| * Fix various errors in custom fields administration  | ||||
							
								
								
									
										5
									
								
								.changes/v2.14.1.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								.changes/v2.14.1.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| ## v2.14.1 - 2023-11-29 | ||||
| ### Fixed | ||||
| * Export: fix list person with custom fields  | ||||
| * ([#100](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/100)) Add a paginator to budget elements (resource and charge types) in the admin  | ||||
| * Fix error in ListEvaluation when "handling agents" are alone  | ||||
							
								
								
									
										11
									
								
								.changes/v2.15.0.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								.changes/v2.15.0.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| ## v2.15.0 - 2023-12-11 | ||||
| ### Feature | ||||
| * ([#191](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/191)) Add export "number of household associate with an exchange"  | ||||
| * ([#235](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/235)) Export: add dates on the filter "filter course by activity type"  | ||||
| ### Fixed | ||||
| * ([#214](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/214)) Fix error when posting an empty comment on an accompanying period.  | ||||
| * ([#233](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/233)) Fix "filter evaluation by evaluation type" (and add select2 to the list of evaluation types to pick)  | ||||
| * ([#234](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/234)) Fix "filter aside activity by date" | ||||
|   | ||||
| * ([#228](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/228)) Fix export of activity for people created before the introduction of the createdAt column on person (during v1)  | ||||
| * ([#246](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/246)) Do not show activities, evaluations and social work when associated to a confidential accompanying period, except for the users which are allowed to see them  | ||||
							
								
								
									
										5
									
								
								.changes/v2.15.1.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								.changes/v2.15.1.md
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										5
									
								
								.changes/v2.15.2.md
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										15
									
								
								.changes/v2.16.0.md
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										3
									
								
								.changes/v2.16.1.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | ||||
| ## v2.16.1 - 2024-02-09 | ||||
| ### Fixed | ||||
| * Force bootstrap version to avoid error in builds with newer version  | ||||
| @@ -34,6 +34,8 @@ variables: | ||||
|     DEFAULT_CARRIER_CODE: BE | ||||
|     # force a timezone | ||||
|     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]=0&verbose=0 | ||||
|  | ||||
| stages: | ||||
|     - Composer install | ||||
| @@ -51,7 +53,7 @@ build: | ||||
|         paths: | ||||
|             - .cache/ | ||||
|     artifacts: | ||||
|         expire_in: 30 min | ||||
|         expire_in: 1 day | ||||
|         paths: | ||||
|             - bin | ||||
|             - vendor/ | ||||
| @@ -65,7 +67,7 @@ code_style: | ||||
|         paths: | ||||
|             - .cache/ | ||||
|     artifacts: | ||||
|         expire_in: 30 min | ||||
|         expire_in: 1 day | ||||
|         paths: | ||||
|             - bin | ||||
|             - vendor/ | ||||
| @@ -79,7 +81,7 @@ phpstan_tests: | ||||
|         paths: | ||||
|             - .cache/ | ||||
|     artifacts: | ||||
|         expire_in: 30 min | ||||
|         expire_in: 1 day | ||||
|         paths: | ||||
|             - bin | ||||
|             - vendor/ | ||||
| @@ -94,7 +96,7 @@ rector_tests: | ||||
|         paths: | ||||
|             - .cache/ | ||||
|     artifacts: | ||||
|         expire_in: 30 min | ||||
|         expire_in: 1 day | ||||
|         paths: | ||||
|             - bin | ||||
|             - vendor/ | ||||
| @@ -121,7 +123,7 @@ unit_tests: | ||||
|         - php -d memory_limit=3G tests/console doctrine:fixtures:load -n | ||||
|         - php -d memory_limit=4G bin/phpunit --colors=never --exclude-group dbIntensive | ||||
|     artifacts: | ||||
|         expire_in: 30 min | ||||
|         expire_in: 1 day | ||||
|         paths: | ||||
|             - bin | ||||
|             - vendor/ | ||||
|   | ||||
| @@ -1,10 +1,14 @@ | ||||
| --- | ||||
| version: 2 | ||||
|  | ||||
| build: | ||||
|   os: ubuntu-22.04 | ||||
|   tools: | ||||
|     python: "3.7" | ||||
|  | ||||
| sphinx: | ||||
|   configuration: docs/source/conf.py | ||||
|  | ||||
| python: | ||||
|   version: 3.7 | ||||
|   install: | ||||
|     - requirements: docs/requirements.txt | ||||
|     - requirements: docs/requirements.txt | ||||
							
								
								
									
										100
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										100
									
								
								CHANGELOG.md
									
									
									
									
									
								
							| @@ -6,6 +6,106 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), | ||||
| and is generated by [Changie](https://github.com/miniscruff/changie). | ||||
|  | ||||
|  | ||||
| ## 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 | ||||
| ### Feature | ||||
| * ([#191](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/191)) Add export "number of household associate with an exchange"  | ||||
| * ([#235](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/235)) Export: add dates on the filter "filter course by activity type"  | ||||
| ### Fixed | ||||
| * ([#214](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/214)) Fix error when posting an empty comment on an accompanying period.  | ||||
| * ([#233](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/233)) Fix "filter evaluation by evaluation type" (and add select2 to the list of evaluation types to pick)  | ||||
| * ([#234](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/234)) Fix "filter aside activity by date" | ||||
|   | ||||
| * ([#228](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/228)) Fix export of activity for people created before the introduction of the createdAt column on person (during v1)  | ||||
| * ([#246](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/246)) Do not show activities, evaluations and social work when associated to a confidential accompanying period, except for the users which are allowed to see them  | ||||
|  | ||||
| ## v2.14.1 - 2023-11-29 | ||||
| ### Fixed | ||||
| * Export: fix list person with custom fields  | ||||
| * ([#100](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/100)) Add a paginator to budget elements (resource and charge types) in the admin  | ||||
| * Fix error in ListEvaluation when "handling agents" are alone  | ||||
|  | ||||
| ## v2.14.0 - 2023-11-24 | ||||
| ### Feature | ||||
| * ([#161](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/161)) Export: in filter "Filter accompanying period work (social action) by type, goal and result", order the items alphabetically or with the defined order  | ||||
| ### Fixed | ||||
| * ([#141](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/141)) Export: on filter "action by type goals, and results", restore the fields when editing a saved export  | ||||
| * ([#219](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/219)) Export: fix the list of accompanying period work, when the "calc date" is null  | ||||
| * ([#222](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/222)) Fix rendering of custom fields  | ||||
| * Fix various errors in custom fields administration  | ||||
|  | ||||
| ## v2.13.0 - 2023-11-21 | ||||
| ### Feature | ||||
| * ([#173](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/173)) Allow user to add a phonenumber to their profile which will be included in automatically generated documents | ||||
| ### Fixed | ||||
| * ([#211](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/211)) Export: fix loading of "Group activity by type" | ||||
| * ([#190](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/190)) Export: fix loading of "group activity by reasons" | ||||
| * ([#213](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/213)) Export: fix usage of some Collection returned instead of array in export filters | ||||
| * ([#215](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/215)) Use only the string 'both' for gender (with a database migration) | ||||
| * ([#212](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/212)) Clean the database to make working the "Group people by gender" aggregator | ||||
|  | ||||
| ## v2.12.1 - 2023-11-16 | ||||
| ### Fixed | ||||
| * ([#208](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/208)) Export: fix loading of form for "filter action by type, goal and result"  | ||||
|  | ||||
| ## v2.12.0 - 2023-11-15 | ||||
| ### Feature | ||||
| * ([#199](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/199)) Export: add an aggregator "group activities by presence" | ||||
| * ([#199](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/199)) Export: add a filter "filter activity by activity presence" | ||||
| * ([#199](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/199)) Export: add an aggregator "group activities by person" (only for the activities saved in a person context) | ||||
| * ([#199](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/199)) Export: add a new aggregator "group peoples by postal code" | ||||
| * ([#200](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/200)) Export: split export about person on accompanying period work: one with the people associated with the work, another one with the people associated with the accompanying period | ||||
| * ([#204](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/204)) Add 3 new filters and 3 new aggregators for work action creator (with jobs and scopes) | ||||
|  | ||||
| * ([#202](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/202)) Create export for the average duration of social work actions | ||||
| * ([#206](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/206)) Export: add a export which count persons on accompanying period work | ||||
| * ([#206](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/206)) Export: add an export which count persons on activity | ||||
| * ([#203](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/203)) Export: add clauses on the social work start date and end date within the filter "Filter accompanying period by accompanying period work" | ||||
| ### Fixed | ||||
| * Export: fix typo in filter "filter accompanying period work on end date" | ||||
| * ([#189](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/189)) Export: Fix failure in export linked to household | ||||
| * ([#205](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/205)) Fix loading of accompanying period work referrers | ||||
| ### Traduction francophone des principaux changements | ||||
| * export: ajout d'un regroupement "grouper les échanges par présence de l'usager"; | ||||
| * export: ajout d'un filtre "filtre les échanges par présence de l'usager"; | ||||
| * export: ajout d'un regroupement "regrouper les échanges par personne" (seulement pour les échanges enregistrés dans le contexte de l'usager); | ||||
| * export: ajout d'un regroupement "grouper les usagers par codes postaux" | ||||
| * export: séparation des exports sur les actions: dans l'un, les filtres des usagers portent sur les usagers concernés par l'action, dans l'autre, les filtres portent sur les usagers concernés par le parcours de l'action; | ||||
| * export: ajout de 3 nouveaux filtres et regroupements sur le créateur de l'action, son métier et son service; | ||||
| * export: correction de l'export sur les ménages liés aux parcours; | ||||
| * correction du chargement des actions d'accompagnement | ||||
|  | ||||
| ## v2.11.0 - 2023-11-07 | ||||
| ### Feature | ||||
| * ([#194](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/194)) Export: add a filter "filter activity by creator job"  | ||||
|   | ||||
| @@ -27,7 +27,7 @@ To compile this documentation : | ||||
| Contribute | ||||
| =========== | ||||
|  | ||||
| Issue tracker : https://git.framasoft.org/groups/Chill-project/issues | ||||
| Issue tracker : https://gitlab.com/Chill-Projet/chill-bundles/-/issues | ||||
|  | ||||
| Licence | ||||
| ======= | ||||
|   | ||||
| @@ -1,6 +1,7 @@ | ||||
| docutils==0.13.1 | ||||
| Pygments==2.2.0 | ||||
| sphinx==1.8.5 | ||||
| Jinja2<3.1 | ||||
| git+https://github.com/fabpot/sphinx-php.git@v2.0.2#egg_name=sphinx-php | ||||
| jsx-lexer===0.0.8 | ||||
| sphinx_rtd_theme==0.5.0 | ||||
|   | ||||
| @@ -48,8 +48,8 @@ Clone or download the chill-skeleton project and `cd` into the main directory. | ||||
|  | ||||
| .. code-block:: bash | ||||
|  | ||||
|    git clone https://gitlab.com/Chill-Projet/chill-skeleton-basic.git | ||||
|    cd chill-app | ||||
|    git clone https://gitea.champs-libres.be/Chill-project/chill-skeleton-basic.git | ||||
|    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. | ||||
|   | ||||
| @@ -5,72 +5,74 @@ Add condition with distinct alias on each export join clauses (Indicators + Filt | ||||
|  | ||||
| These are alias conventions : | ||||
|  | ||||
| | Entity                                  | Join                                    | Attribute                                  | Alias                                  | | ||||
| |:----------------------------------------|:----------------------------------------|:-------------------------------------------|:---------------------------------------| | ||||
| | AccompanyingPeriod::class               |                                         |                                            | acp                                    | | ||||
| |                                         | AccompanyingPeriodWork::class           | acp.works                                  | acpw                                   | | ||||
| |                                         | AccompanyingPeriodParticipation::class  | acp.participations                         | acppart                                | | ||||
| |                                         | Location::class                         | acp.administrativeLocation                 | acploc                                 | | ||||
| |                                         | ClosingMotive::class                    | acp.closingMotive                          | acpmotive                              | | ||||
| |                                         | UserJob::class                          | acp.job                                    | acpjob                                 | | ||||
| |                                         | Origin::class                           | acp.origin                                 | acporigin                              | | ||||
| |                                         | Scope::class                            | acp.scopes                                 | acpscope                               | | ||||
| |                                         | SocialIssue::class                      | acp.socialIssues                           | acpsocialissue                         | | ||||
| |                                         | User::class                             | acp.user                                   | acpuser                                | | ||||
| |                                         | AccompanyingPeriopStepHistory::class    | acp.stepHistories                          | acpstephistories                       | | ||||
| |                                         | AccompanyingPeriodInfo::class           | not existing (using custom WITH clause)    | acpinfo                                | | ||||
| | AccompanyingPeriodWork::class           |                                         |                                            | acpw                                   | | ||||
| |                                         | AccompanyingPeriodWorkEvaluation::class | acpw.accompanyingPeriodWorkEvaluations     | workeval                               | | ||||
| |                                         | SocialAction::class                     | acpw.socialAction                          | acpwsocialaction                       | | ||||
| |                                         | Goal::class                             | acpw.goals                                 | goal                                   | | ||||
| |                                         | Result::class                           | acpw.results                               | result                                 | | ||||
| | AccompanyingPeriodParticipation::class  |                                         |                                            | acppart                                | | ||||
| |                                         | Person::class                           | acppart.person                             | partperson                             | | ||||
| | AccompanyingPeriodWorkEvaluation::class |                                         |                                            | workeval                               | | ||||
| |                                         | Evaluation::class                       | workeval.evaluation                        | eval                                   | | ||||
| | AccompanyingPeriodInfo::class           |                                         |                                            | acpinfo                                | | ||||
| |                                         | User::class                             | acpinfo.user                               | acpinfo_user                           | | ||||
| | Goal::class                             |                                         |                                            | goal                                   | | ||||
| |                                         | Result::class                           | goal.results                               | goalresult                             | | ||||
| | Person::class                           |                                         |                                            | person                                 | | ||||
| |                                         | Center::class                           | person.center                              | center                                 | | ||||
| |                                         | HouseholdMember::class                  | partperson.householdParticipations         | householdmember                        | | ||||
| |                                         | MaritalStatus::class                    | person.maritalStatus                       | personmarital                          | | ||||
| |                                         | VendeePerson::class                     |                                            | vp                                     | | ||||
| |                                         | VendeePersonMineur::class               |                                            | vpm                                    | | ||||
| |                                         | CurrentPersonAddress::class             | person.currentPersonAddress                | currentPersonAddress (on a given date) | | ||||
| | ResidentialAddress::class               |                                         |                                            | resaddr                                | | ||||
| |                                         | ThirdParty::class                       | resaddr.hostThirdParty                     | tparty                                 | | ||||
| | ThirdParty::class                       |                                         |                                            | tparty                                 | | ||||
| |                                         | ThirdPartyCategory::class               | tparty.categories                          | tpartycat                              | | ||||
| | HouseholdMember::class                  |                                         |                                            | householdmember                        | | ||||
| |                                         | Household::class                        | householdmember.household                  | household                              | | ||||
| |                                         | Person::class                           | householdmember.person                     | memberperson                           | | ||||
| |                                         |                                         | memberperson.center                        | membercenter                           | | ||||
| | Household::class                        |                                         |                                            | household                              | | ||||
| |                                         | HouseholdComposition::class             | household.compositions                     | composition                            | | ||||
| | Activity::class                         |                                         |                                            | activity                               | | ||||
| |                                         | Person::class                           | activity.person                            | actperson                              | | ||||
| |                                         | AccompanyingPeriod::class               | activity.accompanyingPeriod                | acp                                    | | ||||
| |                                         | Person::class                           | activity\_person\_having\_activity.person  | person\_person\_having\_activity       | | ||||
| |                                         | ActivityReason::class                   | activity\_person\_having\_activity.reasons | reasons\_person\_having\_activity      | | ||||
| |                                         | ActivityType::class                     | activity.activityType                      | acttype                                | | ||||
| |                                         | Location::class                         | activity.location                          | actloc                                 | | ||||
| |                                         | SocialAction::class                     | activity.socialActions                     | actsocialaction                        | | ||||
| |                                         | SocialIssue::class                      | activity.socialIssues                      | actsocialssue                          | | ||||
| |                                         | ThirdParty::class                       | activity.thirdParties                      | acttparty                              | | ||||
| |                                         | User::class                             | activity.user                              | actuser                                | | ||||
| |                                         | User::class                             | activity.users                             | actusers                               | | ||||
| |                                         | ActivityReason::class                   | activity.reasons                           | actreasons                             | | ||||
| |                                         | Center::class                           | actperson.center                           | actcenter                              | | ||||
| |                                         | Person::class                           | activity.createdBy                         | actcreator                             | | ||||
| | ActivityReason::class                   |                                         |                                            | actreasons                             | | ||||
| |                                         | ActivityReasonCategory::class           | actreason.category                         | actreasoncat                           | | ||||
| | Calendar::class                         |                                         |                                            | cal                                    | | ||||
| |                                         | CancelReason::class                     | cal.cancelReason                           | calcancel                              | | ||||
| |                                         | Location::class                         | cal.location                               | calloc                                 | | ||||
| |                                         | User::class                             | cal.user                                   | caluser                                | | ||||
| | VendeePerson::class                     |                                         |                                            | vp                                     | | ||||
| |                                         | SituationProfessionelle::class          | vp.situationProfessionelle                 | vpprof                                 | | ||||
| |                                         | StatutLogement::class                   | vp.statutLogement                          | vplog                                  | | ||||
| |                                         | TempsDeTravail::class                   | vp.tempsDeTravail                          | vptt                                   | | ||||
| | Entity                                  | Join                                    | Attribute                                  | Alias                                      | | ||||
| |:----------------------------------------|:----------------------------------------|:-------------------------------------------|:-------------------------------------------| | ||||
| | AccompanyingPeriodStepHistory::class    |                                         |                                            | acpstephistory (contexte ACP_STEP_HISTORY) | | ||||
| |                                         | AccompanyingPeriod::class               | acpstephistory.period                      | acp                                        | | ||||
| | AccompanyingPeriod::class               |                                         |                                            | acp                                        | | ||||
| |                                         | AccompanyingPeriodWork::class           | acp.works                                  | acpw                                       | | ||||
| |                                         | AccompanyingPeriodParticipation::class  | acp.participations                         | acppart                                    | | ||||
| |                                         | Location::class                         | acp.administrativeLocation                 | acploc                                     | | ||||
| |                                         | ClosingMotive::class                    | acp.closingMotive                          | acpmotive                                  | | ||||
| |                                         | UserJob::class                          | acp.job                                    | acpjob                                     | | ||||
| |                                         | Origin::class                           | acp.origin                                 | acporigin                                  | | ||||
| |                                         | Scope::class                            | acp.scopes                                 | acpscope                                   | | ||||
| |                                         | SocialIssue::class                      | acp.socialIssues                           | acpsocialissue                             | | ||||
| |                                         | User::class                             | acp.user                                   | acpuser                                    | | ||||
| |                                         | AccompanyingPeriopStepHistory::class    | acp.stepHistories                          | acpstephistories                           | | ||||
| |                                         | AccompanyingPeriodInfo::class           | not existing (using custom WITH clause)    | acpinfo                                    | | ||||
| | AccompanyingPeriodWork::class           |                                         |                                            | acpw                                       | | ||||
| |                                         | AccompanyingPeriodWorkEvaluation::class | acpw.accompanyingPeriodWorkEvaluations     | workeval                                   | | ||||
| |                                         | SocialAction::class                     | acpw.socialAction                          | acpwsocialaction                           | | ||||
| |                                         | Goal::class                             | acpw.goals                                 | goal                                       | | ||||
| |                                         | Result::class                           | acpw.results                               | result                                     | | ||||
| | AccompanyingPeriodParticipation::class  |                                         |                                            | acppart                                    | | ||||
| |                                         | Person::class                           | acppart.person                             | partperson                                 | | ||||
| | AccompanyingPeriodWorkEvaluation::class |                                         |                                            | workeval                                   | | ||||
| |                                         | Evaluation::class                       | workeval.evaluation                        | eval                                       | | ||||
| | AccompanyingPeriodInfo::class           |                                         |                                            | acpinfo                                    | | ||||
| |                                         | User::class                             | acpinfo.user                               | acpinfo_user                               | | ||||
| | Goal::class                             |                                         |                                            | goal                                       | | ||||
| |                                         | Result::class                           | goal.results                               | goalresult                                 | | ||||
| | Person::class                           |                                         |                                            | person                                     | | ||||
| |                                         | Center::class                           | person.center                              | center                                     | | ||||
| |                                         | HouseholdMember::class                  | partperson.householdParticipations         | householdmember                            | | ||||
| |                                         | MaritalStatus::class                    | person.maritalStatus                       | personmarital                              | | ||||
| |                                         | VendeePerson::class                     |                                            | vp                                         | | ||||
| |                                         | VendeePersonMineur::class               |                                            | vpm                                        | | ||||
| |                                         | CurrentPersonAddress::class             | person.currentPersonAddress                | currentPersonAddress (on a given date)     | | ||||
| | ResidentialAddress::class               |                                         |                                            | resaddr                                    | | ||||
| |                                         | ThirdParty::class                       | resaddr.hostThirdParty                     | tparty                                     | | ||||
| | ThirdParty::class                       |                                         |                                            | tparty                                     | | ||||
| |                                         | ThirdPartyCategory::class               | tparty.categories                          | tpartycat                                  | | ||||
| | HouseholdMember::class                  |                                         |                                            | householdmember                            | | ||||
| |                                         | Household::class                        | householdmember.household                  | household                                  | | ||||
| |                                         | Person::class                           | householdmember.person                     | memberperson                               | | ||||
| |                                         |                                         | memberperson.center                        | membercenter                               | | ||||
| | Household::class                        |                                         |                                            | household                                  | | ||||
| |                                         | HouseholdComposition::class             | household.compositions                     | composition                                | | ||||
| | Activity::class                         |                                         |                                            | activity                                   | | ||||
| |                                         | Person::class                           | activity.person                            | actperson                                  | | ||||
| |                                         | AccompanyingPeriod::class               | activity.accompanyingPeriod                | acp                                        | | ||||
| |                                         | Person::class                           | activity\_person\_having\_activity.person  | person\_person\_having\_activity           | | ||||
| |                                         | ActivityReason::class                   | activity\_person\_having\_activity.reasons | reasons\_person\_having\_activity          | | ||||
| |                                         | ActivityType::class                     | activity.activityType                      | acttype                                    | | ||||
| |                                         | Location::class                         | activity.location                          | actloc                                     | | ||||
| |                                         | SocialAction::class                     | activity.socialActions                     | actsocialaction                            | | ||||
| |                                         | SocialIssue::class                      | activity.socialIssues                      | actsocialssue                              | | ||||
| |                                         | ThirdParty::class                       | activity.thirdParties                      | acttparty                                  | | ||||
| |                                         | User::class                             | activity.user                              | actuser                                    | | ||||
| |                                         | User::class                             | activity.users                             | actusers                                   | | ||||
| |                                         | ActivityReason::class                   | activity.reasons                           | actreasons                                 | | ||||
| |                                         | Center::class                           | actperson.center                           | actcenter                                  | | ||||
| |                                         | Person::class                           | activity.createdBy                         | actcreator                                 | | ||||
| | ActivityReason::class                   |                                         |                                            | actreasons                                 | | ||||
| |                                         | ActivityReasonCategory::class           | actreason.category                         | actreasoncat                               | | ||||
| | Calendar::class                         |                                         |                                            | cal                                        | | ||||
| |                                         | CancelReason::class                     | cal.cancelReason                           | calcancel                                  | | ||||
| |                                         | Location::class                         | cal.location                               | calloc                                     | | ||||
| |                                         | User::class                             | cal.user                                   | caluser                                    | | ||||
| | VendeePerson::class                     |                                         |                                            | vp                                         | | ||||
| |                                         | SituationProfessionelle::class          | vp.situationProfessionelle                 | vpprof                                     | | ||||
| |                                         | StatutLogement::class                   | vp.statutLogement                          | vplog                                      | | ||||
| |                                         | TempsDeTravail::class                   | vp.tempsDeTravail                          | vptt                                       | | ||||
|   | ||||
| @@ -15,7 +15,7 @@ | ||||
|     "@symfony/webpack-encore": "^4.1.0", | ||||
|     "@tsconfig/node14": "^1.0.1", | ||||
|     "bindings": "^1.5.0", | ||||
|     "bootstrap": "^5.0.1", | ||||
|     "bootstrap": "5.2.3", | ||||
|     "chokidar": "^3.5.1", | ||||
|     "fork-awesome": "^1.1.7", | ||||
|     "jquery": "^3.6.0", | ||||
|   | ||||
| @@ -28,3 +28,4 @@ Version 1.5.5 | ||||
|  | ||||
| - [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 | ||||
|  | ||||
|   | ||||
| @@ -13,4 +13,6 @@ namespace Chill\ActivityBundle; | ||||
|  | ||||
| use Symfony\Component\HttpKernel\Bundle\Bundle; | ||||
|  | ||||
| class ChillActivityBundle extends Bundle {} | ||||
| class ChillActivityBundle extends Bundle | ||||
| { | ||||
| } | ||||
|   | ||||
| @@ -67,7 +67,8 @@ final class ActivityController extends AbstractController | ||||
|         private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory, | ||||
|         private readonly TranslatableStringHelperInterface $translatableStringHelper, | ||||
|         private readonly PaginatorFactory $paginatorFactory, | ||||
|     ) {} | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Deletes a Activity entity. | ||||
| @@ -673,8 +674,8 @@ final class ActivityController extends AbstractController | ||||
|                 throw $this->createNotFoundException('Accompanying Period not found'); | ||||
|             } | ||||
|  | ||||
|         // TODO Add permission | ||||
|         // $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); | ||||
|             // TODO Add permission | ||||
|             // $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); | ||||
|         } else { | ||||
|             throw $this->createNotFoundException('Person or Accompanying Period not found'); | ||||
|         } | ||||
|   | ||||
| @@ -56,7 +56,7 @@ class ActivityReasonCategoryController extends AbstractController | ||||
|     { | ||||
|         $em = $this->getDoctrine()->getManager(); | ||||
|  | ||||
|         $entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->find($id); | ||||
|         $entity = $em->getRepository(ActivityReasonCategory::class)->find($id); | ||||
|  | ||||
|         if (!$entity) { | ||||
|             throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); | ||||
| @@ -79,7 +79,7 @@ class ActivityReasonCategoryController extends AbstractController | ||||
|     { | ||||
|         $em = $this->getDoctrine()->getManager(); | ||||
|  | ||||
|         $entities = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->findAll(); | ||||
|         $entities = $em->getRepository(ActivityReasonCategory::class)->findAll(); | ||||
|  | ||||
|         return $this->render('@ChillActivity/ActivityReasonCategory/index.html.twig', [ | ||||
|             'entities' => $entities, | ||||
| @@ -111,7 +111,7 @@ class ActivityReasonCategoryController extends AbstractController | ||||
|     { | ||||
|         $em = $this->getDoctrine()->getManager(); | ||||
|  | ||||
|         $entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->find($id); | ||||
|         $entity = $em->getRepository(ActivityReasonCategory::class)->find($id); | ||||
|  | ||||
|         if (!$entity) { | ||||
|             throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); | ||||
| @@ -131,7 +131,7 @@ class ActivityReasonCategoryController extends AbstractController | ||||
|     { | ||||
|         $em = $this->getDoctrine()->getManager(); | ||||
|  | ||||
|         $entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->find($id); | ||||
|         $entity = $em->getRepository(ActivityReasonCategory::class)->find($id); | ||||
|  | ||||
|         if (!$entity) { | ||||
|             throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); | ||||
|   | ||||
| @@ -24,7 +24,9 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | ||||
|  */ | ||||
| class ActivityReasonController extends AbstractController | ||||
| { | ||||
|     public function __construct(private readonly ActivityReasonRepository $activityReasonRepository) {} | ||||
|     public function __construct(private readonly ActivityReasonRepository $activityReasonRepository) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a new ActivityReason entity. | ||||
| @@ -60,7 +62,7 @@ class ActivityReasonController extends AbstractController | ||||
|     { | ||||
|         $em = $this->getDoctrine()->getManager(); | ||||
|  | ||||
|         $entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id); | ||||
|         $entity = $em->getRepository(ActivityReason::class)->find($id); | ||||
|  | ||||
|         if (null === $entity) { | ||||
|             throw new NotFoundHttpException('Unable to find ActivityReason entity.'); | ||||
| @@ -115,7 +117,7 @@ class ActivityReasonController extends AbstractController | ||||
|     { | ||||
|         $em = $this->getDoctrine()->getManager(); | ||||
|  | ||||
|         $entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id); | ||||
|         $entity = $em->getRepository(ActivityReason::class)->find($id); | ||||
|  | ||||
|         if (!$entity) { | ||||
|             throw $this->createNotFoundException('Unable to find ActivityReason entity.'); | ||||
| @@ -135,7 +137,7 @@ class ActivityReasonController extends AbstractController | ||||
|     { | ||||
|         $em = $this->getDoctrine()->getManager(); | ||||
|  | ||||
|         $entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id); | ||||
|         $entity = $em->getRepository(ActivityReason::class)->find($id); | ||||
|  | ||||
|         if (!$entity) { | ||||
|             throw $this->createNotFoundException('Unable to find ActivityReason entity.'); | ||||
|   | ||||
| @@ -291,7 +291,11 @@ class ActivityType | ||||
|     public function checkSocialActionsVisibility(ExecutionContextInterface $context, mixed $payload) | ||||
|     { | ||||
|         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 | ||||
|                     ->buildViolation('The socialActionsVisible value is not compatible with the socialIssuesVisible value') | ||||
|                     ->atPath('socialActionsVisible') | ||||
|   | ||||
| @@ -19,7 +19,9 @@ use Doctrine\ORM\EntityManagerInterface; | ||||
|  | ||||
| class ActivityEntityListener | ||||
| { | ||||
|     public function __construct(private readonly EntityManagerInterface $em, private readonly AccompanyingPeriodWorkRepository $workRepository) {} | ||||
|     public function __construct(private readonly EntityManagerInterface $em, private readonly AccompanyingPeriodWorkRepository $workRepository) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function persistActionToCourse(Activity $activity) | ||||
|     { | ||||
|   | ||||
| @@ -31,7 +31,8 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface | ||||
|         private RollingDateConverterInterface $rollingDateConverter, | ||||
|         private ActivityTypeRepositoryInterface $activityTypeRepository, | ||||
|         private TranslatableStringHelperInterface $translatableStringHelper, | ||||
|     ) {} | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     public function buildForm(FormBuilderInterface $builder) | ||||
|     { | ||||
| @@ -56,7 +57,7 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface | ||||
|  | ||||
|     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) { | ||||
|                 return 'export.aggregator.acp.by_activity_type.activity_type'; | ||||
|             } | ||||
|   | ||||
| @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| class BySocialActionAggregator implements AggregatorInterface | ||||
| { | ||||
|     public function __construct(private readonly SocialActionRender $actionRender, private readonly SocialActionRepository $actionRepository) {} | ||||
|     public function __construct(private readonly SocialActionRender $actionRender, private readonly SocialActionRepository $actionRepository) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| class BySocialIssueAggregator implements AggregatorInterface | ||||
| { | ||||
|     public function __construct(private readonly SocialIssueRepository $issueRepository, private readonly SocialIssueRender $issueRender) {} | ||||
|     public function __construct(private readonly SocialIssueRepository $issueRepository, private readonly SocialIssueRender $issueRender) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -20,9 +20,13 @@ use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| final readonly class ActivityPresenceAggregator implements AggregatorInterface | ||||
| { | ||||
|     public function __construct(private ActivityPresenceRepositoryInterface $activityPresenceRepository, private TranslatableStringHelperInterface $translatableStringHelper) {} | ||||
|     public function __construct(private ActivityPresenceRepositoryInterface $activityPresenceRepository, private TranslatableStringHelperInterface $translatableStringHelper) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function buildForm(FormBuilderInterface $builder) {} | ||||
|     public function buildForm(FormBuilderInterface $builder) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function getFormDefaultData(): array | ||||
|     { | ||||
| @@ -31,7 +35,7 @@ final readonly class ActivityPresenceAggregator implements AggregatorInterface | ||||
|  | ||||
|     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) { | ||||
|                 return 'export.aggregator.activity.by_activity_presence.header'; | ||||
|             } | ||||
|   | ||||
| @@ -9,7 +9,7 @@ declare(strict_types=1); | ||||
|  * 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\Repository\ActivityReasonCategoryRepository; | ||||
| @@ -25,7 +25,12 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; | ||||
| 
 | ||||
| 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 | ||||
|     { | ||||
| @@ -49,7 +54,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali | ||||
| 
 | ||||
|         // make a jointure only if needed
 | ||||
|         if (!\in_array('actreasons', $qb->getAllAliases(), true)) { | ||||
|             $qb->innerJoin('activity.reasons', 'actreasons'); | ||||
|             $qb->leftJoin('activity.reasons', 'actreasons'); | ||||
|         } | ||||
| 
 | ||||
|         // join category if necessary
 | ||||
| @@ -60,19 +65,12 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         // add the "group by" part
 | ||||
|         $groupBy = $qb->getDQLPart('groupBy'); | ||||
| 
 | ||||
|         if (\count($groupBy) > 0) { | ||||
|             $qb->addGroupBy($alias); | ||||
|         } else { | ||||
|             $qb->groupBy($alias); | ||||
|         } | ||||
|         $qb->addGroupBy($alias); | ||||
|     } | ||||
| 
 | ||||
|     public function applyOn(): string | ||||
|     { | ||||
|         return Declarations::ACTIVITY_PERSON; | ||||
|         return Declarations::ACTIVITY; | ||||
|     } | ||||
| 
 | ||||
|     public function buildForm(FormBuilderInterface $builder) | ||||
| @@ -94,17 +92,13 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali | ||||
| 
 | ||||
|     public function getFormDefaultData(): array | ||||
|     { | ||||
|         return []; | ||||
|         return [ | ||||
|             'level' => 'reasons', | ||||
|         ]; | ||||
|     } | ||||
| 
 | ||||
|     public function getLabels($key, array $values, $data) | ||||
|     { | ||||
|         match ($data['level']) { | ||||
|             'reasons' => $this->activityReasonRepository->findBy(['id' => $values]), | ||||
|             'categories' => $this->activityReasonCategoryRepository->findBy(['id' => $values]), | ||||
|             default => throw new \RuntimeException(sprintf("The level data '%s' is invalid.", $data['level'])), | ||||
|         }; | ||||
| 
 | ||||
|         return function ($value) use ($data) { | ||||
|             if ('_header' === $value) { | ||||
|                 return 'reasons' === $data['level'] ? 'Group by reasons' : 'Group by categories of reason'; | ||||
| @@ -22,7 +22,9 @@ class ActivityTypeAggregator implements AggregatorInterface | ||||
| { | ||||
|     final public const KEY = 'activity_type_aggregator'; | ||||
|  | ||||
|     public function __construct(protected ActivityTypeRepositoryInterface $activityTypeRepository, protected TranslatableStringHelperInterface $translatableStringHelper) {} | ||||
|     public function __construct(protected ActivityTypeRepositoryInterface $activityTypeRepository, protected TranslatableStringHelperInterface $translatableStringHelper) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
| @@ -56,20 +58,15 @@ class ActivityTypeAggregator implements AggregatorInterface | ||||
|  | ||||
|     public function getLabels($key, array $values, $data): \Closure | ||||
|     { | ||||
|         // for performance reason, we load data from db only once | ||||
|         $this->activityTypeRepository->findBy(['id' => $values]); | ||||
|  | ||||
|         return function ($value): string { | ||||
|         return function (int|string|null $value): string { | ||||
|             if ('_header' === $value) { | ||||
|                 return 'Activity type'; | ||||
|             } | ||||
|  | ||||
|             if (null === $value || '' === $value) { | ||||
|             if (null === $value || '' === $value || null === $t = $this->activityTypeRepository->find($value)) { | ||||
|                 return ''; | ||||
|             } | ||||
|  | ||||
|             $t = $this->activityTypeRepository->find($value); | ||||
|  | ||||
|             return $this->translatableStringHelper->localize($t->getName()); | ||||
|         }; | ||||
|     } | ||||
|   | ||||
| @@ -22,7 +22,9 @@ class ActivityUserAggregator implements AggregatorInterface | ||||
| { | ||||
|     final public const KEY = 'activity_user_id'; | ||||
|  | ||||
|     public function __construct(private readonly UserRepository $userRepository, private readonly UserRender $userRender) {} | ||||
|     public function __construct(private readonly UserRepository $userRepository, private readonly UserRender $userRender) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| class ActivityUsersAggregator implements AggregatorInterface | ||||
| { | ||||
|     public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) {} | ||||
|     public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -27,7 +27,8 @@ class ActivityUsersJobAggregator implements AggregatorInterface | ||||
|     public function __construct( | ||||
|         private readonly UserJobRepositoryInterface $userJobRepository, | ||||
|         private readonly TranslatableStringHelperInterface $translatableStringHelper | ||||
|     ) {} | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
| @@ -65,7 +66,9 @@ class ActivityUsersJobAggregator implements AggregatorInterface | ||||
|         return Declarations::ACTIVITY; | ||||
|     } | ||||
|  | ||||
|     public function buildForm(FormBuilderInterface $builder) {} | ||||
|     public function buildForm(FormBuilderInterface $builder) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function getFormDefaultData(): array | ||||
|     { | ||||
|   | ||||
| @@ -27,7 +27,8 @@ class ActivityUsersScopeAggregator implements AggregatorInterface | ||||
|     public function __construct( | ||||
|         private readonly ScopeRepositoryInterface $scopeRepository, | ||||
|         private readonly TranslatableStringHelperInterface $translatableStringHelper | ||||
|     ) {} | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
| @@ -65,7 +66,9 @@ class ActivityUsersScopeAggregator implements AggregatorInterface | ||||
|         return Declarations::ACTIVITY; | ||||
|     } | ||||
|  | ||||
|     public function buildForm(FormBuilderInterface $builder) {} | ||||
|     public function buildForm(FormBuilderInterface $builder) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function getFormDefaultData(): array | ||||
|     { | ||||
|   | ||||
| @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| class ByCreatorAggregator implements AggregatorInterface | ||||
| { | ||||
|     public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) {} | ||||
|     public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| class ByThirdpartyAggregator implements AggregatorInterface | ||||
| { | ||||
|     public function __construct(private readonly ThirdPartyRepository $thirdPartyRepository, private readonly ThirdPartyRender $thirdPartyRender) {} | ||||
|     public function __construct(private readonly ThirdPartyRepository $thirdPartyRepository, private readonly ThirdPartyRender $thirdPartyRender) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -27,7 +27,8 @@ class CreatorJobAggregator implements AggregatorInterface | ||||
|     public function __construct( | ||||
|         private readonly UserJobRepositoryInterface $userJobRepository, | ||||
|         private readonly TranslatableStringHelper $translatableStringHelper | ||||
|     ) {} | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
| @@ -65,7 +66,9 @@ class CreatorJobAggregator implements AggregatorInterface | ||||
|         return Declarations::ACTIVITY; | ||||
|     } | ||||
|  | ||||
|     public function buildForm(FormBuilderInterface $builder) {} | ||||
|     public function buildForm(FormBuilderInterface $builder) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function getFormDefaultData(): array | ||||
|     { | ||||
|   | ||||
| @@ -27,7 +27,8 @@ class CreatorScopeAggregator implements AggregatorInterface | ||||
|     public function __construct( | ||||
|         private readonly ScopeRepository $scopeRepository, | ||||
|         private readonly TranslatableStringHelper $translatableStringHelper | ||||
|     ) {} | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
| @@ -65,7 +66,9 @@ class CreatorScopeAggregator implements AggregatorInterface | ||||
|         return Declarations::ACTIVITY; | ||||
|     } | ||||
|  | ||||
|     public function buildForm(FormBuilderInterface $builder) {} | ||||
|     public function buildForm(FormBuilderInterface $builder) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function getFormDefaultData(): array | ||||
|     { | ||||
|   | ||||
| @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| class LocationTypeAggregator implements AggregatorInterface | ||||
| { | ||||
|     public function __construct(private readonly LocationTypeRepository $locationTypeRepository, private readonly TranslatableStringHelper $translatableStringHelper) {} | ||||
|     public function __construct(private readonly LocationTypeRepository $locationTypeRepository, private readonly TranslatableStringHelper $translatableStringHelper) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -19,7 +19,9 @@ use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| final readonly class PersonAggregator implements AggregatorInterface | ||||
| { | ||||
|     public function __construct(private LabelPersonHelper $labelPersonHelper) {} | ||||
|     public function __construct(private LabelPersonHelper $labelPersonHelper) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function buildForm(FormBuilderInterface $builder) | ||||
|     { | ||||
|   | ||||
| @@ -25,7 +25,9 @@ final readonly class PersonsAggregator implements AggregatorInterface | ||||
| { | ||||
|     private const PREFIX = 'act_persons_agg'; | ||||
|  | ||||
|     public function __construct(private LabelPersonHelper $labelPersonHelper) {} | ||||
|     public function __construct(private LabelPersonHelper $labelPersonHelper) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function buildForm(FormBuilderInterface $builder) | ||||
|     { | ||||
|   | ||||
| @@ -19,7 +19,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; | ||||
|  | ||||
| class SentReceivedAggregator implements AggregatorInterface | ||||
| { | ||||
|     public function __construct(private readonly TranslatorInterface $translator) {} | ||||
|     public function __construct(private readonly TranslatorInterface $translator) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -36,7 +36,9 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface | ||||
|         $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; | ||||
|     } | ||||
|  | ||||
|     public function buildForm(FormBuilderInterface $builder) {} | ||||
|     public function buildForm(FormBuilderInterface $builder) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function getFormDefaultData(): array | ||||
|     { | ||||
|   | ||||
| @@ -41,7 +41,9 @@ class CountActivity implements ExportInterface, GroupedExportInterface | ||||
|         $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; | ||||
|     } | ||||
|  | ||||
|     public function buildForm(FormBuilderInterface $builder) {} | ||||
|     public function buildForm(FormBuilderInterface $builder) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function getFormDefaultData(): array | ||||
|     { | ||||
|   | ||||
| @@ -0,0 +1,149 @@ | ||||
| <?php | ||||
|  | ||||
| declare(strict_types=1); | ||||
|  | ||||
| /* | ||||
|  * Chill is a software for social workers | ||||
|  * | ||||
|  * For the full copyright and license information, please view | ||||
|  * the LICENSE file that was distributed with this source code. | ||||
|  */ | ||||
|  | ||||
| namespace Chill\ActivityBundle\Export\Export\LinkedToACP; | ||||
|  | ||||
| use Chill\ActivityBundle\Entity\Activity; | ||||
| use Chill\ActivityBundle\Export\Declarations; | ||||
| use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; | ||||
| use Chill\MainBundle\Export\AccompanyingCourseExportHelper; | ||||
| use Chill\MainBundle\Export\ExportInterface; | ||||
| use Chill\MainBundle\Export\FormatterInterface; | ||||
| use Chill\MainBundle\Export\GroupedExportInterface; | ||||
| use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation; | ||||
| use Chill\PersonBundle\Entity\Household\HouseholdMember; | ||||
| use Chill\PersonBundle\Entity\Person\PersonCenterHistory; | ||||
| use Chill\PersonBundle\Export\Declarations as PersonDeclarations; | ||||
| use Doctrine\ORM\EntityManagerInterface; | ||||
| use Doctrine\ORM\EntityRepository; | ||||
| use Doctrine\ORM\Query; | ||||
| use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; | ||||
| use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| final readonly class CountHouseholdOnActivity implements ExportInterface, GroupedExportInterface | ||||
| { | ||||
|     private EntityRepository $repository; | ||||
|  | ||||
|     private bool $filterStatsByCenters; | ||||
|  | ||||
|     public function __construct( | ||||
|         EntityManagerInterface $em, | ||||
|         ParameterBagInterface $parameterBag, | ||||
|     ) { | ||||
|         $this->repository = $em->getRepository(Activity::class); | ||||
|         $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; | ||||
|     } | ||||
|  | ||||
|     public function buildForm(FormBuilderInterface $builder) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function getFormDefaultData(): array | ||||
|     { | ||||
|         return []; | ||||
|     } | ||||
|  | ||||
|     public function getAllowedFormattersTypes(): array | ||||
|     { | ||||
|         return [FormatterInterface::TYPE_TABULAR]; | ||||
|     } | ||||
|  | ||||
|     public function getDescription(): string | ||||
|     { | ||||
|         return 'export.export.count_household_on_activity.description'; | ||||
|     } | ||||
|  | ||||
|     public function getGroup(): string | ||||
|     { | ||||
|         return 'Exports of activities linked to an accompanying period'; | ||||
|     } | ||||
|  | ||||
|     public function getLabels($key, array $values, $data) | ||||
|     { | ||||
|         if ('export_count_activity' !== $key) { | ||||
|             throw new \LogicException("the key {$key} is not used by this export"); | ||||
|         } | ||||
|  | ||||
|         return static fn ($value) => '_header' === $value ? 'export.export.count_household_on_activity.header' : $value; | ||||
|     } | ||||
|  | ||||
|     public function getQueryKeys($data): array | ||||
|     { | ||||
|         return ['export_count_activity']; | ||||
|     } | ||||
|  | ||||
|     public function getResult($query, $data) | ||||
|     { | ||||
|         return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); | ||||
|     } | ||||
|  | ||||
|     public function getTitle(): string | ||||
|     { | ||||
|         return 'export.export.count_household_on_activity.title'; | ||||
|     } | ||||
|  | ||||
|     public function getType(): string | ||||
|     { | ||||
|         return Declarations::ACTIVITY; | ||||
|     } | ||||
|  | ||||
|     public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) | ||||
|     { | ||||
|         $centers = array_map(static fn ($el) => $el['center'], $acl); | ||||
|  | ||||
|         $qb = $this->repository | ||||
|             ->createQueryBuilder('activity') | ||||
|             ->join('activity.persons', 'person') | ||||
|             ->join('activity.accompanyingPeriod', 'acp') | ||||
|             ->join( | ||||
|                 HouseholdMember::class, | ||||
|                 'householdmember', | ||||
|                 Query\Expr\Join::WITH, | ||||
|                 'person.id = IDENTITY(householdmember.person) AND householdmember.startDate <= activity.date AND (householdmember.endDate IS NULL OR householdmember.endDate > activity.date)' | ||||
|             ) | ||||
|             ->join('householdmember.household', 'household'); | ||||
|  | ||||
|         if ($this->filterStatsByCenters) { | ||||
|             $qb | ||||
|                 ->andWhere( | ||||
|                     $qb->expr()->exists( | ||||
|                         'SELECT 1 FROM '.AccompanyingPeriodParticipation::class.' acl_count_part | ||||
|                     JOIN '.PersonCenterHistory::class.' acl_count_person_history WITH IDENTITY(acl_count_person_history.person) = IDENTITY(acl_count_part.person) | ||||
|                     WHERE acl_count_part.accompanyingPeriod = acp.id AND acl_count_person_history.center IN (:authorized_centers) | ||||
|                     ' | ||||
|                     ) | ||||
|                 ) | ||||
|                 ->setParameter('authorized_centers', $centers); | ||||
|         } | ||||
|  | ||||
|         AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb); | ||||
|  | ||||
|         $qb->select('COUNT(DISTINCT household.id) as export_count_activity'); | ||||
|  | ||||
|         return $qb; | ||||
|     } | ||||
|  | ||||
|     public function requiredRole(): string | ||||
|     { | ||||
|         return ActivityStatsVoter::STATS; | ||||
|     } | ||||
|  | ||||
|     public function supportsModifiers(): array | ||||
|     { | ||||
|         return [ | ||||
|             Declarations::ACTIVITY, | ||||
|             Declarations::ACTIVITY_ACP, | ||||
|             PersonDeclarations::ACP_TYPE, | ||||
|             PersonDeclarations::PERSON_TYPE, | ||||
|             PersonDeclarations::HOUSEHOLD_TYPE, | ||||
|         ]; | ||||
|     } | ||||
| } | ||||
| @@ -41,7 +41,9 @@ class CountPersonsOnActivity implements ExportInterface, GroupedExportInterface | ||||
|         $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; | ||||
|     } | ||||
|  | ||||
|     public function buildForm(FormBuilderInterface $builder) {} | ||||
|     public function buildForm(FormBuilderInterface $builder) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function getFormDefaultData(): array | ||||
|     { | ||||
|   | ||||
| @@ -20,22 +20,18 @@ use Chill\MainBundle\Export\AccompanyingCourseExportHelper; | ||||
| use Chill\MainBundle\Export\GroupedExportInterface; | ||||
| use Chill\MainBundle\Export\Helper\TranslatableStringExportLabelHelper; | ||||
| use Chill\MainBundle\Export\ListInterface; | ||||
| use Chill\PersonBundle\Entity\Person\PersonCenterHistory; | ||||
| use Chill\PersonBundle\Export\Helper\FilterListAccompanyingPeriodHelperInterface; | ||||
| use Doctrine\ORM\EntityManagerInterface; | ||||
| use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; | ||||
| use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| class ListActivity implements ListInterface, GroupedExportInterface | ||||
| final readonly class ListActivity implements ListInterface, GroupedExportInterface | ||||
| { | ||||
|     private readonly bool $filterStatsByCenters; | ||||
|  | ||||
|     public function __construct( | ||||
|         private readonly ListActivityHelper $helper, | ||||
|         private readonly EntityManagerInterface $entityManager, | ||||
|         private readonly TranslatableStringExportLabelHelper $translatableStringExportLabelHelper, | ||||
|         ParameterBagInterface $parameterBag, | ||||
|         private ListActivityHelper $helper, | ||||
|         private EntityManagerInterface $entityManager, | ||||
|         private TranslatableStringExportLabelHelper $translatableStringExportLabelHelper, | ||||
|         private FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper, | ||||
|     ) { | ||||
|         $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; | ||||
|     } | ||||
|  | ||||
|     public function buildForm(FormBuilderInterface $builder) | ||||
| @@ -119,19 +115,7 @@ class ListActivity implements ListInterface, GroupedExportInterface | ||||
|             ->leftJoin('acppart.person', 'person') | ||||
|             ->andWhere('acppart.startDate != acppart.endDate OR acppart.endDate IS NULL'); | ||||
|  | ||||
|         if ($this->filterStatsByCenters) { | ||||
|             $qb | ||||
|                 ->andWhere( | ||||
|                     $qb->expr()->exists( | ||||
|                         'SELECT 1 | ||||
|                     FROM '.PersonCenterHistory::class.' acl_count_person_history | ||||
|                     WHERE acl_count_person_history.person = person | ||||
|                     AND acl_count_person_history.center IN (:authorized_centers) | ||||
|                     ' | ||||
|                     ) | ||||
|                 ) | ||||
|                 ->setParameter('authorized_centers', $centers); | ||||
|         } | ||||
|         $this->filterListAccompanyingPeriodHelper->addFilterAccompanyingPeriods($qb, $requiredModifiers, $acl, $data); | ||||
|  | ||||
|         $qb | ||||
|             // some grouping are necessary | ||||
|   | ||||
| @@ -33,7 +33,9 @@ class CountActivity implements ExportInterface, GroupedExportInterface | ||||
|         $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; | ||||
|     } | ||||
|  | ||||
|     public function buildForm(FormBuilderInterface $builder) {} | ||||
|     public function buildForm(FormBuilderInterface $builder) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function getFormDefaultData(): array | ||||
|     { | ||||
|   | ||||
| @@ -0,0 +1,140 @@ | ||||
| <?php | ||||
|  | ||||
| declare(strict_types=1); | ||||
|  | ||||
| /* | ||||
|  * Chill is a software for social workers | ||||
|  * | ||||
|  * For the full copyright and license information, please view | ||||
|  * the LICENSE file that was distributed with this source code. | ||||
|  */ | ||||
|  | ||||
| namespace Chill\ActivityBundle\Export\Export\LinkedToPerson; | ||||
|  | ||||
| use Chill\ActivityBundle\Export\Declarations; | ||||
| use Chill\ActivityBundle\Repository\ActivityRepository; | ||||
| use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; | ||||
| use Chill\MainBundle\Export\ExportInterface; | ||||
| use Chill\MainBundle\Export\FormatterInterface; | ||||
| use Chill\MainBundle\Export\GroupedExportInterface; | ||||
| use Chill\PersonBundle\Entity\Household\HouseholdMember; | ||||
| use Chill\PersonBundle\Export\Declarations as PersonDeclarations; | ||||
| use Doctrine\ORM\Query; | ||||
| use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; | ||||
| use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| final readonly class CountHouseholdOnActivity implements ExportInterface, GroupedExportInterface | ||||
| { | ||||
|     private bool $filterStatsByCenters; | ||||
|  | ||||
|     public function __construct( | ||||
|         private ActivityRepository $activityRepository, | ||||
|         ParameterBagInterface $parameterBag, | ||||
|     ) { | ||||
|         $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; | ||||
|     } | ||||
|  | ||||
|     public function buildForm(FormBuilderInterface $builder) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function getFormDefaultData(): array | ||||
|     { | ||||
|         return []; | ||||
|     } | ||||
|  | ||||
|     public function getAllowedFormattersTypes() | ||||
|     { | ||||
|         return [FormatterInterface::TYPE_TABULAR]; | ||||
|     } | ||||
|  | ||||
|     public function getDescription() | ||||
|     { | ||||
|         return 'export.export.count_household_on_activity_person.description'; | ||||
|     } | ||||
|  | ||||
|     public function getGroup(): string | ||||
|     { | ||||
|         return 'Exports of activities linked to a person'; | ||||
|     } | ||||
|  | ||||
|     public function getLabels($key, array $values, $data) | ||||
|     { | ||||
|         if ('export_count_activity' !== $key) { | ||||
|             throw new \LogicException("the key {$key} is not used by this export"); | ||||
|         } | ||||
|  | ||||
|         return static fn ($value) => '_header' === $value ? 'export.export.count_household_on_activity_person.header' : $value; | ||||
|     } | ||||
|  | ||||
|     public function getQueryKeys($data) | ||||
|     { | ||||
|         return ['export_count_activity']; | ||||
|     } | ||||
|  | ||||
|     public function getResult($query, $data) | ||||
|     { | ||||
|         return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); | ||||
|     } | ||||
|  | ||||
|     public function getTitle() | ||||
|     { | ||||
|         return 'export.export.count_household_on_activity_person.title'; | ||||
|     } | ||||
|  | ||||
|     public function getType(): string | ||||
|     { | ||||
|         return Declarations::ACTIVITY; | ||||
|     } | ||||
|  | ||||
|     public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) | ||||
|     { | ||||
|         $centers = array_map(static fn ($el) => $el['center'], $acl); | ||||
|  | ||||
|         $qb = $this->activityRepository | ||||
|             ->createQueryBuilder('activity') | ||||
|             ->join('activity.person', 'person') | ||||
|             ->join( | ||||
|                 HouseholdMember::class, | ||||
|                 'householdmember', | ||||
|                 Query\Expr\Join::WITH, | ||||
|                 'person = householdmember.person AND householdmember.startDate <= activity.date AND (householdmember.endDate IS NULL OR householdmember.endDate > activity.date)' | ||||
|             ) | ||||
|             ->join('householdmember.household', 'household'); | ||||
|  | ||||
|         $qb->select('COUNT(DISTINCT household.id) as export_count_activity'); | ||||
|  | ||||
|         if ($this->filterStatsByCenters) { | ||||
|             $qb | ||||
|                 ->join('person.centerHistory', 'centerHistory') | ||||
|                 ->where( | ||||
|                     $qb->expr()->andX( | ||||
|                         $qb->expr()->lte('centerHistory.startDate', 'activity.date'), | ||||
|                         $qb->expr()->orX( | ||||
|                             $qb->expr()->isNull('centerHistory.endDate'), | ||||
|                             $qb->expr()->gt('centerHistory.endDate', 'activity.date') | ||||
|                         ) | ||||
|                     ) | ||||
|                 ) | ||||
|                 ->andWhere($qb->expr()->in('centerHistory.center', ':centers')) | ||||
|                 ->setParameter('centers', $centers); | ||||
|         } | ||||
|  | ||||
|         return $qb; | ||||
|     } | ||||
|  | ||||
|     public function requiredRole(): string | ||||
|     { | ||||
|         return ActivityStatsVoter::STATS; | ||||
|     } | ||||
|  | ||||
|     public function supportsModifiers() | ||||
|     { | ||||
|         return [ | ||||
|             Declarations::ACTIVITY, | ||||
|             Declarations::ACTIVITY_PERSON, | ||||
|             PersonDeclarations::PERSON_TYPE, | ||||
|             PersonDeclarations::HOUSEHOLD_TYPE, | ||||
|         ]; | ||||
|     } | ||||
| } | ||||
| @@ -47,7 +47,9 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface | ||||
|         $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; | ||||
|     } | ||||
|  | ||||
|     public function buildForm(FormBuilderInterface $builder) {} | ||||
|     public function buildForm(FormBuilderInterface $builder) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function getFormDefaultData(): array | ||||
|     { | ||||
|   | ||||
| @@ -40,7 +40,8 @@ class ListActivityHelper | ||||
|         private readonly TranslatableStringHelperInterface $translatableStringHelper, | ||||
|         private readonly TranslatableStringExportLabelHelper $translatableStringLabelHelper, | ||||
|         private readonly UserHelper $userHelper | ||||
|     ) {} | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     public function addSelect(QueryBuilder $qb): void | ||||
|     { | ||||
| @@ -74,7 +75,9 @@ class ListActivityHelper | ||||
|             ->addGroupBy('location.id'); | ||||
|     } | ||||
|  | ||||
|     public function buildForm(FormBuilderInterface $builder) {} | ||||
|     public function buildForm(FormBuilderInterface $builder) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function getAllowedFormattersTypes() | ||||
|     { | ||||
|   | ||||
| @@ -15,18 +15,24 @@ use Chill\ActivityBundle\Entity\Activity; | ||||
| use Chill\ActivityBundle\Entity\ActivityType; | ||||
| use Chill\ActivityBundle\Repository\ActivityTypeRepositoryInterface; | ||||
| use Chill\MainBundle\Export\FilterInterface; | ||||
| use Chill\MainBundle\Form\Type\PickRollingDateType; | ||||
| use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface; | ||||
| use Chill\MainBundle\Templating\TranslatableStringHelperInterface; | ||||
| use Chill\PersonBundle\Export\Declarations; | ||||
| use Doctrine\ORM\QueryBuilder; | ||||
| use Symfony\Bridge\Doctrine\Form\Type\EntityType; | ||||
| use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| class ActivityTypeFilter implements FilterInterface | ||||
| final readonly class ActivityTypeFilter implements FilterInterface | ||||
| { | ||||
|     private const BASE_EXISTS = 'SELECT 1 FROM '.Activity::class.' act_type_filter_activity WHERE act_type_filter_activity.accompanyingPeriod = acp'; | ||||
|  | ||||
|     public function __construct( | ||||
|         private readonly ActivityTypeRepositoryInterface $activityTypeRepository, | ||||
|         private readonly TranslatableStringHelperInterface $translatableStringHelper | ||||
|     ) {} | ||||
|         private ActivityTypeRepositoryInterface $activityTypeRepository, | ||||
|         private TranslatableStringHelperInterface $translatableStringHelper, | ||||
|         private RollingDateConverterInterface $rollingDateConverter, | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
| @@ -35,13 +41,26 @@ class ActivityTypeFilter implements FilterInterface | ||||
|  | ||||
|     public function alterQuery(QueryBuilder $qb, $data) | ||||
|     { | ||||
|         $qb->andWhere( | ||||
|             $qb->expr()->exists( | ||||
|                 'SELECT 1 FROM '.Activity::class.' act_type_filter_activity | ||||
|                 WHERE act_type_filter_activity.activityType IN (:act_type_filter_activity_types) AND act_type_filter_activity.accompanyingPeriod = acp' | ||||
|             ) | ||||
|         ); | ||||
|         $qb->setParameter('act_type_filter_activity_types', $data['accepted_activitytypes']); | ||||
|         $exists = self::BASE_EXISTS; | ||||
|  | ||||
|         if (count($data['accepted_activitytypes']) > 0) { | ||||
|             $exists .= ' AND act_type_filter_activity.activityType IN (:act_type_filter_activity_types)'; | ||||
|             $qb->setParameter('act_type_filter_activity_types', $data['accepted_activitytypes']); | ||||
|         } | ||||
|  | ||||
|         if (null !== $data['date_after']) { | ||||
|             $exists .= ' AND act_type_filter_activity.date >= :act_type_filter_activity_date_after'; | ||||
|             $qb->setParameter('act_type_filter_activity_date_after', $this->rollingDateConverter->convert($data['date_after'])); | ||||
|         } | ||||
|  | ||||
|         if (null !== $data['date_before']) { | ||||
|             $exists .= ' AND act_type_filter_activity.date >= :act_type_filter_activity_date_before'; | ||||
|             $qb->setParameter('act_type_filter_activity_date_before', $this->rollingDateConverter->convert($data['date_before'])); | ||||
|         } | ||||
|  | ||||
|         if (self::BASE_EXISTS !== $exists) { | ||||
|             $qb->andWhere($qb->expr()->exists($exists)); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public function applyOn() | ||||
| @@ -60,11 +79,27 @@ class ActivityTypeFilter implements FilterInterface | ||||
|             'multiple' => true, | ||||
|             'expanded' => true, | ||||
|         ]); | ||||
|  | ||||
|         $builder->add('date_after', PickRollingDateType::class, [ | ||||
|             'label' => 'export.filter.activity.acp_by_activity_type.activity after', | ||||
|             'help' => 'export.filter.activity.acp_by_activity_type.activity after help', | ||||
|             'required' => false, | ||||
|         ]); | ||||
|  | ||||
|         $builder->add('date_before', PickRollingDateType::class, [ | ||||
|             'label' => 'export.filter.activity.acp_by_activity_type.activity before', | ||||
|             'help' => 'export.filter.activity.acp_by_activity_type.activity before help', | ||||
|             'required' => false, | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     public function getFormDefaultData(): array | ||||
|     { | ||||
|         return []; | ||||
|         return [ | ||||
|             'accepted_activitytypes' => [], | ||||
|             'date_after' => null, | ||||
|             'date_before' => null, | ||||
|         ]; | ||||
|     } | ||||
|  | ||||
|     public function describeAction($data, $format = 'string'): array | ||||
| @@ -75,8 +110,12 @@ class ActivityTypeFilter implements FilterInterface | ||||
|             $types[] = $this->translatableStringHelper->localize($aty->getName()); | ||||
|         } | ||||
|  | ||||
|         return ['export.filter.activity.acp_by_activity_type.acp_containing_at_least_one_%activitytypes%', [ | ||||
|             '%activitytypes%' => implode(', ', $types), | ||||
|         return ['export.filter.activity.acp_by_activity_type.acp_containing_at_least_one_activitytypes', [ | ||||
|             'activitytypes' => implode(', ', $types), | ||||
|             'has_date_after' => null !== $data['date_after'] ? 1 : 0, | ||||
|             'date_after' => $this->rollingDateConverter->convert($data['date_after']), | ||||
|             'has_date_before' => null !== $data['date_before'] ? 1 : 0, | ||||
|             'date_before' => $this->rollingDateConverter->convert($data['date_before']), | ||||
|         ]]; | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -21,7 +21,9 @@ use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| class BySocialActionFilter implements FilterInterface | ||||
| { | ||||
|     public function __construct(private readonly SocialActionRender $actionRender) {} | ||||
|     public function __construct(private readonly SocialActionRender $actionRender) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -21,7 +21,9 @@ use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| class BySocialIssueFilter implements FilterInterface | ||||
| { | ||||
|     public function __construct(private readonly SocialIssueRender $issueRender) {} | ||||
|     public function __construct(private readonly SocialIssueRender $issueRender) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -23,7 +23,8 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt | ||||
| { | ||||
|     public function __construct( | ||||
|         private RollingDateConverterInterface $rollingDateConverter, | ||||
|     ) {} | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     public function getTitle() | ||||
|     { | ||||
|   | ||||
| @@ -23,7 +23,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; | ||||
|  | ||||
| class ActivityDateFilter implements FilterInterface | ||||
| { | ||||
|     public function __construct(protected TranslatorInterface $translator, private readonly RollingDateConverterInterface $rollingDateConverter) {} | ||||
|     public function __construct(protected TranslatorInterface $translator, private readonly RollingDateConverterInterface $rollingDateConverter) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -26,7 +26,8 @@ final readonly class ActivityPresenceFilter implements FilterInterface | ||||
|     public function __construct( | ||||
|         private TranslatableStringHelperInterface $translatableStringHelper, | ||||
|         private TranslatorInterface $translator | ||||
|     ) {} | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     public function getTitle() | ||||
|     { | ||||
|   | ||||
| @@ -27,7 +27,8 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter | ||||
|     public function __construct( | ||||
|         protected TranslatableStringHelperInterface $translatableStringHelper, | ||||
|         protected ActivityTypeRepositoryInterface $activityTypeRepository | ||||
|     ) {} | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| class ActivityUsersFilter implements FilterInterface | ||||
| { | ||||
|     public function __construct(private readonly UserRender $userRender) {} | ||||
|     public function __construct(private readonly UserRender $userRender) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| class ByCreatorFilter implements FilterInterface | ||||
| { | ||||
|     public function __construct(private readonly UserRender $userRender) {} | ||||
|     public function __construct(private readonly UserRender $userRender) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -32,7 +32,8 @@ final readonly class CreatorJobFilter implements FilterInterface | ||||
|         private TranslatableStringHelper $translatableStringHelper, | ||||
|         private TranslatorInterface $translator, | ||||
|         private UserJobRepositoryInterface $userJobRepository, | ||||
|     ) {} | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -27,7 +27,8 @@ class CreatorScopeFilter implements FilterInterface | ||||
|  | ||||
|     public function __construct( | ||||
|         private readonly TranslatableStringHelper $translatableStringHelper | ||||
|     ) {} | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -28,7 +28,9 @@ class EmergencyFilter implements FilterInterface | ||||
|  | ||||
|     private const DEFAULT_CHOICE = 'false'; | ||||
|  | ||||
|     public function __construct(private readonly TranslatorInterface $translator) {} | ||||
|     public function __construct(private readonly TranslatorInterface $translator) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -21,7 +21,9 @@ use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| class LocationTypeFilter implements FilterInterface | ||||
| { | ||||
|     public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} | ||||
|     public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -26,7 +26,9 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; | ||||
|  | ||||
| class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInterface | ||||
| { | ||||
|     public function __construct(protected TranslatableStringHelper $translatableStringHelper, protected ActivityReasonRepository $activityReasonRepository) {} | ||||
|     public function __construct(protected TranslatableStringHelper $translatableStringHelper, protected ActivityReasonRepository $activityReasonRepository) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -32,7 +32,8 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem | ||||
|         private TranslatableStringHelper $translatableStringHelper, | ||||
|         private ActivityReasonRepository $activityReasonRepository, | ||||
|         private RollingDateConverterInterface $rollingDateConverter, | ||||
|     ) {} | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -26,7 +26,9 @@ final readonly class PersonsFilter implements FilterInterface | ||||
| { | ||||
|     private const PREFIX = 'act_persons_filter'; | ||||
|  | ||||
|     public function __construct(private PersonRenderInterface $personRender) {} | ||||
|     public function __construct(private PersonRenderInterface $personRender) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -29,7 +29,9 @@ class SentReceivedFilter implements FilterInterface | ||||
|  | ||||
|     private const DEFAULT_CHOICE = Activity::SENTRECEIVED_SENT; | ||||
|  | ||||
|     public function __construct(private readonly TranslatorInterface $translator) {} | ||||
|     public function __construct(private readonly TranslatorInterface $translator) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -21,7 +21,9 @@ use Symfony\Component\Form\FormBuilderInterface; | ||||
|  | ||||
| class UserFilter implements FilterInterface | ||||
| { | ||||
|     public function __construct(private readonly UserRender $userRender) {} | ||||
|     public function __construct(private readonly UserRender $userRender) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -28,7 +28,8 @@ class UsersJobFilter implements FilterInterface | ||||
|  | ||||
|     public function __construct( | ||||
|         private readonly TranslatableStringHelperInterface $translatableStringHelper | ||||
|     ) {} | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -30,7 +30,8 @@ class UsersScopeFilter implements FilterInterface | ||||
|     public function __construct( | ||||
|         private readonly ScopeRepositoryInterface $scopeRepository, | ||||
|         private readonly TranslatableStringHelperInterface $translatableStringHelper | ||||
|     ) {} | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     public function addRole(): ?string | ||||
|     { | ||||
|   | ||||
| @@ -183,6 +183,7 @@ class ActivityType extends AbstractType | ||||
|             $builder->add('attendee', EntityType::class, [ | ||||
|                 'label' => $activityType->getLabel('attendee'), | ||||
|                 'required' => $activityType->isRequired('attendee'), | ||||
|                 'placeholder' => false, | ||||
|                 'expanded' => true, | ||||
|                 'class' => ActivityPresence::class, | ||||
|                 '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('role', ['string']) | ||||
|             ->setAllowedTypes('activityType', \Chill\ActivityBundle\Entity\ActivityType::class) | ||||
|             ->setAllowedTypes('accompanyingPeriod', [\Chill\PersonBundle\Entity\AccompanyingPeriod::class, 'null']); | ||||
|             ->setAllowedTypes('accompanyingPeriod', [AccompanyingPeriod::class, 'null']); | ||||
|     } | ||||
|  | ||||
|     public function getBlockPrefix(): string | ||||
|   | ||||
| @@ -25,7 +25,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; | ||||
|  | ||||
| class ActivityTypeType extends AbstractType | ||||
| { | ||||
|     public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} | ||||
|     public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function buildForm(FormBuilderInterface $builder, array $options) | ||||
|     { | ||||
|   | ||||
| @@ -28,7 +28,8 @@ class PickActivityReasonType extends AbstractType | ||||
|         private readonly ActivityReasonRepository $activityReasonRepository, | ||||
|         private readonly ActivityReasonRender $reasonRender, | ||||
|         private readonly TranslatableStringHelperInterface $translatableStringHelper | ||||
|     ) {} | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     public function configureOptions(OptionsResolver $resolver) | ||||
|     { | ||||
|   | ||||
| @@ -23,7 +23,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; | ||||
|  */ | ||||
| class TranslatableActivityReasonCategoryType extends AbstractType | ||||
| { | ||||
|     public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) {} | ||||
|     public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function configureOptions(OptionsResolver $resolver) | ||||
|     { | ||||
|   | ||||
| @@ -20,7 +20,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; | ||||
|  | ||||
| class TranslatableActivityType extends AbstractType | ||||
| { | ||||
|     public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, protected ActivityTypeRepositoryInterface $activityTypeRepository) {} | ||||
|     public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, protected ActivityTypeRepositoryInterface $activityTypeRepository) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function configureOptions(OptionsResolver $resolver) | ||||
|     { | ||||
|   | ||||
| @@ -23,7 +23,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; | ||||
|  */ | ||||
| class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface | ||||
| { | ||||
|     public function __construct(protected Security $security, protected TranslatorInterface $translator) {} | ||||
|     public function __construct(protected Security $security, protected TranslatorInterface $translator) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function buildMenu($menuId, MenuItem $menu, array $parameters) | ||||
|     { | ||||
|   | ||||
| @@ -20,7 +20,9 @@ use Symfony\Component\Security\Core\Security; | ||||
|  */ | ||||
| final readonly class AdminMenuBuilder implements LocalMenuBuilderInterface | ||||
| { | ||||
|     public function __construct(private Security $security) {} | ||||
|     public function __construct(private Security $security) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function buildMenu($menuId, MenuItem $menu, array $parameters) | ||||
|     { | ||||
|   | ||||
| @@ -23,11 +23,13 @@ use Symfony\Contracts\Translation\TranslatorInterface; | ||||
|  */ | ||||
| final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface | ||||
| { | ||||
|     public function __construct(private AuthorizationCheckerInterface $authorizationChecker, private TranslatorInterface $translator) {} | ||||
|     public function __construct(private AuthorizationCheckerInterface $authorizationChecker, private TranslatorInterface $translator) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function buildMenu($menuId, MenuItem $menu, array $parameters) | ||||
|     { | ||||
|         /** @var \Chill\PersonBundle\Entity\Person $person */ | ||||
|         /** @var Person $person */ | ||||
|         $person = $parameters['person']; | ||||
|  | ||||
|         if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) { | ||||
|   | ||||
| @@ -18,7 +18,9 @@ use Chill\MainBundle\Notification\NotificationHandlerInterface; | ||||
|  | ||||
| final readonly class ActivityNotificationHandler implements NotificationHandlerInterface | ||||
| { | ||||
|     public function __construct(private ActivityRepository $activityRepository) {} | ||||
|     public function __construct(private ActivityRepository $activityRepository) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function getTemplate(Notification $notification, array $options = []): string | ||||
|     { | ||||
|   | ||||
| @@ -44,7 +44,8 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos | ||||
|         private EntityManagerInterface $em, | ||||
|         private Security $security, | ||||
|         private RequestStack $requestStack, | ||||
|     ) {} | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @throws NonUniqueResultException | ||||
|   | ||||
| @@ -33,16 +33,17 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum | ||||
|         private CenterResolverManagerInterface $centerResolverManager, | ||||
|         private AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser, | ||||
|         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); | ||||
|  | ||||
|         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); | ||||
|         $activityMetadata = $this->em->getClassMetadata(Activity::class); | ||||
| @@ -71,7 +72,7 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum | ||||
|         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); | ||||
|         $activityMetadata = $this->em->getClassMetadata(Activity::class); | ||||
| @@ -122,7 +123,7 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum | ||||
|         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); | ||||
|  | ||||
|   | ||||
| @@ -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 | ||||
|      */ | ||||
|     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. | ||||
|      * | ||||
|      * 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; | ||||
| } | ||||
|   | ||||
| @@ -34,7 +34,7 @@ class ActivityPresenceRepository implements ActivityPresenceRepositoryInterface | ||||
|         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); | ||||
|     } | ||||
|   | ||||
| @@ -25,7 +25,7 @@ interface ActivityPresenceRepositoryInterface | ||||
|     /** | ||||
|      * @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; | ||||
|  | ||||
|   | ||||
| @@ -48,7 +48,7 @@ final class ActivityTypeRepository implements ActivityTypeRepositoryInterface | ||||
|     /** | ||||
|      * @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); | ||||
|     } | ||||
|   | ||||
| @@ -51,7 +51,8 @@ class ActivityContext implements | ||||
|         private readonly BaseContextData $baseContextData, | ||||
|         private readonly ThirdPartyRender $thirdPartyRender, | ||||
|         private readonly ThirdPartyRepository $thirdPartyRepository | ||||
|     ) {} | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     public function adminFormReverseTransform(array $data): array | ||||
|     { | ||||
|   | ||||
| @@ -56,7 +56,8 @@ class ListActivitiesByAccompanyingPeriodContext implements | ||||
|         private readonly ThirdPartyRepository $thirdPartyRepository, | ||||
|         private readonly TranslatableStringHelperInterface $translatableStringHelper, | ||||
|         private readonly UserRepository $userRepository | ||||
|     ) {} | ||||
|     ) { | ||||
|     } | ||||
|  | ||||
|     public function adminFormReverseTransform(array $data): array | ||||
|     { | ||||
|   | ||||
| @@ -34,9 +34,10 @@ final readonly class AccompanyingPeriodActivityGenericDocProvider implements Gen | ||||
|         private EntityManagerInterface $em, | ||||
|         private Security $security, | ||||
|         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); | ||||
|         $activityMetadata = $this->em->getClassMetadata(Activity::class); | ||||
| @@ -99,7 +100,7 @@ final readonly class AccompanyingPeriodActivityGenericDocProvider implements Gen | ||||
|         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 | ||||
|             ->buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext($person, $startDate, $endDate, $content); | ||||
|   | ||||
| @@ -25,9 +25,10 @@ final readonly class PersonActivityGenericDocProvider implements GenericDocForPe | ||||
|     public function __construct( | ||||
|         private Security $security, | ||||
|         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( | ||||
|             $person, | ||||
|   | ||||
| @@ -20,7 +20,9 @@ use Chill\DocStoreBundle\Repository\StoredObjectRepository; | ||||
|  | ||||
| final readonly class AccompanyingPeriodActivityGenericDocRenderer implements GenericDocRendererInterface | ||||
| { | ||||
|     public function __construct(private StoredObjectRepository $objectRepository, private ActivityRepository $activityRepository) {} | ||||
|     public function __construct(private StoredObjectRepository $objectRepository, private ActivityRepository $activityRepository) | ||||
|     { | ||||
|     } | ||||
|  | ||||
|     public function supports(GenericDocDTO $genericDocDTO, $options = []): bool | ||||
|     { | ||||
|   | ||||
| @@ -310,7 +310,7 @@ final class ActivityControllerTest extends WebTestCase | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @return \Chill\ActivityBundle\Entity\ActivityType | ||||
|      * @return ActivityType | ||||
|      */ | ||||
|     private function getRandomActivityType() | ||||
|     { | ||||
|   | ||||
| @@ -9,10 +9,10 @@ declare(strict_types=1); | ||||
|  * 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\Export\Aggregator\PersonAggregators\ActivityReasonAggregator; | ||||
| use Chill\ActivityBundle\Export\Aggregator\ActivityReasonAggregator; | ||||
| use Chill\MainBundle\Test\Export\AbstractAggregatorTest; | ||||
| use Doctrine\ORM\EntityManagerInterface; | ||||
| use Prophecy\PhpUnit\ProphecyTrait; | ||||
| @@ -33,14 +33,14 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest | ||||
|         self::bootKernel(); | ||||
| 
 | ||||
|         $this->aggregator = self::$container->get(ActivityReasonAggregator::class); | ||||
|         /* | ||||
|                 $request = $this->prophesize() | ||||
|                     ->willExtend(\Symfony\Component\HttpFoundation\Request::class); | ||||
| 
 | ||||
|         $request = $this->prophesize() | ||||
|             ->willExtend(\Symfony\Component\HttpFoundation\Request::class); | ||||
|                 $request->getLocale()->willReturn('fr'); | ||||
| 
 | ||||
|         $request->getLocale()->willReturn('fr'); | ||||
| 
 | ||||
|         self::$container->get('request_stack') | ||||
|             ->push($request->reveal()); | ||||
|                 self::$container->get('request_stack') | ||||
|                     ->push($request->reveal());*/ | ||||
|     } | ||||
| 
 | ||||
|     public function getAggregator() | ||||
| @@ -65,7 +65,12 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest | ||||
|         return [ | ||||
|             $em->createQueryBuilder() | ||||
|                 ->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() | ||||
|                 ->select('count(activity.id)') | ||||
|                 ->from(Activity::class, 'activity') | ||||
| @@ -0,0 +1,60 @@ | ||||
| <?php | ||||
|  | ||||
| declare(strict_types=1); | ||||
|  | ||||
| /* | ||||
|  * Chill is a software for social workers | ||||
|  * | ||||
|  * For the full copyright and license information, please view | ||||
|  * the LICENSE file that was distributed with this source code. | ||||
|  */ | ||||
|  | ||||
| namespace Chill\ActivityBundle\Tests\Export\Export\LinkedToACP; | ||||
|  | ||||
| use Chill\ActivityBundle\Export\Declarations; | ||||
| use Chill\ActivityBundle\Export\Export\LinkedToACP\CountHouseholdOnActivity; | ||||
| use Chill\MainBundle\Test\Export\AbstractExportTest; | ||||
| use Chill\PersonBundle\Export\Declarations as PersonDeclarations; | ||||
| use Doctrine\ORM\EntityManagerInterface; | ||||
|  | ||||
| /** | ||||
|  * @internal | ||||
|  * | ||||
|  * @coversNothing | ||||
|  */ | ||||
| class CountHouseholdOnActivityTest extends AbstractExportTest | ||||
| { | ||||
|     private EntityManagerInterface $entityManager; | ||||
|  | ||||
|     protected function setUp(): void | ||||
|     { | ||||
|         self::bootKernel(); | ||||
|         $this->entityManager = self::$container->get(EntityManagerInterface::class); | ||||
|     } | ||||
|  | ||||
|     public function getExport() | ||||
|     { | ||||
|         yield new CountHouseholdOnActivity($this->entityManager, $this->getParameters(true)); | ||||
|         yield new CountHouseholdOnActivity($this->entityManager, $this->getParameters(false)); | ||||
|     } | ||||
|  | ||||
|     public function getFormData() | ||||
|     { | ||||
|         return [ | ||||
|             [], | ||||
|         ]; | ||||
|     } | ||||
|  | ||||
|     public function getModifiersCombination() | ||||
|     { | ||||
|         return [ | ||||
|             [ | ||||
|                 Declarations::ACTIVITY, | ||||
|                 Declarations::ACTIVITY_ACP, | ||||
|                 PersonDeclarations::ACP_TYPE, | ||||
|                 PersonDeclarations::PERSON_TYPE, | ||||
|                 PersonDeclarations::HOUSEHOLD_TYPE, | ||||
|             ], | ||||
|         ]; | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,59 @@ | ||||
| <?php | ||||
|  | ||||
| declare(strict_types=1); | ||||
|  | ||||
| /* | ||||
|  * Chill is a software for social workers | ||||
|  * | ||||
|  * For the full copyright and license information, please view | ||||
|  * the LICENSE file that was distributed with this source code. | ||||
|  */ | ||||
|  | ||||
| namespace Chill\ActivityBundle\Tests\Export\Export\LinkedToPerson; | ||||
|  | ||||
| use Chill\ActivityBundle\Export\Declarations; | ||||
| use Chill\ActivityBundle\Export\Export\LinkedToPerson\CountHouseholdOnActivity; | ||||
| use Chill\ActivityBundle\Repository\ActivityRepository; | ||||
| use Chill\MainBundle\Test\Export\AbstractExportTest; | ||||
| use Chill\PersonBundle\Export\Declarations as PersonDeclarations; | ||||
|  | ||||
| /** | ||||
|  * @internal | ||||
|  * | ||||
|  * @coversNothing | ||||
|  */ | ||||
| class CountHouseholdOnActivityTest extends AbstractExportTest | ||||
| { | ||||
|     private ActivityRepository $activityRepository; | ||||
|  | ||||
|     protected function setUp(): void | ||||
|     { | ||||
|         self::bootKernel(); | ||||
|         $this->activityRepository = self::$container->get(ActivityRepository::class); | ||||
|     } | ||||
|  | ||||
|     public function getExport() | ||||
|     { | ||||
|         yield new CountHouseholdOnActivity($this->activityRepository, $this->getParameters(true)); | ||||
|         yield new CountHouseholdOnActivity($this->activityRepository, $this->getParameters(false)); | ||||
|     } | ||||
|  | ||||
|     public function getFormData() | ||||
|     { | ||||
|         return [ | ||||
|             [], | ||||
|         ]; | ||||
|     } | ||||
|  | ||||
|     public function getModifiersCombination() | ||||
|     { | ||||
|         return [ | ||||
|             [ | ||||
|                 Declarations::ACTIVITY, | ||||
|                 Declarations::ACTIVITY_PERSON, | ||||
|                 PersonDeclarations::PERSON_TYPE, | ||||
|                 PersonDeclarations::HOUSEHOLD_TYPE, | ||||
|             ], | ||||
|         ]; | ||||
|     } | ||||
| } | ||||
| @@ -13,6 +13,7 @@ namespace Chill\ActivityBundle\Tests\Export\Filter\ACPFilters; | ||||
|  | ||||
| use Chill\ActivityBundle\Entity\Activity; | ||||
| use Chill\ActivityBundle\Entity\ActivityType; | ||||
| use Chill\MainBundle\Service\RollingDate\RollingDate; | ||||
| use Chill\MainBundle\Test\Export\AbstractFilterTest; | ||||
| use Chill\PersonBundle\Entity\AccompanyingPeriod; | ||||
| use Doctrine\Common\Collections\ArrayCollection; | ||||
| @@ -55,8 +56,30 @@ final class ActivityTypeFilterTest extends AbstractFilterTest | ||||
|         $data = []; | ||||
|  | ||||
|         foreach ($array as $a) { | ||||
|             $data[] = [ | ||||
|                 'accepted_activitytypes' => [], | ||||
|                 'date_after' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), | ||||
|                 'date_before' => new RollingDate(RollingDate::T_TODAY), | ||||
|             ]; | ||||
|             $data[] = [ | ||||
|                 'accepted_activitytypes' => new ArrayCollection([$a]), | ||||
|                 'date_after' => null, | ||||
|                 'date_before' => null, | ||||
|             ]; | ||||
|             $data[] = [ | ||||
|                 'accepted_activitytypes' => [$a], | ||||
|                 'date_after' => null, | ||||
|                 'date_before' => null, | ||||
|             ]; | ||||
|             $data[] = [ | ||||
|                 'accepted_activitytypes' => [$a], | ||||
|                 'date_after' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), | ||||
|                 'date_before' => new RollingDate(RollingDate::T_TODAY), | ||||
|             ]; | ||||
|             $data[] = [ | ||||
|                 'accepted_activitytypes' => [], | ||||
|                 'date_after' => null, | ||||
|                 'date_before' => null, | ||||
|             ]; | ||||
|         } | ||||
|  | ||||
|   | ||||
| @@ -35,7 +35,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest | ||||
|         $this->filter = self::$container->get('chill.activity.export.person_having_an_activity_between_date_filter'); | ||||
|  | ||||
|         $request = $this->prophesize() | ||||
|             ->willExtend(\Symfony\Component\HttpFoundation\Request::class); | ||||
|             ->willExtend(Request::class); | ||||
|  | ||||
|         $request->getLocale()->willReturn('fr'); | ||||
|  | ||||
|   | ||||
| @@ -58,7 +58,7 @@ final class TranslatableActivityTypeTest extends KernelTestCase | ||||
|  | ||||
|         $this->assertTrue($form->isSynchronized()); | ||||
|         $this->assertInstanceOf( | ||||
|             \Chill\ActivityBundle\Entity\ActivityType::class, | ||||
|             ActivityType::class, | ||||
|             $form->getData()['type'], | ||||
|             'The data is an instance of Chill\\ActivityBundle\\Entity\\ActivityType' | ||||
|         ); | ||||
| @@ -83,7 +83,7 @@ final class TranslatableActivityTypeTest extends KernelTestCase | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @return \Chill\ActivityBundle\Entity\ActivityType | ||||
|      * @return ActivityType | ||||
|      */ | ||||
|     protected function getRandomType(mixed $active = true) | ||||
|     { | ||||
|   | ||||
| @@ -157,7 +157,7 @@ final class ActivityVoterTest extends KernelTestCase | ||||
|      * | ||||
|      * @return \Symfony\Component\Security\Core\Authentication\Token\TokenInterface | ||||
|      */ | ||||
|     protected function prepareToken(User $user = null) | ||||
|     protected function prepareToken(?User $user = null) | ||||
|     { | ||||
|         $token = $this->prophet->prophesize(); | ||||
|         $token | ||||
|   | ||||
| @@ -20,6 +20,14 @@ services: | ||||
|         tags: | ||||
|             - { name: chill.export, alias: 'count_person_on_activity' } | ||||
|  | ||||
|     Chill\ActivityBundle\Export\Export\LinkedToACP\CountHouseholdOnActivity: | ||||
|         tags: | ||||
|             - { name: chill.export, alias: 'count_household_on_activity_acp' } | ||||
|  | ||||
|     Chill\ActivityBundle\Export\Export\LinkedToPerson\CountHouseholdOnActivity: | ||||
|         tags: | ||||
|             - { name: chill.export, alias: 'count_household_on_activity_person' } | ||||
|  | ||||
|     chill.activity.export.count_activity_linked_to_acp: | ||||
|         class: Chill\ActivityBundle\Export\Export\LinkedToACP\CountActivity | ||||
|         tags: | ||||
| @@ -145,7 +153,7 @@ services: | ||||
|  | ||||
|  | ||||
|     ## Aggregators | ||||
|     Chill\ActivityBundle\Export\Aggregator\PersonAggregators\ActivityReasonAggregator: | ||||
|     Chill\ActivityBundle\Export\Aggregator\ActivityReasonAggregator: | ||||
|         tags: | ||||
|             - { name: chill.export_aggregator, alias: activity_reason_aggregator } | ||||
|  | ||||
|   | ||||
| @@ -3,7 +3,12 @@ export: | ||||
|         activity: | ||||
|             course_having_activity_between_date: | ||||
|                 Only course having an activity between from and to: Seulement les parcours ayant reçu au moins un échange entre le {from, date, short} et le {to, date, short} | ||||
|         person_between_dates: | ||||
|  | ||||
|             acp_by_activity_type: | ||||
|                 'acp_containing_at_least_one_activitytypes': >- | ||||
|                     Parcours filtrés: uniquement ceux qui contiennent au moins un échange d'un des types suivants: {activitytypes} | ||||
|                     {has_date_after, select, 1 {, après le {date_after, date}} other {}} | ||||
|                     {has_date_before, select, 1 {, avant le {date_before, date}} other {}} | ||||
|             describe_action_with_no_subject: >- | ||||
|                 Filtré par personne ayant eu un échange entre le {date_from, date} et le {date_to, date} | ||||
|             describe_action_with_subject: >- | ||||
|   | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user