Compare commits

..

206 Commits

Author SHA1 Message Date
da3c6f2dd1 php cs fix 2023-09-14 17:17:36 +02:00
c72af4d7db update changelog 2023-09-14 17:14:46 +02:00
370c9c6d74 only display active centers in center form for exports 2023-09-14 17:01:58 +02:00
80ea712475 changelog and changies 2023-09-14 16:17:22 +02:00
0e47a1cf59 Merge branch '38-gestion-doublon' into 'master'
fix the doublons module

Closes #38

See merge request Chill-Projet/chill-bundles!577
2023-09-14 14:08:51 +00:00
6a554c1c8c Merge branch 'tasks_mission_type_filter' into 'master'
Add filter to tasks based on mission type (AMLI)

See merge request Chill-Projet/chill-bundles!588
2023-09-14 14:08:33 +00:00
0bd8ad84a8 Merge branch 'use_crud_for_center' into 'master'
Use crud for center and add isActive property

See merge request Chill-Projet/chill-bundles!587
2023-09-14 14:07:28 +00:00
115d71ad34 php cs fixes 2023-09-14 15:56:39 +02:00
7ca2380dad php cs fixes 2023-09-14 15:53:42 +02:00
ac9704f154 add changie gestion doublon 2023-09-14 15:47:17 +02:00
87ea841aaa fix rector 2023-09-14 15:47:17 +02:00
dccc2bf4a5 use newer notation for declaring service 2023-09-14 15:47:17 +02:00
599510c3b9 Use PickUserLocationType instead of an EntityType 2023-09-14 15:47:17 +02:00
18971b3204 remove unused comment on Version migration 2023-09-14 15:47:17 +02:00
735a4aa97c csfixer after (rebuild php container) 2023-09-14 15:47:17 +02:00
7cdbee2d0f run rector 2023-09-14 15:47:17 +02:00
95dfb4ba52 cs fixer 2023-09-14 15:47:17 +02:00
22241ca7b1 add changies 2023-09-14 15:47:17 +02:00
13faa572ef Fix missing translation in acpw exports 2023-09-14 15:47:17 +02:00
72f0c460ab Feature: [export] add byLocation filter/aggregators in asideActivity exports 2023-09-14 15:47:17 +02:00
c546c4a207 Feature: add location in asideActivity pages (user currentLocation by default) 2023-09-14 15:47:16 +02:00
5cea4a647d Feature: migrate changes in Location attribute in Asideactivity Entity 2023-09-14 15:47:16 +02:00
207e109d1e Improve NotificationMailerTest by adding an assertion
This assertion is performed by Prophecy's shouldBeCalled* method.
2023-09-14 15:47:16 +02:00
758ad9bc87 [test][household] add a test to check if leaveMovement write an enddate when member startdate is today 2023-09-14 15:47:16 +02:00
90c8f1e3cf add new changie 2023-09-14 15:47:16 +02:00
05d86f1a70 Fix: [Household] allow to set an enddate to member who is repositionned at the same date
addMovement was correct
leaveMovement were not, enddate was not written when startdate was same
2023-09-14 15:47:16 +02:00
99cf7b8e8d UX: minor design correction on badge-person in household banner 2023-09-14 15:47:16 +02:00
68f2c7df25 Fixed: [vuejs] fix missing translation in HouseholdMembersEditor component 2023-09-14 15:47:16 +02:00
6f1dd5b3f2 Fix new CS 2023-09-14 15:47:16 +02:00
e7a9b10d0d NotificationMailer: add tests when user does not have any email 2023-09-14 15:47:16 +02:00
b4f8c7d261 NotificationMailer: send to correct destinees 2023-09-14 15:47:16 +02:00
65b585d4a9 Add test to NotificationMailer::postPersistComment 2023-09-14 15:47:16 +02:00
2cec4a770e Fixed: [notificationMailer] invert 'if continue' condition inside foreach loop 2023-09-14 15:47:16 +02:00
52c5807cd5 add changie 2023-09-14 15:47:16 +02:00
bf7f375daf Fixed: [export] bad type in form of EmergencyFilter and CalendarRangeFilter 2023-09-14 15:47:16 +02:00
cd85e37c1b do active center filtering in frontend for person creation 2023-09-14 14:30:58 +02:00
67e9127f8e docs: correct code block display 2023-09-14 12:40:32 +02:00
754515f185 php cs fixes 2023-09-14 12:25:56 +02:00
15fbfbb621 add developer faq in the index + some language corrections 2023-09-14 12:17:01 +02:00
cf294541ae Add a developer faq to the chill documentation 2023-09-14 12:11:28 +02:00
b4f9501af5 php cs fixes 2023-09-14 11:47:54 +02:00
c1a586dfb9 php cs fix 2023-09-12 16:07:50 +02:00
57a1a49fac fix user filter not combining with other filters 2023-09-12 15:55:03 +02:00
19789acbbe php cs fixes 2023-09-12 15:18:03 +02:00
77180ebb0c Fix error in the doublons queries 2023-09-12 14:19:10 +02:00
6e2377b7ee remove commented code 2023-09-12 13:21:58 +02:00
4d111cd6cf filter out active centers in api 2023-09-11 16:37:27 +02:00
9600543fec Merge branch 'master' into use_crud_for_center 2023-09-11 14:57:51 +02:00
86315b1579 only show active centers from the reachable centers for creation of person 2023-09-11 14:43:52 +02:00
0355699a69 php cs fix 2023-09-11 13:53:40 +02:00
efd43c3791 refactor code after review 2023-09-11 13:53:09 +02:00
f770664798 phpstan fix 2023-09-11 13:06:07 +02:00
74645c065b use different logic to decide whether mission type filter should be shown 2023-09-11 13:01:43 +02:00
c1d70ec63e try fix error cannot insert multiple commands into prepared statement 2023-09-11 11:23:21 +02:00
36ca0fcbfc php cs fixer 2023-09-08 10:50:57 +02:00
91c4c3c270 Merge branch 'master' into tasks_mission_type_filter 2023-09-08 10:49:44 +02:00
92b1b17679 Merge branch 'master' into 38-gestion-doublon 2023-09-07 16:08:27 +02:00
c19d1ff0c7 php cs fixer 2023-09-07 16:08:18 +02:00
94f26df81e Make test personMove work for centers 2023-09-07 16:07:23 +02:00
ae9f1e3905 Merge branch '133-location-asideactivity' into 'master'
Resolve "Ajouter la localisation aux activités annexes"

Closes #133

See merge request Chill-Projet/chill-bundles!581
2023-09-07 11:13:18 +00:00
b6fe830f1e use newer notation for declaring service 2023-09-07 13:08:55 +02:00
665f0b4ccb Use PickUserLocationType instead of an EntityType 2023-09-07 13:08:55 +02:00
30fa57b999 remove unused comment on Version migration 2023-09-07 12:57:41 +02:00
0a6131abcc csfixer after (rebuild php container) 2023-09-07 12:16:47 +02:00
bd4f3e38eb run rector 2023-09-07 12:16:47 +02:00
75bca46b98 cs fixer 2023-09-07 12:16:47 +02:00
fe1fe31b68 add changies 2023-09-07 12:16:46 +02:00
46a5464429 Fix missing translation in acpw exports 2023-09-07 12:16:46 +02:00
67ea62f33d Feature: [export] add byLocation filter/aggregators in asideActivity exports 2023-09-07 12:16:46 +02:00
0e16ab4c18 Feature: add location in asideActivity pages (user currentLocation by default) 2023-09-07 12:16:45 +02:00
a68fef8547 Feature: migrate changes in Location attribute in Asideactivity Entity 2023-09-07 12:16:45 +02:00
fe89e527e6 Merge branch '136-household-reposition-date' into 'master'
Fix bug when repositionning at same date in Household

See merge request Chill-Projet/chill-bundles!584
2023-09-07 09:35:02 +00:00
7b28bb7561 Improve NotificationMailerTest by adding an assertion
This assertion is performed by Prophecy's shouldBeCalled* method.
2023-09-07 11:30:04 +02:00
8f793d8985 [test][household] add a test to check if leaveMovement write an enddate when member startdate is today 2023-09-07 11:30:04 +02:00
264e19e20a add new changie 2023-09-07 11:30:04 +02:00
f30b4ff452 DX php cs fixer 2023-09-06 16:22:03 +02:00
f3a37d435f FEATURE [form][isActive] add form field for isActive property 2023-09-06 16:21:29 +02:00
f0c6d00953 Fix: [Household] allow to set an enddate to member who is repositionned at the same date
addMovement was correct
leaveMovement were not, enddate was not written when startdate was same
2023-09-06 16:19:59 +02:00
fe5e1e5557 UX: minor design correction on badge-person in household banner 2023-09-06 16:19:58 +02:00
16fcd03a02 Fixed: [vuejs] fix missing translation in HouseholdMembersEditor component 2023-09-06 16:19:58 +02:00
34ee2b3ba5 Fix new CS 2023-09-06 16:18:28 +02:00
03baee4286 FIX [repository][center] adjust center repository to find all active entities 2023-09-06 16:07:14 +02:00
bc5c420f92 Merge branch '137-send-reply-when-adding-notification-comments' into 'master'
Resolve: Send reply email to all recipees when add comments in notifications

See merge request Chill-Projet/chill-bundles!585
2023-09-06 14:05:31 +00:00
b256c3176e FIX [migration][center] set default value in center migration to add isActive 2023-09-06 16:05:21 +02:00
53cc43f8d3 NotificationMailer: add tests when user does not have any email 2023-09-06 15:59:36 +02:00
40a72d9fca NotificationMailer: send to correct destinees 2023-09-06 15:59:35 +02:00
82b3025842 DX php cs fixer 2023-09-06 15:56:48 +02:00
7c7c5862c6 FEATURE [center][isActive] add getter and setter + integrate into template 2023-09-06 15:56:04 +02:00
6301505563 DX add changie 2023-09-06 15:52:26 +02:00
ba41ab98f7 FEATURE [isActive][center] add isActive property to the center entity 2023-09-06 15:50:45 +02:00
fa47dcd5b6 FIX [center][crud] use crud controller for center entity 2023-09-06 15:50:12 +02:00
f3fbd5314a Add test to NotificationMailer::postPersistComment 2023-09-06 15:47:45 +02:00
e9f90e2dd2 Merge branch '135-bad-type-in-emergency-filter' into 'master'
Resolve "[saved exports] erreur de typage quand on veut remodifier un export sauvegardé"

