diff --git a/.changes/unreleased/Fixed-20240916-151843.yaml b/.changes/unreleased/Fixed-20240916-151843.yaml deleted file mode 100644 index ba89d3a70..000000000 --- a/.changes/unreleased/Fixed-20240916-151843.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kind: Fixed -body: Show only the current referrer in the page "show" for an accompanying period - workf -time: 2024-09-16T15:18:43.017401122+02:00 -custom: - Issue: "308" diff --git a/.changes/v3.1.1.md b/.changes/v3.1.1.md new file mode 100644 index 000000000..06bf33077 --- /dev/null +++ b/.changes/v3.1.1.md @@ -0,0 +1,6 @@ +## 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 diff --git a/.changes/v3.2.0.md b/.changes/v3.2.0.md new file mode 100644 index 000000000..25dd295c8 --- /dev/null +++ b/.changes/v3.2.0.md @@ -0,0 +1,3 @@ +## v3.2.0 - 2024-10-30 +### Feature +* Introduce a gender entity diff --git a/.changes/v3.2.1.md b/.changes/v3.2.1.md new file mode 100644 index 000000000..dd1466922 --- /dev/null +++ b/.changes/v3.2.1.md @@ -0,0 +1,4 @@ +## v3.2.1 - 2024-10-31 +### Fixed +* Add the possibility of unknown to the gender entity +* Fix the fusion of person doubles by excluding accompanyingPeriod work entities to be deleted. They are moved instead. diff --git a/.changes/v3.2.2.md b/.changes/v3.2.2.md new file mode 100644 index 000000000..7ab01bf62 --- /dev/null +++ b/.changes/v3.2.2.md @@ -0,0 +1,3 @@ +## v3.2.2 - 2024-10-31 +### Fixed +* Fix gender translation for unknown diff --git a/.changes/v3.2.3.md b/.changes/v3.2.3.md new file mode 100644 index 000000000..b7064350a --- /dev/null +++ b/.changes/v3.2.3.md @@ -0,0 +1,4 @@ +## v3.2.3 - 2024-11-05 +### Fixed +* ([#315](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/315)) Fix display of accompanying period work referrers. Only current referrers should be displayed. +Fix color of Chill footer diff --git a/.changes/v3.2.4.md b/.changes/v3.2.4.md new file mode 100644 index 000000000..f89cf37eb --- /dev/null +++ b/.changes/v3.2.4.md @@ -0,0 +1,3 @@ +## v3.2.4 - 2024-11-06 +### Fixed +* Fix compilation of chill assets diff --git a/CHANGELOG.md b/CHANGELOG.md index 5272cd5a9..c5bed63c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,22 +6,57 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). +## v3.2.4 - 2024-11-06 +### Fixed +* Fix compilation of chill assets + +## v3.2.3 - 2024-11-05 +### Fixed +* ([#315](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/315)) Fix display of accompanying period work referrers. Only current referrers should be displayed. +Fix color of Chill footer + +## v3.2.2 - 2024-10-31 +### Fixed +* Fix gender translation for unknown + +## v3.2.1 - 2024-10-31 +### Fixed +* Add the possibility of unknown to the gender entity +* Fix the fusion of person doubles by excluding accompanyingPeriod work entities to be deleted. They are moved instead. + +## v3.2.0 - 2024-10-30 +### Feature +* Introduce a gender entity + +## 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 + ## 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. +* Add export aggregator to aggregate activities by household + filter persons that are not part of an accompanyingperiod during a certain timeframe. ## 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 +* 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 ## 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. +* ([#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. -## v2.23.0 - 2024-07-19 & 2024-07-23 +## 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 @@ -31,6 +66,8 @@ and is generated by [Changie](https://github.com/miniscruff/changie). * 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 @@ -43,25 +80,15 @@ and is generated by [Changie](https://github.com/miniscruff/changie). - 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. -* ([#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 - -### Fixed -* Fix resolving of centers for an household, which will fix in turn the access control -* Resolved type hinting error in activity list export - ## v2.22.2 - 2024-07-03 ### Fixed -* Remove scope required for event participation stats +* Remove scope required for event participation stats ## v2.22.1 - 2024-07-01 ### Fixed -* Remove debug word +* Remove debug word ### DX -* Add a command for reading official address DB from Luxembourg and update chill addresses +* Add a command for reading official address DB from Luxembourg and update chill addresses ## v2.22.0 - 2024-06-25 ### Feature @@ -104,7 +131,7 @@ and is generated by [Changie](https://github.com/miniscruff/changie). ## v2.20.1 - 2024-06-05 ### Fixed -* Do not allow StoredObjectCreated for edit and convert buttons +* Do not allow StoredObjectCreated for edit and convert buttons ## v2.20.0 - 2024-06-05 ### Fixed @@ -151,96 +178,96 @@ and is generated by [Changie](https://github.com/miniscruff/changie). ## 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 +* ([#250](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/250)) Postal codes import : fix the source URL and the keys to handle each record ## v2.18.1 - 2024-03-26 ### Fixed -* Fix layout issue in document generation for admin (minor) +* Fix layout issue in document generation for admin (minor) ## 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 +* ([#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 +* ([#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 ## 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 +* ([#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 +* ([#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 ## 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' +* ([#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 +* ([#232](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/232)) Order user jobs and services alphabetically in export filters ## v2.16.2 - 2024-02-21 ### Fixed -* Check for null values in closing motive of parcours d'accompagnement for correct rendering of template +* Check for null values in closing motive of parcours d'accompagnement for correct rendering of template ## v2.16.1 - 2024-02-09 ### Fixed -* Force bootstrap version to avoid error in builds with newer version +* Force bootstrap version to avoid error in builds with newer version ## v2.16.0 - 2024-02-08 ### Feature -* ([#231](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/231)) Create new filter for persons having a participation in an accompanying period during a certain time span -* ([#241](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/241)) [Export][List of accompanyign period] Add two columns: the list of persons participating to the period, and their ids -* ([#244](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/244)) Add capability to generate export about change of steps of accompanying period, and generate exports for this -* ([#253](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/253)) Export: group accompanying period by person participating -* ([#243](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/243)) Export: add filter for courses not linked to a reference address -* ([#229](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/229)) Allow to group activities linked with accompanying period by reason -* ([#115](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/115)) Prevent social work to be saved when another user edited conccurently the social work -* Modernize the event bundle, with some new fields and multiple improvements +* ([#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 +* ([#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. +* ([#260](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/260)) Order list of centers alphabetically in dropdown 'user' section admin. ## v2.15.2 - 2024-01-11 ### Fixed -* Fix the id_seq used when creating a new accompanying period participation during fusion of two person files +* 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. +* Set placeholder to False for expanded EntityType form fields where required is set to False. ## v2.15.1 - 2023-12-20 ### Fixed -* Fix the household export query to exclude accompanying periods that are in draft state. +* 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 +* ([#167](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/167)) Fixed readthedocs compilation by updating readthedocs config file and requirements for Sphinx ## v2.15.0 - 2023-12-11 ### Feature -* ([#191](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/191)) Add export "number of household associate with an exchange" -* ([#235](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/235)) Export: add dates on the filter "filter course by activity type" +* ([#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) +* ([#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 + +* ([#228](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/228)) Fix export of activity for people created before the introduction of the createdAt column on person (during v1) +* ([#246](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/246)) Do not show activities, evaluations and social work when associated to a confidential accompanying period, except for the users which are allowed to see them ## v2.14.1 - 2023-11-29 ### Fixed -* Export: fix list person with custom fields -* ([#100](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/100)) Add a paginator to budget elements (resource and charge types) in the admin -* Fix error in ListEvaluation when "handling agents" are alone +* Export: fix list person with custom fields +* ([#100](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/100)) Add a paginator to budget elements (resource and charge types) in the admin +* Fix error in ListEvaluation when "handling agents" are alone ## v2.14.0 - 2023-11-24 ### Feature -* ([#161](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/161)) Export: in filter "Filter accompanying period work (social action) by type, goal and result", order the items alphabetically or with the defined order +* ([#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 +* ([#141](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/141)) Export: on filter "action by type goals, and results", restore the fields when editing a saved export +* ([#219](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/219)) Export: fix the list of accompanying period work, when the "calc date" is null +* ([#222](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/222)) Fix rendering of custom fields +* Fix various errors in custom fields administration ## v2.13.0 - 2023-11-21 ### Feature @@ -254,7 +281,7 @@ and is generated by [Changie](https://github.com/miniscruff/changie). ## 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" +* ([#208](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/208)) Export: fix loading of form for "filter action by type, goal and result" ## v2.12.0 - 2023-11-15 ### Feature @@ -285,36 +312,36 @@ and is generated by [Changie](https://github.com/miniscruff/changie). ## 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" +* ([#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 +* ([#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 ## 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 +* ([#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 ## 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" +* ([#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" ## v2.10.4 - 2023-10-26 ### Fixed -* Fix null value constraint errors when merging relationships in doubles +* Fix null value constraint errors when merging relationships in doubles ## 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 +* ([#175](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/175)) Replace old method of getting translator with injection of translatorInterface ## v2.10.2 - 2023-10-26 ### Fixed -* ([#175](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/175)) Use injection of translator instead of ->get(). +* ([#175](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/175)) Use injection of translator instead of ->get(). ## v2.10.1 - 2023-10-24 ### Fixed -* Fix export controller when generating an export without any data in session +* Fix export controller when generating an export without any data in session ## v2.10.0 - 2023-10-24 ### Feature @@ -339,11 +366,11 @@ and is generated by [Changie](https://github.com/miniscruff/changie). ## v2.9.2 - 2023-10-17 ### Fixed -* Fix possible null values in string's entities +* Fix possible null values in string's entities ## 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 +* Fix the handling of activity form when editing or creating an activity in an accompanying period with multiple centers ## v2.9.0 - 2023-10-17 ### Feature @@ -391,57 +418,57 @@ But if you do not need this any more, you must ensure that the configuration key ## 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) +* ([#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" +* ([#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" ## v2.6.3 - 2023-09-19 ### Fixed -* Remove id property from document -mappedsuperclass +* Remove id property from document +mappedsuperclass ## v2.6.2 - 2023-09-18 ### Fixed -* Fix doctrine mapping of AbstractTaskPlaceEvent and SingleTaskPlaceEvent: id property moved. +* Fix doctrine mapping of AbstractTaskPlaceEvent and SingleTaskPlaceEvent: id property moved. ## v2.6.1 - 2023-09-14 ### Fixed -* Filter out active centers in exports, which uses a different PickCenterType. +* Filter out active centers in exports, which uses a different PickCenterType. ## v2.6.0 - 2023-09-14 ### Feature -* ([#133](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/133)) Add locations in Aside Activity. By default, suggest user location, otherwise a select with all locations. -* ([#133](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/133)) Adapt Aside Activity exports: display location, filter by location, group by location -* Use the CRUD controller for center entity + add the isActive property to be able to mask instances of Center that are no longer in use. +* ([#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 +* ([#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. + +* ([#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 + +* Do not send an email to creator twice when adding a comment to a notification +* ([#107](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/107)) Fix gestion doublon functionality to work with chill bundles v2 ### UX * Uniformize badge-person in household banner (background, size) - + ## v2.5.3 - 2023-07-20 ### Fixed -* ([#132](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/132)) Rendez-vous documents created would appear in all documents lists of all persons with an accompanying period. Or statements are now added to the where clause to filter out documents that come from unrelated accompanying period/ or person rendez-vous. +* ([#132](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/132)) Rendez-vous documents created would appear in all documents lists of all persons with an accompanying period. Or statements are now added to the where clause to filter out documents that come from unrelated accompanying period/ or person rendez-vous. ## v2.5.2 - 2023-07-15 ### Fixed -* [Collate Address] when updating address point, do not use the point's address reference if the similarity is below the requirement for associating the address reference and the address (it uses the postcode's center instead) +* [Collate Address] when updating address point, do not use the point's address reference if the similarity is below the requirement for associating the address reference and the address (it uses the postcode's center instead) ## v2.5.1 - 2023-07-14 ### Fixed -* [collate addresses] block collating addresses to another address reference where the address reference is already the best match +* [collate addresses] block collating addresses to another address reference where the address reference is already the best match ## v2.5.0 - 2023-07-14 ### Feature diff --git a/package.json b/package.json index 05750d5c9..ae6d5437e 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,8 @@ "vue-i18n": "^9.1.6", "vue-multiselect": "3.0.0-alpha.2", "vue-toast-notification": "^3.1.2", - "vuex": "^4.0.0" + "vuex": "^4.0.0", + "bootstrap-icons": "^1.11.3" }, "browserslist": [ "Firefox ESR" diff --git a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityStoredObjectVoter.php b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityStoredObjectVoter.php index 78def7318..6a2a27140 100644 --- a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityStoredObjectVoter.php +++ b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityStoredObjectVoter.php @@ -16,7 +16,7 @@ use Chill\ActivityBundle\Repository\ActivityRepository; use Chill\DocStoreBundle\Repository\AssociatedEntityToStoredObjectInterface; use Chill\DocStoreBundle\Security\Authorization\StoredObjectRoleEnum; use Chill\DocStoreBundle\Security\Authorization\StoredObjectVoter\AbstractStoredObjectVoter; -use Chill\DocStoreBundle\Service\WorkflowStoredObjectPermissionHelper; +use Chill\MainBundle\Workflow\Helper\WorkflowRelatedEntityPermissionHelper; use Symfony\Component\Security\Core\Security; class ActivityStoredObjectVoter extends AbstractStoredObjectVoter @@ -24,7 +24,7 @@ class ActivityStoredObjectVoter extends AbstractStoredObjectVoter public function __construct( private readonly ActivityRepository $repository, Security $security, - WorkflowStoredObjectPermissionHelper $workflowDocumentService, + WorkflowRelatedEntityPermissionHelper $workflowDocumentService, ) { parent::__construct($security, $workflowDocumentService); } diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php index 54d63b978..3a0adbdcc 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php @@ -42,8 +42,8 @@ class CustomFieldLongChoice extends AbstractCustomField $translatableStringHelper = $this->translatableStringHelper; $builder->add($customField->getSlug(), Select2ChoiceType::class, [ 'choices' => $entries, - 'choice_label' => static fn (Option $option) => $translatableStringHelper->localize($option->getText()), - 'choice_value' => static fn (Option $key): ?int => null === $key ? null : $key->getId(), + 'choice_label' => static fn (?Option $option) => $translatableStringHelper->localize($option->getText()), + 'choice_value' => static fn (?Option $key): ?int => $key?->getId(), 'multiple' => false, 'expanded' => false, 'required' => $customField->isRequired(), diff --git a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php index 55f09597c..723b47612 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php @@ -46,11 +46,8 @@ class CustomFieldsGroup #[ORM\GeneratedValue(strategy: 'AUTO')] private ?int $id = null; - /** - * @var array - */ #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] - private $name; + private array|string $name; #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] private array $options = []; @@ -181,7 +178,7 @@ class CustomFieldsGroup * * @return CustomFieldsGroup */ - public function setName($name) + public function setName(array|string $name) { $this->name = $name; diff --git a/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter/AbstractStoredObjectVoter.php b/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter/AbstractStoredObjectVoter.php index 9d77211c2..f8713f2dc 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter/AbstractStoredObjectVoter.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter/AbstractStoredObjectVoter.php @@ -15,7 +15,7 @@ use Chill\DocStoreBundle\Entity\StoredObject; use Chill\DocStoreBundle\Repository\AssociatedEntityToStoredObjectInterface; use Chill\DocStoreBundle\Security\Authorization\StoredObjectRoleEnum; use Chill\DocStoreBundle\Security\Authorization\StoredObjectVoterInterface; -use Chill\DocStoreBundle\Service\WorkflowStoredObjectPermissionHelper; +use Chill\MainBundle\Workflow\Helper\WorkflowRelatedEntityPermissionHelper; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Security; @@ -34,7 +34,7 @@ abstract class AbstractStoredObjectVoter implements StoredObjectVoterInterface public function __construct( private readonly Security $security, - private readonly ?WorkflowStoredObjectPermissionHelper $workflowDocumentService = null, + private readonly ?WorkflowRelatedEntityPermissionHelper $workflowDocumentService = null, ) {} public function supports(StoredObjectRoleEnum $attribute, StoredObject $subject): bool @@ -49,6 +49,11 @@ abstract class AbstractStoredObjectVoter implements StoredObjectVoterInterface // Retrieve the related accompanying course document $entity = $this->getRepository()->findAssociatedEntityToStoredObject($subject); + if ($this->workflowDocumentService->isAllowedByWorkflow($entity)) { + // read and write permissions are granted by workflow + return true; + } + // Determine the attribute to pass to AccompanyingCourseDocumentVoter $voterAttribute = $this->attributeToRole($attribute); diff --git a/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter/AccompanyingCourseDocumentStoredObjectVoter.php b/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter/AccompanyingCourseDocumentStoredObjectVoter.php index 94ff9149d..e1a9add7d 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter/AccompanyingCourseDocumentStoredObjectVoter.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter/AccompanyingCourseDocumentStoredObjectVoter.php @@ -16,7 +16,7 @@ use Chill\DocStoreBundle\Repository\AccompanyingCourseDocumentRepository; use Chill\DocStoreBundle\Repository\AssociatedEntityToStoredObjectInterface; use Chill\DocStoreBundle\Security\Authorization\AccompanyingCourseDocumentVoter; use Chill\DocStoreBundle\Security\Authorization\StoredObjectRoleEnum; -use Chill\DocStoreBundle\Service\WorkflowStoredObjectPermissionHelper; +use Chill\MainBundle\Workflow\Helper\WorkflowRelatedEntityPermissionHelper; use Symfony\Component\Security\Core\Security; final class AccompanyingCourseDocumentStoredObjectVoter extends AbstractStoredObjectVoter @@ -24,7 +24,7 @@ final class AccompanyingCourseDocumentStoredObjectVoter extends AbstractStoredOb public function __construct( private readonly AccompanyingCourseDocumentRepository $repository, Security $security, - WorkflowStoredObjectPermissionHelper $workflowDocumentService, + WorkflowRelatedEntityPermissionHelper $workflowDocumentService, ) { parent::__construct($security, $workflowDocumentService); } diff --git a/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter/PersonDocumentStoredObjectVoter.php b/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter/PersonDocumentStoredObjectVoter.php index 4c8ae693e..16833c535 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter/PersonDocumentStoredObjectVoter.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter/PersonDocumentStoredObjectVoter.php @@ -16,7 +16,7 @@ use Chill\DocStoreBundle\Repository\AssociatedEntityToStoredObjectInterface; use Chill\DocStoreBundle\Repository\PersonDocumentRepository; use Chill\DocStoreBundle\Security\Authorization\PersonDocumentVoter; use Chill\DocStoreBundle\Security\Authorization\StoredObjectRoleEnum; -use Chill\DocStoreBundle\Service\WorkflowStoredObjectPermissionHelper; +use Chill\MainBundle\Workflow\Helper\WorkflowRelatedEntityPermissionHelper; use Symfony\Component\Security\Core\Security; class PersonDocumentStoredObjectVoter extends AbstractStoredObjectVoter @@ -24,7 +24,7 @@ class PersonDocumentStoredObjectVoter extends AbstractStoredObjectVoter public function __construct( private readonly PersonDocumentRepository $repository, Security $security, - WorkflowStoredObjectPermissionHelper $workflowDocumentService, + WorkflowRelatedEntityPermissionHelper $workflowDocumentService, ) { parent::__construct($security, $workflowDocumentService); } diff --git a/src/Bundle/ChillDocStoreBundle/Tests/Security/Authorization/AbstractStoredObjectVoterTest.php b/src/Bundle/ChillDocStoreBundle/Tests/Security/Authorization/AbstractStoredObjectVoterTest.php index a045a1fd6..0090496db 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/Security/Authorization/AbstractStoredObjectVoterTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/Security/Authorization/AbstractStoredObjectVoterTest.php @@ -15,7 +15,7 @@ use Chill\DocStoreBundle\Entity\StoredObject; use Chill\DocStoreBundle\Repository\AssociatedEntityToStoredObjectInterface; use Chill\DocStoreBundle\Security\Authorization\StoredObjectRoleEnum; use Chill\DocStoreBundle\Security\Authorization\StoredObjectVoter\AbstractStoredObjectVoter; -use Chill\DocStoreBundle\Service\WorkflowStoredObjectPermissionHelper; +use Chill\MainBundle\Workflow\Helper\WorkflowRelatedEntityPermissionHelper; use Chill\MainBundle\Entity\User; use PHPUnit\Framework\TestCase; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; @@ -30,16 +30,16 @@ class AbstractStoredObjectVoterTest extends TestCase { private AssociatedEntityToStoredObjectInterface $repository; private Security $security; - private WorkflowStoredObjectPermissionHelper $workflowDocumentService; + private WorkflowRelatedEntityPermissionHelper $workflowDocumentService; protected function setUp(): void { $this->repository = $this->createMock(AssociatedEntityToStoredObjectInterface::class); $this->security = $this->createMock(Security::class); - $this->workflowDocumentService = $this->createMock(WorkflowStoredObjectPermissionHelper::class); + $this->workflowDocumentService = $this->createMock(WorkflowRelatedEntityPermissionHelper::class); } - private function buildStoredObjectVoter(bool $canBeAssociatedWithWorkflow, AssociatedEntityToStoredObjectInterface $repository, Security $security, ?WorkflowStoredObjectPermissionHelper $workflowDocumentService = null): AbstractStoredObjectVoter + private function buildStoredObjectVoter(bool $canBeAssociatedWithWorkflow, AssociatedEntityToStoredObjectInterface $repository, Security $security, ?WorkflowRelatedEntityPermissionHelper $workflowDocumentService = null): AbstractStoredObjectVoter { // Anonymous class extending the abstract class return new class ($canBeAssociatedWithWorkflow, $repository, $security, $workflowDocumentService) extends AbstractStoredObjectVoter { @@ -47,7 +47,7 @@ class AbstractStoredObjectVoterTest extends TestCase private readonly bool $canBeAssociatedWithWorkflow, private readonly AssociatedEntityToStoredObjectInterface $repository, Security $security, - ?WorkflowStoredObjectPermissionHelper $workflowDocumentService = null, + ?WorkflowRelatedEntityPermissionHelper $workflowDocumentService = null, ) { parent::__construct($security, $workflowDocumentService); } @@ -99,6 +99,25 @@ class AbstractStoredObjectVoterTest extends TestCase $this->workflowDocumentService->method('notBlockedByWorkflow')->willReturn($workflowAllowed); } + public function testIsAllowedByWorkflow(): void + { + [$user, $token, $subject, $entity] = $this->setupMockObjects(); + $workflowRelatedEntityPermissionHelper = $this->createMock(WorkflowRelatedEntityPermissionHelper::class); + $workflowRelatedEntityPermissionHelper->method('isAllowedByWorkflow')->withAnyParameters()->willReturn(true); + + $associatedObjectRepository = $this->createMock(AssociatedEntityToStoredObjectInterface::class); + $associatedObjectRepository->method('findAssociatedEntityToStoredObject')->willReturn($entity); + + $voter = $this->buildStoredObjectVoter( + true, + $associatedObjectRepository, + $this->createMock(Security::class), + $workflowRelatedEntityPermissionHelper + ); + + self::assertTrue($voter->voteOnAttribute(StoredObjectRoleEnum::EDIT, $subject, $token)); + } + public function testSupportsOnAttribute(): void { [$user, $token, $subject, $entity] = $this->setupMockObjects(); diff --git a/src/Bundle/ChillEventBundle/Security/Authorization/EventStoredObjectVoter.php b/src/Bundle/ChillEventBundle/Security/Authorization/EventStoredObjectVoter.php index 9a23d6d85..7e61db7d6 100644 --- a/src/Bundle/ChillEventBundle/Security/Authorization/EventStoredObjectVoter.php +++ b/src/Bundle/ChillEventBundle/Security/Authorization/EventStoredObjectVoter.php @@ -14,7 +14,7 @@ namespace Chill\EventBundle\Security\Authorization; use Chill\DocStoreBundle\Repository\AssociatedEntityToStoredObjectInterface; use Chill\DocStoreBundle\Security\Authorization\StoredObjectRoleEnum; use Chill\DocStoreBundle\Security\Authorization\StoredObjectVoter\AbstractStoredObjectVoter; -use Chill\DocStoreBundle\Service\WorkflowStoredObjectPermissionHelper; +use Chill\MainBundle\Workflow\Helper\WorkflowRelatedEntityPermissionHelper; use Chill\EventBundle\Entity\Event; use Chill\EventBundle\Repository\EventRepository; use Chill\EventBundle\Security\EventVoter; @@ -25,7 +25,7 @@ class EventStoredObjectVoter extends AbstractStoredObjectVoter public function __construct( private readonly EventRepository $repository, Security $security, - WorkflowStoredObjectPermissionHelper $workflowDocumentService, + WorkflowRelatedEntityPermissionHelper $workflowDocumentService, ) { parent::__construct($security, $workflowDocumentService); } diff --git a/src/Bundle/ChillJobBundle/src/Resources/public/sass/csconnectes.scss b/src/Bundle/ChillJobBundle/src/Resources/public/sass/csconnectes.scss deleted file mode 100644 index 6405c0f00..000000000 --- a/src/Bundle/ChillJobBundle/src/Resources/public/sass/csconnectes.scss +++ /dev/null @@ -1,19 +0,0 @@ -footer.footer { - padding: 0; - background-color: white; - border-top: 1px solid grey; - div.sponsors { - p { - padding-bottom: 10px; - color: #000; - font-size: 16px; - } - background-color: white; - padding: 2em 0; - img { - display: block; - margin: auto; - } - } -} - diff --git a/src/Bundle/ChillJobBundle/src/Resources/public/sass/index.js b/src/Bundle/ChillJobBundle/src/Resources/public/sass/index.js index 657c9677d..e69de29bb 100644 --- a/src/Bundle/ChillJobBundle/src/Resources/public/sass/index.js +++ b/src/Bundle/ChillJobBundle/src/Resources/public/sass/index.js @@ -1 +0,0 @@ -require('./csconnectes.scss'); diff --git a/src/Bundle/ChillJobBundle/src/chill.webpack.config.js b/src/Bundle/ChillJobBundle/src/chill.webpack.config.js index b648e23bb..882a1013d 100644 --- a/src/Bundle/ChillJobBundle/src/chill.webpack.config.js +++ b/src/Bundle/ChillJobBundle/src/chill.webpack.config.js @@ -5,8 +5,7 @@ module.exports = function(encore, chillEntries) personal_situation_edit_file = __dirname + '/Resources/public/module/personal_situation/index.js', cv_edit_file = __dirname + '/Resources/public/module/cv_edit/index.js', immersion_edit_file = __dirname + '/Resources/public/module/immersion_edit/index.js', - images = __dirname + '/Resources/public/images/index.js', - sass_styles = __dirname + '/Resources/public/sass/index.js' + images = __dirname + '/Resources/public/images/index.js' ; encore.addEntry('dispositifs_edit', dispositif_edit_file); @@ -15,6 +14,4 @@ module.exports = function(encore, chillEntries) encore.addEntry('images', images); encore.addEntry('cs_cv', cv_edit_file); - chillEntries.push(sass_styles); - }; diff --git a/src/Bundle/ChillMainBundle/Controller/GenderApiController.php b/src/Bundle/ChillMainBundle/Controller/GenderApiController.php new file mode 100644 index 000000000..96fae4024 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Controller/GenderApiController.php @@ -0,0 +1,32 @@ +andWhere( + $query->expr()->eq('e.active', "'TRUE'") + ); + } + + protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format) + { + return $query->addOrderBy('e.order', 'ASC'); + } +} diff --git a/src/Bundle/ChillMainBundle/Controller/GenderController.php b/src/Bundle/ChillMainBundle/Controller/GenderController.php new file mode 100644 index 000000000..a556145d4 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Controller/GenderController.php @@ -0,0 +1,26 @@ +addOrderBy('e.order', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGenders.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGenders.php new file mode 100644 index 000000000..2d74e6977 --- /dev/null +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGenders.php @@ -0,0 +1,63 @@ + ['en' => 'man', 'fr' => 'homme'], + 'genderTranslation' => GenderEnum::MALE, + 'icon' => GenderIconEnum::MALE, + ], + [ + 'label' => ['en' => 'woman', 'fr' => 'femme'], + 'genderTranslation' => GenderEnum::FEMALE, + 'icon' => GenderIconEnum::FEMALE, + ], + [ + 'label' => ['en' => 'neutral', 'fr' => 'neutre'], + 'genderTranslation' => GenderEnum::NEUTRAL, + 'icon' => GenderIconEnum::NEUTRAL, + ], + ]; + + public function getOrder() + { + return 100; + } + + public function load(ObjectManager $manager) + { + echo "loading genders... \n"; + + foreach ($this->genders as $g) { + echo $g['label']['fr'].' '; + $new_g = new Gender(); + $new_g->setGenderTranslation($g['genderTranslation']); + $new_g->setLabel($g['label']); + $new_g->setIcon($g['icon']); + + $this->addReference('g_'.$g['genderTranslation']->value, $new_g); + $manager->persist($new_g); + } + + $manager->flush(); + } +} diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index 999277ed1..9a005be4a 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -17,6 +17,8 @@ use Chill\MainBundle\Controller\CivilityApiController; use Chill\MainBundle\Controller\CivilityController; use Chill\MainBundle\Controller\CountryApiController; use Chill\MainBundle\Controller\CountryController; +use Chill\MainBundle\Controller\GenderApiController; +use Chill\MainBundle\Controller\GenderController; use Chill\MainBundle\Controller\GeographicalUnitApiController; use Chill\MainBundle\Controller\LanguageController; use Chill\MainBundle\Controller\LocationController; @@ -54,6 +56,7 @@ use Chill\MainBundle\Doctrine\Type\PointType; use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Civility; use Chill\MainBundle\Entity\Country; +use Chill\MainBundle\Entity\Gender; use Chill\MainBundle\Entity\GeographicalUnitLayer; use Chill\MainBundle\Entity\Language; use Chill\MainBundle\Entity\Location; @@ -66,6 +69,7 @@ use Chill\MainBundle\Entity\UserJob; use Chill\MainBundle\Form\CenterType; use Chill\MainBundle\Form\CivilityType; use Chill\MainBundle\Form\CountryType; +use Chill\MainBundle\Form\GenderType; use Chill\MainBundle\Form\LanguageType; use Chill\MainBundle\Form\LocationFormType; use Chill\MainBundle\Form\LocationTypeType; @@ -511,6 +515,28 @@ class ChillMainExtension extends Extension implements ], ], ], + [ + 'class' => Gender::class, + 'name' => 'main_gender', + 'base_path' => '/admin/main/gender', + 'base_role' => 'ROLE_ADMIN', + 'form_class' => GenderType::class, + 'controller' => GenderController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillMain/Gender/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillMain/Gender/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillMain/Gender/edit.html.twig', + ], + ], + ], [ 'class' => Language::class, 'name' => 'main_language', @@ -814,6 +840,21 @@ class ChillMainExtension extends Extension implements ], ], ], + [ + 'class' => Gender::class, + 'name' => 'gender', + 'base_path' => '/api/1.0/main/gender', + 'base_role' => 'ROLE_USER', + 'controller' => GenderApiController::class, + 'actions' => [ + '_index' => [ + 'methods' => [ + Request::METHOD_GET => true, + Request::METHOD_HEAD => true, + ], + ], + ], + ], [ 'class' => GeographicalUnitLayer::class, 'controller' => GeographicalUnitApiController::class, diff --git a/src/Bundle/ChillMainBundle/Entity/Gender.php b/src/Bundle/ChillMainBundle/Entity/Gender.php new file mode 100644 index 000000000..59c0bd134 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Entity/Gender.php @@ -0,0 +1,104 @@ + Gender::class])] +#[ORM\Entity(repositoryClass: GenderRepository::class)] +#[ORM\Table(name: 'chill_main_gender')] +class Gender +{ + #[Serializer\Groups(['read'])] + #[ORM\Id] + #[ORM\GeneratedValue] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)] + private ?int $id = null; + + #[Serializer\Groups(['read'])] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] + private array $label = []; + + #[Serializer\Groups(['read'])] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)] + private bool $active = true; + + #[Assert\NotNull(message: 'You must choose a gender translation')] + #[Serializer\Groups(['read'])] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, enumType: GenderEnum::class)] + private GenderEnum $genderTranslation; + + #[Serializer\Groups(['read'])] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, enumType: GenderIconEnum::class)] + private GenderIconEnum $icon; + + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, name: 'ordering', nullable: true, options: ['default' => '0.0'])] + private float $order = 0; + + public function getId(): int + { + return $this->id; + } + + public function getLabel(): array + { + return $this->label; + } + + public function setLabel(array $label): void + { + $this->label = $label; + } + + public function isActive(): bool + { + return $this->active; + } + + public function setActive(bool $active): void + { + $this->active = $active; + } + + public function getGenderTranslation(): GenderEnum + { + return $this->genderTranslation; + } + + public function setGenderTranslation(GenderEnum $genderTranslation): void + { + $this->genderTranslation = $genderTranslation; + } + + public function getIcon(): GenderIconEnum + { + return $this->icon; + } + + public function setIcon(GenderIconEnum $icon): void + { + $this->icon = $icon; + } + + public function getOrder(): float + { + return $this->order; + } + + public function setOrder(float $order): void + { + $this->order = $order; + } +} diff --git a/src/Bundle/ChillMainBundle/Entity/GenderEnum.php b/src/Bundle/ChillMainBundle/Entity/GenderEnum.php new file mode 100644 index 000000000..c9fb3c2cf --- /dev/null +++ b/src/Bundle/ChillMainBundle/Entity/GenderEnum.php @@ -0,0 +1,20 @@ +add('label', TranslatableStringFormType::class, [ + 'required' => true, + ]) + ->add('icon', EnumType::class, [ + 'class' => GenderIconEnum::class, + 'choices' => GenderIconEnum::cases(), + 'expanded' => true, + 'multiple' => false, + 'mapped' => true, + 'choice_label' => fn (GenderIconEnum $enum) => '', + 'choice_value' => fn (?GenderIconEnum $enum) => null !== $enum ? $enum->value : null, + 'label' => 'gender.admin.Select Gender Icon', + 'label_html' => true, + ]) + ->add('genderTranslation', EnumType::class, [ + 'class' => GenderEnum::class, + 'choice_label' => fn (GenderEnum $enum) => $enum->value, + 'label' => 'gender.admin.Select Gender Translation', + ]) + ->add('active', ChoiceType::class, [ + 'choices' => [ + 'Active' => true, + 'Inactive' => false, + ], + ]) + ->add('order', NumberType::class); + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Gender::class, + ]); + } +} diff --git a/src/Bundle/ChillMainBundle/Repository/GenderRepository.php b/src/Bundle/ChillMainBundle/Repository/GenderRepository.php new file mode 100644 index 000000000..56dcd1a4b --- /dev/null +++ b/src/Bundle/ChillMainBundle/Repository/GenderRepository.php @@ -0,0 +1,47 @@ + + */ +class GenderRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Gender::class); + } + + public function findByActiveOrdered(): array + { + return $this->createQueryBuilder('g') + ->select('g') + ->where('g.active = True') + ->orderBy('g.order', 'ASC') + ->getQuery() + ->getResult(); + } + + public function findByGenderTranslation($gender): array + { + return $this->createQueryBuilder('g') + ->select('g') + ->where('g.genderTranslation = :gender') + ->setParameter('gender', $gender) + ->getQuery() + ->getResult(); + } +} diff --git a/src/Bundle/ChillMainBundle/Resources/public/module/bootstrap/index.js b/src/Bundle/ChillMainBundle/Resources/public/module/bootstrap/index.js index a9d34e01d..91d66416a 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/module/bootstrap/index.js +++ b/src/Bundle/ChillMainBundle/Resources/public/module/bootstrap/index.js @@ -10,6 +10,7 @@ import Modal from 'bootstrap/js/dist/modal'; import Collapse from 'bootstrap/js/src/collapse'; import Carousel from 'bootstrap/js/src/carousel'; import Popover from 'bootstrap/js/src/popover'; +import 'bootstrap-icons/font/bootstrap-icons.css'; // // Carousel: ACHeaderSlider is a small slider used in banner of AccompanyingCourse Section @@ -59,4 +60,4 @@ const popoverList = triggerList.map(function (el) { return new Popover(el, { html: true, }); -}); \ No newline at end of file +}); diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/GenderIconRenderBox.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/GenderIconRenderBox.vue new file mode 100644 index 000000000..2aeb123c7 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/GenderIconRenderBox.vue @@ -0,0 +1,11 @@ + + + + + diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.ts b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.ts index f81699a7c..ae6f72dc5 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.ts @@ -38,7 +38,9 @@ const messages = { person: "Usager", birthday: { man: "Né le", - woman: "Née le" + woman: "Née le", + neutral: "Né·e le", + unknown: "Né·e le", }, deathdate: "Date de décès", household_without_address: "Le ménage de l'usager est sans adresse", diff --git a/src/Bundle/ChillMainBundle/Resources/views/Gender/edit.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Gender/edit.html.twig new file mode 100644 index 000000000..39f01e519 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Gender/edit.html.twig @@ -0,0 +1,75 @@ +{% extends '@ChillMain/CRUD/Admin/index.html.twig' %} + +{% block title %} + {% include('@ChillMain/CRUD/_edit_title.html.twig') %} +{% endblock %} + +{% form_theme form _self %} + +{% block _gender_icon_widget %} + {% for child in form %} +
-
-
+