mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-10 16:55:00 +00:00
Compare commits
6 Commits
v3.1.1
...
feature-ad
Author | SHA1 | Date | |
---|---|---|---|
148221cdc7 | |||
58047faac6 | |||
40dda65006 | |||
|
054a28ecf4 | ||
|
6b2eda0f94 | ||
|
1359f1ba58 |
@@ -1,6 +0,0 @@
|
||||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
|
||||
and is generated by [Changie](https://github.com/miniscruff/changie).
|
@@ -1,677 +0,0 @@
|
||||
## 2.0.0
|
||||
|
||||
* this is a release to relaunch our proceess of release with semantic versioning
|
||||
|
||||
## Test releases
|
||||
|
||||
### 2.0.0-beta3
|
||||
|
||||
* [person][export] Fixed: rename the alias for `accompanying_period` to `acp` in filter associated with person
|
||||
* [activity][export] Feature: improve label for aliases in "Filter by activity type"
|
||||
* [activity][export] DX/Feature: use of an `ActivityTypeRepositoryInterface` instead of the old-style EntityRepository
|
||||
* [person][export] Fixed: some inconsistency with date filter on accompanying courses
|
||||
* [person][export] Fixed: use left join for related entities in accompanying course aggregators
|
||||
* [workflow] Feature: allow user to copy and send manually the access link for the workflow
|
||||
* [workflow] Feature: show the email addresses that received an access link for the workflow
|
||||
### 2.0.0-beta2
|
||||
|
||||
* [workflow]: Fixed: the notification is sent when the user is added to the first step.
|
||||
* [budget] Feature: allow to desactivate some charges and resources, adding an `active` key in the configuration
|
||||
* [person] Feature: on Evaluation, allow to configure an URL from the admin
|
||||
|
||||
### 2022-06
|
||||
|
||||
* [workflow]: added pagination to workflow list page
|
||||
* [homepage_widget]: null error on tasks widget fixed
|
||||
* [person-thirdparty]: fix quick-add of names that consist of multiple parts (eg. De Vlieger) within onthefly modal person/thirdparty
|
||||
* [search]: Order of birthdate fields changed in advanced search to avoid confusion.
|
||||
* [workflow]: Constraint added to workflow (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/675)
|
||||
* [social_action]: only show active objectives (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/625)
|
||||
* [household]: Reposition and cut button for enfant hors menage have been deleted (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/620)
|
||||
* [admin]: Add crud for composition type in admin (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/611)
|
||||
* [social_action]: only show active objectives (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/625)
|
||||
|
||||
## Test releases
|
||||
|
||||
### 2022-05-30
|
||||
|
||||
* fix creating a new AccompanyingPeriodWorkEvaluationDocument when replacing the document (the workflow was lost)
|
||||
|
||||
### 2022-05-27
|
||||
|
||||
* [storedobject] add title field on StoredObject entity + use it in activity documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/604)
|
||||
* [main] add a "read more..." on comment embeddable when overflown (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/604)
|
||||
* [person] add closing motive to closed acc course (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/603)
|
||||
* [person] household filiation: fetch person info when unfolding person (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/586)
|
||||
* [admin] repair edit of social action in the admin (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/601)
|
||||
* [admin]: add select2 to Goal form type entity fields (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/702)
|
||||
* [main] allow hide permissions group list menu (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/577)
|
||||
* [main] allow hide change user password menu (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/577)
|
||||
* [main] filter user jobs by active jobs (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/577)
|
||||
* [main] add civility to User (entity, migration and form type) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/577)
|
||||
* [admin] refactorisation of the admin section: reorganisation of the menu, translations, form types, new entities (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/592)
|
||||
* [admin] add admin section for languages and countries (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/596)
|
||||
* [activity] activity admin: translations + remove label field for comment on admin activity type (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/587)
|
||||
* [main] admin user_job: improvements (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/588)
|
||||
* [address] can add extra address info even if noAddress (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/576)
|
||||
|
||||
|
||||
### 2022-05-06
|
||||
|
||||
* [person] add civility when creating a person (with the on-the-fly component or in the php form) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/557)
|
||||
* [person] add address when creating a person (with the on-the-fly component or in the php form) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/557)
|
||||
* [person] add household creation API point (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/557)
|
||||
|
||||
### 2021-04-29
|
||||
|
||||
* [person] prevent circular references in PersonDocGenNormalizer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/527)
|
||||
* [person] add maritalStatusComment to PersonDocGenNormalizer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/582)
|
||||
* Load relationships without gender in french fixtures
|
||||
* Add command to remove old draft accompanying periods
|
||||
* [parcours]: If users assings him/herself as referrer and job is not null. Update parcours job (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/578)
|
||||
|
||||
### 2021-04-28
|
||||
|
||||
* [address] fix bug when editing address: update location and addressreferenceId + better update of the map in edition (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/593)
|
||||
* [main] avoid address reference search on undefined post code (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/561)
|
||||
* [person] prevent duplicate relationship in filiation/household graph (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/560)
|
||||
* [Documents] Validate storedObject and allow for null data (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/565)
|
||||
* [parcours]: Comments can be unpinned + edit/delete for all users that are allowed to edit parcours (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/566)
|
||||
|
||||
### 2021-04-26
|
||||
|
||||
* [Datepickers] datepickers fixed when using keyboard to enter date (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/545)
|
||||
* [social_action] Display 'agents traitants' in parcours resumé and social action list (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/568)
|
||||
* [Person_search] Closed parcours shown within an accordeon that can be opened/closed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/574)
|
||||
|
||||
### 2021-04-24
|
||||
|
||||
* [notification email on course designation] allow raw string in email content generation
|
||||
* [Accompanying period work] list evaluations associated to a work by startDate, and then by id, from the most recent to older
|
||||
* [Documents] Change wording 'créer' to 'enregistrer' (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/634)
|
||||
* [Parcours]: The number of 'mes parcours' displayed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/572)
|
||||
* [Hompage_widget]: Renaming of tabs and removal of social actions tab (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/570)
|
||||
* [activity]: Ignore thirdparties when creating a social action via an activity (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/573)
|
||||
* [parcours]: change wording of warning message and button when user is not associated to a household yet (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/590#note_918370943)
|
||||
* [Accompanying period work evaluations] list documents associated to a work by creation date, and then by id, from the most recent to older
|
||||
* [Course comment] add validationConstraint NotNull and NotBlank on comment content, to avoid sql error
|
||||
* [Notifications] delay the sending of notificaiton to kernel.terminate
|
||||
* [Notifications / Period user change] fix the sending of notification when user changes
|
||||
* [Activity form] invert 'incoming' and 'receiving' in Activity form
|
||||
* [Activity form] keep the same order for 'attendee' field in new and edit form
|
||||
* [list with period] use "sameas" test operator to introduce requestor in list
|
||||
* [notification email on course designation] allow raw string in email content generation
|
||||
* [Accompanying period work] list evaluations associated to a work by startDate, and then by id, from the most recent to older
|
||||
* [evaluation_document] changing date to datetime in order to display the time at which document was created (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/569)
|
||||
|
||||
|
||||
### 2021-04-13
|
||||
|
||||
* [person] household address: add a form for editing the validFrom date (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/541)
|
||||
* [person] householdmemberseditor: fix composition type bug in select form (vuejs) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/543)
|
||||
* [docgen] add more persons choices in docgen for course: amongst requestor (if person), resources of course (if person), and PersonResource (if person);
|
||||
* [docgen] add a new context with a list of activities in course
|
||||
* [docgen] add a comment in budget lines
|
||||
* [notifications] allow to send a notification to an email address. The address receive an access link
|
||||
* [adresses] add constraints in database to avoid errors later: postcode not null, and validfrom <= validto
|
||||
* [accompanying work editor] add a label on document title input
|
||||
|
||||
### 2021-04-07
|
||||
|
||||
* notification list: move action buttons outside of the toggle
|
||||
* fix detecting of non-read notification
|
||||
* filter users which are disabled in search user api
|
||||
* order query for location and add pagination in list
|
||||
* allow every person which has part for a workflow to see the workflow page
|
||||
* able to see the workflow if the evaluation document has been deleted
|
||||
* hardcode the list of supported mime types for edition with collabora
|
||||
* list of accompanying course: allow to see the pinned comment in list_item
|
||||
|
||||
### 2021-04-06
|
||||
|
||||
* [main] notification toggle read: correct js syntax for compilation in production (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/548)
|
||||
* [parcours] Display of interlocuteurs changed to flex-table in parcours edit page to prevent cut-off of information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/535)
|
||||
* [activity] espace entre les boutons pour supprimer les documents
|
||||
|
||||
|
||||
### continuous release in February and March
|
||||
|
||||
* Creation of PickCivilityType, and implementation in PersonType and ThirdpartyType
|
||||
* [person] Accompanying course evaluation documents: disable the WOPI edit link if mimetype not supported and if no keyInfos
|
||||
(https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/585)
|
||||
* [activity] display error messages above the form in creating a new location (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/481)
|
||||
* [activity] show required field in activity edit/new by an asterix in the vuejs fields (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/494)
|
||||
* [ACL] fix allow to see the course, event if the scope'course does not contains the scope's user
|
||||
* [search] enforce limit of results for fetching rsults by search api https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/576
|
||||
* [activity] Fix delete button for document (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/554)
|
||||
* [activity] Add return path the document generation (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/553)
|
||||
* [person] add person ressource to person docgen normaliser (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/517)
|
||||
* [person] AccompanyingCourseWorkEdit: fix deleting evaluation documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/546)
|
||||
* [person] AccompanyingCourseWorkEdit: download existing documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/512)
|
||||
* [person] AccompanyingCourseWorkEdit: replace document by a new one (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/511)
|
||||
* [person] AccompanyingPeriodWork: add referrers to work, add doctrine event listener to add logged user to referrers collection and display a referrers list in work list (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/502)
|
||||
* [person] AccompanyingPeriodWorkEvaluation: fix circular reference when serialising (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/495)
|
||||
* [person] order accompanying period by opening date in search persons, person and household period lists (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/493)
|
||||
* [parcours] autosave of the pinned comment for draft accompanying course (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/477)
|
||||
* [main] filter user job in undispatch acc period to assign (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/472)
|
||||
* [main] filter user job in undispatch acc period to assign (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/472)
|
||||
* [person] Add url in accompanying period work evaluations entity and form (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/476)
|
||||
* [person] Add document generation in admin and in person/{id}/document (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/464)
|
||||
* [activity] do not override location if already exist (when validating new activity) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/470)
|
||||
* [parcours] Toggle emergency/intensity only by referrer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/442)
|
||||
* [docstore] Add an API entrypoint for StoredObject (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/466)
|
||||
* [person] Add the possibility of uploading existing documents to AccPeriodWorkEvaluationDocument (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/466)
|
||||
* [person] Add title to AccPeriodWorkEvaluationDocument (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/466)
|
||||
* [person] Order social issues by the field "ordering" (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/388)
|
||||
* [Person/Household list] when listing other simultaneous members of an household, exclude the members on person, not on members (avoid to show two membersship with the same person)
|
||||
* [draft periods] add a delete button (if acl granted) on each draft period listed on draft period page (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/463)
|
||||
* [Person] Display suffixText in RenderPerson, PersonText.vue, RenderPersonBox.vue (was made for displaying "enfant confie") (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/441)
|
||||
* [budget]: budget enabled for persons and households (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/469)
|
||||
* [person] residential address: show residential address or info in PersonRenderBox, refactor Residential Address (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/439)
|
||||
* [thirdparty] Add a contact to a thirdparty from within onTheFly (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/345)
|
||||
* [documents] Improve flex-table item-col placement when long buttons and long metadata
|
||||
* [thirdparty] Fix display of multiple contact badges so they wrap onto next line (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/482)
|
||||
* [confidential] Fix position of toggle button so it does not cover text nor fall outside of box (no issue)
|
||||
* [parcours] Fix edit of both thirdparty and contact name (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/474)
|
||||
* [template] do not list inactive templates (for doc generator)
|
||||
* [household] bugfix if position of member is null, renderbox no longer throws an error (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/480)
|
||||
* [parcours] location cannot be removed if linked to a user (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/478)
|
||||
* [person] email added to twig personRenderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/490)
|
||||
* [activity] Only youngest descendant is kept for social issues and actions (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/471)
|
||||
* [person] Add link to current household in person banner (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/484)
|
||||
* [address] person badge in address history changed to open OnTheFly with all person info (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/489)
|
||||
* [person] Change 'personne' with 'usager' and '&' with 'ET' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/499)
|
||||
* [thirdparty] Add parameter condition to display centers or not (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/500)
|
||||
* [phonenumber] Remove placeholder in phonenumber field (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/496)
|
||||
* [person_resource] separate create page created to avoid confusion (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/504)
|
||||
* [contact] add contact button color changed plus the pipe at the side removed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/506)
|
||||
* [thirdparty] For contacts show current civility/profession in edit form + fix saving of edited information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/491)
|
||||
* [household] create-edit household composition placed in separate page to avoid confusion (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/505)
|
||||
* [blur] Improved positioning of toggle icon (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/486)
|
||||
* [thirdparty] add firstname field to thirdparty 'child' or 'contact' types (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/508)
|
||||
* [household] create-edit household composition placed in separate page to avoid confusion (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/505)
|
||||
* [blur] Improved positioning of toggle icon (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/486)
|
||||
* [parcours] List of parcours for a specific user so they can be reassigned in case of absence (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/509)
|
||||
* [thirdparty] Thirdparty view page, english text translated (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/534)
|
||||
* [social_action] Translation changed in evaluation section (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/512)
|
||||
* [filiation] Possible to add person (or create onthefly) to add to filiation graph + add relation (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/519)
|
||||
* [household] Within parcours listing page of household add create button (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/560)
|
||||
* [person_resource] bugfix when adding thirdparty or freetext resource + prevent personOwner themselves to be added. (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/526)
|
||||
* [aside_activity] style correction + sticky-form create button (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/529)
|
||||
* [budget] order within the menu adjusted (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/592)
|
||||
* [onthefly] fix create person. Bug was noticed in filiation (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/591)
|
||||
* [parcours] Create document buttons made sticky (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/532)
|
||||
* [person] Trailing guillemet removed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/530)
|
||||
* [notification] Display of social action within workflow notification set to display block (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/537)
|
||||
* [onthefly] trim trailing whitespace in email of person and thirdparty (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/542)
|
||||
|
||||
* [action] Only youngest descendant is kept for social issues and actions (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/471)
|
||||
## Test releases
|
||||
|
||||
### test release 2022-02-21
|
||||
|
||||
* [notifications] Word 'un' changed to number '1' for notifications in user menu (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/483)
|
||||
* [documents] 'gabarit' changed to 'modèle' (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/405)
|
||||
* [person_resources] Menu name and order changed (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/460)
|
||||
* workflow: fix sending notifications
|
||||
* [thirdparty] Extend the thirdparty search to thirdparty children (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/448)
|
||||
* [person]: AddPersons: allow creation of person or thirdparty only (no users) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/422)
|
||||
* [person]: AddPersons: allow creation of person or thirdparty depending on allowed types (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/422)
|
||||
* [person]: AddPersons: add suggestion of name when creating new person or thirdparty (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/422)
|
||||
* [main] Address: fix small bug: when modifying an address without street (isNoAddress), also check errors if street is an empty string as back-end change null value to empty string for street (and streetNumber)
|
||||
* [main] Address: stronger client-side validation of addresses (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/449)
|
||||
* [person] accompanying course: filter suggested entities by open participations (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/415)
|
||||
[activity] can click through the cross icon for removing person in concerned group (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/476)
|
||||
[activity] correct associated persons by considering only open participations (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/476)
|
||||
* [person_resources]: Renderboxes used to display person/thirdparty info (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/465)
|
||||
* [Household]: Add end date in HouseholdMember form for 'enfant hors menage' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/434)
|
||||
* [homepage_widget]: If no sender then display as 'notification automatique' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/435)
|
||||
* [parcours]: Order social activities and only display most recent three in parcours resumé (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/481)
|
||||
* [3party]: 3party: redirect to parent when contact (child) is opened in view page
|
||||
* [parcours / addresses]: launch an event when a person change address (either through changing household or because the household is associated to a new address). If the person is localising a course, the course location go back to a temporarily address.
|
||||
* [thirdparty]: address/phonenumber/email/fonction displayed in thirdpartyrenderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/401)
|
||||
* [thirdparty_contact]: in search results the 'qualité' is displayed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/465)
|
||||
* [bug]: fix confidential toggle of address in thirdpartyrenderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/460)
|
||||
|
||||
|
||||
|
||||
### test release 2022-02-14
|
||||
|
||||
* AddPersons: remove ul-li html tags from AddPersons (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/419)
|
||||
* [doc-generator] do not set required fields for mainPerson, person1, person2 (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement#456)
|
||||
* [doc-generation] add age and obele in the mainPerson, person1 and person2 list + add obele in person renderString if addAge (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/370)
|
||||
* [person] accompanying course work: fix on-the-fly update of thirdParty
|
||||
* fix normalisation of accompanying course requestor api (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/378)
|
||||
* [person] add a returnPath when clicking on some Person or ThirdParty badge (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/427)
|
||||
* [person] accompanying course work: fix on-the-fly update of thirdParty
|
||||
* [on-the-fly] close modal only after validation
|
||||
* [person] correct thirdparty PATCH url + add email and altnames in AddPerson and serializer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/433)
|
||||
* change order for accompanying course work list
|
||||
* [parcours]: Mes parcours brouillon added to user menu (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/440)
|
||||
* [Documents]: List view adapted to display more information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/414)
|
||||
* [person]: style fix in parcours listing per person. (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/432)
|
||||
* [parcours]: Only the referrer can toggle the intensity of the parcours (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/442)
|
||||
* [household]: display address of current household (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/415)
|
||||
* ajoute un ordre dans les localisation (api)
|
||||
* [pick entity]: fix translations in modal (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/419)
|
||||
* [homepage_widget]: fix translation on emergency badge (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/440)
|
||||
* [person]: create person and household added to button dropdown (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/454)
|
||||
* display full address in address.text in normalization. Adapt AddressRenderBox
|
||||
* [address]: Correction residential address 'depuis le' (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/459)
|
||||
* [Documents]: List view adapted to display more information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/414)
|
||||
* [Thirdparty_contact]: address blurred if confidential in view page (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/450)
|
||||
* [thirdparty] Add a contact to a thirdparty from within onTheFly (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/345)
|
||||
|
||||
|
||||
### test release 2021-02-01
|
||||
|
||||
* renommer "dossier numéro" en "parcours numéro" dans les résultats de recherche
|
||||
* renomme date de début en date d'ouverture dans le formulaire parcours
|
||||
* [homepage widget] improve content tables, improve counter pluralization with style on number
|
||||
* [notification lists] add comments counter information
|
||||
* [workflows] fix popover header with previous transition
|
||||
* [parcours]: validation + message for closing parcours adjusted.
|
||||
* [household]: household composition double edit button replaced by a delete action (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/426)
|
||||
[fast_actions] improve fast-actions buttons override mechanism, fix https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/413
|
||||
[homepage widget] add vue homepage_widget with asynchone loading, give a global view resume of the user concerned actions, notifications, etc.
|
||||
* [person]: Comment on marital status is possible even if marital status is not defined (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/421)
|
||||
* [parcours]: In the list of person results the requestor is not displayed if defined as anonymous (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/424)
|
||||
* [bugfix]: modal closes and newly created person/thirdparty is selected when multiple persons/thirdparties are created through the modal (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/429)
|
||||
* [person_resource]: Onthefly button added to view person/thirdparty and badge differentiation for a contact-thirdparty (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/428)
|
||||
* [workflow][notification] improve how notifications and workflows are 'attached' to entities: contextual list, counter, buttons and vue modal
|
||||
* [AddAddress] disable multiselect search, and rely only on most pertinent Cities and Street computed backend
|
||||
* [fast_actions] improve fast-actions buttons override mechanism, fix https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/413
|
||||
* [homepage widget] add vue homepage_widget with asynchone loading, give a global view resume of the user concerned actions, notifications, etc.
|
||||
* [thirdparty] Add a contact to a thirdparty from within onTheFly (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/345)
|
||||
* [homepage widget] add vue homepage_widget with asynchone loading, give a global view resume of the user concerned actions, notifications, etc.
|
||||
|
||||
|
||||
### test release 2021-01-31
|
||||
|
||||
* [person] accompanying course: optimisation: do not fetch some resources for the banner (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/409)
|
||||
* [person] accompanying course: close modal when edit participation (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/420)
|
||||
* [person] accompanying course: treat validation error when editing on-the-fly entities (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/420)
|
||||
* [activity] show activity attendee (présence) in the activity list (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/412)
|
||||
* [activity] admin: change validation rule for social action visible field (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/413)
|
||||
* [parcours]: component added to change the opening date of a parcours (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/411)
|
||||
* [search]: listing of parcours display changed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/410)
|
||||
* [user]: page with accompanying periods to which is user is referent (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/408)
|
||||
* [person] age added to renderstring + renderbox/ vue component created to display person text (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/389)
|
||||
* [household member editor] allow to push to existing household
|
||||
|
||||
|
||||
### test release 2021-01-28
|
||||
|
||||
* [person] improve filiations vis graph: disable physics, use chill colors for persons-households-course, increase label of relations, remove labels on household arrows and other improvements (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/286, https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/362)
|
||||
* [activity] Order activity by date and by id (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/364)
|
||||
* [main] increase length of 4 Address fields (change to TEXT, no size limits) (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/277)
|
||||
* [main] Add confidential option for address, in edit and view (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/165)
|
||||
* [person] name suggestions within create person form when person is created departing from a search input (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/377)
|
||||
* [person] Add residential address entity, form and list for each person
|
||||
* [aside_activity]: dynamicUserPickerType used (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/399)
|
||||
* dispatching list
|
||||
|
||||
|
||||
### test release 2021-01-26
|
||||
|
||||
* [parcours] comments truncated if too long + link added (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/406)
|
||||
* [person]: possibility to add person resources (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/382)
|
||||
* [person ressources]: module added
|
||||
|
||||
|
||||
### test release 2022-01-24
|
||||
|
||||
* [person] name suggestions within create person form when person is created departing from a search input (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/377)
|
||||
* [notification: formulaire création] descend la box avec la description dans le bas du formulaire
|
||||
* [notification for activity]: fix link to activity
|
||||
* [notification] add "URGENT" before accompanying course with emergency = true
|
||||
* [notification] add a "read more" button on system notification
|
||||
* [notification] add `[Chill]` in the subject of each notification, automatically
|
||||
* [notification] add a counter for notification in activity list and accompanying period list, and search results
|
||||
* [parcours] bugfix if deathdate is not defined (eg. for a thirdparty) parcours is still displayed. Gave error before.
|
||||
* [workflow] add breadcrumb to show steps
|
||||
* [popover] add popover html popup mechanism (used by workflow breadcrumb)
|
||||
* [templates] improve updatedBy macro in item metadatas
|
||||
* [parcours]: bug fix when comment is pinned all other comments remain in the collection (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/385)
|
||||
* [workflow]
|
||||
* add My workflow section with my opened subscriptions
|
||||
* apply workflow on documents, accompanyingCourseWork and Evaluations
|
||||
* [wopi-link] a new vue component allow to open wopi link in a fullscreen chill-themed modal
|
||||
|
||||
### test release 2022-01-19
|
||||
* vuejs: add dead information on all on-the-fly person render boxes, in vis graph and other templates (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/271)
|
||||
* [thirdparty] fix bug in 3rd party view: types was replaced by thirdPartyTypes
|
||||
* [main] location form type: fix unmapped address field (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/246)
|
||||
* [activity] fix wrong import of js assets for adding and viewing documents in activity (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/83 & https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/176)
|
||||
* [person]: space added between deathdate and age in twig renderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/380)
|
||||
* [forms] dynamic picker types for user/person/thirdparty types created (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/386)
|
||||
|
||||
### test release 2022-01-17
|
||||
|
||||
* [main] Add editableByUser field to locationType entity, adapt the admin template and add this condition in the location-type endpoint (see https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/297)
|
||||
* [main] Add mainLocation field to User entity and add it in user form type
|
||||
* rewrite page which allow to select activity
|
||||
* [main] Add mainLocation field to User entity and add it in user form type
|
||||
* [course list in person context] show full username/label for ref
|
||||
* [accompanying period work] remove the possibility to generate document from an accompanying period work
|
||||
* vuejs: add validation on required fields for AddPerson, Address and Location components
|
||||
* vuejs: treat 422 validation errors in locations and AddPerson components
|
||||
* [person]: space added between deathdate and age in twig renderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/380)
|
||||
|
||||
## Test releases
|
||||
* vuejs: add validation on required fields for AddPerson, Address and Location components
|
||||
* vuejs: treat 422 validation errors in locations and AddPerson components
|
||||
* [person]: space added between deathdate and age in twig renderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/380)
|
||||
|
||||
### test release 2022-01-12
|
||||
|
||||
* fix thirdparty normalizer on telephone field: https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/322
|
||||
|
||||
### test release 2022-01-11
|
||||
|
||||
* vuejs: translate in French all multiselect widgets
|
||||
* [address] define address lines according postal standards for France and Belgium (default) and change AddressRender, chill_entity_render_box and AddressRenderBox.vue
|
||||
* [household] change translations (champs-libres/departement-de-la-vendee/accent-suivi-developpement#109)
|
||||
* [household] add address i18n in household component (champs-libres/departement-de-la-vendee/accent-suivi-developpement#158)
|
||||
* [household] add on the fly i18n in household component
|
||||
* [household] redirect to the household page when a household is created from a person (champs-libres/departement-de-la-vendee/accent-suivi-developpement#175)
|
||||
* [household] household member editor: display alert if some members have already an household (champs-libres/departement-de-la-vendee/accent-suivi-developpement#172)
|
||||
* [household] household member editor: do not add in new members if the member is included in the members of household (champs-libres/departement-de-la-vendee/accent-suivi-developpement#123)
|
||||
* [household] household member editor: remove markNoAddress button (champs-libres/departement-de-la-vendee/accent-suivi-developpement#109)
|
||||
* [person]: ordering fields in add person (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/61)
|
||||
* [person]: Add email and alt names in add person (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/61)
|
||||
* [accompanyingCourse] Add a delete action and delete buttons to delete a accompanying course when step = DRAFT (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/64)
|
||||
* [accompanyingCourse] Add a administrative location in the accompanying course, set the user current location as default, allow to select a location in a select field and do not allow to confirm the accompanying course if location is empty.
|
||||
* [accompanyingCourse] Add the administrative location in the available variables for document generation
|
||||
* AddAddress: optimize loading: wait for the user finish typing;
|
||||
* UserPicker: fix bug with deprecated role
|
||||
* docgen: add base context + tests
|
||||
* docgen: add age for person
|
||||
* [household menu] fix filiation order https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/265
|
||||
* [AddAddress]: optimize loading: wait for the user finish typing;
|
||||
* [UserPicker]: fix bug with deprecated role
|
||||
* [docgen]: add base context + tests
|
||||
* [docgen]: add age for person
|
||||
* [task]: fix dropdown menu style + fix bug in singleTaskController (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/338)
|
||||
* Household: fix bug when moving person on the same day (see https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/281)
|
||||
* Household: show date validFrom and validTo when moving
|
||||
* address reference: add index for refid
|
||||
* [accompanyingCourse_work] fix styles conflicts + fix bug with remove goal (remove goals one at a time)
|
||||
* [accompanyingCourse] improve masonry on resume page, add origin
|
||||
* [notification] new notification interface, can be associated to AccompanyingCourse/Period, Activities.
|
||||
* List notifications, show, and comment in User section
|
||||
* Notify button and contextual notification box on associated objects pages
|
||||
* [accompanyingCourse] add a comment for each resource associated. A modal allow to save comment. Comment is displayed in on-the-fly show modal of the accompanyingCourse context (edit page + resume page).
|
||||
|
||||
### test release 2021-12-14
|
||||
|
||||
* [asideactivity] creation of aside activity category fixed (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/262)
|
||||
* [vendee/person] fix typo "situation professionelle" => "situation professionnelle"
|
||||
* [main] add availableForUsers condition from locationType in the location API endpoint (champs-libres/departement-de-la-vendee/accent-suivi-developpement#248)
|
||||
* [main] add the current location of the user as API point + add it in the activity location list (champs-libres/departement-de-la-vendee/accent-suivi-developpement#247)
|
||||
* [activity] improve show/new/edit templates, fix SEE and SEE_DETAILS acl
|
||||
* [badges] create specific badge for TMS, and make person/thirdparty badges clickable with on-the-fly modal in :
|
||||
* concerned groups items (activity, calendar)
|
||||
* accompanyingCourseWork lists
|
||||
* accompanyingCourse lists
|
||||
* [acompanyingCourse] add initial comment on Resume page
|
||||
* [person] create button full width (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/330)
|
||||
|
||||
### test release 2021-12-11
|
||||
|
||||
* [main] add order field to civility
|
||||
* [main] change address format in case the country is France, in Address render box and address normalizer
|
||||
* [person] add validator for accompanying period with a test on social issues (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/76)
|
||||
* [activity] fix visibility for location
|
||||
* [origin] fix origin: use correctly the translatable strings
|
||||
* /!\ everyone must update the origin table. As there is only one row, execute `update chill_person_accompanying_period_origin set label = jsonb_build_object('fr', 'appel téléphonique');`
|
||||
* [person] redirect bug fixed.
|
||||
* [action] add an unrelated issue within action creation.
|
||||
* [origin] fix origin: use correctly the translatable strings
|
||||
* /!\ everyone must update the origin table. As there is only one row, execute `update chill_person_accompanying_period_origin set label = jsonb_build_object('fr', 'appel téléphonique');`
|
||||
* [main] change order of civilities in civility fixtures (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191)
|
||||
* [person] set min attr in the minimum of children field (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191)
|
||||
* [person] add marital status date in person view (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191)
|
||||
* [person] show number of children + allow set number of children to null (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191)
|
||||
* [person] show acceptSMS option (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191)
|
||||
* [person] add death information in person render box in twig and vue render boxes (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191)
|
||||
* [asideactivity] creation of aside activity category fixed (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/262)
|
||||
* [vendee/person] fix typo "situation professionelle" => "situation professionnelle"
|
||||
* [accompanyingcourse_work] Changes in layout/behavior of edit form (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/321)
|
||||
* [badge-entity] design coherency between pills badge-person and 3 kinds of badge-thirdparty
|
||||
* [AddPersons] suggestions row are clickable, not only checkbox
|
||||
|
||||
### test release 2021-12-06
|
||||
|
||||
* [main] address: use search API end points for getting postal code and reference address (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/316)
|
||||
* [main] address: in edit mode, select the encoded values in multiselect for address reference and city (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/316)
|
||||
* [person search] fix bug when using birthdate after and birthdate before
|
||||
* [person search] increase pertinence when lastname begins with search pattern
|
||||
* [activity/actions] Améliore la cohérence du design entre
|
||||
* la page résumé d'un parcours (liste d'actions récentes et liste d'activités récentes)
|
||||
* la page liste des actions
|
||||
* la page liste des activités (contexte personne / contexte parcours)
|
||||
* [household] field to edit wheter person is titulaire of household or not removed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/322)
|
||||
* [activity] create work if a work with same social action is not associated to the activity
|
||||
* [visgraph] improve and fix bugs on vis-network relationship graph
|
||||
* [bugfix] posting of birth- and deathdate through api fixed.
|
||||
* [suggestions] improve suggestions lists
|
||||
|
||||
### Test release 2021-11-19 - bis
|
||||
|
||||
* [household] do not allow to create two addresses on the same date
|
||||
* [activity] handle case when there is no social action associated to social issue
|
||||
* [activity] layout for issues / actions
|
||||
* [activity][bugfix] in edit mode, the form will now load the social action list
|
||||
|
||||
|
||||
### Test release 2021-11-29
|
||||
|
||||
* [person] suggest entities (person | thirdparty) when creating/editing the accompanying course (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/119)
|
||||
* [activity] add custom validation on the Activity class, based on what is required from the ActivityType (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/188)
|
||||
* [main] translate multiselect messages when selecting/creating address
|
||||
* [main] set the coordinates of the city when creating a new address OR choosing "pas d'adresse complète"
|
||||
* Use the user.label in accompanying course banner, instead of username;
|
||||
* fix: show validation message when closing accompanying course;
|
||||
* [thirdparty] link from modal to thirdparty detail page fixed (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/228)
|
||||
* [assets] new asset to style suggestions lists (with add/remove item link) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/258)
|
||||
* [accompanyingCourseWorkEdit] improves hyphenation and line breaks for long badges
|
||||
* [acompanyingCourse] improve Resume page
|
||||
* complete all needed informations,
|
||||
* actions and activities are clickables,
|
||||
* better placement with js masonry blocks on top of content area,
|
||||
* https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/101
|
||||
* https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/295
|
||||
* [activity/calendar] on show page, concerned groups of persons table adapt itself to isVisibles options
|
||||
* [activity] remove the "plus" button in activity list
|
||||
* [activity] check ACL on activity list in person context
|
||||
* [list for accompanying course in person] filter list using ACL
|
||||
* [validation] toasts are displayed for errors when modifying accompanying course (generalization required).
|
||||
* [period] only the user can enable confidentiality
|
||||
* add an endpoint for checking permissions. See https://gitlab.com/Chill-Projet/chill-bundles/-/merge_requests/232
|
||||
* [activity] for a new activity: suggest and create on-the-fly locations based on the accompanying course location + location of the suggested parties
|
||||
* [calendar] for a new rdv: suggest and create on-the-fly locations based on the accompanying course location + location of the suggested parties
|
||||
* [period] Validation added when period is confidential and confirmed -> user cannot be null.
|
||||
|
||||
|
||||
## Test releases
|
||||
|
||||
### Test release 2021-11-22
|
||||
|
||||
* [activity] delete admin_user_show in twig template because this route is not defined and should be defined
|
||||
* [activity] suggest requestor, user and ressources for adding persons|user|3rdparty
|
||||
* [calendar] suggest persons, professionals and invites for adding persons|3rdparty|user
|
||||
* [activity] take into account the restrictions on person|thirdparties|users visibilities defined in ActivityType
|
||||
* [main] Add currentLocation to the User entity + add a page for selecting this location + add in the user menu (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/133)
|
||||
* [activity] add user current location as default location for a new activity (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/133)
|
||||
* [task] Select2 field in task form to allow search for a user (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/167)
|
||||
* remove "search by phone configuration option": search by phone is now executed by default
|
||||
* remplacer le classement par ordre alphabétique par un classement par ordre de pertinence, qui tient compte:
|
||||
* de la présence d'une string avec le nom de la ville;
|
||||
* de la similarité;
|
||||
* du fait que la recherche commence par une partie du mot recherché
|
||||
* ajouter la recherche par numéro de téléphone directement dans la barre de recherche et dans le formulaire recherche avancée;
|
||||
* ajouter la recherche par date de naissance directement dans la barre de recherche;
|
||||
* ajouter la recherche par ville dans la recherche avancée
|
||||
* ajouter un lien vers le ménage dans les résultats de recherche
|
||||
* ajouter l'id du parcours dans les résultats de recherche
|
||||
* ajouter le demandeur dans les résultats de recherche
|
||||
* ajout d'un bouton "recherche avancée" sur la page d'accueil
|
||||
* [person] create an accompanying course: add client-side validation if no origin (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/210)
|
||||
* [person] fix bounds for computing current person address: the new address appears immediatly
|
||||
* [docgen] create a normalizer and serializer for normalization on doc format
|
||||
* [person normalization] the key center is now "centers" and is an array. Empty array if no center
|
||||
* [accompanyingCourse] Ability to close accompanying course (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/296)
|
||||
* [task] Select2 field in task form to allow search for a user (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/167)
|
||||
* [list result] show all courses, except ones with period closed
|
||||
* [accompanyingCourse] improve banner with small carousel to display slide social-issues or slide associated persons (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/69)
|
||||
|
||||
### Test release 2021-11-15
|
||||
|
||||
* [main] fix adding multiple AddresseDeRelais (combine PickAddressType with ChillCollection)
|
||||
* [person]: do not suggest the current household of the person (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/51)
|
||||
* [person]: display other phone numbers in view + add message in case no others phone numbers (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/184)
|
||||
* unnecessary whitespace removed from person banner after person-id + double parentheses removed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/290)
|
||||
* [person]: delete accompanying period work, including related objects (cascade) (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/36)
|
||||
* [address]: Display of incomplete address adjusted.
|
||||
* [household]: improve relationship graph
|
||||
* add form to create/edit/delete relationship link,
|
||||
* improve graph refresh mechanism
|
||||
* add feature to export canvas as image (png)
|
||||
* [person suggest] In widget "add person", improve the pertinence of persons when one of the names starts with the pattern;
|
||||
* [person] do not ask for center any more on person creation
|
||||
* [3party] do not ask for center any more on 3party creation
|
||||
|
||||
## Test releases
|
||||
|
||||
### Test release 2021-11-08
|
||||
|
||||
* [person]: Display the name of a user when searching after a User (TMS)
|
||||
* [person]: Add civility to the person
|
||||
* [person]: Various improvements on the edit person form
|
||||
* [person]: Set available_languages and available_countries as parameters for use in the edit person form
|
||||
* [activity] Bugfix: documents can now be added to an activity.
|
||||
* [tasks] improve tasks with filter order
|
||||
* [tasks] refactor singleControllerTasks: limit the number of conditions from the context
|
||||
* [validations] validation of accompanying period added: no duplicate participations or resources (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/60).
|
||||
* [renderbox] If gender of person is not defined, no icon is displayed instead of neuter-icon (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/129).
|
||||
* [confidential information] module added to blur confidential information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/248).
|
||||
* refactor `AuthorizationHelper` and `UserACLAwareRepository` to fix constructor, and separate logic for parent role helper into `ParentRoleHelper`
|
||||
* [main]: filter location and locationType in backend: exclude NULL names, only active and availableToUsers
|
||||
* [activity]: perform client-side validation & show/hide fields in the "new location" modal
|
||||
* [person]: normalize person with CenterResolverDispatcher and handle case where center is null or multiple in PersonRenderBox
|
||||
* [docstore] voter for PersonDocument and AccompanyingCourseDocument on the 2.0 way (using VoterHelperFactory)
|
||||
* [docstore] add authorization check inside controller and menu
|
||||
* [activity]: fix inheritance for role `ACTIVITY FULL` and add missing acl in menu
|
||||
* [person] show current address in search results
|
||||
* [person] show alt names in search results
|
||||
* [admin]: links to activity admin section added again.
|
||||
* [household]: endDate field deleted from household edit form.
|
||||
* [household]: View accompanying periods of current and old household members.
|
||||
* [tasks]: different layout for task list / my tasks, and fix link to tasks in alert or in warning
|
||||
* [admin]: links to activity admin section added again.
|
||||
* [household]: household addresses ordered by ValidFrom date and by id to show the last created address on top.
|
||||
* [socialWorkAction]: display of social issue and parent issues + banner context added.
|
||||
* [DBAL dependencies] Upgrade to DBAL 3.1
|
||||
|
||||
### Test release 2021-10-27
|
||||
|
||||
* [person]: delete double actions buttons on search person page
|
||||
* [person]: accompanying course work: remove creation date display the list of work + handle case when end date is null
|
||||
* [main]: Add new pages with a menu for managing location and location type in the admin
|
||||
* [main]: Add some fixtures for location type
|
||||
* [calendar]: Pass the location when transforming a calendar item (rdv) into an activity
|
||||
* [calendar]: Add a user menu for "my calendar"
|
||||
|
||||
### Test release 2021-10-18
|
||||
|
||||
* [3party]: french translation of contact and company
|
||||
* [3party]: show parent in list
|
||||
* [3party]: change color for badge "child"
|
||||
* [3party]: fix address creation
|
||||
* [household members editor] finalisation of editor
|
||||
* [AccompanyingCourse banner]: replace translation referrer (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/70)
|
||||
* [Location]: add location system in activity and RV (calendar). User can choose in location list or create a new location.
|
||||
* [household]: add relationship page with dynamic data visualisation graph
|
||||
|
||||
## Test releases
|
||||
|
||||
### Test release 2021-10-11
|
||||
|
||||
* Address: zoom on postal code geometry + fix origin of manually entered postal code
|
||||
|
||||
* in the Address vue component, order the postal code and street address by alphabetic and numeric order
|
||||
|
||||
* add 3 new fields to PostalCode and adapt postal code command and fixtures
|
||||
|
||||
* [Aside activity] Fixes for aside activity
|
||||
|
||||
* categories with child
|
||||
* fast creation buttons
|
||||
* add ordering for types
|
||||
|
||||
* [AccompanyingCourse Resume page] dashboard for AccompanyingCourseWork and for Activities;
|
||||
* Improve badges behaviour with small screens;
|
||||
|
||||
* [ThirdParty]:
|
||||
|
||||
* third party list
|
||||
* create a kind contact/institution when create a new thirdparty, and set contact embedded as kind=child;
|
||||
* filter thirdparties in list
|
||||
|
||||
* [FilterOrder]: add development kit for generating filter and ordering in list
|
||||
* [Capitalization of names] person names are capitalized on creation, on prePersist event
|
||||
* [On-The-Fly] modale works for showing, editing and creating person or thirdparty ;
|
||||
* [AccompanyingCourse Resume page] associated persons list, can see household when hover, and with show on-the-fly modale when clicking person ;
|
||||
|
||||
### test release 2021-10-04
|
||||
|
||||
* [Household editor][UI] Update how household suggestion and addresses are picked;
|
||||
|
||||
See https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/80
|
||||
* [AddAddress] Handle address suggestion;
|
||||
* [CenterType][Create a person] when overriding the ACL rules, allow to show a PickCenterType
|
||||
when no centers are reachable by the default ACL.
|
||||
* [Household] Show comment event if no address are associated with the household;
|
||||
* [Person results] Add requestor into search results:
|
||||
|
||||
* a badge "requestor" is shown into search results;
|
||||
* periods where the person is only requestor (without participating) are also shown;
|
||||
|
||||
Issues:
|
||||
|
||||
* https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/13
|
||||
* https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/199
|
||||
* [Person form] "accept sms" not required:
|
||||
|
||||
https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/37
|
||||
https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/221
|
||||
|
||||
* [Household editor] suggest only temporarily addresses;
|
||||
See https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/82
|
||||
* On-The-Fly modale works for showing, editing and creating person and thirdparty ;
|
||||
* AccompanyingCourse Resume page: list associated persons by household, see household when hover, and show on-the-fly modale when clicking on person ;
|
||||
* [AddAddress] Handle address suggestion;
|
||||
* [AddAddress][Entity address]: add a link between address and address reference;
|
||||
* [Household editor] suggest household by comparing the temporary addresses from courses;
|
||||
|
||||
See https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/81
|
||||
* On-The-Fly modale works for showing, editing and creating person and thirdparty
|
||||
|
||||
|
||||
## Test released
|
||||
|
||||
<!--
|
||||
|
||||
Coming soon...
|
||||
|
||||
DO NOT ADD unreleased items here. Add them under "Unreleased" title
|
||||
|
||||
### Test release yyyy-mm-dd
|
||||
|
||||
-->
|
||||
|
||||
## Stable releases
|
||||
|
||||
No stable releases for v2+
|
||||
|
@@ -1,17 +0,0 @@
|
||||
## v2.1.0 - 2023-06-12
|
||||
|
||||
### Feature
|
||||
|
||||
* [docgen] allow to pick a third party when generating a document in context Activity, AccompanyingPeriod
|
||||
|
||||
### Fixed
|
||||
|
||||
* ([#111](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/111)) List of "my accompanying periods": separate the active and closed periods in two different lists, and show the inactive_long and inactive_short periods
|
||||
|
||||
### Security
|
||||
|
||||
* ([#105](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/105)) Rights are checked for display of 'accompanying period' tab in household menu. Rights are also checked for creation of 'accompanying period' from within household context
|
||||
|
||||
### DX
|
||||
|
||||
* Add methods to RegroupmentRepository and fullfill Center / Regroupment Doctrine mapping
|
@@ -1,20 +0,0 @@
|
||||
## v2.10.0 - 2023-10-24
|
||||
### Feature
|
||||
* ([#172](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/172)) [export] Add a filter "grouping accompanying period by opening date" and "grouping accompanying period by closing date"
|
||||
* ([#172](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/172)) [export] add a filter and aggregator on accompanying period work: group/filter by handling third party
|
||||
* ([#172](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/172)) [export] add a filter and aggregator on activites: group/filter activities by people participating to the activities
|
||||
* ([#172](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/172)) [export] add a grouping on accompanying period export: group by activity type associated to at least one activity within the accompanying period
|
||||
* [export] sort filters and aggregators by title
|
||||
* ([#179](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/179)) [export] create a parameter that will force to skip the filtering by center (ACL) when generating an export
|
||||
### Fixed
|
||||
* ([#177](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/177)) [export] fix date range selection on filter and grouping "by status of the course at date", on accompanying periods
|
||||
|
||||
### Résumé francophone des changements
|
||||
|
||||
- Ajout d'un regroupement sur les parcours: par date de cloture et d'ouverture;
|
||||
- Ajouter d'un filtre et regroupement par tiers traitant sur les actions d'accompagnement;
|
||||
- ajout d'un filtre et regroupement par usager participant sur les échanges
|
||||
- ajout d'un regroupement: par type d'activité associé au parcours;
|
||||
- trie les filtre et regroupements par ordre alphabétique dans els exports
|
||||
- ajout d'un paramètre qui permet de désactiver le filtre par centre dans les exports
|
||||
- correction de l'interface de date dans les filtres et regroupements "par statut du parcours à la date"
|
@@ -1,3 +0,0 @@
|
||||
## v2.10.1 - 2023-10-24
|
||||
### Fixed
|
||||
* Fix export controller when generating an export without any data in session
|
@@ -1,3 +0,0 @@
|
||||
## v2.10.2 - 2023-10-26
|
||||
### Fixed
|
||||
* ([#175](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/175)) Use injection of translator instead of ->get().
|
@@ -1,3 +0,0 @@
|
||||
## v2.10.3 - 2023-10-26
|
||||
### Fixed
|
||||
* ([#175](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/175)) Replace old method of getting translator with injection of translatorInterface
|
@@ -1,3 +0,0 @@
|
||||
## v2.10.4 - 2023-10-26
|
||||
### Fixed
|
||||
* Fix null value constraint errors when merging relationships in doubles
|
@@ -1,4 +0,0 @@
|
||||
## v2.10.5 - 2023-11-05
|
||||
### Fixed
|
||||
* ([#183](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/183)) Fix "problem during download" on some filters, which used a wrong data type
|
||||
* ([#184](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/184)) Fix filter "activity by date"
|
@@ -1,4 +0,0 @@
|
||||
## v2.10.6 - 2023-11-07
|
||||
### Fixed
|
||||
* ([#182](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/182)) Fix merging of double person files. Adjustement relationship sql statement
|
||||
* ([#185](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/185)) Export: fix aggregator by geographical unit on person: avoid inconsistencies
|
@@ -1,6 +0,0 @@
|
||||
## v2.11.0 - 2023-11-07
|
||||
### Feature
|
||||
* ([#194](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/194)) Export: add a filter "filter activity by creator job"
|
||||
### Fixed
|
||||
* ([#185](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/185)) Export: fix "group accompanying period by geographical unit": take into account the accompanying periods when the period is not located within an unit
|
||||
* Fix "group activity by creator job" aggregator
|
@@ -1,26 +0,0 @@
|
||||
## v2.12.0 - 2023-11-15
|
||||
### Feature
|
||||
* ([#199](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/199)) Export: add an aggregator "group activities by presence"
|
||||
* ([#199](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/199)) Export: add a filter "filter activity by activity presence"
|
||||
* ([#199](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/199)) Export: add an aggregator "group activities by person" (only for the activities saved in a person context)
|
||||
* ([#199](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/199)) Export: add a new aggregator "group peoples by postal code"
|
||||
* ([#200](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/200)) Export: split export about person on accompanying period work: one with the people associated with the work, another one with the people associated with the accompanying period
|
||||
* ([#204](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/204)) Add 3 new filters and 3 new aggregators for work action creator (with jobs and scopes)
|
||||
|
||||
* ([#202](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/202)) Create export for the average duration of social work actions
|
||||
* ([#206](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/206)) Export: add a export which count persons on accompanying period work
|
||||
* ([#206](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/206)) Export: add an export which count persons on activity
|
||||
* ([#203](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/203)) Export: add clauses on the social work start date and end date within the filter "Filter accompanying period by accompanying period work"
|
||||
### Fixed
|
||||
* Export: fix typo in filter "filter accompanying period work on end date"
|
||||
* ([#189](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/189)) Export: Fix failure in export linked to household
|
||||
* ([#205](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/205)) Fix loading of accompanying period work referrers
|
||||
### Traduction francophone des principaux changements
|
||||
* export: ajout d'un regroupement "grouper les échanges par présence de l'usager";
|
||||
* export: ajout d'un filtre "filtre les échanges par présence de l'usager";
|
||||
* export: ajout d'un regroupement "regrouper les échanges par personne" (seulement pour les échanges enregistrés dans le contexte de l'usager);
|
||||
* export: ajout d'un regroupement "grouper les usagers par codes postaux"
|
||||
* export: séparation des exports sur les actions: dans l'un, les filtres des usagers portent sur les usagers concernés par l'action, dans l'autre, les filtres portent sur les usagers concernés par le parcours de l'action;
|
||||
* export: ajout de 3 nouveaux filtres et regroupements sur le créateur de l'action, son métier et son service;
|
||||
* export: correction de l'export sur les ménages liés aux parcours;
|
||||
* correction du chargement des actions d'accompagnement
|
@@ -1,3 +0,0 @@
|
||||
## v2.12.1 - 2023-11-16
|
||||
### Fixed
|
||||
* ([#208](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/208)) Export: fix loading of form for "filter action by type, goal and result"
|
@@ -1,9 +0,0 @@
|
||||
## v2.13.0 - 2023-11-21
|
||||
### Feature
|
||||
* ([#173](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/173)) Allow user to add a phonenumber to their profile which will be included in automatically generated documents
|
||||
### Fixed
|
||||
* ([#211](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/211)) Export: fix loading of "Group activity by type"
|
||||
* ([#190](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/190)) Export: fix loading of "group activity by reasons"
|
||||
* ([#213](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/213)) Export: fix usage of some Collection returned instead of array in export filters
|
||||
* ([#215](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/215)) Use only the string 'both' for gender (with a database migration)
|
||||
* ([#212](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/212)) Clean the database to make working the "Group people by gender" aggregator
|
@@ -1,8 +0,0 @@
|
||||
## v2.14.0 - 2023-11-24
|
||||
### Feature
|
||||
* ([#161](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/161)) Export: in filter "Filter accompanying period work (social action) by type, goal and result", order the items alphabetically or with the defined order
|
||||
### Fixed
|
||||
* ([#141](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/141)) Export: on filter "action by type goals, and results", restore the fields when editing a saved export
|
||||
* ([#219](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/219)) Export: fix the list of accompanying period work, when the "calc date" is null
|
||||
* ([#222](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/222)) Fix rendering of custom fields
|
||||
* Fix various errors in custom fields administration
|
@@ -1,5 +0,0 @@
|
||||
## v2.14.1 - 2023-11-29
|
||||
### Fixed
|
||||
* Export: fix list person with custom fields
|
||||
* ([#100](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/100)) Add a paginator to budget elements (resource and charge types) in the admin
|
||||
* Fix error in ListEvaluation when "handling agents" are alone
|
@@ -1,11 +0,0 @@
|
||||
## v2.15.0 - 2023-12-11
|
||||
### Feature
|
||||
* ([#191](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/191)) Add export "number of household associate with an exchange"
|
||||
* ([#235](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/235)) Export: add dates on the filter "filter course by activity type"
|
||||
### Fixed
|
||||
* ([#214](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/214)) Fix error when posting an empty comment on an accompanying period.
|
||||
* ([#233](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/233)) Fix "filter evaluation by evaluation type" (and add select2 to the list of evaluation types to pick)
|
||||
* ([#234](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/234)) Fix "filter aside activity by date"
|
||||
|
||||
* ([#228](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/228)) Fix export of activity for people created before the introduction of the createdAt column on person (during v1)
|
||||
* ([#246](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/246)) Do not show activities, evaluations and social work when associated to a confidential accompanying period, except for the users which are allowed to see them
|
@@ -1,5 +0,0 @@
|
||||
## v2.15.1 - 2023-12-20
|
||||
### Fixed
|
||||
* Fix the household export query to exclude accompanying periods that are in draft state.
|
||||
### DX
|
||||
* ([#167](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/167)) Fixed readthedocs compilation by updating readthedocs config file and requirements for Sphinx
|
@@ -1,5 +0,0 @@
|
||||
## v2.15.2 - 2024-01-11
|
||||
### Fixed
|
||||
* Fix the id_seq used when creating a new accompanying period participation during fusion of two person files
|
||||
### DX
|
||||
* Set placeholder to False for expanded EntityType form fields where required is set to False.
|
@@ -1,15 +0,0 @@
|
||||
## v2.16.0 - 2024-02-08
|
||||
### Feature
|
||||
* ([#231](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/231)) Create new filter for persons having a participation in an accompanying period during a certain time span
|
||||
* ([#241](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/241)) [Export][List of accompanyign period] Add two columns: the list of persons participating to the period, and their ids
|
||||
* ([#244](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/244)) Add capability to generate export about change of steps of accompanying period, and generate exports for this
|
||||
* ([#253](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/253)) Export: group accompanying period by person participating
|
||||
* ([#243](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/243)) Export: add filter for courses not linked to a reference address
|
||||
* ([#229](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/229)) Allow to group activities linked with accompanying period by reason
|
||||
* ([#115](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/115)) Prevent social work to be saved when another user edited conccurently the social work
|
||||
* Modernize the event bundle, with some new fields and multiple improvements
|
||||
### Fixed
|
||||
* ([#220](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/220)) Fix error in logs about wrong typing of eventArgs in onEditNotificationComment method
|
||||
* ([#256](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/256)) Fix the conditions upon which social actions should be optional or required in relation to social issues within the activity creation form
|
||||
### UX
|
||||
* ([#260](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/260)) Order list of centers alphabetically in dropdown 'user' section admin.
|
@@ -1,3 +0,0 @@
|
||||
## v2.16.1 - 2024-02-09
|
||||
### Fixed
|
||||
* Force bootstrap version to avoid error in builds with newer version
|
@@ -1,3 +0,0 @@
|
||||
## v2.16.2 - 2024-02-21
|
||||
### Fixed
|
||||
* Check for null values in closing motive of parcours d'accompagnement for correct rendering of template
|
@@ -1,5 +0,0 @@
|
||||
## v2.16.3 - 2024-02-26
|
||||
### Fixed
|
||||
* ([#236](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/236)) Fix translation of user job -> 'service' must be 'métier'
|
||||
### UX
|
||||
* ([#232](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/232)) Order user jobs and services alphabetically in export filters
|
@@ -1,9 +0,0 @@
|
||||
## v2.17.0 - 2024-03-19
|
||||
### Feature
|
||||
* ([#237](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/237)) New export filter for social actions with an evaluation created between two dates
|
||||
* ([#258](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/258)) In the list of accompangying period, add the list of person's centers and the duration of the course
|
||||
* ([#238](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/238)) Allow to customize list person with new fields
|
||||
* ([#159](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/159)) Admin can publish news on the homepage
|
||||
### Fixed
|
||||
* ([#264](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/264)) Fix languages: load the languages in all availables languages configured for Chill
|
||||
* ([#259](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/259)) Keep a consistent behaviour between the filtering of activities within the document generation (model "accompanying period with activities"), and the same filter in the list of activities for an accompanying period
|
@@ -1,5 +0,0 @@
|
||||
## v2.18.0 - 2024-03-26
|
||||
### Feature
|
||||
* ([#268](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/268)) Improve admin UX to configure document templates for document generation
|
||||
### Fixed
|
||||
* ([#267](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/267)) Fix the join between job and user in the user list (admin): show only the current user job
|
@@ -1,3 +0,0 @@
|
||||
## v2.18.1 - 2024-03-26
|
||||
### Fixed
|
||||
* Fix layout issue in document generation for admin (minor)
|
@@ -1,3 +0,0 @@
|
||||
## v2.18.2 - 2024-04-12
|
||||
### Fixed
|
||||
* ([#250](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/250)) Postal codes import : fix the source URL and the keys to handle each record
|
@@ -1,20 +0,0 @@
|
||||
## v2.19.0 - 2024-05-14
|
||||
### Feature
|
||||
* ([#197](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/197)) Make the script which subscribe to microsoft calendars changes more tolerant to errors or missing configuration on the microsoft side
|
||||
* ([#276](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/276)) Take closing date into account when computing the geographical unit on accompanying period. When a person moved after an accompanying period is closed, the date of closing accompanying period is took into account if it is earlier than the date given by the user.
|
||||
### Fixed
|
||||
* ([#270](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/270)) Fix broken link in homepage when a evaluation from a closed acc period was present in the homepage widget
|
||||
* ([#275](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/275)) Allow the filter "filter accompanying period by geographical unit" to take period's location on address into account
|
||||
### UX
|
||||
* Form for document generation moved to the top of document list page
|
||||
* ([#266](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/266)) Event bundle: adjust certain graphical issues for better user experience
|
||||
|
||||
|
||||
### Traduction francophone des principaux changements
|
||||
|
||||
- script de synchronisation des agendas de microsoft Outlook: le script est plus tolérant aux erreurs de configuration côté serveur (manque de droit d'accès);
|
||||
- dans les statistiques sur les parcours d'accompagnements, regroupement et filtre par unité géographique: lorsque la date de prise en compte de l'adresse est postérieure à la fermeture du parcours, c'est la date de fermeture du parcours qui est prise en compte (cela permet de tenir compte de la localisation de l'usager au moment de la fermeture dans le cas où celui-ci aurait déménagé par la suite);
|
||||
- sur la page d'accueil, il n'y a plus de rappel pour les évaluations pour les parcours cloturés;
|
||||
- correction du filtre "filtrer par zone géographique"
|
||||
- répétition du bouton pour générer un document en haut de la page "liste des documents", quand il y a plus de cinq documents;
|
||||
- module événement: améliorerations graphiques
|
@@ -1,12 +0,0 @@
|
||||
## v2.2.0 - 2023-06-18
|
||||
### Feature
|
||||
* When navigating from a workflow regarding to an evaluation's document to an accompanying course, scroll directly to the document, and blink to highlight this document
|
||||
* Add notification to accompanying period work and work's evaluation's documents
|
||||
* ([#113](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/113))[Export] Filter accompanying period by step at date: allow to pick multiple steps
|
||||
* ([#113](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/113))[export] add a filter on accompanying period: filter by step between two dates
|
||||
### Fixed
|
||||
* use the correct annotation for the association between PersonCurrentCenter and Person
|
||||
* ([#58](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/58))Fix birthdate timezone in PersonRenderBox
|
||||
* ([#55](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/55))Fix the notification counter
|
||||
### DX
|
||||
* DQL function OVERLAPSI: simplify expression in postgresql
|
@@ -1,3 +0,0 @@
|
||||
## v2.2.1 - 2023-06-19
|
||||
### Fixed
|
||||
* ([#114](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/114)) [notification on document evaluation] fix entityId and return path when adding a notification on a document in an evaluation
|
@@ -1,5 +0,0 @@
|
||||
## v2.2.2 - 2023-06-26
|
||||
### Fixed
|
||||
* [Accompanying period comments]: order comments from the most recent to the oldest, in the list
|
||||
* Api: filter social action to keep only the currently activated
|
||||
* ([#82](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/82)) Fix deletion and re-creation of filiation relationship
|
@@ -1,21 +0,0 @@
|
||||
## v2.20.0 - 2024-06-05
|
||||
### Fixed
|
||||
* ([#170](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/170)) Display agents traitants instead of accompanying period referrer in export list social actions.
|
||||
* Added translations for choices of durations (> 5 hours)
|
||||
### Feature
|
||||
* ([#145](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/145)) Allow to open documents in LibreOffice locally (need configuration within security);
|
||||
|
||||
This endpoint should be added to make the endpoint works properly:
|
||||
|
||||
```yaml
|
||||
security:
|
||||
firewalls:
|
||||
dav:
|
||||
pattern: ^/dav
|
||||
provider: chain_provider
|
||||
stateless: true
|
||||
guard:
|
||||
authenticators:
|
||||
- Chill\DocStoreBundle\Security\Guard\JWTOnDavUrlAuthenticator
|
||||
|
||||
```
|
@@ -1,3 +0,0 @@
|
||||
## v2.20.1 - 2024-06-05
|
||||
### Fixed
|
||||
* Do not allow StoredObjectCreated for edit and convert buttons
|
@@ -1,31 +0,0 @@
|
||||
## v2.21.0 - 2024-06-18
|
||||
### Feature
|
||||
* Add flash menu buttons in search results, to open directly a new calendar, or a new activity in an accompanying period
|
||||
* ([#122](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/122)) Improve the list of calendar in the search results: make all calendar clicable, and display a list of calendars
|
||||
* ([#282](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/282)) [export] add start date and end date on filters "filter course by referrer job" and "filter course by referrer scope"
|
||||
* ([#282](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/282)) [export] the aggregator "Group by referrer" now accept a date range.
|
||||
* ([#282](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/282)) [export] add date range on "group course by referrer's scope"
|
||||
* ([#282](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/282)) [export] add date range on "group course by referrer's jobs"
|
||||
* ([#168](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/168) In the UX, display user job and service at the time when he performs an action:
|
||||
now, the job and service is shown:
|
||||
* at the activity's date,
|
||||
* at the appointment's date,
|
||||
* when the user is marked as referrer for an accompanying period work,
|
||||
* when the user apply a transition in a workflow,
|
||||
* when the user updates or creates "something" ("created/updated by ... at ..."),
|
||||
* or when he wrote a comment,
|
||||
* …
|
||||
|
||||
### Traduction francophone
|
||||
* Ajout d'un menu "flash" dans les résultats de recherche, pour créer un rendez-vous ou un échange dans un parcours depuis les résultats de recherche;
|
||||
* Améliore la liste des rendez-vous dans les résultats de recherche: les rendez-vous sont cliquables;
|
||||
* [exports] Ajout d'intervalles de dates pour des filtres et regroupements des parcours par référent, métier du référent, service du référent;
|
||||
* Affiche le métier et le service des utilisateurs à la date à laquelle il a exécuté une action. Le métier et le service est affiché:
|
||||
* à la date d'un échange,
|
||||
* au jour d'un rendez-vous,
|
||||
* quand l'utilisateur est devenu référent d'un parcours d'accompagnement,
|
||||
* quand il a appliqué une transition sur un workflow,
|
||||
* quand il a mise à jour ou créé une fiche, dans les mentions "créé / mise à jour par ..., le ...",
|
||||
* quand il a mis à jour un commentaire,
|
||||
* …
|
||||
|
@@ -1,6 +0,0 @@
|
||||
## v2.22.0 - 2024-06-25
|
||||
### Feature
|
||||
* ([#216](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/216)) [event bundle] exports added for the event module
|
||||
|
||||
### Traduction francophone
|
||||
* Exports sont ajoutés pour la module événement.
|
@@ -1,5 +0,0 @@
|
||||
## v2.22.1 - 2024-07-01
|
||||
### Fixed
|
||||
* Remove debug word
|
||||
### DX
|
||||
* Add a command for reading official address DB from Luxembourg and update chill addresses
|
@@ -1,3 +0,0 @@
|
||||
## v2.22.2 - 2024-07-03
|
||||
### Fixed
|
||||
* Remove scope required for event participation stats
|
@@ -1,30 +0,0 @@
|
||||
## v2.23.0 - 2024-07-23 & 2024-07-19
|
||||
### Feature
|
||||
* ([#221](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/221)) [DX] move async-upload-bundle features into chill-bundles
|
||||
* Add job bundle (module emploi)
|
||||
* Upgrade import of address list to the last version of compiled addresses of belgian-best-address
|
||||
|
||||
* Upgrade CKEditor and refactor configuration with use of typescript
|
||||
|
||||
* ([#123](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/123)) Add a button to duplicate calendar ranges from a week to another one
|
||||
* [admin] filter users by active / inactive in the admin user's list
|
||||
* ([#273](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/273)) Add the possibility to mark all notifications as read
|
||||
|
||||
|
||||
* Handle duplicate reference id in the import of reference addresses
|
||||
* Do not update the "createdAt" column when importing postal code which does not change
|
||||
* Display filename on file upload within the UI interface
|
||||
### Fixed
|
||||
* Fix resolving of centers for an household, which will fix in turn the access control
|
||||
* Resolved type hinting error in activity list export
|
||||
* ([#271](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/271)) Take into account the acp closing date in the acp works date filter
|
||||
|
||||
### Traduction française des principaux changements
|
||||
- Ajout d'un bouton pour dupliquer les périodes de disponibilités d'une semaine à une autre;
|
||||
- dans l'interface d'administration, filtre sur les utilisateurs actifs. Par défaut, seul les utilisateurs
|
||||
actifs sont affichés;
|
||||
- Nouveau bouton pour indiquer toutes les notifications comme lues;
|
||||
- Améliorations sur l'import des adresses et des codes postaux;
|
||||
- Affiche le nom du fichier déposé quand on téléverse un fichier depuis le poste de travail local;
|
||||
- Agrandit l'icône du type de fichier dans l'interface de dépôt de fichier;
|
||||
- correction: tient compte de la date de fermeture du parcours dans les filtres sur les actions d'accompagnement.
|
@@ -1,3 +0,0 @@
|
||||
## v2.24.0 - 2024-09-11
|
||||
### Feature
|
||||
* ([#306](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/306)) When a document is converted or downloaded in the browser, this document is removed from the browser memory after 45s. Future click on the button re-download the document.
|
@@ -1,42 +0,0 @@
|
||||
## v2.3.0 - 2023-06-27
|
||||
### Feature
|
||||
* ([#110](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/110)) Edit saved exports options: the saved exports options (forms, filters, aggregators) are now editable.
|
||||
* ([#103](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/103)) Get an unified list of document in person and accompanying period context
|
||||
* [export] Set the default date of calculation of the accompanying period's list as "today"
|
||||
* Force accompanying period user history to be unique for the same period and stardate/enddate [:warning: may encounter migration issue]
|
||||
|
||||
If some issue is encountered during migration, use this SQL to find the line which are in conflict, examine the problem and delete some of the concerning line
|
||||
*
|
||||
```sql
|
||||
-- to see the line which are in conflict with another one
|
||||
SELECT o.*
|
||||
FROM chill_person_accompanying_period_user_history o
|
||||
JOIN chill_person_accompanying_period_user_history c ON o.id < c.id AND o.accompanyingperiod_id = c.accompanyingperiod_id
|
||||
WHERE tsrange(o.startdate, o.enddate, '[)') && tsrange(c.startdate, c.enddate, '[)')
|
||||
ORDER BY accompanyingperiod_id;
|
||||
-- to examine line in conflict for a given accompanyingperiod_id (given by the previous query)
|
||||
SELECT * FROM chill_person_accompanying_period_user_history WHERE accompanyingperiod_id = IIIIDDDD order by startdate, enddate;
|
||||
```
|
||||
* Rename label of filter in French: "parcours actif" => "parcours ouvert", and "filtrer les parcours ouverts" => "Filtrer les parcours dont la date d'ouverture"
|
||||
|
||||
### Traduction francophone des principaux changements
|
||||
|
||||
* Les exports enregistrés sont éditables par l'utilisateur;
|
||||
* L'onglet "Document" dans les parcours et les dossiers d'usager affiche désormais les documents ajoutés à différents endroits.
|
||||
|
||||
Pour les parcours, il s'agit de:
|
||||
|
||||
- documents ajoutés directement dans le parcours;
|
||||
- documents des échanges;
|
||||
- documents des rendez-vous;
|
||||
- documents des évaluations;
|
||||
- documents directement ajoutés dans le dossier des usagers concernés par le parcours;
|
||||
|
||||
Pour les usagers, il s'agit de:
|
||||
|
||||
- documents des échanges;
|
||||
- documents des parcours;
|
||||
- documents des rendez-vous;
|
||||
- documents des actions, des échanges, des rendez-vous, des évaluations ajoutés dans les parcours.
|
||||
* Dans la liste des parcours, la date de calcul des éléments associés est "aujourd'hui" par défaut.
|
||||
* Dans les exports, renommage des libellés des filtres: "parcours actif" => "parcours ouvert", et "filtrer les parcours ouverts" => "Filtrer les parcours dont la date d'ouverture"
|
@@ -1,36 +0,0 @@
|
||||
## v2.4.0 - 2023-07-07
|
||||
|
||||
### Feature
|
||||
* ([#113](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/113)) [export] on "filter by user working" on accompanying period, add two dates to filters intervention within a period
|
||||
* ([#113](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/113)) [export] Add an aggregator by user's job working on a course
|
||||
* ([#113](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/113)) [export] add an aggregator by user's scope working on a course
|
||||
* [export] on aggregator "user working on a course"
|
||||
* ([#113](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/113)) [export] add a center aggregator for Person
|
||||
* ([#113](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/113)) [export] add a filter on "job working on a course"
|
||||
* ([#113](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/113)) [export] Add a filter on "scope working on a course"
|
||||
* ([#121](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/121)) Create a role "See Confidential Periods", separated from the "Reassign courses" role
|
||||
* ([#124](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/124)) Sync user absence / presence through microsoft outlook / graph api.
|
||||
|
||||
### Fixed
|
||||
* ([#116](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/116)) On the accompanying course page, open the action on view mode if the user does not have right to update them (i.e. if the accompanying period is closed)
|
||||
* [export] Rename label for CurrentActionFilter (on accompanying period work) to make precision between "ouvert" and "sans date de fin"
|
||||
* Force the db to have either a person_location or a address_location, and avoid to have both also internally in the entity
|
||||
* [export] set rolling date on person age aggregator
|
||||
* [export] fix list when a person locating a course is without address
|
||||
* [export] remove unused condition on course about duration participation
|
||||
* Command to subscribe on MS Graph users calendars: improve the loop to be more efficient
|
||||
|
||||
### DX
|
||||
* Rolling Date: can receive a null parameter
|
||||
|
||||
### Traduction francophone des principaux changements
|
||||
|
||||
- sur le "filtre par intervenant", ajoute deux dates pour limiter la période d'intervention;
|
||||
- ajout d'un regroupement par métier des intervenants sur un parcours;
|
||||
- ajout d'un regroupement par service des intervenants sur un parcours;
|
||||
- ajout d'un regroupement par utilisateur intervenant sur un parcours
|
||||
- ajout d'un regroupement "par centre de l'usager";
|
||||
- ajout d'un filtre "par métier intervenant sur un parcours";
|
||||
- ajout d'un filtre "par service intervenant sur un parcours";
|
||||
- création d'un rôle spécifique pour voir les parcours confidentiels (et séparer de celui de la liste qui permet de ré-assigner les parcours en lot);
|
||||
- synchronisation de l'absence des utilisateurs par microsoft graph api
|
@@ -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
|
@@ -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
|
@@ -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)
|
@@ -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.
|
@@ -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)
|
||||
|
@@ -1,3 +0,0 @@
|
||||
## v2.6.1 - 2023-09-14
|
||||
### Fixed
|
||||
* Filter out active centers in exports, which uses a different PickCenterType.
|
@@ -1,3 +0,0 @@
|
||||
## v2.6.2 - 2023-09-18
|
||||
### Fixed
|
||||
* Fix doctrine mapping of AbstractTaskPlaceEvent and SingleTaskPlaceEvent: id property moved.
|
@@ -1,4 +0,0 @@
|
||||
## v2.6.3 - 2023-09-19
|
||||
### Fixed
|
||||
* Remove id property from document
|
||||
mappedsuperclass
|
@@ -1,6 +0,0 @@
|
||||
## v2.7.0 - 2023-09-27
|
||||
### Feature
|
||||
* ([#155](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/155)) The regulation list load accompanying periods by exact postal code (address associated with postal code), and not by the content of the postal code (postal code with same code's string)
|
||||
### Fixed
|
||||
* ([#142](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/142)) Fix the label of filter ActivityTypeFilter to a more obvious one
|
||||
* ([#140](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/140)) [export] Fix association of filter "filter location by type" which did not appears on "list of activities"
|
@@ -1,19 +0,0 @@
|
||||
## v2.8.0 - 2023-10-05
|
||||
|
||||
### Feature
|
||||
|
||||
* ([#162](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/162)) Reassigning list: when reassigning courses to a new user, the job associated with the course become the one of the new user (if any)
|
||||
* Reassining list: the length of the list is increased to 100 courses
|
||||
|
||||
### Fixed
|
||||
|
||||
* ([#143](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/143)) Fix filter "accompanying course by social action" to avoid duplication in list
|
||||
* ([#164](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/164)) View a third party: avoid errors when a contact has a civility
|
||||
* ([#163](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/163)) Fix the filters and aggregators on exports "count peoples"
|
||||
* ([#143](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/143)) From the database, avoid the creation of location history for same period and at same dates
|
||||
|
||||
### Traduction francophone des principaux changements
|
||||
|
||||
- Fonctionnalité: Réassigner les parcours en lot: lorsque des parcours sont réassignés "en lot", les parcours sont maintenant associés au métier du nouveau référent;
|
||||
- Correction: certaines causes qui créaient des doublons dans les listes ont été corrigées;
|
||||
- Correction des associations entre l'export "nombre de personnes" et les filtres et regroupements associés
|
@@ -1,23 +0,0 @@
|
||||
## v2.9.0 - 2023-10-17
|
||||
### Feature
|
||||
* ([#147](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/147)) Add history to scopes and to jobs in administrator section. When user job or main scope of user is changed, automaticaly add a new row in history.
|
||||
* ([#146](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/146)) Allow closing motives to be identified as 'canceling the accompanying period' + don't take canceled accompanying periods into account
|
||||
* [export] add an aggregator for activities: group by job scope's creator aggregator
|
||||
* DX: prepare the code for the upgrade to symfony 5.4
|
||||
|
||||
### Traductions francophones des principaux changements
|
||||
|
||||
- ajout de l'historique des services et métiers pour les utilisateurs. Les exports, filtres et regroupements sont adaptés pour tenir compte du métier et du service
|
||||
de l'utilisateur au moment de l'échange, de sa désignation comme agent traitant de l'échange ou du moment du rendez-vous ([#147](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/147)))
|
||||
- modification des motifs de cloture des parcours: ajout d'un chanmp "annule le parcours", qui permet d'indiquer que le motif "annule" le parcours. Les parcours annulés n'apparaissent
|
||||
pas dans les statistiques
|
||||
- ajouter d'un regroupement pour les échanges: grouper par métier et service du créateur de l'échange
|
||||
|
||||
|
||||
### Possible BC break in configuration
|
||||
|
||||
This release remove the use of deprecated package [symfony/templating](https://symfony.com/components/Templating).
|
||||
|
||||
If you use this package in your own bundle (usually `src/` directory, or other dependencies), you should add this dependencies in your local composer.json (`composer require symfony/templating`).
|
||||
|
||||
But if you do not need this any more, you must ensure that the configuration key `framework.templating` is removed. This is usually located into `config/packages/framework.yaml`. [See here an example](https://gitea.champs-libres.be/Chill-project/chill-skeleton-basic/commit/cc716beaecc239e6a189f3db62ea95f169a37505#diff-df607fe73ff82c569824a7392edf5e760e998efe)
|
@@ -1,3 +0,0 @@
|
||||
## v2.9.1 - 2023-10-17
|
||||
### Fixed
|
||||
* Fix the handling of activity form when editing or creating an activity in an accompanying period with multiple centers
|
@@ -1,3 +0,0 @@
|
||||
## v2.9.2 - 2023-10-17
|
||||
### Fixed
|
||||
* Fix possible null values in string's entities
|
@@ -1,5 +0,0 @@
|
||||
## v3.0.0 - 2024-08-26
|
||||
### Fixed
|
||||
* Fix delete action for accompanying periods in draft state
|
||||
* Fix connection to azure when making an calendar event in chill
|
||||
* CollectionType js fixes for remove button and adding multiple entries
|
@@ -1,3 +0,0 @@
|
||||
## v3.1.0 - 2024-08-30
|
||||
### Feature
|
||||
* Add export aggregator to aggregate activities by household + filter persons that are not part of an accompanyingperiod during a certain timeframe.
|
@@ -1,6 +0,0 @@
|
||||
## v3.1.1 - 2024-10-01
|
||||
### Fixed
|
||||
* ([#308](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/308)) Show only the current referrer in the page "show" for an accompanying period workf
|
||||
* ([#309](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/309)) Correctly compute the grouping by referrer aggregator
|
||||
|
||||
* Fixed typing of custom field long choice and custom field group
|
@@ -1,39 +0,0 @@
|
||||
changesDir: .changes
|
||||
unreleasedDir: unreleased
|
||||
headerPath: header.tpl.md
|
||||
changelogPath: CHANGELOG.md
|
||||
versionExt: md
|
||||
versionFormat: '## {{.Version}} - {{.Time.Format "2006-01-02"}}'
|
||||
kindFormat: '### {{.Kind}}'
|
||||
# Note: it is possible to add a `.custom.Long` text manually into the yaml file produced by `changie new`. This will add a long description.
|
||||
changeFormat: >-
|
||||
* {{ if not (eq .Custom.Issue "") }}([#{{ .Custom.Issue }}](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/{{ .Custom.Issue }})) {{ end }}{{.Body}} {{ if and (.Custom.Long) (not (eq .Custom.Long "")) }}
|
||||
|
||||
{{ .Custom.Long }}{{ end }}
|
||||
custom:
|
||||
- key: Issue
|
||||
label: Issue number (on chill-bundles repository) (optional)
|
||||
optional: true
|
||||
type: int
|
||||
minInt: 1
|
||||
body:
|
||||
# allow multiline messages
|
||||
block: true
|
||||
kinds:
|
||||
- label: Feature
|
||||
auto: minor
|
||||
- label: Deprecated
|
||||
auto: minor
|
||||
- label: Fixed
|
||||
auto: patch
|
||||
- label: Security
|
||||
auto: patch
|
||||
- label: DX
|
||||
auto: patch
|
||||
- label: UX
|
||||
auto: patch
|
||||
newlines:
|
||||
afterChangelogHeader: 1
|
||||
beforeChangelogVersion: 1
|
||||
endOfVersion: 1
|
||||
envPrefix: CHANGIE_
|
@@ -7,7 +7,6 @@ charset = utf-8
|
||||
end_of_line = LF
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
indent_size = 4
|
||||
|
||||
[*.{php,html,twig}]
|
||||
indent_style = space
|
||||
@@ -18,12 +17,3 @@ max_line_length = 80
|
||||
|
||||
[COMMIT_EDITMSG]
|
||||
max_line_length = 0
|
||||
|
||||
[*.{js, vue, ts}]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
|
||||
[.rst]
|
||||
ident_size = 3
|
||||
ident_style = space
|
||||
|
||||
|
98
.env
98
.env
@@ -1,45 +1,45 @@
|
||||
# * .env contains default values for the environment variables needed by the app
|
||||
# * .env.local uncommitted file with local overrides
|
||||
# * .env.$APP_ENV committed environment-specific defaults
|
||||
# * .env.$APP_ENV.local uncommitted environment-specific overrides
|
||||
#
|
||||
# Real environment variables win over .env files.
|
||||
#
|
||||
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
|
||||
# https://symfony.com/doc/current/configuration/secrets.html
|
||||
#
|
||||
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
|
||||
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
|
||||
##
|
||||
## Manually dump .env files in .env.local.php with
|
||||
## `$ composer symfony:dump-env prod`
|
||||
##
|
||||
|
||||
## Project environment
|
||||
APP_ENV=dev
|
||||
|
||||
## Enable debug
|
||||
APP_DEBUG=true
|
||||
|
||||
## Locale
|
||||
LOCALE=fr
|
||||
|
||||
###> symfony/framework-bundle ###
|
||||
# this should be set in docker-compose.yml file
|
||||
APP_ENV=prod
|
||||
APP_SECRET=ChangeItf2b58287ef7f9976409d3f6c72529e99ChangeIt
|
||||
TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
|
||||
TRUSTED_HOSTS='^(localhost|example\.com|nginx)$'
|
||||
###< symfony/framework-bundle ###
|
||||
## Framework secret
|
||||
APP_SECRET=ThisTokenIsNotSoSecretChangeIt
|
||||
|
||||
## Wopi server for editing documents online
|
||||
WOPI_SERVER=http://collabora:9980
|
||||
|
||||
# must be manually set in .env.local
|
||||
# ADMIN_PASSWORD=
|
||||
|
||||
###> symfony/mailer ###
|
||||
# MAILER_DSN=null://null
|
||||
###< symfony/mailer ###
|
||||
## Symfony/swiftmailer
|
||||
MAILER_TRANSPORT=smtp
|
||||
MAILER_HOST=smtp
|
||||
MAILER_PORT=1025
|
||||
MAILER_CRYPT=
|
||||
MAILER_AUTH=
|
||||
MAILER_USER=
|
||||
MAILER_PASSWORD=
|
||||
MAILER_URL=${MAILER_TRANSPORT}://${MAILER_HOST}:${MAILER_PORT}?encryption=${MAILER_CRYPT}&auth_mode=${MAILER_AUTH}&username=${MAILER_USER}&password=${MAILER_PASSWORD}
|
||||
|
||||
## Notifications
|
||||
NOTIFICATION_HOST=localhost:8001
|
||||
NOTIFICATION_FROM_EMAIL=admin@chill.social
|
||||
NOTIFICATION_FROM_NAME="Chill <admin@chill.social>"
|
||||
NOTIFICATION_FROM_NAME=Chill
|
||||
|
||||
## Pgadmin credential
|
||||
PGADMIN_DEFAULT_EMAIL=
|
||||
PGADMIN_DEFAULT_PASSWORD=
|
||||
## Gelf
|
||||
GELF_HOST=gelf
|
||||
GELF_PORT=12201
|
||||
|
||||
## OVH OpenStack Storage User/Role
|
||||
OS_USERNAME=
|
||||
OS_PASSWORD=
|
||||
OS_TENANT_ID=
|
||||
OS_REGION_NAME=GRA
|
||||
OS_AUTH_URL=https://auth.cloud.ovh.net/v2.0/
|
||||
|
||||
## OVH OpenStack Storage Container
|
||||
ASYNC_UPLOAD_TEMP_URL_KEY=
|
||||
@@ -54,41 +54,11 @@ REDIS_URL=redis://${REDIS_HOST}:${REDIS_PORT}
|
||||
## Twilio
|
||||
TWILIO_SID=~
|
||||
TWILIO_SECRET=~
|
||||
DEFAULT_CARRIER_CODE=BE
|
||||
|
||||
ADD_ADDRESS_DEFAULT_COUNTRY=BE
|
||||
|
||||
ADD_ADDRESS_MAP_CENTER_X=50.8443
|
||||
ADD_ADDRESS_MAP_CENTER_Y=4.3523
|
||||
ADD_ADDRESS_MAP_CENTER_Z=15
|
||||
|
||||
SHORT_MESSAGE_DSN=null://null
|
||||
|
||||
## DOCKER IMAGES REGISTRY
|
||||
#IMAGE_PHP=
|
||||
#IMAGE_NGINX=
|
||||
|
||||
## DOCKER IMAGES TAG
|
||||
## DOCKER IMAGES VERSION
|
||||
#VERSION=test
|
||||
#VERSION=prod
|
||||
|
||||
###> symfony/messenger ###
|
||||
# Choose one of the transports below
|
||||
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
|
||||
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
|
||||
MESSENGER_TRANSPORT_DSN=sync://
|
||||
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
|
||||
###< symfony/messenger ###
|
||||
|
||||
###> doctrine/doctrine-bundle ###
|
||||
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
|
||||
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
|
||||
#
|
||||
DATABASE_URL="postgresql://postgres:postgres@db:5432/postgres?serverVersion=14&charset=utf8"
|
||||
###< doctrine/doctrine-bundle ###
|
||||
|
||||
###> lexik/jwt-authentication-bundle ###
|
||||
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
|
||||
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
|
||||
JWT_PASSPHRASE=2a30f6ba26521a2613821da35f28386e
|
||||
###< lexik/jwt-authentication-bundle ###
|
||||
VERSION=prod
|
||||
|
39
.env.test
39
.env.test
@@ -3,41 +3,4 @@
|
||||
# Run tests from root to adapt your own environment
|
||||
KERNEL_CLASS='App\Kernel'
|
||||
APP_SECRET='$ecretf0rt3st'
|
||||
|
||||
TRUSTED_HOSTS=
|
||||
|
||||
ADMIN_PASSWORD=password
|
||||
|
||||
LOCALE=fr
|
||||
REDIS_URL=redis
|
||||
REDIS_PORT=6379
|
||||
REDIS_URL=redis://${REDIS_HOST}:${REDIS_PORT}
|
||||
|
||||
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
|
||||
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
|
||||
JWT_PASSPHRASE=2a30f6ba26521a2613821da35f28386e
|
||||
|
||||
TWILIO_SID=~
|
||||
TWILIO_SECRET=~
|
||||
DEFAULT_CARRIER_CODE=BE
|
||||
|
||||
ADD_ADDRESS_DEFAULT_COUNTRY=BE
|
||||
|
||||
ADD_ADDRESS_MAP_CENTER_X=50.8443
|
||||
ADD_ADDRESS_MAP_CENTER_Y=4.3523
|
||||
ADD_ADDRESS_MAP_CENTER_Z=15
|
||||
|
||||
SHORT_MESSAGE_DSN=null://null
|
||||
MESSENGER_TRANSPORT_DSN=sync://
|
||||
###< symfony/messenger ###
|
||||
|
||||
###> doctrine/doctrine-bundle ###
|
||||
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
|
||||
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
|
||||
#
|
||||
DATABASE_URL="postgresql://postgres:postgres@db:5432/test?serverVersion=14&charset=utf8"
|
||||
###< doctrine/doctrine-bundle ###
|
||||
|
||||
ASYNC_UPLOAD_TEMP_URL_KEY=
|
||||
ASYNC_UPLOAD_TEMP_URL_BASE_PATH=
|
||||
ASYNC_UPLOAD_TEMP_URL_CONTAINER=
|
||||
DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres?serverVersion=12&charset=utf8
|
||||
|
9
.gitignore
vendored
9
.gitignore
vendored
@@ -1,11 +1,8 @@
|
||||
.composer/*
|
||||
composer
|
||||
composer.phar
|
||||
composer.lock
|
||||
docs/build/
|
||||
node_modules/*
|
||||
.php_cs.cache
|
||||
.cache/*
|
||||
|
||||
###> symfony/framework-bundle ###
|
||||
/.env.local
|
||||
@@ -22,9 +19,3 @@ node_modules/*
|
||||
/phpunit.xml
|
||||
.phpunit.result.cache
|
||||
###< phpunit/phpunit ###
|
||||
|
||||
/.php-cs-fixer.cache
|
||||
/.idea/
|
||||
/.psalm/
|
||||
|
||||
node_modules/*
|
||||
|
154
.gitlab-ci.yml
154
.gitlab-ci.yml
@@ -1,141 +1,37 @@
|
||||
---
|
||||
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
||||
|
||||
# Select what we should cache between builds
|
||||
cache:
|
||||
paths:
|
||||
- /vendor/
|
||||
- .cache
|
||||
paths:
|
||||
- tests/app/vendor/
|
||||
|
||||
before_script:
|
||||
# add extensions to postgres
|
||||
- PGPASSWORD=$POSTGRES_PASSWORD psql -U $POSTGRES_USER -h db -c "CREATE EXTENSION IF NOT EXISTS unaccent; CREATE EXTENSION IF NOT EXISTS pg_trgm;"
|
||||
# Install and run Composer
|
||||
- curl -sS https://getcomposer.org/installer | php
|
||||
- php composer.phar install
|
||||
- php tests/app/bin/console doctrine:migrations:migrate -n
|
||||
- php tests/app/bin/console doctrine:fixtures:load -n
|
||||
|
||||
# Bring in any services we need http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service
|
||||
# See http://docs.gitlab.com/ee/ci/services/README.html for examples.
|
||||
services:
|
||||
- name: postgis/postgis:14-3.3-alpine
|
||||
alias: db
|
||||
command:
|
||||
- postgres
|
||||
- "-c"
|
||||
- max_connections=1000
|
||||
- name: redis
|
||||
alias: redis
|
||||
- name: postgres:12
|
||||
alias: db
|
||||
- name: redis
|
||||
alias: redis
|
||||
|
||||
# Set any variables we need
|
||||
variables:
|
||||
APP_ENV: test
|
||||
GIT_DEPTH: 1
|
||||
# Configure postgres environment variables (https://hub.docker.com/r/_/postgres/)
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
# configure database access
|
||||
DATABASE_URL: postgresql://postgres:postgres@db:5432/postgres?serverVersion=14&charset=utf8
|
||||
# fetch the chill-app using git submodules
|
||||
# GIT_SUBMODULE_STRATEGY: recursive
|
||||
REDIS_HOST: redis
|
||||
REDIS_PORT: 6379
|
||||
REDIS_URL: redis://redis:6379
|
||||
DEFAULT_CARRIER_CODE: BE
|
||||
# force a timezone
|
||||
TZ: Europe/Brussels
|
||||
# avoid direct deprecations (using symfony phpunit bridge: https://symfony.com/doc/4.x/components/phpunit_bridge.html#internal-deprecations
|
||||
SYMFONY_DEPRECATIONS_HELPER: max[total]=99999999&max[self]=0&max[direct]=45&verbose=0
|
||||
# Configure postgres environment variables (https://hub.docker.com/r/_/postgres/)
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
# fetch the chill-app using git submodules
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
|
||||
stages:
|
||||
- Composer install
|
||||
- Tests
|
||||
- Deploy
|
||||
|
||||
build:
|
||||
stage: Composer install
|
||||
image: gitea.champs-libres.be/chill-project/chill-skeleton-basic/base-image:php82
|
||||
before_script:
|
||||
- composer config -g cache-dir "$(pwd)/.cache"
|
||||
script:
|
||||
- composer install --optimize-autoloader --no-ansi --no-interaction --no-progress
|
||||
cache:
|
||||
paths:
|
||||
- .cache/
|
||||
artifacts:
|
||||
expire_in: 1 day
|
||||
paths:
|
||||
- bin
|
||||
- vendor/
|
||||
|
||||
code_style:
|
||||
stage: Tests
|
||||
image: gitea.champs-libres.be/chill-project/chill-skeleton-basic/base-image:php82
|
||||
script:
|
||||
- php-cs-fixer fix --dry-run -v --show-progress=none
|
||||
cache:
|
||||
paths:
|
||||
- .cache/
|
||||
artifacts:
|
||||
expire_in: 1 day
|
||||
paths:
|
||||
- bin
|
||||
- vendor/
|
||||
|
||||
phpstan_tests:
|
||||
stage: Tests
|
||||
image: gitea.champs-libres.be/chill-project/chill-skeleton-basic/base-image:php82
|
||||
script:
|
||||
- bin/phpstan analyze --memory-limit=2G
|
||||
cache:
|
||||
paths:
|
||||
- .cache/
|
||||
artifacts:
|
||||
expire_in: 1 day
|
||||
paths:
|
||||
- bin
|
||||
- vendor/
|
||||
|
||||
rector_tests:
|
||||
stage: Tests
|
||||
image: gitea.champs-libres.be/chill-project/chill-skeleton-basic/base-image:php82
|
||||
script:
|
||||
- tests/console cache:clear
|
||||
- bin/rector process --dry-run
|
||||
cache:
|
||||
paths:
|
||||
- .cache/
|
||||
artifacts:
|
||||
expire_in: 1 day
|
||||
paths:
|
||||
- bin
|
||||
- vendor/
|
||||
|
||||
# psalm_tests:
|
||||
# stage: Tests
|
||||
# image: gitea.champs-libres.be/chill-project/chill-skeleton-basic/base-image:php82
|
||||
# script:
|
||||
# - bin/psalm
|
||||
# allow_failure: true
|
||||
# artifacts:
|
||||
# expire_in: 30 min
|
||||
# paths:
|
||||
# - bin
|
||||
# - tests/app/vendor/
|
||||
|
||||
unit_tests:
|
||||
stage: Tests
|
||||
image: gitea.champs-libres.be/chill-project/chill-skeleton-basic/base-image:php82
|
||||
script:
|
||||
- php tests/console doctrine:migrations:migrate -n --env=test
|
||||
- php tests/console chill:db:sync-views --env=test
|
||||
- php -d memory_limit=2G tests/console cache:clear --env=test
|
||||
- php -d memory_limit=3G tests/console doctrine:fixtures:load -n --env=test
|
||||
- php -d memory_limit=4G bin/phpunit --colors=never --exclude-group dbIntensive
|
||||
artifacts:
|
||||
expire_in: 1 day
|
||||
paths:
|
||||
- bin
|
||||
- vendor/
|
||||
|
||||
release:
|
||||
stage: Deploy
|
||||
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
script:
|
||||
- echo "running release_job"
|
||||
release:
|
||||
tag_name: '$CI_COMMIT_TAG'
|
||||
description: "./.changes/$CI_COMMIT_TAG.md"
|
||||
# Run our tests
|
||||
test:
|
||||
script:
|
||||
- bin/phpunit --colors=never
|
||||
|
@@ -1,24 +0,0 @@
|
||||
|
||||
# Description of changes
|
||||
|
||||
<!--
|
||||
describe here the change of your MR. It can be either a text, or a bullet list
|
||||
for changes
|
||||
-->
|
||||
|
||||
|
||||
# Issues related
|
||||
|
||||
<!--
|
||||
list the issues related to this MR.
|
||||
|
||||
It may be client issues, or dev issues
|
||||
-->
|
||||
|
||||
* ...
|
||||
* ...
|
||||
|
||||
# Tests
|
||||
|
||||
<!-- Describe tests if any, or why no tests -->
|
||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +1,6 @@
|
||||
[submodule "_exts/sphinx-php"]
|
||||
path = _exts/sphinx-php
|
||||
url = https://github.com/fabpot/sphinx-php.git
|
||||
[submodule "tests/app"]
|
||||
path = tests/app
|
||||
url = https://gitlab.com/Chill-projet/chill-app.git
|
||||
|
@@ -1,125 +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.
|
||||
*/
|
||||
|
||||
$finder = PhpCsFixer\Finder::create();
|
||||
|
||||
$finder
|
||||
->in(__DIR__.'/src')
|
||||
->in(__DIR__.'/utils')
|
||||
->append([__FILE__])
|
||||
->exclude(['docs/', 'tests/app'])
|
||||
->notPath('tests/app')
|
||||
->ignoreDotFiles(true)
|
||||
->name('**.php')
|
||||
;
|
||||
|
||||
$config = new PhpCsFixer\Config();
|
||||
$config
|
||||
->setFinder($finder)
|
||||
->setRiskyAllowed(true)
|
||||
->setCacheFile('.cache/php-cs-fixer.cache')
|
||||
->setUsingCache(true)
|
||||
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
|
||||
;
|
||||
|
||||
$rules = $config->getRules();
|
||||
|
||||
$riskyRules = [
|
||||
'ternary_to_elvis_operator' => false,
|
||||
'php_unit_mock_short_will_return' => false,
|
||||
'php_unit_set_up_tear_down_visibility' => false,
|
||||
'php_unit_construct' => false,
|
||||
'php_unit_dedicate_assert' => false,
|
||||
'php_unit_expectation' => false,
|
||||
'php_unit_mock' => false,
|
||||
'php_unit_namespaced' => false,
|
||||
'php_unit_no_expectation_annotation' => false,
|
||||
'php_unit_test_case_static_method_calls' => false,
|
||||
'php_unit_test_annotation' => false,
|
||||
// 'final_internal_class' => false,
|
||||
// 'strict_param' => false,
|
||||
// 'declare_strict_types' => false,
|
||||
// 'strict_comparison' => false,
|
||||
// 'no_unreachable_default_argument_value' => false,
|
||||
// 'ereg_to_preg' => false,
|
||||
// 'ordered_interfaces' => false,
|
||||
// 'error_suppression' => false,
|
||||
// 'non_printable_character' => false,
|
||||
// 'ordered_traits' => false,
|
||||
// 'no_useless_sprintf' => false,
|
||||
// 'dir_constant' => false,
|
||||
// 'no_alias_functions' => false,
|
||||
// 'implode_call' => false,
|
||||
// 'combine_nested_dirname' => false,
|
||||
// 'pow_to_exponentiation' => false,
|
||||
// 'comment_to_phpdoc' => false,
|
||||
// 'no_unset_on_property' => false,
|
||||
// 'native_constant_invocation' => false,
|
||||
// 'function_to_constant' => false,
|
||||
// 'is_null' => false,
|
||||
// 'native_function_invocation' => false,
|
||||
// 'no_trailing_whitespace_in_string' => false,
|
||||
// 'array_push' => false,
|
||||
// 'fopen_flag_order' => false,
|
||||
// 'fopen_flags' => false,
|
||||
// 'logical_operators' => false,
|
||||
// 'modernize_types_casting' => false,
|
||||
// 'no_homoglyph_names' => false,
|
||||
// 'no_unneeded_final_method' => false,
|
||||
// 'random_api_migration' => false,
|
||||
// 'static_lambda' => false,
|
||||
// 'set_type_to_cast' => false,
|
||||
// 'string_line_ending' => false,
|
||||
// 'psr_autoloading' => false,
|
||||
];
|
||||
|
||||
$untilFullSwitchToPhp8 = [
|
||||
'blank_line_between_import_groups' => false,
|
||||
'declare_strict_types' => true,
|
||||
'multiline_whitespace_before_semicolons' => false,
|
||||
'phpdoc_no_empty_return' => false,
|
||||
];
|
||||
|
||||
$rules = array_merge(
|
||||
[
|
||||
'@PhpCsFixer' => true,
|
||||
'@PhpCsFixer:risky' => false,
|
||||
'@Symfony' => true,
|
||||
'@Symfony:risky' => false,
|
||||
'ordered_class_elements' => [
|
||||
'order' => [
|
||||
'use_trait',
|
||||
'constant_public',
|
||||
'constant_protected',
|
||||
'constant_private',
|
||||
'property_public',
|
||||
'property_protected',
|
||||
'property_private',
|
||||
'construct',
|
||||
'destruct',
|
||||
'magic',
|
||||
'phpunit',
|
||||
'method_public',
|
||||
'method_protected',
|
||||
'method_private',
|
||||
],
|
||||
'sort_algorithm' => 'alpha',
|
||||
],
|
||||
'single_line_empty_body' => true,
|
||||
],
|
||||
$rules,
|
||||
$riskyRules,
|
||||
$untilFullSwitchToPhp8,
|
||||
);
|
||||
|
||||
$rules['header_comment']['header'] = trim(file_get_contents(__DIR__.'/resource/header.txt'));
|
||||
|
||||
return $config->setRules($rules);
|
25
.php_cs.dist
Normal file
25
.php_cs.dist
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @see https://www.champs-libres.coop/
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
$config = require __DIR__ . '/vendor/drupol/php-conventions/config/php73/php_cs_fixer.config.php';
|
||||
|
||||
$config
|
||||
->getFinder()
|
||||
->ignoreDotFiles(false)
|
||||
->name(['.php_cs.dist']);
|
||||
|
||||
$rules = $config->getRules();
|
||||
|
||||
$rules['header_comment']['header'] = trim(file_get_contents(__DIR__ . '/resource/header.txt'));
|
||||
|
||||
return $config->setRules($rules);
|
@@ -1,14 +1,10 @@
|
||||
---
|
||||
version: 2
|
||||
|
||||
build:
|
||||
os: ubuntu-22.04
|
||||
tools:
|
||||
python: "3.7"
|
||||
|
||||
sphinx:
|
||||
configuration: docs/source/conf.py
|
||||
|
||||
python:
|
||||
version: 3.7
|
||||
install:
|
||||
- requirements: docs/requirements.txt
|
||||
- requirements: docs/requirements.txt
|
||||
|
1288
CHANGELOG.md
1288
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@@ -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 Chill 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.
|
||||
|
427
CONVENTIONS.md
427
CONVENTIONS.md
@@ -1,427 +0,0 @@
|
||||
# Conventions Chill
|
||||
|
||||
en cours de rédaction
|
||||
|
||||
## Translations
|
||||
|
||||
|
||||
Par bundle, toutes les traductions des pages twig se trouvent dans un seul fichier `translations/messages.fr.yaml`.
|
||||
|
||||
## Emplacement des fichiers
|
||||
|
||||
Les controllers, form type & templates twig sont placés à la racine des dossiers `Controller`, `Form` & `Ressources/views`, respectivement. Pour les pages Admin, on ne les mets plus dans des sous-dossiers Admin.
|
||||
## Assets: nommage des entrypoints
|
||||
|
||||
Trois types d'entrypoint:
|
||||
|
||||
* application vue (souvent spécifique à une page) -> préfixé par `vue_`;
|
||||
* code js/css qui est réutilisé à plusieurs endroits:
|
||||
* ckeditor
|
||||
* async_upload (utilisé pour un formulaire)
|
||||
* bootstrap
|
||||
* chill.js
|
||||
* ...
|
||||
|
||||
=> on préfixe `mod_`
|
||||
* code css ou js pour une seule page
|
||||
* ré-utilise parfois des "foncitionnalités": ShowHide, ...
|
||||
=> on préfixe `page_`
|
||||
|
||||
|
||||
Arborescence:
|
||||
|
||||
```
|
||||
# Sous Resources/public
|
||||
|
||||
- chill/ => theme (chill)
|
||||
- chillmain.scss -> push dans l'entrypoint chill
|
||||
- lib/ => ne vont jamais dans un entrypoint, mais sont ré-utilisés par d'autres
|
||||
- ShowHide
|
||||
- Collection
|
||||
- Select2
|
||||
- module/ => termine dans des entrypoints ré-utilisables (mod_)
|
||||
- bootstrap
|
||||
- custom.scss
|
||||
- custom/
|
||||
- variables.scss
|
||||
- ..
|
||||
- forkawesome
|
||||
- AsyncUpload
|
||||
- vue/ => uniquement application vue (vue_)
|
||||
- _components
|
||||
- app
|
||||
- page/ => uniquement pour une seule page (page_)
|
||||
- login
|
||||
- person
|
||||
- personvendee
|
||||
- household_edit_metadata
|
||||
- index.js
|
||||
```
|
||||
|
||||
## Organisation des feuilles de styles
|
||||
|
||||
Comment s'échaffaudent les styles dans Chill ?
|
||||
|
||||
|
||||
1. l'entrypoint **mod_bootstrap** (module bootstrap) est le premier niveau. Toutes les parties(modules) de bootstrap sont convoquées dans le fichier ```bootstrap.js``` situé dans ```ChillMainBundle/Resources/public/module/bootstrap```.
|
||||
* Au début, ce fichier importe le fichier ```variables.scss``` qui détermine la plupart des réglages bootstrap tels qu'on les a personnalisés. Ce fichier surcharge l'original, et de nombreuses variables y sont adaptées pour Chill.
|
||||
* On veillera à ce qu'on puisse toujours comparer ce fichier à l'original de bootstrap. En cas de mise à jour de bootstrap, il faudra générer un diff, et adapter ce diff sur le fichier variable de la nouvelle version.
|
||||
* A la fin on importe le fichier ```custom.scss```, qui comprends des adaptations de bootstrap pour le préparer à notre thème Chill.
|
||||
* ce ```custom.scss``` peut être splitté en plus petits fichiers avec des ```@import 'custom/...'```
|
||||
* L'idée est que cette première couche bootstrap règle un partie importante des styles de l'application, en particulier ce qui touche aux position du layout, aux points de bascules responsive, aux marges et écarts appliqués par défauts aux éléments qu'on manipule.
|
||||
|
||||
2. l'entrypoint **chill** est le second niveau. Il contient le thème Chill qui est reconnaissable à l'application.
|
||||
* Chaque bundle a un dossier ```Resources/public/chill``` dans lequel on peut trouver une feuille sass principale, qui est éventuellement splittée avec des ```@imports```. Toutes ces feuilles sont compilées dans un unique entrypoint Chill, c'est le thème de l'application. Celui-ci surcharge bootstrap.
|
||||
* La feuille chillmain.scss devrait contenir les cascades de styles les plus générales, celles qui sont appliquées à de nombreux endroits de l'application.
|
||||
* La feuille chillperson.scss va aussi retrouver des styles propres aux différents contextes des personnes: person, household et accompanyingcourse.
|
||||
* Certains bundles plus secondaires ne contiennent que des styles spécifiques à leur fonctionnement.
|
||||
|
||||
3. les entrypoints **vue_** sont utilisés pour des composants vue. Les fichiers vue peuvent contenir un bloc de styles scss. Ce sont des styles qui ne concernent que le composant et son héritage, le tag ```scoped``` précise justement sa portée (voir la doc).
|
||||
|
||||
4. les entrypoints **page_** sont utilisés pour ajouter des assets spécifiques à certaines pages, le plus souvent des scripts et des styles.
|
||||
|
||||
|
||||
## Taguer du code html et construire la cascade de styles
|
||||
|
||||
L'exemple suivant montre comment taguer sans excès un élément de code. On remarque que:
|
||||
* il n'est pas nécessaire de taguer toutes les classes intérieures,
|
||||
* il ne faut pas répéter la classe parent dans toutes les classes enfants. La cascade sass va permettre de saisir le html avec souplesse sans alourdir la structure des balises.
|
||||
* souvent la première classe sera déclinée par plusieurs classes qui commencent de la même manière: ```bloc-dark``` ajoute juste la version sombre de ```bloc```, on ne met pas ```bloc dark```, car on ne souhaite pas que la classe ```dark``` de ```bloc``` interagisse avec la même classe ```dark``` de ```table```. On aura donc un élément ```bloc bloc-dark``` et un élément ```table table-dark```.
|
||||
|
||||
```html
|
||||
<div class="bloc bloc-dark mon-bloc">
|
||||
<h3>mon titre</h3>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a class="btn btn-edit"></a>
|
||||
</li>
|
||||
<li></li>
|
||||
<li></li>
|
||||
</ul>
|
||||
</div>
|
||||
```
|
||||
|
||||
Finalement, il importe ici de définir ce qu'est un bloc, ce qu'est une zone d'actions et ce qu'est un bouton. Ces 3 éléments existent de manière autonome, ce sont les seuls qu'on tagge.
|
||||
|
||||
Par exemple pour mettre un style au titre on précise juste h3 dans la cascade bloc.
|
||||
|
||||
```scss
|
||||
div.bloc {
|
||||
// un bloc générique, utilisé à plusieurs endroits
|
||||
&.bloc-dark {
|
||||
// la version sombre du bloc
|
||||
}
|
||||
h3 {}
|
||||
ul {
|
||||
// une liste standard dans bloc
|
||||
li {
|
||||
// des items de liste standard dans bloc
|
||||
}
|
||||
}
|
||||
}
|
||||
div.mon-bloc {
|
||||
// des exceptions spécifiques à mon-bloc,
|
||||
// qui sont des adaptations de bloc
|
||||
}
|
||||
|
||||
ul.record_actions {
|
||||
// va uniformiser tous les record_actions de l'application
|
||||
li {
|
||||
//...
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
// les boutons de bootstrap
|
||||
.btn-edit {
|
||||
// chill étends les boutons bootstrap pour ses propres besoins
|
||||
}
|
||||
}
|
||||
</style>
|
||||
```
|
||||
|
||||
## Render box
|
||||
|
||||
|
||||
## URL
|
||||
|
||||
### Nommage des routes
|
||||
|
||||
:::warning
|
||||
Ces règles n'ont pas toujours été utilisées par le passé. Elles sont souhaitées pour le futur.
|
||||
:::
|
||||
|
||||
Les routes sont nommées de cette manière:
|
||||
|
||||
`chill_(api|crud)_bundle_(api)_entite_action`
|
||||
|
||||
1. d'abord chill_ (pour tous les modules chill)
|
||||
2. ensuite `crud` ou `api`, optionnel, automatiquement ajouté si la route est générée par la configuration
|
||||
3. ensuite une string qui indique le bundle (`main`, `person`, `activity`, ...)
|
||||
4. ensuite, `api`, si la route est une route d'api.
|
||||
5. ensuite une string qui indique sur quelle entité porte la route, voire également les sous-entités
|
||||
6. ensuite une action (`list`, `view`, `edit`, `new`, ...)
|
||||
|
||||
Le fait d'indiquer `api` en quatrième position permet de distinguer les routes d'api qui sont générées par la configuration (qui sont toutes préfixées par `chill_api`, de celles générées manuellement. (Exemple: `chill_api_household__index`, et `chill_person_api_household_members_move`)
|
||||
|
||||
Si les points 4 et 5 sont inexistants, alors ils sont remplacés par d'autres éléments de manière à garantir l'unicité de la route, et sa bonne compréhension.
|
||||
|
||||
### Nommage des URL
|
||||
|
||||
Les URL respectent également une convention:
|
||||
|
||||
#### Pour les pages html
|
||||
|
||||
:::warning
|
||||
Ces règles n'ont pas toujours été utilisées par le passé. Elles sont souhaitées pour le futur.
|
||||
:::
|
||||
|
||||
Syntaxe:
|
||||
|
||||
```
|
||||
/{_locale}/bundle/entity/{id}/action
|
||||
/{_locale}/bundle/entity/sub-entity/{id}/action
|
||||
```
|
||||
|
||||
Les éléments suivants devraient se trouver dans la liste:
|
||||
|
||||
1. la locale;
|
||||
2. un identifiant du bundle
|
||||
3. l'entité auquel il se rapporte
|
||||
4. les éventuelles sous-entités auxquelles l'url se rapport
|
||||
5. l'action
|
||||
|
||||
Ces éléments peuvent être entrecoupés de l'identifiant d'une entité. Dans ce cas, cet identifiant se place juste après l'entité auquel il se rapporte.
|
||||
|
||||
Exemple:
|
||||
|
||||
```
|
||||
# liste des échanges pour une personne
|
||||
/fr/activity/person/25/activity/list
|
||||
|
||||
# nouvelle activité
|
||||
/fr/activity/activity/new?person_id=25
|
||||
|
||||
```
|
||||
|
||||
#### Pour les API
|
||||
|
||||
:::info
|
||||
Les routes générées automatiquement sont préfixées par chill_api
|
||||
:::
|
||||
|
||||
Syntaxe:
|
||||
|
||||
```
|
||||
/api/1.0/bundle/entity/{id}/action
|
||||
/api/1.0/bundle/entity/sub-entity/{id}/action
|
||||
```
|
||||
|
||||
Les éléments suivants devraient se trouver dans la liste:
|
||||
|
||||
1. la string `/api/` et puis la version (1.0)
|
||||
2. un identifiant du bundle
|
||||
3. l'entité auquel il se rapporte
|
||||
4. les éventuelles sous-entités auxquelles l'url se rapport
|
||||
5. l'action
|
||||
|
||||
Ces éléments peuvent être entrecoupés de l'identifiant d'une entité. Dans ce cas, cet identifiant se place juste après l'entité auquel il se rapporte.
|
||||
|
||||
#### Pour les URL de l'espace Admin
|
||||
|
||||
Même conventions que dans les autres pages html de l'application, **mais `admin` est ajouté en deuxième position**. Soit:
|
||||
|
||||
|
||||
`/{_locale}/admin/bundle/entity/{id}/action`
|
||||
|
||||
|
||||
## Règles UI chill
|
||||
|
||||
### Titre des pages
|
||||
|
||||
#### Chaque page contient un titre
|
||||
|
||||
Chaque page contient un titre dans la balise head. Ce titre est normalement identique à celui de l'entête de la page.
|
||||
|
||||
Astuce: il est possible d'utiliser la fonction `block` de twig pour cela:
|
||||
|
||||
```htmlmixed=
|
||||
{% block title "Titre de la page" %}
|
||||
|
||||
{% block content %}
|
||||
<h1>
|
||||
{{ block('title')}}
|
||||
</h1>
|
||||
{% endblock %}
|
||||
```
|
||||
|
||||
|
||||
### Utilisation des `entity_render`
|
||||
|
||||
#### En twig
|
||||
|
||||
Les templates twig doivent toujours utiliser la fonction chill_entity_render_box pour effectuer le rendu des éléments suivants:
|
||||
|
||||
* User
|
||||
* Person
|
||||
* SocialIssue
|
||||
* SocialAction
|
||||
* Address
|
||||
* ThirdParty
|
||||
* ...
|
||||
|
||||
Exemple:
|
||||
|
||||
```
|
||||
address|chill_entity_render_box
|
||||
```
|
||||
|
||||
Justification:
|
||||
|
||||
* des éléments sont parfois personnalisés par installation (par exemple, le nom de chaque utilisateur sera suivi par le nom du service)
|
||||
* pour rationaliser et rendre semblable les affichages
|
||||
* pour simplifier le code twig
|
||||
|
||||
A prevoir:
|
||||
|
||||
* toujours trois positions:
|
||||
* inline
|
||||
* block
|
||||
* item (dans un tableau, une ligne)
|
||||
|
||||
> block et item sont en fait la même option passée au render_box: render: bloc. Il y a aussi ‘raw’ pour le inline, et ‘label’ pour une titraille configurable avec des options.
|
||||
|
||||
> quand on passe l’option render: bloc, on peut placer le render_box dans une boucle for plus large qui fonctionne avec la classe flex-table ou la classe flex-bloc, ce qui donnera un affichage en rangée (table) ou en blocs. [name=Mathieu]
|
||||
|
||||
|
||||
|
||||
#### En vue
|
||||
|
||||
Il existe systématiquement une "box" équivalente en vue.
|
||||
|
||||
#### Lien vers des sections
|
||||
|
||||
A chaque fois qu'on indique le nom d'une personne, un parcours, un ménage, il y a toujours:
|
||||
|
||||
* un lien pour accéder à son dossier (pour autant que l'utilisateur ait les droits d'accès);
|
||||
* à moins qu'il ne soit indiqué dans une phrase, l'icône de son dossier avant ou après (donc un bonhomme pour la personne, une maison pour le ménage, un fa-random pour les parcours);
|
||||
|
||||
Ces éléments sont toujours proposé par des `render_box` par défaut. Des options permettent de les désactiver dans des cas particuliers
|
||||
|
||||
> à discuter, quelques réflexion:
|
||||
> quelle est la logique qui domine pour les boutons ? on a symbolisé les 4 actions du crud par des couleurs: bleu(show) orange(edit) vert(create) et rouge(delete).
|
||||
> Est-ce que c'est ça qui prime, et comment ça s'articule avec la logique des pictos ?
|
||||
> Par exemple, il pourrait être logique d'utiliser l'oeil bleu pour voir l'objet, qu'il s'agisse d'une personne ou d'un parcours, ce serait plutôt le contexte, et l'infobulle (title) qui préciserait le contexte.
|
||||
> Je pense que les pictos de boutons doivent faire référence à l'action, mais pas à l'objet. Autrement dit je n'utiliserais jamais l'icone du ménage ou du parcours dans les boutons.
|
||||
> Pour représenter les ménages et les parcours, je pense qu'il faudrait trouver autre chose que forkawesome. Si c'est des pictos, trouver un motif différents et de tailles différente. Réfléchir à un couplage picto-couleur-forme différent, qui exprime le contexte et qui se distingue bien des boutons.
|
||||
> Idem pour les badges, il faut une palette de badge qui couvre tous les besoins: socialIssue, socialActions, socialReason, members, etc. [name=Mathieu]
|
||||
|
||||
### Formulaires
|
||||
|
||||
#### Vocabulaire:
|
||||
|
||||
Utiliser toujours:
|
||||
|
||||
* `Créer` dans un `bt bt-create` pour les **liens** vers le formulairep pour créer une entité (pour parvenir au formulaire);
|
||||
* `Enregistrer` dans un `bt bt-save` pour les boutons "Enregistrer" (dans un formulaire édition **ou** création);
|
||||
* `Enregistrer et nouveau`
|
||||
* `Enregistrer et voir`
|
||||
* `Modifier` dans un `bt bt-edit` pour les **liens** vers le formulaire d'édition
|
||||
* `Dupliquer` (préciser là où on peut le voir)
|
||||
* `Annuler` pour quitter une page d'édition avec un lien vers la liste, ou le `returnPath`
|
||||
|
||||
#### Retour après un enregistrement
|
||||
|
||||
Après avoir cliqué sur "Créer" ou "Sauver", la page devrait revenir:
|
||||
|
||||
* vers le returnPath, s'il existe;
|
||||
* sinon, vers la page "vue".
|
||||
|
||||
|
||||
### Bandeaux contenant les boutons d'actions
|
||||
|
||||
Les boutons sont toujours dans un bandeau "sticky-form" dans le bas du formulaire ou de la page de liste.
|
||||
|
||||
Si pertinent:
|
||||
|
||||
* Le bandeau contient un bouton "Annuler" qui retourne à la page précédente. Il est obligatoire pour les formulaires, optionnel pour les listes ou les pages "résumés"
|
||||
* Ce bouton "annuler" est toujours à gauche
|
||||
|
||||
```
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<li class="cancel">
|
||||
<a href="{{ chill_entity_return_path('route_name' { 'route': 'option' } )}}">{{ return_path_label }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<!-- action 1 -->
|
||||
</li>
|
||||
</ul>
|
||||
```
|
||||
|
||||
### Messages flash
|
||||
|
||||
#### A la création d'une entité
|
||||
|
||||
A chaque fois qu'un élément est créé par un formulaire, un message flash doit apparaitre. Il indique:
|
||||
|
||||
> "L'élément a été créé"
|
||||
|
||||
Le nom de l'élément peut être remplacé par quelque chose de plus pertinent:
|
||||
|
||||
> * L'activité a été créée
|
||||
> * Le rendez-vous a été créé
|
||||
> * ...
|
||||
|
||||
|
||||
#### A l'enregistrement d'une entité
|
||||
|
||||
A chaque fois qu'un élément est enregistré, un message flash doit apparaitre:
|
||||
|
||||
> * Les données ont été modifiées
|
||||
>
|
||||
|
||||
#### Erreur sur un formulaire (erreur de validation)
|
||||
|
||||
En tête d'un formulaire, un message flash doit indiquer que des validations n'ont pas réussi:
|
||||
|
||||
> Ce formulaire contient des erreurs
|
||||
|
||||
Les erreurs doivent apparaitre attachée au champ qui les concerne. Toutefois, il est acceptable d'afficher les erreurs à la racine du formulaire s'il était complexe, techniquement, d'attacher les erreurs.
|
||||
|
||||
### Liens de retour
|
||||
|
||||
A chaque fois qu'un lien est indiqué, vérifier si on ne doit pas utiliser la fonction `chill_return_path`, `chill_forward_return_path` ou `chill_return_path_or`.
|
||||
|
||||
* depuis la page liste, vers l'ouverture d'un élément, ou le bouton création => utiliser `chill_path_add_return_path`
|
||||
* dans ces pages d'éditions,
|
||||
* utiliser `chill_return_path_or` dans le bouton "Cancel";
|
||||
* pour les boutons "enregistrer et voir" et "Enregistrer et fermer" => ?
|
||||
|
||||
### Assets pour les listes de suggestion
|
||||
|
||||
Créer une liste de suggestions à ajouter (tout l'item est cliquable)
|
||||
```html
|
||||
<ul class="list-suggest add-items">
|
||||
<li>
|
||||
<span>item</span>
|
||||
</li>
|
||||
</ul>
|
||||
```
|
||||
Créer une liste de suggestions à enlever (avec une croix rouge cliquable, l'ancre a est vide)
|
||||
```html
|
||||
<ul class="list-suggest remove-items">
|
||||
<li>
|
||||
<span>
|
||||
item
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
```
|
||||
Créer un titre enlevable (avec une croix rouge cliquable, l'ancre a est vide)
|
||||
```html
|
||||
<div class="item-title">
|
||||
<span>title</span>
|
||||
</div>
|
||||
```
|
||||
Les classes `cols` ou `inline` peuvent être ajoutées à côté de `list-suggest` pour modifier la disposition de la liste.
|
||||
Dans le dernier exemple, on met une classe `removable` sur le span, si on veut pouvoir enlever l'élément.
|
117
MIGRATION.md
117
MIGRATION.md
@@ -1,117 +0,0 @@
|
||||
|
||||
# Switch to symfony 5.0
|
||||
|
||||
- the tag `chill.role` is now renamed to `chill_main.provide_role`.
|
||||
|
||||
**Note**: It is not necessary to apply this tag on service definition: the tag is automatically applyied if the
|
||||
service implements `\Chill\MainBundle\Security\ProvideRoleInterface`.
|
||||
|
||||
- those annotation can be converted to attribute:
|
||||
|
||||
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\AccompanyingPeriodValidity`
|
||||
- `Chill\PersonBundle\Validator\Constraints\Household\HouseholdMembershipSequential`
|
||||
- `Chill\PersonBundle\Validator\Constraints\Household\MaxHolder`
|
||||
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ConfidentialCourseMustHaveReferrer`
|
||||
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\LocationValidity`
|
||||
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ParticipationOverlap`
|
||||
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ResourceDuplicateCheck`
|
||||
- `Chill\PersonBundle\Validator\Constraints\Person\Birthdate`
|
||||
- `Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenter`
|
||||
- `Chill\PersonBundle\Validator\Constraints\Relationship\RelationshipNoDuplicate`
|
||||
- `Chill\ActivityBundle\Validator\Constraints\ActivityValidity`
|
||||
- `Chill\DocStoreBundle\Validator\Constraints\AsyncFileExists`
|
||||
- `Chill\MainBundle\Validation\Constraint\PhonenumberConstraint`
|
||||
- `Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency`
|
||||
- `Chill\MainBundle\Workflow\Validator\EntityWorkflowCreation`
|
||||
|
||||
Here is the rector rule that can be used to switch attributes to annotations:
|
||||
|
||||
```php
|
||||
$rectorConfig->ruleWithConfiguration(\Rector\Php80\Rector\Class_\AnnotationToAttributeRector::class, [
|
||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\AccompanyingPeriodValidity'),
|
||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Household\HouseholdMembershipSequential'),
|
||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Household\MaxHolder'),
|
||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ConfidentialCourseMustHaveReferrer'),
|
||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\LocationValidity'),
|
||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ParticipationOverlap'),
|
||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ResourceDuplicateCheck'),
|
||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Person\Birthdate'),
|
||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenter'),
|
||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Relationship\RelationshipNoDuplicate'),
|
||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\ActivityBundle\Validator\Constraints\ActivityValidity'),
|
||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\DocStoreBundle\Validator\Constraints\AsyncFileExists'),
|
||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Validation\Constraint\PhonenumberConstraint'),
|
||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency'),
|
||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Workflow\Validator\EntityWorkflowCreation'),
|
||||
]);
|
||||
```
|
||||
|
||||
- to keep cleaner definition in container's dependency injection and framework bundle, the definition of crud or api
|
||||
requires to define explicitly a controller.
|
||||
|
||||
Before:
|
||||
|
||||
```php
|
||||
$container->prependExtensionConfig('chill_main', [
|
||||
'apis' => [
|
||||
[
|
||||
'class' => ThirdParty::class,
|
||||
'name' => 'thirdparty',
|
||||
'base_path' => '/api/1.0/thirdparty/thirdparty',
|
||||
'actions' => [
|
||||
'_entity' => [
|
||||
'methods' => [
|
||||
Request::METHOD_GET => true,
|
||||
Request::METHOD_HEAD => true,
|
||||
Request::METHOD_POST => true,
|
||||
Request::METHOD_PUT => true,
|
||||
Request::METHOD_PATCH => true,
|
||||
],
|
||||
'roles' => [
|
||||
Request::METHOD_GET => ThirdPartyVoter::SHOW,
|
||||
Request::METHOD_HEAD => ThirdPartyVoter::SHOW,
|
||||
Request::METHOD_POST => ThirdPartyVoter::CREATE,
|
||||
Request::METHOD_PUT => ThirdPartyVoter::CREATE,
|
||||
Request::METHOD_PATCH => ThirdPartyVoter::CREATE,
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
After:
|
||||
|
||||
```php
|
||||
$container->prependExtensionConfig('chill_main', [
|
||||
'apis' => [
|
||||
[
|
||||
'class' => ThirdParty::class,
|
||||
'controller' => ThirdPartyApiController::class,
|
||||
'name' => 'thirdparty',
|
||||
'base_path' => '/api/1.0/thirdparty/thirdparty',
|
||||
'actions' => [
|
||||
'_entity' => [
|
||||
'methods' => [
|
||||
Request::METHOD_GET => true,
|
||||
Request::METHOD_HEAD => true,
|
||||
Request::METHOD_POST => true,
|
||||
Request::METHOD_PUT => true,
|
||||
Request::METHOD_PATCH => true,
|
||||
],
|
||||
'roles' => [
|
||||
Request::METHOD_GET => ThirdPartyVoter::SHOW,
|
||||
Request::METHOD_HEAD => ThirdPartyVoter::SHOW,
|
||||
Request::METHOD_POST => ThirdPartyVoter::CREATE,
|
||||
Request::METHOD_PUT => ThirdPartyVoter::CREATE,
|
||||
Request::METHOD_PATCH => ThirdPartyVoter::CREATE,
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
```
|
||||
|
||||
|
@@ -1,9 +0,0 @@
|
||||
# Chill framework
|
||||
|
||||
Documentation of the Chill software.
|
||||
|
||||
The online documentation can be found at http://docs.chill.social
|
||||
|
||||
See the [`docs`][1] directory for more.
|
||||
|
||||
[1]: docs/README.md
|
193
composer.json
193
composer.json
@@ -1,157 +1,88 @@
|
||||
{
|
||||
"name": "chill-project/chill-bundles",
|
||||
"description": "Most used bundles for chill-project",
|
||||
"license": "AGPL-3.0-only",
|
||||
"type": "library",
|
||||
"keywords": [
|
||||
"chill",
|
||||
"social worker"
|
||||
],
|
||||
"require": {
|
||||
"php": "^8.2",
|
||||
"ext-dom": "*",
|
||||
"ext-json": "*",
|
||||
"ext-openssl": "*",
|
||||
"ext-redis": "*",
|
||||
"champs-libres/wopi-bundle": "dev-master@dev",
|
||||
"champs-libres/wopi-lib": "dev-master@dev",
|
||||
"doctrine/doctrine-bundle": "^2.1",
|
||||
"doctrine/doctrine-migrations-bundle": "^3.0",
|
||||
"doctrine/orm": "^2.13.0",
|
||||
"erusev/parsedown": "^1.7",
|
||||
"knplabs/knp-menu-bundle": "^3.0",
|
||||
"knplabs/knp-time-bundle": "^1.12",
|
||||
"knpuniversity/oauth2-client-bundle": "^2.10",
|
||||
"league/csv": "^9.7.1",
|
||||
"lexik/jwt-authentication-bundle": "^2.16",
|
||||
"nyholm/psr7": "^1.4",
|
||||
"ocramius/package-versions": "^1.10 || ^2",
|
||||
"odolbeau/phone-number-bundle": "^3.6",
|
||||
"ovh/ovh": "^3.0",
|
||||
"phpoffice/phpspreadsheet": "^1.16",
|
||||
"ramsey/uuid-doctrine": "^1.7",
|
||||
"sensio/framework-extra-bundle": "^5.5",
|
||||
"spomky-labs/base64url": "^2.0",
|
||||
"symfony/asset": "^5.4",
|
||||
"symfony/browser-kit": "^5.4",
|
||||
"symfony/cache": "^5.4",
|
||||
"symfony/clock": "^6.2",
|
||||
"symfony/config": "^5.4",
|
||||
"symfony/console": "^5.4",
|
||||
"symfony/css-selector": "^5.4",
|
||||
"symfony/dom-crawler": "^5.4",
|
||||
"symfony/error-handler": "^5.4",
|
||||
"symfony/event-dispatcher": "^5.4",
|
||||
"symfony/event-dispatcher-contracts": "^2.4",
|
||||
"symfony/expression-language": "^5.4",
|
||||
"symfony/filesystem": "^5.4",
|
||||
"symfony/finder": "^5.4",
|
||||
"symfony/form": "^5.4",
|
||||
"symfony/framework-bundle": "^5.4",
|
||||
"symfony/http-client": "^5.4",
|
||||
"symfony/http-foundation": "^5.4",
|
||||
"symfony/intl": "^5.4",
|
||||
"symfony/mailer": "^5.4",
|
||||
"symfony/messenger": "^5.4",
|
||||
"symfony/mime": "^5.4",
|
||||
"symfony/monolog-bundle": "^3.5",
|
||||
"symfony/options-resolver": "^5.4",
|
||||
"symfony/process": "^5.4",
|
||||
"symfony/property-access": "^5.4",
|
||||
"symfony/property-info": "^5.4",
|
||||
"symfony/routing": "^5.4",
|
||||
"symfony/security-bundle": "^5.4",
|
||||
"symfony/security-core": "^5.4",
|
||||
"symfony/security-csrf": "^5.4",
|
||||
"symfony/security-guard": "^5.4",
|
||||
"symfony/security-http": "^5.4",
|
||||
"symfony/serializer": "^5.4",
|
||||
"symfony/string": "^5.4",
|
||||
"symfony/templating": "^5.4",
|
||||
"symfony/translation": "^5.4",
|
||||
"symfony/twig-bundle": "^5.4",
|
||||
"symfony/validator": "^5.4",
|
||||
"symfony/webpack-encore-bundle": "^1.11",
|
||||
"symfony/workflow": "^5.4",
|
||||
"symfony/yaml": "^5.4",
|
||||
"thenetworg/oauth2-azure": "^2.0",
|
||||
"twig/extra-bundle": "^3.0",
|
||||
"twig/intl-extra": "^3.0",
|
||||
"twig/markdown-extra": "^3.3",
|
||||
"twig/string-extra": "^3.3",
|
||||
"twig/twig": "^3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/doctrine-fixtures-bundle": "^3.3",
|
||||
"fakerphp/faker": "^1.13",
|
||||
"jangregor/phpstan-prophecy": "^1.0",
|
||||
"nelmio/alice": "^3.8",
|
||||
"nikic/php-parser": "^4.15",
|
||||
"phpspec/prophecy-phpunit": "^2.0",
|
||||
"phpstan/extension-installer": "^1.2",
|
||||
"phpstan/phpstan": "^1.9",
|
||||
"phpstan/phpstan-deprecation-rules": "^1.1",
|
||||
"phpstan/phpstan-strict-rules": "^1.0",
|
||||
"phpunit/phpunit": "^10.5.24",
|
||||
"rector/rector": "^1.1.0",
|
||||
"symfony/debug-bundle": "^5.4",
|
||||
"symfony/dotenv": "^5.4",
|
||||
"symfony/maker-bundle": "^1.20",
|
||||
"symfony/phpunit-bridge": "^7.1",
|
||||
"symfony/runtime": "^5.4",
|
||||
"symfony/stopwatch": "^5.4",
|
||||
"symfony/var-dumper": "^5.4"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/symfony": "*"
|
||||
},
|
||||
"description": "Most used bundles for chill-project",
|
||||
"keywords": ["chill", "social worker"],
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Chill\\ActivityBundle\\": "src/Bundle/ChillActivityBundle",
|
||||
"Chill\\AsideActivityBundle\\": "src/Bundle/ChillAsideActivityBundle/src",
|
||||
"Chill\\BudgetBundle\\": "src/Bundle/ChillBudgetBundle",
|
||||
"Chill\\CalendarBundle\\": "src/Bundle/ChillCalendarBundle",
|
||||
"Chill\\CustomFieldsBundle\\": "src/Bundle/ChillCustomFieldsBundle",
|
||||
"Chill\\DocGeneratorBundle\\": "src/Bundle/ChillDocGeneratorBundle",
|
||||
"Chill\\DocStoreBundle\\": "src/Bundle/ChillDocStoreBundle",
|
||||
"Chill\\EventBundle\\": "src/Bundle/ChillEventBundle",
|
||||
"Chill\\FranceTravailApiBundle\\": "src/Bundle/ChillFranceTravailApiBundle/src",
|
||||
"Chill\\JobBundle\\": "src/Bundle/ChillJobBundle/src",
|
||||
"Chill\\FamilyMemberBundle\\": "src/Bundle/ChillFamilyMemberBundle",
|
||||
"Chill\\MainBundle\\": "src/Bundle/ChillMainBundle",
|
||||
"Chill\\PersonBundle\\": "src/Bundle/ChillPersonBundle",
|
||||
"Chill\\ReportBundle\\": "src/Bundle/ChillReportBundle",
|
||||
"Chill\\TaskBundle\\": "src/Bundle/ChillTaskBundle",
|
||||
"Chill\\ThirdPartyBundle\\": "src/Bundle/ChillThirdPartyBundle",
|
||||
"Chill\\WopiBundle\\": "src/Bundle/ChillWopiBundle/src",
|
||||
"Chill\\Utils\\Rector\\": "utils/rector/src"
|
||||
"Chill\\ThirdPartyBundle\\": "src/Bundle/ChillThirdPartyBundle"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"App\\": "tests/",
|
||||
"Chill\\DocGeneratorBundle\\Tests\\": "src/Bundle/ChillDocGeneratorBundle/tests",
|
||||
"Chill\\WopiBundle\\Tests\\": "src/Bundle/ChillDocGeneratorBundle/tests",
|
||||
"Chill\\Utils\\Rector\\Tests\\": "utils/rector/tests"
|
||||
"App\\": "tests/app/src/"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"composer/package-versions-deprecated": true,
|
||||
"ergebnis/composer-normalize": true,
|
||||
"ocramius/package-versions": true,
|
||||
"phpro/grumphp": true,
|
||||
"phpstan/extension-installer": true,
|
||||
"roave/you-are-using-it-wrong": true,
|
||||
"symfony/runtime": true
|
||||
},
|
||||
"bin-dir": "bin",
|
||||
"optimize-autoloader": true,
|
||||
"sort-packages": true
|
||||
"require": {
|
||||
"champs-libres/async-uploader-bundle": "dev-sf4",
|
||||
"graylog2/gelf-php": "^1.5",
|
||||
"symfony/form": "4.*",
|
||||
"symfony/twig-bundle": "^4.4",
|
||||
"twig/extra-bundle": "^2.12|^3.0",
|
||||
"twig/twig": "^2.12|^3.0",
|
||||
"composer/package-versions-deprecated": "^1.10",
|
||||
"doctrine/doctrine-bundle": "^2.1",
|
||||
"doctrine/doctrine-migrations-bundle": "^3.0",
|
||||
"doctrine/orm": "^2.7",
|
||||
"symfony/asset": "4.*",
|
||||
"symfony/monolog-bundle": "^3.5",
|
||||
"symfony/security-bundle": "4.*",
|
||||
"symfony/translation": "4.*",
|
||||
"symfony/validator": "4.*",
|
||||
"sensio/framework-extra-bundle": "^5.5",
|
||||
"symfony/yaml": "4.*",
|
||||
"symfony/webpack-encore-bundle": "^1.11",
|
||||
"knplabs/knp-menu": "^3.1",
|
||||
"knplabs/knp-menu-bundle": "^3.0",
|
||||
"symfony/templating": "4.*",
|
||||
"twig/intl-extra": "^3.0",
|
||||
"symfony/workflow": "4.*",
|
||||
"symfony/expression-language": "4.*",
|
||||
"knplabs/knp-time-bundle": "^1.12",
|
||||
"symfony/intl": "4.*",
|
||||
"symfony/swiftmailer-bundle": "^3.5",
|
||||
"league/csv": "^9.6",
|
||||
"phpoffice/phpspreadsheet": "^1.16",
|
||||
"symfony/browser-kit": "^5.2",
|
||||
"symfony/css-selector": "^5.2",
|
||||
"twig/markdown-extra": "^3.3",
|
||||
"erusev/parsedown": "^1.7",
|
||||
"symfony/serializer": "^5.2"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/symfony": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"drupol/php-conventions": "4.*",
|
||||
"fakerphp/faker": "^1.13",
|
||||
"phpunit/phpunit": "^7.0",
|
||||
"symfony/dotenv": "^5.1",
|
||||
"symfony/maker-bundle": "^1.20",
|
||||
"doctrine/doctrine-fixtures-bundle": "^3.3",
|
||||
"symfony/stopwatch": "^5.1",
|
||||
"symfony/web-profiler-bundle": "^5.0",
|
||||
"symfony/var-dumper": "4.*",
|
||||
"symfony/debug-bundle": "^5.1",
|
||||
"symfony/phpunit-bridge": "^5.2"
|
||||
},
|
||||
"scripts": {
|
||||
"auto-scripts": {
|
||||
"cache:clear": "symfony-cmd"
|
||||
},
|
||||
"php-cs-fixer": "php-cs-fixer fix --config=./.php-cs-fixer.dist.php --show-progress=none"
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"bin-dir": "bin"
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ To compile this documentation :
|
||||
Contribute
|
||||
===========
|
||||
|
||||
Issue tracker : https://gitlab.com/Chill-Projet/chill-bundles/-/issues
|
||||
Issue tracker : https://git.framasoft.org/groups/Chill-project/issues
|
||||
|
||||
Licence
|
||||
=======
|
||||
|
@@ -1,7 +1,6 @@
|
||||
docutils==0.13.1
|
||||
Pygments==2.2.0
|
||||
sphinx==1.8.5
|
||||
Jinja2<3.1
|
||||
git+https://github.com/fabpot/sphinx-php.git@v2.0.2#egg_name=sphinx-php
|
||||
jsx-lexer===0.0.8
|
||||
sphinx_rtd_theme==0.5.0
|
||||
|
@@ -1,14 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @see https://www.champs-libres.coop/
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Export\Filter;
|
||||
|
||||
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
||||
@@ -21,7 +23,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
class BirthdateFilter implements ExportElementValidatedInterface, FilterInterface
|
||||
{
|
||||
// add specific role for this filter
|
||||
public function addRole(): ?string
|
||||
public function addRole()
|
||||
{
|
||||
// we do not need any new role for this filter, so we return null
|
||||
return null;
|
||||
@@ -62,6 +64,7 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
|
||||
{
|
||||
$builder->add('date_from', DateType::class, [
|
||||
'label' => 'Born after this date',
|
||||
'data' => new DateTime(),
|
||||
'attr' => ['class' => 'datepicker'],
|
||||
'widget' => 'single_text',
|
||||
'format' => 'dd-MM-yyyy',
|
||||
@@ -69,15 +72,12 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
|
||||
|
||||
$builder->add('date_to', DateType::class, [
|
||||
'label' => 'Born before this date',
|
||||
'data' => new DateTime(),
|
||||
'attr' => ['class' => 'datepicker'],
|
||||
'widget' => 'single_text',
|
||||
'format' => 'dd-MM-yyyy',
|
||||
]);
|
||||
}
|
||||
public function getFormDefaultData(): array
|
||||
{
|
||||
return ['date_from' => new DateTime(), 'date_to' => new DateTime()];
|
||||
}
|
||||
|
||||
// here, we create a simple string which will describe the action of
|
||||
// the filter in the Response
|
||||
|
@@ -1,14 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @see https://www.champs-libres.coop/
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Export\Export;
|
||||
|
||||
use Chill\MainBundle\Export\ExportInterface;
|
||||
@@ -18,6 +20,7 @@ use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\Query;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
|
||||
class CountPerson implements ExportInterface
|
||||
{
|
||||
@@ -36,10 +39,6 @@ class CountPerson implements ExportInterface
|
||||
{
|
||||
// this export does not add any form
|
||||
}
|
||||
public function getFormDefaultData(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getAllowedFormattersTypes()
|
||||
{
|
||||
@@ -54,9 +53,18 @@ class CountPerson implements ExportInterface
|
||||
public function getLabels($key, array $values, $data)
|
||||
{
|
||||
// the Closure which will be executed by the formatter.
|
||||
return fn($value) => match ($value) {
|
||||
'_header' => $this->getTitle(),
|
||||
default => $value,
|
||||
return function ($value) {
|
||||
switch ($value) {
|
||||
case '_header':
|
||||
// we have to process specifically the '_header' string,
|
||||
// which will be used by the formatter to show a column title
|
||||
return $this->getTitle();
|
||||
|
||||
default:
|
||||
// for all value, we do not process them and return them
|
||||
// immediatly
|
||||
return $value;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -67,9 +75,9 @@ class CountPerson implements ExportInterface
|
||||
return ['export_result'];
|
||||
}
|
||||
|
||||
public function getResult($query, $data)
|
||||
public function getResult($qb, $data)
|
||||
{
|
||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||
return $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||
}
|
||||
|
||||
public function getTitle()
|
||||
@@ -85,7 +93,9 @@ class CountPerson implements ExportInterface
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||
{
|
||||
// we gather all center the user choose.
|
||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||
$centers = array_map(static function ($el) {
|
||||
return $el['center'];
|
||||
}, $acl);
|
||||
|
||||
$qb = $this->entityManager->createQueryBuilder();
|
||||
|
||||
@@ -98,9 +108,9 @@ class CountPerson implements ExportInterface
|
||||
return $qb;
|
||||
}
|
||||
|
||||
public function requiredRole(): string
|
||||
public function requiredRole()
|
||||
{
|
||||
return PersonVoter::STATS;
|
||||
return new Role(PersonVoter::STATS);
|
||||
}
|
||||
|
||||
public function supportsModifiers()
|
||||
|
@@ -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
|
@@ -23,196 +23,15 @@ Every time an entity is created, viewed or updated, the software check if the us
|
||||
|
||||
The user must be granted access to the action on this particular entity, with this scope and center.
|
||||
|
||||
TL;DR
|
||||
=====
|
||||
|
||||
Resolve scope and center
|
||||
------------------------
|
||||
|
||||
In a service, resolve the center and scope of an entity
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher;
|
||||
use Chill\MainBundle\Security\Resolver\ScopeResolverDispatcher;
|
||||
|
||||
|
||||
class MyService {
|
||||
private ScopeResolverDispatcher $scopeResolverDispatcher;
|
||||
private CenterResolverDispatcher $centerResolverDispatcher;
|
||||
|
||||
public function myFunction($entity) {
|
||||
/** @var null|Center[]|Center $center */
|
||||
$center = $this->centerResolverDispatcher->resolveCenter($entity);
|
||||
// $center may be null, an array of center, or an instance of Center
|
||||
|
||||
if ($this->scopeResolverDispatcher->isConcerned($entity) {
|
||||
/** @var null|Scope[]|Scope */
|
||||
$scope = $this-scopeResolverDispatcher->resolveScope($entity);
|
||||
// $scope may be null, an array of Scope, or an instance of Scope
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
In twig template, resolve the center:
|
||||
|
||||
.. code-block:: twig
|
||||
|
||||
{# resolve a center #}
|
||||
|
||||
{% if person|chill_resolve_center is not null%}
|
||||
|
||||
{% if person|chill_resolve_center is iterable %}
|
||||
{% set centers = person|chill_resolve_center %}
|
||||
{% else %}
|
||||
{% set centers = [ person|chill_resolve_center ] %}
|
||||
{% endif %}
|
||||
|
||||
<span class="open_sansbold">
|
||||
{{ 'Center'|trans|upper}} :
|
||||
</span>
|
||||
{% for c in centers %}
|
||||
{{ c.name|upper }}
|
||||
{% if not loop.last %}, {% endif %}
|
||||
{% endfor %}
|
||||
{%- endif -%}
|
||||
|
||||
In twig template, resolve the scope:
|
||||
|
||||
.. code-block:: twig
|
||||
|
||||
{% if entity|chill_is_scope_concerned %}
|
||||
|
||||
{% if entity|chill_resolve_scope is iterable %}
|
||||
{% set scopes = entity|chill_resolve_scope %}
|
||||
{% else %}
|
||||
{% set scopes = [ entity|chill_resolve_scope ] %}
|
||||
{% endif %}
|
||||
|
||||
<span>Scopes :</span>
|
||||
{% for s in scopes %}
|
||||
{{ c.name|localize_translatable_string }}
|
||||
{% if not loop.last %}, {% endif %}
|
||||
{% endfor %}
|
||||
{%- endif -%}
|
||||
|
||||
Build a ``Voter``
|
||||
-----------------
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
<?php
|
||||
|
||||
namespace Chill\DocStoreBundle\Security\Authorization;
|
||||
|
||||
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
|
||||
use Chill\MainBundle\Security\Authorization\VoterHelperFactoryInterface;
|
||||
use Chill\MainBundle\Security\Authorization\VoterHelperInterface;
|
||||
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
|
||||
use Chill\DocStoreBundle\Entity\PersonDocument;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
class PersonDocumentVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||
{
|
||||
// roles should be stored into constants:
|
||||
|
||||
const CREATE = 'CHILL_PERSON_DOCUMENT_CREATE';
|
||||
const SEE = 'CHILL_PERSON_DOCUMENT_SEE';
|
||||
const SEE_DETAILS = 'CHILL_PERSON_DOCUMENT_SEE_DETAILS';
|
||||
const UPDATE = 'CHILL_PERSON_DOCUMENT_UPDATE';
|
||||
const DELETE = 'CHILL_PERSON_DOCUMENT_DELETE';
|
||||
|
||||
protected Security $security;
|
||||
protected VoterHelperInterface $voterHelper;
|
||||
|
||||
public function __construct(
|
||||
Security $security,
|
||||
VoterHelperFactoryInterface $voterHelperFactory
|
||||
) {
|
||||
$this->security = $security;
|
||||
|
||||
// we build here a voter helper. This will ease the operations below.
|
||||
// when the authorization model is changed, it will be easy to make a different implementation
|
||||
// of the helper, instead of writing all Voters
|
||||
|
||||
$this->voterHelper = $voterHelperFactory
|
||||
// create a builder with some context
|
||||
->generate(self::class)
|
||||
// add the support of given roles for given class:
|
||||
->addCheckFor(Person::class, [self::SEE, self::CREATE])
|
||||
->addCheckFor(PersonDocument::class, $this->getRoles())
|
||||
->build();
|
||||
}
|
||||
|
||||
|
||||
protected function supports($attribute, $subject)
|
||||
{
|
||||
return $this->voterHelper->supports($attribute, $subject);
|
||||
}
|
||||
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
|
||||
{
|
||||
// basic check
|
||||
if (!$token->getUser() instanceof User) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// we first check the acl for associated elements.
|
||||
// here, we must be able to see the person associated to the document:
|
||||
if ($subject instanceof PersonDocument
|
||||
&& !$this->security->isGranted(PersonVoter::SEE, $subject->getPerson())) {
|
||||
|
||||
// not possible to see the associated person ? Then, not possible to see the document!
|
||||
return false;
|
||||
}
|
||||
|
||||
// the voter helper will implements the logic:
|
||||
return $this->voterHelper->voteOnAttribute($attribute, $subject, $token);
|
||||
}
|
||||
|
||||
// all the method below are used to register roles into the admin part
|
||||
public function getRoles()
|
||||
{
|
||||
return [
|
||||
self::CREATE,
|
||||
self::SEE,
|
||||
self::SEE_DETAILS,
|
||||
self::UPDATE,
|
||||
self::DELETE
|
||||
];
|
||||
}
|
||||
|
||||
public function getRolesWithoutScope()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
public function getRolesWithHierarchy()
|
||||
{
|
||||
return ['PersonDocument' => $this->getRoles() ];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
From an user point of view
|
||||
==========================
|
||||
--------------------------
|
||||
|
||||
The software is design to allow fine tuned access rights for complicated installation and team structure. The administrators may also decide that every user has the right to see all resources, where team have a more simple structure.
|
||||
|
||||
Here is an overview of the model.
|
||||
|
||||
Chill can be multi-center
|
||||
-------------------------
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Chill is designed to be installed once for social center who work with multiple teams separated, or for social services's federation who would like to share the same installation of the software for all their members.
|
||||
|
||||
@@ -223,7 +42,7 @@ Otherwise, it is not required to create multiple center: Chill can also work for
|
||||
Obviously, users working in the different centers are not allowed to see the entities (_persons_, _reports_, _activities_) of other centers. But users may be attached to multiple centers: consequently they will be able to see the entities of the multiple centers they are attached to.
|
||||
|
||||
Inside center, scope divide team
|
||||
--------------------------------
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Users are attached to one or more center and, inside to those center, there may exists differents scopes. The aim of those _scopes_ is to divide the whole team of social worker amongst different departement, for instance: the social team, the psychologist team, the nurse team, the administrative team, ... Each team is granted of different rights amongst scope. For instance, the social team may not see the _activities_ of the psychologist team. The administrative team may see the date & time's activities, but is not allowed to see the detail of those entities (the personal notes, ...).
|
||||
|
||||
@@ -233,38 +52,8 @@ As entities have only one scopes, if some entities must be shared across two dif
|
||||
|
||||
Example: if some activities must be seen and updated between nurses and psychologists, the administrator will create a scope "nurse and psy" and add the ability for both team "nurse" and "psychologist" to "create", "see", and "update" the activities belonging to scope "nurse and psy".
|
||||
|
||||
|
||||
Where does the ``scope`` and ``center`` comes from ?
|
||||
====================================================
|
||||
|
||||
Most often, scope and center comes from user's input:
|
||||
|
||||
* when person is created, Chill asks the associated center to the user. Then, every entity associated to the user (Activity, ...) is associated to this center;
|
||||
* when an entity is created, Chill asks the associated scope.
|
||||
|
||||
The UI check the model before adding those input into form. If the user hae access to only one center or scope, this scope or center is filled automatically, and the UI does not ask the user. Most of the times, the user does not see "Pick a scope" and "Pick a center" inputs.
|
||||
|
||||
Scope and Center are associated to entities through ``ManyToOne`` properties, which are then mapped to ``FOREIGN KEY`` in tables, ...
|
||||
|
||||
But sometimes, this implementation does not fits the needs:
|
||||
|
||||
* persons are associated to center *geographically*: the address of each person contains lat/lon coordinates, and the center is resolved from this coordinated;
|
||||
* some would like to associated persons to multiple center, or one center;
|
||||
* entities are associated to scope through the job reached by "creator" (an user);
|
||||
* some would like not to use scope at all;
|
||||
* …
|
||||
|
||||
For this reasons, associated center and scopes must be resolved programmatically. The default implementation rely on the model association, as described above. But it becomes possible to change the behaviour on different implementations.
|
||||
|
||||
Is my entity "concerned" by scopes ?
|
||||
------------------------------------
|
||||
|
||||
Some entities are concerned by scope, some not.
|
||||
|
||||
This is also programmatically resolved.
|
||||
|
||||
The concepts translated into code
|
||||
===================================
|
||||
-----------------------------------
|
||||
|
||||
.. figure:: /_static/access_control_model.png
|
||||
|
||||
@@ -292,7 +81,7 @@ At each step of his lifetime (creation, view of the entity and eventually of his
|
||||
All those action are executed through symfony voters and helpers.
|
||||
|
||||
How to check authorization ?
|
||||
============================
|
||||
----------------------------
|
||||
|
||||
Just use the symfony way-of-doing, but do not forget to associate the entity you want to check access. For instance, in controller :
|
||||
|
||||
@@ -311,23 +100,34 @@ Just use the symfony way-of-doing, but do not forget to associate the entity you
|
||||
|
||||
And in template :
|
||||
|
||||
.. code-block:: twig
|
||||
.. code-block:: html+jinja
|
||||
|
||||
{{ if is_granted('CHILL_ENTITY_SEE', entity) %}print something{% endif %}
|
||||
|
||||
Retrieving reachable scopes and centers for a user
|
||||
--------------------------------------------------
|
||||
Retrieving reachable scopes and centers
|
||||
----------------------------------------
|
||||
|
||||
The class :class:`Chill\\MainBundle\\Security\\Authorization\\AuthorizationHelperInterface` helps you to get centers and scope reachable by a user.
|
||||
The class :class:`Chill\\MainBundle\\Security\\Authorization\\AuthorizationHelper` helps you to get centers and scope reachable by a user.
|
||||
|
||||
Those methods are intentionnaly build to give information about user rights:
|
||||
|
||||
- getReachableCenters: to get reachable centers for a user
|
||||
- getReachableScopes : to get reachable scopes for a user
|
||||
|
||||
.. note::
|
||||
|
||||
The service is reachable through the Depedency injection with the key `chill.main.security.authorization.helper`. Example :
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
$helper = $container->get('chill.main.security.authorization.helper');
|
||||
|
||||
.. todo::
|
||||
|
||||
Waiting for a link between our api and this doc, we invite you to read the method signatures `here <https://github.com/Chill-project/Main/blob/add_acl/Security/Authorization/AuthorizationHelper.php>`_
|
||||
|
||||
Adding your own roles
|
||||
---------------------
|
||||
=====================
|
||||
|
||||
Extending Chill will requires you to define your own roles and rules for your entities. You will have to define your own voter to do so.
|
||||
|
||||
@@ -352,7 +152,7 @@ To create your own roles, you should:
|
||||
|
||||
|
||||
Declare your role
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
------------------
|
||||
|
||||
To declare new role, implement the class :class:`Chill\\MainBundle\\Security\\ProvideRoleInterface`.
|
||||
|
||||
@@ -412,8 +212,69 @@ Example of an implementation of :class:`Chill\\MainBundle\\Security\\ProvideRole
|
||||
|
||||
}
|
||||
|
||||
Implement your voter
|
||||
--------------------
|
||||
|
||||
Inside this class, you might use the :class:`Chill\\MainBundle\\Security\\Authorization\\AuthorizationHelper` to check permission (do not re-invent the wheel). This is a real-world example:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
namespace Chill\ReportBundle\Security\Authorization;
|
||||
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
|
||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||
|
||||
|
||||
class ReportVoter extends AbstractChillVoter
|
||||
{
|
||||
const CREATE = 'CHILL_REPORT_CREATE';
|
||||
const SEE = 'CHILL_REPORT_SEE';
|
||||
const UPDATE = 'CHILL_REPORT_UPDATE';
|
||||
|
||||
/**
|
||||
*
|
||||
* @var AuthorizationHelper
|
||||
*/
|
||||
protected $helper;
|
||||
|
||||
public function __construct(AuthorizationHelper $helper)
|
||||
{
|
||||
$this->helper = $helper;
|
||||
}
|
||||
|
||||
protected function getSupportedAttributes()
|
||||
{
|
||||
return array(self::CREATE, self::SEE, self::UPDATE);
|
||||
}
|
||||
protected function getSupportedClasses()
|
||||
{
|
||||
return array('Chill\ReportBundle\Entity\Report');
|
||||
}
|
||||
protected function isGranted($attribute, $report, $user = null)
|
||||
{
|
||||
if (! $user instanceof \Chill\MainBundle\Entity\User){
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->helper->userHasAccess($user, $report, $attribute);
|
||||
}
|
||||
}
|
||||
|
||||
Then, you will have to declare the service and tag it as a voter :
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
services:
|
||||
chill.report.security.authorization.report_voter:
|
||||
class: Chill\ReportBundle\Security\Authorization\ReportVoter
|
||||
arguments:
|
||||
- "@chill.main.security.authorization.helper"
|
||||
tags:
|
||||
- { name: security.voter }
|
||||
|
||||
|
||||
Adding role hierarchy
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
---------------------
|
||||
|
||||
You should prepend Symfony's security component directly from your code.
|
||||
|
||||
@@ -451,484 +312,3 @@ You should prepend Symfony's security component directly from your code.
|
||||
}
|
||||
|
||||
|
||||
|
||||
Implement your voter
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Most of the time, Voter will check that:
|
||||
|
||||
1. The given role is reachable (= ``$attribute``)
|
||||
2. for the given center,
|
||||
3. and, if any, for the given role
|
||||
4. if the entity is associated to another entity, this entity should be, at least, viewable by the user.
|
||||
|
||||
Thats what we call the "autorization logic". But this logic may be replace by a new one, and developers should take care of it.
|
||||
|
||||
|
||||
Then voter implementation should take care of:
|
||||
|
||||
* check the access to associated entities. For instance, if an ``Activity`` is associated to a ``Person``, the voter should first check that the user can show the associated ``Person``;
|
||||
* as far as possible, delegates the check for associated center, scopes, and check for authorization using the authorization logic. VoterHelper will ease the most common operation of this logic.
|
||||
|
||||
This is an example of implementation:
|
||||
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
<?php
|
||||
|
||||
namespace Chill\DocStoreBundle\Security\Authorization;
|
||||
|
||||
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
|
||||
use Chill\MainBundle\Security\Authorization\VoterHelperFactoryInterface;
|
||||
use Chill\MainBundle\Security\Authorization\VoterHelperInterface;
|
||||
use Chill\DocStoreBundle\Entity\PersonDocument;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
class PersonDocumentVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||
{
|
||||
protected Security $security;
|
||||
protected VoterHelperInterface $voterHelper;
|
||||
|
||||
public function __construct(
|
||||
Security $security,
|
||||
VoterHelperFactoryInterface $voterHelperFactory
|
||||
) {
|
||||
$this->security = $security;
|
||||
|
||||
// we build here a voter helper. This will ease the operations below.
|
||||
// when the authorization model is changed, it will be easy to make a different implementation
|
||||
// of the helper, instead of writing all Voters
|
||||
|
||||
$this->voterHelper = $voterHelperFactory
|
||||
// create a builder with some context
|
||||
->generate(self::class)
|
||||
// add the support of given roles for given class:
|
||||
->addCheckFor(Person::class, [self::SEE, self::CREATE])
|
||||
->addCheckFor(PersonDocument::class, $this->getRoles())
|
||||
->build();
|
||||
}
|
||||
|
||||
|
||||
protected function supports($attribute, $subject)
|
||||
{
|
||||
return $this->voterHelper->supports($attribute, $subject);
|
||||
}
|
||||
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
|
||||
{
|
||||
// basic check
|
||||
if (!$token->getUser() instanceof User) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// we first check the acl for associated elements.
|
||||
// here, we must be able to see the person associated to the document:
|
||||
if ($subject instanceof PersonDocument
|
||||
&& !$this->security->isGranted(PersonVoter::SEE, $subject->getPerson())) {
|
||||
|
||||
// not possible to see the associated person ? Then, not possible to see the document!
|
||||
return false;
|
||||
}
|
||||
|
||||
// the voter helper will implements the logic of checking:
|
||||
// 1. that the center is reachable
|
||||
// 2. for this given entity
|
||||
// 3. for this given scope
|
||||
// 4. and for the given role
|
||||
return $this->voterHelper->voteOnAttribute($attribute, $subject, $token);
|
||||
}
|
||||
|
||||
public function getRoles()
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
public function getRolesWithoutScope()
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
public function getRolesWithHierarchy()
|
||||
{
|
||||
// ...
|
||||
}
|
||||
}
|
||||
|
||||
Then, you will have to declare the service and tag it as a voter :
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
services:
|
||||
chill.report.security.authorization.report_voter:
|
||||
class: Chill\ReportBundle\Security\Authorization\ReportVoter
|
||||
arguments:
|
||||
- "@chill.main.security.authorization.helper"
|
||||
tags:
|
||||
- { name: security.voter }
|
||||
|
||||
|
||||
How to resolve scope and center programmatically ?
|
||||
==================================================
|
||||
|
||||
In a service, resolve the center and scope of an entity
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher;
|
||||
use Chill\MainBundle\Security\Resolver\ScopeResolverDispatcher;
|
||||
|
||||
|
||||
class MyService {
|
||||
private ScopeResolverDispatcher $scopeResolverDispatcher;
|
||||
private CenterResolverDispatcher $centerResolverDispatcher;
|
||||
|
||||
public function myFunction($entity) {
|
||||
/** @var null|Center[]|Center $center */
|
||||
$center = $this->centerResolverDispatcher->resolveCenter($entity);
|
||||
// $center may be null, an array of center, or an instance of Center
|
||||
|
||||
if ($this->scopeResolverDispatcher->isConcerned($entity) {
|
||||
/** @var null|Scope[]|Scope */
|
||||
$scope = $this-scopeResolverDispatcher->resolveScope($entity);
|
||||
// $scope may be null, an array of Scope, or an instance of Scope
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
In twig template, resolve the center:
|
||||
|
||||
.. code-block:: twig
|
||||
|
||||
{# resolve a center #}
|
||||
|
||||
{% if person|chill_resolve_center is not null%}
|
||||
|
||||
{% if person|chill_resolve_center is iterable %}
|
||||
{% set centers = person|chill_resolve_center %}
|
||||
{% else %}
|
||||
{% set centers = [ person|chill_resolve_center ] %}
|
||||
{% endif %}
|
||||
|
||||
<span class="open_sansbold">
|
||||
{{ 'Center'|trans|upper}} :
|
||||
</span>
|
||||
{% for c in centers %}
|
||||
{{ c.name|upper }}
|
||||
{% if not loop.last %}, {% endif %}
|
||||
{% endfor %}
|
||||
{%- endif -%}
|
||||
|
||||
In twig template, resolve the scope:
|
||||
|
||||
.. code-block:: twig
|
||||
|
||||
{% if entity|chill_is_scope_concerned %}
|
||||
|
||||
{% if entity|chill_resolve_scope is iterable %}
|
||||
{% set scopes = entity|chill_resolve_scope %}
|
||||
{% else %}
|
||||
{% set scopes = [ entity|chill_resolve_scope ] %}
|
||||
{% endif %}
|
||||
|
||||
<span>Scopes :</span>
|
||||
{% for s in scopes %}
|
||||
{{ c.name|localize_translatable_string }}
|
||||
{% if not loop.last %}, {% endif %}
|
||||
{% endfor %}
|
||||
{%- endif -%}
|
||||
|
||||
What is the default implementation of Scope and Center resolver ?
|
||||
-----------------------------------------------------------------
|
||||
|
||||
By default, the implementation rely on association into entities.
|
||||
|
||||
* implements ``Chill\MainBundle\Entity\HasCenterInterface`` on entities which have one or any center;
|
||||
* implements ``Chill\MainBundle\Entity\HasCentersInterface`` on entities which have one, multiple or any centers;
|
||||
* implements ``Chill\MainBundle\Entity\HasScopeInterface`` on entities which have one or any scope;
|
||||
* implements ``Chill\MainBundle\Entity\HasScopesInterface`` on entities which have one or any scopes;
|
||||
|
||||
Then, the default implementation will resolve the center and scope based on the implementation in your model.
|
||||
|
||||
How to change the default behaviour ?
|
||||
-------------------------------------
|
||||
|
||||
Implements those interface into services:
|
||||
|
||||
* ``Chill\MainBundle\Security\Resolver\CenterResolverInterface``;
|
||||
* ``Chill\MainBundle\Security\Resolver\ScopeResolverInterface``;
|
||||
|
||||
Authorization into lists and index pages
|
||||
========================================
|
||||
|
||||
Due to the fact that authorization model may be overriden, "list" and "index" pages should not rely on center and scope from controller. This must be delegated to dedicated service, which will be aware of the authorization model. We call them ``ACLAwareRepository``. This service must implements an interface, in order to allow to change the implementation.
|
||||
|
||||
The controller **must not** performs any DQL or SQL query.
|
||||
|
||||
Example in a controller:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
namespace Chill\TaskBundle\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Chill\TaskBundle\Repository\SingleTaskAclAwareRepositoryInterface;
|
||||
|
||||
|
||||
final class SingleTaskController extends AbstractController
|
||||
{
|
||||
|
||||
private SingleTaskAclAwareRepositoryInterface $singleTaskAclAwareRepository;
|
||||
|
||||
/**
|
||||
*
|
||||
* @Route(
|
||||
* "/{_locale}/task/single-task/list",
|
||||
* name="chill_task_singletask_list"
|
||||
* )
|
||||
*/
|
||||
public function listAction(
|
||||
Request $request
|
||||
) {
|
||||
$this->denyAccessUnlessGranted(TaskVoter::SHOW, null);
|
||||
|
||||
$nb = $this->singleTaskAclAwareRepository->countByAllViewable(
|
||||
'', // search pattern
|
||||
[] // search flags
|
||||
);
|
||||
$paginator = $this->paginatorFactory->create($nb);
|
||||
|
||||
if (0 < $nb) {
|
||||
$tasks = $this->singleTaskAclAwareRepository->findByAllViewable(
|
||||
'', // search pattern
|
||||
[] // search flags
|
||||
$paginator->getCurrentPageFirstItemNumber(),
|
||||
$paginator->getItemsPerPage(),
|
||||
// ordering:
|
||||
[
|
||||
'startDate' => 'DESC',
|
||||
'endDate' => 'DESC',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$tasks = [];
|
||||
}
|
||||
|
||||
return $this->render('@ChillTask/SingleTask/List/index.html.twig', [
|
||||
'tasks' => $tasks,
|
||||
'paginator' => $paginator,
|
||||
'filter_order' => $filterOrder
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Writing ``ACLAwareRepository``
|
||||
------------------------------
|
||||
|
||||
The ACLAwareRepository should rely on interfaces
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
As described above, the ACLAwareRepository will perform the query for listing entities, and take care of authorization.
|
||||
|
||||
Those "ACLAwareRepositories" must be described into ``interfaces``.
|
||||
|
||||
The service must rely on this interface, and not on the default implementation.
|
||||
|
||||
Example: at first, we design an interface for listing ``SingleTask`` entities:
|
||||
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
<?php
|
||||
|
||||
namespace Chill\TaskBundle\Repository;
|
||||
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
|
||||
interface SingleTaskAclAwareRepositoryInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @return SingleTask[]|array
|
||||
*/
|
||||
public function findByCurrentUsersTasks(?string $pattern = null, ?array $flags = [], ?int $start = 0, ?int $limit = 50, ?array $orderBy = []): array;
|
||||
|
||||
public function countByCurrentUsersTasks(?string $pattern = null, ?array $flags = []): int;
|
||||
|
||||
public function countByAllViewable(
|
||||
?string $pattern = null,
|
||||
?array $flags = []
|
||||
): int;
|
||||
|
||||
/**
|
||||
* @return SingleTask[]|array
|
||||
*/
|
||||
public function findByAllViewable(
|
||||
?string $pattern = null,
|
||||
?array $flags = [],
|
||||
?int $start = 0,
|
||||
?int $limit = 50,
|
||||
?array $orderBy = []
|
||||
): array;
|
||||
}
|
||||
|
||||
Implements this interface and register the interface as an alias for the implementation.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
services:
|
||||
Chill\TaskBundle\Repository\SingleTaskAclAwareRepository:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
|
||||
Chill\TaskBundle\Repository\SingleTaskAclAwareRepositoryInterface: '@Chill\TaskBundle\Repository\SingleTaskAclAwareRepository'
|
||||
|
||||
Write the basic implementation for re-use: separate authorization logic and search logic
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The logic of such repository may be separated into two logic:
|
||||
|
||||
* the authorization logic (show only entities that the user is allowed to see);
|
||||
* the search logic (filter entities on some criterias).
|
||||
|
||||
This logic should be separated into your implementation.
|
||||
|
||||
Considering this simple interface:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
interface MyEntityACLAwareRepositoryInterface {
|
||||
|
||||
public function countByAuthorized(array $criterias): int;
|
||||
|
||||
public function findByAuthorized(array $criteria, int $start, int $limit, array $orderBy): array;
|
||||
|
||||
}
|
||||
|
||||
The base implementation should separate the logic to allow an easy reuse. Here, the method ``buildQuery`` build a basic query without authorization logic, which can be re-used. The authorization logic is dedicated to a private method. For ease of user, the logic of adding ordering criterias and pagination parameters (``$start`` and ``$limit``) are also delegated to a public method.
|
||||
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
namespace Chill\MyBundle\Repository;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
|
||||
|
||||
final class MyEntityACLAwareRepository implements MyEntityACLAwareRepositoryInterface {
|
||||
|
||||
private EntityManagerInterface $em;
|
||||
|
||||
// constructor omitted
|
||||
|
||||
public function countByAuthorized(array $criterias): int
|
||||
{
|
||||
$qb = $this->buildQuery($criterias);
|
||||
|
||||
return $this->addAuthorizations($qb)->select("COUNT(e)")->getQuery()->getResult()->getSingleScalarResult();
|
||||
}
|
||||
|
||||
public function findByAuthorized(array $criteria, int $start, int $limit, array $orderBy): array
|
||||
{
|
||||
$qb = $this->buildQuery($criterias);
|
||||
|
||||
return $this->getResult($this->addAuthorizations($qb), $start, $limit, $orderBy);
|
||||
}
|
||||
|
||||
public function getResult(QueryBuilder $qb, int $start, int $limit, array $orderBy): array
|
||||
{
|
||||
$qb
|
||||
->setFirstResult($start)
|
||||
->setMaxResults($limit)
|
||||
;
|
||||
|
||||
// add order by logic
|
||||
|
||||
return $qb->getQuery()->getResult();
|
||||
}
|
||||
|
||||
public function buildQuery(array $criterias): QueryBuilder
|
||||
{
|
||||
$qb = $this->em->createQueryBuilder();
|
||||
|
||||
// implement you logic with search criteria here
|
||||
|
||||
return $qb;
|
||||
}
|
||||
|
||||
private function addAuthorizations(QueryBuilder $qb): QueryBuilder
|
||||
{
|
||||
// add authorization logic here
|
||||
return $qb;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Once this logic is executed, it becomes easy to make a new implementation of the repository:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
namespace Chill\MyOtherBundle\Repository;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Chill\MyBundle\Repository\MyEntityACLAwareRepository
|
||||
|
||||
|
||||
final class AnotherEntityACLAwareRepository implements MyEntityACLAwareRepositoryInterface {
|
||||
|
||||
private EntityManagerInterface $em;
|
||||
private \Chill\MyBundle\Repository\MyEntityACLAwareRepository $initial;
|
||||
|
||||
public function __construct(
|
||||
EntityManagerInterface $em,
|
||||
\Chill\MyBundle\Repository\MyEntityACLAwareRepository $initial
|
||||
) {
|
||||
$this->em = $em;
|
||||
$this->initial = $initial;
|
||||
}
|
||||
|
||||
public function countByAuthorized(array $criterias): int
|
||||
{
|
||||
$qb = $this->initial->buildQuery($criterias);
|
||||
|
||||
return $this->addAuthorizations($qb)->select("COUNT(e)")->getQuery()->getResult()->getSingleScalarResult();
|
||||
}
|
||||
|
||||
public function findByAuthorized(array $criteria, int $start, int $limit, array $orderBy): array
|
||||
{
|
||||
$qb = $this->initial->buildQuery($criterias);
|
||||
|
||||
return $this->initial->getResult($this->addAuthorizations($qb), $start, $limit, $orderBy);
|
||||
}
|
||||
|
||||
private function addAuthorizations(QueryBuilder $qb): QueryBuilder
|
||||
{
|
||||
// add a different authorization logic here
|
||||
return $qb;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Then, register this service and decorates the old one:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
services:
|
||||
Chill\MyOtherBundle\Repository\AnotherEntityACLAwareRepository:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
decorates: Chill\MyBundle\Repository\MyEntityACLAwareRepositoryInterface:
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -1,747 +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".
|
||||
|
||||
.. _api:
|
||||
|
||||
API
|
||||
###
|
||||
|
||||
Chill provides a basic framework to build REST api.
|
||||
|
||||
Basic configuration
|
||||
*******************
|
||||
|
||||
Configure a route
|
||||
=================
|
||||
|
||||
Follow those steps to build a REST api:
|
||||
|
||||
1. Create your model;
|
||||
2. Configure the API;
|
||||
|
||||
You can also:
|
||||
|
||||
* hook into the controller to customize some steps;
|
||||
* add more route and steps
|
||||
|
||||
.. note::
|
||||
|
||||
Useful links:
|
||||
|
||||
* `How to use annotation to configure serialization <https://symfony.com/doc/current/serializer.html>`_
|
||||
* `How to create your custom normalizer <https://symfony.com/doc/current/serializer/custom_normalizer.html>`_
|
||||
|
||||
Auto-loading the routes
|
||||
=======================
|
||||
|
||||
Ensure that those lines are present in your file `app/config/routing.yml`:
|
||||
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
chill_cruds:
|
||||
resource: 'chill_main_crud_route_loader:load'
|
||||
type: service
|
||||
|
||||
|
||||
Create your model
|
||||
=================
|
||||
|
||||
Create your model on the usual way:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
namespace Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\OriginRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=OriginRepository::class)
|
||||
* @ORM\Table(name="chill_person_accompanying_period_origin")
|
||||
*/
|
||||
class Origin
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="json")
|
||||
*/
|
||||
private $label;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="date_immutable", nullable=true)
|
||||
*/
|
||||
private $noActiveAfter;
|
||||
|
||||
// .. getters and setters
|
||||
|
||||
}
|
||||
|
||||
|
||||
Configure api
|
||||
=============
|
||||
|
||||
Configure the api using Yaml (see the full configuration: :ref:`api_full_configuration`):
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# config/packages/chill_main.yaml
|
||||
chill_main:
|
||||
apis:
|
||||
accompanying_period_origin:
|
||||
base_path: '/api/1.0/person/accompanying-period/origin'
|
||||
class: 'Chill\PersonBundle\Entity\AccompanyingPeriod\Origin'
|
||||
name: accompanying_period_origin
|
||||
base_role: 'ROLE_USER'
|
||||
actions:
|
||||
_index:
|
||||
methods:
|
||||
GET: true
|
||||
HEAD: true
|
||||
_entity:
|
||||
methods:
|
||||
GET: true
|
||||
HEAD: true
|
||||
|
||||
.. note::
|
||||
|
||||
If you are working on a shared bundle (aka "The chill bundles"), you should define your configuration inside the class :code:`ChillXXXXBundleExtension`, using the "prependConfig" feature:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
namespace Chill\PersonBundle\DependencyInjection;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* Class ChillPersonExtension
|
||||
* Loads and manages your bundle configuration
|
||||
*
|
||||
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
|
||||
* @package Chill\PersonBundle\DependencyInjection
|
||||
*/
|
||||
class ChillPersonExtension extends Extension implements PrependExtensionInterface
|
||||
{
|
||||
public function prepend(ContainerBuilder $container)
|
||||
{
|
||||
$this->prependCruds($container);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerBuilder $container
|
||||
*/
|
||||
protected function prependCruds(ContainerBuilder $container)
|
||||
{
|
||||
$container->prependExtensionConfig('chill_main', [
|
||||
'apis' => [
|
||||
[
|
||||
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Origin::class,
|
||||
'name' => 'accompanying_period_origin',
|
||||
'base_path' => '/api/1.0/person/accompanying-period/origin',
|
||||
'controller' => \Chill\PersonBundle\Controller\OpeningApiController::class,
|
||||
'base_role' => 'ROLE_USER',
|
||||
'actions' => [
|
||||
'_index' => [
|
||||
'methods' => [
|
||||
Request::METHOD_GET => true,
|
||||
Request::METHOD_HEAD => true
|
||||
],
|
||||
],
|
||||
'_entity' => [
|
||||
'methods' => [
|
||||
Request::METHOD_GET => true,
|
||||
Request::METHOD_HEAD => true
|
||||
]
|
||||
],
|
||||
]
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
The :code:`_index` and :code:`_entity` action
|
||||
*********************************************
|
||||
|
||||
The :code:`_index` and :code:`_entity` action are default actions:
|
||||
|
||||
* they will call a specific method in the default controller;
|
||||
* they will generate defined routes:
|
||||
|
||||
Index:
|
||||
Name: :code:`chill_api_single_accompanying_period_origin__index`
|
||||
|
||||
Path: :code:`/api/1.0/person/accompanying-period/origin.{_format}`
|
||||
|
||||
Entity:
|
||||
Name: :code:`chill_api_single_accompanying_period_origin__entity`
|
||||
|
||||
Path: :code:`/api/1.0/person/accompanying-period/origin/{id}.{_format}`
|
||||
|
||||
Role
|
||||
****
|
||||
|
||||
By default, the key `base_role` is used to check ACL. Take care of creating the :code:`Voter` required to take that into account.
|
||||
|
||||
For index action, the role will be called with :code:`NULL` as :code:`$subject`. The retrieved entity will be the subject for single queries.
|
||||
|
||||
You can also define a role for each method. In this case, this role is used for the given method, and, if any, the base role is taken into account.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# config/packages/chill_main.yaml
|
||||
chill_main:
|
||||
apis:
|
||||
accompanying_period_origin:
|
||||
base_path: '/api/1.0/person/bla/bla'
|
||||
class: 'Chill\PersonBundle\Entity\Blah'
|
||||
name: bla
|
||||
actions:
|
||||
_entity:
|
||||
methods:
|
||||
GET: true
|
||||
HEAD: true
|
||||
roles:
|
||||
GET: MY_ROLE_SEE
|
||||
HEAD: MY ROLE_SEE
|
||||
|
||||
Customize the controller
|
||||
************************
|
||||
|
||||
You can customize the controller by hooking into the default actions. Take care of extending :code:`Chill\MainBundle\CRUD\Controller\ApiController`.
|
||||
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
|
||||
namespace Chill\PersonBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class OpeningApiController extends ApiController
|
||||
{
|
||||
protected function customizeQuery(string $action, Request $request, $qb): void
|
||||
{
|
||||
$qb->where($qb->expr()->gt('e.noActiveAfter', ':now'))
|
||||
->orWhere($qb->expr()->isNull('e.noActiveAfter'));
|
||||
$qb->setParameter('now', new \DateTime('now'));
|
||||
}
|
||||
}
|
||||
|
||||
And set your controller in configuration:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
chill_main:
|
||||
apis:
|
||||
accompanying_period_origin:
|
||||
base_path: '/api/1.0/person/accompanying-period/origin'
|
||||
class: 'Chill\PersonBundle\Entity\AccompanyingPeriod\Origin'
|
||||
name: accompanying_period_origin
|
||||
# add a controller
|
||||
controller: 'Chill\PersonBundle\Controller\OpeningApiController'
|
||||
base_role: 'ROLE_USER'
|
||||
actions:
|
||||
_index:
|
||||
methods:
|
||||
GET: true
|
||||
HEAD: true
|
||||
_entity:
|
||||
methods:
|
||||
GET: true
|
||||
HEAD: true
|
||||
|
||||
Create your own actions
|
||||
***********************
|
||||
|
||||
You can add your own actions:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
chill_main:
|
||||
apis:
|
||||
-
|
||||
class: Chill\PersonBundle\Entity\AccompanyingPeriod
|
||||
name: accompanying_course
|
||||
base_path: /api/1.0/person/accompanying-course
|
||||
controller: Chill\PersonBundle\Controller\AccompanyingCourseApiController
|
||||
actions:
|
||||
# add a custom participation:
|
||||
participation:
|
||||
methods:
|
||||
POST: true
|
||||
DELETE: true
|
||||
GET: false
|
||||
HEAD: false
|
||||
PUT: false
|
||||
roles:
|
||||
POST: CHILL_PERSON_ACCOMPANYING_PERIOD_SEE
|
||||
DELETE: CHILL_PERSON_ACCOMPANYING_PERIOD_SEE
|
||||
GET: null
|
||||
HEAD: null
|
||||
PUT: null
|
||||
single-collection: single
|
||||
|
||||
The key :code:`single-collection` with value :code:`single` will add a :code:`/{id}/ + "action name"` (in this example, :code:`/{id}/participation`) into the path, after the base path. If the value is :code:`collection`, no id will be set, but the action name will be append to the path.
|
||||
|
||||
Then, create the corresponding action into your controller:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
namespace Chill\PersonBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Symfony\Component\HttpFoundation\Exception\BadRequestException;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
use Chill\PersonBundle\Privacy\AccompanyingPeriodPrivacyEvent;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
|
||||
class AccompanyingCourseApiController extends ApiController
|
||||
{
|
||||
protected EventDispatcherInterface $eventDispatcher;
|
||||
|
||||
protected ValidatorInterface $validator;
|
||||
|
||||
public function __construct(EventDispatcherInterface $eventDispatcher, $validator)
|
||||
{
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
$this->validator = $validator;
|
||||
}
|
||||
|
||||
public function participationApi($id, Request $request, $_format)
|
||||
{
|
||||
/** @var AccompanyingPeriod $accompanyingPeriod */
|
||||
$accompanyingPeriod = $this->getEntity('participation', $id, $request);
|
||||
$person = $this->getSerializer()
|
||||
->deserialize($request->getContent(), Person::class, $_format, []);
|
||||
|
||||
if (NULL === $person) {
|
||||
throw new BadRequestException('person id not found');
|
||||
}
|
||||
|
||||
$this->onPostCheckACL('participation', $request, $accompanyingPeriod, $_format);
|
||||
|
||||
switch ($request->getMethod()) {
|
||||
case Request::METHOD_POST:
|
||||
$participation = $accompanyingPeriod->addPerson($person);
|
||||
break;
|
||||
case Request::METHOD_DELETE:
|
||||
$participation = $accompanyingPeriod->removePerson($person);
|
||||
break;
|
||||
default:
|
||||
throw new BadRequestException("This method is not supported");
|
||||
}
|
||||
|
||||
$errors = $this->validator->validate($accompanyingPeriod);
|
||||
|
||||
if ($errors->count() > 0) {
|
||||
// only format accepted
|
||||
return $this->json($errors);
|
||||
}
|
||||
|
||||
$this->getDoctrine()->getManager()->flush();
|
||||
|
||||
return $this->json($participation);
|
||||
}
|
||||
}
|
||||
|
||||
Managing association
|
||||
********************
|
||||
|
||||
ManyToOne association
|
||||
=====================
|
||||
|
||||
In ManyToOne association, you can add associated entities using the :code:`PATCH` request. By default, the serializer deserialize entities only with their id and discriminator type, if any.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
curl -X 'PATCH' \
|
||||
'http://localhost:8001/api/1.0/person/accompanying-course/2668.json' \
|
||||
-H 'accept: */*' \
|
||||
-H 'Content-Type: application/json' \
|
||||
# see the data sent to the server: \
|
||||
-d '{
|
||||
"type": "accompanying_period",
|
||||
"id": 2668,
|
||||
"origin": { "id": 11 }
|
||||
}'
|
||||
|
||||
ManyToMany associations
|
||||
=======================
|
||||
|
||||
In OneToMany association, you can easily create route for adding and removing entities, using :code:`POST` and :code:`DELETE` requests.
|
||||
|
||||
Prepare your entity, creating the methods :code:`addYourEntity` and :code:`removeYourEntity`:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
namespace Chill\PersonBundle\Entity;
|
||||
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
|
||||
/**
|
||||
* AccompanyingPeriod Class
|
||||
*
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="chill_person_accompanying_period")
|
||||
* @DiscriminatorMap(typeProperty="type", mapping={
|
||||
* "accompanying_period"=AccompanyingPeriod::class
|
||||
* })
|
||||
*/
|
||||
class AccompanyingPeriod
|
||||
{
|
||||
/**
|
||||
* @var Collection
|
||||
* @ORM\ManyToMany(
|
||||
* targetEntity=Scope::class,
|
||||
* cascade={}
|
||||
* )
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
private $scopes;
|
||||
|
||||
public function addScope(Scope $scope): self
|
||||
{
|
||||
$this->scopes[] = $scope;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeScope(Scope $scope): void
|
||||
{
|
||||
$this->scopes->removeElement($scope);
|
||||
}
|
||||
|
||||
|
||||
Create your route into the configuration:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
chill_main:
|
||||
apis:
|
||||
-
|
||||
class: Chill\PersonBundle\Entity\AccompanyingPeriod
|
||||
name: accompanying_course
|
||||
base_path: /api/1.0/person/accompanying-course
|
||||
controller: Chill\PersonBundle\Controller\AccompanyingCourseApiController
|
||||
actions:
|
||||
scope:
|
||||
methods:
|
||||
POST: true
|
||||
DELETE: true
|
||||
GET: false
|
||||
HEAD: false
|
||||
PUT: false
|
||||
PATCH: false
|
||||
roles:
|
||||
POST: CHILL_PERSON_ACCOMPANYING_PERIOD_SEE
|
||||
DELETE: CHILL_PERSON_ACCOMPANYING_PERIOD_SEE
|
||||
GET: null
|
||||
HEAD: null
|
||||
PUT: null
|
||||
PATCH: null
|
||||
controller_action: null
|
||||
path: null
|
||||
single-collection: single
|
||||
|
||||
This will create a new route, which will accept two methods: DELETE and POST:
|
||||
|
||||
.. code-block:: raw
|
||||
|
||||
+--------------+---------------------------------------------------------------------------------------+
|
||||
| Property | Value |
|
||||
+--------------+---------------------------------------------------------------------------------------+
|
||||
| Route Name | chill_api_single_accompanying_course_scope |
|
||||
| Path | /api/1.0/person/accompanying-course/{id}/scope.{_format} |
|
||||
| Path Regex | {^/api/1\.0/person/accompanying\-course/(?P<id>[^/]++)/scope\.(?P<_format>[^/]++)$}sD |
|
||||
| Host | ANY |
|
||||
| Host Regex | |
|
||||
| Scheme | ANY |
|
||||
| Method | POST|DELETE |
|
||||
| Requirements | {id}: \d+ |
|
||||
| Class | Symfony\Component\Routing\Route |
|
||||
| Defaults | _controller: csapi_accompanying_course_controller:scopeApi |
|
||||
| Options | compiler_class: Symfony\Component\Routing\RouteCompiler |
|
||||
+--------------+---------------------------------------------------------------------------------------+
|
||||
|
||||
|
||||
|
||||
Then, create the controller action. Call the method:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
namespace Chill\PersonBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
|
||||
class MyController extends ApiController
|
||||
{
|
||||
public function scopeApi($id, Request $request, string $_format): Response
|
||||
{
|
||||
return $this->addRemoveSomething('scope', $id, $request, $_format, 'scope', Scope::class, [ 'groups' => [ 'read' ] ]);
|
||||
}
|
||||
}
|
||||
|
||||
This will allow to add a scope by his id, and delete them.
|
||||
|
||||
Curl requests:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# add a scope with id 5
|
||||
curl -X 'POST' \
|
||||
'http://localhost:8001/api/1.0/person/accompanying-course/2868/scope.json' \
|
||||
-H 'accept: */*' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"type": "scope",
|
||||
"id": 5
|
||||
}'
|
||||
|
||||
# remove a scope with id 5
|
||||
curl -X 'DELETE' \
|
||||
'http://localhost:8001/api/1.0/person/accompanying-course/2868/scope.json' \
|
||||
-H 'accept: */*' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"id": 5,
|
||||
"type": "scope"
|
||||
}'
|
||||
|
||||
Deserializing an association where multiple types are allowed
|
||||
=============================================================
|
||||
|
||||
Sometimes, multiples types are allowed as association to one entity:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
namespace Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
class Resource
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=ThirdParty::class)
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*/
|
||||
private $thirdParty;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Person::class)
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*/
|
||||
private $person;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param $resource Person|ThirdParty
|
||||
*/
|
||||
public function setResource($resource): self
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return ThirdParty|Person
|
||||
* @Groups({"read", "write"})
|
||||
*/
|
||||
public function getResource()
|
||||
{
|
||||
return $this->person ?? $this->thirdParty;
|
||||
}
|
||||
}
|
||||
|
||||
This is not well taken into account by the Symfony serializer natively.
|
||||
|
||||
You must, then, create your own CustomNormalizer. You can help yourself using this:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
namespace Chill\PersonBundle\Serializer\Normalizer;
|
||||
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\Resource;
|
||||
use Chill\PersonBundle\Repository\AccompanyingPeriod\ResourceRepository;
|
||||
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait;
|
||||
use Symfony\Component\Serializer\Normalizer\ObjectToPopulateTrait;
|
||||
use Symfony\Component\Serializer\Exception;
|
||||
use Chill\MainBundle\Serializer\Normalizer\DiscriminatedObjectDenormalizer;
|
||||
|
||||
|
||||
class AccompanyingPeriodResourceNormalizer implements DenormalizerInterface, DenormalizerAwareInterface
|
||||
{
|
||||
use DenormalizerAwareTrait;
|
||||
use ObjectToPopulateTrait;
|
||||
|
||||
public function __construct(ResourceRepository $repository)
|
||||
{
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
public function denormalize($data, string $type, string $format = null, array $context = [])
|
||||
{
|
||||
// .. snipped for brevity
|
||||
|
||||
if ($resource === NULL) {
|
||||
$resource = new Resource();
|
||||
}
|
||||
|
||||
if (\array_key_exists('resource', $data)) {
|
||||
$res = $this->denormalizer->denormalize(
|
||||
$data['resource'],
|
||||
// call for a "multiple type"
|
||||
DiscriminatedObjectDenormalizer::TYPE,
|
||||
$format,
|
||||
// into the context, we add the list of allowed types:
|
||||
[
|
||||
DiscriminatedObjectDenormalizer::ALLOWED_TYPES =>
|
||||
[
|
||||
Person::class, ThirdParty::class
|
||||
]
|
||||
]
|
||||
);
|
||||
|
||||
$resource->setResource($res);
|
||||
}
|
||||
|
||||
return $resource;
|
||||
}
|
||||
|
||||
|
||||
public function supportsDenormalization($data, string $type, string $format = null)
|
||||
{
|
||||
return $type === Resource::class;
|
||||
}
|
||||
}
|
||||
|
||||
Serialization for collection
|
||||
****************************
|
||||
|
||||
A specific model has been defined for returning collection:
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"count": 49,
|
||||
"results": [
|
||||
],
|
||||
"pagination": {
|
||||
"more": true,
|
||||
"next": "/api/1.0/search.json&q=xxxx......&page=2",
|
||||
"previous": null,
|
||||
"first": 0,
|
||||
"items_per_page": 1
|
||||
}
|
||||
}
|
||||
|
||||
Where this is relevant, this model should be re-used in custom controller actions.
|
||||
|
||||
In custom actions, this can be achieved quickly by assembling results into a :code:`Chill\MainBundle\Serializer\Model\Collection`. The pagination information is given by using :code:`Paginator` (see :ref:`Pagination <pagination-ref>`).
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
|
||||
class MyController extends AbstractController
|
||||
{
|
||||
|
||||
protected function serializeCollection(PaginatorInterface $paginator, $entities): Response
|
||||
{
|
||||
$model = new Collection($entities, $paginator);
|
||||
|
||||
return $this->json($model, Response::HTTP_OK, [], $context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.. _api_full_configuration:
|
||||
|
||||
Full configuration example
|
||||
**************************
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
apis:
|
||||
-
|
||||
class: Chill\PersonBundle\Entity\AccompanyingPeriod
|
||||
name: accompanying_course
|
||||
base_path: /api/1.0/person/accompanying-course
|
||||
controller: Chill\PersonBundle\Controller\AccompanyingCourseApiController
|
||||
actions:
|
||||
_entity:
|
||||
roles:
|
||||
GET: CHILL_PERSON_ACCOMPANYING_PERIOD_SEE
|
||||
HEAD: null
|
||||
POST: null
|
||||
DELETE: null
|
||||
PUT: null
|
||||
controller_action: null
|
||||
path: null
|
||||
single-collection: single
|
||||
methods:
|
||||
GET: true
|
||||
HEAD: true
|
||||
POST: false
|
||||
DELETE: false
|
||||
PUT: false
|
||||
participation:
|
||||
methods:
|
||||
POST: true
|
||||
DELETE: true
|
||||
GET: false
|
||||
HEAD: false
|
||||
PUT: false
|
||||
roles:
|
||||
POST: CHILL_PERSON_ACCOMPANYING_PERIOD_SEE
|
||||
DELETE: CHILL_PERSON_ACCOMPANYING_PERIOD_SEE
|
||||
GET: null
|
||||
HEAD: null
|
||||
PUT: null
|
||||
controller_action: null
|
||||
# the requirements for the route. Will be set to `[ 'id' => '\d+' ]` if left empty.
|
||||
requirements: []
|
||||
path: null
|
||||
single-collection: single
|
||||
base_role: null
|
||||
|
||||
|
@@ -1,101 +0,0 @@
|
||||
|
||||
.. Copyright (C) 2014-2023 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".
|
||||
|
||||
.. _cronjob:
|
||||
|
||||
Cron jobs
|
||||
*********
|
||||
|
||||
Some tasks must be executed regularly: refresh some materialized views, remove old data, ...
|
||||
|
||||
For this purpose, one can programmatically implements a "cron job", which will be scheduled by a specific command.
|
||||
|
||||
The command :code:`chill:cron-job:execute`
|
||||
==========================================
|
||||
|
||||
The command :code:`chill:cron-job:execute` will schedule a task, one by one. In a classical implementation, it should
|
||||
be executed every 15 minutes (more or less), to ensure that every task can be executed.
|
||||
|
||||
.. warning::
|
||||
|
||||
This command should not be executed in parallel. The installer should ensure that two job are executed concurrently.
|
||||
|
||||
How to implements a cron job ?
|
||||
==============================
|
||||
|
||||
Implements a :code:`Chill\MainBundle\Cron\CronJobInterface`. Here is an example:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
namespace Chill\MainBundle\Service\Something;
|
||||
|
||||
use Chill\MainBundle\Cron\CronJobInterface;
|
||||
use Chill\MainBundle\Entity\CronJobExecution;
|
||||
use DateInterval;
|
||||
use DateTimeImmutable;
|
||||
use Symfony\Component\Clock\ClockInterface;
|
||||
|
||||
class MyCronJob implements CronJobInterface
|
||||
{
|
||||
function __construct(private ClockInterface $clock) {}
|
||||
|
||||
public function canRun(?CronJobExecution $cronJobExecution): bool
|
||||
{
|
||||
// the parameter $cronJobExecution contains data about the last execution of the cronjob
|
||||
// if it is null, it should be executed immediatly
|
||||
if (null === $cronJobExecution) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($cronJobExecution->getKey() !== $this->getKey()) {
|
||||
throw new UnexpectedValueException();
|
||||
}
|
||||
|
||||
// this cron job should be executed if the last execution is greater than one day, but only during the night
|
||||
|
||||
$now = $clock->now();
|
||||
|
||||
return $cronJobExecution->getLastStart() < $now->sub(new DateInterval('P1D'))
|
||||
&& in_array($now->format('H'), self::ACCEPTED_HOURS, true)
|
||||
// introduce a random component to ensure a roll of task execution when multiple instances are hosted on same machines
|
||||
&& mt_rand(0, 5) === 0;
|
||||
}
|
||||
|
||||
public function getKey(): string
|
||||
{
|
||||
return 'arbitrary-and-unique-key';
|
||||
}
|
||||
|
||||
public function run(array $lastExecutionData): void
|
||||
{
|
||||
// here, we execute the command
|
||||
|
||||
// we return execution data, which will be served for next execution
|
||||
// this data should be easily serializable in a json column: it should contains
|
||||
// only int, string, etc. Avoid storing object
|
||||
return ['last-execution-id' => 0];
|
||||
}
|
||||
}
|
||||
|
||||
How are cron job scheduled ?
|
||||
============================
|
||||
|
||||
If the command :code:`chill:cron-job:execute` is run with one or more :code:`job` argument, those jobs are run, **without checking that the job can run** (the method :code:`canRun` is not executed).
|
||||
|
||||
If any :code:`job` argument is given, the :code:`CronManager` schedule job with those steps:
|
||||
|
||||
* the tasks are ordered, with:
|
||||
* a priority is given for tasks that weren't never executed;
|
||||
* then, the tasks are ordered, the last executed are the first in the list
|
||||
* then, for each tasks, and in the given order, the first task where :code:`canRun` return :code:`TRUE` will be executed.
|
||||
|
||||
The command :code:`chill:cron-job:execute` execute **only one** task.
|
||||
|
||||
|
||||
|
@@ -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`.
|
@@ -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.
|
@@ -1,203 +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".
|
||||
|
||||
.. _entity-info:
|
||||
|
||||
Stats about event on entity in php world
|
||||
########################################
|
||||
|
||||
It is necessary to be able to gather information about events for some entities:
|
||||
|
||||
- when the event has been done;
|
||||
- who did it;
|
||||
- ...
|
||||
|
||||
Those "infos" are not linked with right management, like describe in :ref:`timelines`.
|
||||
|
||||
|
||||
“infos” for some stats and info about an entity
|
||||
-----------------------------------------------
|
||||
|
||||
Building an info means:
|
||||
|
||||
- create an Entity, and map this entity to a SQL view (not a regular table);
|
||||
- use the framework to build this entity dynamically.
|
||||
|
||||
A framework api is built to be able to build multiple “infos” entities
|
||||
through “union” views:
|
||||
|
||||
- use a command ``bin/console chill:db:sync-views`` to synchronize view (create view if it does not exists, or update
|
||||
views when new SQL parts are added in the UNION query. Internally, this command call a new ``ViewEntityInfoManager``,
|
||||
which iterate over available views to build the SQL;
|
||||
- one can create a new “view entity info” by implementing a
|
||||
``ViewEntityInfoProviderInterface``
|
||||
- this implementation of the interface is free to create another
|
||||
interface for building each part of the UNION query. This interface
|
||||
is created for AccompanyingPeriodInfo:
|
||||
``Chill\PersonBundle\Service\EntityInfo\AccompanyingPeriodInfoUnionQueryPartInterface``
|
||||
|
||||
So, converting new “events” into rows for ``AccompanyingPeriodInfo`` is
|
||||
just implementing this interface!
|
||||
|
||||
Implementation for AccompanyingPeriod (``AccompanyingPeriod/AccompanyingPeriodInfo``)
|
||||
-------------------------------------------------------------------------------------
|
||||
|
||||
A class is created for computing some statistical info for an
|
||||
AccompanyingPeriod: ``AccompanyingPeriod/AccompanyingPeriodInfo``. This
|
||||
contains information about “something happens”, who did it and when.
|
||||
|
||||
Having those info in table answer some questions like:
|
||||
|
||||
- when is the last and the first action (AccompanyingPeriodWork,
|
||||
Activity, AccompanyingPeriodWorkEvaluation, …) on the period;
|
||||
- who is “acting” on the period, and when is the last “action” for each
|
||||
user.
|
||||
|
||||
The AccompanyingPeriod info is mapped to a SQL view, not a table. The
|
||||
sql view is built dynamically (see below), and gather infos from
|
||||
ActivityBundle, PersonBundle, CalendarBundle, … It is possible to create
|
||||
custom bundle and add info on this view.
|
||||
|
||||
.. code:: php
|
||||
|
||||
/**
|
||||
*
|
||||
* @ORM\Entity()
|
||||
* @ORM\Table(name="view_chill_person_accompanying_period_info") <==== THIS IS A VIEW, NOT A TABLE
|
||||
*/
|
||||
class AccompanyingPeriodInfo
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
Why do we need this ?
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
For multiple jobs in PHP world:
|
||||
|
||||
- moving the accompanying period to another steps when inactive,
|
||||
automatically;
|
||||
- listing all the users which are intervening on the action on a new
|
||||
“Liste des intervenants” page;
|
||||
- filtering on exports
|
||||
|
||||
Later, we will launch automatic anonymise for accompanying period and
|
||||
all related entities through this information.
|
||||
|
||||
How is built the SQL views which is mapped to “info” entities ?
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The AccompanyingPeriodInfo entity is mapped by a SQL view (not a regular
|
||||
table).
|
||||
|
||||
The sql view is built dynamically, it is a SQL view like this, for now (April 2023):
|
||||
|
||||
.. code:: sql
|
||||
|
||||
create view view_chill_person_accompanying_period_info
|
||||
(accompanyingperiod_id, relatedentity, relatedentityid, user_id, infodate, discriminator, metadata) as
|
||||
SELECT w.accompanyingperiod_id,
|
||||
'Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork'::text AS relatedentity,
|
||||
w.id AS relatedentityid,
|
||||
cpapwr.user_id,
|
||||
w.enddate AS infodate,
|
||||
'accompanying_period_work_end'::text AS discriminator,
|
||||
'{}'::jsonb AS metadata
|
||||
FROM chill_person_accompanying_period_work w
|
||||
LEFT JOIN chill_person_accompanying_period_work_referrer cpapwr ON w.id = cpapwr.accompanyingperiodwork_id
|
||||
WHERE w.enddate IS NOT NULL
|
||||
UNION
|
||||
SELECT cpapw.accompanyingperiod_id,
|
||||
'Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation'::text AS relatedentity,
|
||||
e.id AS relatedentityid,
|
||||
e.updatedby_id AS user_id,
|
||||
e.updatedat AS infodate,
|
||||
'accompanying_period_work_evaluation_updated_at'::text AS discriminator,
|
||||
'{}'::jsonb AS metadata
|
||||
FROM chill_person_accompanying_period_work_evaluation e
|
||||
JOIN chill_person_accompanying_period_work cpapw ON cpapw.id = e.accompanyingperiodwork_id
|
||||
WHERE e.updatedat IS NOT NULL
|
||||
UNION
|
||||
SELECT cpapw.accompanyingperiod_id,
|
||||
'Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation'::text AS relatedentity,
|
||||
e.id AS relatedentityid,
|
||||
cpapwr.user_id,
|
||||
e.maxdate AS infodate,
|
||||
'accompanying_period_work_evaluation_start'::text AS discriminator,
|
||||
'{}'::jsonb AS metadata
|
||||
FROM chill_person_accompanying_period_work_evaluation e
|
||||
JOIN chill_person_accompanying_period_work cpapw ON cpapw.id = e.accompanyingperiodwork_id
|
||||
LEFT JOIN chill_person_accompanying_period_work_referrer cpapwr ON cpapw.id = cpapwr.accompanyingperiodwork_id
|
||||
WHERE e.maxdate IS NOT NULL
|
||||
UNION
|
||||
SELECT cpapw.accompanyingperiod_id,
|
||||
'Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation'::text AS relatedentity,
|
||||
e.id AS relatedentityid,
|
||||
cpapwr.user_id,
|
||||
e.startdate AS infodate,
|
||||
'accompanying_period_work_evaluation_start'::text AS discriminator,
|
||||
'{}'::jsonb AS metadata
|
||||
FROM chill_person_accompanying_period_work_evaluation e
|
||||
JOIN chill_person_accompanying_period_work cpapw ON cpapw.id = e.accompanyingperiodwork_id
|
||||
LEFT JOIN chill_person_accompanying_period_work_referrer cpapwr ON cpapw.id = cpapwr.accompanyingperiodwork_id
|
||||
UNION
|
||||
SELECT cpapw.accompanyingperiod_id,
|
||||
'Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocument'::text AS relatedentity,
|
||||
doc.id AS relatedentityid,
|
||||
doc.updatedby_id AS user_id,
|
||||
doc.updatedat AS infodate,
|
||||
'accompanying_period_work_evaluation_document_updated_at'::text AS discriminator,
|
||||
'{}'::jsonb AS metadata
|
||||
FROM chill_person_accompanying_period_work_evaluation_document doc
|
||||
JOIN chill_person_accompanying_period_work_evaluation e ON doc.accompanyingperiodworkevaluation_id = e.id
|
||||
JOIN chill_person_accompanying_period_work cpapw ON cpapw.id = e.accompanyingperiodwork_id
|
||||
WHERE doc.updatedat IS NOT NULL
|
||||
UNION
|
||||
SELECT cpapw.accompanyingperiod_id,
|
||||
'Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation'::text AS relatedentity,
|
||||
e.id AS relatedentityid,
|
||||
cpapwr.user_id,
|
||||
e.maxdate AS infodate,
|
||||
'accompanying_period_work_evaluation_max'::text AS discriminator,
|
||||
'{}'::jsonb AS metadata
|
||||
FROM chill_person_accompanying_period_work_evaluation e
|
||||
JOIN chill_person_accompanying_period_work cpapw ON cpapw.id = e.accompanyingperiodwork_id
|
||||
LEFT JOIN chill_person_accompanying_period_work_referrer cpapwr ON cpapw.id = cpapwr.accompanyingperiodwork_id
|
||||
WHERE e.maxdate IS NOT NULL
|
||||
UNION
|
||||
SELECT w.accompanyingperiod_id,
|
||||
'Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork'::text AS relatedentity,
|
||||
w.id AS relatedentityid,
|
||||
cpapwr.user_id,
|
||||
w.startdate AS infodate,
|
||||
'accompanying_period_work_start'::text AS discriminator,
|
||||
'{}'::jsonb AS metadata
|
||||
FROM chill_person_accompanying_period_work w
|
||||
LEFT JOIN chill_person_accompanying_period_work_referrer cpapwr ON w.id = cpapwr.accompanyingperiodwork_id
|
||||
UNION
|
||||
SELECT activity.accompanyingperiod_id,
|
||||
'Chill\ActivityBundle\Entity\Activity'::text AS relatedentity,
|
||||
activity.id AS relatedentityid,
|
||||
au.user_id,
|
||||
activity.date AS infodate,
|
||||
'activity_date'::text AS discriminator,
|
||||
'{}'::jsonb AS metadata
|
||||
FROM activity
|
||||
LEFT JOIN activity_user au ON activity.id = au.activity_id
|
||||
WHERE activity.accompanyingperiod_id IS NOT NULL;
|
||||
|
||||
As you can see, the view gather multiple SELECT queries and bind them
|
||||
with UNION.
|
||||
|
||||
Each SELECT query is built dynamically, through a class implementing an
|
||||
interface: ``Chill\PersonBundle\Service\EntityInfo\AccompanyingPeriodInfoUnionQueryPartInterface``, `like
|
||||
here <https://gitlab.com/Chill-Projet/chill-bundles/-/blob/master/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEndQueryPartForAccompanyingPeriodInfo.php>`__
|
||||
|
||||
To add new `SELECT` query in different `UNION` parts in the sql view, create a
|
||||
service and implements this interface: ``Chill\PersonBundle\Service\EntityInfo\AccompanyingPeriodInfoUnionQueryPartInterface``.
|
@@ -10,17 +10,17 @@
|
||||
Exports
|
||||
*******
|
||||
|
||||
Export is an important issue within the Chill software : users should be able to :
|
||||
Export is an important issue for the Chill software : users should be able to :
|
||||
|
||||
- compute statistics about their activity ;
|
||||
- list "things" which are a part of their activities.
|
||||
- list "things" which make part of their activities.
|
||||
|
||||
The `main bundle`_ provides a powerful framework to build custom queries with re-usable parts across differents bundles.
|
||||
|
||||
.. contents:: Table of content
|
||||
:local:
|
||||
|
||||
.. seealso::
|
||||
.. seealso::
|
||||
|
||||
`The issue where this framework was discussed <https://git.framasoft.org/Chill-project/Chill-Main/issues/9>`_
|
||||
Provides some information about the pursued features and architecture.
|
||||
@@ -32,37 +32,37 @@ Concepts
|
||||
Some vocabulary: 3 "Export elements"
|
||||
------------------------------------
|
||||
|
||||
Four terms are used for this framework :
|
||||
Four terms are used for this framework :
|
||||
|
||||
Exports
|
||||
provide some basic operation on the data. Two kinds of exports are available :
|
||||
exports
|
||||
provides some basic operation on the date. Two kind of exports are available :
|
||||
|
||||
- computed data : it may be "the number of people", "the number of activities", "the duration of activities", ...
|
||||
- list data : it may be "the list of people", "the list of activities", ...
|
||||
- list data : it may be "the list of people", "the list of activity", ...
|
||||
|
||||
Filters
|
||||
The filters create a filter on the data: it removes some information the user doesn't want to introduce in the computation done by the export.
|
||||
filters
|
||||
The filters make a filter on the date: it removes some information the user doesn't want to introduce in the computation done by export. In other word, filters make a filter...
|
||||
|
||||
Example of a filter: "people under 18 years olds", "activities between the 1st of June and the 31st December", ...
|
||||
Example of filter: "people under 18 years olds", "activities between the 1st of June and the 31st December", ...
|
||||
|
||||
Aggregators
|
||||
The aggregator aggregates the data into some group (some software use the term 'bucket').
|
||||
aggregators
|
||||
The aggregator aggregates the data into some group (some software use the term 'bucket').
|
||||
|
||||
Example of an aggregator : "group people by gender", "group people by nationality", "group activity by type", ...
|
||||
Example of aggregator : "group people by gender", "group people by nationality", "group activity by type", ...
|
||||
|
||||
Formatters
|
||||
The formatters format the data into a :class:`Symfony\Component\HttpFoundation\Response`, which will be returned "as is" by the controller to the web client.
|
||||
formatters
|
||||
The formatters format the data into a :class:`Symfony\Component\HttpFoundation\Response`, which will be returned "as is" by the controller to the web client.
|
||||
|
||||
Example of a formatter: "format data as CSV", "format data as an ods spreadsheet", ...
|
||||
Example of formatter: "format data as CSV", "format data as ods spreadsheet", ...
|
||||
|
||||
Anatomy of an export
|
||||
---------------------
|
||||
|
||||
An export can be thought of as a sentence where each part of this sentence refers to one or multiple export elements. Examples :
|
||||
An export may be explained as a sentence, where each part of this sentence refers to one or multiple exports element. Examples :
|
||||
|
||||
**Example 1**: Count the number of people having at least one activity in the last 12 month, and group them by nationality and gender, and format them in a CSV spreadsheet.
|
||||
|
||||
Here :
|
||||
Here :
|
||||
|
||||
- *count the number of people* is the export part
|
||||
- *having at least one activity* is the filter part
|
||||
@@ -72,10 +72,10 @@ Here :
|
||||
|
||||
Note that :
|
||||
|
||||
- Aggregators, filters, exports and formatters are cross-bundle. Here the bundle *activity* provides a filter which is applied on an export provided by the person bundle ;
|
||||
- Multiple aggregator or filter for one export may exist. Currently, only one export is allowed.
|
||||
- aggregators, filters, exports and aggregators are cross-bundle. Here the bundle *activity* provides a filter which apply on an export provided by the person bundle ;
|
||||
- there may exists multiple aggregator or filter for one export. Currently, only one export is allowed.
|
||||
|
||||
The result might be :
|
||||
The result might be :
|
||||
|
||||
+-----------------------+----------------+---------------------------+
|
||||
| Nationality | Gender | Number of people |
|
||||
@@ -89,9 +89,9 @@ The result might be :
|
||||
| France | Female | 150 |
|
||||
+-----------------------+----------------+---------------------------+
|
||||
|
||||
**Example 2**: Count the average duration of an activity with type "meeting", which occurs between the 1st of June and the 31st of December, group them by week, and format the data in an OpenDocument spreadsheet.
|
||||
**Example 2**: Count the average duration of an activity with type "meeting", which occurs between the 1st of June and the 31st of December, group them by week, and format the data in a OpenDocument spreadsheet.
|
||||
|
||||
Here :
|
||||
Here :
|
||||
|
||||
- *count the average duration of an activity* is the export part
|
||||
- *activity with type meeting* is a filter part
|
||||
@@ -102,7 +102,7 @@ Here :
|
||||
The result might be :
|
||||
|
||||
+-----------------------+----------------------+
|
||||
| Week | Number of activities |
|
||||
| Week | Number of activities |
|
||||
+=======================+======================+
|
||||
| 2015-10 | 10 |
|
||||
+-----------------------+----------------------+
|
||||
@@ -116,77 +116,77 @@ The result might be :
|
||||
Authorization and exports
|
||||
-------------------------
|
||||
|
||||
Exports, filters and aggregators should not show data the user is not allowed to see within the application.
|
||||
Exports, filters and aggregators should not make see data the user is not allowed to see.
|
||||
|
||||
In other words, developers are required to take care of user authorization for each export.
|
||||
|
||||
There should be a specific role that grants permission to users who are allowed to build exports. For more simplicity, this role should apply on a center, and should not require special circles.
|
||||
It should exists a special role that should be granted to users which are allowed to build exports. For more simplicity, this role should apply on center, and should not requires special circles.
|
||||
|
||||
How does the magic work ?
|
||||
How does the magic works ?
|
||||
===========================
|
||||
|
||||
To build an export, we rely on the capacity of the database to execute queries with aggregate (i.e. GROUP BY) and filter (i.e. WHERE) instructions.
|
||||
|
||||
An export is an SQL query which is initiated by an export, and modified by aggregators and filters.
|
||||
|
||||
.. note::
|
||||
.. note::
|
||||
|
||||
**Example**: Count the number of people having at least one activity in the last 12 month, and group them by nationality and gender
|
||||
|
||||
1. The report initiates the query
|
||||
1. The report initiate the query
|
||||
|
||||
.. code-block:: SQL
|
||||
|
||||
SELECT count(people.*) FROM people
|
||||
|
||||
2. The filter adds a where and join clause :
|
||||
2. The filter add a where and join clause :
|
||||
|
||||
.. code-block:: SQL
|
||||
|
||||
SELECT count(people.*) FROM people
|
||||
RIGHT JOIN activity
|
||||
SELECT count(people.*) FROM people
|
||||
RIGHT JOIN activity
|
||||
WHERE activity.date IS BETWEEN now AND 6 month ago
|
||||
|
||||
3. The aggregator "nationality" adds a GROUP BY clause and a column in the SELECT statement:
|
||||
3. The aggregator "nationality" add a GROUP BY clause and a column in the SELECT statement:
|
||||
|
||||
.. code-block:: sql
|
||||
|
||||
SELECT people.nationality, count(people.*) FROM people
|
||||
RIGHT JOIN activity
|
||||
WHERE activity.date IS BETWEEN now AND 6 month ago
|
||||
SELECT people.nationality, count(people.*) FROM people
|
||||
RIGHT JOIN activity
|
||||
WHERE activity.date IS BETWEEN now AND 6 month ago
|
||||
GROUP BY nationality
|
||||
|
||||
4. The aggregator "gender" does the same job as the nationality aggregator : it adds a GROUP BY clause and a column in the SELECT statement :
|
||||
4. The aggregator "gender" do the same job as the nationality aggregator : it adds a GROUP BY clause and a column in the SELECT statement :
|
||||
|
||||
.. code-block:: sql
|
||||
|
||||
SELECT people.nationality, people.gender, count(people.*)
|
||||
FROM people RIGHT JOIN activity
|
||||
WHERE activity.date IS BETWEEN now AND 6 month ago
|
||||
SELECT people.nationality, people.gender, count(people.*)
|
||||
FROM people RIGHT JOIN activity
|
||||
WHERE activity.date IS BETWEEN now AND 6 month ago
|
||||
GROUP BY nationality, gender
|
||||
|
||||
Each filter, aggregator and filter may collect parameters from the user through a form. This form is appended to the export form. Here is an example.
|
||||
Each filter, aggregator and filter may collect parameters from the user by providing a form. This form is appended to the export form. Here is an example.
|
||||
|
||||
.. figure:: /_static/screenshots/development/export_form-fullpage.png
|
||||
|
||||
The screenshot shows the export form for ``CountPeople`` (Nombre de personnes). The filter by date of birth is checked (*Filtrer par date de naissance de la personne*), which triggers a subform, which is provided by the :class:`Chill\PersonBundle\Export\Filter\BirthdateFilter`. The other unchecked filter does not show the subform.
|
||||
The screenshot show the export form for ``CountPeople`` (Nombre de personnes). The filter by date of birth is checked (*Filtrer par date de naissance de la personne*), which allow to show a subform, which is provided by the :class:`Chill\PersonBundle\Export\Filter\BirthdateFilter`. The other filter, which are unchecked, does not show the subform.
|
||||
|
||||
Two aggregators are also checked : by Country of birth (*Aggréger les personnes par pays de naissance*, the corresponding class is :class:`Chill\PersonBundle\Export\Aggregator\CountryOfBirthAggregator`, which also triggers a subform. The aggregator by gender (*Aggréger les personnes par genre*) is also checked, but there is no corresponding subform.
|
||||
Two aggregators are also checked : by Country of birth (*Aggréger les personnes par pays de naissance*, corresponding class is :class:`Chill\PersonBundle\Export\Aggregator\CountryOfBirthAggregator`, which also open a subform. The aggregator by gender (*Aggréger les personnes par genre*) is also checked, but there is no corresponding subform.
|
||||
|
||||
The Export Manager
|
||||
------------------
|
||||
|
||||
The Export manager (:class:`Chill\MainBundle\Export\ExportManager` is the central class which registers all exports, aggregators, filters and formatters.
|
||||
The Export manager (:class:`Chill\MainBundle\Export\ExportManager` is the central class which register all exports, aggregators, filters and formatters.
|
||||
|
||||
The export manager is also responsible for orchestrating the whole export process, producing a :class:`Symfony\FrameworkBundle\HttpFoundation\Request` for each export request.
|
||||
The export manager is also responsible for orchestrating the whole export process, producing a :class:`Symfony\FrameworkBundle\HttpFoundation\Request` to each export request.
|
||||
|
||||
|
||||
The export form step
|
||||
--------------------
|
||||
|
||||
The form step allows you to build a form, combining different parts of the module.
|
||||
The form step allow to build a form, aggregating different parts of the module.
|
||||
|
||||
The building of forms is split into different subforms, where each one is responsible for rendering their part of the form (aggregators, filters, and export).
|
||||
The building of forms is separated between different subform, which are responsible for rendering their part of the form (aggregators, filters, and export).
|
||||
|
||||
.. figure:: /_static/puml/exports/form_steps.png
|
||||
:scale: 40%
|
||||
@@ -194,12 +194,12 @@ The building of forms is split into different subforms, where each one is respon
|
||||
The formatter form step
|
||||
-----------------------
|
||||
|
||||
The formatter form is processed *after* the user filled the export form. It is built the same way, but receives the data entered by the user on the previous step as parameters (i.e. export form). It may then adapt it accordingly (example: show a list of columns selected in aggregators).
|
||||
The formatter form is processed *after* the user filled the export form. It is built the same way, but receive in parameters the data entered by the user on the previous step (i.e. export form). It may then adapt it accordingly (example: show a list of columns selected in aggregators).
|
||||
|
||||
Processing the export
|
||||
---------------------
|
||||
|
||||
The export process can be explained by this schema :
|
||||
The export process may be explained by this schema :
|
||||
|
||||
.. figure:: /_static/puml/exports/processing_export.png
|
||||
:scale: 40%
|
||||
@@ -219,20 +219,20 @@ This is an example of the ``CountPerson`` export :
|
||||
:language: php
|
||||
:linenos:
|
||||
|
||||
* **Line 36**: the ``getType`` function returns a string. This string will be used to find the aggregtors and filters which will apply to this export.
|
||||
* **Line 41**: a simple description to help users understand what your export does.
|
||||
* **Line 36**: the ``getType`` function return a string. This string will be used to find the aggregtors and filters which will apply to this export.
|
||||
* **Line 41**: a simple description to help user to understand what your export does.
|
||||
* **Line 46**: The title of the export. A summary of what your export does.
|
||||
* **Line 51**: The list of roles required to execute this export.
|
||||
* **Line 51**: The list of roles requires to execute this export.
|
||||
* **Line 56**: We initiate the query here...
|
||||
* **Line 59**: We have to filter the query with centers the users checked in the form. We process the $acl variable to get all ``Center`` objects in one array
|
||||
* **Line 63**: We create the query with a query builder.
|
||||
* **Line 74**: We return the result, but make sure to hydrate the results as an array.
|
||||
* **Line 103**: return the list of formatter types which are allowed to be applied on this filter
|
||||
* **Line 59**: We have to filter the query with centers the users checked in the form. We process the $acl variable to get all ``Center`` object in one array
|
||||
* **Line 63**: We create the query, with a query builder.
|
||||
* **Line 74**: We simply returns the result, but take care of hydrating the results as an array.
|
||||
* **Line 103**: return the list of formatters types which are allowed to apply on this filter
|
||||
|
||||
Filters
|
||||
-------
|
||||
|
||||
This is an example of the *filter by birthdate*. This filter asks some information through a form (`buildForm` is not empty), and this form must be validated. To perform this validation, we implement a new Interface: :class:`Chill\MainBundle\Export\ExportElementValidatedInterface`:
|
||||
This is an example of the *filter by birthdate*. This filter ask some information in a form (`buildForm` is not empty), and this form must be validated. To performs this validations, we implement a new Interface: :class:`Chill\MainBundle\Export\ExportElementValidatedInterface`:
|
||||
|
||||
.. literalinclude:: /_static/code/exports/BirthdateFilter.php
|
||||
:language: php
|
||||
@@ -242,129 +242,3 @@ This is an example of the *filter by birthdate*. This filter asks some informati
|
||||
Continue to explain the export framework
|
||||
|
||||
.. _main bundle: https://git.framasoft.org/Chill-project/Chill-Main
|
||||
|
||||
|
||||
With many-to-* relationship, why should we set WHERE clauses in an EXISTS subquery instead of a JOIN ?
|
||||
``````````````````````````````````````````````````````````````````````````````````````````````````````
|
||||
|
||||
As we described above, the doctrine builder is converted into a sql query. Let's see how to compute the "number of course
|
||||
which count at least one activity type with the id 7". For the purpose of this demonstration, we will restrict this on
|
||||
two accompanying period only: the ones with id 329 and 334.
|
||||
|
||||
Let's see the list of activities associated with those accompanying period:
|
||||
|
||||
.. code-block:: sql
|
||||
|
||||
SELECT id, accompanyingperiod_id, type_id FROM activity WHERE accompanyingperiod_id IN (329, 334) AND type_id = 7
|
||||
ORDER BY accompanyingperiod_id;
|
||||
|
||||
We see that we have 6 activities for the accompanying period with id 329, and only one for the 334's one.
|
||||
|
||||
.. csv-table::
|
||||
:header: id, accompanyingperiod_id, type_id
|
||||
|
||||
990,329,7
|
||||
986,329,7
|
||||
987,329,7
|
||||
993,329,7
|
||||
991,329,7
|
||||
992,329,7
|
||||
1000,334,7
|
||||
|
||||
Let's calculate the average duration for those accompanying periods, and the number of period:
|
||||
|
||||
.. code-block:: sql
|
||||
|
||||
SELECT AVG(age(COALESCE(closingdate, CURRENT_DATE), openingdate)), COUNT(id) from chill_person_accompanying_period WHERE id IN (329, 334);
|
||||
|
||||
The result of this query is:
|
||||
|
||||
.. csv-table::
|
||||
:header: AVG, COUNT
|
||||
|
||||
2 years 2 mons 21 days 12 hours 0 mins 0.0 secs,2
|
||||
|
||||
Now, we count the number of accompanying period, adding a :code:`JOIN` clause which make a link to the :code:`activity` table, and add a :code:`WHERE` clause to keep
|
||||
only the accompanying period which contains the given activity type:
|
||||
|
||||
.. code-block:: sql
|
||||
|
||||
SELECT COUNT(chill_person_accompanying_period.id) from chill_person_accompanying_period
|
||||
JOIN activity ON chill_person_accompanying_period.id = activity.accompanyingperiod_id
|
||||
WHERE chill_person_accompanying_period.id IN (329, 334) AND activity.type_id = 7;
|
||||
|
||||
What are the results here ?
|
||||
|
||||
.. csv-table::
|
||||
:header: COUNT
|
||||
|
||||
7
|
||||
|
||||
:code:`7` ! Why this result ? Because the number of lines is duplicated for each activity. Let's see the list of rows which
|
||||
are taken into account for the computation:
|
||||
|
||||
.. code-block:: sql
|
||||
|
||||
SELECT chill_person_accompanying_period.id, activity.id from chill_person_accompanying_period
|
||||
JOIN activity ON chill_person_accompanying_period.id = activity.accompanyingperiod_id
|
||||
WHERE chill_person_accompanying_period.id IN (329, 334) AND activity.type_id = 7;
|
||||
|
||||
.. csv-table::
|
||||
:header: accompanyingperiod.id, activity.id
|
||||
|
||||
329,993
|
||||
334,1000
|
||||
329,987
|
||||
329,990
|
||||
329,991
|
||||
329,992
|
||||
329,986
|
||||
|
||||
For each activity, a row is created and, as we count the number of non-null :code:`accompanyingperiod.id` columns, we
|
||||
count one entry for each activity (actually, we count the number of activities).
|
||||
|
||||
So, let's use the :code:`DISTINCT` keyword to count only once the equal ids:
|
||||
|
||||
.. code-block::
|
||||
|
||||
SELECT COUNT(DISTINCT chill_person_accompanying_period.id) from chill_person_accompanying_period
|
||||
JOIN activity ON chill_person_accompanying_period.id = activity.accompanyingperiod_id
|
||||
WHERE chill_person_accompanying_period.id IN (329, 334) AND activity.type_id = 7;
|
||||
|
||||
Now, it works again...
|
||||
|
||||
.. csv-table::
|
||||
:header: COUNT
|
||||
|
||||
2
|
||||
|
||||
But, for the average duration, this won't work: the duration which are equals (because the :code:`openingdate` is the same and
|
||||
:code:`closingdate` is still :code:`NULL`, for instance) will be counted only once, which will give unexpected result.
|
||||
|
||||
The solution is to move the condition "having an activity with activity type with id 7" in a :code:`EXISTS` clause:
|
||||
|
||||
.. code-block:: sql
|
||||
|
||||
SELECT COUNT(chill_person_accompanying_period.id) from chill_person_accompanying_period
|
||||
WHERE chill_person_accompanying_period.id IN (329, 334) AND EXISTS (SELECT 1 FROM activity WHERE type_id = 7 AND accompanyingperiod_id = chill_person_accompanying_period.id);
|
||||
|
||||
The result is correct without :code:`DISTINCT` keyword:
|
||||
|
||||
.. csv-table::
|
||||
:header: COUNT
|
||||
|
||||
2
|
||||
|
||||
And we can now compute the average duration without fear:
|
||||
|
||||
.. code-block:: sql
|
||||
|
||||
SELECT AVG(age(COALESCE(closingdate, CURRENT_DATE), openingdate)) from chill_person_accompanying_period
|
||||
WHERE chill_person_accompanying_period.id IN (329, 334) AND EXISTS (SELECT 1 FROM activity WHERE type_id = 7 AND accompanyingperiod_id = chill_person_accompanying_period.id);
|
||||
|
||||
Give the result:
|
||||
|
||||
.. csv-table::
|
||||
:header: AVG
|
||||
|
||||
2 years 2 mons 21 days 12 hours 0 mins 0.0 secs
|
||||
|
@@ -9,14 +9,13 @@
|
||||
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::
|
||||
:maxdepth: 2
|
||||
|
||||
Instructions to create a new bundle <create-a-new-bundle.rst>
|
||||
CRUD (Create - Update - Delete) for one entity <crud.rst>
|
||||
Helpers for building a REST API <api.rst>
|
||||
Routing <routing.rst>
|
||||
Menus <menus.rst>
|
||||
Forms <forms.rst>
|
||||
@@ -34,10 +33,6 @@ As Chill relies on the `symfony <http://symfony.com>`_ framework, reading the fr
|
||||
Useful snippets <useful-snippets.rst>
|
||||
manual/index.rst
|
||||
Assets <assets.rst>
|
||||
Cron Jobs <cronjob.rst>
|
||||
Info about entities <entity-info.rst>
|
||||
Info about database (in French) <database-principles.rst>
|
||||
Developer FAQ <FAQ.rst>
|
||||
|
||||
Layout and UI
|
||||
**************
|
||||
|
@@ -7,8 +7,6 @@
|
||||
Free Documentation License".
|
||||
|
||||
|
||||
.. _pagination-ref:
|
||||
|
||||
Pagination
|
||||
##########
|
||||
|
||||
@@ -17,7 +15,7 @@ The Bundle :code:`Chill\MainBundle` provides a **Pagination** api which allow yo
|
||||
A simple example
|
||||
****************
|
||||
|
||||
In the controller, get the :code:`Chill\Main\Pagination\PaginatorFactory` from the `Container` and use this :code:`PaginatorFactory` to create a :code:`Paginator` instance.
|
||||
In the controller, get the :class:`Chill\Main\Pagination\PaginatorFactory` from the `Container` and use this :code:`PaginatorFactory` to create a :code:`Paginator` instance.
|
||||
|
||||
|
||||
.. literalinclude:: pagination/example.php
|
||||
@@ -28,11 +26,11 @@ Then, render the pagination using the dedicated twig function.
|
||||
|
||||
.. code-block:: html+twig
|
||||
|
||||
{% extends "@ChillPerson/Person/layout.html.twig" %}
|
||||
{% extends "ChillPersonBundle::layout.html.twig" %}
|
||||
|
||||
{% block title 'Item list'|trans %}
|
||||
|
||||
{% block content %}
|
||||
{% block personcontent %}
|
||||
|
||||
<table>
|
||||
|
||||
|
@@ -1,26 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @see https://www.champs-libres.coop/
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\MyBundle\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
|
||||
class example extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController
|
||||
class example extends Controller
|
||||
{
|
||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
||||
{
|
||||
}
|
||||
public function yourAction()
|
||||
{
|
||||
$em = $this->managerRegistry->getManager();
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
// first, get the number of total item are available
|
||||
$total = $em
|
||||
->createQuery('SELECT COUNT (item.id) FROM ChillMyBundle:Item item')
|
||||
|
@@ -6,8 +6,6 @@
|
||||
A copy of the license is included in the section entitled "GNU
|
||||
Free Documentation License".
|
||||
|
||||
.. _timelines:
|
||||
|
||||
Timelines
|
||||
*********
|
||||
|
||||
@@ -20,24 +18,24 @@ Concept
|
||||
From an user point of view
|
||||
--------------------------
|
||||
|
||||
Chill has two objectives :
|
||||
Chill has two objectives :
|
||||
|
||||
* make the administrative tasks more lightweight ;
|
||||
* help social workers to have all information they need to work
|
||||
|
||||
To reach this second objective, Chill provides a special view: **timeline**. On a timeline view, information is gathered and shown on a single page, from the most recent event to the oldest one.
|
||||
|
||||
The information gathered is linked to a *context*. This *context* may be, for instance :
|
||||
The information gathered is linked to a *context*. This *context* may be, for instance :
|
||||
|
||||
* a person : events linked to this person are shown on the page ;
|
||||
* a center: events linked to a center are shown. They may concern different peoples ;
|
||||
* ...
|
||||
* ...
|
||||
|
||||
In other word, the *context* is the kind of argument that will be used in the event's query.
|
||||
|
||||
Let us recall that only the data the user has allowed to see should be shown.
|
||||
|
||||
.. seealso::
|
||||
.. seealso::
|
||||
|
||||
`The issue where the subject was first discussed <https://redmine.champs-libres.coop/issues/224>`_
|
||||
|
||||
@@ -45,30 +43,30 @@ Let us recall that only the data the user has allowed to see should be shown.
|
||||
For developers
|
||||
--------------
|
||||
|
||||
The `Main` bundle provides interfaces and services to help to build timelines.
|
||||
The `Main` bundle provides interfaces and services to help to build timelines.
|
||||
|
||||
If a bundle wants to *push* information in a timeline, it should be create a service which implements `Chill\MainBundle\Timeline\TimelineProviderInterface`, and tag is with `chill.timeline` and arguments defining the supported context (you may use multiple `chill.timeline` tags in order to support multiple context with a single service/class).
|
||||
|
||||
If a bundle wants to provide a new context for a timeline, the service `chill.main.timeline_builder` will helps to gather timeline's services supporting the defined context, and run queries across the models.
|
||||
If a bundle wants to provide a new context for a timeline, the service `chill.main.timeline_builder` will helps to gather timeline's services supporting the defined context, and run queries across the models.
|
||||
|
||||
.. _understanding-queries :
|
||||
|
||||
Understanding queries
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Due to the fact that timelines should show only the X last events from Y differents tables, queries for a timeline may consume a lot of resources: at first on the database, and then on the ORM part, which will have to deserialize DB data to PHP classes, which may not be used if they are not part of the "last X events".
|
||||
Due to the fact that timelines should show only the X last events from Y differents tables, queries for a timeline may consume a lot of resources: at first on the database, and then on the ORM part, which will have to deserialize DB data to PHP classes, which may not be used if they are not part of the "last X events".
|
||||
|
||||
To avoid such load on database, the objects are queried in two steps :
|
||||
To avoid such load on database, the objects are queried in two steps :
|
||||
|
||||
1. An UNION request which gather the last X events, ordered by date. The data retrieved are the ID, the date, and a string key: a type. This type discriminates the data type.
|
||||
2. The PHP objects are queried by ID, the type helps the program to link id with the kind of objects.
|
||||
2. The PHP objects are queried by ID, the type helps the program to link id with the kind of objects.
|
||||
|
||||
Those methods should ensure that only X PHP objects will be gathered and build by the ORM.
|
||||
|
||||
What does the master timeline builder service ?
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
When the service `chill.main.timeline_builder` is instanciated, the service is informed of each service taggued with `chill.timeline` tags. Then,
|
||||
When the service `chill.main.timeline_builder` is instanciated, the service is informed of each service taggued with `chill.timeline` tags. Then,
|
||||
|
||||
1. The service build an UNION query by assembling column and tables names provided by the `fetchQuery` result ;
|
||||
2. The UNION query is run, the result contains an id and a type for each row (see :ref:`above <understanding-queries>`)
|
||||
@@ -86,7 +84,7 @@ To push events on a timeline :
|
||||
Implementing the TimelineProviderInterface
|
||||
------------------------------------------
|
||||
|
||||
The has the following signature :
|
||||
The has the following signature :
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
@@ -94,19 +92,19 @@ The has the following signature :
|
||||
|
||||
interface TimelineProviderInterface
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $context
|
||||
* @param mixed[] $args the argument to the context.
|
||||
* @return TimelineSingleQuery
|
||||
* @return string[]
|
||||
* @throw \LogicException if the context is not supported
|
||||
*/
|
||||
public function fetchQuery($context, array $args);
|
||||
|
||||
|
||||
/**
|
||||
* Indicate if the result type may be handled by the service
|
||||
*
|
||||
*
|
||||
* @param string $type the key present in the SELECT query
|
||||
* @return boolean
|
||||
*/
|
||||
@@ -115,42 +113,42 @@ The has the following signature :
|
||||
/**
|
||||
* fetch entities from db into an associative array. The keys **MUST BE**
|
||||
* the id
|
||||
*
|
||||
* All ids returned by all SELECT queries
|
||||
*
|
||||
* All ids returned by all SELECT queries
|
||||
* (@see TimeLineProviderInterface::fetchQuery) and with the type
|
||||
* supported by the provider (@see TimelineProviderInterface::supportsType)
|
||||
* will be passed as argument.
|
||||
*
|
||||
*
|
||||
* @param array $ids an array of id
|
||||
* @return mixed[] an associative array of entities, with id as key
|
||||
*/
|
||||
public function getEntities(array $ids);
|
||||
|
||||
|
||||
/**
|
||||
* return an associative array with argument to render the entity
|
||||
* in an html template, which will be included in the timeline page
|
||||
*
|
||||
*
|
||||
* The result must have the following key :
|
||||
*
|
||||
*
|
||||
* - `template` : the template FQDN
|
||||
* - `template_data`: the data required by the template
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
*
|
||||
* ```
|
||||
* array(
|
||||
* array(
|
||||
* 'template' => 'ChillMyBundle:timeline:template.html.twig',
|
||||
* 'template_data' => array(
|
||||
* 'accompanyingPeriod' => $entity,
|
||||
* 'person' => $args['person']
|
||||
* 'accompanyingPeriod' => $entity,
|
||||
* 'person' => $args['person']
|
||||
* )
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* `$context` and `$args` are defined by the bundle which will call the timeline
|
||||
* rendering.
|
||||
*
|
||||
* rendering.
|
||||
*
|
||||
* @param type $entity
|
||||
* @param type $context
|
||||
* @param array $args
|
||||
@@ -158,27 +156,29 @@ The has the following signature :
|
||||
* @throws \LogicException if the context is not supported
|
||||
*/
|
||||
public function getEntityTemplate($entity, $context, array $args);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
The `fetchQuery` function
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The fetchQuery function help to build the UNION query to gather events. This function should return an instance of :code:`TimelineSingleQuery`. For you convenience, this object may be build using an associative array with the following keys:
|
||||
The fetchQuery function help to build the UNION query to gather events. This function should return an associative array MUST have the following key :
|
||||
|
||||
* `id` : the name of the id column
|
||||
* `type`: a string to indicate the type
|
||||
* `date`: the name of the datetime column, used to order entities by date
|
||||
* `FROM`: the FROM clause. May contains JOIN instructions
|
||||
* `WHERE`: the WHERE clause;
|
||||
* `parameters`: the parameters to pass to the query
|
||||
* `FROM` (in capital) : the FROM clause. May contains JOIN instructions
|
||||
|
||||
The parameters should be replaced into the query by :code:`?`. They will be replaced into the query using prepared statements.
|
||||
Those key are optional:
|
||||
|
||||
* `WHERE` (in capital) : the WHERE clause.
|
||||
|
||||
Where relevant, the data must be quoted to avoid SQL injection.
|
||||
|
||||
`$context` and `$args` are defined by the bundle which will call the timeline rendering. You may use them to build a different query depending on this context.
|
||||
|
||||
For instance, if the context is `'person'`, the args will be this array :
|
||||
For instance, if the context is `'person'`, the args will be this array :
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
@@ -186,20 +186,11 @@ For instance, if the context is `'person'`, the args will be this array :
|
||||
'person' => $person //a \Chill\PersonBundle\Entity\Person entity
|
||||
);
|
||||
|
||||
For the context :code:`center`, the args will be:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
array(
|
||||
'centers' => [ ] // an array of \Chill\MainBundle\Entity\Center entities
|
||||
);
|
||||
|
||||
|
||||
You should find in the bundle documentation which contexts are arguments the bundle defines.
|
||||
|
||||
.. note::
|
||||
|
||||
We encourage to use `ClassMetaData` to define column names arguments. If you change your column names, changes will be reflected automatically during the execution of your code.
|
||||
We encourage to use `ClassMetaData` to define column names arguments. If you change your column names, changes will be reflected automatically during the execution of your code.
|
||||
|
||||
Example of an implementation :
|
||||
|
||||
@@ -208,22 +199,23 @@ Example of an implementation :
|
||||
namespace Chill\ReportBundle\Timeline;
|
||||
|
||||
use Chill\MainBundle\Timeline\TimelineProviderInterface;
|
||||
use Chill\MainBundle\Timeline\TimelineSingleQuery;
|
||||
use Doctrine\ORM\EntityManager;
|
||||
|
||||
/**
|
||||
* Provide report for inclusion in timeline
|
||||
*
|
||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||
* @author Champs Libres <info@champs-libres.coop>
|
||||
*/
|
||||
class TimelineReportProvider implements TimelineProviderInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @var EntityManager
|
||||
*/
|
||||
protected $em;
|
||||
|
||||
|
||||
public function __construct(EntityManager $em)
|
||||
{
|
||||
$this->em = $em;
|
||||
@@ -232,20 +224,19 @@ Example of an implementation :
|
||||
public function fetchQuery($context, array $args)
|
||||
{
|
||||
$this->checkContext($context);
|
||||
|
||||
|
||||
$metadata = $this->em->getClassMetadata('ChillReportBundle:Report');
|
||||
|
||||
return TimelineSingleQuery::fromArray([
|
||||
|
||||
return array(
|
||||
'id' => $metadata->getColumnName('id'),
|
||||
'type' => 'report',
|
||||
'date' => $metadata->getColumnName('date'),
|
||||
'FROM' => $metadata->getTableName(),
|
||||
'WHERE' => sprintf('%s = ?',
|
||||
'WHERE' => sprintf('%s = %d',
|
||||
$metadata
|
||||
->getAssociationMapping('person')['joinColumns'][0]['name'])
|
||||
)
|
||||
'parameters' => [ $args['person']->getId() ]
|
||||
]);
|
||||
->getAssociationMapping('person')['joinColumns'][0]['name'],
|
||||
$args['person']->getId())
|
||||
);
|
||||
}
|
||||
|
||||
//....
|
||||
@@ -256,11 +247,11 @@ Example of an implementation :
|
||||
The `supportsType` function
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This function indicate to the master `chill.main.timeline_builder` service (which orchestrate the build of UNION queries) that the service supports the type indicated in the result's array of the `fetchQuery` function.
|
||||
This function indicate to the master `chill.main.timeline_builder` service (which orchestrate the build of UNION queries) that the service supports the type indicated in the result's array of the `fetchQuery` function.
|
||||
|
||||
The implementation of our previous example will be :
|
||||
The implementation of our previous example will be :
|
||||
|
||||
.. code-block:: php
|
||||
.. code-block:: php
|
||||
|
||||
|
||||
namespace Chill\ReportBundle\Timeline;
|
||||
@@ -274,7 +265,7 @@ The implementation of our previous example will be :
|
||||
//...
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function supportsType($type)
|
||||
@@ -306,12 +297,12 @@ The results **must be** an array where the id given by the UNION query (remember
|
||||
{
|
||||
$reports = $this->em->getRepository('ChillReportBundle:Report')
|
||||
->findBy(array('id' => $ids));
|
||||
|
||||
|
||||
$result = array();
|
||||
foreach($reports as $report) {
|
||||
$result[$report->getId()] = $report;
|
||||
}
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -320,9 +311,9 @@ The results **must be** an array where the id given by the UNION query (remember
|
||||
The `getEntityTemplate` function
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This is where the master service will collect information to render the entity.
|
||||
This is where the master service will collect information to render the entity.
|
||||
|
||||
The result must be an associative array with :
|
||||
The result must be an associative array with :
|
||||
|
||||
- **template** is the FQDN of the template ;
|
||||
- **template_data** is an associative array where keys are the variables'names for this template, and values are the values.
|
||||
@@ -334,8 +325,8 @@ Example :
|
||||
array(
|
||||
'template' => 'ChillMyBundle:timeline:template.html.twig',
|
||||
'template_data' => array(
|
||||
'period' => $entity,
|
||||
'person' => $args['person']
|
||||
'period' => $entity,
|
||||
'person' => $args['person']
|
||||
)
|
||||
);
|
||||
|
||||
@@ -351,7 +342,7 @@ Create a timeline with his own context
|
||||
|
||||
You have to create a Controller which will execute the service `chill.main.timeline_builder`. Using the `Chill\MainBundle\Timeline\TimelineBuilder::getTimelineHTML` function, you will get an HTML representation of the timeline, which you may include with twig `raw` filter.
|
||||
|
||||
Example :
|
||||
Example :
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
|
@@ -1,14 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @see https://www.champs-libres.coop/
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\HealthBundle\Controller;
|
||||
|
||||
use Chill\HealthBundle\Security\Authorization\ConsultationVoter;
|
||||
@@ -16,11 +18,8 @@ use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
|
||||
class ConsultationController extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController
|
||||
class ConsultationController extends Controller
|
||||
{
|
||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
||||
{
|
||||
}
|
||||
/**
|
||||
* @param int $id personId
|
||||
*
|
||||
@@ -46,12 +45,12 @@ class ConsultationController extends \Symfony\Bundle\FrameworkBundle\Controller\
|
||||
|
||||
$circles = $authorizationHelper->getReachableCircles(
|
||||
$this->getUser(),
|
||||
ConsultationVoter::SEE,
|
||||
new Role(ConsultationVoter::SEE),
|
||||
$person->getCenter()
|
||||
);
|
||||
|
||||
// create a query which take circles into account
|
||||
$consultations = $this->managerRegistry->getManager()
|
||||
$consultations = $this->getDoctrine()->getManager()
|
||||
->createQuery('SELECT c FROM ChillHealthBundle:Consultation c '
|
||||
. 'WHERE c.patient = :person AND c.circle IN(:circles) '
|
||||
. 'ORDER BY c.date DESC')
|
||||
|
@@ -149,14 +149,14 @@ It proposes a new block :
|
||||
|
||||
* where to display the admin content
|
||||
|
||||
@ChillPersonBundle/Person/layout.html.twig
|
||||
ChillPersonBundle::layout.html.twig
|
||||
-----------------------------------
|
||||
|
||||
This layout extend `ChillMainBundle::layoutWithVerticalMenu.html.twig` add the person details in the block `top_banner`, set the menu `person` as the vertical menu.
|
||||
|
||||
It proposes 1 new block :
|
||||
|
||||
* content
|
||||
* personcontent
|
||||
|
||||
* where to display the information of the person
|
||||
|
||||
|
@@ -1,20 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @see https://www.champs-libres.coop/
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// Chill\MainBundle\DependencyInjection\Configuration.php
|
||||
|
||||
namespace Chill\MainBundle\DependencyInjection;
|
||||
|
||||
use Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
|
||||
/**
|
||||
* Configure the main bundle.
|
||||
@@ -23,18 +27,28 @@ class ChillMainConfiguration implements ConfigurationInterface
|
||||
{
|
||||
use AddWidgetConfigurationTrait;
|
||||
|
||||
/**
|
||||
* @var ContainerBuilder
|
||||
*/
|
||||
private $containerBuilder;
|
||||
|
||||
public function __construct(
|
||||
array $widgetFactories,
|
||||
private readonly ContainerBuilder $containerBuilder
|
||||
ContainerBuilder $containerBuilder
|
||||
) {
|
||||
// we register here widget factories (see below)
|
||||
$this->setWidgetFactories($widgetFactories);
|
||||
// we will need the container builder later...
|
||||
$this->containerBuilder = $containerBuilder;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getConfigTreeBuilder()
|
||||
{
|
||||
$treeBuilder = new TreeBuilder('chill_main');
|
||||
$rootNode = $treeBuilder->getRootNode();
|
||||
$treeBuilder = new TreeBuilder();
|
||||
$rootNode = $treeBuilder->root('chill_main');
|
||||
|
||||
$rootNode
|
||||
->children()
|
||||
@@ -49,7 +63,7 @@ class ChillMainConfiguration implements ConfigurationInterface
|
||||
->end() // end of widgets
|
||||
->end() // end of root/children
|
||||
->end() // end of root
|
||||
;
|
||||
;
|
||||
|
||||
return $treeBuilder;
|
||||
}
|
||||
|
@@ -1,14 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @see https://www.champs-libres.coop/
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
//Chill\MainBundle\DependencyInjection\ChillMainExtension.php
|
||||
|
||||
namespace Chill\MainBundle\DependencyInjection;
|
||||
|
||||
use Chill\MainBundle\DependencyInjection\Widget\Factory\WidgetFactoryInterface;
|
||||
|
@@ -1,14 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @see https://www.champs-libres.coop/
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// Chill/PersonBundle/Widget/PersonListWidgetFactory
|
||||
|
||||
namespace Chill\PersonBundle\Widget;
|
||||
|
||||
use Chill\MainBundle\DependencyInjection\Widget\Factory\AbstractWidgetFactory;
|
||||
|
@@ -1,14 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @see https://www.champs-libres.coop/
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// Chill/PersonBundle/Widget/PersonListWidget.php
|
||||
|
||||
namespace Chill\PersonBundle\Widget;
|
||||
|
||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||
@@ -87,7 +91,7 @@ class ChillPersonAddAPersonWidget implements WidgetInterface
|
||||
// show only the person from the authorized centers
|
||||
$and = $qb->expr()->andX();
|
||||
$centers = $this->authorizationHelper
|
||||
->getReachableCenters($this->getUser(), PersonVoter::SEE);
|
||||
->getReachableCenters($this->getUser(), new Role(PersonVoter::SEE));
|
||||
$and->add($qb->expr()->in('person.center', ':centers'));
|
||||
$qb->setParameter('centers', $centers);
|
||||
|
||||
|
@@ -1,14 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @see https://www.champs-libres.coop/
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// Chill/PersonBundle/DependencyInjection/ChillPersonExtension.php
|
||||
|
||||
namespace Chill\PersonBundle\DependencyInjection;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
@@ -22,6 +26,9 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
*/
|
||||
class ChillPersonExtension extends Extension implements PrependExtensionInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load(array $configs, ContainerBuilder $container)
|
||||
{
|
||||
// ...
|
||||
|
@@ -15,362 +15,245 @@ Installation & Usage
|
||||
####################
|
||||
|
||||
|
||||
You will learn here how to install a new symfony project with chill, and configure it.
|
||||
|
||||
Requirements
|
||||
============
|
||||
|
||||
The installation is tested on a Debian-like linux distribution. The installation on other operating systems is not documented.
|
||||
|
||||
You have to install the following tools on your computer:
|
||||
|
||||
- `PHP <https://www.php.net/>`_, version 8.3+, with the following extensions: pdo_pgsql, intl, mbstring, zip, bcmath, exif, sockets, redis, ast, gd;
|
||||
- `composer <https://getcomposer.org/>`_;
|
||||
- `symfony cli <https://symfony.com/download>`_;
|
||||
- `node, we encourage you to use nvm to configure the correct version <https://github.com/nvm-sh/nvm>`_. The project contains an
|
||||
:code:`.nvmrc` file which selects automatically the required version of node (if present).
|
||||
- `yarn <https://classic.yarnpkg.com/lang/en/docs/install/>`_. We use the version 1.22+ for now.
|
||||
- `docker and the plugin compose <https://docker.com>`_ to run the database
|
||||
|
||||
Chill needs a redis server and a postgresql database, and a few other things like a "relatorio service" which will
|
||||
generate documents from templates. **All these things are available through docker using the plugin compose**. We do not provide
|
||||
information on how to run this without docker compose.
|
||||
|
||||
|
||||
Install a new project
|
||||
=====================
|
||||
|
||||
Initialize project and dependencies
|
||||
***********************************
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
symfony new --version=5.4 my_chill_project
|
||||
cd my_chill_project
|
||||
|
||||
We strongly encourage you to initialize a git repository at this step, to track further changes.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# add the flex endpoints required for custom recipes
|
||||
cat <<< "$(jq '.extra.symfony += {"endpoint": ["flex://defaults", "https://gitlab.com/api/v4/projects/57371968/repository/files/index.json/raw?ref=main"]}' composer.json)" > composer.json
|
||||
# install chill and some dependencies
|
||||
# TODO fix the suffix "alpha1" and replace by ^3.0.0 when version 3.0.0 will be released
|
||||
symfony composer require chill-project/chill-bundles v3.0.0-RC3 champs-libres/wopi-lib dev-master@dev champs-libres/wopi-bundle dev-master@dev
|
||||
|
||||
We encourage you to accept the inclusion of the "Docker configuration from recipes": this is the documented way to run the database.
|
||||
You must also accept to configure recipes from the contrib repository, unless you want to configure the bundles manually).
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# fix some configuration
|
||||
./post-install-chill.sh
|
||||
# install node dependencies
|
||||
yarn install
|
||||
# and compile assets
|
||||
yarn run encore production
|
||||
|
||||
.. note::
|
||||
|
||||
If you encounter this error during assets compilation (:code:`yarn run encore production`) (repeated multiple times):
|
||||
|
||||
.. code-block:: txt
|
||||
|
||||
[tsl] ERROR in /tmp/chill/v1/public/bundles/chillcalendar/types.ts(2,65)
|
||||
TS2307: Cannot find module '../../../ChillMainBundle/Resources/public/types' or its corresponding type declarations.
|
||||
|
||||
run:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
rm -rf public/bundles/*
|
||||
|
||||
Then restart the compilation of assets (:code:```yarn run encore production```)
|
||||
|
||||
Configure your project
|
||||
**********************
|
||||
|
||||
You should read the configuration files in :code:`chill/config/packages` carefully, especially if you have
|
||||
custom developments. But most of the time, this should be fine.
|
||||
|
||||
You have to configure some local variables, which are described in the :code:`.env` file. The secrets should not be stored
|
||||
in this :code:`.env` file, but instead using the `secrets management tool <https://symfony.com/doc/current/configuration/secrets.html>`_
|
||||
or in the :code:`.env.local` file, which should not be committed to the git repository.
|
||||
|
||||
You do not need to set variables for the smtp server, redis server and relatorio server, as they are generated automatically
|
||||
by the symfony server, from the docker compose services.
|
||||
|
||||
The only required variable is the :code:`ADMIN_PASSWORD`. You can generate a hashed and salted admin password using the command
|
||||
:code:`symfony console security:hash-password <your password> 'Symfony\Component\Security\Core\User\User'`. Then,
|
||||
you can either:
|
||||
|
||||
- add this password to the :code:`.env.local` file, you must escape the character :code:`$`: if the generated password
|
||||
is :code:`$2y$13$iyvJLuT4YEa6iWXyQV4/N.hNHpNG8kXlYDkkt5MkYy4FXcSwYAwmm`, your :code:`.env.local` file will be:
|
||||
|
||||
.. code-block:: env
|
||||
|
||||
ADMIN_PASSWORD=\$2y\$13\$iyvJLuT4YEa6iWXyQV4/N.hNHpNG8kXlYDkkt5MkYy4FXcSwYAwmm
|
||||
# note: if you copy-paste the line above, the password will be "admin".
|
||||
|
||||
- add the generated password to the secrets manager (**note**: you must add the generated hashed password to the secrets env,
|
||||
not the password in clear text).
|
||||
|
||||
- set up the jwt authentication bundle
|
||||
|
||||
Some environment variables are available for the JWT authentication bundle in the :code:`.env` file.
|
||||
|
||||
Prepare migrations and other tools
|
||||
**********************************
|
||||
|
||||
To continue the installation process, you will have to run migrations:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# start databases and other services
|
||||
docker compose up -d
|
||||
# the first start, it may last some seconds, you can check with docker compose ps
|
||||
# run migrations
|
||||
symfony console doctrine:migrations:migrate
|
||||
# setup messenger
|
||||
symfony console messenger:setup-transports
|
||||
# prepare some views
|
||||
symfony console chill:db:sync-views
|
||||
# generate jwt token, required for some api features (webdav access, ...)
|
||||
symfony console lexik:jwt:generate-keypair
|
||||
|
||||
.. warning::
|
||||
|
||||
If you encounter an error while running :code:`symfony console messenger:setup-transports`, you can set up the messenger
|
||||
transport to redis, by adding this in the :code:`.env.local` or :code:`.env` file:
|
||||
|
||||
.. code-block:: env
|
||||
|
||||
MESSENGER_TRANSPORT_DSN=redis://${REDIS_HOST}:${REDIS_PORT}/messages
|
||||
|
||||
Start your web server locally
|
||||
*****************************
|
||||
|
||||
At this step, Chill will be ready to be served locally, but without any configuration. You can run the project
|
||||
locally using the `local symfony server <https://symfony.com/doc/current/setup/symfony_server.html>`_:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# see the whole possibilities at https://symfony.com/doc/current/setup/symfony_server.html
|
||||
symfony server:start -d
|
||||
|
||||
|
||||
If you need to test the instance with accounts and some basic configuration, please install the fixtures (see below).
|
||||
|
||||
|
||||
Add capabilities for dev
|
||||
========================
|
||||
|
||||
If you need to add custom bundles, you can develop them in the `src/` directory, like for any other symfony project. You
|
||||
can rely on the whole chill framework, meaning there is no need to add them to the original `chill-bundles`.
|
||||
|
||||
You will require some bundles to have the following development tools:
|
||||
|
||||
- add fixtures
|
||||
- add profiler and debug bundle
|
||||
|
||||
Install fixtures
|
||||
****************
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# generate fixtures for chill
|
||||
symfony composer require --dev doctrine/doctrine-fixtures-bundle nelmio/alice
|
||||
# now, you can generate fixtures (this will reset your database)
|
||||
symfony console doctrine:fixtures:load
|
||||
|
||||
This will generate user accounts, centers, and some basic configuration.
|
||||
|
||||
The accounts created are: :code:`center a_social`, :code:`center b_social`, :code:`center a_direction`, ... The full list is
|
||||
visible in the "users" table: :code:`docker compose exec database psql -U app -c "SELECT username FROM users"`.
|
||||
|
||||
The password is always :code:`password`.
|
||||
|
||||
.. warning::
|
||||
|
||||
The fixtures are not fully functional. See the `corresponding issue <https://gitlab.com/Chill-Projet/chill-bundles/-/issues/280>`_.
|
||||
|
||||
Add web profiler and debugger
|
||||
*****************************
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
symfony composer require --dev symfony/web-profiler-bundle symfony/debug-bundle
|
||||
|
||||
Working on chill bundles
|
||||
************************
|
||||
|
||||
If you plan to improve the chill-bundles repository, that's great!
|
||||
|
||||
You will have to download chill-bundles as a git repository (and not as an archive, which is barely editable).
|
||||
|
||||
In your :code:`composer.json` file, add these lines:
|
||||
|
||||
.. code-block:: diff
|
||||
|
||||
{
|
||||
"config": {
|
||||
+ "preferred-install": {
|
||||
+ "chill-project/chill-bundles": "source",
|
||||
"*": "dist"
|
||||
+ }
|
||||
}
|
||||
|
||||
Then, run :code:`symfony composer reinstall chill-project/chill-bundles` to re-install the package from source.
|
||||
|
||||
Code style, code quality and other tools
|
||||
****************************************
|
||||
|
||||
For development, you will also have to install:
|
||||
|
||||
- `php-cs-fixer <https://cs.symfony.com/>`_
|
||||
|
||||
We also encourage you to use tools like `phpstan <https://phpstan.org>`_ and `rector <https://getrector.com>`_.
|
||||
|
||||
Commit and share your project
|
||||
=============================
|
||||
|
||||
If multiple developers work on a project, you can commit your symfony project and share it with other people.
|
||||
|
||||
When another developer clones your project, they will have to:
|
||||
|
||||
- run :code:`symfony composer install` and :code:`yarn install` to install the same dependencies as the initial developer;
|
||||
- run :code:`yarn run encore production` to compile assets;
|
||||
- copy any possible variables from the :code:`.env.local` files;
|
||||
- start the docker compose stack, using :code:`docker compose`, and run migrations, set up transports, and prepare chill db views
|
||||
(see the corresponding command above)
|
||||
|
||||
Update
|
||||
======
|
||||
|
||||
In order to update your app, you must update dependencies:
|
||||
|
||||
- for chill-bundles, you can `set the last version <https://gitlab.com/Chill-Projet/chill-bundles/-/releases>`_ manually
|
||||
in the :code:`composer.json` file, or set the version to `^3.0.0` and run :code:`symfony composer update` regularly
|
||||
- run :code:`composer update` and :code:`yarn update` to maintain your dependencies up-to-date.
|
||||
|
||||
After each update, you must update your database schema:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
symfony console doctrine:migrations:migrate
|
||||
symfony console chill:db:sync-views
|
||||
|
||||
Operations
|
||||
==========
|
||||
|
||||
Build assets
|
||||
************
|
||||
|
||||
run those commands:
|
||||
- This project use `docker <https://docker.com>`_ to be run. As a developer, use `docker-compose <https://docs.docker.com/compose/overview/>`_ to bootstrap a dev environment in a glance. You do not need any other dependencies ;
|
||||
- Make is used to automate scripts.
|
||||
|
||||
Installation in development mode
|
||||
********************************
|
||||
|
||||
1. Get the code
|
||||
===============
|
||||
|
||||
Clone or download the chill-app project and `cd` into the main directory.
|
||||
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# for production (or in dev, when you don't need to work on your assets and need some speed)
|
||||
yarn run encore production
|
||||
# in dev, when you wan't to reload the assets on each changes
|
||||
yarn run encore dev --watch
|
||||
git clone https://gitlab.com/Chill-Projet/chill-app.git
|
||||
cd chill-app
|
||||
|
||||
|
||||
As a developer, the code will stay on your computer and will be executed in docker container. To avoid permission problem, the code should be run with the same uid/gid from your current user. This is why we get your current user id with the command ``id -u`` in each following scripts.
|
||||
|
||||
2. Prepare your variables
|
||||
=========================
|
||||
|
||||
Have a look at the variable in ``.env.dist`` and in ``app/config/parameters.yml.dist`` and check if you need to adapt them. If they do not adapt with your need, or if some are missing:
|
||||
|
||||
1. copy the file as ``.env``: ``cp .env.dist .env``
|
||||
2. you may replace some variables inside ``.env``
|
||||
|
||||
**Note**: If you intend to use the bundle ``Chill-Doc-Store``, you will need to configure and install an openstack object storage container with temporary url middleware. You will have to configure `secret keys <https://docs.openstack.org/swift/latest/api/temporary_url_middleware.html#secret-keys>`_.
|
||||
|
||||
3. Run the bootstrap script
|
||||
===========================
|
||||
|
||||
This script can be run using `make`
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
make init
|
||||
|
||||
This script will :
|
||||
|
||||
1. force docker-compose to, eventually, pull the base images and build the image used by this project ;
|
||||
2. run an install script to download `composer <https://getcomposer.org>`_ ;
|
||||
3. install the php dependencies
|
||||
4. build assets
|
||||
|
||||
|
||||
4. Start the project
|
||||
====================
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
docker-compose up
|
||||
|
||||
**On the first run** (and after each upgrade), you must execute *post update commands* and run database migrations. With a container up and running, execute the following commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
make migrate
|
||||
|
||||
Chill will be available at ``http://localhost:8001.`` Currently, there isn't any user or data. To add fixtures, run
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
docker-compose exec --user $(id -u) php bin/console doctrine:fixtures:load
|
||||
|
||||
There are several users available:
|
||||
|
||||
- ``center a_social``
|
||||
- ``center b_social``
|
||||
|
||||
The password is always ``password``.
|
||||
|
||||
Now, read `Operations` below.
|
||||
|
||||
Operations
|
||||
**********
|
||||
|
||||
Build assets
|
||||
============
|
||||
|
||||
run those commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
make build-assets
|
||||
|
||||
How to execute the console ?
|
||||
****************************
|
||||
============================
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# start the console with all required variables
|
||||
symfony console
|
||||
# you can add your command after that:
|
||||
symfony console list
|
||||
# if a container is running
|
||||
docker-compose exec --user $(id -u) php bin/console
|
||||
# if not
|
||||
docker-compose run --user $(id -u) php bin/console
|
||||
|
||||
How to generate documents
|
||||
*************************
|
||||
|
||||
Documents are generated asynchronously by `"consuming messages" <https://symfony.com/doc/current/messenger.html#consuming-messages-running-the-worker>`_.
|
||||
|
||||
You must generate them using a dedicated process:
|
||||
How to create the database schema (= run migrations) ?
|
||||
======================================================
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
symfony console messenger:consume async priority
|
||||
# if a container is running
|
||||
docker-compose exec --user $(id -u) php bin/console doctrine:migrations:migrate
|
||||
# if not
|
||||
docker-compose run --user $(id -u) php bin/console doctrine:migrations:migrate
|
||||
|
||||
To avoid memory issues, we encourage you to also use the :code:`--limit` parameter of the command.
|
||||
|
||||
How to read emails sent by the program ?
|
||||
*******************************************
|
||||
How to read the email sent by the program ?
|
||||
===========================================
|
||||
|
||||
In development, there is a built-in "mail catcher". Open it with :code:`symfony open:local:webmail`
|
||||
Go at ``http://localhost:8005`` and you should have access to mailcatcher.
|
||||
|
||||
How to run cron-jobs ?
|
||||
**********************
|
||||
In case of you should click on a link in the email, be aware that you should remove the "s" from https.
|
||||
|
||||
Some commands must be executed in :ref:`cron jobs <cronjob>`. To execute them:
|
||||
How to load fixtures ? (development mode only)
|
||||
==============================================
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
symfony console chill:cron-job:execute
|
||||
# if a container is running
|
||||
docker-compose exec --user $(id -u) php bin/console doctrine:fixtures:load
|
||||
# if not
|
||||
docker-compose run --user $(id -u) php bin/console doctrine:fixtures:load
|
||||
|
||||
What about materialized views ?
|
||||
*******************************
|
||||
How to open a terminal in the project
|
||||
=====================================
|
||||
|
||||
There are some materialized views in chill, to speed up some complex computations in the database.
|
||||
.. code-block:: bash
|
||||
|
||||
In order to refresh them, run a cron job or refresh them manually in your database.
|
||||
# if a container is running
|
||||
docker-compose exec --user $(id -u) php /bin/bash
|
||||
# if not
|
||||
docker-compose run --user $(id -u) php /bin/bash
|
||||
|
||||
How to run tests for chill-bundles
|
||||
**********************************
|
||||
How to run composer ?
|
||||
=====================
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# if a container is running
|
||||
docker-compose exec --user $(id -u) php ./composer.phar
|
||||
# if not
|
||||
docker-compose run --user $(id -u) php ./composer.phar
|
||||
|
||||
How to access to PGADMIN ?
|
||||
==========================
|
||||
|
||||
Pgadmin is installed with docker-compose.
|
||||
|
||||
You can access it at ``http://localhost:8002``.
|
||||
|
||||
Credentials:
|
||||
|
||||
- login: admin@chill.social
|
||||
- password: password
|
||||
|
||||
How to run tests ?
|
||||
==================
|
||||
|
||||
Tests reside inside the installed bundles. You must `cd` into that directory, download the required packages, and execute them from this place.
|
||||
|
||||
**Note**: some bundles require the fixtures to be executed. See the dedicated _how-tos_.
|
||||
**Note**: some bundle require the fixture to be executed. See the dedicated _how-tos_.
|
||||
|
||||
Example, for running a unit test inside `main` bundle:
|
||||
Exemple, for running test inside `main` bundle:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# mount into the php image
|
||||
docker-compose run --user $(id -u) php /bin/bash
|
||||
# cd into main directory
|
||||
cd vendor/chill-project/chill-bundles
|
||||
composer install
|
||||
cd vendor/chill-project/main
|
||||
# download deps
|
||||
php ../../../composer.phar install
|
||||
# run tests
|
||||
bin/phpunit src/Bundle/path/to/your/test
|
||||
/vendor/bin/phpunit
|
||||
|
||||
Or for running tests to check code style and php conventions with csfixer and phpstan:
|
||||
How to run webpack interactively
|
||||
================================
|
||||
|
||||
Troubleshooting
|
||||
===============
|
||||
Executing :code:`bash docker-node.sh` will open a terminal in a node container, with volumes mounted.
|
||||
|
||||
Build the documentation API
|
||||
===========================
|
||||
|
||||
A basic configuration of `sami <https://github.com/FriendsOfPhp/Sami>`_ is embedded within the project.
|
||||
|
||||
A configuration file for `phpDocumentor <https://www.phpdoc.org>`_ is present.
|
||||
|
||||
Error `An exception has been thrown during the rendering of a template ("Asset manifest file "/var/www/app/web/build/manifest.json" does not exist.").` on first run
|
||||
********************************************************************************************************************************************************************
|
||||
====================================================================================================================================================================
|
||||
|
||||
Build assets, see above.
|
||||
Run :code:`make build-assets`
|
||||
|
||||
Running in production
|
||||
=====================
|
||||
*********************
|
||||
|
||||
Currently, to run this software in production, the *state of the art* is the following :
|
||||
|
||||
1. Run the software locally and tweak the configuration to your needs ;
|
||||
2. Build the image and store it in a private container registry.
|
||||
2. Build the image and store them into a private container registry. This can be done using :code:`make build-and-push-image`.
|
||||
|
||||
To be sure to target the correct container registry, you have to adapt the values ``IMAGE_NGINX`` and ``IMAGE_PHP`` date in the ``.env`` file.
|
||||
3. Run the image on your production server, using docker-compose or eventually docker stack. You have to customize the variable set in docker-compose.
|
||||
|
||||
See also the :ref:`running-production-tips-and-tricks` below.
|
||||
|
||||
.. warning::
|
||||
|
||||
In production, you **must** set these variables:
|
||||
In production, you **must** set those variables:
|
||||
|
||||
* ``APP_ENV`` to ``prod``
|
||||
* ``APP_DEBUG`` to ``false``
|
||||
|
||||
There are security issues if you keep the same variables as for production.
|
||||
There are security issues if you keep the same variable than for production.
|
||||
|
||||
|
||||
Going further
|
||||
=============
|
||||
.. _running-production-tips-and-tricks:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
Tips and tricks
|
||||
===============
|
||||
|
||||
Operation on database (backups, running custom sql, replication) are easier to set when run outside of a container. If you run into a container, take care of the volume where data are stored.
|
||||
|
||||
The PHP sessions are stored inside redis. This is useful if you distribute the traffic amongst different php server: they will share same sessions if a request goes into a different instance of the container.
|
||||
|
||||
When the PHP servers are shared across multiple instances, take care that some data is stored into redis: the same redis server should be reachable by all instances.
|
||||
|
||||
It is worth having an eye on the configuration of logstash container.
|
||||
|
||||
|
||||
Design principles
|
||||
*****************
|
||||
|
||||
Why the DB URL is set in environment, and not in parameters.yml ?
|
||||
=================================================================
|
||||
|
||||
Because, at startup, a script does check the db is up and, if not, wait for a couple of seconds before running ``entrypoint.sh``. For avoiding double configuration, the configuration of the PHP app takes his configuration from environment also (and it will be standard in future releases, with symfony 4.0).
|
||||
|
||||
prod.rst
|
||||
load-addresses.rst
|
||||
prod-calendar-sms-sending.rst
|
||||
msgraph-configure.rst
|
||||
|
@@ -1,60 +0,0 @@
|
||||
|
||||
.. _addresses:
|
||||
|
||||
Addresses
|
||||
*********
|
||||
|
||||
Chill can store a list of geolocated address references, which are used to suggest address and ensure that the data is correctly stored.
|
||||
|
||||
Those addresses may be load from a dedicated source.
|
||||
|
||||
Countries
|
||||
=========
|
||||
|
||||
In order to load addresses into the chill application we first have to make sure that a list of countries is present.
|
||||
To import the countries run the following command.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
bin/console chill:main:countries:populate
|
||||
|
||||
In France
|
||||
=========
|
||||
|
||||
The address are loaded from the `BANO <https://bano.openstreetmap.fr/>`_. The postal codes are loaded from `the official list of
|
||||
postal codes <https://datanova.laposte.fr/explore/dataset/laposte_hexasmal/information/>`_
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# first, load postal codes
|
||||
bin/console chill:main:postal-code:load:FR
|
||||
# then, load all addresses, by departement (multiple departement can be loaded by repeating the departement code
|
||||
bin/console chill:main:address-ref-from-bano 57 54 51
|
||||
|
||||
In Belgium
|
||||
==========
|
||||
|
||||
Addresses are prepared from the `BeST Address data <https://www.geo.be/catalog/details/ca0fd5c0-8146-11e9-9012-482ae30f98d9>`_.
|
||||
|
||||
Postal code are loaded from this database. There is no need to load postal codes from another source (actually, this is strongly discouraged).
|
||||
|
||||
The data are prepared for Chill (`See this repository <https://gitea.champs-libres.be/Chill-project/belgian-bestaddresses-transform/releases>`_).
|
||||
One can select postal code by his first number (:code:`1xxx` for postal codes from 1000 to 1999), or a limited list for development purpose.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# load postal code from 1000 to 3999:
|
||||
bin/console chill:main:address-ref-from-best-addresse 1xxx 2xxx 3xxx
|
||||
|
||||
# load only an extract (for dev purposes)
|
||||
bin/console chill:main:address-ref-from-best-addresse extract
|
||||
|
||||
# load full addresses (discouraged)
|
||||
bin/console chill:main:address-ref-from-best-addresse full
|
||||
|
||||
.. note::
|
||||
|
||||
There is a possibility to load the full list of addresses is discouraged: the loading is optimized with smaller extracts.
|
||||
|
||||
Once you load the full list, it is not possible to load smaller extract: each extract loaded **after** will not
|
||||
delete the addresses loaded with the full extract (and some addresses will be present twice).
|
@@ -1,330 +0,0 @@
|
||||
|
||||
Configure Chill for calendar and absence synchronisation and SSO with Microsoft Graph (Outlook)
|
||||
===============================================================================================
|
||||
|
||||
Chill offers the possibility to:
|
||||
|
||||
* authenticate users using Microsoft Graph, with relatively small adaptations;
|
||||
* synchronize calendar in both ways (`see the user manual for a large description of the feature <https://gitea.champs-libres.be/Chill-project/manuals>`_).
|
||||
|
||||
Both can be configured separately (synchronising calendars without SSO, or SSO without calendar).
|
||||
|
||||
Please note that the user's email address is the key to associate Chill's users with Microsoft's ones.
|
||||
|
||||
Configure SSO
|
||||
-------------
|
||||
|
||||
On Azure side
|
||||
*************
|
||||
|
||||
Configure an app with the Azure interface, and give it the name of your choice.
|
||||
|
||||
Grab the tenant's ID for your app, which is visible on the main tab "Vue d'ensemble":
|
||||
|
||||
.. figure:: ./saml_login_id_general.png
|
||||
|
||||
This the variable which will be named :code:`SAML_IDP_APP_UUID`.
|
||||
|
||||
Go to the "Single sign-on" ("Authentication unique") section. Choose "SAML" as protocol, and fill those values:
|
||||
|
||||
.. figure:: ./saml_login_1.png
|
||||
|
||||
1. The :code:`entityId` seems to be arbitrary. This will be your variable :code:`SAML_ENTITY_ID`;
|
||||
2. The url response must be your Chill's URL appended by :code:`/saml/acs`
|
||||
3. The only used attributes is :code:`emailaddress`, which must match the user's email one.
|
||||
|
||||
.. figure:: ./saml_login_2.png
|
||||
|
||||
You must download the certificate, as base64. The format for the download is :code:`cer`: you will remove the first and last line (the ones with :code:`-----BEGIN CERTIFICATE-----` and :code:`-----END CERTIFICATE-----`), and remove all the return line. The final result should be something as :code:`MIIAbcdef...XyZA=`.
|
||||
|
||||
This certificat will be your :code:`SAML_IDP_X509_CERT` variable.
|
||||
|
||||
The url login will be filled automatically with your tenant id.
|
||||
|
||||
Do not forget to provider user's accesses to your app, using the "Utilisateurs et groupes" tab:
|
||||
|
||||
.. figure:: ./saml_login_appro.png
|
||||
|
||||
|
||||
You must know have gathered all the required variables for SSO:
|
||||
|
||||
.. code-block::
|
||||
|
||||
SAML_BASE_URL=https://test.chill.be # must be
|
||||
SAML_ENTITY_ID=https://test.chill.be # must match the one entered
|
||||
SAML_IDP_APP_UUID=42XXXXXX-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
SAML_IDP_X509_CERT: MIIC...E8u3bk # truncated
|
||||
|
||||
Configure chill app
|
||||
*******************
|
||||
|
||||
* add the bundle :code:`hslavich/oneloginsaml-bundle`
|
||||
* add the configuration file (see example above)
|
||||
* configure the security part (see example above)
|
||||
* add a user SAML factory into your src, and register it
|
||||
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# config/packages/hslavich_onelogin.yaml
|
||||
|
||||
parameters:
|
||||
saml_base_url: '%env(resolve:SAML_BASE_URL)%'
|
||||
saml_entity_id: '%env(resolve:SAML_ENTITY_ID)%'
|
||||
saml_idp_x509cert: '%env(resolve:SAML_IDP_X509_CERT)%'
|
||||
saml_idp_app_uuid: '%env(resolve:SAML_IDP_APP_UUID)%'
|
||||
|
||||
|
||||
hslavich_onelogin_saml:
|
||||
# Basic settings
|
||||
idp:
|
||||
entityId: 'https://sts.windows.net/%saml_idp_app_uuid%/'
|
||||
singleSignOnService:
|
||||
url: 'https://login.microsoftonline.com/%saml_idp_app_uuid%/saml2'
|
||||
binding: 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'
|
||||
singleLogoutService:
|
||||
url: 'https://login.microsoftonline.com/%saml_idp_app_uuid%/saml2'
|
||||
binding: 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'
|
||||
x509cert: '%saml_idp_x509cert%'
|
||||
sp:
|
||||
entityId: '%saml_entity_id%'
|
||||
assertionConsumerService:
|
||||
url: '%saml_base_url%/saml/acs'
|
||||
binding: 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST'
|
||||
singleLogoutService:
|
||||
url: '%saml_base_url%/saml/'
|
||||
binding: 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect'
|
||||
privateKey: ''
|
||||
# Optional settings.
|
||||
baseurl: '%saml_base_url%/saml'
|
||||
strict: true
|
||||
debug: true
|
||||
security:
|
||||
nameIdEncrypted: false
|
||||
authnRequestsSigned: false
|
||||
logoutRequestSigned: false
|
||||
logoutResponseSigned: false
|
||||
wantMessagesSigned: false
|
||||
wantAssertionsSigned: false
|
||||
wantNameIdEncrypted: false
|
||||
requestedAuthnContext: true
|
||||
signMetadata: false
|
||||
wantXMLValidation: true
|
||||
signatureAlgorithm: 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'
|
||||
digestAlgorithm: 'http://www.w3.org/2001/04/xmlenc#sha256'
|
||||
contactPerson:
|
||||
technical:
|
||||
givenName: 'Tech User'
|
||||
emailAddress: 'techuser@example.com'
|
||||
support:
|
||||
givenName: 'Support User'
|
||||
emailAddress: 'supportuser@example.com'
|
||||
organization:
|
||||
en:
|
||||
name: 'Example'
|
||||
displayname: 'Example'
|
||||
url: 'http://example.com'
|
||||
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# config/security.yaml
|
||||
# merge this with other existing configurations
|
||||
|
||||
security:
|
||||
|
||||
|
||||
providers:
|
||||
saml_provider:
|
||||
# Loads user from user repository
|
||||
entity:
|
||||
class: Chill\MainBundle\Entity\User
|
||||
property: username
|
||||
|
||||
firewalls:
|
||||
|
||||
|
||||
default:
|
||||
# saml part:
|
||||
saml:
|
||||
username_attribute: http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress
|
||||
# weird behaviour in dev environment... configuration seems different
|
||||
# username_attribute: http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name
|
||||
# Use the attribute's friendlyName instead of the name
|
||||
use_attribute_friendly_name: false
|
||||
user_factory: user_from_saml_factory
|
||||
persist_user: true
|
||||
check_path: saml_acs
|
||||
login_path: saml_login
|
||||
logout:
|
||||
path: /saml/logout
|
||||
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
// src/Security/SamlFactory.php
|
||||
|
||||
namespace App\Security;
|
||||
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Hslavich\OneloginSamlBundle\Security\Authentication\Token\SamlTokenInterface;
|
||||
use Hslavich\OneloginSamlBundle\Security\User\SamlUserFactoryInterface;
|
||||
|
||||
class UserSamlFactory implements SamlUserFactoryInterface
|
||||
{
|
||||
public function createUser(SamlTokenInterface $token)
|
||||
{
|
||||
$attributes = $token->getAttributes();
|
||||
$user = new User();
|
||||
$user->setUsername($attributes['http://schemas.microsoft.com/identity/claims/displayname'][0]);
|
||||
$user->setLabel($attributes['http://schemas.microsoft.com/identity/claims/displayname'][0]);
|
||||
$user->setPassword('');
|
||||
$user->setEmail($attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress'][0]);
|
||||
$user->setAttributes($attributes);
|
||||
|
||||
return $user;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Configure sync and calendar access
|
||||
----------------------------------
|
||||
|
||||
The purpose of this configuration is the following:
|
||||
|
||||
- let user read their calendar and shared calendar within Chill (with the same permissions as the one configured in Outlook / Azure);
|
||||
- allow chill instance to write appointment ("Rendez-vous") into their calendar, and invite other users to their appointment;
|
||||
- allow chill instance to be notified if an appoint is added or removed by the user within another interface than Chill: if the appointment match another one created in the Chill interface, the date and time are updated in Chill;
|
||||
- allow chill instance to read the absence of the user and, if set, mark the user as absent in Chill;
|
||||
|
||||
The sync processe might be configured in the same app, or into a different app on the Azure side.
|
||||
|
||||
The synchronization processes use Oauth 2.0 / OpenID Connect for authentication and authorization.
|
||||
|
||||
.. note::
|
||||
|
||||
Two flows are in use:
|
||||
|
||||
* we authenticate "on behalf of a user", to allow users to see their own calendar or other user's calendar into the web interface.
|
||||
|
||||
Typically, when the page is loaded, Chill first check that an authorization token exists. If not, the user is redirected to Microsoft Azure for authentification and a new token is grabbed (most of the times, this is transparent for users).
|
||||
|
||||
* Chill also acts "as a machine", to synchronize calendars with a daemon background.
|
||||
|
||||
One can access the configuration using this screen (it is quite well hidden into the multiple of tabs):
|
||||
|
||||
.. figure:: ./oauth_app_registration.png
|
||||
|
||||
You can find the oauth configuration on the "Securité > Autorisations" tab, and click on "application registration" (not translated).
|
||||
|
||||
Add a redirection URI for you authentification:
|
||||
|
||||
.. figure:: ./oauth_api_authentification.png
|
||||
|
||||
The URI must be "your chill public url" with :code:`/connect/azure/check` at the end.
|
||||
|
||||
Allow some authorizations for your app:
|
||||
|
||||
.. figure:: ./oauth_api_autorisees.png
|
||||
|
||||
Take care of the separation between autorization "on behalf of a user" (déléguée), or "for a machine" (application).
|
||||
|
||||
Some explanation:
|
||||
|
||||
* Users must be allowed to read their user profile (:code:`User.Read`), and the profile of other users (:code:`User.ReadBasicAll`);
|
||||
* They must be allowed to read their calendar (:code:`Calendars.Read`), and the calendars shared with them (:code:`Calendars.Read.Shared`);
|
||||
|
||||
The sync daemon must have write access:
|
||||
|
||||
* the daemon must be allowed to read all users and their profile, to establish a link between them and the Chill's users: (:code:`Users.Read.All`);
|
||||
* it must also be allowed to read and write into the calendars (:code:`Calendars.ReadWrite.All`);
|
||||
* for sending invitation to other users, the permission (:code:`Mail.Send`) must be granted;
|
||||
* and, for reading the absence status of the user and sync it with chill, it must be able to read the mailboxSettings (:code:`MailboxSettings.Read`).
|
||||
|
||||
At this step, you might choose to accept those permissions for all users, or let them do it by yourself.
|
||||
|
||||
Grab your client id:
|
||||
|
||||
.. figure:: ./oauth_api_client_id.png
|
||||
|
||||
This will be your :code:`OAUTH_AZURE_CLIENT_ID` variable.
|
||||
|
||||
|
||||
Generate a secret:
|
||||
|
||||
.. figure:: ./oauth_api_secret.png
|
||||
|
||||
This will be your :code:`OAUTH_AZURE_CLIENT_SECRET` variable.
|
||||
|
||||
And get you azure's tenant id, which is the same as the :code:`SAML_IDP_APP_UUID` (see above).
|
||||
|
||||
Your variables will be:
|
||||
|
||||
.. code-block::
|
||||
|
||||
OAUTH_AZURE_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
OAUTH_AZURE_CLIENT_TENANT=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
OAUTH_AZURE_CLIENT_SECRET: 3-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
Then, configure chill:
|
||||
|
||||
Enable the calendar sync with microsoft azure:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# config/packages/chill_calendar.yaml
|
||||
|
||||
chill_calendar:
|
||||
remote_calendars_sync:
|
||||
microsoft_graph:
|
||||
enabled: true
|
||||
|
||||
and configure the oauth client:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# config/packages/knp_oauth2_client.yaml
|
||||
knpu_oauth2_client:
|
||||
clients:
|
||||
azure:
|
||||
type: azure
|
||||
client_id: '%env(OAUTH_AZURE_CLIENT_ID)%'
|
||||
client_secret: '%env(OAUTH_AZURE_CLIENT_SECRET)%'
|
||||
redirect_route: chill_calendar_remote_connect_azure_check
|
||||
redirect_params: { }
|
||||
tenant: '%env(OAUTH_AZURE_CLIENT_TENANT)%'
|
||||
url_api: 'https://graph.microsoft.com/'
|
||||
default_end_point_version: '2.0'
|
||||
|
||||
|
||||
You can now process for the first api authorization on the application side, (unless you did it in the Azure interface), and get a first token, by using :
|
||||
|
||||
:code:`bin/console chill:calendar:msgraph-grant-admin-consent`
|
||||
|
||||
This will generate a url that you can use to grant your app for your tenant. The redirection may fails in the browser, but this is not relevant: if you get an authorization token in the CLI, the authentication works.
|
||||
|
||||
Run the processes to synchronize
|
||||
--------------------------------
|
||||
|
||||
The calendar synchronization is processed using symfony messenger. It seems to be intersting to configure a queue (in the postgresql database it is the most simple way), and to run a worker for synchronization, at least in production.
|
||||
|
||||
The association between chill's users and Microsoft's users is done by this cli command:
|
||||
|
||||
.. code-block::
|
||||
|
||||
bin/console chill:calendar:msgraph-user-map-subscribe
|
||||
|
||||
This command:
|
||||
|
||||
* will associate the Microsoft's user metadata in our database;
|
||||
* and, most important, create a subscription to get notification when the user alter his calendar, to sync chill's event and ranges in sync.
|
||||
|
||||
The subscription least at most 3 days. This command should be runned:
|
||||
|
||||
* at least each time a user is added;
|
||||
* and, at least, every three days.
|
||||
|
||||
In production, we advise to run it at least every day to get the sync working.
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user