See merge request Chill-Projet/chill-bundles!582
2023-09-06 12:40:54 +00:00
dcae15e8d8 Fixed: [notificationMailer] invert 'if continue' condition inside foreach loop 2023-08-24 15:20:53 +02:00
9ccbba2deb add changie 2023-08-22 14:28:35 +02:00
87cdf2e53b Fixed: [export] bad type in form of EmergencyFilter and CalendarRangeFilter 2023-08-22 14:24:40 +02:00
bf27e81e35 DX add changie 2023-08-21 16:10:32 +02:00
6275623f5e FIX [task][filter] use config parameter for list of mission types 2023-08-21 11:40:30 +02:00
bc4af576bc FIX [filter][missionType] reimplement mission type task filter 2023-08-21 11:24:33 +02:00
01e9a15bd7 FIX [sort][center] sort list of centers in admin alphabetically 2023-08-21 10:09:34 +02:00
256579af89 FIX Assign the correct id_seq for PersonMoveAccompanyingPeriodParticipationHandler 2023-08-03 11:41:36 +02:00
3af065e530 WIP [centerHistory] Try to get test to work for personCenterHistory 2023-08-03 11:40:47 +02:00
fd79692f6d FEATURE [relationships] Add personMoveRelationHandler and test for this 2023-08-03 11:39:09 +02:00
7758d62f86 FIX remove var_dump 2023-07-27 10:47:42 +02:00
2921073da3 [centerHistory] add conditions to be sure at least one center history exists per person 2023-07-27 10:34:19 +02:00
f02d97ddb0 FEATURE [centerHistory] attempt to complete test for centerHistory 2023-07-27 10:18:30 +02:00
95b3933650 Version 2.5.3 2023-07-20 12:30:51 +02:00
b7a6a88e70 DX run changie to batch and merge 2023-07-20 12:24:26 +02:00
9846cd5acb DX phpstan, csfix, remove dumps 2023-07-20 12:12:34 +02:00
032eed0424 DX add changie 2023-07-20 11:37:59 +02:00
767ed89f80 FIX [document][list] 'or' query statements were not added to query for rendez vous documents causing all rendez-vous documents from all users to appear in dossiers that had a parcours. 'Or' statements add to where clause 2023-07-20 10:52:22 +02:00
15bf4d6d6d Update CONTRIBUTING.md 2023-07-18 06:42:21 +00:00
c7cdb3a092 Add CONTRIBUTING 2023-07-18 06:37:26 +00:00
bb187f5463 WIP started center_history query for duplicate person merge 2023-07-17 07:50:10 +02:00
1ebf68683f release 2.5.2 2023-07-15 09:00:03 +02:00
98c2ee3ab2 [Collate Address] when updating address point, do not use the point's address reference if the similarity is below 2023-07-15 08:59:07 +02:00
4d7b4500c1 release 2.5.1 2023-07-14 13:03:29 +02:00
ca2ba9d8e4 [collate addresses] block collating addresses to another address reference
where the address reference is already the best match
2023-07-14 13:03:28 +02:00
f34f8b1eaa Update v2.5.0.md - add missing changie 2023-07-14 10:42:11 +00:00
2b96160200 Release v2.5.0 2023-07-14 11:42:35 +02:00
933c353357 DX: [changie] fix bug when Custom.Long is not present 2023-07-14 11:32:10 +02:00
e6da727a11 Merge branch 'issue120_filter_social_actions' into 'master'
Add filter to social actions

See merge request Chill-Projet/chill-bundles!570
2023-07-14 09:14:21 +00:00
0719a541a6 Merge branch 'doc-chill-database' into 'master'
doc: documentation for database printciples

See merge request Chill-Projet/chill-bundles!562
2023-07-14 08:58:11 +00:00
883147ed9c add a missing sntence 2023-07-14 08:57:55 +00:00
718de2fad0 Merge branch '112-addresses-recollate' into 'master'
Feature: re-associate addresses with addresses references and postal code references in a cronjob and allow a cronjob to pass data from one execution to the next one

Closes #112

See merge request Chill-Projet/chill-bundles!580
2023-07-14 08:56:56 +00:00
643d8f99be collate address: force the country to be the same when comparing postal codes 2023-07-14 10:52:33 +02:00
3954d69c94 Merge branch '93-improve-address-design' into 'master'
Améliorations cosmétiques en rapport avec le bouton "détails de l'adresse"

See merge request Chill-Projet/chill-bundles!579
2023-07-14 08:47:18 +00:00
78a5e81e33 remove glitch from filter when no task states in database 2023-07-14 10:43:18 +02:00
b05e128b5e Handle case when some arguments are null in SingleTaskAclAwareRepository 2023-07-14 10:13:57 +02:00
8f39d0320c Merge branch '117-repair-queries-on-homepage-widget' into 'master'
[homepage widget] repair my unread notification list with actions and evaluations documents

See merge request Chill-Projet/chill-bundles!578
2023-07-14 07:48:46 +00:00
1cc61cee36 Fixed: fix CS + fix "my workflow" api when course or work has been delete 2023-07-14 09:44:05 +02:00
a21cefab31 Fix: last fixes for accompanying period work filters
- avoid errors when the user inverse date from and date to (we correct them)
- allow the user to filter by multiple users
- do not show filter by types if only one action type
- more type-hinting in the $filter argument for AccompanyingPeriodWorkRepository::findByAccompanyingPeriodOpenFirst
2023-07-14 09:23:23 +02:00
f2673d6c83 Merge remote-tracking branch 'origin/master' into issue120_filter_social_actions 2023-07-13 21:14:31 +02:00
18535ee85f DX: remove dump message 2023-07-13 21:12:08 +02:00
aea6796ba1 Merge branch 'user_filter_tasks' into 'master'
Filter on user within task list

See merge request Chill-Projet/chill-bundles!569
2023-07-13 16:07:54 +00:00
872d5e8ebf do not show filter by user on 'my tasks' page, and show different states
dynamically
2023-07-13 18:02:54 +02:00
c0901947ca [filterOrder] show selected picked users in the results boxes 2023-07-13 17:36:05 +02:00
860e076b89 [test] add dataprovider for testing move person where both are participating in the same parcours 2023-07-13 16:18:39 +02:00
ea0e5dfa14 Merge remote-tracking branch 'origin/master' into user_filter_tasks 2023-07-13 16:13:14 +02:00
e0cdf06e99 FIX [duplicate] adding test and handlers to handle fusion of doublons with special cases - after codewithme session 2023-07-13 15:30:33 +02:00
59da93fd75 corrections 2023-07-13 14:07:01 +02:00
1d9b8729ab oups 2023-07-13 12:50:15 +02:00
22ded77bde Create new route to redirect from document to work that contains evaluation that contains document 2023-07-13 12:49:01 +02:00
995e2dac80 Merge branch '126-addperson-thirdparty-api-search' into 'master'
[AddPersons] redondance dans les résultats de recherche de tiers

See merge request Chill-Projet/chill-bundles!576
2023-07-13 08:37:32 +00:00
28c41aaf85 fix the number of parameters in the query 2023-07-13 10:32:56 +02:00
ce2ce42530 add changies 2023-07-13 10:32:51 +02:00
1409a3b23a update changelog 2023-07-13 10:27:29 +02:00
51e382760d add changie 2023-07-13 10:05:57 +02:00
b0fcffea2d fixed: take into account the first iteration of the cronjob 2023-07-13 09:03:41 +02:00
66e1047752 DX php cs fixer 2023-07-12 20:30:31 +02:00
7bee376718 DX phpstan fix and remove dump 2023-07-12 20:29:53 +02:00
6bc45bbca3 FEATURE [filter][actions] integrate user and dates filter into sql 2023-07-12 20:21:14 +02:00
f3912e5544 Merge branch '129-export-filter-course-having-activity' into 'master'
[export] Add a filter "filter course having an activity between two dates"

Closes #129

See merge request Chill-Projet/chill-bundles!574
2023-07-12 16:20:18 +00:00
0950074121 Merge branch '128-export-group-activity-by-localisation' into 'master'
Feature: [export] allow to group activities by location

Closes #128

See merge request Chill-Projet/chill-bundles!573
2023-07-12 16:11:51 +00:00
94e9b75e40 Merge branch '125-list-person-on-course' into 'master'
Feature: Add a list of peoples with the details of their accompanying courses

Closes #125

See merge request Chill-Projet/chill-bundles!572
2023-07-12 16:11:39 +00:00
23c7a92546 Merge branch '118-design-filterOrder' into 'master'
improve style of filterOrder box

See merge request Chill-Projet/chill-bundles!568
2023-07-12 16:11:22 +00:00
8391dbe448 Merge branch 'issue719_filter_activities_version_2' into 'master'
Filter the list of activities

See merge request Chill-Projet/chill-bundles!563
2023-07-12 16:11:10 +00:00
a7842b2597 [Addresses] add a cronjob to collate addresses with reference 2023-07-12 18:00:29 +02:00
1552b3c9d7 [Addresses] create a service to collate addresses with the address reference 2023-07-12 17:30:46 +02:00
2259a31260 show detail button in banners 2023-07-12 17:25:49 +02:00
36eed4323c add title tag on detail address button 2023-07-12 17:20:02 +02:00
9bf8c9b0ed UX: [address details] improve button integration 2023-07-12 17:03:55 +02:00
1930c48d28 Align address detail button style with banner context buttons 2023-07-12 17:03:55 +02:00
29306d2b66 UX: [vue][onTheFly] improve residential address position in modale 2023-07-12 17:03:55 +02:00
e0758215ba FEATURE [repository] implement filter logic 2023-07-12 15:17:03 +02:00
e82c7cdc6c Fixed: [homepage widget] repair my unread notification list with actions and evaluations documents 2023-07-12 13:24:23 +02:00
3f66e1a862 [cron-job] allow a cronjob to pass data from one execution to another
When a cronjob is executed, it may return an array of data.

