Compare commits

..

19 Commits

Author SHA1 Message Date
801f799e45 Merge branch '125-list-person-on-course' into testing 2023-07-11 17:04:17 +02:00
98b8f3dcff Merge branch '118-design-filterOrder' into testing 2023-07-11 17:03:23 +02:00
a333a0312a Merge branch 'issue719_filter_activities_version_2' into testing 2023-07-11 17:02:44 +02:00
0288fd22cf Merge branch '128-export-group-activity-by-localisation' into testing 2023-07-11 17:02:33 +02:00
1dd4398c43 Merge branch '129-export-filter-course-having-activity' into testing 2023-07-11 17:02:19 +02:00
4f4b3dbb44 Merge branch 'issue719_filter_activities_version_2' into testing 2023-07-07 13:29:28 +02:00
1c3e6e0dba Merge remote-tracking branch 'origin/118-design-filterOrder' into testing 2023-07-07 13:29:11 +02:00
e7ca81e057 Merge branch 'master' into testing 2023-07-07 13:27:02 +02:00
9687debb57 Merge remote-tracking branch 'origin/master' into testing 2023-06-27 21:11:09 +02:00
769504c497 Merge branch 'issue719_filter_activities_version_2' into testing 2023-06-23 13:10:17 +02:00
811364e139 Merge branch '110-export-editable' into testing 2023-06-23 13:09:43 +02:00
deffc5e4db Merge branch '103-document-page' into testing 2023-06-18 22:03:51 +02:00
40ecaab5b4 Merge branch '110-export-editable' into testing 2023-06-18 22:03:36 +02:00
f7be53f790 Merge remote-tracking branch 'origin/master' into testing 2023-06-18 22:02:14 +02:00
6fb01b19ec Merge branch 'feature/change-parcours-status' into testing 2023-04-28 15:55:51 +02:00
b8ecff4f08 Merge branch 'exports/filters-on-work-date' into testing 2023-04-28 14:38:36 +02:00
4c340dd086 Merge branch 'feature/change-parcours-status' into testing 2023-04-28 14:38:28 +02:00
8f1955c536 Merge branch 'master' into testing 2023-04-28 14:38:08 +02:00
c9c15cdd56 Merge remote-tracking branch 'origin/testing' into testing 2023-04-28 14:38:00 +02:00
227 changed files with 985 additions and 3296 deletions

View File

@@ -0,0 +1,5 @@
kind: Feature
body: '[export] Add a list for people with their associated course'
time: 2023-07-07T12:36:09.596469063+02:00
custom:
Issue: "125"

View File

@@ -0,0 +1,6 @@
kind: Feature
body: '[export] Add ordering by person''s lastname or course opening date in list
which concerns accompanying course or peoples'
time: 2023-07-07T12:41:32.112725962+02:00
custom:
Issue: ""

View File

@@ -0,0 +1,5 @@
kind: Feature
body: '[Export] allow to group activities by localisation'
time: 2023-07-11T15:00:55.770070399+02:00
custom:
Issue: "128"

View File

@@ -0,0 +1,5 @@
kind: Feature
body: '[export] Add a filter "filter course having an activity between two dates"'
time: 2023-07-11T15:59:29.065329834+02:00
custom:
Issue: "129"

View File

@@ -1,39 +0,0 @@
## 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

View File

@@ -1,3 +0,0 @@
## 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

View File

@@ -1,3 +0,0 @@
## 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)

View File

@@ -1,3 +0,0 @@
## 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.

View File

@@ -1,21 +0,0 @@
## 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)

View File

