mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-10 16:55:00 +00:00
Compare commits
203 Commits
user_filte
...
v2.6.0
Author | SHA1 | Date | |
---|---|---|---|
80ea712475 | |||
0e47a1cf59 | |||
6a554c1c8c | |||
0bd8ad84a8 | |||
115d71ad34 | |||
7ca2380dad | |||
ac9704f154 | |||
87ea841aaa | |||
dccc2bf4a5 | |||
599510c3b9 | |||
18971b3204 | |||
735a4aa97c | |||
7cdbee2d0f | |||
95dfb4ba52 | |||
22241ca7b1 | |||
13faa572ef | |||
72f0c460ab | |||
c546c4a207 | |||
5cea4a647d | |||
207e109d1e | |||
758ad9bc87 | |||
90c8f1e3cf | |||
05d86f1a70 | |||
99cf7b8e8d | |||
68f2c7df25 | |||
6f1dd5b3f2 | |||
e7a9b10d0d | |||
b4f8c7d261 | |||
65b585d4a9 | |||
2cec4a770e | |||
52c5807cd5 | |||
bf7f375daf | |||
cd85e37c1b | |||
67e9127f8e | |||
754515f185 | |||
15fbfbb621 | |||
cf294541ae | |||
b4f9501af5 | |||
c1a586dfb9 | |||
57a1a49fac | |||
19789acbbe | |||
77180ebb0c | |||
6e2377b7ee | |||
4d111cd6cf | |||
9600543fec | |||
86315b1579 | |||
0355699a69 | |||
efd43c3791 | |||
f770664798 | |||
74645c065b | |||
c1d70ec63e | |||
36ca0fcbfc | |||
91c4c3c270 | |||
92b1b17679 | |||
c19d1ff0c7 | |||
94f26df81e | |||
ae9f1e3905 | |||
b6fe830f1e
|
|||
665f0b4ccb
|
|||
30fa57b999
|
|||
0a6131abcc
|
|||
bd4f3e38eb
|
|||
75bca46b98
|
|||
fe1fe31b68
|
|||
46a5464429
|
|||
67ea62f33d
|
|||
0e16ab4c18
|
|||
a68fef8547
|
|||
fe89e527e6 | |||
7b28bb7561
|
|||
8f793d8985
|
|||
264e19e20a
|
|||
f30b4ff452 | |||
f3a37d435f | |||
f0c6d00953
|
|||
fe5e1e5557
|
|||
16fcd03a02
|
|||
34ee2b3ba5
|
|||
03baee4286 | |||
bc5c420f92 | |||
b256c3176e | |||
53cc43f8d3
|
|||
40a72d9fca
|
|||
82b3025842 | |||
7c7c5862c6 | |||
6301505563 | |||
ba41ab98f7 | |||
fa47dcd5b6 | |||
f3fbd5314a
|
|||
e9f90e2dd2 | |||
dcae15e8d8 | |||
9ccbba2deb | |||
87cdf2e53b | |||
bf27e81e35 | |||
6275623f5e | |||
bc4af576bc | |||
01e9a15bd7 | |||
256579af89 | |||
3af065e530 | |||
fd79692f6d | |||
7758d62f86 | |||
2921073da3 | |||
f02d97ddb0 | |||
95b3933650 | |||
b7a6a88e70 | |||
9846cd5acb | |||
032eed0424 | |||
767ed89f80 | |||
15bf4d6d6d | |||
c7cdb3a092 | |||
bb187f5463 | |||
1ebf68683f
|
|||
98c2ee3ab2
|
|||
4d7b4500c1
|
|||
ca2ba9d8e4
|
|||
f34f8b1eaa | |||
2b96160200
|
|||
933c353357
|
|||
e6da727a11 | |||
0719a541a6 | |||
883147ed9c | |||
718de2fad0 | |||
643d8f99be
|
|||
3954d69c94 | |||
78a5e81e33
|
|||
b05e128b5e
|
|||
8f39d0320c | |||
1cc61cee36
|
|||
a21cefab31
|
|||
f2673d6c83
|
|||
18535ee85f
|
|||
aea6796ba1 | |||
872d5e8ebf
|
|||
c0901947ca
|
|||
860e076b89 | |||
ea0e5dfa14
|
|||
e0cdf06e99 | |||
59da93fd75 | |||
1d9b8729ab | |||
22ded77bde | |||
995e2dac80 | |||
28c41aaf85
|
|||
ce2ce42530 | |||
1409a3b23a
|
|||
51e382760d | |||
b0fcffea2d
|
|||
66e1047752 | |||
7bee376718 | |||
6bc45bbca3 | |||
f3912e5544 | |||
0950074121 | |||
94e9b75e40 | |||
23c7a92546 | |||
8391dbe448 | |||
a7842b2597
|
|||
1552b3c9d7
|
|||
2259a31260 | |||
36eed4323c | |||
9bf8c9b0ed | |||
1930c48d28 | |||
29306d2b66 | |||
e0758215ba | |||
e82c7cdc6c | |||
3f66e1a862
|
|||
0423540976 | |||
fcd4c3b92e | |||
efee2d8b44 | |||
7c109d909a | |||
d825a8509b | |||
f3829d3390 | |||
e8690d249f | |||
a2e705bd92 | |||
e38b369149
|
|||
5a36a8660d | |||
f7d385eba1 | |||
edd66f6a6c | |||
2882038efc
|
|||
6065680e1e
|
|||
88114e3ba6
|
|||
bf93c1ddb2 | |||
0d365e16e5
|
|||
802ff20b5c | |||
cdfe201574 | |||
43419f9f15
|
|||
39896ea6e2
|
|||
ca62c3fd0b
|
|||
b3b84c5dc0
|
|||
6bdb3e9695
|
|||
20e64e8768 | |||
63f9bd5548
|
|||
c8146ded17
|
|||
17d2b795b4 | |||
7f30742fc3
|
|||
56d9072abe
|
|||
7ccff61c25
|
|||
cc97199c5d | |||
20d5fabc18 | |||
c04fd66163
|
|||
61982634a6 | |||
6c58e7eb3e | |||
4b25970ce0 | |||
145c1df313 | |||
ad72192e24
|
@@ -1,5 +0,0 @@
|
||||
kind: DX
|
||||
body: '[FilterOrderHelper] add entity choice and singleCheckbox'
|
||||
time: 2023-06-23T12:24:08.133491895+02:00
|
||||
custom:
|
||||
Issue: ""
|
@@ -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: ""
|
@@ -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: ""
|
@@ -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: ""
|
@@ -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
39
.changes/v2.5.0.md
Normal 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
3
.changes/v2.5.1.md
Normal 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
3
.changes/v2.5.2.md
Normal 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
3
.changes/v2.5.3.md
Normal 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
21
.changes/v2.6.0.md
Normal 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)
|
||||
|
@@ -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
|
||||
|
74
CHANGELOG.md
74
CHANGELOG.md
@@ -6,6 +6,80 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
|
||||
and is generated by [Changie](https://github.com/miniscruff/changie).
|
||||
|
||||
|
||||
## 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
80
CONTRIBUTING.md
Normal 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.
|
||||
|
@@ -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();
|
||||
|
||||
|
36
docs/source/development/FAQ.rst
Normal file
36
docs/source/development/FAQ.rst
Normal 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
|
84
docs/source/development/database-principles.rst
Normal file
84
docs/source/development/database-principles.rst
Normal 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`.
|
155
docs/source/development/database/table_list.csv
Normal file
155
docs/source/development/database/table_list.csv
Normal 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.
|
@@ -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
|
||||
**************
|
||||
|
@@ -56,7 +56,7 @@ class ChillMainConfiguration implements ConfigurationInterface
|
||||
->end() // end of widgets
|
||||
->end() // end of root/children
|
||||
->end() // end of root
|
||||
;
|
||||
;
|
||||
|
||||
return $treeBuilder;
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -13,6 +13,4 @@ namespace Chill\ActivityBundle;
|
||||
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
class ChillActivityBundle extends Bundle
|
||||
{
|
||||
}
|
||||
class ChillActivityBundle extends Bundle {}
|
||||
|
@@ -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();
|
||||
}
|
||||
|
@@ -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';
|
||||
}
|
||||
}
|
@@ -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 [];
|
||||
|
@@ -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 [];
|
||||
|
@@ -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 [];
|
||||
|
@@ -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 [];
|
||||
|
@@ -104,9 +104,7 @@ class ListActivityHelper
|
||||
->addGroupBy('location.id');
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
}
|
||||
public function buildForm(FormBuilderInterface $builder) {}
|
||||
|
||||
public function getAllowedFormattersTypes()
|
||||
{
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
@@ -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;
|
||||
}
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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"];
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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:
|
||||
|
@@ -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}
|
@@ -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:
|
||||
|
@@ -13,6 +13,4 @@ namespace Chill\AsideActivityBundle;
|
||||
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
class ChillAsideActivityBundle extends Bundle
|
||||
{
|
||||
}
|
||||
class ChillAsideActivityBundle extends Bundle {}
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
@@ -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 [];
|
||||
|
@@ -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 [];
|
||||
|
@@ -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;
|
||||
|
@@ -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 [];
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
@@ -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)
|
||||
|
@@ -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">
|
||||
|
@@ -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>
|
||||
|
||||
|
@@ -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' }
|
||||
|
@@ -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)');
|
||||
}
|
||||
}
|
@@ -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
|
||||
|
@@ -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 }}"> </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 }}"> </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 %}
|
||||
|
@@ -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) %}
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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")
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -21,8 +21,7 @@ readonly class MSUserAbsenceSync
|
||||
private MSUserAbsenceReaderInterface $absenceReader,
|
||||
private ClockInterface $clock,
|
||||
private LoggerInterface $logger,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function syncUserAbsence(User $user): void
|
||||
{
|
||||
|
@@ -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 {}
|
||||
}
|
||||
|
@@ -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 {}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -172,5 +172,4 @@ class MSUserAbsenceReaderTest extends TestCase
|
||||
"User is absent: absence is always enabled"
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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()
|
||||
{
|
||||
|
@@ -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
|
||||
]
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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
|
||||
]
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -21,8 +21,7 @@ final readonly class GenericDocDTO
|
||||
public array $identifiers,
|
||||
public \DateTimeImmutable $docDate,
|
||||
public AccompanyingPeriod|Person $linked,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function getContext(): string
|
||||
{
|
||||
|
@@ -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;
|
||||
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -28,8 +28,7 @@ final readonly class PersonDocumentGenericDocProvider implements GenericDocForPe
|
||||
public function __construct(
|
||||
private Security $security,
|
||||
private PersonDocumentACLAwareRepositoryInterface $personDocumentACLAwareRepository,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function buildFetchQueryForPerson(
|
||||
Person $person,
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -20,5 +20,4 @@ interface GenericDocRendererInterface
|
||||
public function getTemplate(GenericDocDTO $genericDocDTO, $options = []): string;
|
||||
|
||||
public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array;
|
||||
|
||||
}
|
||||
|
@@ -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) {
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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'];
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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) {
|
||||
|
@@ -13,6 +13,4 @@ namespace Chill\EventBundle;
|
||||
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
class ChillEventBundle extends Bundle
|
||||
{
|
||||
}
|
||||
class ChillEventBundle extends Bundle {}
|
||||
|
@@ -16,6 +16,4 @@ use Doctrine\ORM\EntityRepository;
|
||||
/**
|
||||
* Class EventRepository.
|
||||
*/
|
||||
class EventRepository extends EntityRepository
|
||||
{
|
||||
}
|
||||
class EventRepository extends EntityRepository {}
|
||||
|
@@ -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',
|
||||
|
@@ -13,6 +13,4 @@ namespace Chill\FamilyMembersBundle;
|
||||
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
class ChillAMLIFamilyMembersBundle extends Bundle
|
||||
{
|
||||
}
|
||||
class ChillAMLIFamilyMembersBundle extends Bundle {}
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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.
|
||||
|
@@ -16,6 +16,4 @@ use Symfony\Component\Form\AbstractType;
|
||||
/**
|
||||
* Class CRUDDeleteEntityForm.
|
||||
*/
|
||||
class CRUDDeleteEntityForm extends AbstractType
|
||||
{
|
||||
}
|
||||
class CRUDDeleteEntityForm extends AbstractType {}
|
||||
|
@@ -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 {}
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -13,6 +13,4 @@ namespace Chill\MainBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
|
||||
class LocationTypeController extends CRUDController
|
||||
{
|
||||
}
|
||||
class LocationTypeController extends CRUDController {}
|
||||
|
@@ -44,7 +44,5 @@ class LoginController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
public function LoginCheckAction(Request $request)
|
||||
{
|
||||
}
|
||||
public function LoginCheckAction(Request $request) {}
|
||||
}
|
||||
|
@@ -50,8 +50,7 @@ final class PermissionsGroupController extends AbstractController
|
||||
private readonly EntityManagerInterface $em,
|
||||
private readonly PermissionsGroupRepository $permissionsGroupRepository,
|
||||
private readonly RoleScopeRepository $roleScopeRepository,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/**
|
||||
*/
|
||||
|
@@ -27,8 +27,7 @@ final readonly class UserExportController
|
||||
private UserRepositoryInterface $userRepository,
|
||||
private Security $security,
|
||||
private TranslatorInterface $translator,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @throws \League\Csv\CannotInsertRecord
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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([]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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' => [
|
||||
[
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -175,9 +175,7 @@ class User implements UserInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function eraseCredentials()
|
||||
{
|
||||
}
|
||||
public function eraseCredentials() {}
|
||||
|
||||
public function getAbsenceStart(): ?DateTimeImmutable
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -20,6 +20,4 @@ namespace Chill\MainBundle\Export;
|
||||
*
|
||||
* When used, the `ExportManager` will not handle aggregator for this class.
|
||||
*/
|
||||
interface ListInterface extends ExportInterface
|
||||
{
|
||||
}
|
||||
interface ListInterface extends ExportInterface {}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user