This data will be passed as parameter on the next execution
2023-07-12 11:36:26 +02:00
0423540976 FIX [duplicate][personpicker] use dynamic person picker to assign duplicate manually 2023-07-12 11:17:25 +02:00
fcd4c3b92e DX add changie 2023-07-12 11:12:22 +02:00
efee2d8b44 cleaning 2023-07-12 10:53:12 +02:00
7c109d909a Merge branch '38-gestion-doublon' of gitlab.com:Chill-Projet/chill-bundles into 38-gestion-doublon 2023-07-12 10:52:13 +02:00
d825a8509b FIX [duplicate][delete] fix error messages for treating the accompaning_period_work linked to the person that will be deleted 2023-07-12 10:51:55 +02:00
f3829d3390 adapt query to simplify join clauses (lightly improve perfs) 2023-07-12 10:50:17 +02:00
e8690d249f FIX [duplicate][delete] fix error messages for treating the accompaning_period_work linked to the person that will be deleted 2023-07-12 10:42:46 +02:00
a2e705bd92 fixed: error with parent joins in thirdparty api search query 2023-07-12 10:38:11 +02:00
e38b369149 [cron-job] add a new "lastExecution" data on CronJobExecution entity
This column will store the results of the last execution
2023-07-12 10:26:53 +02:00
5a36a8660d Merge branch 'AMLI_fix_budget_calculator' into 'master'
AMLIi fix budget calculator

See merge request Chill-Projet/chill-bundles!575
2023-07-12 08:20:03 +00:00
f7d385eba1 DX add changie 2023-07-12 09:06:08 +02:00
edd66f6a6c FIX [budget][templates] reimplement display of all calculator results 2023-07-12 09:04:15 +02:00
2882038efc [export] Add a filter "filter course having an activity between two dates" 2023-07-11 16:00:40 +02:00
6065680e1e Feature: [export] allow to group activities by location 2023-07-11 15:01:32 +02:00
88114e3ba6 Fixed: [filterOrder] refactor active filter helper to a dedicated class and fix loading of multiple entity choices 2023-07-11 14:17:02 +02:00
bf93c1ddb2 fix label color in active filters pills 2023-07-11 14:06:10 +02:00
0d365e16e5 add missing translations 2023-07-10 15:59:33 +02:00
802ff20b5c Merge branch '118-design-filterOrder' of gitlab.com:Chill-Projet/chill-bundles into 118-design-filterOrder 2023-07-10 15:55:18 +02:00
cdfe201574 render active filters like pills 2023-07-10 15:55:05 +02:00
43419f9f15 [filterOrder] fix error in method getActiveFilters when dealing with entityChoice with incorrect number of translation 2023-07-10 15:39:00 +02:00
39896ea6e2 [FilterOrder] add a method to get all the active filters 2023-07-10 15:26:54 +02:00
ca62c3fd0b Merge remote-tracking branch 'origin/master' into 118-design-filterOrder 2023-07-10 11:51:39 +02:00
b3b84c5dc0 Merge branch 'issue719_filter_activities_version_2' into 118-design-filterOrder 2023-07-10 11:49:24 +02:00
6bdb3e9695 fix typo which prevent to apply a filter on activity types 2023-07-07 21:49:36 +02:00
20e64e8768 test filterOrder in an accordion 2023-07-07 15:41:29 +02:00
63f9bd5548 [export] Add ordering by person''s lastname or course opening date in list which concerns accompanying course or people 2023-07-07 12:42:32 +02:00
c8146ded17 Feature: add a list for people with their associated accompanying course 2023-07-07 12:36:24 +02:00
17d2b795b4 update changelog 2023-07-07 11:38:00 +02:00
7f30742fc3 Rename ListPersonWithAccompanyingPeriod to ListPersonHavingAccompanyingPeriod 2023-07-07 09:36:39 +02:00
56d9072abe change id, to avoid collision between ListPersonHelper and ListAccompanyingPeriodHelper 2023-07-07 09:33:03 +02:00
7ccff61c25 Refactor ListAccompanyingPeriod to use a helper for most of the work 2023-07-07 09:17:36 +02:00
cc97199c5d DX added changie 2023-07-06 13:40:25 +02:00
20d5fabc18 [repository][action filter] integrating filters in repository 2023-07-06 13:39:08 +02:00
c04fd66163 do not show filter on job or activity type if less than 2 possibilities 2023-07-05 22:20:27 +02:00
61982634a6 FEATURE add filter to the template 2023-07-05 16:05:51 +02:00
6c58e7eb3e DX phpstan and cs-fixer 2023-07-05 15:50:08 +02:00
4b25970ce0 FEATURE [filter] start implementation of social action filter 2023-07-05 15:35:13 +02:00
145c1df313 cleaning 2023-07-05 09:43:13 +02:00
ad72192e24 doc: for database printciples 2023-06-08 11:24:27 +02:00
239 changed files with 4233 additions and 1487 deletions

View File

@@ -1,5 +0,0 @@
kind: DX
body: '[FilterOrderHelper] add entity choice and singleCheckbox'
time: 2023-06-23T12:24:08.133491895+02:00
custom:
Issue: ""

View File

@@ -1,5 +0,0 @@
kind: Feature
body: '[activity list] add filtering for activities list'
time: 2023-06-23T12:25:30.49643551+02:00
custom:
Issue: ""

View File

@@ -1,6 +0,0 @@
kind: Feature
body: '[activity list] in person context, show also the activities from the accompanying
periods where the person participates'
time: 2023-06-23T12:27:02.159041095+02:00
custom:
Issue: ""

View File

@@ -1,5 +0,0 @@
kind: Feature
body: '[activity list] add pagination to the list of activities'
time: 2023-06-23T12:44:38.879098862+02:00
custom:
Issue: ""

View File

@@ -1,5 +0,0 @@
kind: Feature
body: Allow filtering on the basis of a user within general tasks list
time: 2023-07-05T14:03:36.664880092+02:00
custom:
Issue: ""

39
.changes/v2.5.0.md Normal file
View File