@@ -7,7 +7,7 @@ versionFormat: '## {{.Version}} - {{.Time.Format "2006-01-02"}}'
kindFormat: '### {{.Kind}}' 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. # 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: >- changeFormat: >-
* {{ 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 "")) }} * {{ if not (eq .Custom.Issue "") }}([#{{ .Custom.Issue }}](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/{{ .Custom.Issue }})) {{ end }}{{.Body}} {{ if not (eq .Custom.Long "") }}
{{ .Custom.Long }}{{ end }} {{ .Custom.Long }}{{ end }}
custom: custom:

View File

@@ -6,80 +6,6 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie). and is generated by [Changie](https://github.com/miniscruff/changie).
## v2.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 ## v2.4.0 - 2023-07-07
### Feature ### Feature

View File

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

View File

@@ -94,7 +94,7 @@ class CountPerson implements ExportInterface
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{ {
// we gather all center the user choose. // 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(); $qb = $this->entityManager->createQueryBuilder();

View File

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

View File

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

View File

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

View File

@@ -9,7 +9,7 @@
Development Development
########### ###########
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. 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.
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
@@ -36,8 +36,6 @@ As Chill relies on the `symfony <http://symfony.com>`_ framework, reading the fr
Assets <assets.rst> Assets <assets.rst>
Cron Jobs <cronjob.rst> Cron Jobs <cronjob.rst>
Info about entities <entity-info.rst> Info about entities <entity-info.rst>
Info about database (in French) <database-principles.rst>
Developer FAQ <FAQ.rst>
Layout and UI Layout and UI
************** **************

View File

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

View File

@@ -2,13 +2,6 @@
declare(strict_types=1); 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\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig; use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\LevelSetList;

View File

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

View File

@@ -72,7 +72,8 @@ final class ActivityController extends AbstractController
private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory, private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory,
private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatableStringHelperInterface $translatableStringHelper,
private readonly PaginatorFactory $paginatorFactory, private readonly PaginatorFactory $paginatorFactory,
) {} ) {
}
/** /**
* Deletes a Activity entity. * Deletes a Activity entity.
@@ -319,6 +320,7 @@ final class ActivityController extends AbstractController
private function buildFilterOrder(AccompanyingPeriod|Person $associated): FilterOrderHelper private function buildFilterOrder(AccompanyingPeriod|Person $associated): FilterOrderHelper
{ {
$filterBuilder = $this->filterOrderHelperFactory->create(self::class); $filterBuilder = $this->filterOrderHelperFactory->create(self::class);
$types = $this->activityACLAwareRepository->findActivityTypeByAssociated($associated); $types = $this->activityACLAwareRepository->findActivityTypeByAssociated($associated);
$jobs = $this->activityACLAwareRepository->findUserJobByAssociated($associated); $jobs = $this->activityACLAwareRepository->findUserJobByAssociated($associated);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -23,7 +23,8 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
{ {
public function __construct( public function __construct(
private RollingDateConverterInterface $rollingDateConverter, private RollingDateConverterInterface $rollingDateConverter,
) {} ) {
}
public function getTitle() public function getTitle()
{ {

View File

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

View File

@@ -43,7 +43,8 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum
private CenterResolverManagerInterface $centerResolverManager, private CenterResolverManagerInterface $centerResolverManager,
private AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser, private AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser,
private Security $security private Security $security
) {} ) {
}
public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface
{ {

View File

@@ -36,7 +36,8 @@ final class AccompanyingPeriodActivityGenericDocProvider implements GenericDocFo
private EntityManagerInterface $em, private EntityManagerInterface $em,
private Security $security, private Security $security,
private ActivityDocumentACLAwareRepositoryInterface $activityDocumentACLAwareRepository, private ActivityDocumentACLAwareRepositoryInterface $activityDocumentACLAwareRepository,
) {} ) {
}
public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
{ {

View File

@@ -29,7 +29,8 @@ final readonly class PersonActivityGenericDocProvider implements GenericDocForPe
public function __construct( public function __construct(
private Security $security, private Security $security,
private ActivityDocumentACLAwareRepositoryInterface $personActivityDocumentACLAwareRepository, private ActivityDocumentACLAwareRepositoryInterface $personActivityDocumentACLAwareRepository,
) {} ) {
}
public function buildFetchQueryForPerson(Person $person, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface public function buildFetchQueryForPerson(Person $person, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
{ {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -22,13 +22,6 @@
<dt class="inline">{{ 'Created for'|trans }}</dt> <dt class="inline">{{ 'Created for'|trans }}</dt>
<dd>{{ entity.agent }}</dd> <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> <h2 class="chill-red">{{ 'Activity data'|trans }}</h2>

View File

@@ -46,27 +46,19 @@ services:
tags: tags:
- { name: chill.export_filter, alias: 'aside_activity_user_filter' } - { 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 ## Aggregators
chill.aside_activity.export.type_aggregator: chill.aside_activity.export.type_aggregator:
class: Chill\AsideActivityBundle\Export\Aggregator\ByActivityTypeAggregator class: Chill\AsideActivityBundle\Export\Aggregator\ByActivityTypeAggregator
tags: tags:
- { name: chill.export_aggregator, alias: 'activity_type_aggregator' } - { name: chill.export_aggregator, alias: activity_type_aggregator }
chill.aside_activity.export.user_job_aggregator: chill.aside_activity.export.user_job_aggregator:
class: Chill\AsideActivityBundle\Export\Aggregator\ByUserJobAggregator class: Chill\AsideActivityBundle\Export\Aggregator\ByUserJobAggregator
tags: 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: chill.aside_activity.export.user_scope_aggregator:
class: Chill\AsideActivityBundle\Export\Aggregator\ByUserScopeAggregator class: Chill\AsideActivityBundle\Export\Aggregator\ByUserScopeAggregator
tags: tags:
- { name: chill.export_aggregator, alias: 'aside_activity_user_scope_aggregator' } - { name: chill.export_aggregator, alias: aside_activity_user_scope_aggregator }
Chill\AsideActivityBundle\Export\Aggregator\ByLocationAggregator:
tags:
- { name: chill.export_aggregator, alias: 'aside_activity_location_aggregator' }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -150,7 +150,9 @@ abstract class AbstractCRUDController extends AbstractController
return new $class(); 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) protected function getActionConfig(string $action)
{ {

View File

@@ -242,9 +242,13 @@ class CRUDController extends AbstractController
/** /**
* Customize the form created by createFormFor. * 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 * @param $id
@@ -923,7 +927,9 @@ 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 * @param $action
@@ -946,55 +952,77 @@ class CRUDController extends AbstractController
/** /**
* @param $entity * @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. * method used by indexAction.
* *
* @param mixed $query * @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. * method used by indexAction.
* *
* @param mixed $entities * @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 * @param $entity
*/ */
protected function onPostPersist(string $action, $entity, FormInterface $form, Request $request) {} protected function onPostPersist(string $action, $entity, FormInterface $form, Request $request)
{
}
/** /**
* @param $entity * @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 * @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. * 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 * @param $entity
*/ */
protected function onPrePersist(string $action, $entity, FormInterface $form, Request $request) {} protected function onPrePersist(string $action, $entity, FormInterface $form, Request $request)
{
}
/** /**
* @param $entity * @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. * Add ordering fields in the query build by self::queryEntities.

View File

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

View File

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

View File

@@ -11,22 +11,176 @@ declare(strict_types=1);
namespace Chill\MainBundle\Controller; namespace Chill\MainBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Form\CenterType; use Chill\MainBundle\Form\CenterType;
use Chill\MainBundle\Pagination\PaginatorInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
/** /**
* Class CenterController. * Class CenterController.
*/ */
class CenterController extends CRUDController class CenterController extends AbstractController
{ {
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) /**
* Creates a new Center entity.
*/
public function createAction(Request $request)
{ {
$query->addOrderBy('e.name', 'ASC'); $center = new Center();
$form = $this->createCreateForm($center);
$form->handleRequest($request);
return parent::orderQuery($action, $query, $request, $paginator); 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;
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -12,7 +12,6 @@ declare(strict_types=1);
namespace Chill\MainBundle\DependencyInjection; namespace Chill\MainBundle\DependencyInjection;
use Chill\MainBundle\Controller\AddressApiController; use Chill\MainBundle\Controller\AddressApiController;
use Chill\MainBundle\Controller\CenterController;
use Chill\MainBundle\Controller\CivilityApiController; use Chill\MainBundle\Controller\CivilityApiController;
use Chill\MainBundle\Controller\CivilityController; use Chill\MainBundle\Controller\CivilityController;
use Chill\MainBundle\Controller\CountryController; use Chill\MainBundle\Controller\CountryController;
@@ -45,7 +44,6 @@ use Chill\MainBundle\Doctrine\DQL\Unaccent;
use Chill\MainBundle\Doctrine\ORM\Hydration\FlatHierarchyEntityHydrator; use Chill\MainBundle\Doctrine\ORM\Hydration\FlatHierarchyEntityHydrator;
use Chill\MainBundle\Doctrine\Type\NativeDateIntervalType; use Chill\MainBundle\Doctrine\Type\NativeDateIntervalType;
use Chill\MainBundle\Doctrine\Type\PointType; use Chill\MainBundle\Doctrine\Type\PointType;
use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Entity\Civility; use Chill\MainBundle\Entity\Civility;
use Chill\MainBundle\Entity\Country; use Chill\MainBundle\Entity\Country;
use Chill\MainBundle\Entity\GeographicalUnitLayer; use Chill\MainBundle\Entity\GeographicalUnitLayer;
@@ -55,7 +53,6 @@ use Chill\MainBundle\Entity\LocationType;
use Chill\MainBundle\Entity\Regroupment; use Chill\MainBundle\Entity\Regroupment;
use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\UserJob; use Chill\MainBundle\Entity\UserJob;
use Chill\MainBundle\Form\CenterType;
use Chill\MainBundle\Form\CivilityType; use Chill\MainBundle\Form\CivilityType;
use Chill\MainBundle\Form\CountryType; use Chill\MainBundle\Form\CountryType;
use Chill\MainBundle\Form\LanguageType; use Chill\MainBundle\Form\LanguageType;
@@ -527,27 +524,6 @@ 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' => [ 'apis' => [
[ [

View File

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

View File

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

View File

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

View File

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

View File

@@ -20,4 +20,6 @@ namespace Chill\MainBundle\Export;
* *
* When used, the `ExportManager` will not handle aggregator for this class. * When used, the `ExportManager` will not handle aggregator for this class.
*/ */
interface ListInterface extends ExportInterface {} interface ListInterface extends ExportInterface
{
}

View File

@@ -11,10 +11,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\Form; namespace Chill\MainBundle\Form;
use Chill\MainBundle\Entity\Center;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -24,18 +21,24 @@ class CenterType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder $builder
->add('name', TextType::class, [ ->add('name', TextType::class);
'label' => 'Nom',
])
->add('isActive', CheckboxType::class, [
'label' => 'Actif ?',
'required' => false,
]);
} }
/**
* @param OptionsResolverInterface $resolver
*/
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)
{ {
$resolver $resolver->setDefaults([
->setDefault('class', Center::class); 'data_class' => \Chill\MainBundle\Entity\Center::class,
]);
}
/**
* @return string
*/
public function getBlockPrefix()
{
return 'chill_mainbundle_center';
} }
} }

View File

@@ -19,7 +19,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class AggregatorType extends AbstractType class AggregatorType extends AbstractType
{ {
public function __construct() {} public function __construct()
{
}
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {

View File

@@ -21,7 +21,9 @@ class FilterType extends AbstractType
{ {
public const ENABLED_FIELD = 'enabled'; public const ENABLED_FIELD = 'enabled';
public function __construct() {} public function __construct()
{
}
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {

View File

@@ -12,7 +12,6 @@ declare(strict_types=1);
namespace Chill\MainBundle\Form\Type\Listing; namespace Chill\MainBundle\Form\Type\Listing;
use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Form\Type\PickUserDynamicType;
use Chill\MainBundle\Templating\Listing\FilterOrderHelper; use Chill\MainBundle\Templating\Listing\FilterOrderHelper;
use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
@@ -115,26 +114,6 @@ final class FilterOrderType extends \Symfony\Component\Form\AbstractType
$builder->add($singleCheckBoxBuilder); $builder->add($singleCheckBoxBuilder);
} }
if ([] !== $helper->getUserPickers()) {
$userPickersBuilder = $builder->create('user_pickers', null, ['compound' => true]);
foreach ($helper->getUserPickers() as $name => [
'label' => $label, 'options' => $opts
]) {
$userPickersBuilder->add(
$name,
PickUserDynamicType::class,
[
'multiple' => true,
'label' => $label,
...$opts,
]
);
}
$builder->add($userPickersBuilder);
}
} }
public static function buildCheckboxChoices(array $choices, array $trans = []): array public static function buildCheckboxChoices(array $choices, array $trans = []): array

View File

@@ -61,8 +61,6 @@ class PickCenterType extends AbstractType
{ {
$centers = $this->getReachableCenters($options['role'], $options['scopes']); $centers = $this->getReachableCenters($options['role'], $options['scopes']);
$centersActive = array_filter($centers, fn (Center $c) => $c->getIsActive());
if (count($centers) <= 1) { if (count($centers) <= 1) {
$multiple = $options['choice_options']['multiple'] ?? false; $multiple = $options['choice_options']['multiple'] ?? false;
$builder->add('center', HiddenType::class); $builder->add('center', HiddenType::class);
@@ -77,7 +75,7 @@ class PickCenterType extends AbstractType
$options['choice_options'], $options['choice_options'],
[ [
'class' => Center::class, 'class' => Center::class,
'choices' => $centersActive, 'choices' => $centers,
] ]
) )
); );

View File

@@ -67,7 +67,6 @@ class UserType extends AbstractType
'class' => Center::class, 'class' => Center::class,
'query_builder' => static function (EntityRepository $er) { 'query_builder' => static function (EntityRepository $er) {
$qb = $er->createQueryBuilder('c'); $qb = $er->createQueryBuilder('c');
$qb->where($qb->expr()->eq('c.isActive', 'true'));
$qb->addOrderBy('c.name'); $qb->addOrderBy('c.name');
return $qb; return $qb;

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