@@ -0,0 +1,39 @@
## v2.5.0 - 2023-07-14
### Feature
* Allow filtering on the basis of a user within general tasks lists
* ([#120](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/120)) Adding OrderFilter to the list of social actions.
* ([#125](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/125)) [export] Add a list for people with their associated course
* [export] Add ordering by person's lastname or course opening date in list which concerns accompanying course or peoples
* ([#128](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/128)) [Export] allow to group activities by localisation
* ([#129](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/129)) [export] Add a filter "filter course having an activity between two dates"
* ([#112](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/112)) [addresses] Add a cronjob to re-associate addresses with addresses reference every 6 hours
* Improve filtering layout
### Fixed
* reimplement the visualization of all calculator results
* ([#117](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/117)) Repair my unread notification list with actions and evaluations documents
* ([#126](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/126)) Correct bug in thirdparty API search query: simplify address joins clause for child and parent kind
### DX
* Documentation for database principles
* [cronjob] when a cronjob is executed, it may return an array of data that will be passed as argument on the next execution
### UX
* ([#93](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/93)) Better integration of address details button: look, position, title tag
* ([#93](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/93)) Show address detail button on person and household banners
* Improve residential address position on show onthefly modale
### Traduction francophone des principaux changements
* Ajout d'un filtre "par utilisateur" aux pages de tâche
* Filtre des actions d'accompagnement par date, type, intervenant
* export: liste des usagers concernés avec détail de leurs parcours
* export: ajout d'un regroupement des échanges par localisation
* export: ajout d'un filtre "parcours ayant reçu un échange entre deux dates"
* ajout d'une tâche cron pour associer les adresses à une adresse de référence
* correction: réparation de la liste des notifications sur la page d'accueil, dans le cas où une notification concerne une action ou un document dans une évaluation
* correction: réparation de la recherche des tiers ayant des codes postaux similaires entre les parents et enfants
* meilleure intégration du bouton "détail d'une adresse": améliration de la taille et de la position
* bouton permettant de visualiser les détails d'une adresse (modale avec carte) dans la bannière "Usager" et "Ménage"
* amélioration de la modale permettant de voir les détails d'un usager: les adresses de résidence sont dans la continuité des autres adresses, et non plus dans une colonne séparée
* améliore le design et l'expérience utilisateur des filtres

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

@@ -0,0 +1,3 @@
## v2.5.1 - 2023-07-14
### Fixed
* [collate addresses] block collating addresses to another address reference where the address reference is already the best match

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

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

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

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

21
.changes/v2.6.0.md Normal file
View File

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

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

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

View File

@@ -7,7 +7,7 @@ versionFormat: '## {{.Version}} - {{.Time.Format "2006-01-02"}}'
kindFormat: '### {{.Kind}}'
# Note: it is possible to add a `.custom.Long` text manually into the yaml file produced by `changie new`. This will add a long description.
changeFormat: >-
* {{ if not (eq .Custom.Issue "") }}([#{{ .Custom.Issue }}](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/{{ .Custom.Issue }})) {{ end }}{{.Body}} {{ if not (eq .Custom.Long "") }}
* {{ if not (eq .Custom.Issue "") }}([#{{ .Custom.Issue }}](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/{{ .Custom.Issue }})) {{ end }}{{.Body}} {{ if and (.Custom.Long) (not (eq .Custom.Long "")) }}
{{ .Custom.Long }}{{ end }}
custom:
@@ -30,6 +30,8 @@ kinds:
auto: patch
- label: DX
auto: patch
- label: UX
auto: patch
newlines:
afterChangelogHeader: 1
beforeChangelogVersion: 1

View File

@@ -6,6 +6,84 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).
## v2.6.1 - 2023-09-14
### Fixed
* Filter out active centers in exports, which uses a different PickCenterType.
## v2.6.0 - 2023-09-14
### Feature
* ([#133](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/133)) Add locations in Aside Activity. By default, suggest user location, otherwise a select with all locations.
* ([#133](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/133)) Adapt Aside Activity exports: display location, filter by location, group by location
* Use the CRUD controller for center entity + add the isActive property to be able to mask instances of Center that are no longer in use.
### Fixed
* ([#107](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/107)) reinstate the fusion of duplicate persons
* Missing translation in Work Actions exports
* Reimplement the mission type filter on tasks, only for instances that have a config parameter indicating true for this.
* ([#135](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/135)) Corrects a typing error in 2 filters, which caused an
error when trying to reedit a saved export
* ([#136](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/136)) [household] when moving a person to a sharing position to a not-sharing position on the same household on the same date, remove the previous household membership on the same household. This fix duplicate member.
* Add missing translation for comment field placeholder in repositionning household editor.
* Do not send an email to creator twice when adding a comment to a notification
* ([#107](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/107)) Fix gestion doublon functionality to work with chill bundles v2
### UX
* Uniformize badge-person in household banner (background, size)
## v2.5.3 - 2023-07-20
### Fixed
* ([#132](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/132)) Rendez-vous documents created would appear in all documents lists of all persons with an accompanying period. Or statements are now added to the where clause to filter out documents that come from unrelated accompanying period/ or person rendez-vous.
## v2.5.2 - 2023-07-15
### Fixed
* [Collate Address] when updating address point, do not use the point's address reference if the similarity is below the requirement for associating the address reference and the address (it uses the postcode's center instead)
## v2.5.1 - 2023-07-14
### Fixed
* [collate addresses] block collating addresses to another address reference where the address reference is already the best match
## v2.5.0 - 2023-07-14
### Feature
* Allow filtering on the basis of a user within general tasks lists
* ([#120](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/120)) Adding OrderFilter to the list of social actions.
* ([#125](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/125)) [export] Add a list for people with their associated course
* [export] Add ordering by person's lastname or course opening date in list which concerns accompanying course or peoples
* ([#128](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/128)) [Export] allow to group activities by localisation
* ([#129](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/129)) [export] Add a filter "filter course having an activity between two dates"
* ([#112](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/112)) [addresses] Add a cronjob to re-associate addresses with addresses reference every 6 hours
* Improve filtering layout
### Fixed
* reimplement the visualization of all calculator results
* ([#117](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/117)) Repair my unread notification list with actions and evaluations documents
* ([#126](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/126)) Correct bug in thirdparty API search query: simplify address joins clause for child and parent kind
### DX
* Documentation for database principles
* [cronjob] when a cronjob is executed, it may return an array of data that will be passed as argument on the next execution
### UX
* ([#93](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/93)) Better integration of address details button: look, position, title tag
* ([#93](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/93)) Show address detail button on person and household banners
* Improve residential address position on show onthefly modale
### Traduction francophone des principaux changements
* Ajout d'un filtre "par utilisateur" aux pages de tâche
* Filtre des actions d'accompagnement par date, type, intervenant
* export: liste des usagers concernés avec détail de leurs parcours
* export: ajout d'un regroupement des échanges par localisation
* export: ajout d'un filtre "parcours ayant reçu un échange entre deux dates"
* ajout d'une tâche cron pour associer les adresses à une adresse de référence
* correction: réparation de la liste des notifications sur la page d'accueil, dans le cas où une notification concerne une action ou un document dans une évaluation
* correction: réparation de la recherche des tiers ayant des codes postaux similaires entre les parents et enfants
* meilleure intégration du bouton "détail d'une adresse": améliration de la taille et de la position
* bouton permettant de visualiser les détails d'une adresse (modale avec carte) dans la bannière "Usager" et "Ménage"
* amélioration de la modale permettant de voir les détails d'un usager: les adresses de résidence sont dans la continuité des autres adresses, et non plus dans une colonne séparée
* améliore le design et l'expérience utilisateur des filtres
## v2.4.0 - 2023-07-07
### Feature

80
CONTRIBUTING.md Normal file
View File

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

View File

@@ -94,7 +94,7 @@ class CountPerson implements ExportInterface
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
// we gather all center the user choose.
$centers = array_map(static fn($el) => $el['center'], $acl);
$centers = array_map(static fn ($el) => $el['center'], $acl);
$qb = $this->entityManager->createQueryBuilder();

View File

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

View File

@@ -0,0 +1,84 @@
.. database-principles:
Principes de la base de données
###############################
Cette page donne une compréhension globale de la base de donnée de Chill, et explique quelques détails d'implémentations qui permettent d'accélérer les traitements à partir de la base de donnée, ou de l'exploiter plus aisément.
Cette page est rédigée en français.
.. note::
La stabilité du schéma de la base de donnée n'est pas garantie.
Toutefois, ce dernier évolue relativement peu. Il est rare que des tables ou des colonnes soient supprimées ou renommées. Mais il n'est pas garanti que cela puisse arriver.
Généralités
===========
Une liste commentée de toutes les tables :download:`est disponible au format CSV <./database/table_list.csv`.
Schéma et conventions de nommage
--------------------------------
Au début de l'histoire de Chill, les schémas postgresql n'étaient pas exploités. Les données étaient stockées dans le schéma :code:`public`.
Par la suite, des nouveaux bundles sont apparus, et les tables ont été classées dans des schémas dédiés.
A l'heure actuelle:
- pour les anciens bundle, ceux qui ont déjà des tables dans le schéma public, les nouvelles tables sont ajoutées à ce schéma. Elles sont préfixées par :code:`chill_<nom du bundle>_`;
- pour les bundles plus récents, les tables sont créées dans le schéma dédié
Données avec de l'historicité
-----------------------------
Certaines données sont historisées:
- les référents d'un parcours;
- les statuts d'un parcours;
- la liaison entre les centres et les usagers;
- etc.
Dans ces cas-là, Chill crée généralement deux colonnes, qui sont habituellement nommées :code:`startDate` et :code:`endDate`. Lorsque la colonne :code:`endDate` est à :code:`NULL`, cela signifie que la période n'est pas "fermée". La colonne :code:`startDate` n'est pas nullable.
Dans certains cas, la donnée actuelle (référent d'un parcours, par exemple) est également répétée au niveau de la table en elle-même. Par exemple, la table des parcours :code:`chill_person_accompanying_period` comporte une colonne :code:`step` (le statut du parcours) et :code:`user_id` (id du référent) en plus de l'historique. Bien que redondant, cela simplifie les traitements.
Relations particulières
=======================
Usagers, ménages, adresses
--------------------------
Les usagers ont une adresse au travers des ménages: dans l'interface, l'adresse est inscrite dans le dossier du ménage, et elle est "donnée" aux usagers membres du ménage, **et** qui partagent l'adresse de ce ménage. En effet, il est possible que des usagers "appartiennent" à un ménage sans y être domicilié: c'est le cas, par exemple, des enfants en garde alternée.
L'historique de l'appartenance des usagers au ménage est conservée, de même que l'historique des adresses pour un même ménage.
Les tables en jeu sont les suivantes:
- la table :code:`chill_person_person` liste les usagers;
- la table :code:`chill_person_household_members` liste les appartenances au ménage: il s'agit de la jointure entre les usagers et les ménages:
- les colonnes :code:`startDate` et :code:`endDate` indiquent la date de début et la date de fin de l'appartenance;
- la colonne :code:`shareHousehold` indique si l'utilisateur partage l'adresse du ménage (si oui, sa valeur est :code:`TRUE`)
- la table :code:`chill_person_household` liste les ménages
- la table :code:`chill_person_household_to_addresses` associe les ménages aux adresses;
- la table :code:`chill_main_address` contient les adresses, en indiquant la date de début de validité (:code:`validFrom`) et la fin de validité (:code:`validTo`).
Pour simplifier la résolution des adresses et des usagers, deux vues ont été mises en œuvre:
- la vue :code:`view_chill_person_household_address` reprend, pour chaque usager, l'historique des appartenances au ménage découpée par l'historique des adresses d'un ménage.
Autrement dit, une ligne est créée à chaque fois qu'un usager change de ménage, ou qu'un ménage change d'adresse. Il est donc possible de retrouver l'historique complet des adresses pour un usager donné via cette table.
- la vue :code:`view_chill_person_current_address` reprend l'adresse actuelle des usagers.
Adresses et unités géographiques
--------------------------------
Chill propose des statistiques sur la localisation des adresses par rapport à des zones géographiques (:code:`chill_main_geographical_unit`).
Comme la résolution géographique des adresses est coûteuse en CPU et en temps de traitement, une vue matérialisée a été créée: :code:`view_chill_main_address_geographical_unit`. Elle est rafraichie quotidiennement dans la base de donnée de production.
Liste des tables et commentaires
================================
Une liste commentée de toutes les tables :download:`est disponible au format CSV <./database/table_list.csv`.

View File

@@ -0,0 +1,155 @@
order,table_schema,table_name,commentaire
1,chill_3party,party_category,Catégorie de tiers
2,chill_3party,party_center,Association entre les tiers et les centres (déprécié)
3,chill_3party,party_profession,Profession du tiers (déprécié)
4,chill_3party,third_party,Tiers
5,chill_3party,thirdparty_category,association tiers - catégories
6,chill_asideactivity,asideactivity,Activités annexes
7,chill_asideactivity,asideactivitycategory,Catégories d'activités annexes
8,chill_budget,charge,Charges du budget
9,chill_budget,charge_type,Types de charges
10,chill_budget,resource,Ressources du budget
11,chill_budget,resource_type,Types de ressources
12,chill_calendar,calendar,Rendez-vous
13,chill_calendar,calendar_doc,Document du rendez-vous
14,chill_calendar,calendar_range,Plage de disponibilité
15,chill_calendar,calendar_to_persons,association rendez-vous - usagers
16,chill_calendar,calendar_to_thirdparties,association rendez-vous - tiers
17,chill_calendar,cancel_reason,Motifs d'annulations
18,chill_calendar,invite,Invitation aux rendez-vous
19,chill_doc,accompanyingcourse_document,Documents associés aux parcours
20,chill_doc,document_category,Catégories de documents
21,chill_doc,person_document,Documents associés à l'usagers
22,chill_doc,stored_object,Documents
23,chill_task,recurring_task,Tâches récurrentes (non utilisé)
24,chill_task,single_task,Tâches
25,chill_task,single_task_place_event,Historique des transitions des tâches
26,chill_vendee,adressederelais,
27,chill_vendee,center_polygon
28,chill_vendee,entourage,
29,chill_vendee,geographical_unit
30,chill_vendee,geographical_unit_association
31,chill_vendee,mobilite
32,chill_vendee,niveauetude
33,chill_vendee,security_profile
34,chill_vendee,security_profile_action
35,chill_vendee,security_profile_jobs
36,chill_vendee,situationprofessionelle
37,chill_vendee,statutlogement
38,chill_vendee,tempsdetravail
39,chill_vendee,titredesejour
40,chill_vendee,vendee_person
41,chill_vendee,vendee_person_mineur
42,chill_vendee,vendeeperson_entourage
43,chill_vendee,vendeepersonmineur_adressederelais
44,public,accompanying_periods_scopes,Services associés aux parcours
45,public,activity,Échanges
46,public,activity_activityreason,s
47,public,activity_person,
48,public,activity_storedobject,
49,public,activity_thirdparty,
50,public,activity_user,
51,public,activityreason,Sujets d'échange
52,public,activityreasoncategory,Catégories de sujets
53,public,activitytpresence,Présence aux échanges
54,public,activitytype,Types d'échanges
55,public,activitytypecategory,Catégories de types d'échanges
56,public,centers,"Centres (territoires, agences, etc.)"
57,public,chill_activity_activity_chill_person_socialaction,
58,public,chill_activity_activity_chill_person_socialissue
59,public,chill_docgen_template,Gabarits de documents
60,public,chill_main_address,Adresses
61,public,chill_main_address_legacy,Anciennes adresses (dépréciés)
62,public,chill_main_address_reference,Adresses de référence
63,public,chill_main_civility,Civilités
64,public,chill_main_cronjob_execution,Dernière exécution des tâche cron
65,public,chill_main_geographical_unit,Unités géographiques
66,public,chill_main_geographical_unit_layer,Couches d'unités géographiques
67,public,chill_main_location,Localisations
68,public,chill_main_location_type,Types de localisations
69,public,chill_main_notification,Notifications
70,public,chill_main_notification_addresses_unread
71,public,chill_main_notification_addresses_user
72,public,chill_main_notification_comment,
73,public,chill_main_postal_code,Code postaux
74,public,chill_main_saved_export,Exports enregistrés
75,public,chill_main_user_job,Métiers
76,public,chill_main_workflow_entity,Workflows
77,public,chill_main_workflow_entity_comment
78,public,chill_main_workflow_entity_step,Etapes du workflow
79,public,chill_main_workflow_entity_step_cc_user,
80,public,chill_main_workflow_entity_step_user
81,public,chill_main_workflow_entity_step_user_by_accesskey,
82,public,chill_main_workflow_entity_subscriber_to_final,
83,public,chill_main_workflow_entity_subscriber_to_step
84,public,chill_person_accompanying_period,Parcours d'accompagnement
85,public,chill_person_accompanying_period_closingmotive,Motifs de cloture des parcours
86,public,chill_person_accompanying_period_comment,Commentaires des parcours
87,public,chill_person_accompanying_period_location_history,Historique de la localisatio ndes parcours
88,public,chill_person_accompanying_period_origin,Origine des parcours
89,public,chill_person_accompanying_period_participation,Appartenance des usagers au parcours
90,public,chill_person_accompanying_period_resource,Personnes ressources d'un parcours
91,public,chill_person_accompanying_period_social_issues,
92,public,chill_person_accompanying_period_step_history
93,public,chill_person_accompanying_period_user_history
94,public,chill_person_accompanying_period_work,Actions d'accompagnements
95,public,chill_person_accompanying_period_work_evaluation,Évaluations (dans les actions d'accompagnements)
96,public,chill_person_accompanying_period_work_evaluation_document,Documents des évaluations
97,public,chill_person_accompanying_period_work_goal,Objectifs d'une actions
98,public,chill_person_accompanying_period_work_goal_result,Objectifs et résultats d'une action
99,public,chill_person_accompanying_period_work_person,Usagers associés à une actions
100,public,chill_person_accompanying_period_work_referrer,Référents d'une actions
101,public,chill_person_accompanying_period_work_result,Résultats d'une action
102,public,chill_person_accompanying_period_work_third_party,Tiers traitants d'une action
103,public,chill_person_alt_name,"Noms supplémentaires d'un usager (nom marital, etc.)"
104,public,chill_person_household,Ménages
105,public,chill_person_household_composition,
106,public,chill_person_household_composition_type,Types de composition de ménage
107,public,chill_person_household_members,Membres du ménages
108,public,chill_person_household_position,Positions dans le ménage
109,public,chill_person_household_to_addresses,Association adresses - ménages
110,public,chill_person_marital_status,Etats civils
111,public,chill_person_not_duplicate,
112,public,chill_person_person,Usagers
113,public,chill_person_person_center_history,Historique des centres d'un usagers
114,public,chill_person_persons_to_addresses,Déprécié
115,public,chill_person_phone,Numéros d etéléphone supplémentaires d'un usager
116,public,chill_person_relations,Types de relations de filiation
117,public,chill_person_relationships,Relations de filiations
118,public,chill_person_residential_address,Adresses de résidences
119,public,chill_person_resource,Personnes ressources (pour les personnes)
120,public,chill_person_resource_kind,Type de personnes ressources
121,public,chill_person_social_action,Liste des actions d'accompagnement
122,public,chill_person_social_action_goal,Objectifs associés à une action
123,public,chill_person_social_action_result,Résultats associés à une action
124,public,chill_person_social_issue,Problématiques sociales
125,public,chill_person_social_work_evaluation,Evaluations disponibles
126,public,chill_person_social_work_evaluation_action,Associations entre les évaluations et les actions
127,public,chill_person_social_work_goal,Objectifs disponibles pour une actions
128,public,chill_person_social_work_goal_result,Objectifs et résultats disponible pour une action
129,public,chill_person_social_work_result,Résultats disponibles pour une action
130,public,country,Pays
131,public,custom_field_long_choice_options,
132,public,customfield
133,public,customfieldsdefaultgroup
134,public,customfieldsgroup
135,public,geography_columns,Table liée à postgis
136,public,geometry_columns,Table liée à postgis
137,public,group_centers,
138,public,language,Langues
139,public,messenger_messages,Table système
140,public,migration_versions,Table système
141,public,permission_groups
142,public,permissionsgroup_rolescope
143,public,persons_spoken_languages
144,public,regroupment,Regroupement de centres
145,public,regroupment_center,
146,public,role_scopes,
147,public,scopes,Services
148,public,spatial_ref_sys,Table système (postgis)
149,public,user_groupcenter,
150,public,users,Utilisateurs
151,public,view_chill_person_accompanying_period_info,
152,public,view_chill_person_current_address
153,public,view_chill_person_household_address
154,public,view_chill_person_person_center_history_current
Can't render this file because it has a wrong number of fields in line 28.

View File

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

View File

@@ -56,7 +56,7 @@ class ChillMainConfiguration implements ConfigurationInterface
->end() // end of widgets
->end() // end of root/children
->end() // end of root
;
;
return $treeBuilder;
}

View File

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

View File

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

View File

@@ -72,8 +72,7 @@ final class ActivityController extends AbstractController
private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory,
private readonly TranslatableStringHelperInterface $translatableStringHelper,
private readonly PaginatorFactory $paginatorFactory,
) {
}
) {}
/**
* Deletes a Activity entity.
@@ -259,8 +258,8 @@ final class ActivityController extends AbstractController
$filterArgs = [
'my_activities' => $filter->getSingleCheckboxData('my_activities'),
'types' => $filter->getEntityChoiceData('activity_types'),
'jobs' => $filter->getEntityChoiceData('jobs'),
'types' => $filter->hasEntityChoice('activity_types') ? $filter->getEntityChoiceData('activity_types') : [],
'jobs' => $filter->hasEntityChoice('jobs') ? $filter->getEntityChoiceData('jobs') : [],
'before' => $filter->getDateRangeData('activity_date')['to'],
'after' => $filter->getDateRangeData('activity_date')['from'],
];
@@ -320,28 +319,34 @@ final class ActivityController extends AbstractController
private function buildFilterOrder(AccompanyingPeriod|Person $associated): FilterOrderHelper
{
$filterBuilder = $this->filterOrderHelperFactory->create(self::class);
$types = $this->activityACLAwareRepository->findActivityTypeByAssociated($associated);
$jobs = $this->activityACLAwareRepository->findUserJobByAssociated($associated);
$filterBuilder
->addDateRange('activity_date', 'activity.date')
->addSingleCheckbox('my_activities', 'activity_filter.My activities')
->addEntityChoice('activity_types', 'activity_filter.Types', \Chill\ActivityBundle\Entity\ActivityType::class, $types, [
'choice_label' => function (\Chill\ActivityBundle\Entity\ActivityType $activityType) {
$text = match ($activityType->hasCategory()) {
true => $this->translatableStringHelper->localize($activityType->getCategory()->getName()) . ' > ',
false => '',
};
->addSingleCheckbox('my_activities', 'activity_filter.My activities');
return $text . $this->translatableStringHelper->localize($activityType->getName());
}
])
->addEntityChoice('jobs', 'activity_filter.Jobs', UserJob::class, $jobs, [
'choice_label' => fn (UserJob $u) => $this->translatableStringHelper->localize($u->getLabel())
])
;
if (1 < count($types)) {
$filterBuilder
->addEntityChoice('activity_types', 'activity_filter.Types', \Chill\ActivityBundle\Entity\ActivityType::class, $types, [
'choice_label' => function (\Chill\ActivityBundle\Entity\ActivityType $activityType) {
$text = match ($activityType->hasCategory()) {
true => $this->translatableStringHelper->localize($activityType->getCategory()->getName()) . ' > ',
false => '',
};
return $text . $this->translatableStringHelper->localize($activityType->getName());
}
]);
}
if (1 < count($jobs)) {
$filterBuilder
->addEntityChoice('jobs', 'activity_filter.Jobs', UserJob::class, $jobs, [
'choice_label' => fn (UserJob $u) => $this->translatableStringHelper->localize($u->getLabel())
]);
}
return $filterBuilder->build();
}

View File

@@ -0,0 +1,80 @@
<?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\Aggregator;
use Chill\ActivityBundle\Export\Declarations;
use Chill\ActivityBundle\Repository\ActivityTypeRepositoryInterface;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\MainBundle\Repository\LocationRepository;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Closure;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
use function in_array;
final readonly class ActivityLocationAggregator implements AggregatorInterface
{
public const KEY = 'activity_location_aggregator';
public function addRole(): ?string
{
return null;
}
public function alterQuery(QueryBuilder $qb, $data)
{
if (!in_array('actloc', $qb->getAllAliases(), true)) {
$qb->leftJoin('activity.location', 'actloc');
}
$qb->addSelect(sprintf('actloc.name AS %s', self::KEY));
$qb->addGroupBy(self::KEY);
}
public function applyOn(): string
{
return Declarations::ACTIVITY;
}
public function buildForm(FormBuilderInterface $builder)
{
// no form required for this aggregator
}
public function getFormDefaultData(): array
{
return [];
}
public function getLabels($key, array $values, $data): Closure
{
return function ($value): string {
if ('_header' === $value) {
return 'export.aggregator.activity.by_location.Activity Location';
}
if (null === $value || '' === $value) {
return '';
}
return $value;
};
}
public function getQueryKeys($data): array
{
return [self::KEY];
}
public function getTitle()
{
return 'export.aggregator.activity.by_location.Title';
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -22,11 +22,11 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class EmergencyFilter implements FilterInterface
{
private const CHOICES = [
'activity is emergency' => true,
'activity is not emergency' => false,
'activity is emergency' => 'true',
'activity is not emergency' => 'false',
];
private const DEFAULT_CHOICE = false;
private const DEFAULT_CHOICE = 'false';
private TranslatorInterface $translator;

View File

@@ -0,0 +1,89 @@
<?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\Filter\ACPFilters;
use Chill\ActivityBundle\Entity\Activity;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Form\Type\PickRollingDateType;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInterface
{
public function __construct(
private RollingDateConverterInterface $rollingDateConverter,
) {}
public function getTitle()
{
return 'export.filter.activity.course_having_activity_between_date.Title';
}
public function buildForm(FormBuilderInterface $builder)
{
$builder
->add('start_date', PickRollingDateType::class, [
'label' => 'export.filter.activity.course_having_activity_between_date.Receiving an activity after'
])
->add('end_date', PickRollingDateType::class, [
'label' => 'export.filter.activity.course_having_activity_between_date.Receiving an activity before'
]);
}
public function getFormDefaultData(): array
{
return [
'start_date' => new RollingDate(RollingDate::T_YEAR_CURRENT_START),
'end_date' => new RollingDate(RollingDate::T_TODAY)
];
}
public function describeAction($data, $format = 'string')
{
return [
'export.filter.activity.course_having_activity_between_date.Only course having an activity between from and to',
[
'from' => $this->rollingDateConverter->convert($data['start_date']),
'to' => $this->rollingDateConverter->convert($data['end_date']),
]
];
}
public function addRole(): ?string
{
return null;
}
public function alterQuery(QueryBuilder $qb, $data)
{
$alias = 'act_period_having_act_betw_date_alias';
$from = 'act_period_having_act_betw_date_start';
$to = 'act_period_having_act_betw_date_end';
$qb->andWhere(
$qb->expr()->exists(
'SELECT 1 FROM ' . Activity::class . " {$alias} WHERE {$alias}.date >= :{$from} AND {$alias}.date < :{$to} AND {$alias}.accompanyingPeriod = acp"
)
);
$qb
->setParameter($from, $this->rollingDateConverter->convert($data['start_date']))
->setParameter($to, $this->rollingDateConverter->convert($data['end_date']));
}
public function applyOn()
{
return \Chill\PersonBundle\Export\Declarations::ACP_TYPE;
}
}

View File

@@ -47,8 +47,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos
private EntityManagerInterface $em,
private Security $security,
private RequestStack $requestStack,
) {
}
) {}
/**
* @throws NonUniqueResultException
@@ -322,7 +321,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos
$counter++;
}
foreach ($person->getAccompanyingPeriodParticipations() as $participation) {
foreach ($person->getAccompanyingPeriodParticipations() as $participation) {
if (!$this->security->isGranted(ActivityVoter::SEE, $participation->getAccompanyingPeriod())) {
continue;
}

View File

@@ -43,8 +43,7 @@ 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
{

View File

@@ -36,8 +36,7 @@ final class AccompanyingPeriodActivityGenericDocProvider implements GenericDocFo
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
{

View File

@@ -29,8 +29,7 @@ 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
{

View File

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

View File

@@ -135,6 +135,10 @@ services:
tags:
- { name: chill.export_filter, alias: 'accompanyingcourse_has_no_activity_filter' }
Chill\ActivityBundle\Export\Filter\ACPFilters\PeriodHavingActivityBetweenDatesFilter:
tags:
- { name: chill.export_filter, alias: 'period_having_activity_betw_dates_filter' }
## Aggregators
Chill\ActivityBundle\Export\Aggregator\PersonAggregators\ActivityReasonAggregator:
tags:
@@ -144,6 +148,10 @@ services:
tags:
- { name: chill.export_aggregator, alias: activity_common_type_aggregator }
Chill\ActivityBundle\Export\Aggregator\ActivityLocationAggregator:
tags:
- { name: chill.export_aggregator, alias: activity_common_location_aggregator }
chill.activity.export.user_aggregator:
class: Chill\ActivityBundle\Export\Aggregator\ActivityUserAggregator
tags:

View File

@@ -0,0 +1,5 @@
export:
filter:
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}

View File

@@ -96,9 +96,6 @@ activity_filter:
My activities: Mes échanges (où j'interviens)
Types: Par type d'échange
Jobs: Par métier impliqué
By: Filtrer par
Search: Chercher dans la liste
By date: Filtrer par date
#timeline
'%user% has done an %activity_type%': '%user% a effectué un échange de type "%activity_type%"'
@@ -376,6 +373,12 @@ export:
by_usersscope:
Filter by users scope: Filtrer les échanges par services d'au moins un utilisateur participant
'Filtered activity by users scope: only %scopes%': 'Filtré par service d''au moins un utilisateur participant: seulement %scopes%'
course_having_activity_between_date:
Title: Filtre les parcours ayant reçu un échange entre deux dates
Receiving an activity after: Ayant reçu un échange après le
Receiving an activity before: Ayant reçu un échange avant le
aggregator:
activity:
by_sent_received:
@@ -383,6 +386,9 @@ export:
is sent: envoyé
is received: reçu
Group activity by sentreceived: Grouper les échanges par envoyé / reçu
by_location:
Activity Location: Localisation de l'échange
Title: Grouper les échanges par localisation de l'échange
generic_doc:
filter:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,11 +1,12 @@
{% macro table_elements(elements, family) %}
{% macro table_elements(elements, type) %}
<table class="table table-bordered border-dark budget-table">
<thead>
<tr>
<th class="{{ family }} el-type">{{ 'Budget element type'|trans }}</th>
<th class="{{ family }}">{{ 'Amount'|trans }}</th>
<th class="{{ family }}">{{ 'Validity period'|trans }}</th>
<th class="{{ family }}">&nbsp;</th>
<th class="{{ type }} el-type">{{ 'Budget element type'|trans }}</th>
<th class="{{ type }}">{{ 'Amount'|trans }}</th>
<th class="{{ type }}">{{ 'Validity period'|trans }}</th>
<th class="{{ type }}">&nbsp;</th>
</tr>
</thead>
<tbody>
@@ -38,17 +39,17 @@
<ul class="record_actions">
{% if is_granted('CHILL_BUDGET_ELEMENT_SEE', f) %}
<li>
<a href="{{ path('chill_budget_' ~ family ~ '_view', { 'id': f.id } ) }}" class="btn btn-sm btn-show"></a>
<a href="{{ path('chill_budget_' ~ type ~ '_view', { 'id': f.id } ) }}" class="btn btn-sm btn-show"></a>
</li>
{% endif %}
{% if is_granted('CHILL_BUDGET_ELEMENT_UPDATE', f) %}
<li>
<a href="{{ path('chill_budget_' ~ family ~'_edit', { 'id': f.id } ) }}" class="btn btn-sm btn-edit"></a>
<a href="{{ path('chill_budget_' ~ type ~'_edit', { 'id': f.id } ) }}" class="btn btn-sm btn-edit"></a>
</li>
{% endif %}
{% if is_granted('CHILL_BUDGET_ELEMENT_DELETE', f) %}
<li>
<a href="{{ path('chill_budget_' ~ family ~ '_delete', { 'id': f.id } ) }}" class="btn btn-sm btn-delete"></a>
<a href="{{ path('chill_budget_' ~ type ~ '_delete', { 'id': f.id } ) }}" class="btn btn-sm btn-delete"></a>
</li>
{% endif %}
</ul>
@@ -69,7 +70,7 @@
</table>
{% endmacro %}
{% macro table_results(actualCharges, actualResources) %}
{% macro table_results(actualCharges, actualResources, results) %}
{% set totalCharges = 0 %}
{% for c in actualCharges %}
@@ -97,6 +98,20 @@
{{ result|format_currency('EUR') }}
</td>
</tr>
{% for result in results %}
<tr>
<td>{{ result.label }}</td>
<td>
{% if result.type == 'currency' %}
{{ result.result|format_currency('EUR') }}
{% elseif result.type == 'percentage' %}
{{ result.result|round(2, 'ceil') ~ '%' }}
{% else %}
{{ result.result|round(2, 'common') }}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endmacro %}

View File

@@ -25,7 +25,7 @@
<div class="mt-5">
<h3 class="subtitle">{{ 'Budget calculator'|trans }}</h3>
{{ table_results(charges, resources) }}
{{ table_results(charges, resources, results) }}
</div>
{% if is_granted('CHILL_BUDGET_ELEMENT_CREATE', person) %}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -24,8 +24,7 @@ final readonly class AccompanyingCourseDocumentGenericDocRenderer implements Gen
public function __construct(
private AccompanyingCourseDocumentRepository $accompanyingCourseDocumentRepository,
private PersonDocumentRepository $personDocumentRepository,
) {
}
) {}
public function supports(GenericDocDTO $genericDocDTO, $options = []): bool
{

View File

@@ -25,8 +25,7 @@ final readonly class GenericDocExtensionRuntime implements RuntimeExtensionInter
* @var list<GenericDocRendererInterface>
*/
private iterable $renderers,
) {
}
) {}
/**
* @throws RuntimeError
@@ -46,5 +45,4 @@ final readonly class GenericDocExtensionRuntime implements RuntimeExtensionInter
throw new \LogicException("no renderer found");
}
}

View File

@@ -20,5 +20,4 @@ interface GenericDocRendererInterface
public function getTemplate(GenericDocDTO $genericDocDTO, $options = []): string;
public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array;
}

View File

@@ -38,8 +38,7 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA
private CenterResolverManagerInterface $centerResolverManager,
private AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser,
private Security $security,
) {
}
) {}
public function buildQueryByPerson(Person $person): QueryBuilder
{
@@ -98,7 +97,6 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA
continue;
}
$orPersonId[] = $participation->getPerson()->getId();
}
if ([] === $orPersonId) {

View File

@@ -54,9 +54,6 @@ class FetchQueryToSqlBuilderTest extends KernelTestCase
);
self::assertEquals(['foo', 'bar_baz', 'baz'], $params);
self::assertEquals([Types::STRING, Types::STRING, Types::STRING], $types);
}
public function testToSqlWithoutWhere(): void
@@ -85,5 +82,4 @@ class FetchQueryToSqlBuilderTest extends KernelTestCase
self::assertEquals([], $params);
self::assertEquals([], $types);
}
}

View File

@@ -142,7 +142,6 @@ class PersonDocumentACLAwareRepositoryTest extends KernelTestCase
yield [$period, new DateTimeImmutable('2 years ago'), new DateTimeImmutable('1 year ago'), null];
yield [$period, null, null, 'test'];
yield [$period, new DateTimeImmutable('2 years ago'), new DateTimeImmutable('1 year ago'), 'test'];
}
public function provideDataBuildFetchQueryForPerson(): iterable
@@ -154,5 +153,4 @@ class PersonDocumentACLAwareRepositoryTest extends KernelTestCase
yield [null, null, 'test'];
yield [new DateTimeImmutable('2 years ago'), new DateTimeImmutable('1 year ago'), 'test'];
}
}

View File

@@ -46,8 +46,7 @@ class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandler
public function getEntityData(EntityWorkflow $entityWorkflow, array $options = []): array
{
$course = $this->getRelatedEntity($entityWorkflow)
->getCourse();
$course = $this->getRelatedEntity($entityWorkflow)?->getCourse();
$persons = [];
if (null !== $course) {

View File

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

View File

@@ -16,6 +16,4 @@ use Doctrine\ORM\EntityRepository;
/**
* Class EventRepository.
*/
class EventRepository extends EntityRepository
{
}
class EventRepository extends EntityRepository {}

View File

@@ -152,7 +152,7 @@ class EventSearch extends AbstractSearch
$orWhere = $qb->expr()->orX();
foreach ($reachableCenters as $center) {
$n = $n+1;
$n = $n + 1;
$circles = $this->authorizationHelper->getReachableScopes(
$this->security->getUser(),
'CHILL_EVENT_SEE',

View File

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

View File

@@ -150,9 +150,7 @@ abstract class AbstractCRUDController extends AbstractController
return new $class();
}
protected function customizeQuery(string $action, Request $request, $query): void
{
}
protected function customizeQuery(string $action, Request $request, $query): void {}
protected function getActionConfig(string $action)
{

View File

@@ -242,13 +242,9 @@ class CRUDController extends AbstractController
/**
* Customize the form created by createFormFor.
*/
protected function customizeForm(string $action, FormInterface $form)
{
}
protected function customizeForm(string $action, FormInterface $form) {}
protected function customizeQuery(string $action, Request $request, $query): void
{
}
protected function customizeQuery(string $action, Request $request, $query): void {}
/**
* @param $id
@@ -927,9 +923,7 @@ class CRUDController extends AbstractController
}
}
protected function onFormValid(string $action, object $entity, FormInterface $form, Request $request)
{
}
protected function onFormValid(string $action, object $entity, FormInterface $form, Request $request) {}
/**
* @param $action
@@ -952,77 +946,55 @@ class CRUDController extends AbstractController
/**
* @param $entity
*/
protected function onPostFlush(string $action, $entity, FormInterface $form, Request $request)
{
}
protected function onPostFlush(string $action, $entity, FormInterface $form, Request $request) {}
/**
* method used by indexAction.
*
* @param mixed $query
*/
protected function onPostIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, $query)
{
}
protected function onPostIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, $query) {}
/**
* method used by indexAction.
*
* @param mixed $entities
*/
protected function onPostIndexFetchQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, $entities)
{
}
protected function onPostIndexFetchQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, $entities) {}
/**
* @param $entity
*/
protected function onPostPersist(string $action, $entity, FormInterface $form, Request $request)
{
}
protected function onPostPersist(string $action, $entity, FormInterface $form, Request $request) {}
/**
* @param $entity
*/
protected function onPostRemove(string $action, $entity, FormInterface $form, Request $request)
{
}
protected function onPostRemove(string $action, $entity, FormInterface $form, Request $request) {}
protected function onPreDelete(string $action, Request $request)
{
}
protected function onPreDelete(string $action, Request $request) {}
/**
* @param $entity
*/
protected function onPreFlush(string $action, $entity, FormInterface $form, Request $request)
{
}
protected function onPreFlush(string $action, $entity, FormInterface $form, Request $request) {}
protected function onPreIndex(string $action, Request $request)
{
}
protected function onPreIndex(string $action, Request $request) {}
/**
* method used by indexAction.
*/
protected function onPreIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator)
{
}
protected function onPreIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator) {}
/**
* @param $entity
*/
protected function onPrePersist(string $action, $entity, FormInterface $form, Request $request)
{
}
protected function onPrePersist(string $action, $entity, FormInterface $form, Request $request) {}
/**
* @param $entity
*/
protected function onPreRemove(string $action, $entity, FormInterface $form, Request $request)
{
}
protected function onPreRemove(string $action, $entity, FormInterface $form, Request $request) {}
/**
* Add ordering fields in the query build by self::queryEntities.

View File

@@ -16,6 +16,4 @@ use Symfony\Component\Form\AbstractType;
/**
* Class CRUDDeleteEntityForm.
*/
class CRUDDeleteEntityForm extends AbstractType
{
}
class CRUDDeleteEntityForm extends AbstractType {}

View File

@@ -213,14 +213,8 @@ class LoadPostalCodesCommand extends Command
}
}
class ExistingPostalCodeException extends Exception
{
}
class ExistingPostalCodeException extends Exception {}
class CountryCodeNotFoundException extends Exception
{
}
class CountryCodeNotFoundException extends Exception {}
class PostalCodeNotValidException extends Exception
{
}
class PostalCodeNotValidException extends Exception {}

View File

@@ -11,176 +11,22 @@ declare(strict_types=1);
namespace Chill\MainBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Form\CenterType;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Chill\MainBundle\Pagination\PaginatorInterface;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request;
/**
* Class CenterController.
*/
class CenterController extends AbstractController
class CenterController extends CRUDController
{
/**
* Creates a new Center entity.
*/
public function createAction(Request $request)
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{
$center = new Center();
$form = $this->createCreateForm($center);
$form->handleRequest($request);
$query->addOrderBy('e.name', 'ASC');
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($center);
$em->flush();
return $this->redirect($this->generateUrl('admin_center'));
}
return $this->render('@ChillMain/Center/new.html.twig', [
'entity' => $center,
'form' => $form->createView(),
]);
}
/**
* Displays a form to edit an existing Center entity.
*
* @param mixed $id
*/
public function editAction($id)
{
$em = $this->getDoctrine()->getManager();
$center = $em->getRepository(\Chill\MainBundle\Entity\Center::class)->find($id);
if (!$center) {
throw $this->createNotFoundException('Unable to find Center entity.');
}
$editForm = $this->createEditForm($center);
return $this->render('@ChillMain/Center/edit.html.twig', [
'entity' => $center,
'edit_form' => $editForm->createView(),
]);
}
/**
* Lists all Center entities.
*/
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository(\Chill\MainBundle\Entity\Center::class)->findAll();
return $this->render('@ChillMain/Center/index.html.twig', [
'entities' => $entities,
]);
}
/**
* Displays a form to create a new Center entity.
*/
public function newAction()
{
$center = new Center();
$form = $this->createCreateForm($center);
return $this->render('@ChillMain/Center/new.html.twig', [
'entity' => $center,
'form' => $form->createView(),
]);
}
/**
* Finds and displays a Center entity.
*
* @param mixed $id
*/
public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$center = $em->getRepository(\Chill\MainBundle\Entity\Center::class)->find($id);
if (!$center) {
throw $this->createNotFoundException('Unable to find Center entity.');
}
return $this->render('@ChillMain/Center/show.html.twig', [
'entity' => $center,
]);
}
/**
* Edits an existing Center entity.
*
* @param mixed $id
*/
public function updateAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$center = $em->getRepository(\Chill\MainBundle\Entity\Center::class)->find($id);
if (!$center) {
throw $this->createNotFoundException('Unable to find Center entity.');
}
$editForm = $this->createEditForm($center);
$editForm->handleRequest($request);
if ($editForm->isValid()) {
$em->flush();
return $this->redirect($this->generateUrl('admin_center_edit', ['id' => $id]));
}
return $this->render('@ChillMain/Center/edit.html.twig', [
'entity' => $center,
'edit_form' => $editForm->createView(),
]);
}
/**
* Creates a form to create a Center entity.
*
* @param Center $center The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createCreateForm(Center $center)
{
$form = $this->createForm(CenterType::class, $center, [
'action' => $this->generateUrl('admin_center_create'),
'method' => 'POST',
]);
$form->add('submit', SubmitType::class, ['label' => 'Create']);
return $form;
}
/**
* Creates a form to edit a Center entity.
*
* @param Center $center The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createEditForm(Center $center)
{
$form = $this->createForm(CenterType::class, $center, [
'action' => $this->generateUrl('admin_center_update', ['id' => $center->getId()]),
'method' => 'PUT',
]);
$form->add('submit', SubmitType::class, ['label' => 'Update']);
return $form;
return parent::orderQuery($action, $query, $request, $paginator);
}
}

View File

@@ -13,6 +13,4 @@ namespace Chill\MainBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
class LocationTypeController extends CRUDController
{
}
class LocationTypeController extends CRUDController {}

View File

@@ -44,7 +44,5 @@ class LoginController extends AbstractController
]);
}
public function LoginCheckAction(Request $request)
{
}
public function LoginCheckAction(Request $request) {}
}

View File

@@ -50,8 +50,7 @@ final class PermissionsGroupController extends AbstractController
private readonly EntityManagerInterface $em,
private readonly PermissionsGroupRepository $permissionsGroupRepository,
private readonly RoleScopeRepository $roleScopeRepository,
) {
}
) {}
/**
*/

View File

@@ -27,8 +27,7 @@ final readonly class UserExportController
private UserRepositoryInterface $userRepository,
private Security $security,
private TranslatorInterface $translator,
) {
}
) {}
/**
* @throws \League\Csv\CannotInsertRecord

View File

@@ -19,5 +19,13 @@ interface CronJobInterface
public function getKey(): string;
public function run(): void;
/**
* Execute the cronjob
*
* If data is returned, this data is passed as argument on the next execution
*
* @param array $lastExecutionData the data which was returned from the previous execution
* @return array|null optionally return an array with the same data than the previous execution
*/
public function run(array $lastExecutionData): null|array;
}

View File

@@ -14,6 +14,7 @@ namespace Chill\MainBundle\Cron;
use Chill\MainBundle\Entity\CronJobExecution;
use Chill\MainBundle\Repository\CronJobExecutionRepositoryInterface;
use DateTimeImmutable;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\EntityManagerInterface;
use Exception;
use Psr\Log\LoggerInterface;
@@ -46,6 +47,8 @@ class CronManager implements CronManagerInterface
private const UPDATE_BEFORE_EXEC = 'UPDATE ' . CronJobExecution::class . ' cr SET cr.lastStart = :now WHERE cr.key = :key';
private const UPDATE_LAST_EXECUTION_DATA = 'UPDATE ' . CronJobExecution::class . ' cr SET cr.lastExecutionData = :data WHERE cr.key = :key';
private CronJobExecutionRepositoryInterface $cronJobExecutionRepository;
private EntityManagerInterface $entityManager;
@@ -85,6 +88,8 @@ class CronManager implements CronManagerInterface
foreach ($orderedJobs as $job) {
if ($job->canRun($lasts[$job->getKey()] ?? null)) {
if (array_key_exists($job->getKey(), $lasts)) {
$executionData = $lasts[$job->getKey()]->getLastExecutionData();
$this->entityManager
->createQuery(self::UPDATE_BEFORE_EXEC)
->setParameters([
@@ -96,12 +101,17 @@ class CronManager implements CronManagerInterface
$execution = new CronJobExecution($job->getKey());
$this->entityManager->persist($execution);
$this->entityManager->flush();
$executionData = $execution->getLastExecutionData();
}
$this->entityManager->clear();
// note: at this step, the entity manager does not have any entity CronJobExecution
// into his internal memory
try {
$this->logger->info(sprintf('%sWill run job', self::LOG_PREFIX), ['job' => $job->getKey()]);
$job->run();
$result = $job->run($executionData);
$this->entityManager
->createQuery(self::UPDATE_AFTER_EXEC)
@@ -112,6 +122,14 @@ class CronManager implements CronManagerInterface
])
->execute();
if (null !== $result) {
$this->entityManager
->createQuery(self::UPDATE_LAST_EXECUTION_DATA)
->setParameter('data', $result, Types::JSON)
->setParameter('key', $job->getKey(), Types::STRING)
->execute();
}
$this->logger->info(sprintf('%sSuccessfully run job', self::LOG_PREFIX), ['job' => $job->getKey()]);
return;
@@ -133,7 +151,7 @@ class CronManager implements CronManagerInterface
}
/**
* @return array<0: CronJobInterface[], 1: array<string, CronJobExecution>>
* @return array{0: array<CronJobInterface>, 1: array<string, CronJobExecution>}
*/
private function getOrderedJobs(): array
{
@@ -174,7 +192,7 @@ class CronManager implements CronManagerInterface
{
foreach ($this->jobs as $job) {
if ($job->getKey() === $forceJob) {
$job->run();
$job->run([]);
}
}
}

View File

@@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\DependencyInjection;
use Chill\MainBundle\Controller\AddressApiController;
use Chill\MainBundle\Controller\CenterController;
use Chill\MainBundle\Controller\CivilityApiController;
use Chill\MainBundle\Controller\CivilityController;
use Chill\MainBundle\Controller\CountryController;
@@ -44,6 +45,7 @@ use Chill\MainBundle\Doctrine\DQL\Unaccent;
use Chill\MainBundle\Doctrine\ORM\Hydration\FlatHierarchyEntityHydrator;
use Chill\MainBundle\Doctrine\Type\NativeDateIntervalType;
use Chill\MainBundle\Doctrine\Type\PointType;
use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Entity\Civility;
use Chill\MainBundle\Entity\Country;
use Chill\MainBundle\Entity\GeographicalUnitLayer;
@@ -53,6 +55,7 @@ use Chill\MainBundle\Entity\LocationType;
use Chill\MainBundle\Entity\Regroupment;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\UserJob;
use Chill\MainBundle\Form\CenterType;
use Chill\MainBundle\Form\CivilityType;
use Chill\MainBundle\Form\CountryType;
use Chill\MainBundle\Form\LanguageType;
@@ -524,6 +527,27 @@ class ChillMainExtension extends Extension implements
],
],
],
[
'class' => Center::class,
'name' => 'center',
'base_path' => '/admin/center',
'form_class' => CenterType::class,
'controller' => CenterController::class,
'actions' => [
'index' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/Admin/Center/index.html.twig',
],
'new' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/Admin/Center/new.html.twig',
],
'edit' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/Admin/Center/edit.html.twig',
],
],
],
],
'apis' => [
[

View File

@@ -48,6 +48,11 @@ class Center implements HasCenterInterface
*/
private string $name = '';
/**
* @ORM\Column(type="boolean")
*/
private bool $isActive = true;
/**
* @var Collection<Regroupment>
* @ORM\ManyToMany(targetEntity=Regroupment::class, mappedBy="centers")
@@ -121,6 +126,11 @@ class Center implements HasCenterInterface
return $this->regroupments;
}
public function getIsActive(): bool
{
return $this->isActive;
}
/**
* @param $name
*
@@ -132,4 +142,11 @@ class Center implements HasCenterInterface
return $this;
}
public function setIsActive(bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
}

View File

@@ -31,7 +31,6 @@ class CronJobExecution
private string $key;
/**
* @var DateTimeImmutable
* @ORM\Column(type="datetime_immutable", nullable=true, options={"default": null})
*/
private ?DateTimeImmutable $lastEnd = null;
@@ -46,6 +45,11 @@ class CronJobExecution
*/
private ?int $lastStatus = null;
/**
* @ORM\Column(type="json", options={"default": "'{}'::jsonb", "jsonb": true})
*/
private array $lastExecutionData = [];
public function __construct(string $key)
{
$this->key = $key;
@@ -92,4 +96,16 @@ class CronJobExecution
return $this;
}
public function getLastExecutionData(): array
{
return $this->lastExecutionData;
}
public function setLastExecutionData(array $lastExecutionData): CronJobExecution
{
$this->lastExecutionData = $lastExecutionData;
return $this;
}
}

View File

@@ -175,9 +175,7 @@ class User implements UserInterface
return $this;
}
public function eraseCredentials()
{
}
public function eraseCredentials() {}
public function getAbsenceStart(): ?DateTimeImmutable
{

View File

@@ -26,8 +26,7 @@ final readonly class ExportFormHelper
private AuthorizationHelperForCurrentUserInterface $authorizationHelper,
private ExportManager $exportManager,
private FormFactoryInterface $formFactory,
) {
}
) {}
public function getDefaultData(string $step, ExportInterface|DirectExportInterface $export, array $options = []): array
{

View File

@@ -97,7 +97,7 @@ interface ExportInterface extends ExportElementInterface
* @param mixed[] $values The values from the result. if there are duplicates, those might be given twice. Example: array('FR', 'BE', 'CZ', 'FR', 'BE', 'FR')
* @param mixed $data The data from the export's form (as defined in `buildForm`)
*
* @return callable(null|string|int|float|'_header' $value): string|int|\DateTimeInterface where the first argument is the value, and the function should return the label to show in the formatted file. Example : `function($countryCode) use ($countries) { return $countries[$countryCode]->getName(); }`
* @return (callable(null|string|int|float|'_header' $value): string|int|\DateTimeInterface) where the first argument is the value, and the function should return the label to show in the formatted file. Example : `function($countryCode) use ($countries) { return $countries[$countryCode]->getName(); }`
*/
public function getLabels($key, array $values, $data);

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