diff --git a/.changes/unreleased/DX-20251030-123732.yaml b/.changes/unreleased/DX-20251030-123732.yaml new file mode 100644 index 000000000..db3ca64c2 --- /dev/null +++ b/.changes/unreleased/DX-20251030-123732.yaml @@ -0,0 +1,6 @@ +kind: DX +body: Add missing fixtures for proper loading of AccompanyingPeriods +time: 2025-10-30T12:37:32.824593456+01:00 +custom: + Issue: "280" + SchemaChange: No schema change diff --git a/.changes/unreleased/DX-20251117-160650.yaml b/.changes/unreleased/DX-20251117-160650.yaml new file mode 100644 index 000000000..f555554bc --- /dev/null +++ b/.changes/unreleased/DX-20251117-160650.yaml @@ -0,0 +1,6 @@ +kind: DX +body: Use mkdocs with mkdocs-material instead of sphinx to build chill developer documentation +time: 2025-11-17T16:06:50.46185765+01:00 +custom: + Issue: "386" + SchemaChange: No schema change diff --git a/.changes/unreleased/Feature-20251112-130016.yaml b/.changes/unreleased/Feature-20251112-130016.yaml deleted file mode 100644 index d7a576dde..000000000 --- a/.changes/unreleased/Feature-20251112-130016.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kind: Feature -body: Display appointments (calendar items) linked to a person within the search results, like it was done for accompanying periods -time: 2025-11-12T13:00:16.844313583+01:00 -custom: - Issue: "462" - SchemaChange: No schema change diff --git a/.changes/unreleased/Fixed-20251201-185859.yaml b/.changes/unreleased/Fixed-20251201-185859.yaml new file mode 100644 index 000000000..989620ad9 --- /dev/null +++ b/.changes/unreleased/Fixed-20251201-185859.yaml @@ -0,0 +1,6 @@ +kind: Fixed +body: Do not suggest a user that is no longer active in the activity form. +time: 2025-12-01T18:58:59.410998029+01:00 +custom: + Issue: "475" + SchemaChange: No schema change diff --git a/.changes/unreleased/Fixed-20251203-113832.yaml b/.changes/unreleased/Fixed-20251203-113832.yaml new file mode 100644 index 000000000..45adf3dc4 --- /dev/null +++ b/.changes/unreleased/Fixed-20251203-113832.yaml @@ -0,0 +1,6 @@ +kind: Fixed +body: Remove double display of person id in the banner when there is a deathdate +time: 2025-12-03T11:38:32.653635449+01:00 +custom: + Issue: "441" + SchemaChange: No schema change diff --git a/.changes/unreleased/UX-20251124-164723.yaml b/.changes/unreleased/UX-20251124-164723.yaml new file mode 100644 index 000000000..298cbc5ee --- /dev/null +++ b/.changes/unreleased/UX-20251124-164723.yaml @@ -0,0 +1,6 @@ +kind: UX +body: Display calendar item info on cancel page +time: 2025-11-24T16:47:23.020302054+01:00 +custom: + Issue: "460" + SchemaChange: No schema change diff --git a/.changes/unreleased/UX-20251125-150135.yaml b/.changes/unreleased/UX-20251125-150135.yaml new file mode 100644 index 000000000..f97ba7f0a --- /dev/null +++ b/.changes/unreleased/UX-20251125-150135.yaml @@ -0,0 +1,6 @@ +kind: UX +body: Display entire comment for activity item within list +time: 2025-11-25T15:01:35.558013876+01:00 +custom: + Issue: "424" + SchemaChange: No schema change diff --git a/.changes/unreleased/UX-20251126-133910.yaml b/.changes/unreleased/UX-20251126-133910.yaml new file mode 100644 index 000000000..474e52fac --- /dev/null +++ b/.changes/unreleased/UX-20251126-133910.yaml @@ -0,0 +1,6 @@ +kind: UX +body: Improve accessibility of event form +time: 2025-11-26T13:39:10.462348982+01:00 +custom: + Issue: "474" + SchemaChange: No schema change diff --git a/.changes/v4.8.0.md b/.changes/v4.8.0.md new file mode 100644 index 000000000..48583b6a2 --- /dev/null +++ b/.changes/v4.8.0.md @@ -0,0 +1,9 @@ +## v4.8.0 - 2025-11-17 +### Feature +* ([#461](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/461)) Make a calendar item on the 'mes rendez-vous' page clickable. Clicking will navigate to the edit page of the calendar item. +### Fixed +* ([#463](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/463)) Display calendar items for which an invite was accepted on the mes rendez-vous page +* Improve accessibility on login page + +### UX +* ([#449](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/449)) Remove the label if there is only one scope and no scope picking field is displayed. diff --git a/.changes/v4.8.1.md b/.changes/v4.8.1.md new file mode 100644 index 000000000..81decc30c --- /dev/null +++ b/.changes/v4.8.1.md @@ -0,0 +1,6 @@ +## v4.8.1 - 2025-11-20 +### Fixed +* Insert name of file as the document title when uploading +* Add missing path paramater 'id' for editing multiple participations +* ([#471](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/471)) Hide the display of inactive user groups in the api + diff --git a/.changes/v4.8.2.md b/.changes/v4.8.2.md new file mode 100644 index 000000000..309255feb --- /dev/null +++ b/.changes/v4.8.2.md @@ -0,0 +1,10 @@ +## v4.8.2 - 2025-11-26 +### Fixed +* ([#466](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/466)) Associate activity's creator as a participant by default, and retro-actively append the creator to each activity + + + **Schema Change**: Add columns or tables +* Fix template parameter for update_multiple route on event participations +### UX +* ([#470](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/470)) Alphabetically order userJobs and mainLocations within user creation form +* ([#437](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/437)) Change position and color of confirm parcours button diff --git a/.env b/.env index cc23653bd..0a1168f39 100644 --- a/.env +++ b/.env @@ -92,3 +92,7 @@ REDIS_URL=redis://${REDIS_HOST}:${REDIS_PORT} ###> symfony/ovh-cloud-notifier ### # OVHCLOUD_DSN=ovhcloud://APPLICATION_KEY:APPLICATION_SECRET@default?consumer_key=CONSUMER_KEY&service_name=SERVICE_NAME ###< symfony/ovh-cloud-notifier ### + +###> symfony/loco-translation-provider ### +#LOCO_DSN=loco://API_KEY@default +###< symfony/loco-translation-provider ### diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 355524fa4..b9c532b29 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,15 +38,67 @@ variables: 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 + # consider the root package at the dev-master version + # this is required to work with packages + # see https://getcomposer.org/doc/articles/troubleshooting.md#dependencies-on-the-root-package + COMPOSER_ROOT_VERSION: dev-master stages: + - mirror - Composer install - Tests - Deploy +mirror_chill_zimbra_bundle: + stage: mirror + image: alpine:latest + + variables: + GIT_DEPTH: 0 # <-- access to the full git history + + rules: + # 1) Allow manual run from GitLab UI, whatever the branch + - if: '$CI_PIPELINE_SOURCE == "web"' + + # 2) Auto-run on commits to master or 472-zimbra-connector + # but only if relevant files changed + - if: '$CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "472-zimbra-connector"' + changes: + - packages/ChillZimbraBundle/**/* + - .gitlab-ci.yml + + # 3) Otherwise: never run + - when: never + + + before_script: + - apk add --no-cache git git-subtree openssh + # Config git + - git config --global user.email "ci@gitlab.com" + - git config --global user.name "GitLab CI" + # Préparation SSH + - mkdir -p ~/.ssh + - cp "$DEPLOY_KEY" ~/.ssh/id_ed25519 + - printf '\n' >> ~/.ssh/id_ed25519 + - chmod 600 ~/.ssh/id_ed25519 + - ssh-keyscan gitlab.com >> ~/.ssh/known_hosts + # Ajout du remote vers le repo dédié + - git remote add chill-zimbra-connector git@gitlab.com:Chill-Projet/chill-zimbra-connector.git || true + + script: + # On s'assure d'être sur la bonne branche (celle qui a déclenché le job, master) + - git checkout "$CI_COMMIT_REF_NAME" + + # Crée une branche temporaire qui contient uniquement l'historique de packages/ChillZimbraBundle + - git subtree split --prefix=packages/ChillZimbraBundle -b chill_zimbra_temp + + # Push vers le repo cible, branche master du repo chill-zimbra-connector + - git push --force chill-zimbra-connector chill_zimbra_temp:main + build: stage: Composer install image: chill/base-image:8.3-edge + variables: before_script: - composer config -g cache-dir "$(pwd)/.cache" script: diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 3360abe85..9e6e76238 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -14,6 +14,7 @@ $finder = PhpCsFixer\Finder::create(); $finder ->in(__DIR__.'/src') ->in(__DIR__.'/utils') + ->in(__DIR__.'/packages') ->append([__FILE__]) ->exclude(['docs/', 'tests/app']) ->notPath('tests/app') diff --git a/.readthedocs.yml b/.readthedocs.yml index cd8f36eba..fc1abe247 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -4,11 +4,11 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.7" + python: "3.11" -sphinx: - configuration: docs/source/conf.py +mkdocs: + configuration: docs/mkdocs.yml python: install: - - requirements: docs/requirements.txt \ No newline at end of file + - requirements: docs/requirements.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index e684bb689..7b83397f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,100 +6,126 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). +## v4.8.2 - 2025-11-26 +### Fixed +* ([#466](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/466)) Associate activity's creator as a participant by default, and retro-actively append the creator to each activity + **Schema Change**: Add columns or tables +* Fix template parameter for update_multiple route on event participations +### UX +* ([#470](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/470)) Alphabetically order userJobs and mainLocations within user creation form +* ([#437](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/437)) Change position and color of confirm parcours button + +## v4.8.1 - 2025-11-20 +### Fixed +* Insert name of file as the document title when uploading +* Add missing path paramater 'id' for editing multiple participations +* ([#471](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/471)) Hide the display of inactive user groups in the api + + +## v4.8.0 - 2025-11-17 +### Feature +* ([#461](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/461)) Make a calendar item on the 'mes rendez-vous' page clickable. Clicking will navigate to the edit page of the calendar item. +### Fixed +* ([#463](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/463)) Display calendar items for which an invite was accepted on the mes rendez-vous page +* Improve accessibility on login page + +### UX +* ([#449](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/449)) Remove the label if there is only one scope and no scope picking field is displayed. + ## v4.7.0 - 2025-11-10 ### Feature -* ([#385](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/385)) Create invitation list in user menu -* ([#404](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/404)) Add columns for comments linked to an activity in the activity list export +* ([#385](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/385)) Create invitation list in user menu +* ([#404](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/404)) Add columns for comments linked to an activity in the activity list export ### Fixed -* ([#451](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/451)) Fix: display also social actions linked to parents of the selected social issue -* ([#453](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/453)) Fix: export actions and their results in csv even when action does not have any goals attached to it. -* Fix the possibility to delete a workflow +* ([#451](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/451)) Fix: display also social actions linked to parents of the selected social issue +* ([#453](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/453)) Fix: export actions and their results in csv even when action does not have any goals attached to it. +* Fix the possibility to delete a workflow **Schema Change**: Drop or rename table or columns, or enforce new constraint that must be manually fixed -* ([#457](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/457)) Fix the fusion of thirdparty properties that are located in another schema than public for TO_ONE relations + add extra loop for MANY_TO_MANY relations where thirdparty is the source instead of the target -* ([#428](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/428)) Fix suggestion of referrer when creating notification for accompanyingPeriodWorkDocument +* ([#457](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/457)) Fix the fusion of thirdparty properties that are located in another schema than public for TO_ONE relations + add extra loop for MANY_TO_MANY relations where thirdparty is the source instead of the target +* ([#428](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/428)) Fix suggestion of referrer when creating notification for accompanyingPeriodWorkDocument ### DX * Send notifications log to dedicated channel, if it exists - + ### UX -* ([#425](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/425)) Change the terms 'cercle' and 'centre' to 'service', and 'territoire' respectively. -* ([#542](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/542)) Improve the ux for selecting whether user wants to be notified of the final step of a workflow or all steps -* Expand timeSpent choices for evaluation document and translate them to user locale or fallback 'fr' -* ([#455](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/455)) Change the order of display for results and objectives in the social work/action form -* Wrap text when it is too long within badges +* ([#425](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/425)) Change the terms 'cercle' and 'centre' to 'service', and 'territoire' respectively. +* ([#542](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/542)) Improve the ux for selecting whether user wants to be notified of the final step of a workflow or all steps +* Expand timeSpent choices for evaluation document and translate them to user locale or fallback 'fr' +* ([#455](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/455)) Change the order of display for results and objectives in the social work/action form +* Wrap text when it is too long within badges ## v4.6.1 - 2025-10-27 ### Fixed -* Fix export case where no 'reason' is picked within the PersonHavingActivityBetweenDateFilter.php +* Fix export case where no 'reason' is picked within the PersonHavingActivityBetweenDateFilter.php ## v4.6.0 - 2025-10-15 ### Feature -* ([#423](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/423)) Create environment banner that can be activated and configured depending on the image deployed -* ([#394](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/394)) Only show active workflow on the page "my tracked workflow" +* ([#423](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/423)) Create environment banner that can be activated and configured depending on the image deployed +* ([#394](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/394)) Only show active workflow on the page "my tracked workflow" ### Fixed -* Fix loading of classLists in SocialIssuesAcc.vue, ensure elements are present -* Fix the rendering of list of StoredObjectVersions, where there are kept version (before converting to pdf) and intermediate versions deleted -* ([#434](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/434)) Notification: fix editing of sent notification by removing form.addressesEmails, a field that no longer exists -* Fix loading of social issues and social actions within vue component -* ([#446](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/446)) Add unique condition on stored object filename, with cleaning step on existing duplicate filenames +* Fix loading of classLists in SocialIssuesAcc.vue, ensure elements are present +* Fix the rendering of list of StoredObjectVersions, where there are kept version (before converting to pdf) and intermediate versions deleted +* ([#434](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/434)) Notification: fix editing of sent notification by removing form.addressesEmails, a field that no longer exists +* Fix loading of social issues and social actions within vue component +* ([#446](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/446)) Add unique condition on stored object filename, with cleaning step on existing duplicate filenames **Schema Change**: Drop or rename table or columns, or enforce new constraint that must be manually fixed -* [workflow] take permissions into account to delete the workflow attachment -* ([#448](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/448)) Fix the execution of daily cronjob notification, when the previous last execution storage was invalid +* [workflow] take permissions into account to delete the workflow attachment +* ([#448](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/448)) Fix the execution of daily cronjob notification, when the previous last execution storage was invalid ## v4.5.1 - 2025-10-03 ### Fixed -* Add missing javascript dependency -* Add exception handling for conversion of attachment on sending external, when documens are already in pdf +* Add missing javascript dependency +* Add exception handling for conversion of attachment on sending external, when documens are already in pdf ## v4.5.0 - 2025-10-03 ### Feature -* Only allow delete of attachment on workflows that are not final -* Move up signature buttons on index workflow page for easier access -* Filter out document from attachment list if it is the same as the workflow document -* Block edition on attached document on workflow, if the workflow is finalized or sent external -* Convert workflow's attached document to pdf while sending them external -* After a signature is canceled or rejected, going to a waiting page until the post-process routines apply a workflow transition +* Only allow delete of attachment on workflows that are not final +* Move up signature buttons on index workflow page for easier access +* Filter out document from attachment list if it is the same as the workflow document +* Block edition on attached document on workflow, if the workflow is finalized or sent external +* Convert workflow's attached document to pdf while sending them external +* After a signature is canceled or rejected, going to a waiting page until the post-process routines apply a workflow transition ### Fixed -* ([#426](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/426)) Increased the number of required characters when setting a new password in Chill from 9 to 14 - GDPR compliance -* Fix permissions on storedObject which are subject by a workflow +* ([#426](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/426)) Increased the number of required characters when setting a new password in Chill from 9 to 14 - GDPR compliance +* Fix permissions on storedObject which are subject by a workflow ### DX -* Introduce a WaitingScreen component to display a waiting screen +* Introduce a WaitingScreen component to display a waiting screen ## v4.4.2 - 2025-09-12 ### Fixed -* Fix document generation and workflow generation do not work on accompanying period work documents +* Fix document generation and workflow generation do not work on accompanying period work documents ## v4.4.1 - 2025-09-11 ### Fixed -* fix translations in duplicate evaluation document modal and realign close modal button +* fix translations in duplicate evaluation document modal and realign close modal button ## v4.4.0 - 2025-09-11 ### Feature -* ([#359](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/359)) Allow the merge of two accompanying period works -* ([#369](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/369)) Duplication of a document to another accompanying period work evaluation -* ([#359](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/359)) Fusion of two accompanying period works +* ([#359](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/359)) Allow the merge of two accompanying period works +* ([#369](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/369)) Duplication of a document to another accompanying period work evaluation +* ([#359](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/359)) Fusion of two accompanying period works ### Fixed -* Fix display of 'duplicate' and 'merge' buttons in CRUD templates -* Fix saving notification preferences in user's profile +* Fix display of 'duplicate' and 'merge' buttons in CRUD templates +* Fix saving notification preferences in user's profile ## v4.3.0 - 2025-09-08 ### Feature -* ([#409](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/409)) Add 45 and 60 min calendar ranges -* Add a command to generate a list of permissions -* ([#412](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/412)) Add an absence end date +* ([#409](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/409)) Add 45 and 60 min calendar ranges +* Add a command to generate a list of permissions +* ([#412](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/412)) Add an absence end date **Schema Change**: Add columns or tables ### Fixed -* fix date formatting in calendar range display -* Change route URL to avoid clash with person duplicate controller method +* fix date formatting in calendar range display +* Change route URL to avoid clash with person duplicate controller method ## v4.2.1 - 2025-09-03 ### Fixed -* Fix exports to work with DirectExportInterface +* Fix exports to work with DirectExportInterface ### DX * Improve error message when a stored object cannot be written on local disk - + ## v4.2.0 - 2025-09-02 ### Feature @@ -114,26 +140,26 @@ and is generated by [Changie](https://github.com/miniscruff/changie). ## v4.1.0 - 2025-08-26 ### Feature -* ([#400](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/400)) Add filter to social actions list to filter out actions where current user intervenes -* ([#399](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/399)) Show filters on list pages unfolded by default -* Expansion of event module with new fields in the creation form: thematic, internal/external animator, responsable, and budget elements. Filtering options in the event list + adapted exports +* ([#400](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/400)) Add filter to social actions list to filter out actions where current user intervenes +* ([#399](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/399)) Show filters on list pages unfolded by default +* Expansion of event module with new fields in the creation form: thematic, internal/external animator, responsable, and budget elements. Filtering options in the event list + adapted exports **Schema Change**: Add columns or tables ### Fixed -* ([#382](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/382)) adjust display logic for accompanying period dates, include closing date if period is closed. -* ([#384](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/384)) add min and step attributes to integer field in DateIntervalType +* ([#382](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/382)) adjust display logic for accompanying period dates, include closing date if period is closed. +* ([#384](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/384)) add min and step attributes to integer field in DateIntervalType ### UX -* Limit display of participations in event list +* Limit display of participations in event list ## v4.0.2 - 2025-07-09 ### Fixed -* Fix add missing translation -* Fix the transfer of evaluations and documents during of accompanyingperiodwork +* Fix add missing translation +* Fix the transfer of evaluations and documents during of accompanyingperiodwork ## v4.0.1 - 2025-07-08 ### Fixed * Fix package.json for compilation - + ## v4.0.0 - 2025-07-08 ### Feature @@ -212,30 +238,30 @@ framework: ## v3.12.1 - 2025-06-30 ### Fixed -* Fix loading of the list of documents +* Fix loading of the list of documents ## v3.12.0 - 2025-06-30 ### Feature -* ([#377](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/377)) Add the document file name to the document title when a user upload a document, unless there is already a document title. -* Add desactivation date for social action and issue csv export -* Add Emoji and Fullscreen feature to ckeditor configuration -* ([#321](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/321)) Create editor which allow us to toggle between rich and simple text editor -* Do not remove workflow which are automatically canceled after staling for more than 30 days +* ([#377](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/377)) Add the document file name to the document title when a user upload a document, unless there is already a document title. +* Add desactivation date for social action and issue csv export +* Add Emoji and Fullscreen feature to ckeditor configuration +* ([#321](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/321)) Create editor which allow us to toggle between rich and simple text editor +* Do not remove workflow which are automatically canceled after staling for more than 30 days ### Fixed -* ([#376](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/376)) trying to prevent bug of typeerror in doc-history + improved display of document history -* ([#381](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/381)) Display previous participation in acc course work even if the person has left the acc course -* ([#372](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/372)) Fix display of text in calendar events -* Add missing translation for user_group.no_user_groups -* Fix admin entity edit actions for event admin entities and activity reason (category) entities +* ([#376](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/376)) trying to prevent bug of typeerror in doc-history + improved display of document history +* ([#381](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/381)) Display previous participation in acc course work even if the person has left the acc course +* ([#372](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/372)) Fix display of text in calendar events +* Add missing translation for user_group.no_user_groups +* Fix admin entity edit actions for event admin entities and activity reason (category) entities * ([#392](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/392)) Allow null and cast as string to setContent method for NewsItem - -* ([#393](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/393)) Doc Generation: the "dump only" method send the document as an email attachment. + +* ([#393](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/393)) Doc Generation: the "dump only" method send the document as an email attachment. ### DX -* ([#352](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/352)) Remove dead code for wopi-link module -* Replace library node-sass by sass, and upgrade bootstrap to version 5.3 (yarn upgrade / install is required) +* ([#352](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/352)) Remove dead code for wopi-link module +* Replace library node-sass by sass, and upgrade bootstrap to version 5.3 (yarn upgrade / install is required) ### UX -* ([#374](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/374)) Remove default filter in_progress for the page 'my tasks'; Allows for new tasks to be displayed upon opening of the page -* Improve labeling of fields in person resource creation form +* ([#374](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/374)) Remove default filter in_progress for the page 'my tasks'; Allows for new tasks to be displayed upon opening of the page +* Improve labeling of fields in person resource creation form ## v3.11.0 - 2025-04-17 ### Feature @@ -259,11 +285,11 @@ framework: ## v3.10.3 - 2025-03-18 ### DX -* Eslint fixes +* Eslint fixes ## v3.10.2 - 2025-03-17 ### Fixed -* Replace a ts-expect-error with a ts-ignore +* Replace a ts-expect-error with a ts-ignore ## v3.10.1 - 2025-03-17 ### DX @@ -271,37 +297,37 @@ framework: ## v3.10.0 - 2025-03-17 ### Feature -* ([#363](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/363)) Display social actions grouped per social issue within activity form +* ([#363](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/363)) Display social actions grouped per social issue within activity form ### Fixed -* ([#362](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/362)) Fix Dependency Injection, which prevented to save the CalendarRange -* ([#368](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/368)) fix search query for user groups +* ([#362](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/362)) Fix Dependency Injection, which prevented to save the CalendarRange +* ([#368](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/368)) fix search query for user groups ## v3.9.2 - 2025-02-27 ### Fixed -* Use fetchResults method to fetch all social issues instead of only the first page +* Use fetchResults method to fetch all social issues instead of only the first page ## v3.9.1 - 2025-02-27 ### Fixed -* Fix post/patch request with missing 'type' property for gender +* Fix post/patch request with missing 'type' property for gender ## v3.9.0 - 2025-02-27 ### Feature -* ([#349](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/349)) Suggest all referrers within actions of the accompanying period when creating an activity -* ([#343](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/343)) Add possibility to export a csv with all social issues and social actions -* ([#360](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/360)) Restore document to previous kept version when a workflow is canceled -* ([#341](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/341)) Add a list of third parties from within the admin (csv download) +* ([#349](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/349)) Suggest all referrers within actions of the accompanying period when creating an activity +* ([#343](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/343)) Add possibility to export a csv with all social issues and social actions +* ([#360](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/360)) Restore document to previous kept version when a workflow is canceled +* ([#341](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/341)) Add a list of third parties from within the admin (csv download) ### Fixed -* fix generation of document with accompanying period context, and list of activities and works +* fix generation of document with accompanying period context, and list of activities and works ### DX -* ([#333](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/333)) Create an unique source of trust for translations +* ([#333](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/333)) Create an unique source of trust for translations ## v3.8.2 - 2025-02-10 ### Fixed -* ([#358](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/358)) Remove "filter" button on list of documents in the workflow's "add attachement" modal +* ([#358](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/358)) Remove "filter" button on list of documents in the workflow's "add attachement" modal ## v3.8.1 - 2025-02-05 ### Fixed -* Fix household link in the parcours banner +* Fix household link in the parcours banner ## v3.8.0 - 2025-02-03 ### Feature @@ -317,7 +343,7 @@ framework: ## v3.7.1 - 2025-01-21 ### Fixed -* Fix legacy configuration processor for notifier component +* Fix legacy configuration processor for notifier component ## v3.7.0 - 2025-01-21 ### Feature @@ -384,33 +410,33 @@ chill_main: ## v3.6.0 - 2025-01-16 ### Feature -* Importer for addresses does not fails when the postal code is not found with some addresses, and compute a recap list of all addresses that could not be imported. This recap list can be send by email. +* Importer for addresses does not fails when the postal code is not found with some addresses, and compute a recap list of all addresses that could not be imported. This recap list can be send by email. * ([#346](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/346)) Create a driver for storing documents on disk (instead of openstack object store) - -* Add address importer from french Base d'Adresse Nationale (BAN) -* ([#343](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/343)) Add csv export for social issues and social actions + +* Add address importer from french Base d'Adresse Nationale (BAN) +* ([#343](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/343)) Add csv export for social issues and social actions ### Fixed -* Export: fix missing alias in activity between certain dates filter. Condition added for alias. +* Export: fix missing alias in activity between certain dates filter. Condition added for alias. ## v3.5.3 - 2025-01-07 ### Fixed -* Fix the EntityToJsonTransformer to return an empty array if the value is "" +* Fix the EntityToJsonTransformer to return an empty array if the value is "" ## v3.5.2 - 2024-12-19 ### Fixed -* ([#345](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/345)) Export: activity filtering of users that were associated to an activity between certain dates. Results contained activities that were not within the specified date range" +* ([#345](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/345)) Export: activity filtering of users that were associated to an activity between certain dates. Results contained activities that were not within the specified date range" ## v3.5.1 - 2024-12-16 ### Fixed -* Filiation: fix the display of the gender label in the graph -* Wrap handling of PdfSignedMessage into transactions +* Filiation: fix the display of the gender label in the graph +* Wrap handling of PdfSignedMessage into transactions ## v3.5.0 - 2024-12-09 ### Feature -* ([#318](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/318)) Show all the pages of the documents in the signature app +* ([#318](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/318)) Show all the pages of the documents in the signature app ### Fixed -* Wrap the signature's change state into a transaction, to avoid race conditions -* Fix display of gender label +* Wrap the signature's change state into a transaction, to avoid race conditions +* Fix display of gender label ## v3.4.3 - 2024-12-05 ### Fixed @@ -419,76 +445,76 @@ chill_main: ## v3.4.2 - 2024-12-05 ### Fixed -* ([#329](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/329)) Fix the serialization of gender for the generation of documents -* ([#337](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/337)) Enforce unique contraint on activity storedobject +* ([#329](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/329)) Fix the serialization of gender for the generation of documents +* ([#337](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/337)) Enforce unique contraint on activity storedobject ### DX -* ([#310](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/310)) Clean migrations, to reduce the number of bloated migration when running diff on schema +* ([#310](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/310)) Clean migrations, to reduce the number of bloated migration when running diff on schema ## v3.4.1 - 2024-11-22 ### Fixed -* Set the workflow's title to notification content and subject +* Set the workflow's title to notification content and subject ## v3.4.0 - 2024-11-20 ### Feature * ([#314](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/314)) Admin: improve document type admin form with a select field for related class. -Admin: Allow administrator to assign multiple group centers in one go to a user. +Admin: Allow administrator to assign multiple group centers in one go to a user. ## v3.3.0 - 2024-11-20 ### Feature * Electronic signature -Implementation of the electronic signature for documents within chill. -* ([#286](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/286)) The behavoir of the voters for stored objects is adjusted so as to limit edit and delete possibilities to users related to the activity, social action or workflow entity. -* ([#288](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/288)) Metadata form added for person signatures -* Add a signature step in workflow, which allow to apply an electronic signature on documents -* Keep an history of each version of a stored object. -* Add a "send external" step in workflow, which allow to send stored objects and other elements to remote people, by sending them a public url +Implementation of the electronic signature for documents within chill. +* ([#286](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/286)) The behavoir of the voters for stored objects is adjusted so as to limit edit and delete possibilities to users related to the activity, social action or workflow entity. +* ([#288](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/288)) Metadata form added for person signatures +* Add a signature step in workflow, which allow to apply an electronic signature on documents +* Keep an history of each version of a stored object. +* Add a "send external" step in workflow, which allow to send stored objects and other elements to remote people, by sending them a public url ### Fixed -* Adjust household list export to include households even if their address is NULL -* Remove validation of date string on deathDate +* Adjust household list export to include households even if their address is NULL +* Remove validation of date string on deathDate ## v3.2.4 - 2024-11-06 ### Fixed -* Fix compilation of chill assets +* 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 +Fix color of Chill footer ## v3.2.2 - 2024-10-31 ### Fixed -* Fix gender translation for unknown +* 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. +* 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 +* 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 +* ([#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 + +* 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-23 & 2024-07-19 ### Feature @@ -523,13 +549,13 @@ Fix color of Chill footer ## 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 @@ -572,7 +598,7 @@ Fix color of Chill footer ## 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 @@ -619,96 +645,96 @@ Fix color of Chill footer ## 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 @@ -722,7 +748,7 @@ Fix color of Chill footer ## 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 @@ -753,36 +779,36 @@ Fix color of Chill footer ## 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 @@ -807,11 +833,11 @@ Fix color of Chill footer ## 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 @@ -859,57 +885,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/composer.json b/composer.json index c1e235670..d6864d63f 100644 --- a/composer.json +++ b/composer.json @@ -7,6 +7,13 @@ "chill", "social worker" ], + "repositories": [{ + "type": "path", + "url": "./packages/ChillZimbraBundle", + "options": { + "symlink": true + } + }], "require": { "php": "^8.2", "ext-dom": "*", @@ -14,6 +21,7 @@ "ext-openssl": "*", "ext-redis": "*", "ext-zlib": "*", + "chill-project/chill-zimbra-bundle": "@dev", "champs-libres/wopi-bundle": "dev-symfony-v5@dev", "champs-libres/wopi-lib": "dev-master@dev", "doctrine/data-fixtures": "^1.8", @@ -54,6 +62,7 @@ "symfony/http-client": "^5.4", "symfony/http-foundation": "^5.4", "symfony/intl": "^5.4", + "symfony/loco-translation-provider": "^6.0", "symfony/mailer": "^5.4", "symfony/messenger": "^5.4", "symfony/mime": "^5.4", diff --git a/config/bundles.php b/config/bundles.php index 72b5e22f5..989338f3e 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -37,4 +37,5 @@ return [ Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], Symfony\UX\Translator\UxTranslatorBundle::class => ['all' => true], loophp\PsrHttpMessageBridgeBundle\PsrHttpMessageBridgeBundle::class => ['all' => true], + Chill\ZimbraBundle\ChillZimbraBundle::class => ['all' => true], ]; diff --git a/config/packages/chill.yaml b/config/packages/chill.yaml index 0f5aa08b7..26f91feb5 100644 --- a/config/packages/chill.yaml +++ b/config/packages/chill.yaml @@ -1,5 +1,5 @@ chill_main: - available_languages: [ '%env(resolve:LOCALE)%', 'en' ] + available_languages: [ '%env(resolve:LOCALE)%', 'en', 'nl' ] available_countries: ['BE', 'FR'] top_banner: visible: false diff --git a/config/packages/translation.yaml b/config/packages/translation.yaml index b3f8f9cfe..928125aef 100644 --- a/config/packages/translation.yaml +++ b/config/packages/translation.yaml @@ -1,7 +1,12 @@ +# config/packages/translation.yaml framework: - default_locale: en + default_locale: '%env(resolve:LOCALE)%' # LOCALE=fr in .env translator: default_path: '%kernel.project_dir%/translations' fallbacks: - - en + - '%env(resolve:LOCALE)%' # fr providers: + loco: + dsn: '%env(LOCO_DSN)%' + domains: [ 'messages' ] + locales: [ 'fr', 'nl' ] diff --git a/config/packages/translation_chill.yaml b/config/packages/translation_chill.yaml deleted file mode 100644 index a0371ff10..000000000 --- a/config/packages/translation_chill.yaml +++ /dev/null @@ -1,4 +0,0 @@ -framework: - default_locale: '%env(resolve:LOCALE)%' - translator: - fallbacks: [ '%env(resolve:LOCALE)%' ] \ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile index ec37e687c..c35370d9d 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,177 +1,34 @@ -# Makefile for Sphinx documentation +# Makefile for MkDocs documentation # # You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = build +MKDOCS = mkdocs +BUILDDIR = site -# User-friendly check for sphinx-build -ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) -$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +# User-friendly check for mkdocs +ifeq ($(shell which $(MKDOCS) >/dev/null 2>&1; echo $$?), 1) +$(error The '$(MKDOCS)' command was not found. Make sure you have MkDocs installed with 'pip install mkdocs mkdocs-material', then make sure the mkdocs executable is in your PATH.) endif -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext +.PHONY: help clean html build serve help: @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " xml to make Docutils-native XML files" - @echo " pseudoxml to make pseudoxml-XML files for display purposes" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @echo " html to build the documentation (same as build)" + @echo " build to build the documentation" + @echo " serve to start the development server" + @echo " clean to clean the build directory" clean: rm -rf $(BUILDDIR)/* -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html +html: build + +build: + $(MKDOCS) build @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + @echo "Build finished. The HTML pages are in $(BUILDDIR)/." -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/chill-doc.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/chill-doc.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/chill-doc" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/chill-doc" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -latexpdfja: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through platex and dvipdfmx..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." - -xml: - $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml - @echo - @echo "Build finished. The XML files are in $(BUILDDIR)/xml." - -pseudoxml: - $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml - @echo - @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." +serve: + $(MKDOCS) serve + @echo "Development server started at http://127.0.0.1:8000/" diff --git a/docs/README.md b/docs/README.md index 8ae7f650a..301ccfb6a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -10,20 +10,26 @@ Compilation into HTML To compile this documentation : -1. Install [sphinx-doc](http://sphinx-doc.org) +1. Install [MkDocs](https://www.mkdocs.org/) and MkDocs Material ``` bash $ virtualenv .venv # creation of the virtual env (only the first time) $ source .venv/bin/activate # activate the virtual env (.venv) $ pip install -r requirements.txt ``` 2. Install submodules : $ git submodule update --init; -3. run `make html` from the root directory -4. The base file is located on build/html/index.html +3. run `make html` or `mkdocs build` from the root directory +4. The base file is located on site/index.html ``` bash - $ cd build/html + $ cd site $ python -m http.server 8888 # will serve the site on the port 8888 ``` +Alternatively, you can use the built-in development server: +``` bash +(.venv) $ mkdocs serve +``` +This will start a development server at http://127.0.0.1:8000/ with live reload. + Contribute =========== diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml new file mode 100644 index 000000000..c1faac741 --- /dev/null +++ b/docs/mkdocs.yml @@ -0,0 +1,137 @@ +site_name: Chill Documentation +site_description: Documentation for Chill - A free software for social workers +site_url: https://docs.chill.social +repo_url: https://gitlab.com/Chill-project/chill-bundles +repo_name: Chill-project/chill-bundles + +docs_dir: source + +copyright: Copyright © 2014-2024 Champs-Libres Cooperative SCRLFS - GNU Free Documentation License v1.3 + +theme: + name: material + language: en + features: + - navigation.tabs + - navigation.tabs.sticky + - navigation.sections + - navigation.expand + - navigation.path + - navigation.top + - search.highlight + - search.share + - search.suggest + - toc.follow + - content.code.copy + - content.code.annotate + + palette: + # Palette toggle for light mode + - scheme: default + primary: blue + accent: blue + toggle: + icon: material/brightness-7 + name: Switch to dark mode + + # Palette toggle for dark mode + - scheme: slate + primary: blue + accent: blue + toggle: + icon: material/brightness-4 + name: Switch to light mode + + font: + text: Roboto + code: Roboto Mono + +plugins: + - search + - autorefs + +markdown_extensions: + - admonition + - pymdownx.details + - pymdownx.superfences + - pymdownx.highlight: + anchor_linenums: true + line_spans: __span + pygments_lang_class: true + - pymdownx.inlinehilite + - pymdownx.snippets + - pymdownx.tabbed: + alternate_style: true + - pymdownx.tasklist: + custom_checkbox: true + - toc: + permalink: true + - tables + - attr_list + - md_in_html + +nav: + - Home: index.md + - Installation: + - installation/index.md + - Development: installation/installation-development.md + - Production: installation/installation-production.md + - Document Storage: installation/document-storage.md + - Load Addresses: installation/load-addresses.md + - Production Setup: installation/prod.md + - Calendar SMS: installation/prod-calendar-sms-sending.md + - MS Graph Configuration: installation/msgraph-configure.md + - Enable Collabora: installation/enable-collabora-for-dev.md + - Development: + - development/index.md + - Access Control: development/access_control_model.md + - API: development/api.md + - Assets: development/assets.md + - Code Quality: development/code-quality.md + - Create Bundle: development/create-a-new-bundle.md + - Cronjobs: development/cronjob.md + - CRUD: development/crud.md + - Database Principles: development/database-principles.md + - Embeddable Comments: development/embeddable-comments.md + - Entity Info: development/entity-info.md + - ESLint: development/es-lint.md + - Exports: development/exports.md + - FAQ: development/FAQ.md + - Forms: development/forms.md + - Localisation: development/localisation.md + - Logging: development/logging.md + - Manual: + - development/manual/index.md + - Routing and Menus: development/manual/routing-and-menus.md + - Menus: development/menus.md + - Messages to Users: development/messages-to-users.md + - Migrations: development/migrations.md + - Pagination: development/pagination.md + - Render Entity: development/render-entity.md + - Routing: development/routing.md + - Run Tests: development/run-tests.md + - Searching: development/searching.md + - Timelines: development/timelines.md + - Useful Snippets: development/useful-snippets.md + - User Interface: + - CSS Classes: development/user-interface/css-classes.md + - JS Functions: development/user-interface/js-functions.md + - Layout Template: development/user-interface/layout-template-usage.md + - Widgets: development/user-interface/widgets.md + - Bundles: + - bundles/index.md + - Activity: bundles/activity.md + - Custom Fields: bundles/custom-fields.md + - Event: bundles/event.md + - Group: bundles/group.md + - LDAP: bundles/ldap.md + - Main: bundles/main.md + - Person: bundles/person.md + - Report: bundles/report.md + +extra: + social: + - icon: fontawesome/brands/gitlab + link: https://gitlab.com/Chill-project + - icon: fontawesome/solid/comments + link: https://app.element.io/#/room/#chill-social-admin:matrix.org diff --git a/docs/requirements.txt b/docs/requirements.txt index a8d979a2b..82fb39971 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,4 @@ -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 +mkdocs>=1.5.3 +mkdocs-material>=9.4.0 +pymdown-extensions>=10.3.0 +mkdocs-autorefs>=0.5.0 diff --git a/docs/source/bundles/activity.md b/docs/source/bundles/activity.md new file mode 100644 index 000000000..f98f9b009 --- /dev/null +++ b/docs/source/bundles/activity.md @@ -0,0 +1,49 @@ +# Activity bundle + +This bundle provides the ability to record people in the software. This bundle is required by other bundle. + +###### Entities provided + + Describe the entities provided. + +###### Configuration options + +Those options are available under `chill_activity` key. + +Example of configuration: + +```yaml + chill_activity: + form: + time_duration: + - { label: '12 minutes', seconds: 720 } + - { label: '30 minutes', seconds: 1800 } +``` + +form.time_duration *array* + The duration which might be suggested when the user create or update an activity. The value must be an array of object, where each object must have a `label` and a `seconds` key. The label provide which is shown to user (the label will be translated, if possible) and the seconds the duration. + + Example: see the example above + + Default value: the values available are 5, 10, 15, 20, 25, 30, 45 minutes, and 1 hour, 1 hour 15, 1 hour 30, 1 hour 45 and 2 hours. + +###### Macros + +## Activity reason sticker + +Macro file + `ChillActivityBundle:ActivityReason:macro.html.twig` +Macro envelope + `reason(r)` + + `p` is an instance of :class:`Chill\ActivityBundle\Entity\ActivityReason` + +When to use this macro ? + When you want to represent an activity reason. +Example usage : + + ```jinja + {% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %} + + {{ m.reason(r) }} + ``` diff --git a/docs/source/bundles/activity.rst b/docs/source/bundles/activity.rst deleted file mode 100644 index 011983e0a..000000000 --- a/docs/source/bundles/activity.rst +++ /dev/null @@ -1,71 +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". - -.. _activity-bundle: - -Activity bundle -############### - -This bundle provides the ability to record people in the software. This bundle is required by other bundle. - -.. contents:: Table of content - :local: - -Entities provided -***************** - -.. todo:: - - Describe the entities provided. - - -Configuration options -********************* - -Those options are available under `chill_activity` key. - -Example of configuration: - -.. code-block:: yaml - - chill_activity: - form: - time_duration: - - { label: '12 minutes', seconds: 720 } - - { label: '30 minutes', seconds: 1800 } - -form.time_duration *array* - The duration which might be suggested when the user create or update an activity. The value must be an array of object, where each object must have a :code:`label` and a :code:`seconds` key. The label provide which is shown to user (the label will be translated, if possible) and the seconds the duration. - - Example: see the example above - - Default value: the values available are 5, 10, 15, 20, 25, 30, 45 minutes, and 1 hour, 1 hour 15, 1 hour 30, 1 hour 45 and 2 hours. - -.. _activity-bundle-macros: - -Macros -****** - -Activity reason sticker -======================= - -Macro file - `ChillActivityBundle:ActivityReason:macro.html.twig` -Macro envelope - :code:`reason(r)` - - :code:`p` is an instance of :class:`Chill\ActivityBundle\Entity\ActivityReason` - -When to use this macro ? - When you want to represent an activity reason. -Example usage : - .. code-block:: html+jinja - - {% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %} - - {{ m.reason(r) }} diff --git a/docs/source/bundles/custom-fields.rst b/docs/source/bundles/custom-fields.md similarity index 79% rename from docs/source/bundles/custom-fields.rst rename to docs/source/bundles/custom-fields.md index f56b0dc23..646de34f6 100644 --- a/docs/source/bundles/custom-fields.rst +++ b/docs/source/bundles/custom-fields.md @@ -1,15 +1,4 @@ -.. 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". - -.. _custom-fields-bundle: - -Custom fields bundle -==================== +## Custom fields bundle This bundle provides the ability to add custom fields to existing entities. @@ -17,79 +6,63 @@ Those custom fields contains extra data and will be stored in the DB, along with In the database, custom fields are stored in json format. -.. seealso:: + The full specification discussed [here](https://redmine.champs-libres.coop/issues/239) - The full specification discussed `here. `_ - - `JSON Type on postgresql documentation `_ + [JSON Type on postgresql documentation](http://www.postgresql.org/docs/9.3/static/datatype-json.html) The documentation of json type, which is used to store data in the database. - -.. contents:: Table of contents - :depth: 4 - :local: -Custom Fields concepts ----------------------- +### Custom Fields concepts Custom fields are extra data which may be added to entities by user. If a developer implements custom fields on a entity, users will be able to add more fields on this entity. -Example: the `person bundle` allows to record `firstname`, `lastname`, `date of birth` fields. But users need to store information about the kind of house he has (if he owns his house, if he rents it, ...). Custom fields allows to create those fields. +Example: the [person bundle` allows to record `firstname`, `lastname`, `date of birth` fields. But users need to store information about the kind of house he has (if he owns his house, if he rents it, ...). Custom fields allows to create those fields. Automatically, those fields are added at the person form. They are also printed in the person view and in exports. -Custom fields and custom fields group -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +##### Custom fields and custom fields group -Custom fields are associated to a custom fields group. When a user want to add custom fields on an entity, he must first create a custom fields group and associate this field with an entity. Then he may add add custom fields to this groups. +Custom fields are associated to a custom fields group. When a user want to add custom fields on an entity, he must first create a custom fields group and associate this field with an entity. Then he may add add custom fields to this groups. Some entities needs a **default** custom fields group. For instance, the default custom fields group will be printed on the main form for person, and will be appended on the main person view. Some bundle does not use this feature (i.e. the `report` bundle). -.. note:: - In the future of the `person bundle`, other custom fields group will be added in forms accessible from the menu, allowing users to completely customize and separate their entities. - -Allow custom fields on an entity --------------------------------- + +### Allow custom fields on an entity As a developer, you must allow your users to add custom fields on your entities. -.. warning:: For having custom fields, the class of the entity must contain a variable for storing the custom data. **By convention this variable must be called $cFData** - -Create a json field on your entity -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +##### Create a json field on your entity Declare a json field in your database : - -.. code-block:: yaml - +```bash Chill\CustomFieldsBundle\Entity\BlopEntity: type: entity # ... fields: cFData: type: json_array - +``` + Create the field accordingly in the class logic : -.. code-block:: php - +```bash namespace Chill\CustomFieldsBundle\Entity; - + /** * BlopEntity */ class BlopEntity { - + /** * @var array */ private $cFData; - + /** - * You must set a setter in order to save automatically custom + * You must set a setter in order to save automatically custom * fields from forms, using Form Component * * @param array $cFData @@ -100,9 +73,9 @@ Create the field accordingly in the class logic : $this->cFData = $cFData; return $this; } - + /** - * You also must create a getter in order to let Form + * You also must create a getter in order to let Form * component populate form fields * * @return array @@ -111,9 +84,9 @@ Create the field accordingly in the class logic : { return $this->cFData; } - -Declare your customizable entity in configuration -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +``` + +##### Declare your customizable entity in configuration This step is necessary to allow user to create custom fields group associated with this entity. @@ -130,26 +103,25 @@ This method is discouraged but explained first as it helps to undersand the reco Add those file under `chill_custom_fields` section : -.. code-block:: yaml - +```yaml chill_custom_fields: customizables_entities: - { class: Chill\YourBundleBundle\Entity\BlopEntity, name: blop_entity } - +``` + * The `name` allow you to define a string which is translatable. This string will appears when chill's admin will add/retrieve new customFieldsGroup. * The class, which is a full FQDN class path Automatically, in DependencyInjection/Extension class (recommended) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -This is the recommended way for declaring customizable classes. +This is the recommended way for declaring customizable classes. You can prepend configuration of `custom fields bundle` from the class `YourBundle\DependencyInjection\YourBundleExtension`. **Note** that you also have to implements `Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface` on this class to make the `prepend` function being taken into account. -Example here : - -.. code-block:: php +Example here : +```php class ChillYourBundleExtension extends Extension implements PrependExtensionInterface { /** @@ -163,48 +135,44 @@ Example here : } $container->prependExtensionConfig('chill_custom_fields', - array('customizables_entities' => + array('customizables_entities' => array( array( - 'class' => 'Chill\YourBundleBundle\Entity\BlopEntity', + 'class' => 'Chill\YourBundleBundle\Entity\BlopEntity', 'name' => 'blop_entity',) ) ) ); } } +``` * The `name` allow you to define a string which is translatable. This string will appears when chill's admin will add/retrieve new customFieldsGroup. * The class, which is a full FQDN class path -.. seealso:: - - `How to simplify configuration of multiple bundles `_ + `How to simplify configuration of multiple bundles ](http://symfony.com/doc/current/cookbook/bundles/prepend_extension.html) A cookbook page about prepending configuration. - -Adding options to your custom fields groups -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +##### Adding options to your custom fields groups You may add options to the groups associated with an entity. -In `config.yml` the declaration should be : - -.. code-block:: yaml +In `config.yml` the declaration should be : +```yaml chill_custom_fields: customizables_entities: - - + - class: Chill\YourBundleBundle\Entity\BlopEntity name: BlopEntity options: # this will create a "myFieldKey" field as text, with a maxlength attribute to 150 (see http://symfony.com/doc/master/reference/forms/types/text.html) - myFieldKey: {form_type: text, form_options: {attr: [maxlength: 150]}} + myFieldKey: {form_type: text, form_options: {attr: [maxlength: 150]}} +``` -In the `PrependExtensionInterface::prepend` function, the options key will be added in the configuration definition : - -.. code-block:: php +In the `PrependExtensionInterface::prepend` function, the options key will be added in the configuration definition : +```php class ChillYourBundleExtension extends Extension implements PrependExtensionInterface { /** @@ -218,10 +186,10 @@ In the `PrependExtensionInterface::prepend` function, the options key will be ad } $container->prependExtensionConfig('chill_custom_fields', - array('customizables_entities' => + array('customizables_entities' => array( array( - 'class' => 'Chill\YourBundleBundle\Entity\BlopEntity', + 'class' => 'Chill\YourBundleBundle\Entity\BlopEntity', 'name' => 'BlopEntity', 'options' => array( 'myFieldKey' => [ 'form_type' => 'text', 'form_options' => [ 'attr' => [ 'maxlength' => 150 ] ] @@ -231,16 +199,15 @@ In the `PrependExtensionInterface::prepend` function, the options key will be ad ); } } - -**Example :** the entity `Report` from **ReportBundle** has to pick some custom fields belonging to a group to print them in *summaries* the timeline page. The definition will use the special type `custom_fields_group_linked_custom_field` which will add a select input with all fields associated with the current custom fields group : +``` -.. code-block:: php +**Example :** the entity `Report` from **ReportBundle** has to pick some custom fields belonging to a group to print them in *summaries* the timeline page. The definition will use the special type `custom_fields_group_linked_custom_field` which will add a select input with all fields associated with the current custom fields group : +```php class ChillReportExtension extends Extension implements PrependExtensionInterface { /** - * - * +###### * * @param ContainerBuilder $container */ public function prepend(ContainerBuilder $container) @@ -251,15 +218,15 @@ In the `PrependExtensionInterface::prepend` function, the options key will be ad } $container->prependExtensionConfig('chill_custom_fields', - array('customizables_entities' => + array('customizables_entities' => array( array( - 'class' => 'Chill\ReportBundle\Entity\Report', + 'class' => 'Chill\ReportBundle\Entity\Report', 'name' => 'ReportEntity', 'options' => array( 'summary_fields' => array( 'form_type' => 'custom_fields_group_linked_custom_fields', - 'form_options' => + 'form_options' => [ 'multiple' => true, 'expanded' => false @@ -271,14 +238,13 @@ In the `PrependExtensionInterface::prepend` function, the options key will be ad ); } } +``` Note that `custom_fields_group_linked_custom_fields` does not create any input on `CustomFieldsGroup` creation : there aren't any fields associated with the custom fields just after the group creation... You have to add custom fields and associate them with the newly created group to see them appears. -Rendering custom fields and custom fields group in a template -------------------------------------------------------------- +### Rendering custom fields and custom fields group in a template -.. warning:: - Each custom field can be `active` or not. Only `active` custom fields has to be dislayed. +Each custom field can be `active` or not. Only `active` custom fields has to be dislayed. For rendering custom fields, two function are available : @@ -290,8 +256,7 @@ For rendering custom fields group, a function is available : * `chill_custom_fields_group_widget` to render the widget. It will display the custom fields of the group in a dd / dt structure. -chill_custom_field_label -^^^^^^^^^^^^^^^^^^^^^^^^ +##### chill_custom_field_label The signature is : @@ -300,29 +265,23 @@ The signature is : Examples -.. code-block:: jinja - {{ chill_custom_field_label(customField) }} - - -chill_custom_field_widget -^^^^^^^^^^^^^^^^^^^^^^^^^ +##### chill_custom_field_widget The signature is : * array **$fields** the array raw, as stored in the db -* CustomField **$customField** a customField instance +* CustomField **$customField** a customField instance * string **$documentType** the type of document. Default to `html`. Examples: -.. code-block:: jinja - +```bash {{ chill_custom_field_widget(entity.customFields, customField) }} +``` -chill_custom_field_is_empty -^^^^^^^^^^^^^^^^^^^^^^^^^^^ +##### chill_custom_field_is_empty The signature is : @@ -331,13 +290,9 @@ The signature is : Examples : -.. code-block:: jinja - {%- if chill_custom_field_is_empty(cFData, customField) == false -%} - -chill_custom_fields_group_widget -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +##### chill_custom_fields_group_widget This function only display custom fields that are `active`. @@ -346,19 +301,17 @@ The signature is : * array **$fields** the array raw, as stored in the db * CustomFieldsGroup **$customFieldsGroup** the custom field group to render -.. code-block:: jinja - +```bash {{ chill_custom_fields_group_widget(entity.cFData, entity.customFieldsGroup) }} +``` -Custom Fields's form --------------------- +### Custom Fields's form You should simply use the 'custom_field' type in a template, with the group you would like to render in the `group` option's type. -Example : - -.. code-block:: php +Example : +```php namespace Chill\ReportBundle\Form; use Symfony\Component\Form\AbstractType; @@ -377,14 +330,14 @@ Example : $builder ->add('user') - ->add('date', 'date', + ->add('date', 'date', array('required' => true, 'widget' => 'single_text', 'format' => 'dd-MM-yyyy')) #add the custom fields : - ->add('cFData', 'custom_field', + ->add('cFData', 'custom_field', array('attr' => array('class' => 'cf-fields'), 'group' => $options['cFGroup'])) ; } - + /** * @param OptionsResolverInterface $resolver */ @@ -413,29 +366,25 @@ Example : return 'chill_reportbundle_report'; } } +``` - -Available configuration ------------------------- +### Available configuration Those options are available in the configuration, under the `chill_custom_field` key. Example : - -.. code-block:: yaml - +```yaml chill_custom_field: show_empty_values_in_views: false +``` show_empty_values_in_views *boolean*: Allow to hide / show empty values in views. The aim of this configuration parameter is to hide (or show) empty values when :term:`custom fields group` are rendered. Default value : `true` -Glossary --------- -.. glossary:: +### Glossary custom fields group A group of custom fields diff --git a/docs/source/bundles/event.rst b/docs/source/bundles/event.md similarity index 63% rename from docs/source/bundles/event.rst rename to docs/source/bundles/event.md index b902ee444..2fdd77ee7 100644 --- a/docs/source/bundles/event.rst +++ b/docs/source/bundles/event.md @@ -1,24 +1,18 @@ -.. Copyright (C) 2016 Champs Libres Cooperative SCRLFS - Permission is granted to copy, distribute and/or modify this document +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". -.. _event-bundle: +# Event bundle -Event bundle -############ - -Template & Menu -=============== +## Template & Menu The event bundle has a special template with a specific menu for actions on events. This menu is called `event`. -ChillEventBundle::layout.html.twig ----------------------------------- +### ChillEventBundle::layout.html.twig This layout extends `ChillMainBundle::layoutWithVerticalMenu.html.twig` and add the menu `event` @@ -26,4 +20,4 @@ It proposes a new block : * event_content - * where to display content relative to the event. + * where to display content relative to the event. \ No newline at end of file diff --git a/docs/source/bundles/group.md b/docs/source/bundles/group.md new file mode 100644 index 000000000..1a69b9cdc --- /dev/null +++ b/docs/source/bundles/group.md @@ -0,0 +1,33 @@ +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". + +# Group bundle + +Allow to group people in a group. This group may be a family, an activity group, ... + +###### Entities + +###### Macros + +## Group sticker + +Macro file + `ChillGroupBundle:Group:macro.html.twig` +Macro name + `_render` +Macro envelope + `group`, instance of :class:`Chill\GroupBundle\Entity\CGroup` + +When to use this macro ? + When you want to represent group. +Example usage : + + ```jinja + {% import 'ChillGroupBundle:Group:macro.html.twig' as m %} + + {{ m._render(g) }} + ``` diff --git a/docs/source/bundles/group.rst b/docs/source/bundles/group.rst deleted file mode 100644 index 5d601084d..000000000 --- a/docs/source/bundles/group.rst +++ /dev/null @@ -1,49 +0,0 @@ -.. Copyright (C) 2016 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". - -.. _group-bundle: - -Group bundle -############ - -Allow to group people in a group. This group may be a family, an activity group, ... - -.. contents:: Table of content - :local: - -Entities -******** - -.. figure:: /_static/bundles/group/group_classes_uml.png - - -.. _group-bundle-macros: - -Macros -****** - -Group sticker -============== - -Macro file - `ChillGroupBundle:Group:macro.html.twig` -Macro name - :code:`_render` -Macro envelope - :code:`group`, instance of :class:`Chill\GroupBundle\Entity\CGroup` - -When to use this macro ? - When you want to represent group. -Example usage : - .. code-block:: html+jinja - - {% import 'ChillGroupBundle:Group:macro.html.twig' as m %} - - {{ m._render(g) }} - - diff --git a/docs/source/bundles/index.md b/docs/source/bundles/index.md new file mode 100644 index 000000000..045223396 --- /dev/null +++ b/docs/source/bundles/index.md @@ -0,0 +1,23 @@ +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". + +# Bundles documentation + +You will find here documentation about bundles working with Chill. + +- [Main bundle](main.md) +- [Custom Fields bundle](custom-fields.md) +- [Person bundle](person.md) +- [Report bundle](report.md) +- [Activity bundle](activity.md) +- [Group bundle](group.md) +- [Event bundle](event.md) +- [Ldap bundle (synchronisation between ldap and database)](ldap.md) + +### Your bundle here ? + +The contributors still do not have a policy about those bundle integration, but we would like to be very open on this subject. Please write to us [or open an issue ](https://redmine.champs-libres.coop/projects/chill/issues). diff --git a/docs/source/bundles/index.rst b/docs/source/bundles/index.rst deleted file mode 100644 index 2c4f3f17e..000000000 --- a/docs/source/bundles/index.rst +++ /dev/null @@ -1,29 +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". - -Bundles documentation -############################### - -You will find here documentation about bundles working with Chill. - -.. toctree:: - :maxdepth: 2 - - Main bundle - Custom Fields bundle - Person bundle - Report bundle - Activity bundle - Group bundle - Event bundle - Ldap bundle (synchronisation between ldap and database) - -Your bundle here ? -------------------- - -The contributors still do not have a policy about those bundle integration, but we would like to be very open on this subject. Please write to us `or open an issue `_. diff --git a/docs/source/bundles/ldap.rst b/docs/source/bundles/ldap.md similarity index 64% rename from docs/source/bundles/ldap.rst rename to docs/source/bundles/ldap.md index ccea046a8..69b84baff 100644 --- a/docs/source/bundles/ldap.rst +++ b/docs/source/bundles/ldap.md @@ -1,94 +1,70 @@ -.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS - Permission is granted to copy, distribute and/or modify this document +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". -.. _ldap-bundle: - -LDAP bundle -########### +# LDAP bundle This bundle binds the database with an ldap directory. The bundle synchronize the ldap directory with users in the database. It also provides a way to check user credentials against the ldap directory. - -.. contents:: Table of content :local: -Current limitations -******************* +###### Current limitations - The length of the ldap dn must be < 255 characters - if the username extracted from the ldap is updated, the changes are not reflected in the database and remains the same +###### Entities provided -Entities provided -***************** +This bundle provides only one entity : :class:[Chill\\LdapBundle\\Entity\\UserLdapBinding` -This bundle provides only one entity : :class:`Chill\\LdapBundle\\Entity\\UserLdapBinding` +###### How the synchronizer works ? -How the synchronizer works ? -**************************** - -#. The synchronizer performs a query on :code:`dn` and :code:`query` defined in the :ref:`configuration `. -#. For each entry returned by the query, it looks if the :code:`dn` exists in the database +#. The synchronizer performs a query on `dn` and `query` defined in the [configuration ](configuration.md). +#. For each entry returned by the query, it looks if the `dn` exists in the database #. If the entry does not exists : - #. the synchronizer looks for user with same username as defined by :code:`username_attr`, and bind it with the :code:`dn` if it exists. - #. else, a user is created with username defined by :code:`username_attr` (if the ldap contains more than one attribute, the first attribute returned is used) + #. the synchronizer looks for user with same username as defined by `username_attr`, and bind it with the `dn` if it exists. + #. else, a user is created with username defined by `username_attr` (if the ldap contains more than one attribute, the first attribute returned is used) - #. if a user exists which is already binded with the :code:`dn`, the entry is ignored. + #. if a user exists which is already binded with the `dn`, the entry is ignored. -#. The synchronizer looks for dn existing in database and which were not returned by the query performed in 1. +#. The synchronizer looks for dn existing in database and which were not returned by the query performed in 1. - #. If they exists, those user are set to :code:`enabled=false`: they are not allowed to login. + #. If they exists, those user are set to `enabled=false`: they are not allowed to login. -Installation -************ +###### Installation -This bundle requires : +This bundle requires : - PHP LDAP ext -- :code:`symfony/ldap` with minimal version 3.1. Note that, currently, Chill uses Symfony 2.8: you should add the dependency on this single package manually +- `symfony/ldap` with minimal version 3.1. Note that, currently, Chill uses Symfony 2.8: you should add the dependency on this single package manually -In your composer.json, for stable version : - -.. code-block:: json +In your composer.json, for stable version : "require": { - // .. other dependencies + // .. other dependencies "symfony/ldap" : "~3.1", "chill-project/ldap": "~1.0" } - - And for dev version : -.. code-block:: json - "require": { - // .. other dependencies + // .. other dependencies "symfony/ldap" : "~3.1", "chill-project/ldap": "dev-master@dev" } +###### Configuration -.. _configuration: - -Configuration -************** - -Configuration of the bundle -============================ - -.. code-block:: yaml +## Configuration of the bundle # Default configuration for extension with alias: "chill_ldap" chill_ldap: @@ -125,10 +101,7 @@ Configuration of the bundle # The attribute which will provide username (=login) username_attr: cn - -Example : - -.. code-block:: yaml +Example : chill_ldap: server: @@ -140,16 +113,12 @@ Example : dn: dc=champs-libres,dc=coop query: "(&(objectClass=inetOrgPerson)(userPassword=*))" - -Configuration of the security part of chill -============================================ +## Configuration of the security part of chill Simply add the following config in the firewall of the security bundle : `chill_ldap_form_login: ~`. This config is located in `app/config/security.yml` -Example of a configuration : - -.. code-block:: yaml +Example of a configuration : # in app/config/security.yml @@ -168,37 +137,23 @@ Example of a configuration : # enable the login check by a form, against the ldap chill_ldap_form_login: ~ # this is the line you should add - -Note that, if you enable the login check by form **and** by the ldap, +Note that, if you enable the login check by form **and** by the ldap, the password will be checked against the database **and** against the ldap. If one of them match, the login will succeed. -If you want to completely disable login check against the database, -simply remove the :code:`form_login` entry and all his options. +If you want to completely disable login check against the database, +simply remove the `form_login` entry and all his options. -.. _command-and-crontab: +## Command and crontab -Command and crontab -=================== - -Synchronize the database : - -.. code-block:: bash +Synchronize the database : php app/console chill:ldap:synchronize - -For getting more debug message : - -.. code-block:: bash +For getting more debug message : php app/console chill:ldap:synchronize -vvv - - -You should run this command regularly (using crontab or -`systemd timer `_) +You should run this command regularly (using crontab or +`systemd timer ](https://www.freedesktop.org/software/systemd/man/systemd.timer.html#)) to synchronize ldap and database automatically. - - - diff --git a/docs/source/bundles/main.rst b/docs/source/bundles/main.md similarity index 57% rename from docs/source/bundles/main.rst rename to docs/source/bundles/main.md index da195c98e..4cadf32d5 100644 --- a/docs/source/bundles/main.rst +++ b/docs/source/bundles/main.md @@ -1,15 +1,12 @@ -.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS - Permission is granted to copy, distribute and/or modify this document +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". -.. _main-bundle: - -Main bundle -########### + +# Main bundle This bundle is **required** for running Chill. @@ -18,32 +15,24 @@ This bundle provide : * Access control model (users, groups, and all concepts) * ... - -.. warning:: - this section is incomplete. -.. _main-bundle-macros: +###### Macros -Macros -****** - -Address sticker -=============== +## Address sticker Macro file `ChillMainBundle:Address:macro.html.twig` Macro name - :code:`_render` + `_render` Macro envelope - :code:`address`, instance of :class:`Chill\MainBundle\Entity\Address` + `address`, instance of :class:`Chill\MainBundle\Entity\Address` When to use this macro ? When you want to represent an address. Example usage : - .. code-block:: html+jinja - - {% import 'ChillMainBundle:Address:macro.html.twig' as m %} - - {{ m._render(address) }} + ```jinja + {% import 'ChillMainBundle:Address:macro.html.twig' as m %} + {{ m._render(address) }} + ``` diff --git a/docs/source/bundles/person.rst b/docs/source/bundles/person.md similarity index 68% rename from docs/source/bundles/person.rst rename to docs/source/bundles/person.md index f4199e52f..1d9b0ad2c 100644 --- a/docs/source/bundles/person.rst +++ b/docs/source/bundles/person.md @@ -1,65 +1,41 @@ -.. 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". - -.. _person-bundle: - -Person bundle -############# +# Person bundle This bundle provides the ability to record people in the software. This bundle is required by other bundle. -.. contents:: Table of content - :local: - -Entities provided -***************** - -.. todo:: +###### Entities provided describe entities provided by person bundle - - -Search terms -************ -The class `Chill\PersonBundle\Search\PersonSearch` provide the search module. -Domain -====== +###### Search terms + +The class [Chill\PersonBundle\Search\PersonSearch` provide the search module. + +## Domain The search upon "person" is provided by default. The `@person` domain search may be omitted. * `@person` is the domain search for people. - -Arguments -========= +## Arguments * `firstname` : provide the search on firstname. Example : `firstname:Depardieu`. May match part of the firstname (`firsname:dep` will match Depardieu) * `lastname` : provide the search on lastname. May match part of the lastname. * `birthdate` : provide the search on the birthdate. Example : `birthdate:1996-01-19` * `gender`: performs search on man/woman. The accepted values are `man` or `woman`. -* `nationality` : performs search on nationality. Value must be a country code `as described in ISO 3166 `_. Example : `nationality:FR`. +* `nationality` : performs search on nationality. Value must be a country code `as described in ISO 3166 ](http://www.iso.org/iso/fr/home/standards/country_codes.htm). Example : [nationality:FR`. -Default -======= +## Default The default search is performed on firstname and/or lastname. Both are concatened before search. If values are separated by spaces, the clause `AND` is used : the search `dep ge` will match 'Gérard Depardieu` or 'Jean Depagelles', but not 'Charline Depardieu' (missing 'Ge' in word). -Configuration options -********************* +###### Configuration options Those options are available under `chill_person` key. Example of configuration: -.. code-block:: yaml - +```yaml chill_person: validation: birthdate_not_after: P15Y @@ -73,17 +49,18 @@ Example of configuration: marital_status: visible spoken_languages: hidden address: visible +``` birthdate_not_after *string* - The period duration before today during which encoding birthdate is not possible. The period is a string matching the format of `ISO_8601`, which is also use to build `DateInterval classes `_. + The period duration before today during which encoding birthdate is not possible. The period is a string matching the format of `ISO_8601`, which is also use to build `DateInterval classes ](http://php.net/manual/en/dateinterval.construct.php). - Example: `P1D`, `P18Y` + Example: [P1D`, `P18Y` Default value: `P1D` which means that birthdate before the current day (= yesterday) are allowed. person_fields *array* - This define the visibility of some fields. By default, all fields are visible, but you can choose to hide some of them. Available keys are : - + This define the visibility of some fields. By default, all fields are visible, but you can choose to hide some of them. Available keys are : + * `nationality` * `country_of_birth` * `place_of_birth` @@ -97,73 +74,62 @@ person_fields *array* Default value : `visible`, which means that all fields are visible. - Example: - - .. code-block:: yaml + Example: +```yaml chill_person: person_fields: nationality: hidden email: hidden phonenumber: hidden +``` -.. note:: If all the field of a "box" are hidden, the whole box does not appears. Example: if the fields `phonenumber` and `email` are hidden, the title `Contact information` will be hidden in the UI. -.. note:: - If you hide multiple fields, for a better integration you may want to override the template, for a better appeareance. See `the symfony documentation `_ about this feature. + If you hide multiple fields, for a better integration you may want to override the template, for a better appeareance. See `the symfony documentation ](http://symfony.com/doc/current/book/templating.html#overriding-bundle-templates) about this feature. -.. _person-bundle-macros: +###### Macros -Macros -****** - -Sticker for a person -===================== +## Sticker for a person Macro file `ChillPersonBundle:Person:macro.html.twig` Macro envelope - :code:`render(p, withLink=false)` + `render(p, withLink=false)` - :code:`p` is an instance of :class:`Chill\PersonBundle\Entity\Person` + `p` is an instance of `Chill\PersonBundle\Entity\Person` - :code:`withLink` :class:`boolean` + `withLink`: `boolean` When to use this macro ? When you want to represent a person. Example usage : - .. code-block:: html+jinja + ```jinja + {% import "ChillPersonBundle:Person:macro.html.twig" as person_ %} - {% import "ChillPersonBundle:Person:macro.html.twig" as person_ %} + {{ person_.render(person, true) }} + ``` - {{ person_.render(person, true) }} +###### Layout events and delegated blocks -Layout events and delegated blocks -*********************************** - -:code:`chill_block.person_post_vertical_menu` event -==================================================== +## `chill_block.person_post_vertical_menu` event This event is available to add content below of the vertical menu (on the right). -The context is : +The context is : -- :code:`person` : the current person which is rendered. Instance of :class:`Chill\PersonBundle\Entity\Person` +- `person` : the current person which is rendered. Instance of `Chill\PersonBundle\Entity\Person` -Widgets -******* +###### Widgets -Add a list of person on homepage -================================ +## Add a list of person on homepage The bundle provide a way to add a list of accompanyied person on the homepage: -.. code-block:: yaml - +```yaml chill_main: widgets: - homepage: - - + homepage: + - order: 10 widget_alias: person_list person_list: @@ -180,15 +146,11 @@ The bundle provide a way to add a list of accompanyied person on the homepage: # when the view is overriden, you can add some custom fields # to the view custom_fields: [school-2fb5440e-192c-11e6-b2fd-74d02b0c9b55] - -Commands -******** +``` +###### Commands -:code:`chill:person:move` -========================= - -.. code-block:: txt +## `chill:person:move` Usage: chill:person:move [options] @@ -213,21 +175,17 @@ Commands Move all the entities associated to a person onto another one, and remove the old person. -.. warning:: - - Some entities are ignored and will be deleted: + Some entities are ignored and will be deleted: - the accompanying periods ; - the data attached to a person entity: name, address, date of birth, etc. Thos should be merge before the move. -It is advised to run first the command with the :code:`dump-sql` option and, then, use the :code:`force` option. +It is advised to run first the command with the `dump-sql` option and, then, use the `force` option. The moving and suppression is executed inside a transaction, ensuring no data loss if the migration fails. -.. note:: + Using bash and awk, it is easy to use a TSV file (values separated by a tab, not a comma) to create move commands. Assuming our file is named `twins.tsv` and contains two columns: the first one with `from` ids, and the second one with `to` ids: - Using bash and awk, it is easy to use a TSV file (values separated by a tab, not a comma) to create move commands. Assuming our file is named :code:`twins.tsv` and contains two columns: the first one with :code:`from` ids, and the second one with :code:`to` ids: - - .. code-block:: bash - - awk '{ print "php app/console chill:person:move --dump-sql --from " $1 " --to " $2;}' twins.tsv + ```bash + awk '{ print "php app/console chill:person:move --dump-sql --from " $1 " --to " $2;}' twins.tsv +``` diff --git a/docs/source/bundles/report.md b/docs/source/bundles/report.md new file mode 100644 index 000000000..717f9e9d6 --- /dev/null +++ b/docs/source/bundles/report.md @@ -0,0 +1,23 @@ +# Report bundle + +This bundle provides the ability to record report about people. We use custom fields to let user add fields to reports. + +The documentation about report is not written + +## Concepts + +## Search + +### Domain + +* `@report` is the domain search for reports. + +### Arguments + +* `date` : The date of the report + +### Default + +The report's date is the default value. + +An error is thrown if an argument `date` and a default is used. diff --git a/docs/source/bundles/report.rst b/docs/source/bundles/report.rst deleted file mode 100644 index d71caa0be..000000000 --- a/docs/source/bundles/report.rst +++ /dev/null @@ -1,46 +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". - -.. _report-bundle: - -Report bundle -############# - -This bundle provides the ability to record report about people. We use custom fields to let user add fields to reports. - -.. contents:: Table of content - :local: - -.. todo:: - - The documentation about report is not writtend - -Concepts -======== - - -Search -====== - -Domain ------- - -* `@report` is the domain search for reports. - - -Arguments ---------- - -* `date` : The date of the report - -Default -------- - -The report's date is the default value. - -An error is thrown if an argument `date` and a default is used. diff --git a/docs/source/development/FAQ.md b/docs/source/development/FAQ.md new file mode 100644 index 000000000..ffda670b8 --- /dev/null +++ b/docs/source/development/FAQ.md @@ -0,0 +1,23 @@ +# 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. + +``` + docker compose build --pull php + # replace existing containers + docker compose up -d --force-recreate php +``` diff --git a/docs/source/development/FAQ.rst b/docs/source/development/FAQ.rst deleted file mode 100644 index c0b7e37e8..000000000 --- a/docs/source/development/FAQ.rst +++ /dev/null @@ -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 diff --git a/docs/source/development/access_control_model.rst b/docs/source/development/access_control_model.md similarity index 91% rename from docs/source/development/access_control_model.rst rename to docs/source/development/access_control_model.md index e159f7fb6..a05b84766 100644 --- a/docs/source/development/access_control_model.rst +++ b/docs/source/development/access_control_model.md @@ -1,19 +1,15 @@ -.. Copyright (C) 2015 Champs Libres Cooperative SCRLFS - Permission is granted to copy, distribute and/or modify this document +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". -Access controle model -********************** +###### Access controle model -.. contents:: Table of content :local: -Concepts -======== +## Concepts Every time an entity is created, viewed or updated, the software check if the user has the permission to make this action. The decision is made with three parameters : @@ -23,20 +19,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 -===== +## TL;DR -Resolve scope and center ------------------------- +### 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; @@ -58,8 +49,6 @@ In a service, resolve the center and scope of an entity In twig template, resolve the center: -.. code-block:: twig - {# resolve a center #} {% if person|chill_resolve_center is not null%} @@ -81,8 +70,6 @@ In twig template, resolve the center: In twig template, resolve the scope: -.. code-block:: twig - {% if entity|chill_is_scope_concerned %} {% if entity|chill_resolve_scope is iterable %} @@ -98,10 +85,7 @@ In twig template, resolve the scope: {% endfor %} {%- endif -%} -Build a ``Voter`` ------------------ - -.. code-block:: php +### Build a ``Voter`` build(); } - protected function supports($attribute, $subject) { return $this->voterHelper->supports($attribute, $subject); @@ -194,25 +177,19 @@ Build a ``Voter`` return array(); } - public function getRolesWithHierarchy() { return ['PersonDocument' => $this->getRoles() ]; } } - - - -From an user point of view -========================== +## 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 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. @@ -222,8 +199,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 --------------------------------- +### 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,9 +209,7 @@ 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 ? -==================================================== +## Where does the [`scope`` and ``center`` comes from ? Most often, scope and center comes from user's input: @@ -256,30 +230,23 @@ But sometimes, this implementation does not fits the needs: 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 ? ------------------------------------- +### Is my entity "concerned" by scopes ? Some entities are concerned by scope, some not. This is also programmatically resolved. -The concepts translated into code -=================================== +## The concepts translated into code -.. figure:: /_static/access_control_model.png Schema of the access control model Chill handle **entities**, like *persons*, *reports* (associated to *persons*), *activities* (also associated to *_persons*), ... On creation, those entities are linked to one center and, eventually, to one scope. They implements the interface `HasCenterInterface`. -.. note:: - Somes entities are linked to a center through the entity they are associated with. For instance, *activities* or *reports* are associated to a *person*, and the person is associated to a *center*. The *report*'s *center* is always the *person*'s *center*. Entities may be associated with a scope. In this case, they implement the `HasScopeInterface`. -.. note:: - Currently, only the *person* entity is not associated with a scope. At each step of his lifetime (creation, view of the entity and eventually of his details, update and, eventually, deletion), the right of the user are checked. To decide wether the user is granted right to execute the action, the software must decide with those elements : @@ -291,13 +258,10 @@ 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 ? -============================ +## 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 : -.. code-block:: php - class MyController extends Controller { @@ -311,12 +275,9 @@ Just use the symfony way-of-doing, but do not forget to associate the entity you And in template : -.. code-block:: twig - {{ if is_granted('CHILL_ENTITY_SEE', entity) %}print something{% endif %} -Retrieving reachable scopes and centers for a user --------------------------------------------------- +### Retrieving reachable scopes and centers for a user The class :class:`Chill\\MainBundle\\Security\\Authorization\\AuthorizationHelperInterface` helps you to get centers and scope reachable by a user. @@ -325,9 +286,7 @@ 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 - -Adding your own roles ---------------------- +### 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. @@ -336,28 +295,20 @@ To create your own roles, you should: * implement your own voter. This voter will have to extends the :class:`Chill\\MainBundle\\Security\\AbstractChillVoter`. As defined by Symfony, this voter must be declared as a service and tagged with `security.voter`; * declare the role through implementing a service tagged with `chill.role` and implementing :class:`Chill\\MainBundle\\Security\\ProvideRoleInterface`. -.. note:: - Both operation may be done through a simple class: you can implements :class:`Chill\\MainBundle\\Security\\ProvideRoleInterface` and :class:`Chill\\MainBundle\\Security\\AbstractChillVoter` on the same class. See live example: :class:`Chill\\ActivityBundle\\Security\\Authorization\\ActivityVoter`, and similar examples in the `PersonBundle` and `ReportBundle`. -.. seealso:: - - `How to Use Voters to Check User Permissions `_ + `How to Use Voters to Check User Permissions ](http://symfony.com/doc/current/cookbook/security/voters_data_permission.html) From the symfony cookbook - `New in Symfony 2.6: Simpler Security Voters `_ + [New in Symfony 2.6: Simpler Security Voters ](http://symfony.com/blog/new-in-symfony-2-6-simpler-security-voters) From the symfony blog - -Declare your role -^^^^^^^^^^^^^^^^^^ +##### Declare your role To declare new role, implement the class :class:`Chill\\MainBundle\\Security\\ProvideRoleInterface`. -.. code-block:: php - interface ProvideRoleInterface { /** @@ -375,21 +326,15 @@ To declare new role, implement the class :class:`Chill\\MainBundle\\Security\\Pr public function getRolesWithoutScope(); } - Then declare your service with a tag `chill.role`. Example : -.. code-block:: yaml - your_service: class: Chill\YourBundle\Security\Authorization\YourVoter tags: - { name: chill.role } - Example of an implementation of :class:`Chill\\MainBundle\\Security\\ProvideRoleInterface`: -.. code-block:: php - namespace Chill\PersonBundle\Security\Authorization; use Chill\MainBundle\Security\ProvideRoleInterface; @@ -412,13 +357,10 @@ Example of an implementation of :class:`Chill\\MainBundle\\Security\\ProvideRole } -Adding role hierarchy -^^^^^^^^^^^^^^^^^^^^^ +##### Adding role hierarchy You should prepend Symfony's security component directly from your code. -.. code-block:: php - namespace Chill\ReportBundle\DependencyInjection; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Config\FileLocator; @@ -450,10 +392,7 @@ You should prepend Symfony's security component directly from your code. } } - - -Implement your voter -^^^^^^^^^^^^^^^^^^^^ +##### Implement your voter Most of the time, Voter will check that: @@ -464,7 +403,6 @@ Most of the time, Voter will check that: 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``; @@ -472,9 +410,6 @@ Then voter implementation should take care of: This is an example of implementation: - -.. code-block:: php - build(); } - protected function supports($attribute, $subject) { return $this->voterHelper->supports($attribute, $subject); @@ -553,7 +487,6 @@ This is an example of implementation: // ... } - public function getRolesWithHierarchy() { // ... @@ -562,8 +495,6 @@ This is an example of implementation: 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 @@ -572,18 +503,13 @@ Then, you will have to declare the service and tag it as a voter : tags: - { name: security.voter } - -How to resolve scope and center programmatically ? -================================================== +## 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; @@ -605,8 +531,6 @@ In a service, resolve the center and scope of an entity In twig template, resolve the center: -.. code-block:: twig - {# resolve a center #} {% if person|chill_resolve_center is not null%} @@ -628,8 +552,6 @@ In twig template, resolve the center: In twig template, resolve the scope: -.. code-block:: twig - {% if entity|chill_is_scope_concerned %} {% if entity|chill_resolve_scope is iterable %} @@ -645,8 +567,7 @@ In twig template, resolve the scope: {% endfor %} {%- endif -%} -What is the default implementation of Scope and Center resolver ? ------------------------------------------------------------------ +### What is the default implementation of Scope and Center resolver ? By default, the implementation rely on association into entities. @@ -657,16 +578,14 @@ By default, the implementation rely on association into entities. Then, the default implementation will resolve the center and scope based on the implementation in your model. -How to change the default behaviour ? -------------------------------------- +### 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 -======================================== +## 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. @@ -674,14 +593,11 @@ 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 { @@ -729,11 +645,9 @@ Example in a controller: } } -Writing ``ACLAwareRepository`` ------------------------------- +### Writing ``ACLAwareRepository`` -The ACLAwareRepository should rely on interfaces -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +##### The ACLAwareRepository should rely on interfaces As described above, the ACLAwareRepository will perform the query for listing entities, and take care of authorization. @@ -743,9 +657,6 @@ 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 - `_ - * `How to create your custom normalizer `_ + * [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 -======================= +## Autoloading the routes Ensure that those lines are present in your file `app/config/routing.yml`: - -.. code-block:: yaml - +```yaml chill_cruds: resource: 'chill_main_crud_route_loader:load' type: service +``` +## Create your model -Create your model -================= +Create your model in the usual way: -Create your model on the usual way: - -.. code-block:: php - - namespace Chill\PersonBundle\Entity\AccompanyingPeriod; +```php +namespace Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod\OriginRepository; use Doctrine\ORM\Mapping as ORM; @@ -87,16 +67,14 @@ Create your model on the usual way: // .. getters and setters } +``` +## Configure api -Configure api -============= +Configure the api using YAML (see the full configuration: [api_full_configuration](api_full_configuration.md)): -Configure the api using Yaml (see the full configuration: :ref:`api_full_configuration`): - -.. code-block:: yaml - - # config/packages/chill_main.yaml +```yaml +# config/packages/chill_main.yaml chill_main: apis: accompanying_period_origin: @@ -113,15 +91,13 @@ Configure the api using Yaml (see the full configuration: :ref:`api_full_configu methods: GET: true HEAD: true +``` + If you are working on a shared bundle (aka "The chill bundles"), you should define your configuration inside the class `ChillXXXXBundleExtension`, using the "prependConfig" feature: -.. 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 - +```php namespace Chill\PersonBundle\DependencyInjection; + use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; use Symfony\Component\HttpFoundation\Request; @@ -155,13 +131,13 @@ Configure the api using Yaml (see the full configuration: :ref:`api_full_configu 'base_role' => 'ROLE_USER', 'actions' => [ '_index' => [ - 'methods' => [ + 'methods' => [ Request::METHOD_GET => true, Request::METHOD_HEAD => true ], ], '_entity' => [ - 'methods' => [ + 'methods' => [ Request::METHOD_GET => true, Request::METHOD_HEAD => true ] @@ -172,37 +148,35 @@ Configure the api using Yaml (see the full configuration: :ref:`api_full_configu ]); } } +``` -The :code:`_index` and :code:`_entity` action -********************************************* +###### The `_index` and `_entity` action -The :code:`_index` and :code:`_entity` action are default actions: +The `_index` and `_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` + Name: `chill_api_single_accompanying_period_origin__index` - Path: :code:`/api/1.0/person/accompanying-period/origin.{_format}` + Path: `/api/1.0/person/accompanying-period/origin.{_format}` Entity: - Name: :code:`chill_api_single_accompanying_period_origin__entity` + Name: `chill_api_single_accompanying_period_origin__entity` - Path: :code:`/api/1.0/person/accompanying-period/origin/{id}.{_format}` + Path: `/api/1.0/person/accompanying-period/origin/{id}.{_format}` -Role -**** +###### 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. +By default, the key `base_role` is used to check ACL. Take care of creating the `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. +For index action, the role will be called with `NULL` as `$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 +```yaml +# config/packages/chill_main.yaml chill_main: apis: accompanying_period_origin: @@ -217,16 +191,13 @@ You can also define a role for each method. In this case, this role is used for 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 +###### Customize the controller +You can customize the controller by hooking into the default actions. Take care of extending `Chill\MainBundle\CRUD\Controller\ApiController`. +```php namespace Chill\PersonBundle\Controller; use Chill\MainBundle\CRUD\Controller\ApiController; @@ -240,14 +211,14 @@ You can customize the controller by hooking into the default actions. Take care $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: +```yaml + chill_main: apis: accompanying_period_origin: base_path: '/api/1.0/person/accompanying-period/origin' @@ -265,15 +236,15 @@ And set your controller in configuration: methods: GET: true HEAD: true +``` -Create your own actions -*********************** +###### Create your own actions You can add your own actions: -.. code-block:: yaml +```yaml - chill_main: +chill_main: apis: - class: Chill\PersonBundle\Entity\AccompanyingPeriod @@ -281,7 +252,7 @@ You can add your own actions: base_path: /api/1.0/person/accompanying-course controller: Chill\PersonBundle\Controller\AccompanyingCourseApiController actions: - # add a custom participation: + # add custom participation: participation: methods: POST: true @@ -296,13 +267,13 @@ You can add your own actions: 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. +The key `single-collection` with value `single` will add a `/{id}/ + "action name"` (in this example, `/{id}/participation`) into the path, after the base path. If the value is `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 - +```php namespace Chill\PersonBundle\Controller; use Chill\MainBundle\CRUD\Controller\ApiController; @@ -326,10 +297,10 @@ Then, create the corresponding action into your controller: $this->eventDispatcher = $eventDispatcher; $this->validator = $validator; } - + public function participationApi($id, Request $request, $_format) { - /** @var AccompanyingPeriod $accompanyingPeriod */ + /** @var AccompanyingPeriod $accompanyingPeriod */ $accompanyingPeriod = $this->getEntity('participation', $id, $request); $person = $this->getSerializer() ->deserialize($request->getContent(), Person::class, $_format, []); @@ -363,20 +334,18 @@ Then, create the corresponding action into your controller: return $this->json($participation); } } +``` -Managing association -******************** +###### Managing association -ManyToOne 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. +In ManyToOne association, you can add associated entities using the `PATCH` request. By default, the serializer deserialize entities only with their id and discriminator type, if any. Example: -.. code-block:: bash - - curl -X 'PATCH' \ +``` +curl -X 'PATCH' \ 'http://localhost:8001/api/1.0/person/accompanying-course/2668.json' \ -H 'accept: */*' \ -H 'Content-Type: application/json' \ @@ -386,16 +355,15 @@ Example: "id": 2668, "origin": { "id": 11 } }' +``` -ManyToMany associations -======================= +## ManyToMany associations -In OneToMany association, you can easily create route for adding and removing entities, using :code:`POST` and :code:`DELETE` requests. +In OneToMany association, you can easily create route for adding and removing entities, using `POST` and `DELETE` requests. -Prepare your entity, creating the methods :code:`addYourEntity` and :code:`removeYourEntity`: - -.. code-block:: php +Prepare your entity, creating the methods `addYourEntity` and `removeYourEntity`: +```php namespace Chill\PersonBundle\Entity; use Chill\MainBundle\Entity\Scope; @@ -437,12 +405,12 @@ Prepare your entity, creating the methods :code:`addYourEntity` and :code:`remov { $this->scopes->removeElement($scope); } - +``` Create your route into the configuration: -.. code-block:: yaml - +```yaml + # config/packages/chill_main.yaml` chill_main: apis: - @@ -469,14 +437,12 @@ Create your route into the configuration: 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[^/]++)/scope\.(?P<_format>[^/]++)$}sD | @@ -488,14 +454,10 @@ This will create a new route, which will accept two methods: DELETE and POST: | 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 - +```php namespace Chill\PersonBundle\Controller; use Chill\MainBundle\CRUD\Controller\ApiController; @@ -510,14 +472,14 @@ Then, create the controller action. Call the method: 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. +This will allow adding a scope by his id and deleting them. Curl requests: -.. code-block:: bash - - # add a scope with id 5 +``` +# add a scope with id 5 curl -X 'POST' \ 'http://localhost:8001/api/1.0/person/accompanying-course/2868/scope.json' \ -H 'accept: */*' \ @@ -536,14 +498,13 @@ Curl requests: "id": 5, "type": "scope" }' +``` -Deserializing an association where multiple types are allowed -============================================================= +## Deserializing an association where multiple types are allowed -Sometimes, multiples types are allowed as association to one entity: - -.. code-block:: php +Sometimes, multiple types are allowed as association to one entity: +```php namespace Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\Person; @@ -553,7 +514,6 @@ Sometimes, multiples types are allowed as association to one entity: class Resource { - /** * @ORM\ManyToOne(targetEntity=ThirdParty::class) * @ORM\JoinColumn(nullable=true) @@ -566,7 +526,6 @@ Sometimes, multiples types are allowed as association to one entity: */ private $person; - /** * * @param $resource Person|ThirdParty @@ -575,8 +534,8 @@ Sometimes, multiples types are allowed as association to one entity: { // ... } - - + + /** * @return ThirdParty|Person * @Groups({"read", "write"}) @@ -586,13 +545,13 @@ Sometimes, multiples types are allowed as association to one entity: 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 - +```php namespace Chill\PersonBundle\Serializer\Normalizer; use Chill\PersonBundle\Entity\Person; @@ -606,7 +565,6 @@ You must, then, create your own CustomNormalizer. You can help yourself using th use Symfony\Component\Serializer\Exception; use Chill\MainBundle\Serializer\Normalizer\DiscriminatedObjectDenormalizer; - class AccompanyingPeriodResourceNormalizer implements DenormalizerInterface, DenormalizerAwareInterface { use DenormalizerAwareTrait; @@ -632,35 +590,34 @@ You must, then, create your own CustomNormalizer. You can help yourself using th DiscriminatedObjectDenormalizer::TYPE, $format, // into the context, we add the list of allowed types: - [ - DiscriminatedObjectDenormalizer::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 -**************************** +###### Serialization for collection A specific model has been defined for returning collection: -.. code-block:: json - - { +``` +{ "count": 49, "results": [ ], @@ -672,13 +629,13 @@ A specific model has been defined for returning collection: "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 `). - -.. code-block:: php +In custom actions, this can be achieved quickly by assembling results into a `Chill\MainBundle\Serializer\Model\Collection`. The pagination information is given by using `Paginator` (see [Pagination ](pagination-ref.md)). +```php use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Chill\MainBundle\Pagination\PaginatorInterface; @@ -692,15 +649,11 @@ In custom actions, this can be achieved quickly by assembling results into a :co return $this->json($model, Response::HTTP_OK, [], $context); } } +``` +###### Full configuration example -.. _api_full_configuration: - -Full configuration example -************************** - -.. code-block:: yaml - +```yaml apis: - class: Chill\PersonBundle\Entity\AccompanyingPeriod @@ -743,5 +696,4 @@ Full configuration example path: null single-collection: single base_role: null - - +``` diff --git a/docs/source/development/assets.rst b/docs/source/development/assets.md similarity index 79% rename from docs/source/development/assets.rst rename to docs/source/development/assets.md index 3584ef3f6..e197fe7f0 100644 --- a/docs/source/development/assets.rst +++ b/docs/source/development/assets.md @@ -1,91 +1,61 @@ - -.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS - Permission is granted to copy, distribute and/or modify this document +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". -.. _forms: - -Assets -####### +# Assets The Chill assets (js, css, images, …) can be managed by `Webpack Encore`_, which is a thin wrapper for `Webpack`_ in Symfony applications. -Installation -************ +###### Installation Webpack Encore needs to be run in a Node.js environment, using the Yarn package manager. This Node.js environment can be set up using a node docker image. The bash script `docker-node.sh` set up a Node.js environment with an adequate configuration. Launch this container by typing: - -.. code-block:: bash - $ bash docker-node.sh In this NodeJS environment, install all the assets required by Chill with: -.. code-block:: bash - node@b91cab4f7cfc:/app$ yarn install This command will install all the packages that are listed in `package.json`. Any further required dependencies can be installed using the Yarn package. For instance, jQuery is installed by: -.. code-block:: bash - node@b91cab4f7cfc:/app$ yarn add jquery --dev +###### Usage -Usage -***** - -Organize your assets --------------------- +### Organize your assets Chill assets usually lives under the `/Resources/public` folder of each Chill bundle. The Webpack configuration set up in `webpack.config.js` automatically loads the required assets from the Chill bundles that are used. For adding your own assets to Webpack, you must add an entry in the `webpack.config.js` file. For instance, the following entry will output a file `main.js` collecting the js code (and possibly css, image, etc.) from `./assets/main.js`. -.. code-block:: js - .addEntry('main', './assets/main.js') To gather the css files, simply connect them to your js file, using `require`. The css file is seen as a dependency of your js file. : -.. code-block:: js - // assets/js/main.js require('../css/app.css'); For finer configuration of webpack encore, we refer to the above-linked documentation. - -Compile the assets ------------------- +### Compile the assets To compile the assets, run this line in the NodeJS container: -.. code-block:: bash - node@b91cab4f7cfc:/app$ yarn run encore dev While developing, you can tell Webpack Encore to continuously watch the files you are modifying: -.. code-block:: bash - node@b91cab4f7cfc:/app$ yarn run encore dev --watch - -Use the assets in the templates --------------------------------- +### Use the assets in the templates Any entry defined in the webpack.config.js file can be linked to your application using the symfony `asset` helper: -.. code-block:: html - ... @@ -93,12 +63,4 @@ Any entry defined in the webpack.config.js file can be linked to your applicatio ... - - - - - - - -.. _Webpack Encore: https://www.npmjs.com/package/@symfony/webpack-encore -.. _Webpack: https://webpack.js.org/ + \ No newline at end of file diff --git a/docs/source/development/code-quality.md b/docs/source/development/code-quality.md new file mode 100644 index 000000000..6a43fe300 --- /dev/null +++ b/docs/source/development/code-quality.md @@ -0,0 +1,23 @@ +# Code style, code quality and other tools + +## PHP-cs-fixer + +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). + +For running php-cs-fixer: + + symfony composer php-cs-fixer + +## Execute tests + + symfony composer exec phpunit -- /path/to_your_test.php + +Note that IDE like PhpStorm should be able to run tests, even KernelTestcase or WebTestCase, [from within their interfaces ](https://www.jetbrains.com/help/phpstorm/using-phpunit-framework.html#run_phpunit_tests). + +## Execute rector + + symfony composer exec rector -- process \ No newline at end of file diff --git a/docs/source/development/code-quality.rst b/docs/source/development/code-quality.rst deleted file mode 100644 index 7e37ebf25..000000000 --- a/docs/source/development/code-quality.rst +++ /dev/null @@ -1,34 +0,0 @@ -Code style, code quality and other tools -######################################## - -PHP-cs-fixer -============ - -For development, you will also have to install: - -- `php-cs-fixer `_ - -We also encourage you to use tools like `phpstan `_ and `rector `_. - -For running php-cs-fixer: - -.. code-block:: bash - - symfony composer php-cs-fixer - -Execute tests -============= - -.. code-block:: bash - - symfony composer exec phpunit -- /path/to_your_test.php - -Note that IDE like PhpStorm should be able to run tests, even KernelTestcase or WebTestCase, `from within their interfaces `_. - -Execute rector -============== - -.. code-block:: bash - - symfony composer exec rector -- process - diff --git a/docs/source/development/create-a-new-bundle.rst b/docs/source/development/create-a-new-bundle.md similarity index 63% rename from docs/source/development/create-a-new-bundle.rst rename to docs/source/development/create-a-new-bundle.md index 087487ff0..c5d1412ba 100644 --- a/docs/source/development/create-a-new-bundle.rst +++ b/docs/source/development/create-a-new-bundle.md @@ -1,15 +1,11 @@ -.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS - Permission is granted to copy, distribute and/or modify this document +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". -.. _create-new-bundle: - -Create a new bundle -******************* +###### Create a new bundle Create your own bundle is not a trivial task. @@ -19,16 +15,9 @@ The easiest way to achieve this is seems to be : 2. Create a new bundle in this project, in the src directory 3. Initialize a git repository **at the root bundle**, and create your initial commit. 4. Register the bundle with composer/packagist. If you do not plan to distribute your bundle with packagist, you may use a custom repository for achieve this [#f1]_ -5. Move to a development installation, made as described in the :ref:`installation-for-development` section, and add your new repository to the composer.json file -6. Work as :ref:`usual ` - -.. warning:: +5. Move to a development installation, made as described in the [installation-for-development` section, and add your new repository to the composer.json file +6. Work as :ref:`usual ](editing-code-and-commiting.md) This part of the doc is not yet tested -TODO - - -.. rubric:: Footnotes - -.. [#f1] Be aware that we use the Affero GPL Licence, which ensure that all users must have access to derivative works done with this software. +TODO \ No newline at end of file diff --git a/docs/source/development/cronjob.rst b/docs/source/development/cronjob.md similarity index 73% rename from docs/source/development/cronjob.rst rename to docs/source/development/cronjob.md index bda32b5c8..255802e4b 100644 --- a/docs/source/development/cronjob.rst +++ b/docs/source/development/cronjob.md @@ -1,37 +1,26 @@ - -.. Copyright (C) 2014-2023 Champs Libres Cooperative SCRLFS - Permission is granted to copy, distribute and/or modify this document +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 -********* +###### 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 `chill:cron-job:execute` -The command :code:`chill:cron-job:execute` will schedule a task, one by one. In a classical implementation, it should +The command `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 ? -============================== +## How to implements a cron job ? -Implements a :code:`Chill\MainBundle\Cron\CronJobInterface`. Here is an example: - -.. code-block:: php +Implements a `Chill\MainBundle\Cron\CronJobInterface`. Here is an example: namespace Chill\MainBundle\Service\Something; @@ -83,19 +72,15 @@ Implements a :code:`Chill\MainBundle\Cron\CronJobInterface`. Here is an example: } } -How are cron job scheduled ? -============================ +## 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 the command `chill:cron-job:execute` is run with one or more `job` argument, those jobs are run, **without checking that the job can run** (the method `canRun` is not executed). -If any :code:`job` argument is given, the :code:`CronManager` schedule job with those steps: +If any `job` argument is given, the `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. - - +* then, for each tasks, and in the given order, the first task where `canRun` return `TRUE` will be executed. +The command `chill:cron-job:execute` execute **only one** task. diff --git a/docs/source/development/crud.rst b/docs/source/development/crud.md similarity index 86% rename from docs/source/development/crud.rst rename to docs/source/development/crud.md index 1f666cade..2796dff8e 100644 --- a/docs/source/development/crud.rst +++ b/docs/source/development/crud.md @@ -1,15 +1,11 @@ -.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS - Permission is granted to copy, distribute and/or modify this document +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". -.. _crud: - -CRUD -#### +# CRUD Chill provide an API to create a basic CRUD. @@ -20,30 +16,21 @@ One can follow those steps to create a CRUD for one entity: 3. customize the templates if required ; 4. customize some steps of the controller if required ; +An example with the [`ClosingMotive`` (PersonBundle) in the admin part of Chill: -An example with the ``ClosingMotive`` (PersonBundle) in the admin part of Chill: - -Auto-loading the routes -*********************** +###### 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 Create your model on the usual way (in this example, ORM informations are stored in yaml file): -.. code-block:: php - +```php namespace Chill\PersonBundle\Entity\AccompanyingPeriod; use Doctrine\Common\Collections\Collection; @@ -62,41 +49,40 @@ Create your model on the usual way (in this example, ORM informations are stored * @var array */ private $name; - + /** * * @var boolean */ private $active = true; - + /** * * @var self */ private $parent = null; - + /** * child Accompanying periods * * @var Collection */ private $children; - + /** * * @var float */ private $ordering = 0.0; - // getters and setters come here } +``` The form: -.. code-block:: php - +```php namespace Chill\PersonBundle\Form; use Symfony\Component\Form\AbstractType; @@ -108,7 +94,6 @@ The form: use Symfony\Component\Form\Extension\Core\Type\NumberType; /** - * * */ class ClosingMotiveType extends AbstractType @@ -145,22 +130,21 @@ The form: ; } } +``` -Configure the crud -****************** +###### Configure the crud The crud is configured using the key ``crud`` under ``chill_main`` -.. code-block:: yaml - +```yaml chill_main: cruds: - - + - # the class which is concerned by the CRUD class: '\Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class' # give a name for the crud. This will be used internally name: closing_motive - # add a base path for the + # add a base path for the base_path: /admin/closing-motive # this is the form class form_class: 'Chill\PersonBundle\Form\ClosingMotiveType::class' @@ -170,8 +154,8 @@ The crud is configured using the key ``crud`` under ``chill_main`` # this is a list of action you can configure # by default, the actions `index`, `view`, `new` and `edit` are automatically create # you can add more actions or configure some details about them - actions: - index: + actions: + index: # the default template for index is very poor, # you will need to override it template: '@ChillPerson/ClosingMotive/index.html.twig' @@ -180,16 +164,16 @@ The crud is configured using the key ``crud`` under ``chill_main`` new: role: ROLE_ADMIN # by default, the template will only show the form - # you can override it + # you can override it template: '@ChillPerson/ClosingMotive/new.html.twig' edit: role: ROLE_ADMIN template: '@ChillPerson/ClosingMotive/edit.html.twig' +``` -To leave the bundle auto-configure the ``chill_main`` bundle, you can `prepend the configuration of the ChillMain Bundle `_: - -.. code-block:: php +To leave the bundle autoconfigure the ``chill_main`` bundle, you can `prepend the configuration of the ChillMain Bundle ](https://symfony.com/doc/current/bundles/prepend_extension.html): +```php namespace Chill\PersonBundle\DependencyInjection; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -204,13 +188,13 @@ To leave the bundle auto-configure the ``chill_main`` bundle, you can `prepend t { // skipped here } - - - public function prepend(ContainerBuilder $container) + + + public function prepend(ContainerBuilder $container) { $this->prependCruds($container); } - + protected function prependCruds(ContainerBuilder $container) { $container->prependExtensionConfig('chill_main', [ @@ -240,20 +224,17 @@ To leave the bundle auto-configure the ``chill_main`` bundle, you can `prepend t ]); } } +``` +###### Customize templates - -Customize templates -******************* - -The current template are quite basic. You can override and extends them. +The current template is quite basic. You can override and extends them. For a better inclusion, you can embed them instead of extending them. For index. Note that we extend here the `admin` layout, not the default one: -.. code-block:: html+jinja - +```php {% extends '@ChillMain/Admin/layout.html.twig' %} {% block admin_content %} @@ -288,11 +269,11 @@ For index. Note that we extend here the `admin` layout, not the default one: {% endblock %} {% endembed %} {% endblock %} +``` For edit template: -.. code-block:: html+jinja - +```php {% extends '@ChillMain/Admin/layout.html.twig' %} {% block title %} @@ -309,8 +290,6 @@ For edit template: For new template: -.. code-block:: html+jinja - {% extends '@ChillMain/Admin/layout.html.twig' %} {% block title %} @@ -322,17 +301,16 @@ For new template: {% block content_form_actions_save_and_show %}{% endblock %} {% endembed %} {% endblock %} +``` -Customize some steps in the controller -************************************** +###### Customize some steps in the controller Some steps may be customized by overriding the default controller and some methods. Here, we will override the way the entity is created, and the ordering of the "index" page: * we will associate a parent ClosingMotive to the element if a parameter `parent_id` is found ; * we will order the ClosingMotive by the ``ordering`` property -.. code-block:: php - +```php namespace Chill\PersonBundle\Controller; use Chill\MainBundle\CRUD\Controller\CRUDController; @@ -376,14 +354,13 @@ Some steps may be customized by overriding the default controller and some metho return $query->orderBy('e.ordering', 'ASC'); } } +``` -How-to and questions -******************** +###### How-to and questions -Which role is required for each action ? -======================================== +## Which role is required for each action ? -By default, each action will use: +By default, each action will use: 1. the role defined under the action key ; 2. the base role as upper, with the action name appended: @@ -396,22 +373,21 @@ By default, each action will use: The entity will be passed to the role: * for the ``view`` and ``edit`` action: the entity fetched from database -* for the ``new`` action: the entity which is created (you can override default values using -* for index action (or if you re-use the ``indexAction`` method: ``null`` - -How to add some route and actions ? -=================================== +* for the ``new`` action: the entity which is created (you can override default values using +* for index action (or if you re-use the ``indexAction`` method: ``null`` + +## How to add some route and actions ? Add them under the action key: -.. code-block:: yaml - +```yaml chill_main: cruds: - - + - # snipped actions: myaction: ~ +``` The method `myactionAction` will be called by the parameter. @@ -419,13 +395,12 @@ Inside this action, you can eventually call another internal method: * ``indexAction`` for a list of items ; * ``viewAction`` for a view -* ``editFormAction`` for an edition +* ``editFormAction`` for an edition * ``createFormAction`` for a creation Example: -.. code-block:: php - +```php namespace CSConnectes\SPBundle\Controller; use Chill\PersonBundle\CRUD\Controller\OneToOneEntityPersonCRUDController; @@ -456,34 +431,29 @@ Example: } } +``` -How to create a CRUD for entities associated to persons -======================================================= +## How to create a CRUD for entities associated to persons The bundle person provide some controller and template you can override, instead of the ones present in the mainbundle: -* :code:`Chill\PersonBundle\CRUD\Controller\EntityPersonCRUDController` for entities linked with a one-to-may association to :code:`Person` class ; -* :code:`Chill\PersonBundle\CRUD\Controller\OneToOneEntityPersonCRUDController` for entities linked with a one-to-one association to :code:`Person` class. +* `Chill\PersonBundle\CRUD\Controller\EntityPersonCRUDController` for entities linked with a one-to-may association to `Person` class ; +* `Chill\PersonBundle\CRUD\Controller\OneToOneEntityPersonCRUDController` for entities linked with a one-to-one association to `Person` class. There are also template defined under ``@ChillPerson/CRUD/`` namespace. -Those controller assume that: +Those controllers assume that: -* the entity provide the method :code:`getPerson` and :code:`setPerson` ; +* the entity provide the method `getPerson` and `setPerson` ; * the `index`'s id path will be the id of the person, and the ids in `view` and `edit` path will be the id of the entity ; -This bundle also use by default the templates inside ``@ChillPerson/CRUD/``. +This bundle also uses by default the templates inside ``@ChillPerson/CRUD/``. +###### Reference -Reference -********* - -Configuration reference -======================= - - -.. code-block:: txt +## Configuration reference +```yaml chill_main: cruds: @@ -514,9 +484,8 @@ Configuration reference # the template to render the view template: null +``` -Twig default block -================== +## Twig default block This part should be documented. - diff --git a/docs/source/development/database-principles.md b/docs/source/development/database-principles.md new file mode 100644 index 000000000..c952ec584 --- /dev/null +++ b/docs/source/development/database-principles.md @@ -0,0 +1,70 @@ +# Database Principles + +This page provides a global understanding of the Chill database and explains some implementation details that help accelerate processing from the database or exploit it more easily. + +!!! warning "Database Schema Stability" + The stability of the database schema is not guaranteed. + + However, it evolves relatively little. It is rare for tables or columns to be deleted or renamed, but it is not guaranteed that this cannot happen. + +## Overview + +A commented list of all tables is available in CSV format at `./database/table_list.csv`. + +### Schema and naming conventions + +At the beginning of Chill's history, PostgreSQL schemas were not used. Data was stored in the `public` schema. + +Later, new bundles appeared, and tables were classified into dedicated schemas. + +Currently: + +- for older bundles, those that already have tables in the public schema, new tables are added to this schema. They are prefixed with `chill__`; +- for more recent bundles, tables are created in the dedicated schema + +### Historical data + +Some data is historized: + +- the referents of an accompanying period; +- the statuses of an accompanying period; +- the link between territories and users; +- etc. + +In these cases, Chill generally creates two columns, which are usually named `startDate` and `endDate`. When the `endDate` column is `NULL`, it means that the period is not "closed". The `startDate` column is not nullable. + +In some cases, the current data (referent of an accompanying period, for example) is also repeated at the table level itself. For example, the accompanying periods table `chill_person_accompanying_period` has a `step` column (the status of the period) and `user_id` (referent id) in addition to the history. Although redundant, this simplifies processing. + +## Special relationships + +### Users, households, addresses + +Users have an address through households: in the interface, the address is recorded in the household file, and it is "given" to users who are members of the household, **and** who share the address of this household. Indeed, it is possible that users "belong" to a household without being domiciled there: this is the case, for example, for children in shared custody. + +The history of users' membership in the household is preserved, as well as the history of addresses for the same household. + +The tables involved are as follows: + +- the `chill_person_person` table lists the users; +- the `chill_person_household_members` table lists household memberships: this is the junction between users and households: + - the `startDate` and `endDate` columns indicate the start and end date of membership; + - the `shareHousehold` column indicates whether the user shares the household address (if yes, its value is `TRUE`) +- the `chill_person_household` table lists households +- the `chill_person_household_to_addresses` table associates households with addresses; +- the `chill_main_address` table contains addresses, indicating the validity start date (`validFrom`) and the validity end date (`validTo`). + +To simplify the resolution of addresses and users, two views have been implemented: + +- the `view_chill_person_household_address` view takes up, for each user, the history of household memberships broken down by the address history of a household. + In other words, a line is created each time a user changes household, or a household changes address. It is therefore possible to find the complete address history for a given user via this table. +- the `view_chill_person_current_address` view takes up the current address of users. + +### Addresses and geographical units + +Chill provides statistics on the location of addresses relative to geographical zones (`chill_main_geographical_unit`). + +Since the geographical resolution of addresses is costly in CPU and processing time, a materialized view has been created: `view_chill_main_address_geographical_unit`. It is refreshed daily in the production database. + +## Table list and comments + +A commented list of all tables is available in CSV format at `./database/table_list.csv`. diff --git a/docs/source/development/database-principles.rst b/docs/source/development/database-principles.rst deleted file mode 100644 index 3b528ae22..000000000 --- a/docs/source/development/database-principles.rst +++ /dev/null @@ -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__`; -- 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 territoires 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`. diff --git a/docs/source/development/embeddable-comments.rst b/docs/source/development/embeddable-comments.md similarity index 63% rename from docs/source/development/embeddable-comments.rst rename to docs/source/development/embeddable-comments.md index e14e8e84b..ae1e70819 100644 --- a/docs/source/development/embeddable-comments.rst +++ b/docs/source/development/embeddable-comments.md @@ -1,30 +1,17 @@ - -.. Copyright (C) 2016 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". - - -Embeddable comments -################### +# Embeddable comments Those embeddable comments is a comment with some metadata: * the one who updated the comment (the comment itself, and not the whole entity); * the date and time for the last update (again, the comment itself, and not the whole entity). -We make usage of `embeddables `_. +We make usage of [embeddable ](https://www.doctrine-project.org/projects/doctrine-orm/en/2.8/tutorials/embeddables.html). -Embed the comment -================= +## Embed the comment The comment may be embedded into the entity: -.. code-block:: php - +```php namespace Chill\ActivityBundle\Entity; use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable; @@ -51,7 +38,6 @@ The comment may be embedded into the entity: */ private $comment; - /** * @return \Chill\MainBundle\Entity\Embeddalbe\CommentEmbeddable */ @@ -68,27 +54,21 @@ The comment may be embedded into the entity: $this->comment = $comment; } } +``` -Note on relation to :class:`User` -================================= +## Note on relation to :class:`User` The embeddable proposed by Doctrine does not support relationship to other entities. The entity Comment is able to render a user's id, but not an User object. + `$activity->getComment()->getUserId(); // return user id of the last author` -.. code-block:: php + `$activity->getComment()->getUser(); // does not work !` - $activity->getComment()->getUserId(); // return user id of the last author +## Usage into form - $activity->getComment()->getUser(); // does not work ! - - -Usage into form -=============== - -Use the :class:`Chill\MainBundle\Form\Type\CommentType` to load the form widget: - -.. code-block:: php +Use the `Chill\MainBundle\Form\Type\CommentType` to load the form widget: +```php namespace Chill\ActivityBundle\Form; use Chill\MainBundle\Form\Type\CommentType; @@ -110,12 +90,8 @@ Use the :class:`Chill\MainBundle\Form\Type\CommentType` to load the form widget: ; } } +``` -Render the comment -================== - -.. code-block:: twig - - {{ activity.comment|chill_entity_render_box }} - +## Render the comment + `{{ activity.comment|chill_entity_render_box }}` diff --git a/docs/source/development/entity-info.rst b/docs/source/development/entity-info.md similarity index 84% rename from docs/source/development/entity-info.rst rename to docs/source/development/entity-info.md index 72d8b70ea..0e8e2b33b 100644 --- a/docs/source/development/entity-info.rst +++ b/docs/source/development/entity-info.md @@ -1,16 +1,4 @@ - -.. 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 -######################################## +# Stats about event on entity in php world It is necessary to be able to gather information about events for some entities: @@ -18,11 +6,9 @@ It is necessary to be able to gather information about events for some entities: - who did it; - ... -Those "infos" are not linked with right management, like describe in :ref:`timelines`. +Those "infos" are not linked with right management, like describe in [timelines`. - -“infos” for some stats and info about an entity ------------------------------------------------ +### “infos” for some stats and info about an entity Building an info means: @@ -32,10 +18,10 @@ Building an info means: 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 +- use a command ``bin/console chill:db:sync-views`` to synchronize view (create view if it does not exist, 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 +- one can create 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 @@ -45,14 +31,13 @@ through “union” views: So, converting new “events” into rows for ``AccompanyingPeriodInfo`` is just implementing this interface! -Implementation for AccompanyingPeriod (``AccompanyingPeriod/AccompanyingPeriodInfo``) -------------------------------------------------------------------------------------- +### 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: +Having that info in the table answers some questions like: - when is the last and the first action (AccompanyingPeriodWork, Activity, AccompanyingPeriodWorkEvaluation, …) on the period; @@ -60,46 +45,43 @@ Having those info in table answer some questions like: 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 +SQL view is built dynamically (see below), and gathers info from ActivityBundle, PersonBundle, CalendarBundle, … It is possible to create -custom bundle and add info on this view. - -.. code:: php + a custom bundle and add info on this view. +```php /** * * @ORM\Entity() - * @ORM\Table(name="view_chill_person_accompanying_period_info") <==== THIS IS A VIEW, NOT A TABLE + * @ORM\Table(name="view_chill_person_accompanying_period_info") ](==== THIS IS A VIEW, NOT A TABLE */ class AccompanyingPeriodInfo { // ... } +``` -Why do we need this ? -~~~~~~~~~~~~~~~~~~~~~ +#### Why do we need this? -For multiple jobs in PHP world: +For multiple jobs in a PHP world: -- moving the accompanying period to another steps when inactive, +- moving the accompanying period to another step 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 +Later we will launch automatic anonymize for an accompanying period and all related entities through this information. -How is built the SQL views which is mapped to “info” entities ? -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +#### How are the SQL views built that are 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 +The SQL view is built dynamically; it is a SQL view like this, for now (April 2023): +```sql create view view_chill_person_accompanying_period_info (accompanyingperiod_id, relatedentity, relatedentityid, user_id, infodate, discriminator, metadata) as SELECT w.accompanyingperiod_id, @@ -191,13 +173,14 @@ The sql view is built dynamically, it is a SQL view like this, for now (April 20 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 +As you can see, the view gathers multiple SELECT queries and binds them with UNION. Each SELECT query is built dynamically, through a class implementing an interface: ``Chill\PersonBundle\Service\EntityInfo\AccompanyingPeriodInfoUnionQueryPartInterface``, `like -here `__ +here `_ +`https://eslint.vuejs.org/rules/ ](https://eslint.vuejs.org/rules/) -Manual Rule Configuration -------------------------- +### Manual Rule Configuration We can also manually configure certain rules or override rules that are part of the ruleset specified above. For example, if we want to turn off a certain rule, we can do so as follows: -.. code-block:: javascript - rules: { 'vue/multi-word-component': 'off' } @@ -64,8 +57,6 @@ We could also change the severity of a certain rule from 'error' to 'warning', f Within specific ``.js`` or ``.vue`` files, we can also override a certain rule only for that specific file by adding a comment: -.. code-block:: javascript - /* eslint multi-word-component: "off", no-child-content: "error" -------- Here's a description about why this configuration is necessary. */ diff --git a/docs/source/development/export-sequence.puml b/docs/source/development/export-sequence.puml deleted file mode 100644 index 0d0c77c14..000000000 --- a/docs/source/development/export-sequence.puml +++ /dev/null @@ -1,84 +0,0 @@ -@startuml -'https://plantuml.com/sequence-diagram - -autonumber - -User -> ExportController: configure export using form -activate ExportController -ExportController -> ExportForm: build form -activate ExportForm - -loop for every ExportElement (Filter, Aggregator) - ExportForm -> ExportElement: `buildForm` - activate ExportElement - ExportElement -> ExportForm: add form to builders - deactivate ExportElement -end - -ExportForm -> ExportController -deactivate ExportForm - -ExportController -> User: show form -deactivate ExportController - -note left of User: Configure the export:\ncheck filters, aggregators, … - -User -> ExportController: post configuration of the export -activate ExportController - -ExportController -> ExportForm: `getData` -activate ExportForm -ExportForm -> ExportController: return data: list of entities, etc. -deactivate ExportForm - -loop for every ExportElement (Filter, Aggregator) - ExportController -> ExportElement: serializeData (data) - activate ExportElement - ExportElement -> ExportController: return serializedData (simple array with string, int, …) - deactivate ExportElement -end - -ExportController -> Database: `INSERT INTO RequestGeneration_table` (insert new entity) -ExportController -> MessageQueue: warn about a new request -activate MessageQueue -ExportController -> User: "ok, generation is in process" -deactivate ExportController - -note left of User: The user see a waiting screen - -MessageQueue -> MessengerConsumer: forward the message to the MessengerConsumer -deactivate MessageQueue -activate MessengerConsumer -MessengerConsumer -> Database: `SELECT * FROM RequestGeneration_table WHERE id = %s` -activate Database -Database -> MessengerConsumer: return RequestGeneration with serializedData -deactivate Database - -loop for every ExportElement (Filter, Aggregator) - MessengerConsumer -> ExportElement: deserializeData - activate ExportElement - ExportElement -> MessengerConsumer: return data (list of entities, etc.) from the serialized array - deactivate ExportElement - MessengerConsumer -> ExportElement: alter the sql query (`ExportElement::alterQuery`) - activate ExportElement - ExportElement -> MessengerConsumer: return the query with WHERE and GROUP BY clauses - deactivate ExportElement -end - -MessengerConsumer -> MessengerConsumer: prepare the export -MessengerConsumer -> MessengerConsumer: save the export as a stored object -MessengerConsumer -> Database: `UPDATE RequestGeneration_table SET ready = true` -deactivate MessengerConsumer - -User -> ExportController: pull every 5s to know if the export is generated -activate ExportController -ExportController -> User: warn the export is generated -deactivate ExportController - -User -> ExportController: download the export from object storage - - - - - -@enduml diff --git a/docs/source/development/exports.rst b/docs/source/development/exports.md similarity index 60% rename from docs/source/development/exports.rst rename to docs/source/development/exports.md index 7cb04f32e..7335490f2 100644 --- a/docs/source/development/exports.rst +++ b/docs/source/development/exports.md @@ -1,66 +1,49 @@ -.. 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". - - -Exports -******* +###### Exports Export is an important issue within the Chill software : users should be able to : - compute statistics about their activity ; - list "things" which are a part of their activities. -The `main bundle`_ provides a powerful framework to build custom queries with re-usable parts across differents bundles. +The [main bundle`_ provides a powerful framework to build custom queries with re-usable parts across differents bundles. -.. contents:: Table of content :local: -.. seealso:: - - `The issue where this framework was discussed `_ + `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. -Concepts -======== +## Concepts - -Some vocabulary: 3 "Export elements" ------------------------------------- +### Some vocabulary: 3 "Export elements" Four terms are used for this framework : Exports provide some basic operation on the data. Two kinds 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", ... + - 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," ... 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. - Example of a filter: "people under 18 years olds", "activities between the 1st of June and the 31st December", ... + Example of a filter: "people under 18-year-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'). - Example of an aggregator : "group people by gender", "group people by nationality", "group activity by type", ... + Example of an 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. - Example of a formatter: "format data as CSV", "format data as an ods spreadsheet", ... + Example of a formatter: "format data as CSV", "format data as an ods spreadsheet," ... -Anatomy of an export ---------------------- +### 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 : -**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. +**Example 1**: Count the number of people having at least one activity in the last month 12, and group them by nationality and gender, and format them in a CSV spreadsheet. Here : @@ -73,21 +56,16 @@ 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. +- Multiple aggregators or filters for one export may exist. Currently, only one export is allowed. The result might be : -+-----------------------+----------------+---------------------------+ -| Nationality | Gender | Number of people | -+=======================+================+===========================+ -| Russian | Male | 12 | -+-----------------------+----------------+---------------------------+ -| Russian | Female | 24 | -+-----------------------+----------------+---------------------------+ -| France | Male | 110 | -+-----------------------+----------------+---------------------------+ -| France | Female | 150 | -+-----------------------+----------------+---------------------------+ ++-------------+--------+------------------+ +| Nationality | Gender | Number of people | +| Russian | Male | 12 | +| Russian | Female | 24 | +| France | Male | 110 | +| 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. @@ -103,122 +81,97 @@ The result might be : +-----------------------+----------------------+ | Week | Number of activities | -+=======================+======================+ | 2015-10 | 10 | -+-----------------------+----------------------+ | 2015-11 | 12 | -+-----------------------+----------------------+ | 2015-12 | 10 | -+-----------------------+----------------------+ | 2015-13 | 9 | -+-----------------------+----------------------+ -Authorization and exports -------------------------- +### 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 show data the user is not allowed to see within the application. 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. -How does the magic work ? -=========================== +## How does the magic work? 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. +An export is an SQL query that is initiated by an export and modified by aggregators and filters. -.. note:: - - **Example**: Count the number of people having at least one activity in the last 12 month, and group them by nationality and gender + **Example**: Count the number of people having at least one activity in the last month 12, and group them by nationality and gender 1. The report initiates the query - .. code-block:: SQL - + ```SQL SELECT count(people.*) FROM people +``` 2. The filter adds a where and join clause : - .. code-block:: SQL - + ```SQL 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: - .. code-block:: sql - + ```sql 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 : - .. code-block:: sql - + ```sql 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. - -.. figure:: /_static/screenshots/development/export_form-fullpage.png +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. 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. - 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*, 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. -The Export Manager ------------------- +### 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 registers 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 form step --------------------- +### The export form step The form step allows you to build a form, combining 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). -.. figure:: /_static/puml/exports/form_steps.png :scale: 40% -The formatter form step ------------------------ +### 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). -Processing the export ---------------------- +### Processing the export -The export process can be explained by this schema : +This schema can explain the export process : -.. figure:: /_static/puml/exports/processing_export.png :scale: 40% (Click to enlarge) +## Export, formatters, and filters explained -Export, formatters and filters explained -======================================== - -Exports -------- +### Exports This is an example of the ``CountPerson`` export : -.. literalinclude:: /_static/code/exports/CountPerson.php - :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 46**: The title of the export. A summary of what your export does. @@ -226,26 +179,17 @@ This is an example of the ``CountPerson`` 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 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 -Filters -------- +### 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`: - -.. literalinclude:: /_static/code/exports/BirthdateFilter.php - :language: php - -.. todo:: +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: `Chill\MainBundle\Export\ExportElementValidatedInterface`: 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 ? -`````````````````````````````````````````````````````````````````````````````````````````````````````` +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 @@ -253,79 +197,65 @@ 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 +| 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 +| AVG | COUNT | +|--------------------------------------------------|-------| +| 2 years 2 mons 21 days 12 hours 0 mins 0.0 secs | 2 | - 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 +Now, we count the number of accompanying period, adding a `JOIN` clause which make a link to the `activity` table, and add a `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 ? +What are the results here? -.. csv-table:: - :header: COUNT +| COUNT | +|-------| +| 7 | - 7 - -:code:`7` ! Why this result ? Because the number of lines is duplicated for each activity. Let's see the list of rows which +`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 +| accompanyingperiod.id | activity.id | +|----------------------|-------------| +| 329 | 993 | +| 334 | 1000 | +| 329 | 987 | +| 329 | 990 | +| 329 | 991 | +| 329 | 992 | +| 329 | 986 | - 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 +For each activity, a row is created and, as we count the number of non-null `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:: +So, let's use the `DISTINCT` keyword to count only once the equal ids: SELECT COUNT(DISTINCT chill_person_accompanying_period.id) from chill_person_accompanying_period JOIN activity ON chill_person_accompanying_period.id = activity.accompanyingperiod_id @@ -333,38 +263,31 @@ So, let's use the :code:`DISTINCT` keyword to count only once the equal ids: Now, it works again... -.. csv-table:: - :header: COUNT +| COUNT | +|-------| +| 2 | - 2 +But, for the average duration, this won't work: the duration which are equals (because the `openingdate` is the same and +`closingdate` is still `NULL`, for instance) will be counted only once, which will give unexpected result. -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 +The solution is to move the condition "having an activity with activity type with id 7" in a `EXISTS` clause: 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: +The result is correct without `DISTINCT` keyword: -.. csv-table:: - :header: COUNT - - 2 +| 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 +| AVG | +|--------------------------------------------------| +| 2 years 2 mons 21 days 12 hours 0 mins 0.0 secs | diff --git a/docs/source/development/forms.md b/docs/source/development/forms.md new file mode 100644 index 000000000..40ed3d9e2 --- /dev/null +++ b/docs/source/development/forms.md @@ -0,0 +1,25 @@ +# Forms and form types + +###### Date picker + +Class + `Chill\MainBundle\Form\Type\ChillDateType` +Extend + `Symfony\Component\Form\Extension\Core\Type\DateType` + +Usage : + +``` + use Chill\MainBundle\Form\Type\ChillDateType; + + $builder->add('date' ChillDateType::class); +``` + +###### Text editor + +Add a text editor (by default). + +Class + `Chill\MainBundle\Form\Type\ChillTextareaType` +Options + * `disable_editor` to disable text editor diff --git a/docs/source/development/forms.rst b/docs/source/development/forms.rst deleted file mode 100644 index 038240664..000000000 --- a/docs/source/development/forms.rst +++ /dev/null @@ -1,42 +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". - -.. _forms: - -Forms and form types -#################### - -Date picker -*********** - -Class - :class:`Chill\MainBundle\Form\Type\ChillDateType` -Extend - :class:`Symfony\Component\Form\Extension\Core\Type\DateType` - - -Usage : - -.. code-block:: php - - use Chill\MainBundle\Form\Type\ChillDateType; - - $builder->add('date' ChillDateType::class); - -Text editor -*********** - -Add a text editor (by default). - -Class - :class:`Chill\MainBundle\Form\Type\ChillTextareaType` -Options - * :code:`disable_editor` to disable text editor - - diff --git a/docs/source/development/index.md b/docs/source/development/index.md new file mode 100644 index 000000000..ab763538c --- /dev/null +++ b/docs/source/development/index.md @@ -0,0 +1,41 @@ +# 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. + +- [Instructions to create a new bundle](create-a-new-bundle.md) +- [CRUD (Create - Update - Delete) for one entity](crud.md) +- [Helpers for building a REST API](api.md) +- [Routing](routing.md) +- [Menus](menus.md) +- [Forms](forms.md) +- [Access control model](access_control_model.md) +- [Messages to users](messages-to-users.md) +- [Pagination](pagination.md) +- [Localisation](localisation.md) +- [Logging](logging.md) +- [Database migrations](migrations.md) +- [Searching](searching.md) +- [Timelines](timelines.md) +- [Exports](exports.md) +- [Embeddable comments](embeddable-comments.md) +- [Run tests](run-tests.md) +- [ESLint](es-lint.md) +- [Useful snippets](useful-snippets.md) +- [Manual](manual/index.md) +- [Assets](assets.md) +- [Cron Jobs](cronjob.md) +- [Info about entities](entity-info.md) +- [Info about database (in French)](database-principles.md) +- [Developer FAQ](FAQ.md) + +###### Layout and UI + +- [Render entities automatically](render-entity.md) +- [Layout / Template usage](user-interface/layout-template-usage.md) +- [Classes and mixins](user-interface/css-classes.md) +- [Widgets](user-interface/widgets.md) +- [Javascript function](user-interface/js-functions.md) + +###### Help, I am lost! + +Write an email at info@champs-libres.coop, and we will help you! diff --git a/docs/source/development/index.rst b/docs/source/development/index.rst deleted file mode 100644 index d3aefc1b0..000000000 --- a/docs/source/development/index.rst +++ /dev/null @@ -1,59 +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". - -Development -########### - -As Chill relies on the `symfony `_ framework, reading the framework's documentation should answer most of your questions. We are explaining here some tips to work with Chill, and help with things we've encountered. - -.. toctree:: - :maxdepth: 2 - - Instructions to create a new bundle - CRUD (Create - Update - Delete) for one entity - Helpers for building a REST API - Routing - Menus - Forms - Access control model - Messages to users - Pagination - Localisation - Logging - Database migrations - Searching - Timelines - Exports - Embeddable comments - Run tests - ESLint - Useful snippets - manual/index.rst - Assets - Cron Jobs - Info about entities - Info about database (in French) - Developer FAQ - -Layout and UI -************** - -.. toctree:: - :maxdepth: 2 - - Render entities automatically - Layout / Template usage - Classes and mixins - Widgets - Javascript function - - -Help, I am lost ! -***************** - -Write an email at info@champs-libres.coop, and we will help you ! diff --git a/docs/source/development/localisation.md b/docs/source/development/localisation.md new file mode 100644 index 000000000..b412954d5 --- /dev/null +++ b/docs/source/development/localisation.md @@ -0,0 +1,30 @@ +###### Localisation + +## Language in url + +Language should be present in URL, conventionally as the first argument. + + `/fr/your/url/here` + +This allows users to change from one language to another one on each page, which may be useful in multilanguages teams. If the installation is single-language, the language switcher will not appears. + +This is an example of routing defined in YAML : + +```yaml + chill_person_general_edit: + pattern: /{_locale}/person/{person_id}/general/edit + defaults: {_controller: ChillPersonBundle:Person:edit } +``` + +## Date and time + +The [Intl extension ](http://twig.sensiolabs.org/doc/extensions/intl.html) is enabled on the Chill application. + +You may format date and time using the [localizeddate` function : + + `date|localizeddate('long', 'none')` + +By default, we prefer using the `long` format for date formatting. + + [Documentation for Intl Extension](http://twig.sensiolabs.org/doc/extensions/intl.html) + Read the complete doc for the Intl extension. diff --git a/docs/source/development/localisation.rst b/docs/source/development/localisation.rst deleted file mode 100644 index fca5ad8ba..000000000 --- a/docs/source/development/localisation.rst +++ /dev/null @@ -1,49 +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". - -Localisation -************* - -Language in url -=============== - -Language should be present in URL, conventionnaly as first argument. - -.. code-block:: none - - /fr/your/url/here - -This allow users to change from one language to another one on each page, which may be useful in multilanguages teams. If the installation is single-language, the language switcher will not appears. - -This is an example of routing defined in yaml : - -.. code-block:: yaml - - chill_person_general_edit: - pattern: /{_locale}/person/{person_id}/general/edit - defaults: {_controller: ChillPersonBundle:Person:edit } - - -Date and time -============== - -The `Intl extension `_ is enabled on the Chill application. - -You may format date and time using the `localizeddate` function : - -.. code-block:: jinja - - date|localizeddate('long', 'none') - -By default, we prefer using the `long` format for date formatting. - -.. seealso:: - - `Documentation for Intl Extension `_ - Read the complete doc for the Intl extension. - diff --git a/docs/source/development/logging.rst b/docs/source/development/logging.md similarity index 68% rename from docs/source/development/logging.rst rename to docs/source/development/logging.md index 5cace02c7..6cd0b0a20 100644 --- a/docs/source/development/logging.rst +++ b/docs/source/development/logging.md @@ -1,50 +1,41 @@ -.. Copyright (C) 2016 Champs Libres Cooperative SCRLFS - Permission is granted to copy, distribute and/or modify this document +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". +###### Logging -Logging -******* -.. seealso:: - - Symfony documentation: `How to user Monolog to write logs `_ + Symfony documentation: [How to user Monolog to write logs ](http://symfony.com/doc/current/cookbook/logging/monolog.html) The symfony cookbook page about logging. +A channel for custom logging has been created to store sensitive data. -A channel for custom logging has been created to store sensitive data. - -The channel is named ``chill``. +The channel is named ``chill``. The installer of chill should be aware that this channel may contains sensitive data and encrypted during backup. -Logging to channel `chill` -============================ +## Logging to channel `chill` -You should use the service named ``chill.main.logger``, as this : +You should use the service named ``chill.main.logger``, as this : -.. code-block:: php + `$logger = $this->get('chill.main.logger');` - $logger = $this->get('chill.main.logger'); +You should store data into context, not in the log himself, which should remains the same for the action. -You should store data into context, not in the log himself, which should remains the same for the action. - -Example of usage : - -.. code-block:: php +Example of usage : +```php $logger->info("An action has been performed about a person", array( 'person_lastname' => $person->getLastName(), 'person_firstname' => $person->getFirstName(), 'person_id' => $person->getId(), 'by_user' => $user->getUsername() )); +``` For further processing, it is a good idea to separate all fields (like firstname, lastname, ...) into different context keys. By convention, you should store the username of the user performing the action under the ``by_user`` key. - diff --git a/docs/source/development/manual/index.rst b/docs/source/development/manual/index.md similarity index 58% rename from docs/source/development/manual/index.rst rename to docs/source/development/manual/index.md index d93fa3a7e..070db381f 100644 --- a/docs/source/development/manual/index.rst +++ b/docs/source/development/manual/index.md @@ -1,17 +1,10 @@ -.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS - Permission is granted to copy, distribute and/or modify this document +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". -Developer manual -***************** - -.. toctree:: - :maxdepth: 2 - - routing-and-menus.rst - +###### Developer manual +- [Routing and Menus](routing-and-menus.md) diff --git a/docs/source/development/manual/routing-and-menus.rst b/docs/source/development/manual/routing-and-menus.md similarity index 55% rename from docs/source/development/manual/routing-and-menus.rst rename to docs/source/development/manual/routing-and-menus.md index c3b8b61cb..36eb34b83 100644 --- a/docs/source/development/manual/routing-and-menus.rst +++ b/docs/source/development/manual/routing-and-menus.md @@ -1,143 +1,103 @@ -.. 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". +###### Routing and menus -Routing and menus -***************** - - -The *Chill*'s architecture allows to choose bundle on each installation. This may lead to a huge diversity of installations, and a the developper challenge is to make his code working with all those possibles installations. +The architecture of *Chill* allows choosing a bundle on each installation. This may lead to a huge diversity of installations, and the developper challenge is to make his code work with all those possibles installations. *Chill* uses menus to let users access easily to the most used functionalities. For instance, when you land on a "Person" page, you may access directly to his activities, notes, documents, ... in a single click on a side menu. For a developer, it is easy to extend this menu with his own entries. -.. seealso:: - - `Symfony documentation about routing `_ + [Symfony documentation about routing ](http://symfony.com/doc/current/book/routing.html) This documentation should be read before diving into those lines - `Routes dans Chill `_ (FR) + [Routes dans Chill ](https://redmine.champs-libres.coop/issues/179) (FR) The issue where we discussed routes. In French. -Create routes -============== +## Create routes -.. note:: + We recommend using `yaml` to define routes. We have not tested the existing other ways to create routes (annotations, ...). Help wanted. - We recommand using `yaml` to define routes. We have not tested the existing other ways to create routes (annotations, ...). Help wanted. - -The first step is as easy as create a route in symfony, and add some options in his description : - -.. code-block:: yaml +The first step is as easy as creating a route in symfony, and add some options in his description : +```yaml +#src/CL/ChillBundle/Resources/config/routing.yml chill_main_dummy_0: pattern: /dummy/{personId} defaults: { _controller: CLChillMainBundle:Default:index } options: #we begin menu information here : - menus: - foo: #must appears in menu named 'foo' + menus: + foo: #must appear in a menu named 'foo' order: 500 #the order will be '500' - label: foolabel #the label shown on menu. Will be translated - otherkey: othervalue #you may add other informations, as needed by your layout - bar: #must also appears in menu named 'bar' + label: foolabel #the label shown on a menu. Will be translated + otherkey: othervalue #you may add other information, as needed by your layout + bar: #must also appear in a menu named 'bar' order: 500 label: barlabel +``` -The mandatory parameters under the `menus` definition are : +The mandatory parameters under the `menus` definition are : -* `name`: the menu's name, defined as an key for the following entries -* `order`. Note: if we have duplicate order's values, the order will be incremented. We recommand using big intervals within orders and publishing the orders in your documentation -* `label`: the text which will be rendered inside the `` tag. The label should be processed trough the `trans` filter (`{{ route.label|trans }}`) +* `name`: the menu's name, defined as a key for the following entries +* `order`. Note: if we have duplicate order's values, the order will be incremented. We recommend using big intervals within orders and publishing the orders in your documentation +* `label`: the text which will be rendered inside the `[ tag. The label should be processed trough the `trans` filter (`{{ route.label|trans }}`) -You *may* also add other keys, which will be used optionally in the way the menu is rendered. See +You *may* also add other keys, which will be used optionally in the way the menu is rendered. See -.. warning:: + Although all keys will be kept from your `yaml` definition to your menu template, we recommend not using those keys, which are reserved for a future implementations of Chill : - Although all keys will be kept from your `yaml` definition to your menu template, we recommend not using those keys, which are reserved for a future implementations of Chill : + * `helper`, a text to help user or add more information to him + * `access` : which will run a test with `Expression Langage ](http://symfony.com/doc/current/components/expression_language/index.html) to determine if the user has the ACL to show the menu entry ; + * `condition`, which will test with the menu context if the entry must appear - * `helper`, a text to help user or add more informations to him - * `access` : which will run a test with `Expression Langage `_ to determine if the user has the ACL to show the menu entry ; - * `condition`, which will test with the menu context if the entry must appears - -Show menu in twig templates -=========================== +## Show menu in twig templates To show our previous menu in the twig template, we invoke the `chill_menu` function. This will render the `foo` menu : -.. code-block:: jinja + `{{ chill_menu('foo') }}` - {{ chill_menu('foo') }} - -Passing variables -^^^^^^^^^^^^^^^^^ +##### Passing variables If your routes need arguments, i.e. an entity id, you should pass the as argument to the chill_menu function. If your route's pattern is `/person/{personId}`, your code become : -.. code-block:: jinja - - {{ chill_menu('foo', { 'args' : { 'personId' : person.id } } ) }} + `{{ chill_menu('foo', { 'args' : { 'personId' : person.id } } ) }}` Of course, `person` is a variable you must define in your code, which should have an `id` accessible property (i.e. : `$person->getId()`). -.. note:: - Be aware that your arguments will be passed to all routes in a menu. If a route does not require `personId` in his pattern, the route will become `/pattern?personId=XYZ`. This should not cause problem in your application. -.. warning:: - - It is a good idea to reuse the same parameter's name in your pattern, to avoid collision. Prefer `/person/{personId}` to `/person/{id}`. + It is a good idea to reuse the same parameter's name in your pattern, to avoid collision. Prefer `/person/{personId}` to `/person/{id}`. If you don't do that and another developer create a bundle with `person/{personId}/{id}` where `{id}` is the key for something else, this will cause a lot of trouble... -Rendering active entry -^^^^^^^^^^^^^^^^^^^^^^ +##### Rendering active entry -Now, you want to render differently the *active* route of the menu [#f1]_. You should, in your controller or template, add the active route in your menu : +Now, you want to render differently the *active* route of the menu [#f1]_. You should, in your controller or template, add the active route in your menu : -.. code-block:: jinja - - {{ chill_menu('foo', { 'activeRouteKey' : 'chill_main_dummy_0' } ) }} + `{{ chill_menu('foo', { 'activeRouteKey' : 'chill_main_dummy_0' } ) }}` On menu creation, the route wich has the key `chill_main_dummy_0` will be rendered on a different manner. -Define your own template -------------------------- +### Define your own template By default, the menu is rendered with the default template, which is a simple `ul` list. You may create your own templates : -.. code-block:: html+jinja - +``` #MyBundle/Resources/views/Menu/MyMenu.html.twig +``` Arguments available in your template : * The `args` value are the value passed in the 'args' arguments requested by the `chill_menu` function. -* `activeRouteKey` is the key of the currently active route. +* `activeRouteKey` is the key of the currently active route. * `routes` is an array of routes. The array has this structure: `routes[order] = { 'key' : 'the_route_key', 'label' : 'the route label' }` The order is *resolved*: in case of collision (two routes from different bundles having the same order), the order will be incremented. You may find in the array your own keys (`{ 'otherkey' : 'othervalue'}` in the example above). Then, you will call your own template with the `layout` argument : -.. code-block:: jinja - - {{ chill_menu('foo', { 'layout' : 'MyBundle:Menu:MyMenu.html.twig' } ) }} - -.. note:: + `{{ chill_menu('foo', { 'layout' : 'MyBundle:Menu:MyMenu.html.twig' } ) }}` Take care of specifying the absolute path to layout in the function. - - - -.. rubric:: Footnotes - -.. [#f1] In the default template, the currently active entry will be rendered with an "active" class : `
  • ...
  • ` diff --git a/docs/source/development/menus.rst b/docs/source/development/menus.md similarity index 52% rename from docs/source/development/menus.rst rename to docs/source/development/menus.md index 977591f1d..e4904ac54 100644 --- a/docs/source/development/menus.rst +++ b/docs/source/development/menus.md @@ -1,44 +1,25 @@ -.. 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". - -.. _menus : - -Menus -***** +###### Menus Chill has created his own menu system -.. seealso:: - - `Routes dans Chill [specification] `_ + [Routes dans Chill [specification] ](https://redmine.champs-libres.coop/issues/179) The issue wich discussed the implementation of routes. -Concepts -======== - -.. warning:: +## Concepts to be written - - -Add a menu in a template -======================== +## Add a menu in a template In your twig template, use the `chill_menu` function : -.. code-block:: html+jinja - +```php {{ chill_menu('person', { 'layout': 'ChillPersonBundle::menu.html.twig', - 'args' : {'id': person.id }, + 'args': {'id': person.id }, 'activeRouteKey': 'chill_person_view' }) }} +``` The available arguments are: @@ -46,78 +27,61 @@ The available arguments are: * `args` : those arguments will be passed through the url generator. * `activeRouteKey` must be the route key name. -.. note:: - The argument `activeRouteKey` may be a twig variable, defined elsewhere in your template, even in child templates. - - -Create an entry in an existing menu -=================================== +## Create an entry in an existing menu If a route belongs to a menu, you simply add this to his definition in routing.yml : -.. code-block:: yaml - +```yaml chill_person_history_list: pattern: /person/{person_id}/history defaults: { _controller: ChillPersonBundle:History:list } options: #declare menus - menus: - # the route should be in 'person' menu : + menus: + # the route should be in the 'person' menu : person: #and have those arguments : order: 100 label: menu.person.history +``` -* `order` (mandatory) : the order in the menu. It is preferrable to increment by far more than 1. -* `label` (mandatory) : a translatable string. -* `helper` (optional) : a text to help people to understand what does the menu do. Not used in default implementation. -* `condition` (optional) : an `Expression Language `_ which will make the menu appears or not. Typically, it may be used to say "show this menu only if the person concerned is more than 18". **Not implemented yet**. -* `access` (optional) : an Expression Language to evalute the possibility, for the user, to show this menu according to Access Control Model. **Not implemented yet.** +* `order` (mandatory): the order in the menu. It is preferrable to increment by far more than 1. +* `label` (mandatory): a translatable string. +* `helper` (optional): a text to help people to understand what does the menu do. Not used in default implementation. +* `condition` (optional): an `Expression Language `_ which will make the menu appears or not. Typically, it may be used to say "show this menu only if the person concerned is more than 18". **Not implemented yet**. +* `access` (optional): an Expression Language to evalute the possibility, for the user, to show this menu according to Access Control Model. **Not implemented yet.** You may add additional keys, but should not use the keys described above. You may add the same route to multiple menus : -.. code-block:: yaml - +```yaml chill_person_history_list: pattern: /person/{person_id}/history defaults: { _controller: ChillPersonBundle:History:list } options: - menus: + menus: menu1: order: 100 label: menu.person.history menu2: order: 100 label: another.label +``` - - -Customize menu rendering -======================== +## Customize menu rendering You may customize menu rendering by using the `layout` option. -.. warning :: - - TODO : this part should be written. + TODO: this part should be written. - - - - -.. _caveats : - -Caveats -======= +## Caveats Currently, you may pass arguments globally to each menu, and they will be all passed to route url. This means that : -* the argument name in the route entry must match the argument key in menu declaration in twig template +* the argument name in the route entry must match the argument key in the menu declaration in the twig template * if an argument is missing to generate an url, the url generator will throw a `Symfony\Component\Routing\Exception\MissingMandatoryParametersException` * if the argument name is not declared in route entry, it will be added to the url, (example: `/my/route?additional=foo`) diff --git a/docs/source/development/messages-to-users.md b/docs/source/development/messages-to-users.md new file mode 100644 index 000000000..dabbf1ae5 --- /dev/null +++ b/docs/source/development/messages-to-users.md @@ -0,0 +1,93 @@ +###### Messages to users, flashbags, and buttons + +## Flashbags + +The four following levels are defined : + ++-----------+----------------------------------------------------------------------------------------------+ +|Key|Intent | +|success|The user action succeeds. | +|notice|A simple message to give information to the user. The message may be linked or not linked with | +||the user action. | +|error|The user's action failed: he must correct something to process the action. | + +We can use [TranslatableMessage` (and other `TranslatableMessageInterface` instances) into the controller: + +```php + // in a controller action: + if (($session = $request->getSession()) instanceof Session) { + $session->getFlashBag()->add( + 'success', + new TranslatableMessage('saved_export.Saved export is saved!') + ); + } +``` + + `Flash Messages on Symfony documentation ](http://symfony.com/doc/current/book/controller.html#flash-messages) + Learn how to use flash messages in a controller. + +## Buttons + +Some actions are available to decorate ``a`` links and ``buttons``. + +To add the action on button, use them as class along with ``sc-button`` : + + Create an entity + + + ++-----------+----------------+------------------------------------------------------------------------------+ +| Action | Class | Description | +| Submit | ``bt-submit`` | Submit a form. Use only if the action is not "save." | +| Create | ``bt-create`` | - Link to a form to create an entity (alias: ``bt-new``) | +| | or ``bt-new`` | - Submitting this form will create a new entity | +| Reset | ``bt-reset`` | Reset a form | +| Delete | ``bt-delete`` | - Link to a form to delete an entity | +| | | - Submitting this form will remove the entity | +| Edit | ``bt-edit`` or | Link to a form to edit an entity | +| | ``bt-update`` | | +| Save | ``bt-save`` | Submitting this form will save change on the entity | +| Action | ``bt-action`` | Generic link to an action | +| Cancel | ``bt-cancel`` | Cancel an action and go back to another page | + +### Styling buttons + +Small buttons, mainly to use inline + + `

    You button

    ` + +You can omit content and show a button with an icon only : + + `` + +You can hide content and show it only on hover + + `Showed when mouse pass on` + +You can customize the icon : + + `Button with custom icon` + +### Grouping buttons + +Grouping buttons can be done using ``ul.record_actions`` element (an ``ul`` list with class ``record_actions``): + +```html + +``` + +The element with the ``cancel`` class will be set in first position. + +Inside the table, the space between elements will be shorter. + +You can add the class ``record_actions_small`` if you want shorter space between elements. diff --git a/docs/source/development/messages-to-users.rst b/docs/source/development/messages-to-users.rst deleted file mode 100644 index 244638d0b..000000000 --- a/docs/source/development/messages-to-users.rst +++ /dev/null @@ -1,136 +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". - -Messages to users, flashbags and buttons -**************************************** - - -.. _flashbags : - -Flashbags -========== - -The four following levels are defined : - -+-----------+----------------------------------------------------------------------------------------------+ -|Key |Intent | -+===========+==============================================================================================+ -|success |The user action succeeds. | -+-----------+----------------------------------------------------------------------------------------------+ -|notice |A simple message to give information to the user. The message may be linked or not linked with| -| |the user action. | -+-----------+----------------------------------------------------------------------------------------------+ -|error |The user's action failed: he must correct something to process the action. | -+-----------+----------------------------------------------------------------------------------------------+ - -We can use :code:`TranslatableMessage` (and other :code:`TranslatableMessageInterface` instances) into the controller: - -.. code-block:: php - - // in a controller action: - if (($session = $request->getSession()) instanceof Session) { - $session->getFlashBag()->add( - 'success', - new TranslatableMessage('saved_export.Saved export is saved!') - ); - } - -.. seealso:: - - `Flash Messages on Symfony documentation `_ - Learn how to use flash messages in controller. - - -Buttons -======== - -Some actions are available to decorate ``a`` links and ``buttons``. - -To add the action on button, use them as class along with ``sc-button`` : - -.. code-block:: html - - Create an entity - - - -+-----------+----------------+------------------------------------------------------------------------------+ -| Action | Class | Description | -+===========+================+==============================================================================+ -| Submit | ``bt-submit`` | Submit a form. Use only if action is not "save". | -+-----------+----------------+------------------------------------------------------------------------------+ -| Create | ``bt-create`` | - Link to a form to create an entity (alias: ``bt-new``) | -| | or ``bt-new`` | - Submitting this form will create a new entity | -+-----------+----------------+------------------------------------------------------------------------------+ -| Reset | ``bt-reset`` | Reset a form | -+-----------+----------------+------------------------------------------------------------------------------+ -| Delete | ``bt-delete`` | - Link to a form to delete an entity | -| | | - Submitting this form will remove the entity | -+-----------+----------------+------------------------------------------------------------------------------+ -| Edit | ``bt-edit`` or | Link to a form to edit an entity | -| | ``bt-update`` | | -+-----------+----------------+------------------------------------------------------------------------------+ -| Save | ``bt-save`` | Submitting this form will save change on the entity | -+-----------+----------------+------------------------------------------------------------------------------+ -| Action | ``bt-action`` | Generic link to an action | -+-----------+----------------+------------------------------------------------------------------------------+ -| Cancel | ``bt-cancel`` | Cancel an action and go back to another page | -+-----------+----------------+------------------------------------------------------------------------------+ - -Styling buttons ---------------- - -Small buttons, mainly to use inline - -.. code-block:: html - -

    You button

    - -You can omit content and show a button with an icon only : - -.. code-block:: html - - - -You can hide content and show it only on hover - -.. code-block:: html - - Showed when mouse pass on - -You can customize the icon : - -.. code-block:: html - - Button with custom icon - -Grouping buttons ----------------- - -Grouping buttons can be done using ``ul.record_actions`` element (an ``ul`` list with class ``record_actions``): - -.. code-block:: html - - - -The element with the ``cancel`` class will be set in first position. - -Inside table, the space between elements will be shorter. - -You can add the class ``record_actions_small`` if you want shorter space between elements. - diff --git a/docs/source/development/migrations.md b/docs/source/development/migrations.md new file mode 100644 index 000000000..83ce52c67 --- /dev/null +++ b/docs/source/development/migrations.md @@ -0,0 +1,70 @@ +###### Database Migrations + +Every bundle potentially brings his own database operations: to persist entities, developers have to create database schema, creating indexes,... + +Those schemas might be changed (the less is the better) from time to time. + +Consequence: each bundle should bring his own migration files, which will bring the database consistent with the operation you will run in your code. They will be gathered into the app installation, ready to be executed by the chill's installer. + +Currently, we use `doctrine migration`_ to manage those migration files. A `composer`_ script located in the **chill standard** component will copy the migrations from your bundle to the doctrne migration's excepted directory after each install and/or update operation. + + The `doctrine migration`_ documentation + Learn concepts about migration files and scripts and the doctrine ORM + + The `doctrine migration bundle`_ documentation + Learn about doctrine migration integration with a Symfony framework + +## Shipping migration files + +Migration files should be shipped under the Resource/migrations directory. You could customize the migration directory by adding extra information in your composer.json: + +``` + "extra": { + "migration-source": "path/to/my/dir" + } +``` + +The class namespace should be `Application\Migrations`, as expected by doctrine migration. Only the files which will be executed by doctrine migration will be moved: they must have the pattern `VersionYYYYMMDDHHMMSS.php` where YYYY is the year, MM the month, DD the day, HH the hour, MM the month and SS the second of creation. + +They will be moved automatically by composer when you install or update a bundle. + +## Executing migration files + +The installers will have to execute migration files manually, running + + `php app/console doctrine:migrations:status #will give the current status of the database` + `php app/console doctrine:migrations:migrate #process the update` + +## Updating migration files + + After an installation, migration files will be executed and registered as executed in the database (the version timestamp is recorded into the :title:`migrations_versions` table). If you update your migration file code, the file will still be considered as "executed" by doctrine migration, which will not offers the possibility to run the migration again. + + Consequently, updating a migration file should only be considered during the development phase and not published on public git branches. If you want to edit your database schema, you should create a new migration file, with a new timestamp, which will proceed to your schema adaptations. + +Every time a migration file is discovered, the composer script will check if the migration exists in the local migration directory. If yes, the script will compare two file for changes (using a md5 hash). If migrations are discovered, the script will ask the installer to know if he must replace the file or ignore it. + + You can manually run a composer script by launching `composer run-script post-update-cmd` from your root chill installation's directory. + +## Tips for development + +### Migration and data + +Each time you create a migration script, you should ensure that it will not lead to data losing. Eventually, feel free to use intermediate steps. + +### Generation + +You can generate a migration file from the command line, using those commands: + +* `php app/console doctrine:migrations:diff` to generate a migration file by comparing your current database to your mapping information +* `php app/console doctrine:migrations:generate` to generate a blank migration file. + +Those files will be located into `app/DoctrineMigrations` directory. You will have to copy those file to your the directory `Resources/migrations` into your bundle directory. + +### Comments and documentation + +As files are copied from your bundle to the `app/DoctrineMigrations` directory, the link between your bundle and the copied file will be unclear. Please add all relevant documentation which will allow future developers to make a link between your file and your bundle. + +### Inside the script + +The script that moves the migration files to app directory `might be found here + diff --git a/docs/source/development/migrations.rst b/docs/source/development/migrations.rst deleted file mode 100644 index db4745bd3..000000000 --- a/docs/source/development/migrations.rst +++ /dev/null @@ -1,101 +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". - -Database Migrations -******************** - -Every bundle potentially brings his own database operations : to persist entities, developers have to create database schema, creating indexes,... - -Those schema might be changed (the less is the better) from time to time. - -Consequence: each bundle should bring his own migration files, which will bring the database consistent with the operation you will run in your code. They will be gathered into the app installation, ready to be executed by the chill's installer. - -Currently, we use `doctrine migration`_ to manage those migration files. A `composer`_ script located in the **chill standard** component will copy the migrations from your bundle to the doctrne migration's excepted directory after each install and/or update operation. - -.. seealso:: - - The `doctrine migration`_ documentation - Learn concepts about migrations files and scripts and the doctrine ORM - - The `doctrine migration bundle`_ documentation - Learn about doctrine migration integration with Symfony framework - -Shipping migration files -======================== - -Migrations files should be shipped under the Resource/migrations directory. You could customize the migration directory by adding extra information in your composer.json: - -.. code-block:: json - - "extra": { - "migration-source": "path/to/my/dir" - } - -The class namespace should be `Application\Migrations`, as expected by doctrine migration. Only the files which will be executed by doctrine migration will be moved: they must have the pattern `VersionYYYYMMDDHHMMSS.php` where YYYY is the year, MM the month, DD the day, HH the hour, MM the month and SS the second of creation. - -They will be moved automatically by composer when you install or update a bundle. - -Executing migration files -========================== - -The installers will have to execute migrations files manually, running - -.. code-block:: bash - - php app/console doctrine:migrations:status #will give the current status of the database - php app/console doctrine:migrations:migrate #process the update - - -Updating migration files -========================= - -.. warning:: - - After an installation, migration files will be executed and registered as executed in the database (the version timestamp is recorded into the :title:`migrations_versions` table). If you update your migration file code, the file will still be considered as "executed" by doctrine migration, which will not offers the possibility to run the migration again. - - Consequently, updating migration file should only be considered during development phase, and not published on public git branches. If you want to edit your database schema, you should create a new migration file, with a new timestamp, which will proceed to your schema adaptations. - -Every time a migration file is discovered, the composer'script will check if the migration exists in the local migration directory. If yes, the script will compare two file for changes (using a md5 hash). If migrations are discovered, the script will ask the installer to know if he must replace the file or ignore it. - -.. note:: - - You can manually run composer script by launching `composer run-script post-update-cmd` from your root chill installation's directory. - - -.. _doctrine migration: http://www.doctrine-project.org/projects/migrations.html -.. _doctrine migration bundle : http://symfony.com/doc/master/bundles/DoctrineMigrationsBundle/index.html -.. _composer : https://getcomposer.org - -Tips for development -==================== - -Migration and data ------------------- - -Each time you create a migration script, you should ensure that it will not lead to data losing. Eventually, feel free to use intermediate steps. - -Generation ----------- - -You can generate migration file from the command line, using those commands: - -* `php app/console doctrine:migrations:diff` to generate a migration file by comparing your current database to your mapping information -* `php app/console doctrine:migrations:generate` to generate a blank migration file. - -Those files will be located into `app/DoctrineMigrations` directory. You will have to copy those file to your the directory `Resources/migrations` into your bundle directory. - -Comments and documentation --------------------------- - -As files are copied from your bundle to the `app/DoctrineMigrations` directory, the link between your bundle and the copied file will be unclear. Please add all relevant documentation which will allow future developers to make a link between your file and your bundle. - -Inside the script ------------------ - -The script which move the migrations files to app directory `might be found here - diff --git a/docs/source/development/pagination.md b/docs/source/development/pagination.md new file mode 100644 index 000000000..720678ccc --- /dev/null +++ b/docs/source/development/pagination.md @@ -0,0 +1,153 @@ +# Pagination + +The Bundle `Chill\MainBundle` provides a **Pagination** api which allow you to easily divide result list on different pages. + +###### A simple example + +In the controller, get the `Chill\Main\Pagination\PaginatorFactory` from the `Container` and use this `PaginatorFactory` to create a `Paginator` instance. + +```php + +Then, render the pagination using the dedicated twig function. + + {% extends "@ChillPerson/Person/layout.html.twig" %} + + {% block title 'Item list'|trans %} + + {% block content %} + + + + {# ... your items here... #} + +
    + + {% if items|length < paginator.getTotalItems %} + {{ chill_pagination(paginator) }} + {% endif %} +``` + +The function `chill_pagination` will, by default, render a link to the 10 previous page (if they exists) and the 10 next pages (if they exists). Assuming that we are on page 5, the function will render a list to :: + + Previous 1 2 3 4 **5** 6 7 8 9 10 11 12 13 14 Next + +## Understanding the magic + +### Where does the `$paginator` get the page number ? + +Internally, the `$paginator` object has a link to the `Request` object, and it reads the `page` parameter which contains the current page number. If this parameter is not present, the `$paginator` assumes that we are on page 1. + + The `$paginator` get the current page from the request. + +### Where does the `$paginator` get the number of items per page ? + +As above, the `$paginator` can get the number of items per page from the `Request`. If none is provided, this is given by the configuration which is, by default, 50 items per page. + +###### `PaginatorFactory`, `Paginator` and `Page` + +## `PaginatorFactory` + +The `PaginatorFactory` may create more than one `Paginator` in a single action. Those `Paginator` instance may redirect to different routes and/or routes parameters. + + // create a paginator for the route 'my_route' with some parameters (arg1 and arg2) + `$paginatorMyRoute = $paginatorFactory->create($total, 'my_route', array('arg1' => 'foo', 'arg2' => $bar);` +Those parameters will override the current parameters. + +The `PaginatorFactory` has also some useful shortcuts : + + // get current page number + `$paginatorFactory->getCurrentPageNumber()` + // get the number of items per page **for the current request** + `$paginatorFactory->getCurrentItemsPerPage()` + // get the number of the first item **for the current page** + `$paginatorFactory->getCurrentPageFirstItemNumber()` + +## Working with `Paginator` and `Page` + +The paginator has a function to give the number of pages that are required to display all the results and give some information about the number of items per page : + + // how many page count this paginator ? + `$paginator->countPages(); // return 20 in our example` + + // we may get the number of items per page + `$paginator->getItemsPerPage(); // return 20 in our example` + +A `Paginator` instance create instance of `Page`, each `Page`, which is responsible for generating the URL to the page number it represents. Here are some possibilities using `Page` and `Paginator` : + + Get the current page + `$page = $paginator->getCurrentPage();` + On which page are we? + `$page->getNumber(); // return 5 in this example (we are on page 5)` + Generate the url for page 5 + `$page->generateUrl(); // return '/?page=5` + What is the first item number on this page ? + `$page->getFistItemNumber(); // return 101 in our example (20 items per page)` + What is the last item number on this page? + `$page->getLastItemNumber(); // return 120 in our example` + + We can access directly the next and current page +``` +if ($paginator->hasNextPage()) { + $next = $paginator->getNextPage(); + } + if ($paginator->hasPreviousPage()) { + $previous = $paginator->getPreviousPage(); + } +``` + + We can access directly to a given page number +``` + $page10 = $paginator->getPage(10);`` + if ($paginator->hasPage(10)) { + $page10 = $paginator->getPage(10); + } +``` + + We can iterate over our pages through a generator +``` + foreach ($paginator->getPagesGenerator() as $page) { + $page->getNumber(); + } +``` + + Check that a page object is the current page + + `$paginator->isCurrentPage($page); // return false` + + When calling a page which does not exist, the [Paginator` will throw a `RuntimeException`. Example : + + Our last page is 10 + + `$paginator->getPage(99); // out of range => throw RuntimeException` + + Our current page is 1 (the first page) + `$paginator->getPreviousPage; // does not exists (the fist page is always 1) => throw RuntimeException` + + When you create a `Paginator` for the current route and route parameters, the `Page` instances will keep the same parameters and routes : + +```php + // assuming our route is 'my_route', for the pattern '/my/{foo}/route', + // and the current route is '/my/value/route?arg2=bar' +``` + +Create a paginator for the current route and route parameters : + `$paginator = $paginatorFactory->create($total);` + +Get the next page +``` +if ($paginator->hasNext()) { + $next = $paginator->getNextPage(); + + // get the route to the page + $page->generateUrl(); // will print 'my/value/route?arg2=bar&page=2' + } +``` +Having a look at the `full classes' documentation may provide some [ useful information ](http://api.chill.social/Chill-Main/master/namespace-Chill.MainBundle.Pagination.html). + +###### Customizing the rendering of twig's [chill_pagination` + +You can provide your own layout for rendering the pagination: provides your twig template as a second argument : + + {{ chill_pagination(paginator, 'MyBundle:Pagination:MyTemplate.html.twig') }} + +The template will receive the `$paginator` as `paginator` variable. Let's have a look `at the [ current template ](https://framagit.org/Chill-project/Chill-Main/blob/master/Resources/views/Pagination/long.html.twig). diff --git a/docs/source/development/pagination.rst b/docs/source/development/pagination.rst deleted file mode 100644 index a9df72805..000000000 --- a/docs/source/development/pagination.rst +++ /dev/null @@ -1,191 +0,0 @@ -.. Copyright (C) 2016 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". - - -.. _pagination-ref: - -Pagination -########## - -The Bundle :code:`Chill\MainBundle` provides a **Pagination** api which allow you to easily divide results list on different pages. - -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. - - -.. literalinclude:: pagination/example.php - :language: php - - -Then, render the pagination using the dedicated twig function. - -.. code-block:: html+twig - - {% extends "@ChillPerson/Person/layout.html.twig" %} - - {% block title 'Item list'|trans %} - - {% block content %} - - - - {# ... your items here... #} - -
    - - {% if items|length < paginator.getTotalItems %} - {{ chill_pagination(paginator) }} - {% endif %} - - -The function :code:`chill_pagination` will, by default, render a link to the 10 previous page (if they exists) and the 10 next pages (if they exists). Assuming that we are on page 5, the function will render a list to :: - - Previous 1 2 3 4 **5** 6 7 8 9 10 11 12 13 14 Next - -Understanding the magic -======================= - -Where does the :code:`$paginator` get the page number ? -------------------------------------------------------- - -Internally, the :code:`$paginator` object has a link to the :code:`Request` object, and it reads the :code:`page` parameter which contains the current page number. If this parameter is not present, the :code:`$paginator` assumes that we are on page 1. - -.. figure:: /_static/puml/pagination-sequence.png - - The :code:`$paginator` get the current page from the request. - -Where does the :code:`$paginator` get the number of items per page ? --------------------------------------------------------------------- - -As above, the :code:`$paginator` can get the number of items per page from the :code:`Request`. If none is provided, this is given by the configuration which is, by default, 50 items per page. - -:code:`PaginatorFactory`, :code:`Paginator` and :code:`Page` -************************************************************ - -:code:`PaginatorFactory` -======================== - -The :code:`PaginatorFactory` may create more than one :code:`Paginator` in a single action. Those :code:`Paginator` instance may redirect to different routes and/or routes parameters. - -.. code-block:: php - - // create a paginator for the route 'my_route' with some parameters (arg1 and arg2) - $paginatorMyRoute = $paginatorFactory->create($total, 'my_route', array('arg1' => 'foo', 'arg2' => $bar); - -Those parameters will override the current parameters. - -The :code:`PaginatorFactory` has also some useful shortcuts : - -.. code-block:: php - - // get current page number - $paginatorFactory->getCurrentPageNumber( ) - // get the number of items per page **for the current request** - $paginatorFactory->getCurrentItemsPerPage( ) - // get the number of the first item **for the current page** - $paginatorFactory->getCurrentPageFirstItemNumber( ) - - -Working with :code:`Paginator` and :code:`Page` -=============================================== - -The paginator has some function to give the number of pages are required to displayed all the results, and give some information about the number of items per page : - -.. code-block:: php - - // how many page count this paginator ? - $paginator->countPages(); // return 20 in our example - - // we may get the number of items per page - $paginator->getItemsPerPage(); // return 20 in our example - -A :code:`Paginator` instance create instance of :code:`Page`, each :code:`Page`, which is responsible for generating the URL to the page number it represents. Here are some possibilities using :code:`Page` and :code:`Paginator` : - -.. code-block:: php - - // get the current page - $page = $paginator->getCurrentPage(); - // on which page are we ? - $page->getNumber(); // return 5 in this example (we are on page 5) - // generate the url for page 5 - $page->generateUrl(); // return '/?page=5 - // what is the first item number on this page ? - $page->getFistItemNumber(); // return 101 in our example (20 items per page) - // what is the last item number on this page ? - $page->getLastItemNumber(); // return 120 in our example - - // we can access directly the next and current page - if ($paginator->hasNextPage()) { - $next = $paginator->getNextPage(); - } - if ($paginator->hasPreviousPage()) { - $previous = $paginator->getPreviousPage(); - } - - // we can access directly to a given page number - if ($paginator->hasPage(10)) { - $page10 = $paginator->getPage(10); - } - - // we can iterate over our pages through a generator - foreach ($paginator->getPagesGenerator() as $page) { - $page->getNumber(); - } - - // check that a page object is the current page - $paginator->isCurrentPage($page); // return false - -.. warning:: - - When calling a page which does not exists, the :code:`Paginator` will throw a `RuntimeException`. Example : - - .. code-block:: php - - // our last page is 10 - $paginator->getPage(99); // out of range => throw `RuntimeException` - - // our current page is 1 (the first page) - $paginator->getPreviousPage; // does not exists (the fist page is always 1) => throw `RuntimeException` - -.. note:: - - When you create a :code:`Paginator` for the current route and route parameters, the :code:`Page` instances will keep the same parameters and routes : - - .. code-block:: php - - // assuming our route is 'my_route', for the pattern '/my/{foo}/route', - // and the current route is '/my/value/route?arg2=bar' - - // create a paginator for the current route and route parameters : - $paginator = $paginatorFactory->create($total); - - // get the next page - if ($paginator->hasNext()) { - $next = $paginator->getNextPage(); - - // get the route to the page - $page->generateUrl(); // will print 'my/value/route?arg2=bar&page=2' - } - - -Having a look to the `full classes documentation may provide some useful information `_. - - -Customizing the rendering of twig's :code:`chill_pagination` -************************************************************ - -You can provide your own layout for rendering the pagination: provides your twig template as a second argument : - -.. code-block:: html+jinja - - {{ chill_pagination(paginator, 'MyBundle:Pagination:MyTemplate.html.twig') }} - -The template will receive the :code:`$paginator` as :code:`paginator` variable. Let's have a look `at the current template `_. - diff --git a/docs/source/development/render-entity.rst b/docs/source/development/render-entity.md similarity index 61% rename from docs/source/development/render-entity.rst rename to docs/source/development/render-entity.md index bfc579682..d1a4dad01 100644 --- a/docs/source/development/render-entity.rst +++ b/docs/source/development/render-entity.md @@ -1,36 +1,28 @@ - -Rendering entity automatically -############################## +# Rendering entity automatically Some entity need to be rendered automatically for a couple of times: a person, a user, ... One can use some twig filter to render those entities: -.. code-block:: twig - {{ person|chill_entity_render_box }} -Define a renderer -================= +## Define a renderer -By default, the object passed through the renderer will be rendered using the :code:`__toString()` method. To customize this behaviour, you have to define a service and tag it using :code:`chill.render_entity`. +By default, the object passed through the renderer will be rendered using the `__toString()` method. To customize this behaviour, you have to define a service and tag it using `chill.render_entity`. The rendered is implemented using :class:`Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface`. This interface has 3 methods: -* :code:`public function supports($entity, array $options): bool`: return true if the :code:`$entity` given in parameter, with custom options, is supported by this renderer; -* :code:`public function renderString($entity, array $options): string`: render the entity as a single string, for instance in a select list; -* :code:`public function renderBox($entity, array $options): string`: render the entity in an html box. +* `public function supports($entity, array $options): bool`: return true if the `$entity` given in parameter, with custom options, is supported by this renderer; +* `public function renderString($entity, array $options): string`: render the entity as a single string, for instance in a select list; +* `public function renderBox($entity, array $options): string`: render the entity in a HTML box. -.. warning:: + The HTML returned by `renderBox` **MUST BE SAFE** of any XSS injection. - The HTML returned by :code:`renderBox` **MUST BE SAFE** of any XSS injection. - -:class:`Chill\MainBundle\Templating\Entity\AbstractChillEntityRender` provides some useful methods to get the opening and closing boxes that should be used. +`Chill\MainBundle\Templating\Entity\AbstractChillEntityRender` provides some useful methods to get the opening and closing boxes that should be used. Usage about rendering comment: -.. code-block:: php - +```php namespace Chill\MainBundle\Templating\Entity; use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable; @@ -108,47 +100,41 @@ Usage about rendering comment: return $entity instanceof CommentEmbeddable; } } +``` Logic inside the template: -.. code-block:: twig - +```twig + {# @var opening_box: string #} + {# @var closing_box: string #} {{ opening_box|raw }}
    {# logic for rendering #} -
    + {{ closing_box|raw }} +``` -Usage in templates -================== +## Usage in templates -For rendering entity as a box: +For rendering an entity as a box: -.. code-block:: twig + `{{ entity|chill_entity_render_box }}` - {{ entity|chill_entity_render_box }} +For rendering an entity as a string: -For rendering entity as a string: + `{{ entity|chill_entity_render_string }}` -.. code-block:: twig +## Available renderer and options - {{ entity|chill_entity_render_string }} - -Available renderer and options -============================== - -:code:`Person` (Person Bundle) ------------------------------- +### `Person` (Person Bundle) * no options -:code:`CommentEmbeddable` (Main Bundle) ---------------------------------------- +### `CommentEmbeddable` (Main Bundle) -Options: - -* :code:`user`: options which will be passed to "user" renderer -* :code:`disable_markdown`: disable markdown renderer, default to :code:`FALSE` -* :code:`limit_lines` (integer) limit the number of lines. Default to :code:`NULL`. May be an integer. -* :code:`metadata` (boolean): show the last updating user and last updating date. Default to :code:`TRUE`. +Options : +* `user`: options, which will be passed to "user" renderer +* `disable_markdown`: disable markdown renderer, default to `FALSE` +* `limit_lines` (integer) limit the number of lines. Default to `NULL`. Can be an integer. +* `metadata` (boolean): show the last updating user and last updating date. Default to `TRUE`. diff --git a/docs/source/development/routing.rst b/docs/source/development/routing.md similarity index 52% rename from docs/source/development/routing.rst rename to docs/source/development/routing.md index 519490918..2d635d039 100644 --- a/docs/source/development/routing.rst +++ b/docs/source/development/routing.md @@ -1,40 +1,26 @@ -.. 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". +# Routing +Our goal is to ease the installation of the different bundles. Users should not have to dive into complicated config files to install bundles. -Routing -####### +## A routing loader is available for all bundles -Our goal is to ease the installation of the different bundle. Users should not have to dive into complicated config files to install bundles. - -A routing loader available for all bundles -=========================================== - -A Chill bundle may rely on the Routing Loader defined in ChillMain. +A Chill bundle may rely on the Routing Loader defined in ChillMain. The loader will load `yml` or `xml` files. You simply have to add them into `chill_main` config -.. code-block:: yaml - +```yaml chill_main: # ... other stuff here routing: resources: - @ChillMyBundle/Resources/config/routing.yml +``` -Load routes automatically -------------------------- +### Load routes automatically -But this force users to modify config files. To avoid this, you may prepend config implementing the `PrependExtensionInterface` in the `YourBundleExtension` class. This is an example from **chill main** bundle : - - -.. code-block:: php +But this forces users to modify config files. To avoid this, you may prepend config implementing the `PrependExtensionInterface` in the `YourBundleExtension` class. This is an example from **chill main** bundle : +```php namespace Chill\MainBundle\DependencyInjection; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -49,7 +35,7 @@ But this force users to modify config files. To avoid this, you may prepend conf // ... } - public function prepend(ContainerBuilder $container) + public function prepend(ContainerBuilder $container) { //add current route to chill main @@ -64,5 +50,4 @@ But this force users to modify config files. To avoid this, you may prepend conf )); } } - - +``` diff --git a/docs/source/development/run-tests.md b/docs/source/development/run-tests.md new file mode 100644 index 000000000..4c2ee7e16 --- /dev/null +++ b/docs/source/development/run-tests.md @@ -0,0 +1,58 @@ +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". + +###### Run tests + +In reason of the Chill architecture, test should be runnable from the bundle's directory and works correctly: this will allow continuous integration tools to run tests automatically. + +## From chill app + +This is the most convenient method for developer: run test for chill bundle from the main app. + +```bash + # run into a container + `docker-compose exec --user $(id -u) php bash` + # execute all tests suites + `bin/phpunit` + # ... or execute a single test + `bin/phpunit vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Tests/path/to/FileTest.php` +``` + +You can also run tests in a single command: + + `docker-compose exec --user $(id -u) php bin/phpunit` + +### Tests from a bundle (chill-bundles) + +Those tests need the whole symfony app to execute Application Tests (which test html page). + +For ease, the app is cloned using a `git submodule`, which clone the main app into `tests/app`, and tests are bootstrapped to this app. The dependencies are also installed into `tests/app/vendor` to ensure compliance with relative path from this symfony application. + +You may boostrap the tests for the chill bundle this way: + +```bash + # ensure to be located into the environment (provided by docker suits well) + `docker-compose exec --user $(id -u) php bash` + # go to chill subdirectory + `cd vendor/chill-project/chill-bundles` + # install submodule + `git submodule init` + `git submodule update` + # install composer and dependencies + `curl -sS https://getcomposer.org/installer | php` + # run tests + `bin/phpunit` +``` + + If you are on a fresh installation, you will need to migrate database schema. + + The path to the console tool must be adapted to the app. To load migration and add fixtures, one can execute the following commands: + +```bash + tests/app/bin/console doctrine:migrations:migrate + tests/app/bin/console doctrine:fixtures:load +``` diff --git a/docs/source/development/run-tests.rst b/docs/source/development/run-tests.rst deleted file mode 100644 index 1dd944e58..000000000 --- a/docs/source/development/run-tests.rst +++ /dev/null @@ -1,68 +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". - -Run tests -********* - -In reason of the Chill architecture, test should be runnable from the bundle's directory and works correctly: this will allow continuous integration tools to run tests automatically. - -From chill app -============== - -This is the most convenient method for developer: run test for chill bundle from the main app. - -.. code-block:: bash - - # run into a container - docker-compose exec --user $(id -u) php bash - # execute all tests suites - bin/phpunit - # .. or execute a single test - bin/phpunit vendor/chill-project/chill-bundles/src/Bundle/ChillMainBundle/Tests/path/to/FileTest.php - -You can also run tests in a single command: - -.. code-block:: bash - - docker-compose exec --user $(id -u) php bin/phpunit - - -Tests from a bundle (chill-bundles) ------------------------------------ - -Those tests needs the whole symfony app to execute Application Tests (which test html page). - -For ease, the app is cloned using a :code:`git submodule`, which clone the main app into :code:`tests/app`, and tests are bootstrapped to this app. The dependencies are also installed into `tests/app/vendor` to ensure compliance with relative path from this symfony application. - -You may boostrap the tests fro the chill bundle this way: - -.. code-block:: bash - - # ensure to be located into the environement (provided by docker suits well) - docker-compose exec --user $(id -u) php bash - # go to chill subdirectory - cd vendor/chill-project/chill-bundles - # install submodule - git submodule init - git submodule update - # install composer and dependencies - curl -sS https://getcomposer.org/installer | php - # run tests - bin/phpunit - -.. note:: - - If you are on a fresh install, you will need to migrate database schema. - - The path to console tool must be adapted to the app. To load migration and add fixtures, one can execute the following commands: - - .. code-block:: bash - - tests/app/bin/console doctrine:migrations:migrate - tests/app/bin/console doctrine:fixtures:load - diff --git a/docs/source/development/searching.md b/docs/source/development/searching.md new file mode 100644 index 000000000..d1e9d8dd3 --- /dev/null +++ b/docs/source/development/searching.md @@ -0,0 +1,222 @@ +###### Searching + +Chill should provide information needed by users when they need it. Searching within bundle, entities, ... is an important feature to achieve this goal. + +The Main Bundle provides interfaces to ease the developer's work. It will also attempt that search will work in the same way accross bundles. + + :local: + + [Our blog post about searching (in French) ](http://blog.champs-libres.coop/vie-des-champs/2015/01/06/va-chercher-chill-la-recherche-dans-chill-logiciel-libre-service-social.html) + This blog post gives some information for end-users about searching. + + [The issue about search behaviour ](https://redmine.champs-libres.coop/issues/377) + Where the search behavior is defined. + +## Searching at a glance for developers + +Chill suggests using an easy-to-learn language search. + + We are planning to provide a form to create an automatic search pattern according to this language. Watch the [issue regarding this feature ](https://redmine.champs-libres.coop/issues/389). + +The language is an association of search terms. Search terms may contain : + +- **a domain**: this is "the domain you want to search": it may some entities like people, reports, ... Example: [@person` to search accross people, `@report` to browse reports, ... The search pattern may have **a maximum of one** domain by search, providing more should throw an error, and trigger a warning for users. +- **arguments and their values** : This is "what you search." Arguments narrow the search to specific fields: username, date of birth, nationality, ... The syntax is `argument:value`. I.e.: ` birthdate:2014-12-15`, `firstname:Depardieu`, ... **Arguments are optional**. If the value of an argument contains spaces or characters like punctuation, quotes ("), the value should be provided between parenthesis : `firstname:(Van de snoeck)`, `firstname:(M'bola)`, ... +- **default value** : this the "rest" of the search, not linked with any arguments or domain. Example : `@person dep` (`dep` is the "default value"), or simply `dep` if any domain is provided (which is perfectly acceptable). If a string is not idenfied as argument or domain, it will be present in the "default" term. + +If a search pattern (provided by the user) does not contain any domain, the search must be run across default domain/search modules. + +A domain may be supported by different search modules. For instance, if you provide the domain `@person`, the end-user may receive results of exact firstname/lastname, but also result with spelling suggestion, ... **But** if results do not fit into the first page (if you have 75 results and the screen show only 50 results), the next page should contains only the results from the required module. + +For instance: a user searches across people by firstname/lastname, the exact spelling contains 10 results, the "spelling suggestion" results contain 75 names, but show only the first 50. If the user want to see the last 25, the next screen should not contains the results by firstname/lastname. + +## Allowed characters as arguments + +To execute regular expression, the allowed characters in arguments are a-z characters, numbers, and the sign '-'. Spaces and special characters like accents are note allowed (the accents are removed during parsing). + +## Special characters and uppercase + +The search should not care about lowercase/uppercase and accented characters. Currently, they are removed automatically by the `chill.main.search_provider`. + +## Implementing a search module for dev + +To implement a search module, you should : + +- create a class which implements the `Chill\MainBundle\Search\SearchInterface` class. An abstract class `Chill\MainBundle\Search\AbstractSearch` will provide useful assertions for parsing date string to `DateTime` objects, ... +- register the class as a service, and tag the service with `chill.search` and an appropriate alias + +The search logic is provided under the `/search` route. + + `The implementation of a search module in the Person bundle ](https://github.com/Chill-project/Person/blob/master/Search/PersonSearch.php) + An example of implementation https://github.com/Chill-project/Main/blob/master/DependencyInjection/SearchableServicesCompilerPass.php + + **Internals explained** : the services tagged with [chill.search` are gathered into the `chill.main.search_provider` service during compilation (`see the compiler pass ](https://github.com/Chill-project/Main/blob/master/DependencyInjection/SearchableServicesCompilerPass.php)). + + The [chill.main.search_provider` service allows to : + + - retrieve all results (as HTML string) for all search modules concerned by the search (according to the domain provided or modules marked as default) + - retrieve result for one search module + +### The SearchInterface class + +```php + namespace Chill\PersonBundle\Search; + + use Chill\MainBundle\Search\AbstractSearch; + use Doctrine\ORM\EntityManagerInterface; + use Chill\PersonBundle\Entity\Person; + use Symfony\Component\DependencyInjection\ContainerInterface; + use Symfony\Component\DependencyInjection\ContainerAware; + use Symfony\Component\DependencyInjection\ContainerAwareTrait; + use Chill\MainBundle\Search\ParsingException; + + class PersonSearch extends AbstractSearch + { + + // indicate which domain you support + // you may respond TRUE to multiple domain, according to your logic + public function supports($domain, $format='html') + { + return 'person' === $domain; + } + + // if your domain must be called when no domain is provided, should return true + public function isActiveByDefault() + { + return true; + } + + // if multiple modules respond to the same domain, indicate an order for your search. + public function getOrder() + { + return 100; + } + + // This is where your search logic should be executed. + // This method must return an HTML string (a string with HTML tags) + // see below about the structure of the $term array + public function renderResult(array $terms, $start = 0, $limit = 50, array $options = array(), $format = 'html') + { + return $this->container->get('templating')->render('ChillPersonBundle:Person:list.html.twig', + array( + // you should implement the `search` function somewhere :-) + 'persons' => $this->search($terms, $start, $limit, $options), + // recomposePattern is available in AbstractSearch class + 'pattern' => $this->recomposePattern($terms, array('nationality', + 'firstname', 'lastname', 'birthdate', 'gender'), $terms['_domain']), + // you should implement the `count` function somewhere :-) + 'total' => $this->count($terms) + )); + } + } +``` + +##### Values for `$options` + +`$options` is an array with the following keys: + +- `SearchInterface::SEARCH_PREVIEW_OPTION` (bool): if the current view is a preview (the first 5 results) or not ; +- `SearchInterface::REQUEST_QUERY_PARAMETERS` (bool): some parameters added to the query (under the key `SearchInterface::REQUEST_QUERY_KEY_ADD_PARAMETERS`) and that can be interpreted. Used, for instance, when calling a result in json format when searching for interactive picker form. + +##### Structure of array `$term` + +The array term is parsed automatically by the `main.chill.search_provider` service. + + If you need to parse a search pattern, you may use the function `parse($pattern)` provided by the service. + +The array `$term` have the following structure after parsing : + +```php + array( + '_domain' => 'person', //the domain, without the '@' + 'argument1' => 'value', //the argument1, with his value + 'argument2' => 'my value with spaces', //the argument2 + '_default' => 'abcde ef' // the default term + ); +``` + +The original search would have been : `@person argument1:value argument2:(my value with spaces) abcde ef` + + The search values are always unaccented. + +##### Returning a result in JSON + +The JSON format is mainly used by "select2" widgets. + +When returning a result in JSON, the SearchInterface should only return an array with following keys: + +- `more` (bool): if the search has more result than the current page ; +- `results` (array): a list of a result, where: + + - `text` (string): the text that should be displayed in browser ; + - `id` (string): the id of the entity. + +### Register the service + +You should add your service in the configuration, and add a `chill.search` tag and an alias. + +Example : + +```yaml + services: + chill.person.search_person: + class: Chill\PersonBundle\Search\PersonSearch + #your logic here + tags: + - { name: chill.search, alias: 'person_regular' } +``` + +The alias will be used to get the results narrowed to this search module, in case of pagination (see above). + +## Parsing date + +The class `Chill\MainBundle\Search\AbstractSearch` provides a method to parse date : + + //from subclasses + `$date = $this->parseDate($string);` + +`$date` will be an instance of `DateTime ](http://php.net/manual/en/class.datetime.php). + + [The possibility to add periods instead of date ](https://redmine.champs-libres.coop/issues/390) + Which may be a future improvement for search with date. + +## Exceptions + +The logic of the search is handled by the controller for the `/search` path. + +You should throw those Exceptions from your instance of `SearchInterface` if needed : + +Chill\MainBundle\Search\ParsingException + If the terms do not fit your search logic (for instance, conflicting terms) + +## Expected behaviour + +### Operators between multiple terms + +Multiple terms should be considered are "AND" instructions : + +@person nationality:RU firstname:dep + the people having the Russian nationality AND having DEP in their name + +@person birthdate:2015-12-12 charles + the people having 'charles' in their name or firstname AND born on December 12, 2015 + +### Spaces in default + +Spaces in default terms should be considered as "AND" instruction + +@person charle dep + people have "dep" AND "charles" in their firstname or lastname. Match "Charles Depardieu" but not "Gérard Depardieu" ('charle' is not present) + +### Rendering + +The rendering should contain : + +- the total number of results ; +- the search pattern in the search language. The aim of this is to let users learn the search language easily. +- a title + +## Frequently Asked Questions (FAQ) + +Why does renderResults return an HTML string and not a structured array? + It seems that the form of results may vary (according to access-right logic, ...) and is not easily structurable diff --git a/docs/source/development/searching.rst b/docs/source/development/searching.rst deleted file mode 100644 index 023d16a6e..000000000 --- a/docs/source/development/searching.rst +++ /dev/null @@ -1,276 +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". - - -Searching -********* - -Chill should provide information needed by users when they need it. Searching within bundle, entities,... is an important feature to achieve this goal. - -The Main Bundle provide interfaces to ease the developer work. It will also attempt that search will work in the same way accross bundles. - -.. contents:: Table of content - :local: - -.. seealso:: - - `Our blog post about searching (in French) `_ - This blog post give some information for end-users about searching. - - `The issue about search behaviour `_ - Where the search behaviour is defined. - -Searching in a glance for developers -==================================== - -Chill suggests to use an easy-to-learn language search. - -.. note:: - - We are planning to provide a form to create automatically search pattern according to this language. Watch the `issue regarding this feature `_. - -The language is an association of search terms. Search terms may contains : - -- **a domain**: this is "the domain you want to search" : it may some entities like people, reports, ... Example : `@person` to search accross people, `@report` to browse reports, ... The search pattern may have **a maximum of one** domain by search, providing more should throw an error, and trigger a warning for users. -- **arguments and their values** : This is "what you search". Arguments narrow the search to specific fields : username, date of birth, nationality, ... The syntax is `argument:value`. I.e.: ` birthdate:2014-12-15`, `firstname:Depardieu`, ... **Arguments are optional**. If the value of an argument contains spaces or characters like punctuation, quotes ("), the value should be provided between parenthesis : `firstname:(Van de snoeck)`, `firstname:(M'bola)`, ... -- **default value** : this the "rest" of the search, not linked with any arguments or domain. Example : `@person dep` (`dep` is the "default value"), or simply `dep` if any domain is provided (which is perfectly acceptable). If a string is not idenfied as argument or domain, it will be present in the "default" term. - -If a search pattern (provided by the user) does not contains any domain, the search must be run across default domain/search modules. - -A domain may be supported by different search modules. For instance, if you provide the domain `@person`, the end-user may receive results of exact firstname/lastname, but also result with spelling suggestion, ... **But** if results do not fit into the first page (if you have 75 results and the screen show only 50 results), the next page should contains only the results from the required module. - -For instance : a user search across people by firstname/lastname, the exact spelling contains 10 results, the "spelling suggestion" results contains 75 names, but show only the first 50. If the user want to see the last 25, the next screen should not contains the results by firstname/lastname. - -Allowed characters as arguments -=============================== - -In order to execute regular expression, the allowed chararcters in arguments are a-z characters, numbers, and the sign '-'. Spaces and special characters like accents are note allowed (the accents are removed during parsing). - -Special characters and uppercase -================================ - -The search should not care about lowercase/uppercase and accentued characters. Currently, they are removed automatically by the `chill.main.search_provider`. - -Implementing search module for dev -=================================== - -To implement a search module, you should : - -- create a class which implements the `Chill\MainBundle\Search\SearchInterface` class. An abstract class `Chill\MainBundle\Search\AbstractSearch` will provide useful assertions for parsing date string to `DateTime` objects, ... -- register the class as a service, and tag the service with `chill.search` and an appropriate alias - -The search logic is provided under the `/search` route. - -.. seealso:: - - `The implementation of a search module in Person bundle `_ - An example of implementationhttps://github.com/Chill-project/Main/blob/master/DependencyInjection/SearchableServicesCompilerPass.php - -.. note:: - - **Internals explained** : the services tagged with `chill.search` are gathered into the `chill.main.search_provider` service during compilation (`see the compiler pass `_). - - The `chill.main.search_provider` service allow to : - - - retrieve all results (as html string) for all search module concerned by the search (according to the domain provided or modules marked as default) - - retrieve result for one search module - -The SearchInterface class -------------------------- - -.. code-block:: php - - namespace Chill\PersonBundle\Search; - - use Chill\MainBundle\Search\AbstractSearch; - use Doctrine\ORM\EntityManagerInterface; - use Chill\PersonBundle\Entity\Person; - use Symfony\Component\DependencyInjection\ContainerInterface; - use Symfony\Component\DependencyInjection\ContainerAware; - use Symfony\Component\DependencyInjection\ContainerAwareTrait; - use Chill\MainBundle\Search\ParsingException; - - class PersonSearch extends AbstractSearch - { - - // indicate which domain you support - // you may respond TRUE to multiple domain, according to your logic - public function supports($domain, $format='html') - { - return 'person' === $domain; - } - - // if your domain must be called when no domain is provided, should return true - public function isActiveByDefault() - { - return true; - } - - // if multiple module respond to the same domain, indicate an order for your search. - public function getOrder() - { - return 100; - } - - - // This is where your search logic should be executed. - // This method must return an HTML string (a string with HTML tags) - // see below about the structure of the $term array - public function renderResult(array $terms, $start = 0, $limit = 50, array $options = array(), $format = 'html') - { - return $this->container->get('templating')->render('ChillPersonBundle:Person:list.html.twig', - array( - // you should implements the `search` function somewhere :-) - 'persons' => $this->search($terms, $start, $limit, $options), - // recomposePattern is available in AbstractSearch class - 'pattern' => $this->recomposePattern($terms, array('nationality', - 'firstname', 'lastname', 'birthdate', 'gender'), $terms['_domain']), - // you should implement the `count` function somewhere :-) - 'total' => $this->count($terms) - )); - } - } - - -Values for :code:`$options` -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -:code:`$options` is an array with the following keys: - -- :code:`SearchInterface::SEARCH_PREVIEW_OPTION` (bool): if the current view is a preview (the first 5 results) or not ; -- :code:`SearchInterface::REQUEST_QUERY_PARAMETERS` (bool): some parameters added to the query (under the key :code:`SearchInterface::REQUEST_QUERY_KEY_ADD_PARAMETERS`) and that can be interpreted. Used, for instance, when calling a result in json format when searching for interactive picker form. - - - - -Structure of array `$term` -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The array term is parsed automatically by the `main.chill.search_provider` service. - -.. note:: - If you need to parse a search pattern, you may use the function `parse($pattern)` provided by the service. - -The array `$term` have the following structure after parsing : - -.. code-block:: php - - array( - '_domain' => 'person', //the domain, without the '@' - 'argument1' => 'value', //the argument1, with his value - 'argument2' => 'my value with spaces', //the argument2 - '_default' => 'abcde ef' // the default term - ); - -The original search would have been : `@person argument1:value argument2:(my value with spaces) abcde ef` - -.. warning:: - The search values are always unaccented. - -Returning a result in json -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The json format is mainly used by "select2" widgets. - -When returning a result in json, the SearchInterface should only return an array with following keys: - -- :code:`more` (bool): if the search has more result than the current page ; -- :code:`results` (array): a list of result, where: - - - :code:`text` (string): the text that should be displayed in browser ; - - :code:`id` (string): the id of the entity. - - - -Register the service --------------------- - -You should add your service in the configuration, and add a `chill.search` tag and an alias. - -Example : - -.. code-block:: yaml - - services: - chill.person.search_person: - class: Chill\PersonBundle\Search\PersonSearch - #your logic here - tags: - - { name: chill.search, alias: 'person_regular' } - -The alias will be used to get the results narrowed to this search module, in case of pagination (see above). - -Parsing date -============ - -The class `Chill\MainBundle\Search\AbstractSearch` provides a method to parse date : - -.. code-block:: php - - //from subclasses - $date = $this->parseDate($string); - -`$date` will be an instance of `DateTime `_. - -.. seealso:: - - `The possibility to add periods instead of date `_ - Which may be a future improvement for search with date. - -Exceptions -========== - -The logic of the search is handled by the controller for the `/search` path. - -You should throw those Exception from your instance of `SearchInterface` if needed : - -Chill\MainBundle\Search\ParsingException - If the terms does not fit your search logic (for instance, conflicting terms) - -Expected behaviour -================== - -Operators between multiple terms --------------------------------- - -Multiple terms should be considered are "AND" instructions : - -@person nationality:RU firstname:dep - the people having the Russian nationality AND having DEP in their name - -@person birthdate:2015-12-12 charles - the people having 'charles' in their name or firstname AND born on December 12 2015 - -Spaces in default ------------------ - -Spaces in default terms should be considered as "AND" instruction - -@person charle dep - people having "dep" AND "charles" in their firstname or lastname. Match "Charles Depardieu" but not "Gérard Depardieu" ('charle' is not present) - -Rendering ---------- - -The rendering should contains : - -- the total number of results ; -- the search pattern in the search language. The aim of this is to let users learn the search language easily. -- a title - -Frequently Asked Questions (FAQ) -================================ - -Why renderResults returns an HTML string and not structured array ? - It seems that the form of results may vary (according to access-right logic, ...) and is not easily structurable - - - - - - diff --git a/docs/source/development/timelines.rst b/docs/source/development/timelines.md similarity index 76% rename from docs/source/development/timelines.rst rename to docs/source/development/timelines.md index 51c0a1bad..c5dea7432 100644 --- a/docs/source/development/timelines.rst +++ b/docs/source/development/timelines.md @@ -1,49 +1,31 @@ -.. Copyright (C) 2015 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". +###### Timelines -.. _timelines: - -Timelines -********* - -.. contents:: Table of content :local: -Concept -======= +## Concept -From an user point of view --------------------------- +### From a user point of view -Chill has two objectives : +Chill has two goals : -* make the administrative tasks more lightweight ; +* it makes 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. +To reach this second goal, 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 : -* a person : events linked to this person are shown on the page ; +* 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. +In another 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:: + [The issue where the subject was first discussed ](https://redmine.champs-libres.coop/issues/224) - `The issue where the subject was first discussed `_ - - -For developers --------------- +### For developers The `Main` bundle provides interfaces and services to help to build timelines. @@ -51,45 +33,38 @@ If a bundle wants to *push* information in a timeline, it should be create a ser 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 -^^^^^^^^^^^^^^^^^^^^^ +##### 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". -To avoid such load on database, the objects are queried in two steps : +To avoid such a load on a 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. +1. A UNION request that gathers 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. ID queries the PHP objects, 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. +Those methods should ensure that only X PHP objects will be gathered and built by the ORM. -What does the master timeline builder service ? -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +##### 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, 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 `) +2. The UNION query is run, the result contains an id and a type for each row (see [above ](understanding-queries.md)) 3. The master service gather all id with the same type. Then he searches for the `chill.timeline`'s service which will be able to get the entities. Then, the entities will be fetched using the `fetchEntities` function. All entities are gathered in one query ; 4. The information to render entities in HTML is gathered by passing entity, one by one, on `getEntityTemplate` function. -Pushing events to a timeline -============================= +## Pushing events to a timeline To push events on a timeline : 1. Create a class which implements `Chill\MainBundle\Timeline\TimelineProviderInterface` ; 2. Define the class as a service, and tag the service with `chill.timeline`, and define the context associated with this timeline (you may add multiple tags for different contexts). -Implementing the TimelineProviderInterface ------------------------------------------- +### Implementing the TimelineProviderInterface The has the following signature : -.. code-block:: php - +```php namespace Chill\MainBundle\Timeline; interface TimelineProviderInterface @@ -135,7 +110,6 @@ The has the following signature : * - `template` : the template FQDN * - `template_data`: the data required by the template * - * * Example: * * ``` @@ -160,51 +134,42 @@ The has the following signature : public function getEntityTemplate($entity, $context, array $args); } +``` +##### The `fetchQuery` function -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 helps to build the UNION query to gather events. This function should return an instance of `TimelineSingleQuery`. For you convenience, this object may be build using an associative array with the following keys: * `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 +* `FROM`: the FROM clause. May contain JOIN instructions * `WHERE`: the WHERE clause; * `parameters`: the parameters to pass to the query -The parameters should be replaced into the query by :code:`?`. They will be replaced into the query using prepared statements. +The parameters should be replaced into the query by `?`. They will be replaced into the query using prepared statements. `$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 : -.. code-block:: php - array( 'person' => $person //a \Chill\PersonBundle\Entity\Person entity ); -For the context :code:`center`, the args will be: - -.. code-block:: php +For the context `center`, the args will be: 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. Example of an implementation : -.. code-block:: php - +```php namespace Chill\ReportBundle\Timeline; use Chill\MainBundle\Timeline\TimelineProviderInterface; @@ -250,19 +215,16 @@ Example of an implementation : //.... - } +``` -The `supportsType` function -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +##### 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 indicates 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 : -.. code-block:: php - - +```php namespace Chill\ReportBundle\Timeline; use Chill\MainBundle\Timeline\TimelineProviderInterface; @@ -284,16 +246,15 @@ The implementation of our previous example will be : //... } +``` -The `getEntities` function -^^^^^^^^^^^^^^^^^^^^^^^^^^^ +##### The `getEntities` function This is where the service must fetch entities from database and return them to the master service. The results **must be** an array where the id given by the UNION query (remember `fetchQuery`). -.. code-block:: php - +```php namespace Chill\ReportBundle\Timeline; use Chill\MainBundle\Timeline\TimelineProviderInterface; @@ -316,9 +277,9 @@ The results **must be** an array where the id given by the UNION query (remember } } +``` -The `getEntityTemplate` function -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +##### The `getEntityTemplate` function This is where the master service will collect information to render the entity. @@ -329,8 +290,7 @@ The result must be an associative array with : Example : -.. code-block:: php - +```php array( 'template' => 'ChillMyBundle:timeline:template.html.twig', 'template_data' => array( @@ -338,23 +298,19 @@ Example : 'person' => $args['person'] ) ); +``` -The template must, obviously, exists. Example : - -.. code-block:: jinja +The template must exist. Example :

     {{ 'An accompanying period is opened for %person% on %date%'|trans({'%person%': person, '%date%': period.dateOpening|localizeddate('long', 'none') } ) }}

    - -Create a timeline with his own context -====================================== +## 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 : -.. code-block:: php - +```php namespace Chill\PersonBundle\Controller; use Symfony\Component\HttpFoundation\Response; @@ -384,3 +340,4 @@ Example : } } +``` diff --git a/docs/source/development/translation_directives.rst b/docs/source/development/translation_directives.rst new file mode 100644 index 000000000..106ffb3ab --- /dev/null +++ b/docs/source/development/translation_directives.rst @@ -0,0 +1,419 @@ +============================================ +Directives for creating new translation keys +============================================ + +These directives are meant to ensure better consistency across bundles, avoid duplication, and make keys more predictable. + + +General Principles +================== + +1. **Use lowercase snake_case for all keys** + +2. **Use dot-separated namespaces** + The dot is used to reflect: + - bundle + - feature + - sub-feature + - key type + +3. **Do not use spaces in keys** + +4. **Avoid duplicating the same text in multiple places** + When a translation is needed, try a search for the translation value first and see if it exists elsewhere + +5. **If a key is used across multiple bundles, it must live in ChillMainBundle.** + +6. **If a key is used across multiple bundles and is a generic term, it must be placed in the ``common`` namespace.** + + +Key Structure +============= + +We use the following structure: + +.. code-block:: text + + ... + +Where: + +* ``<>`` identifies the bundle or shared context +* ```` identifies the part of the module using the translation +* ```` describes the text purpose +* ```` for a multi-level element ( eg. activity.export.person.count.description) + +Examples of scopes +------------------ + +* ``activity`` — ChillActivityBundle +* ``person`` — ChillPersonBundle +* ``common`` — neutral shared translation values + + +Naming Scopes +============= + +1. **Bundle-specific keys** + + For most things inside a bundle: + + .. code-block:: text + + activity.. + + Example: + + .. code-block:: text + + activity.form.save + activity.list.title + activity.entity.type + activity.menu.activities + activity.controller.success_created + +2. **Shared UI elements (buttons, labels, generic text)** + + These belong in the ``common`` namespace in ChillMainBundle: + + .. code-block:: text + + common.save + common.delete + common.edit + common.filter + common.duration_time + +Translation workflow +==================== + +Use the following workflow when deciding where a key belongs: + +1. **Is this text used in more than one bundle?** + → Place in ``main`` or ``common`` + +2. **Is this text generic UI (button, label, pagination, yes/no)?** + → Place in ``common`` + +3. **Is this text specific to one bundle and one feature?** + → Place in ``.feature.`` + +4. **Is this text related to an entity or value object?** + → Place in ``.entity..`` + +5. **Is this text used in forms?** + → ``.form.`` or ``.form.`` + +6. **Is this text related to exports?** + → ``.export..`` + +7. **Is it related to filtering, searching or parameters?** + → ``.filter.`` or + → ``.filter..`` for nested filters + + +Examples based on translations within ChillActivityBundle +========================================================= + +Below are concrete examples from ``ChillActivityBundle``, +refactored according to the guidelines. + + +General activity keys +--------------------- + +Instead of scattered keys like:: + + Show the activity + Edit the activity + Activity + Duration time + ... + +We use: + +.. code-block:: text + + activity.general.show + activity.general.edit + activity.general.title + activity.general.duration + activity.general.travel_time + activity.general.attendee + activity.general.remark + activity.general.no_comments + + +Forms +----- + +Instead of keys like:: + + Activity creation + Save activity + Reset form + Choose a type + +Use: + +.. code-block:: text + + activity.form.title_create + activity.form.save + activity.form.reset + activity.form.choose_type + activity.form.choose_duration + +Long lists (like durations) should be grouped: + +.. code-block:: text + + activity.form.duration.5min + activity.form.duration.10min + activity.form.duration.15min + activity.form.duration.1h + activity.form.duration.1h30 + activity.form.duration.2h + ... + +Entities +-------- + +Entity fields should follow: + +.. code-block:: text + + activity.entity.activity.date + activity.entity.activity.comment + activity.entity.activity.deleted + activity.entity.location.name + activity.entity.location.type + + +Controller messages +------------------- + +Instead of strings as keys:: + + 'Success : activity created!' + 'The form is not valid. The activity has not been created !' + +Use: + +.. code-block:: text + + activity.controller.success_created + activity.controller.error_invalid_create + activity.controller.success_updated + activity.controller.error_invalid_update + + +Roles +----- + +Access control keys should be: + +.. code-block:: text + + activity.role.create + activity.role.update + activity.role.see + activity.role.see_details + activity.role.delete + activity.role.stats + activity.role.list + + +Admin +----- + +.. code-block:: text + + activity.admin.configuration + activity.admin.types + activity.admin.reasons + activity.admin.reason_category + activity.admin.presence + + +CRUD +---- + +.. code-block:: text + + activity.crud.type.title_new + activity.crud.type.title_edit + activity.crud.presence.title_new + + +Activity Reason +--------------- + +.. code-block:: text + + activity.reason.list + activity.reason.create + activity.reason.active + activity.reason.category + activity.reason.entity_title + + +Exports +------- + +Group them logically: + +.. code-block:: text + + activity.export.person.count.title + activity.export.person.count.description + activity.export.person.count.header + + activity.export.period.sum_duration.title + activity.export.period.sum_duration.description + activity.export.period.sum_duration.header + + +Filters +------- + +Use hierarchical filters: + +.. code-block:: text + + activity.filter.by_reason + activity.filter.by_type + activity.filter.by_date + activity.filter.by_location + activity.filter.by_sent_received + activity.filter.by_user + + +Aggregators +----------- + +.. code-block:: text + + activity.aggregator.reason.by_category + activity.aggregator.reason.level + activity.aggregator.user.by_scope + activity.aggregator.user.by_job + + +Global/Shared Keys +================== + +Keys like the following **must not be redeclared** in each bundle: + +- First name +- Last name +- Username +- ID +- Type +- Duration +- Comment +- Date +- Location +- Present / Not present +- Add / Edit / Delete / Save / Update + +These belong in ``common`` or ``main``: + +.. code-block:: text + + common.firstname + common.lastname + common.username + common.id + common.type + common.comment + common.date + common.location + common.present + common.absent + common.add + common.edit + common.delete + common.save + common.update + + +Naming directives summary +========================== + +* **snake_case** +* **namespaced with dots** +* **bundle prefix for bundle-specific concepts** +* **common or main for shared concepts** +* **avoid free-floating keys (without namespace)** +* **reuse common keys wherever possible** + + +Migration Strategy (Optional) +============================= + +To apply this structure progressively: + +1. New keys must follow these guidelines. +2. Existing keys may remain as-is until refactored. +3. When refactoring: + - Move cross-bundle keys to ChillMainBundle and possible `common` namespace. + - Replace duplicated keys with shared ones. + +=========================================== +Avoiding duplicate translations +=========================================== + +1. Use Shared Namespaces +======================== + +Two namespaces must be used for shared translations: + +* ``common.*`` — generic UI concepts (save, delete, date, name, etc.) + +If a translation may be reused in multiple bundles, it must be placed +in the ``common`` namespace or in ChillMainBundle. + +2. Bundle-Specific Keys +======================= + +Keys belonging only to one bundle or one feature are namespaced inside that +bundle: + +.. code-block:: text + + activity.. + person.. + +3. Search Before Creating +========================= + +Before adding a new translation key, developers must: + +1. For common translations like: "enregistrer/opslaan" look in the `common` namespace. +3. Search in Loco or translations for existing values. + +If a suitable key exists, reuse it. + +4. Only Create a New Key When Necessary +======================================= + +Create a new key only when the text is: + +* specific to the bundle +* specific to the feature +* not reusable elsewhere + +6. Progressive Cleanup +====================== + +Old duplicates may remain temporarily. When updating code in an area, clean +duplicate values by moving them into ``common`` or ``main``. + +General workflow +================ + +* **Reuse shared keys** within ``common`` namespace. +* **Search before creating** new keys. +* **Namespace bundle-specific keys** under their bundle. +* **Refactor progressively** when touching old code. diff --git a/docs/source/development/translation_provider.rst b/docs/source/development/translation_provider.rst new file mode 100644 index 000000000..98b117129 --- /dev/null +++ b/docs/source/development/translation_provider.rst @@ -0,0 +1,148 @@ +======================================================================= +Managing translations within CHILL using Loco as a translation provider +======================================================================= + +Within CHILL we make use of Symfony's translation component together with *Loco* as an external +translation provider. Using this setup centralise translations in a single online +location (Loco), while still allowing developers to create and update +translation keys locally in the project (YAML files). + +Workflow +======== + +We use the following workflow: + +* Developers create translation keys in YAML files inside each bundle. +* Keys are written in **English**. +* Application UI defaults to **French**, with **Dutch** as an additional locale (other languages can be added in the future). +* Loco acts as the central translation memory and synchronisation source. +* Loco Symfony package was installed so that built-in translation commands can be used to push/pull content + between Loco and the local project. + + +Translation directory structure +=============================== + +Each bundle contains its own ``translations`` directory, for example:: + + chill-bundles/ + ChillCoreBundle/ + translations/ + messages.fr.yml + messages.nl.yml + ChillPersonBundle/ + translations/ + messages.fr.yml + messages.nl.yml + ... + +Configuration +============= + +The translation configuration is defined in +``config/packages/translation.yaml``:: + + framework: + default_locale: '%env(resolve:LOCALE)%' + translator: + default_path: '%kernel.project_dir%/translations' + fallbacks: + - '%env(resolve:LOCALE)%' + - 'en' + providers: + loco: + dsn: '%env(LOCO_DSN)%' + domains: [ 'messages' ] + locales: [ 'fr', 'nl' ] + +Note: + +* ``en`` is the **source locale** in Loco. +* ``fr`` and ``nl`` are the **application locales**. +* ``domains: [messages]`` means only ``messages.*.yml`` files are pushed. + + +Environment variables +--------------------- + +In ``.env``:: + + LOCALE=fr + +In ``.env.local``:: + + LOCO_DSN="loco://API_KEY@default" + +Replace ``API_KEY`` with the key provided by Loco. + + +Working with Loco +================= + +Loco shows all translation keys under three languages: + +* **English (source)** — keys are listed but remain “untranslated” +* **French** — translated strings for French users +* **Dutch** — translated strings for Dutch users + +Note: Don't add translations directly in the English column. +This column simply represents the *key*. + + +Pushing translations to Loco +============================ + +You can push local translations to Loco using: + +.. code-block:: bash + + symfony console translation:push loco --locales=fr --locales=nl --force + +This will: + +* Upload all French and Dutch translation values from ``*.fr.yml`` and + ``*.nl.yml`` files +* Ensures Loco stays in sync with local YAML files +* Creates any missing keys in Loco + + +Pulling translations from Loco +============================== + +When translators update strings in Loco, developers can fetch updates with: + +.. code-block:: bash + + symfony console translation:pull loco --locales=fr --locales=nl --force + +This will: + +* Download the latest French and Dutch translations +* Overwrite the local YAML files with Loco’s content +* Keep everything consistent across the team + + +Adding new translation keys (Developer workflow) +================================================ + +1. Add a new key directly in the appropriate YAML file, for example:: + + chill-bundles/ChillPersonBundle/translations/messages.fr.yml + + Example key:: + + person.form.submit: "Envoyer" + +2. Add Dutch translation as well if you can (otherwise leave empty to be translated within Loco later):: + + person.form.submit: "Verzenden" + +3. Run a push to send the new key to Loco: + +.. code-block:: bash + + symfony console translation:push loco --locales=fr --locales=nl --force + +4. The key will now appear in Loco for translation management. + +Note: English appears as “untranslated”, because it is merely the source language diff --git a/docs/source/development/useful-snippets.rst b/docs/source/development/useful-snippets.md similarity index 69% rename from docs/source/development/useful-snippets.rst rename to docs/source/development/useful-snippets.md index 98d07a1d1..0fa9edb7d 100644 --- a/docs/source/development/useful-snippets.rst +++ b/docs/source/development/useful-snippets.md @@ -1,26 +1,17 @@ +# Useful snippets +###### Dependency Injection - - -Useful snippets -############### - -Dependency Injection -******************** - -Configure route automatically -============================= +## Configure route automatically Add the route for the current bundle automatically on the main app. -.. code-block:: php - +```php namespace Chill\MyBundle\DependencyInjection; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; - class ChillMyExtension extends Extension implements PrependExtensionInterface { // ... @@ -30,8 +21,8 @@ Add the route for the current bundle automatically on the main app. $this->prependRoutes($container); } - - public function prependRoutes(ContainerBuilder $container) + + public function prependRoutes(ContainerBuilder $container) { //add routes for custom bundle $container->prependExtensionConfig('chill_main', array( @@ -42,32 +33,26 @@ Add the route for the current bundle automatically on the main app. ) )); } +``` +###### Security -Security -******** - -Get the circles a user can reach -================================ - -.. code-block:: php +## Get the circles a user can reach +```php use Symfony\Component\Security\Core\Role\Role; $authorizationHelper = $this->get('chill.main.security.authorization.helper'); $circles = $authorizationHelper ->getReachableCircles( $this->getUser(), # from a controller - new Role('CHILL_ROLE'), - $center + new Role('CHILL_ROLE'), + $center ); +``` +###### Controller -Controller -********** +## Secured controller for person -Secured controller for person -============================= - -.. literalinclude:: useful-snippets/controller-secured-for-person.php - :language: php + [controller](useful-snippets/controller-secured-for-person.php) diff --git a/docs/source/development/user-interface/css-classes.md b/docs/source/development/user-interface/css-classes.md new file mode 100644 index 000000000..9ed5064a0 --- /dev/null +++ b/docs/source/development/user-interface/css-classes.md @@ -0,0 +1,63 @@ +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". + +# CSS classes and mixins + +The stylesheet are based on the framework [ScratchCSS ](https://github.com/Champs-Libres/ScratchCSS). + +We added some useful classes and mixins for the Chill usage. + +###### CSS Classes + +## Statement "empty data" + +CSS Selector + `.chill-no-data-statement` +In which case will you use this selector ? + When a list is empty, and a message fill the list to inform that the data is empty +Example usage + ```jinja + {{ 'No reason associated'|trans }} + ``` + +## Quotation of user text + +CSS Selector + `blockquote.chill-user-quote` +In which case will you use this selector ? + When you quote text that were filled by the user in a form. +Example usage + ```jinja +
    {{ entity.remark|nl2br }}
    + ``` + +## Boxes + +CSS Selector + `chill__box` +In which case will you use this selector ? + When displaying some data in a nice box +Example usage + ```html + A nice box with green background + A nice box with red background + ``` + +###### Mixins + +## Entity decorator + +Mixin + `@mixin entity($background-color, $color: white)` +In which case including this mixin ? + When you create a `sticker`, a sort of label to represent a text in a way that the user can associate immediatly with a certain type of class / entity. +Example usage + ```sass + span.entity.entity-activity.activity-reason { + @include entity($chill-pink, white); + } +``` diff --git a/docs/source/development/user-interface/js-functions.md b/docs/source/development/user-interface/js-functions.md new file mode 100644 index 000000000..88cb52d67 --- /dev/null +++ b/docs/source/development/user-interface/js-functions.md @@ -0,0 +1,234 @@ +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". + +# Javascript functions + +Some function may be useful to manipulate elements on the page. + +###### Show-hide elements according to a form state + +The module ``ShowHide`` will allow you to show/hide part of your page using a specific test. + +This must be use inside a javascript module. + +## Usage + +In this module, the module will listen to all input given in the ``container_from`` div, and will show or hide the content of the ``container_target`` according to the result of the ``test`` function. + +
    + {{ form_row(form.accompagnementRQTHDate) }} +
    + +
    + {{ form_row(form.accompagnementComment) }} +
    + + import { ShowHide } from 'ShowHide/show_hide.js'; + + var + from = document.getElementById("container_from"), + target = document.getElementById("container_target") + ; + + new ShowHide({ + froms: [from], // the value of from should be an iterable + container: [target], // the value of container should be an iterable + test: function(froms, event) { + // iterate over each element of froms + for (let f of froms.values()) { + // get all input inside froms + for (let input of f.querySelectorAll('input').values()) { + if (input.value === 'autre') { + return input.checked; + } + } + } + + return false; + } + }); + +Once instantiated, the class ``ShowHide`` will: + +1. get all input from each element inside the ``froms`` values +2. attach an event listener (by default, ``change``) to each input inside each entry in ``froms`` +3. each time the event is fired, launch the function ``test`` +4. show the element in the container given in ``container``, if the result of ``test`` is true, or hide them otherwise. + +The test is also launched when the page is loaded. + +## Show/hide while the user enter data: using the ``input`` event + +One can force to use another event on the input elements, instead of the default ``'change'`` event. + +For achieving this, use the `event_name` option. + + new ShowHide({ + froms: froms, + test: test_function, + container: containers , + // using this option, we use the event `input` instead of `change` + event_name: 'input' + }); + +### Examples + + :language: javascript + +## Using Show/Hide in collections forms + +Using show / hide in collection forms implies: + +* to launch show/hide manually for each entry when the page is loaded ; +* to catch when an entry is added to the form ; + +As the show/hide is started manually and not on page load, we add the option ``load_event: null`` to the options: + + new ShowHide({ + load_event: null, + froms: [ from ], + container: [ container ], + test: my_test_function + }); + + When using ``load_event: null`` inside the options, the value of event will be ``null`` as second argument for the test function. + + ```javascript + my_test_function(froms, event) { + // event will be null on first launch + } +``` + +Example usage: here, we would like to catch for element inside a CV form, where the user may add multiple formation entries. + + import { ShowHide } from 'ShowHide/show_hide.js'; + + // we factorize the creation of show hide element in this function. + var make_show_hide = function(entry) { + let + obtained = entry.querySelector('[data-diploma-obtained]'), + reconnue = entry.querySelector('[data-diploma-reconnue]') + ; + new ShowHide({ + load_event: null, + froms: [ obtained ], + container: [ reconnue ], + test: my_test_function + }); + }; + + // this code is fired when an entry is added on the page + window.addEventListener('collection-add-entry', function(e) { + // if the form contains multiple collection, we filter them here: + if (e.detail.collection.dataset.collectionName === 'formations') { + make_show_hide(e.detail.entry); + } + }); + + // on page load, we create a show/hide + window.addEventListener('load', function(_e) { + let + formations = document.querySelectorAll('[data-formation-entry]') + ; + + for (let f of formations.values()) { + make_show_hide(f); + } + }); + +## Handling encapsulated show/hide elements + +This module allow to handle encapsulated show/hide elements. For instance : + +* in a first checkbox list, a second checkbox list is shown if some element is checked ; +* in this second checkbox list, a third input is shown if some element is checked inside the second checkbox list. + +As a consequence, if the given element in the first checkbox list is unchecked, the third input must also be hidden. + +Example: when a situation professionnelle is ``en activite``, the second element ``type contrat`` must be shown if ``en_activite`` is checked. Inside ``type_contrat``, ``type_contrat_aide`` should be shown when ``contrat_aide`` is checked. + +
    + + + +
    + + +
    + + + +
    + +
    + +
    + +The JS code will be: + + import { ShowHide } from 'ShowHide/show_hide.js'; + // we search for the element within the DOM + // NOTE: all the elements should be searched before instanciating the showHides. + // if not, the elements **may** have disappeared from the DOM + + var + situation_prof = document.getElementById('situation_prof'), + type_contrat = document.getElementById('type_contrat'), + type_contrat_aide = document.getElementById('type_contrat_aide'), + ; + + // the first show/hide will apply on situation_prof + new ShowHide({ + // the id will help us to keep a track of the element + id: 'situation_prof_type_contrat', + froms: [situation_prof], + container: [type_contrat], + test: function(froms) { + for (let f of froms.values()) { + for (let input of f.querySelectorAll('input').values()) { + if (input.value === 'en_activite') { + return input.checked; + } + } + } + + return false; + } + }); + + // the show/hide will apply on "contrat aide" + var show_hide_contrat_aide = new ShowHide({ + froms: [type_contrat], + container: [type_contrat_aide], + test: function(froms) { + for (let f of froms.values()) { + for (let input of f.querySelectorAll('input').values()) { + if (input.value === 'contrat_aide') { + return input.checked; + } + } + } + + return false; + } + }); + + // we handle here the case when the first show-hide is changed: the third input must also disappears + window.addEventListener('show-hide-hide', function (e) { + if (e.detail.id = 'situation_prof_type_contrat') { + // we force the 3rd element to disappears + show_hide_contrat_aide.forceHide(); + } + }); + + // when the first show-hide is changed, it makes appears the second one. + // we check here that the second show-hide is processed. + window.addEventListener('show-hide-show', function (e) { + if (e.detail.id = 'situation_prof_type_contrat') { + show_hide_contrat_aide.forceCompute(); + } + }); \ No newline at end of file diff --git a/docs/source/development/user-interface/layout-template-usage.md b/docs/source/development/user-interface/layout-template-usage.md new file mode 100644 index 000000000..385833850 --- /dev/null +++ b/docs/source/development/user-interface/layout-template-usage.md @@ -0,0 +1,196 @@ +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". + +# Layout / Template usage + +We recommand the use of the existing layouts to ensure the consistency of the design. This section explains the different templates and how to use it. + +The layouts are twig templates. + +## Twig templating helper + +### `chill_print_or_message` + +Print a value or use a default template if the value is empty. + +The template can be customized. + +Two default templates are registered: + +- `default`, do not decorate the value ; +- `blockquote`: wrap the value into a blockquote if exists + + {{ "This is a message"|chill_print_or_message("No message") }} + + + {{ ""|chill_print_or_message("No message")}} + + + {{ "This is a comment\n with multiples lines"|chill_print_or_message("No comment", 'blockquote') }} + + +When customizing the template, two arguments are passed to the template: + +- `value`: the actual value ; +- `message`: the message, given as argument + +### Routing with return path + +Three twig function are available for creating routes and handling "return path". + +**Rationale**: When building a "CRUD" (CReate, Update, Delete of an entity), you would like to allow people to go back on some custom cancel page when coming for another place of an application. For instance, if you are in the timeline and show an activity, you would like that the user go back to the timeline when pressing the "return" button at the bottom of the page, instead of going back to the "activity list" page. + +Using those function, a `returnPath` parameter will be added in the path generated. It will be used instead of the default one in the subsequente pages. + +- `chill_path_add_return_path(name, parameters = [], relative = false)`: will create a path with current page as return path (users will go back to the current page on the next page) ; +- `chill_return_path_or(name, parameters = [], relative = false)`: will create a path to the return path if present, or build the path according to the given parameters ; +- `chill_path_forward_return_path(name, parameters = [], relative = false)`: will create a path and adding the return path that is present for the current page, *forwarding* the return path to the next page. This is useful if you are on a "show" page with a return path (by instance, the "timeline" page), you place a link to the *edit* page and want users to go back to the "timeline" page on the edit page. + +- `chill_return_path_or`: + +## Organisation of the layouts + +### ChillMainBundle::layout.html.twig + +This is the base layout. It includes the most import css / js files. It display a page with + +* a horizontal navigation menu +* a place for content +* a footer + +The layout containts blocks, that are : + +* title + + * to display title + +* css + + * where to add some custom css + +* navigation_section_menu + + * place where to insert the section menu in the navigation menu (by default the navigation menu is inserted) + +* navigation_search_bar + + * place where to insert a search bar in the navigation menu (by default the search bar is inserted) + +* top_banner + + * place where to display a banner below the navigation menu (this place is use to display the details of the person) + +* sublayout_containter + + * place between the header and the footer that can be used to create a new layout (with vertical menu for example) + +* content + + * place where to display the content (flash message are included outside of this block) + +* js + + * where to add some custom javascript + +### ChillMainBundle::layoutWithVerticalMenu.html.twig + +This layout extends `ChillMainBundle::layout.html.twig`. It replaces the block `layout_content` and divides this block for displaying a vertical menu and some content. + +It proposes 2 new blocks : + +* layout_wvm_content + + * where to display the page content + +* vertical_menu_content + + * where to place the vertical menu + +### ChillMainBundle::Admin/layout.html.twig + +This layout extends `ChillMainBundle::layout.html.twig`. It hides the search bar, remplaces the `section menu` with the `admin section menu`. + +It proposes a new block : + +* admin_content + + * where to display the admin content + +### ChillMainBundle::Admin/layoutWithVerticalMenu.html.twig + +This layout extends `ChillMainBundle::layoutWithVerticalMenu.html.twig`. It do the same changes than `ChillMainBundle::Admin/layout.html.twig` : hiding the search bar, remplacing the `section menu` with the `admin section menu`. + +It proposes a new block : + +* admin_content + + * where to display the admin content + +@ChillPersonBundle/Person/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 + + * where to display the information of the person + +### ChillMainBundle::Export/layout.html.twig + +This layout extends `ChillMainBundle::layoutWithVerticalMenu.html.twig` and set the menu `export` as the vertical menu. + +It proposes 1 new block : + +* export_content + + * where to display the content of the export + +## Useful template and helpers + +### Macros + +Every bundle may bring their own macro to print resources with uniformized styles. + +See : + +- [Macros in person bundle ](person-bundle-macros.md) ; +- [Macros in activity bundle ](activity-bundle-macros.md) ; +- [Macros in group bundle ](group-bundle-macros.md) ; +- [Macros in main bundle ](main-bundle-macros.md) ; + +### Templates + +##### ChillMainBundle::Util:confirmation_template.html.twig + +This template show a confirmation template before making dangerous things. You can add your own message and title, or define those message by yourself in another template. + +The accepted parameters are : + +- `title` (string) a title for the page. Not mandatory (it won't be rendered if not defined) +- `confirm_question` (string) a confirmation question. This question will not be translated into the template, and may be printed as raw. Not mandatory (it won't be rendered if not defined) +- `form` : (:class:`Symfony\Component\Form\FormView`) a form wich **must** contains an input named `submit`, which must be a :class:`Symfony\Component\Form\Extension\Core\Type\SubmitType`. Mandatory +- `cancel_route` : (string) the name of a route if the user want to cancel the action +- `cancel_parameters` (array) the parameters for the route defined in `cancel_route` + +Usage : + + {{ include('ChillMainBundle:Util:confirmation_template.html.twig', + { + # a title, not mandatory + 'title' : 'Remove membership'|trans, + # a confirmation question, not mandatory + 'confirm_question' : 'Are you sure you want to remove membership ?'|trans + # a route for "cancel" button (mandatory) + 'cancel_route' : 'chill_group_membership_by_person', + # the parameters for 'cancel' route (default to {} ) + 'cancel_parameters' : { 'person_id' : membership.person.id }, + # the form which will send the deletion. This form + # **must** contains a SubmitType + 'form' : form + } ) }} diff --git a/docs/source/development/user-interface/css-classes.rst b/docs/source/development/user-interface/rst/css-classes.rst similarity index 90% rename from docs/source/development/user-interface/css-classes.rst rename to docs/source/development/user-interface/rst/css-classes.rst index 98252cca4..3a13fb186 100644 --- a/docs/source/development/user-interface/css-classes.rst +++ b/docs/source/development/user-interface/rst/css-classes.rst @@ -10,7 +10,7 @@ CSS classes and mixins ###################### -The stylesheet are based on the framework `ScratchCSS `_. +The stylesheet are based on the framework `ScratchCSS `_. We added some useful classes and mixins for the Chill usage. @@ -22,12 +22,12 @@ Statement "empty data" ====================== CSS Selector - :code:`.chill-no-data-statement` + `.chill-no-data-statement` In which case will you use this selector ? When a list is empty, and a message fill the list to inform that the data is empty Example usage .. code-block:: html+jinja - + {{ 'No reason associated'|trans }} @@ -35,7 +35,7 @@ Quotation of user text ======================= CSS Selector - :code:`blockquote.chill-user-quote` + `blockquote.chill-user-quote` In which case will you use this selector ? When you quote text that were filled by the user in a form. Example usage @@ -47,7 +47,7 @@ Boxes ===== CSS Selector - :code:`chill__box` + `chill__box` In which case will you use this selector ? When displaying some data in a nice box Example usage @@ -66,7 +66,7 @@ Entity decorator ================= Mixin - :code:`@mixin entity($background-color, $color: white)` + `@mixin entity($background-color, $color: white)` In which case including this mixin ? When you create a `sticker`, a sort of label to represent a text in a way that the user can associate immediatly with a certain type of class / entity. Example usage diff --git a/docs/source/development/user-interface/js-functions.rst b/docs/source/development/user-interface/rst/js-functions.rst similarity index 100% rename from docs/source/development/user-interface/js-functions.rst rename to docs/source/development/user-interface/rst/js-functions.rst diff --git a/docs/source/development/user-interface/layout-template-usage.rst b/docs/source/development/user-interface/rst/layout-template-usage.rst similarity index 82% rename from docs/source/development/user-interface/layout-template-usage.rst rename to docs/source/development/user-interface/rst/layout-template-usage.rst index 1ddbacafd..2d85253be 100644 --- a/docs/source/development/user-interface/layout-template-usage.rst +++ b/docs/source/development/user-interface/rst/layout-template-usage.rst @@ -22,28 +22,28 @@ Twig templating helper Print a value or use a default template if the value is empty. -The template can be customized. +The template can be customized. -Two default templates are registered: +Two default templates are registered: -- :code:`default`, do not decorate the value ; -- :code:`blockquote`: wrap the value into a blockquote if exists +- `default`, do not decorate the value ; +- `blockquote`: wrap the value into a blockquote if exists .. code-block:: html+twig - {{ "This is a message"|chill_print_or_message("No message") }} + {{ "This is a message"|chill_print_or_message("No message") }} - {{ ""|chill_print_or_message("No message")}} + {{ ""|chill_print_or_message("No message")}} - {{ "This is a comment\n with multiples lines"|chill_print_or_message("No comment", 'blockquote') }} + {{ "This is a comment\n with multiples lines"|chill_print_or_message("No comment", 'blockquote') }} -When customizing the template, two arguments are passed to the template: +When customizing the template, two arguments are passed to the template: -- :code:`value`: the actual value ; -- :code:`message`: the message, given as argument +- `value`: the actual value ; +- `message`: the message, given as argument Routing with return path ------------------------ @@ -52,14 +52,14 @@ Three twig function are available for creating routes and handling "return path" **Rationale**: When building a "CRUD" (CReate, Update, Delete of an entity), you would like to allow people to go back on some custom cancel page when coming for another place of an application. For instance, if you are in the timeline and show an activity, you would like that the user go back to the timeline when pressing the "return" button at the bottom of the page, instead of going back to the "activity list" page. -Using those function, a :code:`returnPath` parameter will be added in the path generated. It will be used instead of the default one in the subsequente pages. +Using those function, a `returnPath` parameter will be added in the path generated. It will be used instead of the default one in the subsequente pages. -- :code:`chill_path_add_return_path(name, parameters = [], relative = false)`: will create a path with current page as return path (users will go back to the current page on the next page) ; -- :code:`chill_return_path_or(name, parameters = [], relative = false)`: will create a path to the return path if present, or build the path according to the given parameters ; -- :code:`chill_path_forward_return_path(name, parameters = [], relative = false)`: will create a path and adding the return path that is present for the current page, *forwarding* the return path to the next page. This is useful if you are on a "show" page with a return path (by instance, the "timeline" page), you place a link to the *edit* page and want users to go back to the "timeline" page on the edit page. +- `chill_path_add_return_path(name, parameters = [], relative = false)`: will create a path with current page as return path (users will go back to the current page on the next page) ; +- `chill_return_path_or(name, parameters = [], relative = false)`: will create a path to the return path if present, or build the path according to the given parameters ; +- `chill_path_forward_return_path(name, parameters = [], relative = false)`: will create a path and adding the return path that is present for the current page, *forwarding* the return path to the next page. This is useful if you are on a "show" page with a return path (by instance, the "timeline" page), you place a link to the *edit* page and want users to go back to the "timeline" page on the edit page. -- :code:`chill_return_path_or`: +- `chill_return_path_or`: Organisation of the layouts @@ -178,9 +178,9 @@ Useful template and helpers Macros ------ -Every bundle may bring their own macro to print resources with uniformized styles. +Every bundle may bring their own macro to print resources with uniformized styles. -See : +See : - :ref:`Macros in person bundle ` ; - :ref:`Macros in activity bundle ` ; @@ -195,7 +195,7 @@ ChillMainBundle::Util:confirmation_template.html.twig This template show a confirmation template before making dangerous things. You can add your own message and title, or define those message by yourself in another template. -The accepted parameters are : +The accepted parameters are : - `title` (string) a title for the page. Not mandatory (it won't be rendered if not defined) - `confirm_question` (string) a confirmation question. This question will not be translated into the template, and may be printed as raw. Not mandatory (it won't be rendered if not defined) @@ -204,7 +204,7 @@ The accepted parameters are : - `cancel_parameters` (array) the parameters for the route defined in `cancel_route` -Usage : +Usage : .. code-block:: html+twig diff --git a/docs/source/development/user-interface/widgets.rst b/docs/source/development/user-interface/rst/widgets.rst similarity index 81% rename from docs/source/development/user-interface/widgets.rst rename to docs/source/development/user-interface/rst/widgets.rst index 1ce4bc591..e635e20e2 100644 --- a/docs/source/development/user-interface/widgets.rst +++ b/docs/source/development/user-interface/rst/widgets.rst @@ -15,12 +15,12 @@ Rationale Widgets are useful if you want to publish content on a page provided by another bundle. -Examples : +Examples : - you want to publish a list of people on the homepage ; - you may want to show the group belonging (see :ref:`group-bundle`) below of the vertical menu, only if the bundle is installed. -The administrator of the chill instance may configure the presence of widget. Although, some widget are defined by default (see :ref:`declaring-widget-by-default`). +The administrator of the chill instance may configure the presence of widget. Although, some widget are defined by default (see :ref:`declaring-widget-by-default`). Concepts ======== @@ -71,32 +71,32 @@ Example : class AddAPersonWidget implements WidgetInterface { public function render( - \Twig_Environment $env, - $place, - array $context, + \Twig_Environment $env, + $place, + array $context, array $config ) { // this will render a link to the page "add a person" return $env->render("ChillPersonBundle:Widget:homepage_add_a_person.html.twig"); } - } + } -Arguments are : +Arguments are : -- :code:`$env` the :class:`\Twig_Environment`, which you can use to render your widget ; -- :code:`$place` a string representing the place where the widget is rendered ; -- :code:`$context` the context given by the template ; -- :code:`$config` the configuration which is, in this case, always an empty array (see :ref:`creating-a-widget-with-config`). +- `$env` the :class:`\Twig_Environment`, which you can use to render your widget ; +- `$place` a string representing the place where the widget is rendered ; +- `$context` the context given by the template ; +- `$config` the configuration which is, in this case, always an empty array (see :ref:`creating-a-widget-with-config`). .. note:: - The html returned by the :code:`render` function will be considered as html safe. You should strip html before returning it. See also `How to escape output in template `_. + The html returned by the `render` function will be considered as html safe. You should strip html before returning it. See also `How to escape output in template `_. Declare your widget ------------------- -Declare your widget as a service and add it the tag :code:`chill_widget`: +Declare your widget as a service and add it the tag `chill_widget`: .. code-block:: yaml @@ -107,17 +107,17 @@ Declare your widget as a service and add it the tag :code:`chill_widget`: - { name: chill_widget, alias: add_person, place: homepage } -The tag must contains those arguments : +The tag must contains those arguments : -- :code:`alias`: an alias, which will be used to reference the widget into the config -- :code:`place`: a place where this widget is authorized +- `alias`: an alias, which will be used to reference the widget into the config +- `place`: a place where this widget is authorized If you want your widget to be available on multiple places, you should add one tag with each place. Conclusion ---------- -Once your widget is correctly declared, your widget should be available in configuration. +Once your widget is correctly declared, your widget should be available in configuration. .. code-block:: bash @@ -134,14 +134,14 @@ Once your widget is correctly declared, your widget should be available in confi # the widget alias (see your installed bundles config). Possible values are (maybe incomplete) : person_list, add_person widget_alias: ~ # Required -If you want to add your widget by default, see :ref:`declaring-widget-by-default`. +If you want to add your widget by default, see :ref:`declaring-widget-by-default`. .. _creating-a-widget-with-config: Creating a widget **with** configuration ======================================== -You can declare some configuration with your widget, which allow administrators to add their own configuration. +You can declare some configuration with your widget, which allow administrators to add their own configuration. To add some configuration, you will : @@ -153,7 +153,7 @@ To add some configuration, you will : Declare your widget class ------------------------- -Declare your widget. You can use some configuration elements in your process, as used here : +Declare your widget. You can use some configuration elements in your process, as used here : .. literalinclude:: ./widgets/ChillPersonAddAPersonWidget.php :language: php @@ -161,7 +161,7 @@ Declare your widget. You can use some configuration elements in your process, as Declare your widget as a service -------------------------------- -You can declare your widget as a service. Not tag is required, as the service will be defined by the :code:`Factory` during next step. +You can declare your widget as a service. Not tag is required, as the service will be defined by the `Factory` during next step. .. code-block:: yaml @@ -187,7 +187,7 @@ The widget factory must implements `Chill\MainBundle\DependencyInjection\Widget\ :language: php .. note:: - You can declare your widget into the container by overriding the `createDefinition` method. By default, this method will return the already existing service definition with the id given by :code:`getServiceId`. But you can create or adapt programmatically the definition. `See the symfony doc on how to do it `_. + You can declare your widget into the container by overriding the `createDefinition` method. By default, this method will return the already existing service definition with the id given by `getServiceId`. But you can create or adapt programmatically the definition. `See the symfony doc on how to do it `_. .. code-block:: php @@ -199,22 +199,22 @@ The widget factory must implements `Chill\MainBundle\DependencyInjection\Widget\ return $definition; } -You must then register your factory into the :code:`Extension` class which provide the place. This is done in the :code: `Bundle` class. +You must then register your factory into the `Extension` class which provide the place. This is done in the `Bundle` class. .. code-block:: php - # Chill/PersonBundle/ChillPersonBundle.php - + # Chill/PersonBundle/ChillPersonBundle.php + use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\DependencyInjection\ContainerBuilder; use Chill\PersonBundle\Widget\PersonListWidgetFactory; class ChillPersonBundle extends Bundle { - public function build(ContainerBuilder $container) + public function build(ContainerBuilder $container) { parent::build($container); - + $container->getExtension('chill_main') ->addWidgetFactory(new PersonListWidgetFactory()); } @@ -225,7 +225,7 @@ You must then register your factory into the :code:`Extension` class which provi Declaring a widget by default ============================= -Use the ability `to prepend configuration of other bundle `_. A living example here : +Use the ability `to prepend configuration of other bundle `_. A living example here : .. literalinclude:: ./widgets/ChillPersonExtension.php :language: php @@ -237,10 +237,10 @@ Defining a place Add your place in template -------------------------- -A place should be defined by using the :code:`chill_widget` function, which take as argument : +A place should be defined by using the `chill_widget` function, which take as argument : -- :code:`place` (string) a string defining the place ; -- :code:`context` (array) an array defining the context. +- `place` (string) a string defining the place ; +- `context` (array) an array defining the context. The context should be documented by the bundle. It will give some information about the context of the page. Example: if the page concerns a people, the :class:`Chill\PersonBundle\Entity\Person` class will be in the context. @@ -262,7 +262,7 @@ Declare configuration for you place In order to let other bundle, or user, to define the widgets inside the given place, you should open a configuration. You can use the Trait :class:`Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait`, which provide the method `addWidgetConfiguration($place, ContainerBuilder $container)`. -Example : +Example : .. literalinclude:: ./widgets/ChillMainConfiguration.php :language: php @@ -285,11 +285,11 @@ You should also adapt the :class:`DependencyInjection\*Extension` class to add C Compile the possible widget using Compiler pass ----------------------------------------------- -For your convenience, simply extends :class:`Chill\MainBundle\DependencyInjection\Widget\AbstractWidgetsCompilerPass`. This class provides a `doProcess(ContainerBuildere $container, $extension, $parameterName)` method which will do the job for you: +For your convenience, simply extends :class:`Chill\MainBundle\DependencyInjection\Widget\AbstractWidgetsCompilerPass`. This class provides a `doProcess(ContainerBuildere $container, $extension, $parameterName)` method which will do the job for you: -- :code:`$container` is the container builder -- :code:`$extension` is the extension name -- :code:`$parameterName` is the name of the parameter which contains the configuration for widgets (see :ref:`the example with ChillMain above `. +- `$container` is the container builder +- `$extension` is the extension name +- `$parameterName` is the name of the parameter which contains the configuration for widgets (see :ref:`the example with ChillMain above `. .. code-block:: php @@ -300,10 +300,10 @@ For your convenience, simply extends :class:`Chill\MainBundle\DependencyInjectio /** * Compile the service definition to register widgets. - * + * */ class WidgetsCompilerPass extends AbstractWidgetsCompilerPass { - + public function process(ContainerBuilder $container) { $this->doProcess($container, 'chill_main', 'chill_main.widgets'); diff --git a/docs/source/development/user-interface/widgets.md b/docs/source/development/user-interface/widgets.md new file mode 100644 index 000000000..90be70ae8 --- /dev/null +++ b/docs/source/development/user-interface/widgets.md @@ -0,0 +1,270 @@ +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". + +# Widgets + +## Rationale + +Widgets are useful if you want to publish content on a page provided by another bundle. + +Examples : + +- you want to publish a list of people on the homepage ; +- you may want to show the group belonging (see [group-bundle[) below of the vertical menu, only if the bundle is installed. + +The administrator of the chill instance may configure the presence of widget. Although, some widget are defined by default (see [declaring-widget-by-default](declaring-widget-by-default.md)). + +## Concepts + +A bundle may define *place(s)* where a widget may be rendered. + +In a single *place*, zero, one or more *widget* may be displayed. + +Some *widget* may require some *configuration*, and some does not require any configuration. + +Example: + +=========================================== ======== ============================= ======================================= +Use case place place defined by... widget provided by... +=========================================== ======== ============================= ======================================= +Publishing a list of people on the homepage homepage defined by [main-bundle](main-bundle.md) widget provided by [person-bundle](person-bundle.md) +=========================================== ======== ============================= ======================================= + +## Creating a widget without configuration + +To add a widget, you should : + +- define your widget, implementing :class:`Chill\MainBundle\Templating\Widget\WidgetInterface` ; +- declare your widget with tag `chill_widget`. + +### Define the widget class + +Define your widget class by implemeting :class:`Chill\MainBundle\Templating\Widget\WidgetInterface`. + +Example : + + namespace Chill\PersonBundle\Widget; + + use Chill\MainBundle\Templating\Widget\WidgetInterface; + + /** + * Add a button "add a person" + * + */ + class AddAPersonWidget implements WidgetInterface + { + public function render( + \Twig_Environment $env, + $place, + array $context, + array $config + ) { + // this will render a link to the page "add a person" + return $env->render("ChillPersonBundle:Widget:homepage_add_a_person.html.twig"); + } + } + +Arguments are : + +- `$env` the :class:`\Twig_Environment`, which you can use to render your widget ; +- `$place` a string representing the place where the widget is rendered ; +- `$context` the context given by the template ; +- `$config` the configuration which is, in this case, always an empty array (see [creating-a-widget-with-config](creating-a-widget-with-config.md)). + + The html returned by the `render` function will be considered as html safe. You should strip html before returning it. See also `How to escape output in template ](http://symfony.com/doc/current/templating/escaping.html.md)_. + +### Declare your widget + +Declare your widget as a service and add it the tag `chill_widget`: + + service: + chill_person.widget.add_person: + class: Chill\PersonBundle\Widget\AddAPersonWidget + tags: + - { name: chill_widget, alias: add_person, place: homepage } + +The tag must contains those arguments : + +- `alias`: an alias, which will be used to reference the widget into the config +- `place`: a place where this widget is authorized + +If you want your widget to be available on multiple places, you should add one tag with each place. + +### Conclusion + +Once your widget is correctly declared, your widget should be available in configuration. + + $ php app/console config:dump-reference chill_main + # Default configuration for extension with alias: "chill_main" + chill_main: + [...] + # register widgets on place "homepage" + homepage: + + # the ordering of the widget. May be a number with decimal + order: ~ # Required, Example: 10.58 + + # the widget alias (see your installed bundles config). Possible values are (maybe incomplete) : person_list, add_person + widget_alias: ~ # Required + +If you want to add your widget by default, see [declaring-widget-by-default`. + +## Creating a widget **with** configuration + +You can declare some configuration with your widget, which allow administrators to add their own configuration. + +To add some configuration, you will : + +- declare a widget as defined above ; +- optionnaly declare it as a service ; +- add a widget factory, which will add configuration to the bundle which provide the place. + +### Declare your widget class + +Declare your widget. You can use some configuration elements in your process, as used here : + + :language: php + +### Declare your widget as a service + +You can declare your widget as a service. Not tag is required, as the service will be defined by the `Factory` during next step. + + services: + chill_person.widget.person_list: + class: Chill\PersonBundle\Widget\PersonListWidget + arguments: + - "@chill.person.repository.person" + - "@doctrine.orm.entity_manager" + - "@chill.main.security.authorization.helper" + - "@security.token_storage" + # this widget is defined by the PersonListWidgetFactory + +You can eventually skip this step and declare your service into the container through the factory (see above). + +### Declare your widget factory + +The widget factory must implements `Chill\MainBundle\DependencyInjection\Widget\Factory\WidgetFactoryInterface`. For your convenience, an :class:`Chill\MainBundle\DependencyInjection\Widget\Factory\AbstractWidgetFactory` will already implements some easy method. + + :language: php + + You can declare your widget into the container by overriding the `createDefinition` method. By default, this method will return the already existing service definition with the id given by `getServiceId`. But you can create or adapt programmatically the definition. `See the symfony doc on how to do it ](http://symfony.com/doc/current/service_container/definitions.html#working-with-a-definition.md)_. + + ```php + public function createDefinition(ContainerBuilder $containerBuilder, $place, $order, array $config) + { + $definition = new \Symfony\Component\DependencyInjection\Definition('my\Class'); + // create or adapt your definition here +``` + + return $definition; + } + +You must then register your factory into the `Extension` class which provide the place. This is done in the `Bundle` class. + + # Chill/PersonBundle/ChillPersonBundle.php + + use Symfony\Component\HttpKernel\Bundle\Bundle; + use Symfony\Component\DependencyInjection\ContainerBuilder; + use Chill\PersonBundle\Widget\PersonListWidgetFactory; + + class ChillPersonBundle extends Bundle + { + public function build(ContainerBuilder $container) + { + parent::build($container); + + $container->getExtension('chill_main') + ->addWidgetFactory(new PersonListWidgetFactory()); + } + } + +## Declaring a widget by default + +Use the ability `to prepend configuration of other bundle ](http://symfony.com/doc/current/bundles/prepend_extension.html). A living example here : + + :language: php + +## Defining a place + +### Add your place in template + +A place should be defined by using the [chill_widget` function, which take as argument : + +- `place` (string) a string defining the place ; +- `context` (array) an array defining the context. + +The context should be documented by the bundle. It will give some information about the context of the page. Example: if the page concerns a people, the :class:`Chill\PersonBundle\Entity\Person` class will be in the context. + +Example : + + {# an empty context on homepage #} + {{ chill_widget('homepage', {} }} + + {# defining a place 'right column' with the person currently viewed + {{ chill_widget('right_column', { 'person' : person } }} + +### Declare configuration for you place + +In order to let other bundle, or user, to define the widgets inside the given place, you should open a configuration. You can use the Trait :class:`Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait`, which provide the method `addWidgetConfiguration($place, ContainerBuilder $container)`. + +Example : + + :language: php + :emphasize-lines: 17, 30, 32, 52 + :linenos: + +You should also adapt the :class:`DependencyInjection\*Extension` class to add ContainerBuilder and WidgetFactories : + + :language: php + :emphasize-lines: 25-39, 48-49, 56 + :linenos: + +- line 25-39: we implements the method required by :class:`Chill\MainBundle\DependencyInjection\Widget\HasWidgetExtensionInterface` ; +- line 48-49: we record the configuration of widget into container's parameter ; +- line 56 : we create an instance of :class:`Configuration` (declared above) + +### Compile the possible widget using Compiler pass + +For your convenience, simply extends :class:`Chill\MainBundle\DependencyInjection\Widget\AbstractWidgetsCompilerPass`. This class provides a `doProcess(ContainerBuildere $container, $extension, $parameterName)` method which will do the job for you: + +- `$container` is the container builder +- `$extension` is the extension name +- `$parameterName` is the name of the parameter which contains the configuration for widgets (see [the example with ChillMain above ](example-chill-main-extension.md). + + namespace Chill\MainBundle\DependencyInjection\CompilerPass; + + use Symfony\Component\DependencyInjection\ContainerBuilder; + use Chill\MainBundle\DependencyInjection\Widget\AbstractWidgetsCompilerPass; + + /** + * Compile the service definition to register widgets. + * + */ + class WidgetsCompilerPass extends AbstractWidgetsCompilerPass { + + public function process(ContainerBuilder $container) + { + $this->doProcess($container, 'chill_main', 'chill_main.widgets'); + } + } + +As explained `in the symfony docs ](http://symfony.com/doc/current/service_container/compiler_passes.html), you should register your Compiler Pass into your bundle : + + namespace Chill\MainBundle; + + use Symfony\Component\HttpKernel\Bundle\Bundle; + use Symfony\Component\DependencyInjection\ContainerBuilder; + use Chill\MainBundle\DependencyInjection\CompilerPass\WidgetsCompilerPass; + + class ChillMainBundle extends Bundle + { + public function build(ContainerBuilder $container) + { + parent::build($container); + $container->addCompilerPass(new WidgetsCompilerPass()); + } + } diff --git a/docs/source/index.md b/docs/source/index.md new file mode 100644 index 000000000..59aaa87fc --- /dev/null +++ b/docs/source/index.md @@ -0,0 +1,54 @@ +# Welcome to Chill documentation! + +Chill is a free software for social workers. + +Chill relies on the php framework [Symfony](http://symfony.com). + +## Let's talk together! + +You can talk to developers using the matrix room: [https://app.element.io/#/room/#chill-social-admin:matrix.org](https://app.element.io/#/room/#chill-social-admin:matrix.org) + +## Contribute + +* [Issue tracker](https://gitlab.com/groups/Chill-project/issues) You may want to dispatch an issue to multiple projects. If you do not know in which project your bug / feature request should be located, use the project Chill-Main. + +## User manual + +A user manual exists in French and currently focuses on describing the main concept of the software. + +[Read (and contribute) to the manual](https://fr.wikibooks.org/wiki/Chill) + +## Available bundles + +* Chill-app | https://gitlab.com/Chill-project/Chill-app This is the skeleton of the project. It contains only a bit of code but provides plenty of information on the configuration of your instance; +* Chill-bundles: this repository contains all the main bundles. This means: + * MainBundle: the main framework, + * PersonBundle: to deal with persons, + * CustomFieldsBundle: to add custom fields to some entities, + * ActivityBundle: to add activities to people, + * AsideActivityBundle: to add annex activities such as meetings/trainings not related to a person, + * BudgetBundle: to add budget elements to a person's file, + * DocGeneratorBundle: to generate documents from templates, + * JobBundle: to add information related to employment/ professional training to a person's file, + * ReportBundle: to add a report to a person's file, + * EventBundle: to create events and add persons that will be participating, + * DocStoreBundle: to store documents to people, but also to other entities, + * TaskBundle: to register tasks within a person's file or accompanying course, + * ThirdPartyBundle: to register third parties, + +You will also found the following projects : + +* The website https://chill.social : https://gitlab.com/Chill-project/chill.social + +And various projects to build docker containers with Chill. + +## Licence + +The project is available under the [GNU AFFERO GENERAL PUBLIC LICENSE v3](http://www.gnu.org/licenses/agpl-3.0.html). + +This documentation is published under the [GNU Free Documentation License (FDL) v1.3](http://www.gnu.org/licenses/fdl-1.3.html) + +--- + +*Copyright (C) 2014 Champs Libres Cooperative SC +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".* diff --git a/docs/source/index.rst b/docs/source/index.rst deleted file mode 100644 index ddfa23e3b..000000000 --- a/docs/source/index.rst +++ /dev/null @@ -1,85 +0,0 @@ -.. chill-doc documentation master file, created by - sphinx-quickstart on Sun Sep 28 22:04:08 2014. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -.. 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". - -Welcome to Chill documentation! -===================================== - -Chill is a free software for social workers. - -Chill rely on the php framework `Symfony `_. - -Contents of this documentation: - -.. toctree:: - :maxdepth: 2 - - installation/index.rst - development/index.rst - Bundles - -Let's talk together ! -====================== - -You may talk to developers using the matrix room: `https://app.element.io/#/room/#chill-social-admin:matrix.org`_ - -Contribute -========== - - -* `Issue tracker `_ You may want to dispatch the issue in the multiple projects. If you do not know in which project is located your bug / feature request, use the project Chill-Main. - - -User manual -=========== - -An user manual exists in French and currently focuses on describing the main concept of the software. - -`Read (and contribute) to the manual `_ - -Available bundles -================= - -* Chill-app | https://gitlab.com/Chill-project/Chill-app This is the skeleton of the project. It does contains only few code, but information about configuration of your instance ; -* Chill-bundle: contains the main bundles, the most used in an instance. This means: - * chill-main, the main framework, - * Chill Person, to deal with persons, - * chill custom fields, to add custom fields to some entities, - * chill activity: to add activities to people, - * chill report: to add report to people, - * chill event: to gather people into events, - * chill docs store: to store documents to people, but also entities, - * chill task: to register task with people, - * chill third party: to register third parties, - -You will also found the following projects : - -* The website https://chill.social : https://gitlab.com/Chill-project/chill.social - -And various project to build docker containers with Chill. - -TODO in documentation -===================== - -.. todolist:: - -Licence -======== - -The project is available under the `GNU AFFERO GENERAL PUBLIC LICENSE v3`_. - -This documentation is published under the `GNU Free Documentation License (FDL) v1.3`_ - - -.. _GNU AFFERO GENERAL PUBLIC LICENSE v3: http://www.gnu.org/licenses/agpl-3.0.html -.. _GNU Free Documentation License (FDL) v1.3: http://www.gnu.org/licenses/fdl-1.3.html - diff --git a/docs/source/installation/document-storage.md b/docs/source/installation/document-storage.md new file mode 100644 index 000000000..7849f7662 --- /dev/null +++ b/docs/source/installation/document-storage.md @@ -0,0 +1,74 @@ +# Document storage + +You can store a document in two different ways: + +- on disk +- in the cloud, using object storage: currently only [openstack swift ](https://docs.openstack.org/api-ref/object-store/index.html) is supported. + +## Comparison + +Storing documents within the cloud is particularly suitable for "portable" deployments, like in kubernetes, or within a container +without having to manage volumes to store documents. But you'll have to subscribe to a commercial offer. + +Storing documents on disk is easier to configure but more challenging to manage: if you use container, you will have to +manager volumes to attach documents on disk. You'll have to do some backup of the directory. If chill is load-balanced (and +multiple instances of chill are run), you will have to find a way to share the directories in read-write mode for every instance. + +## On Disk + +Configure Chill like this: + +```yaml + # file config/packages/chill_doc_store.yaml + chill_doc_store: + use_driver: local_storage + local_storage: + storage_path: '%kernel.project_dir%/var/storage' +``` + +In this configuration, documents will be stored in [var/storage` within your app directory. But this path can be +elsewhere on the disk. Be aware that the directory must be writable by the user executing the chill app (php-fpm or www-data). + +Documents will be stored in subpathes within that directory. The files will be encrypted, the key is stored in the database. + +# In the cloud, using openstack object store + +You must subscribe to a commercial offer for an object store. + +Chill uses some features to allow documents to be stored in the cloud without being uploaded first to the chill server: + +- `Form POST Middelware ](https://docs.openstack.org/swift/latest/api/form_post_middleware.html); +- [Temporary URL Middelware ](https://docs.openstack.org/swift/latest/api/temporary_url_middleware.html). + +A secret key must be generated and configured, and CORS must be configured depending on the domain you will use to serve Chill. + +At first, create a container and get the base path to the container. For instance, on OVH, if you create a container named "mychill", +you will be able to retrieve the base path of the container within the OVH interface, like this: + +- base_path: [https://storage.gra.cloud.ovh.net/v1/AUTH_123456789/mychill/` => will be variable `ASYNC_UPLOAD_TEMP_URL_BASE_PATH` +- container: `mychill` => will be variable `ASYNC_UPLOAD_TEMP_URL_CONTAINER` + +You can also generate a key, which should have at least 20 characters. This key will go in the variable `ASYNC_UPLOAD_TEMP_URL_KEY`. + + See the `documentation of symfony ](https://symfony.com/doc/current/configuration.html#config-env-vars) on how to store variables, and how to encrypt them if needed. + +Configure the storage like this: + +```yaml + # file config/packages/chill_doc_store.yaml + chill_doc_store: + use_driver: openstack + openstack: + temp_url: + temp_url_key: '%env(resolve:ASYNC_UPLOAD_TEMP_URL_KEY)%' # Required + container: '%env(resolve:ASYNC_UPLOAD_TEMP_URL_CONTAINER)%' # Required + temp_url_base_path: '%env(resolve:ASYNC_UPLOAD_TEMP_URL_BASE_PATH)%' # Required +``` + +Chill is able to configure the container to store a document. Grab an Openstack Token (for instance, using `openstack token issue` or +the web interface of your openstack provider), and run this command: + + `symfony console async-upload:configure --os_token=OPENSTACK_TOKEN -d https://mychill.mydomain.example` + + # or, without symfony-cli + `bin/console async-upload:configure --os_token=OPENSTACK_TOKEN -d https://mychill.mydomain.example` diff --git a/docs/source/installation/document-storage.rst b/docs/source/installation/document-storage.rst deleted file mode 100644 index 0b87d9eb2..000000000 --- a/docs/source/installation/document-storage.rst +++ /dev/null @@ -1,84 +0,0 @@ -Document storage -################ - -You can store document on two different ways: - -- on disk -- in the cloud, using object storage: currently only `openstack swift `_ is supported. - -Comparison -========== - -Storing documents within the cloud is particularily suitable for "portable" deployments, like in kubernetes, or within container -without having to manage volumes to store documents. But you'll have to subscribe on a commercial offer. - -Storing documents on disk is more easy to configure, but more difficult to manage: if you use container, you will have to -manager volumes to attach documents on disk. You'll have to do some backup of the directory. If chill is load-balanced (and -multiple instances of chill are run), you will have to find a way to share the directories in read-write mode for every instance. - -On Disk -======= - -Configure Chill like this: - -.. code-block:: yaml - - # file config/packages/chill_doc_store.yaml - chill_doc_store: - use_driver: local_storage - local_storage: - storage_path: '%kernel.project_dir%/var/storage' - -In this configuration, documents will be stored in :code:`var/storage` within your app directory. But this path can be -elsewhere on the disk. Be aware that the directory must be writable by the user executing the chill app (php-fpm or www-data). - -Documents will be stored in subpathes within that directory. The files will be encrypted, the key is stored in the database. - -In the cloud, using openstack object store -########################################## - -You must subscribe to a commercial offer for object store. - -Chill use some features to allow documents to be stored in the cloud without being uploaded first to the chill server: - -- `Form POST Middelware `_; -- `Temporary URL Middelware `_. - -A secret key must be generated and configured, and CORS must be configured depending on the domain you will use to serve Chill. - -At first, create a container and get the base path to the container. For instance, on OVH, if you create a container named "mychill", -you will be able to retrieve the base path of the container within the OVH interface, like this: - -- base_path: :code:`https://storage.gra.cloud.ovh.net/v1/AUTH_123456789/mychill/` => will be variable :code:`ASYNC_UPLOAD_TEMP_URL_BASE_PATH` -- container: :code:`mychill` => will be variable :code:`ASYNC_UPLOAD_TEMP_URL_CONTAINER` - -You can also generate a key, which should have at least 20 characters. This key will go in the variable :code:`ASYNC_UPLOAD_TEMP_URL_KEY`. - -.. note:: - - See the `documentation of symfony `_ on how to store variables, and how to encrypt them if needed. - -Configure the storage like this: - -.. code-block:: yaml - - # file config/packages/chill_doc_store.yaml - chill_doc_store: - use_driver: openstack - openstack: - temp_url: - temp_url_key: '%env(resolve:ASYNC_UPLOAD_TEMP_URL_KEY)%' # Required - container: '%env(resolve:ASYNC_UPLOAD_TEMP_URL_CONTAINER)%' # Required - temp_url_base_path: '%env(resolve:ASYNC_UPLOAD_TEMP_URL_BASE_PATH)%' # Required - -Chill is able to configure the container in order to store document. Grab an Openstack Token (for instance, using :code:`openstack token issue` or -the web interface of your openstack provider), and run this command: - -.. code-block:: bash - - symfony console async-upload:configure --os_token=OPENSTACK_TOKEN -d https://mychill.mydomain.example - - # or, without symfony-cli - bin/console async-upload:configure --os_token=OPENSTACK_TOKEN -d https://mychill.mydomain.example - - diff --git a/docs/source/installation/enable-collabora-for-dev.md b/docs/source/installation/enable-collabora-for-dev.md new file mode 100644 index 000000000..8132b7aab --- /dev/null +++ b/docs/source/installation/enable-collabora-for-dev.md @@ -0,0 +1,105 @@ +## Enable CODE for development + +For editing a document, there must be a way to communicate between the collabora server and the symfony server, in +both directions. The domain name should also be the same for collabora server and for the browser which access to the +online editor. + +### Using ngrok (or other http tunnel) + +One can configure a tunnel server to expose your local installation to the web and access to your local server using the +tunnel url. + +##### Start ngrok + +This can be achieved using [ngrok ](https://ngrok.com/). + + The configuration of ngrok is outside the scope of this document. Refers to the ngrok's documentation. + + # ensuring that your server is running through http and port 8000 + ngrok http 8000 + # then open the link given by the ngrok utility, and you should reach your app + +At this step, ensure that you can reach your local app using the ngrok url. + +##### Configure Collabora + +The collabora server must be executed online and configured to access to your ngrok installation. Ensure that the aliasgroup +exists for your ngrok application ([See the CODE documentation: ](https://sdk.collaboraonline.com/docs/installation/Configuration.html#multihost-configuration)). + +##### Configure your app + +Set the `EDITOR_SERVER` variable to point to your collabora server, this should be done in your `.env.local` file. + +At this point, everything must be fine. In case of errors, watch the log from your collabora server, use the [profiler](https://symfony.com/doc/current/profiler.html) +to debug the requests. + + In case of error while validating proof (you'll see those messages in the collabora's logs), you can temporarily disable + the proof validation adding this code snippet in `config/services.yaml`: + +```yaml + when@dev: + # add only in the dev environment to avoid security problems + services: + ChampsLibres\WopiLib\Contract\Service\ProofValidatorInterface: + # this class will always validate proof + alias: Chill\WopiBundle\Service\Wopi\NullProofValidator +``` + +### With a local CODE image + + This configuration is not sure and must be refined. The documentation does not seem entirely valid. + +##### Use a local domain name and https for your app + +Use the proxy feature from the embedded symfony server to run your app. `See the dedicated doc [ + +Configure also the `https certificate ](https://symfony.com/doc/current/setup/symfony_server.html#enabling-tls) + +In this example, your local domain name will be `my-domain` and the url will be `https://my-domain.wip`. + +Ensure that the proxy is running. + +##### Create a certificate database for collabora + +Collabora must validate your certificate generated by the symfony console. For that, you need [to create a NSS database](https://sdk.collaboraonline.com/docs/installation/Configuration.html#validating-digital-signatures) +and configure collabora to use it. + +At first, export the certificate for symfony development. Use the graphical interface from your browser to get the +certificate as a PEM file. + +```bash + # create your database in a custom directory + `mkdir /path/to/your/directory` + `certutil -N -d /path/to/your/directory` + `cat /path/to/your/ca.crt | certutil -d . -A symfony -t -t C,P,C,u,w -a` +``` + +Launch CODE properly configured + +```yaml + collabora: + image: collabora/code:latest + environment: + - SLEEPFORDEBUGGER=0 + - DONT_GEN_SSL_CERT="True" + # add a path to the database + - extra_params=--o:ssl.enable=false --o:ssl.termination=false --o:logging.level=7 -o:certificates.database_path=/etc/custom-certificates/nss-database + - username=admin + - password=admin + - dictionaries=en_US + - aliasgroup1=https://my-domain.wip + ports: + - "127.0.0.1:9980:9980" + volumes: + - "/path/to/your/directory/nss-database:/etc/custom-certificates/nss-database" + extra_hosts: + - "my-domain.wip:host-gateway" +``` + +##### Configure your app + +In your `.env.local` file: + + `EDITOR_SERVER=http://${COLLABORA_HOST}:${COLLABORA_PORT}` + +At this step, you should be able to edit a document through collabora. diff --git a/docs/source/installation/enable-collabora-for-dev.rst b/docs/source/installation/enable-collabora-for-dev.rst deleted file mode 100644 index 17a9ae1cc..000000000 --- a/docs/source/installation/enable-collabora-for-dev.rst +++ /dev/null @@ -1,125 +0,0 @@ - -Enable CODE for development -=========================== - -For editing a document, there must be a way to communicate between the collabora server and the symfony server, in -both direction. The domain name should also be the same for collabora server and for the browser which access to the -online editor. - -Using ngrok (or other http tunnel) ----------------------------------- - -One can configure a tunnel server to expose your local install to the web, and access to your local server using the -tunnel url. - -Start ngrok -^^^^^^^^^^^ - -This can be achieve using `ngrok `_. - -.. note:: - - The configuration of ngrok is outside of the scope of this document. Refers to the ngrok's documentation. - -.. code-block:: bash - - # ensuring that your server is running through http and port 8000 - ngrok http 8000 - # then open the link given by the ngrok utility and you should reach your app - -At this step, ensure that you can reach your local app using the ngrok url. - -Configure Collabora -^^^^^^^^^^^^^^^^^^^ - -The collabora server must be executed online and configure to access to your ngrok installation. Ensure that the aliasgroup -exists for your ngrok application (`See the CODE documentation: `_). - -Configure your app -^^^^^^^^^^^^^^^^^^ - -Set the :code:`EDITOR_SERVER` variable to point to your collabora server, this should be done in your :code:`.env.local` file. - -At this point, everything must be fine. In case of errors, watch the log from your collabora server, use the `profiler `_ -to debug the requests. - -.. note:: - - In case of error while validating proof (you'll see those message in the collabora's logs), you can temporarily disable - the proof validation adding this code snippet in `config/services.yaml`: - - .. code-block:: yaml - - when@dev: - # add only in dev environment, to avoid security problems - services: - ChampsLibres\WopiLib\Contract\Service\ProofValidatorInterface: - # this class will always validate proof - alias: Chill\WopiBundle\Service\Wopi\NullProofValidator - -With a local CODE image ------------------------ - -.. warning:: - - This configuration is not sure, and must be refined. The documentation does not seems to be entirely valid. - -Use a local domain name and https for your app -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Use the proxy feature from embedded symfony server to run your app. `See the dedicated doc ` - -Configure also the `https certificate `_ - -In this example, your local domain name will be :code:`my-domain` and the url will be :code:`https://my-domain.wip`. - -Ensure that the proxy is running. - -Create a certificate database for collabora -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Collabora must validate your certificate generated by symfony console. For that, you need `to create a NSS database ` -and configure collabora to use it. - -At first, export the certificate for symfony development. Use the graphical interface from your browser to get the -certificate as a PEM file. - -.. code-block:: bash - - # create your database in a custom directory - mkdir /path/to/your/directory - certutil -N -d /path/to/your/directory - cat /path/to/your/ca.crt | certutil -d . -A symfony -t -t C,P,C,u,w -a - -Launch CODE properly configured - -.. code-block:: yaml - - collabora: - image: collabora/code:latest - environment: - - SLEEPFORDEBUGGER=0 - - DONT_GEN_SSL_CERT="True" - # add path to the database - - extra_params=--o:ssl.enable=false --o:ssl.termination=false --o:logging.level=7 -o:certificates.database_path=/etc/custom-certificates/nss-database - - username=admin - - password=admin - - dictionaries=en_US - - aliasgroup1=https://my-domain.wip - ports: - - "127.0.0.1:9980:9980" - volumes: - - "/path/to/your/directory/nss-database:/etc/custom-certificates/nss-database" - extra_hosts: - - "my-domain.wip:host-gateway" - -Configure your app -^^^^^^^^^^^^^^^^^^ - -Into your :code:`.env.local` file: - -.. code-block:: env - - EDITOR_SERVER=http://${COLLABORA_HOST}:${COLLABORA_PORT} - -At this step, you should be able to edit a document through collabora. diff --git a/docs/source/installation/index.md b/docs/source/installation/index.md new file mode 100644 index 000000000..674f1525b --- /dev/null +++ b/docs/source/installation/index.md @@ -0,0 +1,43 @@ +# Installation & Usage + +You will learn here how to install a new symfony project with chill, and configure it. + +## Which kind of installation do I need? + +### I want to run chill in production + +See the [instructions about installing Chill for production ](installation-production.md). + +### I want to add features to the main chill bundles + +If you want to add features to chill bundles itself, **and** you want those features to be merged into the chill bundles, +you can use the "development" installation mode. + +See the [instruction for installation for development ](installation-for-dev.md). + +### I want to add features to Chill, but keep those features for my instance + +Follow the same instruction than for production, until the end. + +## 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 a + `nvmrc` file which selects automatically the required version of node (if present). +- [yarn](https://classic.yarnpkg.com/lang/en/docs/install/): We use 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. + +## Instructions + +- [Installation for Development](installation-development.md) +- [Installation for Production](installation-production.md) diff --git a/docs/source/installation/index.rst b/docs/source/installation/index.rst deleted file mode 100644 index fb4cb3cac..000000000 --- a/docs/source/installation/index.rst +++ /dev/null @@ -1,67 +0,0 @@ -.. chill-doc documentation master file, created by - sphinx-quickstart on Sun Sep 28 22:04:08 2014. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -.. Copyright (C) 2014-2019 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". - -Installation & Usage -#################### - - -You will learn here how to install a new symfony project with chill, and configure it. - -Which can of installation do I need ? -===================================== - -I want to run chill in production ---------------------------------- - -See the :ref:`instructions about installing Chill for production `. - -I want to add features to the main chill bundles ------------------------------------------------- - -If you want to add features to chill bundles itself, **and** you want those features to be merged into the chill bundles, -you can use the "development" installation mode. - -See the :ref:`instruction for installation for development `. - -I want to add features to Chill, but keep those features for my instance -------------------------------------------------------------------------- - -Follow the same instruction than for production, until the end. - -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 `_, version 8.3+, with the following extensions: pdo_pgsql, intl, mbstring, zip, bcmath, exif, sockets, redis, ast, gd; -- `composer `_; -- `symfony cli `_; -- `node, we encourage you to use nvm to configure the correct version `_. The project contains an - :code:`.nvmrc` file which selects automatically the required version of node (if present). -- `yarn `_. We use the version 1.22+ for now. -- `docker and the plugin compose `_ 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. - -Instructions -============ - -.. toctree:: - :maxdepth: 2 - - installation-development.rst - installation-production.rst diff --git a/docs/source/installation/installation-development.md b/docs/source/installation/installation-development.md new file mode 100644 index 000000000..8c79bc8f5 --- /dev/null +++ b/docs/source/installation/installation-development.md @@ -0,0 +1,89 @@ +## Installation for development or testing purpose only + +⚠️ Use this method for development only. ⚠️ + +You will need: + +- [Composer ](https://getcomposer.org); +- [Symfony-cli tool ](https://symfony.com/download); +- [docker ](https://docs.docker.com/engine/install/) and [docker-compose ](https://docs.docker.com/compose/) +- node > 20 and yarn 1.22 + +### First initialization + +1. clone the repository and move to the cloned directory: + + ```bash + git clone https://gitlab.com/Chill-Projet/chill-bundles.git + cd chill-bundles + ``` + +2. install dependencies using composer + + ```bash + composer install + ``` + +3. Install and compile assets: + + ```bash + yarn install + yarn run encore production + ``` + + **note** double-check that you have the node version > 20 using the `node --version` command. + +4. Configure your project: create a `.env.local` file at the root, and add the admin password: + + **note** for this installation mode, the environment should always be "dev" + ``` + APP_ENV=dev + ADMIN_PASSWORD=\$2y\$13\$iyvJLuT4YEa6iWXyQV4/N.hNHpNG8kXlYDkkt5MkYy4FXcSwYAwmm + ``` + **note**: if you copy-paste the line above, the password will be "admin". + +5. Start the stack using `docker compose up -d`, check the status of the start with `docker compose ps` + +6. Configure all the necessary third-party tools. On the first start, it may last a bit longer. You can always check with `docker compose ps` + + ```bash + # 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 + ``` + +7. Add some fixtures + + This will truncate all the existing data of the database. But remember, + we are in dev mode! + + ```bash + symfony console doctrine:fixtures:load + ``` + +8. launch symfony dev-server + + ```bash + symfony server:start -d + ``` + +And visit the web page it suggests. You can log in with user +`center a_social` and password `password`, or login `admin` with +the password you set. + +### Stopping the server + + `symfony server:stop` + +### Restart the webserver for a later start + + `symfony server:start -d` + # this will automatically start the full docker compose services diff --git a/docs/source/installation/installation-development.rst b/docs/source/installation/installation-development.rst deleted file mode 100644 index 5977747c6..000000000 --- a/docs/source/installation/installation-development.rst +++ /dev/null @@ -1,101 +0,0 @@ -.. _installation-for-dev: - -Installation for development or testing purpose only -==================================================== - -⚠️ Use this method for development only. ⚠️ - -You will need: - -- `Composer `__; -- `Symfony-cli tool `__; -- `docker `__ and - `docker-compose `__ -- node > 20 and yarn 1.22 - -First initialization --------------------- - -1. clone the repository and move to the cloned directory: - -.. code:: bash - - git clone https://gitlab.com/Chill-Projet/chill-bundles.git - cd chill-bundles - -2. install dependencies using composer - -.. code:: bash - - composer install - -3. Install and compile assets: - -.. code:: bash - - yarn install - yarn run encore production - -**note** double check that you have the node version > 20 using the -``node --version`` command. - -4. configure your project: create a ``.env.local`` file at the root, and - add the admin password: - -.. code:: dotenv - - # for this installation mode, the environment should always be "dev" - APP_ENV=dev - ADMIN_PASSWORD=\$2y\$13\$iyvJLuT4YEa6iWXyQV4/N.hNHpNG8kXlYDkkt5MkYy4FXcSwYAwmm - # note: if you copy-paste the line above, the password will be "admin". - -5. start the stack using ``docker compose up -d``, check the status of - the start with ``docker compose ps`` - -6. configure all the needed third-party tools - - .. code:: bash - - # 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 - -7. add some fixtures - -This will truncate all the existing data of the database. But remember, -we are in dev mode ! - -.. code:: bash - - symfony console doctrine:fixtures:load - -8. launch symfony dev-server - -.. code:: bash - - symfony server:start -d - -And visit the web page it suggest. You can login with user -``center a_social`` and password ``password``, or login ``admin`` with -the password you set. - -Stopping the server -------------------- - -.. code:: bash - - symfony server:stop - -Restart the webserver for subsequent start ------------------------------------------- - -.. code:: bash - - symfony server:start -d - # this will automatically starts the full docker compose services diff --git a/docs/source/installation/installation-production.md b/docs/source/installation/installation-production.md new file mode 100644 index 000000000..b85deb7d4 --- /dev/null +++ b/docs/source/installation/installation-production.md @@ -0,0 +1,310 @@ +# Install Chill for production with or without adding personal features + +Chill is a set of "bundles" for a symfony app. + +To run Chill in production or add new features to it (without merging those features to the chill core), you must create +a symfony app, and eventually add those features into your app. + +Once you are happy with the configuration, [you should follow the dedicated instructions of how to go into production for +Symfony apps ](https://symfony.com/doc/current/deployment.html). + +## Install a new app + +### Install required dependencies: + +- `jq`: https://jqlang.org/ (install it through your package manager); +- `php`, minimal version: 8.3; +- `composer`: https://getcomposer.org/download/ +- `symfony-cli`: https://symfony.com/download +- `docker` with the plugin `compose`: https://docs.docker.com/engine/install/ and https://docs.docker.com/compose/install/ + +### Initialize the project and it's dependencies +```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. +```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 + `symfony composer require -W chill-project/chill-bundles ^3.7.1 champs-libres/wopi-lib dev-master@dev champs-libres/wopi-bundle dev-master@dev symfony/amqp-messenger` +``` + +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). + +```bash + # fix some configuration + ./post-install-chill.sh + # populate the cache for the first time. This is necessary to dump some translation files, required for the asset compilation + symfony console cache:clear + # install node dependencies + yarn install + # and compile assets + yarn run encore production +``` + + If you encounter this error during asset compilation ([yarn run encore production`) (repeated multiple times): + +```bash + [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: + +```bash + rm -rf public/bundles/* +``` + + Then restart the compilation of assets (```yarn run encore production```) + +### Configure your project + +You should read the configuration files in `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 `.env` file. The secrets should not be stored +in this `.env` file, but instead using the `secrets management tool ](https://symfony.com/doc/current/configuration/secrets.html) +or in the `.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 required variables are: + +- the `ADMIN_PASSWORD`; +- the `OVHCLOUD_DSN` variable; + +##### `ADMIN_PASSWORD` + +You can generate a hashed and salted admin password using the command: +`symfony console security:hash-password 'Symfony\Component\Security\Core\User\User'` + +Then, you can either: + +- add this password to the `.env.local` file, you must escape the character `$`: if the generated password + is `$2y$13$iyvJLuT4YEa6iWXyQV4/N.hNHpNG8kXlYDkkt5MkYy4FXcSwYAwmm`, your `.env.local` file will be: + + ```bash + 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). + +##### `OVHCLOUD_DSN` and sending SMS messages + +This is a temporary dependency, for ensuring compatibility for previous behaviour. + +You can set it to `null://null` if you do not plan to use sending SMS. + + OVHCLOUD_DSN=null://null + +If you plan to do it, you can configure the notifier component `as described in the [symfony documentation](https://symfony.com/doc/current/notifier.html#notifier-sms-channel). + +Some environment variables are available for the JWT authentication bundle in the `.env` file. + +### Prepare database, messenger queue, and other configuration + +To continue the installation process, you will have to run migrations: + +```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 + # load languages data + symfony console chill:main:languages:populate + # generate jwt token, required for some api features (webdav access, ...) + symfony console lexik:jwt:generate-keypair +``` + + If you encounter this error: + +``` +No transport supports the given Messenger DSN. +``` + + Please check that you installed the package `symfony/amqp-messenger`. + +### 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): + +```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 + +```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: `center a_social`, `center b_social`, `center a_direction`, ... + +The full list is visible in the "users" table: `docker compose exec database psql -U app -c "SELECT username FROM users"`. + +The password is always `password`. + +The fixtures are not fully functional. See the `corresponding issue ](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/280). + +### Add web profiler and debugger + +```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! + +It would be better [to follow the instruction about development ](installation-for-dev.md). But if those features are +deeply linked to some dev you made in the app, it can be easier to develop within the [vendor/` directory. + +You will have to download chill-bundles as a git repository (and not as an archive, which is barely editable). + +In your `composer.json` file, add these lines: + +```bash + { + "config": { + + "preferred-install": { + + "chill-project/chill-bundles": "source", + "*": "dist" + + } + } +``` + +Then, run `symfony composer reinstall chill-project/chill-bundles` to re-install the package from source. + +## 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 [composer.json` file, or set the version to `^3.0.0` and run `symfony composer update` regularly +- run `composer update` and `yarn update` to maintain your dependencies up-to-date. + +After each update, you must update your database schema: + +```bash + symfony console doctrine:migrations:migrate + symfony console chill:db:sync-views +``` + +## 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 `symfony composer install` and `yarn install` to install the same dependencies as the initial developer; +- run `yarn run encore production` to compile assets; +- copy any possible variables from the `.env.local` files; +- start the docker compose stack, using `docker compose`, and run migrations, set up transports, and prepare chill db views + (see the corresponding command above) + +## Operations + +### Build assets + +run those commands: + +```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 want to reload the assets on each changes + yarn run encore dev --watch` +``` + +### How to execute the console ? + +```bash + # start the console with all required variables + symfony console + # you can add your command after that: + symfony console list +``` + +### 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: + + `symfony console messenger:consume async priority` + +To avoid memory issues, we encourage you to also use the `--limit` parameter of the command. + +### How to read emails sent by the program ? + +In development, there is a built-in "mail catcher". Open it with `symfony open:local:webmail` + +### How to run cron-jobs ? + +Some commands must be executed in [cron jobs ](cronjob.md). To execute them: + + `symfony console chill:cron-job:execute` + +### What about materialized views ? + +There are some materialized views in chill, to speed up some complex computations in the database. + +In order to refresh them, run a cron job or refresh them manually in your database. + +## Troubleshooting + +### 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. + +## Go to 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. + + In production, you **must** set these variables: + + * ``APP_ENV`` to ``prod`` + * ``APP_DEBUG`` to ``false`` + + There are security issues if you keep the same variables as for production. + +## Going further + +- [Production Setup](prod.md) +- [Document Storage](document-storage.md) +- [Load Addresses](load-addresses.md) +- [Production Calendar SMS Sending](prod-calendar-sms-sending.md) +- [Microsoft Graph Configuration](msgraph-configure.md) diff --git a/docs/source/installation/installation-production.rst b/docs/source/installation/installation-production.rst deleted file mode 100644 index 7169af5d8..000000000 --- a/docs/source/installation/installation-production.rst +++ /dev/null @@ -1,365 +0,0 @@ -.. _installation-production: - -Install Chill for production with or without adding personal features -##################################################################### - -Chill is a set of "bundles" for a symfony app. - -To run Chill in production or add new features to it (without merging those features to the chill core), you must create -a symfony app, and eventually add those features into your app. - -Once you are happy with the configuration, `you should follow the dedicated instructions of how to go into production for -Symfony apps `_. - -Install a new app -================= - -Install required dependencies: ------------------------------- - -- `jq`: https://jqlang.org/ (install it through your package manager); -- `php`, minimal version: 8.3; -- `composer`: https://getcomposer.org/download/ -- `symfony-cli`: https://symfony.com/download -- `docker` with the plugin `compose`: https://docs.docker.com/engine/install/ and https://docs.docker.com/compose/install/ - - -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 - symfony composer require -W chill-project/chill-bundles ^3.7.1 champs-libres/wopi-lib dev-master@dev champs-libres/wopi-bundle dev-master@dev symfony/amqp-messenger - -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 - # populate the cache for the first time. This is necessary to dump some translation files, required for the assets compilation - symfony console cache:clear - # 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:: - - [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 `_ -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 required variables are: - -- the :code:`ADMIN_PASSWORD`; -- the :code:`OVHCLOUD_DSN` variable; - -:code:`ADMIN_PASSWORD` -^^^^^^^^^^^^^^^^^^^^^^ - -You can generate a hashed and salted admin password using the command -:code:`symfony console security:hash-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:: bash - - 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). - -:code:`OVHCLOUD_DSN` and sending SMS messages -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -This is a temporary dependency, for ensuring compatibility for previous behaviour. - -You can set it to :code:`null://null` if you do not plan to use sending SMS. - -.. code-block:: bash - - OVHCLOUD_DSN=null://null - -If you plan to do it, you can configure the notifier component `as described in the symfony documentation `_. - - -Some environment variables are available for the JWT authentication bundle in the :code:`.env` file. - -Prepare database, messenger queue, and other configuration ----------------------------------------------------------- - -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 - # load languages data - symfony console chill:main:languages:populate - # generate jwt token, required for some api features (webdav access, ...) - symfony console lexik:jwt:generate-keypair - -.. note:: - - If you encounter this error: - - .. code-block:: - - No transport supports the given Messenger DSN. - - Please check that you installed the package `symfony/amqp-messenger`. - - - -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 `_: - -.. 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 `_. - -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! - -It would be better :ref:`to follow the instruction about development `. But if those features are -deeply linked to some dev you made in the app, it can be easier to develop within the :code:`vendor/` directory. - -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. - - -Update -====== - -In order to update your app, you must update dependencies: - -- for chill-bundles, you can `set the last version `_ 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 - - -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) - -Operations -========== - -Build assets ------------- - -run those commands: - -.. 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 - -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 - -How to generate documents -------------------------- - -Documents are generated asynchronously by `"consuming messages" `_. - -You must generate them using a dedicated process: - -.. code-block:: bash - - symfony console messenger:consume async priority - -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 ? -------------------------------------------- - -In development, there is a built-in "mail catcher". Open it with :code:`symfony open:local:webmail` - -How to run cron-jobs ? ----------------------- - -Some commands must be executed in :ref:`cron jobs `. To execute them: - -.. code-block:: bash - - symfony console chill:cron-job:execute - -What about materialized views ? -------------------------------- - -There are some materialized views in chill, to speed up some complex computations in the database. - -In order to refresh them, run a cron job or refresh them manually in your database. - - -Troubleshooting -=============== - -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. - -Go to 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. - -.. warning:: - - In production, you **must** set these variables: - - * ``APP_ENV`` to ``prod`` - * ``APP_DEBUG`` to ``false`` - - There are security issues if you keep the same variables as for production. - - -Going further -============= - -.. toctree:: - :maxdepth: 2 - - prod.rst - document-storage.rst - load-addresses.rst - prod-calendar-sms-sending.rst - msgraph-configure.rst diff --git a/docs/source/installation/load-addresses.md b/docs/source/installation/load-addresses.md new file mode 100644 index 000000000..2e4b193f8 --- /dev/null +++ b/docs/source/installation/load-addresses.md @@ -0,0 +1,47 @@ +###### 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 loaded from a dedicated source. + +## Countries + +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. + + bin/console chill:main:countries:populate + +## In France + +The address is 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/) + + # first, load postal codes + `bin/console chill:main:postal-code:load:FR` + # then, load all addresses by departement (multiple departements 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 is 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 (`1xxx` for postal codes from 1000 to 1999), or a limited list for development purpose. + +The command expects a language code as the first argument. + + # load postal code from 1000 to 3999: + `bin/console chill:main:address-ref-from-best-addresse fr 1xxx 2xxx 3xxx` + + # load only an extract (for dev purposes) + `bin/console chill:main:address-ref-from-best-addresse fr extract` + + # load full addresses (discouraged) + `bin/console chill:main:address-ref-from-best-addresse fr full` + + 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 a smaller extract: each extract loaded **after** will not + delete the addresses loaded with the full extract (and some addresses will be present twice). diff --git a/docs/source/installation/load-addresses.rst b/docs/source/installation/load-addresses.rst deleted file mode 100644 index 641325dee..000000000 --- a/docs/source/installation/load-addresses.rst +++ /dev/null @@ -1,62 +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 `_. The postal codes are loaded from `the official list of -postal codes `_ - -.. 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 `_. - -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 `_). -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. - -The command expects a language code as first argument. - -.. code-block:: bash - - # load postal code from 1000 to 3999: - bin/console chill:main:address-ref-from-best-addresse fr 1xxx 2xxx 3xxx - - # load only an extract (for dev purposes) - bin/console chill:main:address-ref-from-best-addresse fr extract - - # load full addresses (discouraged) - bin/console chill:main:address-ref-from-best-addresse fr 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). diff --git a/docs/source/installation/msgraph-configure.rst b/docs/source/installation/msgraph-configure.md similarity index 60% rename from docs/source/installation/msgraph-configure.rst rename to docs/source/installation/msgraph-configure.md index 5655e9ff2..e6d6003a9 100644 --- a/docs/source/installation/msgraph-configure.rst +++ b/docs/source/installation/msgraph-configure.md @@ -1,70 +1,59 @@ - -Configure Chill for calendar and absence synchronisation and SSO with Microsoft Graph (Outlook) -=============================================================================================== +## 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 `_). +* 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). +Both can be configured separately (synchronising calendars without SSO, or SSO without a calendar). Please note that the user's email address is the key to associate Chill's users with Microsoft's ones. -Configure SSO -------------- +### Configure SSO -On Azure side -************* +###### On the Azure side -Configure an app with the Azure interface, and give it the name of your choice. +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 is the variable which will be named `SAML_IDP_APP_UUID`. -This the variable which will be named :code:`SAML_IDP_APP_UUID`. +Go to the "Single sign-on" ("Authentication unique") section. Choose "SAML" as a protocol and fill those values: -Go to the "Single sign-on" ("Authentication unique") section. Choose "SAML" as protocol, and fill those values: +1. The `entityId` seems to be arbitrary. This will be your variable `SAML_ENTITY_ID`; +2. The url response must be your Chill's URL appended by `/saml/acs` +3. The only used attributes is `emailaddress`, which must match the user's email one. -.. figure:: ./saml_login_1.png +You must download the certificate, as base64. The format for the download is `cer`: you will remove the first and last line -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. +(the ones with `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`), -.. figure:: ./saml_login_2.png +and remove all the return line. The final result should be something as `MIIAbcdef...XyZA=`. -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. +This certificat will be your `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: +Remember to provider user's access 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:: +You must now have gathered all the required variables for SSO: +```bash 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 -******************* +###### Configure chill app -* add the bundle :code:`hslavich/oneloginsaml-bundle` +* add the bundle `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 +```yaml # config/packages/hslavich_onelogin.yaml @@ -74,7 +63,6 @@ Configure chill app 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: @@ -124,16 +112,14 @@ Configure chill app name: 'Example' displayname: 'Example' url: 'http://example.com' +``` - -.. code-block:: yaml - +```yaml # config/security.yaml # merge this with other existing configurations security: - providers: saml_provider: # Loads user from user repository @@ -143,7 +129,6 @@ Configure chill app firewalls: - default: # saml part: saml: @@ -158,10 +143,9 @@ Configure chill app login_path: saml_login logout: path: /saml/logout +``` - -.. code-block:: php - +```php // src/Security/SamlFactory.php namespace App\Security; @@ -185,105 +169,86 @@ Configure chill app return $user; } } +``` - - -Configure sync and calendar access ----------------------------------- +### 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 write appointment ("Rendez-vous") into their calendar and invite other users to their appointment; +- allow chill instance to be notified if an appointment is added or removed by the user within another interface than Chill: if the appointment matches 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 sync process 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. + * we authenticate "on behalf of a user", to allow users to see their own calendar or another 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). + Typically, when the page is loaded, Chill first checks 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). - You can find the oauth configuration on the "Securité > Autorisations" tab, and click on "application registration" (not translated). +Add a redirection URI for your authentification: -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. + The URI must be "your chill public url" with `/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). +Take care of the separation between authorization "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`); +* Users must be allowed to read their user profile (`User.Read`), and the profile of other users (`User.ReadBasicAll`); +* They must be allowed to read their calendar (`Calendars.Read`), and the calendars shared with them (`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`). +* the daemon must be allowed to read all users and their profile, to establish a link between them and the Chill's users: (`Users.Read.All`); +* it must also be allowed to read and write into the calendars (`Calendars.ReadWrite.All`); +* for sending invitation to other users, the permission (`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 (`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. +At this step, you might choose to accept those permissions for all users or let them do it by yourself. -Generate a secret: +Grab your client id: This will be your `OAUTH_AZURE_CLIENT_ID` variable. -.. figure:: ./oauth_api_secret.png +Generate a secret: This will be your `OAUTH_AZURE_CLIENT_SECRET` variable. -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). +And get you azure's tenant id, which is the same as the `SAML_IDP_APP_UUID` (see above). Your variables will be: -.. code-block:: - +```bash 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 +Enable the calendar sync with Microsoft Azure: +```yaml # config/packages/chill_calendar.yaml chill_calendar: remote_calendars_sync: microsoft_graph: enabled: true +``` and configure the oauth client: -.. code-block:: yaml - +```yaml # config/packages/knp_oauth2_client.yaml knpu_oauth2_client: clients: @@ -296,35 +261,30 @@ and configure the oauth client: 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 the first token by using : -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 : +`bin/console chill:calendar:msgraph-grant-admin-consent` -:code:`bin/console chill:calendar:msgraph-grant-admin-consent` +This will generate an url that you can use to grant your app for your tenant. The redirection may fail in the browser, but this is not relevant: if you get an authorization token in the CLI, the authentication works. -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 -Run the processes to synchronize --------------------------------- +The calendar synchronization is processed using symfony messenger. It seems to be interesting to configure a queue (in the postgresql database it is the simplest way), and to run a worker for synchronization, at least in production. -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. +This cli command does the association between chill's users and Microsoft's users: -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 + `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. +* and, most important, create a subscription to get notification when the user alters his calendar, to sync chill's event and ranges in sync. -The subscription least at most 3 days. This command should be runned: +The subscription is at least at most 3 days. This command should be run: * 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. - - +In production, we advise running it at least every day to get the sync working. diff --git a/docs/source/installation/prod-calendar-sms-sending.md b/docs/source/installation/prod-calendar-sms-sending.md new file mode 100644 index 000000000..2987fa56b --- /dev/null +++ b/docs/source/installation/prod-calendar-sms-sending.md @@ -0,0 +1,21 @@ +## Send short messages (SMS) with the calendar bundle + +To activate the sending of messages, you should run this command on a regular basis (using, for instance, a cronjob): + + `bin/console chill:calendar:send-short-messages` + +A transporter must be configured for the message to be effectively sent. + +### Configure OVH Transporter + +Currently, this is the only one transporter available. + +To configure this, add this config variable in your environment: + +```env +SHORT_MESSAGE_DSN=ovh://applicationKey:applicationSecret@endpoint?consumerKey=xxxx&sender=yyyy&service_name=zzzz +``` + +To generate the application key, secret, and consumerKey, refers to their [documentation ](https://docs.ovh.com/gb/en/api/first-steps-with-ovh-api/). + +Before to be able to send your first sms, you must enable your account, grab some credits, and configure a sender. The service_name is an internal configuration generated by OVH. diff --git a/docs/source/installation/prod-calendar-sms-sending.rst b/docs/source/installation/prod-calendar-sms-sending.rst deleted file mode 100644 index 6529b95d9..000000000 --- a/docs/source/installation/prod-calendar-sms-sending.rst +++ /dev/null @@ -1,27 +0,0 @@ - -Send short messages (SMS) with calendar bundle -============================================== - -To activate the sending of messages, you should run this command on a regularly basis (using, for instance, a cronjob): - -.. code-block:: bash - - bin/console chill:calendar:send-short-messages - -A transporter must be configured for the message to be effectively sent. - -Configure OVH Transporter -------------------------- - -Currently, this is the only one transporter available. - -For configuring this, simply add this config variable in your environment: - -```env -SHORT_MESSAGE_DSN=ovh://applicationKey:applicationSecret@endpoint?consumerKey=xxxx&sender=yyyy&service_name=zzzz -``` - -In order to generate the application key, secret, and consumerKey, refers to their `documentation `_. - -Before to be able to send your first sms, you must enable your account, grab some credits, and configure a sender. The service_name is an internal configuration generated by OVH. - diff --git a/docs/source/installation/prod.md b/docs/source/installation/prod.md new file mode 100644 index 000000000..50a51b378 --- /dev/null +++ b/docs/source/installation/prod.md @@ -0,0 +1,62 @@ +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". + +# Installation for production + +An installation uses these services, which are deployed using docker containers: + +* a php-fpm image, which runs the Php and Symfony code for Chill; +* a nginx image, which serves the assets and usually proxies the php requests to the fpm image; +* a redis server, which stores the cache, sessions (this is currently hardcoded in the php image), and some useful keys (like wopi locks); +* a postgresql database. The use of postgresql is mandatory; +* a relater service, which transforms odt templates to full documents (replacing the placeholders); + +Some external services: + +* (required) an openstack object store, configured with `temporary url ` configured (no openstack users are required). This is currently the only way to store documents from chill; +* a mailer service (SMTP) +* (optional) a service for verifying phone number. Currently, only Twilio is possible; +* (optional) a service for sending Short Messages (SMS). Currently, only Ovh is possible; + +The `docker-compose.yaml` file of chill app is a basis for a production install. The environment variable in the ```.env``` and ```.env.prod``` should be overridden by environment variables, or ```.env.local``` files. + +This should be adapted to your needs: + +* The images for php and nginx apps are pre-compiled images, with the default configuration and bundle. If they do not fullfill your needs, you should compile your own images. + + .. TODO: + + As the time of writing (2022-07-03) those images are not published yet. + +* Think about how you will back up your database. Some adminsys find it easier to store a database outside of docker, which might be easier to administrate or replicate. + +## Run migrations on each update + +Every time you start a new version, you should apply update the sql schema: + +- running ``bin/console doctrine:migration:migrate`` to run SQL migration; +- synchronizing SQL views to the last state: ``bin/console chill:db:sync-views`` + +## Cron jobs + +The command `chill:cron-job:execute` should be executed every 15 minutes (more or less). + +This command should never be executed concurrently. It should be not having more than one process for a single instance. + +## Post-install tasks + +- import addresses. See [addresses](addresses.md). + +## Tweak symfony messenger + +Calendar sync is processed using symfony messenger. + +You can tweak the configuration + +Going further: + +* Configure the saml login and synchronization with Outlook api diff --git a/docs/source/installation/prod.rst b/docs/source/installation/prod.rst deleted file mode 100644 index 21da15267..000000000 --- a/docs/source/installation/prod.rst +++ /dev/null @@ -1,71 +0,0 @@ -.. Copyright (C) 2014-2019 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". - -.. _prod: - -Installation for production -########################### - -An installation use these services, which are deployed using docker containers: - -* a php-fpm image, which run the Php and Symfony code for Chill; -* a nginx image, which serves the assets, and usually proxy the php requests to the fpm image; -* a redis server, which stores the cache, sessions (this is currently hardcoded in the php image), and some useful keys (like wopi locks); -* a postgresql database. The use of postgresql is mandatory; -* a relatorio service, which transform odt templates to full documents (replacing the placeholders); - -Some external services: - -* (required) an openstack object store, configured with `temporary url ` configured (no openstack users is required). This is currently the only way to store documents from chill; -* a mailer service (SMTP) -* (optional) a service for verifying phone number. Currently, only Twilio is possible; -* (optional) a service for sending Short Messages (SMS). Currently, only Ovh is possible; - -The `docker-compose.yaml` file of chill app is a basis for a production install. The environment variable in the ```.env``` and ```.env.prod``` should be overriden by environment variables, or ```.env.local``` files. - -This should be adapted to your needs: - -* The image for php and nginx apps are pre-compiled images, with the default configuration and bundle. If they do not fullfill your needs, you should compile your own images. - - .. TODO: - - As the time of writing (2022-07-03) those images are not published yet. - -* Think about how you will backup your database. Some adminsys find easier to store database outside of docker, which might be easier to administrate or replicate. - -Run migrations on each update -============================= - -Every time you start a new version, you should apply update the sql schema: - -- running ``bin/console doctrine:migration:migrate`` to run sql migration; -- synchonizing sql views to the last state: ``bin/console chill:db:sync-views`` - -Cron jobs -========= - -The command :code:`chill:cron-job:execute` should be executed every 15 minutes (more or less). - -This command should never be executed concurrently. It should be not have more than one process for a single instance. - -Post-install tasks -================== - -- import addresses. See :ref:`addresses`. - - -Tweak symfony messenger -======================= - -Calendar sync is processed using symfony messenger. - -You can tweak the configuration - -Going further: - -* Configure the saml login and synchronisation with Outlook api diff --git a/package.json b/package.json index a013df3da..1b4c7df13 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "@hotwired/stimulus": "^3.0.0", "@luminateone/eslint-baseline": "^1.0.9", "@symfony/stimulus-bridge": "^3.2.0", + "@symfony/ux-translator": "file:vendor/symfony/ux-translator/assets", "@symfony/webpack-encore": "^4.1.0", "@tsconfig/node20": "^20.1.4", "@types/dompurify": "^3.0.5", diff --git a/packages/ChillZimbraBundle/README.md b/packages/ChillZimbraBundle/README.md new file mode 100644 index 000000000..521b31fd2 --- /dev/null +++ b/packages/ChillZimbraBundle/README.md @@ -0,0 +1,40 @@ +# Chill Zimbra Bundle + +This bundle provides integration with Zimbra email server for Chill application. + +## Source code + +This bundle should be modified within the chill-bundles repository. The code at +https://gitlab.com/Chill-Projet/chill-zimbra-connector is a mirror of the main +repository, and is intended to serve packagist information. + +## Configuration + +This bundle should be configured using a dsn scheme with a `zimbra+http` or `zimbra+https` +scheme. + +```yaml +chill_calendar: + # remember to url-encode username and password + remote_calendar_dsn: zimbra+https://chill%40zimbra.example.com:password@zimbra.example.com +``` + +## Development + +This bundles should be developed from within the chill-bundles repository. + +During development, you must use an inline alias, or a branch alias to +be able to load the root package's master branch as a replacement for a version. + +Example of composer.json for chill-project/chill-zimbra-bundle: + +```json +{ + "require": { + "chill-project/chill-bundles": "dev-master as v4.6.1", + "zimbra-api/soap-api": "^3.2.2", + "psr/http-client": "^1.0", + "nyholm/psr7": "^1.0" + } +} +``` diff --git a/packages/ChillZimbraBundle/composer.json b/packages/ChillZimbraBundle/composer.json new file mode 100644 index 000000000..f62e21125 --- /dev/null +++ b/packages/ChillZimbraBundle/composer.json @@ -0,0 +1,22 @@ +{ + "name": "chill-project/chill-zimbra-bundle", + "description": "Provide connection between Zimbra agenda and Chill", + "minimum-stability": "stable", + "license": "AGPL-3.0", + "type": "library", + "keywords": [ + "chill", + "social worker" + ], + "require": { + "chill-project/chill-bundles": "dev-master as v4.6.1", + "zimbra-api/soap-api": "^3.2.2", + "psr/http-client": "^1.0", + "nyholm/psr7": "^1.0" + }, + "autoload": { + "psr-4": { + "Chill\\ZimbraBundle\\": "src/" + } + } +} diff --git a/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector.php b/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector.php new file mode 100644 index 000000000..acb6bdd84 --- /dev/null +++ b/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector.php @@ -0,0 +1,147 @@ +deleteEvent)($user, $remoteId); + + if (null !== $associatedCalendarRange) { + $this->logger->info(self::LOG_PREFIX.'Ask to re-create the previous calendar range', ['previous_calendar_range_id' => $associatedCalendarRange->getId()]); + $this->createCalendarRange($associatedCalendarRange); + } + } + + public function removeCalendarRange(string $remoteId, array $remoteAttributes, User $user): void + { + if ('' === $remoteId) { + return; + } + + ($this->deleteEvent)($user, $remoteId); + } + + public function syncCalendar(Calendar $calendar, string $action, ?CalendarRange $previousCalendarRange, ?User $previousMainUser, ?array $oldInvites, ?array $newInvites): void + { + if (null !== $previousMainUser && $previousMainUser !== $calendar->getMainUser()) { + $this->removeCalendar($calendar->getRemoteId(), [], $previousMainUser); + $calendar->setRemoteId(''); + } + + if (!$calendar->hasRemoteId()) { + $calItemId = ($this->createEvent)($calendar); + $this->logger->info(self::LOG_PREFIX.'Calendar synced with Zimbra', ['calendar_id' => $calendar->getId(), 'action' => $action, 'calItemId' => $calItemId]); + + $calendar->setRemoteId($calItemId); + } else { + ($this->updateEvent)($calendar); + $this->logger->info(self::LOG_PREFIX.'Calendar updated against zimbra', ['old_cal_remote_id' => $calendar->getRemoteId(), 'calendar_id' => $calendar->getId()]); + } + + if (null !== $calendar->getCalendarRange()) { + $range = $calendar->getCalendarRange(); + $this->removeCalendarRange($range->getRemoteId(), [], $range->getUser()); + $range->setRemoteId(''); + } + + if (null !== $previousCalendarRange) { + $this->syncCalendarRange($previousCalendarRange); + } + + foreach ($calendar->getInvites() as $invite) { + $this->syncInvite($invite); + } + } + + public function syncCalendarRange(CalendarRange $calendarRange): void + { + if (!$calendarRange->hasRemoteId()) { + $this->createCalendarRange($calendarRange); + } else { + ($this->updateEvent)($calendarRange); + $this->logger->info(self::LOG_PREFIX.'Calendar range updated against zimbra', ['old_cal_remote_id' => $calendarRange->getRemoteId(), 'calendar_range_id' => $calendarRange->getId()]); + } + } + + public function syncInvite(Invite $invite): void + { + if (Invite::ACCEPTED === $invite->getStatus()) { + if ($invite->hasRemoteId()) { + ($this->updateEvent)($invite); + $this->logger->info(self::LOG_PREFIX.'Invite range updated against zimbra', ['invite_id' => $invite->getId(), 'invite_remote_id', $invite->getRemoteId()]); + } else { + $remoteId = ($this->createEvent)($invite); + $invite->setRemoteId($remoteId); + $this->logger->info(self::LOG_PREFIX.'Invite range updated against zimbra', ['invite_id' => $invite->getId(), 'invite_remote_id', $invite->getRemoteId()]); + } + } elseif ($invite->hasRemoteId()) { + // case when the invite has been accepted in the past, and synchronized + ($this->deleteEvent)($invite->getUser(), $invite->getRemoteId()); + $this->logger->info(self::LOG_PREFIX.'Invite range removed in zimbra', ['invite_id' => $invite->getId(), 'invite_remote_id', $invite->getRemoteId()]); + $invite->setRemoteId(''); + } + } + + private function createCalendarRange(CalendarRange $calendarRange): void + { + $calItemId = ($this->createEvent)($calendarRange); + $this->logger->info(self::LOG_PREFIX.'Calendar range created with Zimbra', ['calendar_range_id' => $calendarRange->getId(), 'calItemId' => $calItemId]); + + $calendarRange->setRemoteId($calItemId); + } +} diff --git a/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/CreateEvent.php b/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/CreateEvent.php new file mode 100644 index 000000000..0ada55760 --- /dev/null +++ b/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/CreateEvent.php @@ -0,0 +1,96 @@ +getMainUser()->getEmail(); + $organizerLang = $calendar->getMainUser()->getLocale(); + } elseif ($calendar instanceof Invite) { + $organizerEmail = $calendar->getUser()->getEmail(); + $organizerLang = $calendar->getUser()->getLocale(); + } else { + $organizerEmail = $calendar->getUser()->getEmail(); + $organizerLang = $calendar->getUser()->getLocale(); + } + + if (null === $organizerEmail) { + throw new CalendarWithoutMainUserException(); + } + + $api = $this->soapClientBuilder->getApiForAccount($organizerEmail); + + $comp = $this->createEvent->createZimbraInviteComponentFromCalendar($calendar); + + $inv = new InvitationInfo(); + $inv->setInviteComponent($comp); + + $mp = new MimePartInfo(); + $mp->addMimePart(new MimePartInfo('text/plain', $this->translator->trans('zimbra.event_created_by_chill', locale: $organizerLang))); + + $msg = new Msg(); + $msg->setSubject($this->translator->trans('zimbra.event_created_trough_soap', locale: $organizerLang)) + ->setFolderId('10') + ->setInvite($inv) + ->setMimePart($mp); + + $response = $api->createAppointment($msg, echo: true); + + $echo = $response->getEcho(); + $invite = $echo->getInvite(); + $MPInviteInfo = $invite->getInvite(); + /** @var InviteComponent $firstInvite */ + $firstInvite = $MPInviteInfo->getInviteComponents()[0]; + + return $this->zimbraIdSerializer->serializeId( + $response->getCalItemId(), + $response->getCalInvId(), + $firstInvite->getUid(), + ); + } +} diff --git a/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/CreateZimbraComponent.php b/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/CreateZimbraComponent.php new file mode 100644 index 000000000..9fa14d75c --- /dev/null +++ b/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/CreateZimbraComponent.php @@ -0,0 +1,129 @@ +getPersons()->map(fn (Person $p) => $this->personRender->renderString($p, ['addAge' => false]))->toArray() + ); + $content = $this->twig->render('@ChillZimbra/ZimbraComponent/calendar_content.txt.twig', ['calendar' => $calendar]); + } elseif ($calendar instanceof Invite) { + $subject = '[Chill] '. + '('.$this->translator->trans('remote_calendar.calendar_invite_statement_in_calendar').') '. + implode( + ', ', + $calendar->getCalendar()->getPersons()->map(fn (Person $p) => $this->personRender->renderString($p, ['addAge' => false]))->toArray() + ); + $content = $this->twig->render('@ChillZimbra/ZimbraComponent/invitation_content.txt.twig', ['calendar' => $calendar->getCalendar()]); + } else { + // $calendar is an instanceof CalendarRange + $subject = $this->translator->trans('remote_calendar.calendar_range_title'); + $content = ''; + } + + if ($calendar instanceof Invite) { + $startDate = $calendar->getCalendar()->getStartDate(); + $endDate = $calendar->getCalendar()->getEndDate(); + $location = $calendar->getCalendar()->getLocation(); + $hasLocation = $calendar->getCalendar()->hasLocation(); + $isPrivate = $calendar->getCalendar()->getAccompanyingPeriod()?->isConfidential() ?? false; + } else { + $startDate = $calendar->getStartDate(); + $endDate = $calendar->getEndDate(); + $location = $calendar->getLocation(); + $hasLocation = $calendar->hasLocation(); + $isPrivate = $calendar->getAccompanyingPeriod()?->isConfidential() ?? false; + } + + $comp = new InviteComponent(); + $comp->setName($subject); + $comp->setDescription($content); + $comp->setFreeBusy(FreeBusyStatus::BUSY); + $comp->setStatus(InviteStatus::CONFIRMED); + $comp->setCalClass($isPrivate ? InviteClass::PRI : InviteClass::PUB); + $comp->setTransparency(Transparency::OPAQUE); + $comp->setIsAllDay(false); + $comp->setIsDraft(false); + $comp->setDtStart($this->dateConverter->phpToZimbraDateTime($startDate)); + $comp->setDtEnd($this->dateConverter->phpToZimbraDateTime($endDate)); + + if ($hasLocation) { + $comp + ->setLocation($this->createLocationString($location)); + } + + return $comp; + } + + private function createLocationString(Location $location): string + { + $str = ''; + + if ('' !== ($loc = (string) $location->getName())) { + $str .= $loc; + } + + if ($location->hasAddress()) { + if ('' !== $str) { + $str .= ', '; + } + + $str .= $this->addressRender->renderString($location->getAddress(), ['separator' => ', ']); + } + + return $str; + } +} diff --git a/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/DateConverter.php b/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/DateConverter.php new file mode 100644 index 000000000..1fdea5040 --- /dev/null +++ b/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/DateConverter.php @@ -0,0 +1,37 @@ +format(self::FORMAT_DATE_TIME), $date->getTimezone()->getName()); + } +} diff --git a/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/DeleteEvent.php b/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/DeleteEvent.php new file mode 100644 index 000000000..2e3ae5314 --- /dev/null +++ b/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/DeleteEvent.php @@ -0,0 +1,51 @@ +getEmail(); + + if (null === $organizerEmail) { + throw new CalendarWithoutMainUserException(); + } + + $api = $this->soapClientBuilder->getApiForAccount($organizerEmail); + ['calItemId' => $calItemId, 'calInvId' => $calInvId, 'inviteComponentCommonUid' => $inviteComponentCommonUid] + = $this->zimbraIdSerializer->deSerializeId($remoteId); + + $api->cancelAppointment( + id: $calInvId, + componentNum: 0, + ); + } +} diff --git a/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/SoapClientBuilder.php b/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/SoapClientBuilder.php new file mode 100644 index 000000000..e66c45e85 --- /dev/null +++ b/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/SoapClientBuilder.php @@ -0,0 +1,78 @@ +parameterBag->get('chill_calendar.remote_calendar_dsn'); + $url = parse_url($dsn); + + $this->username = urldecode($url['user']); + $this->password = urldecode($url['pass']); + if ('zimbra+http' === $url['scheme']) { + $scheme = 'http://'; + $port = $url['port'] ?? 80; + } elseif ('zimbra+https' === $url['scheme']) { + $scheme = 'https://'; + $port = $url['port'] ?? 443; + } else { + throw new \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException('Unsupported remote calendar scheme: '.$url['scheme']); + } + + $this->url = $scheme.$url['host'].':'.$port; + } + + private function buildApi(): MailApi + { + $baseClient = $this->client->withOptions([ + 'base_uri' => $location = $this->url.'/service/soap', + 'verify_host' => false, + 'verify_peer' => false, + ]); + $psr18Client = new Psr18Client($baseClient); + $api = new MailApi(); + $client = ClientFactory::create($location, $psr18Client); + $api->setClient($client); + + return $api; + } + + public function getApiForAccount(string $accountName): MailApi + { + $api = $this->buildApi(); + $response = $api->authByAccountName($this->username, $this->password); + + $token = $response->getAuthToken(); + + $apiBy = $this->buildApi(); + $apiBy->setAuthToken($token); + $apiBy->setTargetAccount(new AccountInfo(AccountBy::NAME, $accountName)); + + return $apiBy; + } +} diff --git a/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/UpdateEvent.php b/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/UpdateEvent.php new file mode 100644 index 000000000..9bd42b016 --- /dev/null +++ b/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/UpdateEvent.php @@ -0,0 +1,97 @@ +getMainUser()->getEmail(); + $organizerLang = $calendar->getMainUser()->getLocale(); + } elseif ($calendar instanceof Invite) { + $organizerEmail = $calendar->getCalendar()->getMainUser()->getEmail(); + $organizerLang = $calendar->getCalendar()->getMainUser()->getLocale(); + } else { + $organizerEmail = $calendar->getUser()->getEmail(); + $organizerLang = $calendar->getUser()->getLocale(); + } + + if (null === $organizerEmail) { + throw new CalendarWithoutMainUserException(); + } + + $api = $this->soapClientBuilder->getApiForAccount($organizerEmail); + + ['calItemId' => $calItemId, 'calInvId' => $calInvId, 'inviteComponentCommonUid' => $inviteComponentCommonUid] + = $this->zimbraIdSerializer->deSerializeId($calendar->getRemoteId()); + + $existing = $api->getAppointment(sync: true, includeContent: true, includeInvites: true, id: $calItemId); + $appt = $existing->getApptItem(); + + $comp = $this->createZimbraComponent->createZimbraInviteComponentFromCalendar($calendar); + $comp->setUid($inviteComponentCommonUid); + + $inv = new InvitationInfo(); + $inv->setInviteComponent($comp) + ->setUid($calInvId); + + $mp = new MimePartInfo(); + $mp->addMimePart(new MimePartInfo('text/plain', $this->translator->trans('zimbra.event_created_by_chill', locale: $organizerLang))); + + $msg = new Msg(); + $msg->setSubject($this->translator->trans('zimbra.event_created_trough_soap', locale: $organizerLang)) + ->setFolderId('10') + ->setInvite($inv) + ->setMimePart($mp) + ; + + $response = $api->modifyAppointment( + id: $calInvId, + componentNum: 0, + modifiedSequence: $appt->getModifiedSequence(), + revision: $appt->getRevision(), + msg: $msg, + echo: true + ); + } +} diff --git a/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/ZimbraIdSerializer.php b/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/ZimbraIdSerializer.php new file mode 100644 index 000000000..ba9d9ab63 --- /dev/null +++ b/packages/ChillZimbraBundle/src/Calendar/Connector/ZimbraConnector/ZimbraIdSerializer.php @@ -0,0 +1,67 @@ + $exploded[0], + 'calInvId' => $exploded[1], + 'inviteComponentCommonUid' => $exploded[2], + ]; + } +} diff --git a/packages/ChillZimbraBundle/src/ChillZimbraBundle.php b/packages/ChillZimbraBundle/src/ChillZimbraBundle.php new file mode 100644 index 000000000..b49e7e8af --- /dev/null +++ b/packages/ChillZimbraBundle/src/ChillZimbraBundle.php @@ -0,0 +1,16 @@ +load('services.yaml'); + } +} diff --git a/packages/ChillZimbraBundle/src/Exception/CalendarWithoutMainUserException.php b/packages/ChillZimbraBundle/src/Exception/CalendarWithoutMainUserException.php new file mode 100644 index 000000000..01314a62b --- /dev/null +++ b/packages/ChillZimbraBundle/src/Exception/CalendarWithoutMainUserException.php @@ -0,0 +1,14 @@ +setUser($this->security->getUser()); + $entity->addUser($this->security->getUser()); if ($person instanceof Person) { $entity->setPerson($person); diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 28c607acd..3b8f53303 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -88,8 +88,8 @@ class ActivityType extends AbstractType if (null !== $options['data']->getPerson()) { $builder->add('scope', ScopePickerType::class, [ - 'center' => $options['center'], 'role' => ActivityVoter::CREATE === (string) $options['role'] ? ActivityVoter::CREATE_PERSON : (string) $options['role'], + 'center' => $options['center'], 'required' => true, ]); } diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js index acd616dc9..2e240b4ad 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/store.js @@ -103,7 +103,7 @@ const store = createStore({ } // console.log("suggested users", suggestedUsers); - return suggestedUsers; + return suggestedUsers.filter((u) => u.enabled === true); }, suggestedResources(state) { // const resources = state.activity.accompanyingPeriod.resources; diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig index 13dfa7461..5a322d630 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig @@ -136,7 +136,6 @@
    {{ activity.comment|chill_entity_render_box({ 'disable_markdown': false, - 'limit_lines': 3, 'metadata': false, }) }}
    diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20251118124241.php b/src/Bundle/ChillActivityBundle/migrations/Version20251118124241.php new file mode 100644 index 000000000..c06f3e674 --- /dev/null +++ b/src/Bundle/ChillActivityBundle/migrations/Version20251118124241.php @@ -0,0 +1,50 @@ +addSql('ALTER TABLE activity_user ADD COLUMN by_migration BOOL DEFAULT FALSE'); + $this->addSql("COMMENT ON COLUMN activity_user.by_migration IS 'For backup purpose - can be safely deleted after a while. See migration \\Chill\\Migrations\\Activity\\Version20251118124241'"); + + $this->addSql('INSERT INTO activity_user (activity_id, user_id, by_migration) + SELECT id, user_id, true FROM activity + ON CONFLICT DO NOTHING'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE activity_user DROP COLUMN by_migration'); + } +} diff --git a/src/Bundle/ChillActivityBundle/translations/messages+intl-icu.nl.yml b/src/Bundle/ChillActivityBundle/translations/messages+intl-icu.nl.yml new file mode 100644 index 000000000..dc122576f --- /dev/null +++ b/src/Bundle/ChillActivityBundle/translations/messages+intl-icu.nl.yml @@ -0,0 +1,18 @@ +export: + filter: + activity: + course_having_activity_between_date: + Only course having an activity between from and to: Alleen trajecten met een activiteit tussen {from, date, short} en {to, date, short} + + acp_by_activity_type: + 'acp_containing_at_least_one_activitytypes': >- + Gefilterde trajecten: alleen die welke ten minste één activiteit bevatten van een van de volgende types: {activitytypes} + {has_date_after, select, 1 {, na {date_after, date}} other {}} + {has_date_before, select, 1 {, voor {date_before, date}} other {}} + describe_action_with_no_subject: >- + Gefilterd op persoon die een activiteit had tussen {date_from, date} en {date_to, date} + describe_action_with_subject: >- + Gefilterd op persoon die een activiteit had tussen {date_from, date} en {date_to, date}, en een van deze gekozen onderwerpen: {reasons} + +activity: + title: Activiteit van {date, date, long} - {type} diff --git a/src/Bundle/ChillActivityBundle/translations/messages.nl.yaml b/src/Bundle/ChillActivityBundle/translations/messages.nl.yaml index c7dc05f2b..9da8ffbd6 100644 --- a/src/Bundle/ChillActivityBundle/translations/messages.nl.yaml +++ b/src/Bundle/ChillActivityBundle/translations/messages.nl.yaml @@ -1,234 +1,500 @@ #general -Show the activity: Toon activiteit -Edit the activity: Wijzig activiteit -Activity: Activiteit +Show the activity: Uitwisseling bekijken +Edit the activity: Uitwisseling bewerken +Activity: Uitwisseling Duration time: Duur Duration Time: Duur -durationTime: duur -Travel time: Duur van verplaatsing -Attendee: Aanwezigheden -attendee: aanwezigheden -list_reasons: Onderwerpen -user_username: gebruikersnaam -circle_name: naam kring +durationTime: duur +Travel time: Reisduur +Attendee: Aanwezigheid van de gebruiker +attendee: aanwezigheid van de gebruiker +list_reasons: lijst van onderwerpen +user_username: naam van de gebruiker +circle_name: naam van de dienst Remark: Opmerking -No comments: Geen opmerkingen -Add a new activity: Voeg een nieuwe activiteit toe -Activity list: Lijst van activiteiten +No comments: Geen opmerking +Add a new activity: Nieuwe uitwisseling toevoegen +Activity list: Lijst van uitwisselingen present: aanwezig not present: afwezig Delete: Verwijderen Update: Bijwerken -Update activity: Activieit bijwerken -Scope: Werkingsgebied -Activity data: Gegevens activiteit -Activity location: Locatie activiteit +Update activity: Uitwisseling bewerken +Scope: Dienst +Activity data: Gegevens van de uitwisseling +Activity location: Locatie van de uitwisseling No reason associated: Geen onderwerp -No social issues associated: Geen sociaal vraagstuk -No social actions associated: Geen maatschappelijke actie -There isn't any activities.: Er zijn geen activiteiten -type_name: Soort activiteit +No social issues associated: Geen sociale problematiek +No social actions associated: Geen begeleidingsactie +There isn't any activities.: Geen uitwisseling geregistreerd. +type_name: type van de uitwisseling person_firstname: voornaam -person_lastname: familienaam -person_id: Identificatienummer persoon -Type: Soort +person_lastname: achternaam +person_id: identificatie van de gebruiker +Type: Type Invisible: Onzichtbaar Optional: Optioneel Required: Verplicht -Persons: Personen +Persons: Gebruikers Users: Gebruikers -Emergency: Dringend +Emergency: Urgent Sent received: Inkomend / Uitgaand Sent: Verzenden Received: Ontvangen by: 'Door ' location: Plaats Reasons: Onderwerpen +Private comment: Privé opmerking +sent: Verzonden +received: Ontvangen #forms -Activity creation: Nouvel échange -Create: Créer -Back to the list: Retour à la liste -Save activity: Sauver l'échange -Reset form: Remise à zéro du formulaire -Choose the duration: Choisir la durée -Choose a type: Choisir un type -5 minutes: 5 minutes -10 minutes: 10 minutes -15 minutes: 15 minutes -20 minutes: 20 minutes -25 minutes: 25 minutes -30 minutes: 30 minutes -45 minutes: 45 minutes -1 hour: 1 heure -1 hour 15: 1 heure 15 -1 hour 30: 1 heure 30 -1 hour 45: 1 heure 45 -2 hours: 2 heures -Concerned groups: Parties concernées -Persons in accompanying course: Usagers du parcours -Third persons: Tiers non-pro. -Others persons: Usagers -Third parties: Tiers professionnels +Activity creation: Nieuwe uitwisseling +Create: Aanmaken +Back to the list: Terug naar de lijst +Save activity: Uitwisseling opslaan +Reset form: Formulier resetten +Choose the duration: Duur kiezen +Choose a type: Type kiezen +5 minutes: 5 minuten +10 minutes: 10 minuten +15 minutes: 15 minuten +20 minutes: 20 minuten +25 minutes: 25 minuten +30 minutes: 30 minuten +45 minutes: 45 minuten +1 hour: 1 uur +1 hour 15: 1 uur 15 +1 hour 30: 1 uur 30 +1 hour 45: 1 uur 45 +2 hours: 2 uur +2 hours 15: 2 uur 15 +2 hours 30: 2 uur 30 +2 hours 45: 2 uur 45 +3 hours: 3 uur +3 hours 30: 3 uur 30 +4 hours: 4 uur +4 hours 30: 4 uur 30 +5 hours: 5 uur +5 hours 30: 5 uur 30 +6 hours: 6 uur +6 hours 30: 6 uur 30 +7 hours: 7 uur +7 hours 30: 7 uur 30 +8 hours: 8 uur +8 hours 30: 8 uur 30 +9 hours: 9 uur +9 hours 30: 9 uur 30 +10 hours: 10 uur +11 hours: 11 uur +12 hours: 12 uur +Concerned groups: Betrokken partijen bij de uitwisseling +Persons in accompanying course: Gebruikers van het traject +Third persons: Niet-prof. derden +Others persons: Gebruikers +Third parties: Professionele derden Users concerned: T(M)S + activity: - Insert a document: Insérer un document - Remove a document: Supprimer le document - comment: Commentaire -No documents: Aucun document + date: Datum van de uitwisseling + Insert a document: Document invoegen + Remove a document: Document verwijderen + comment: Opmerking + deleted: Uitwisseling verwijderd + + errors: Het formulier bevat fouten + social_issues: Sociale problematieken + choose_other_social_issue: Andere sociale problematiek toevoegen... + social_actions: Begeleidingsacties + select_first_a_social_issue: Selecteer eerst een sociale problematiek + social_action_list_empty: Geen sociale actie beschikbaar + add_persons: Betrokken personen toevoegen + bloc_persons: Gebruikers + bloc_persons_associated: Gebruikers van het traject + bloc_persons_not_associated: Niet-prof. derden + bloc_thirdparty: Professionele derden + bloc_users: T(M)S + location: Locatie + choose_location: Kies een locatie + choose_location_type: Kies een type locatie + create_new_location: Nieuwe locatie aanmaken + location_fields: + name: Naam + type: Type + phonenumber1: Telefoon + phonenumber2: Andere telefoon + email: E-mailadres + create_address: Adres aanmaken + edit_address: Adres bewerken + +No documents: Geen document + +# activity filter in list page +activity_filter: + My activities: Mijn uitwisselingen (waar ik aan deelneem) + Types: Op type uitwisseling + Jobs: Op betrokken beroep #timeline -'%user% has done an %activity_type%': '%user% a effectué un échange de type "%activity_type%"' +'%user% has done an %activity_type%': '%user% heeft een uitwisseling van type "%activity_type%" uitgevoerd' #controller -'Success : activity created!': L'échange a été créé. -'The form is not valid. The activity has not been created !': Le formulaire est invalide. L'échange n'a pas été créé. -'Success : activity updated!': L'échange a été mis à jour. -'The form is not valid. The activity has not been updated !': Le formulaire est invalide. L'échange n'a pas été mis à jour. +'Success : activity created!': De uitwisseling is aangemaakt. +'The form is not valid. The activity has not been created !': Het formulier is ongeldig. De uitwisseling is niet aangemaakt. +'Success : activity updated!': De uitwisseling is bijgewerkt. +'The form is not valid. The activity has not been updated !': Het formulier is ongeldig. De uitwisseling is niet bijgewerkt. # ROLES -CHILL_ACTIVITY_CREATE: Créer un échange -CHILL_ACTIVITY_UPDATE: Modifier un échange -CHILL_ACTIVITY_SEE: Voir un échange -CHILL_ACTIVITY_SEE_DETAILS: Voir le détail des échanges -CHILL_ACTIVITY_DELETE: Supprimer un échange -CHILL_ACTIVITY_STATS: Statistique des échanges -CHILL_ACTIVITY_LIST: Liste des échanges +CHILL_ACTIVITY_CREATE: Uitwisseling aanmaken +CHILL_ACTIVITY_UPDATE: Uitwisseling bewerken +CHILL_ACTIVITY_SEE: Uitwisseling bekijken +CHILL_ACTIVITY_SEE_DETAILS: Detail van uitwisselingen bekijken +CHILL_ACTIVITY_DELETE: Uitwisseling verwijderen +CHILL_ACTIVITY_STATS: Statistieken van uitwisselingen +CHILL_ACTIVITY_LIST: Lijst van uitwisselingen +CHILL_ACTIVITY_CREATE_PERSON: Uitwisseling aanmaken gekoppeld aan een gebruiker +CHILL_ACTIVITY_CREATE_ACCOMPANYING_COURSE: Uitwisseling aanmaken gekoppeld aan een traject +CHILL_ACTIVITY_FULL: Details bekijken, aanmaken, verwijderen en bijwerken van een uitwisseling # admin -Activities: Échanges -Activity configuration: Configuration des échanges -Activity configuration menu: Configuration des échanges -Activity types: Types d'échange -Activity type configuration: Configuration des categories d'échanges -Activity Reasons: Sujets d'un échange -Activity Reasons Category: Catégories de sujet d'échanges -Activity Types Categories: Catégories des types d'échanges -Activity Presences: Presences des échanges +Activities: Uitwisselingen +Activity configuration: Configuratie van uitwisselingen +Activity configuration menu: Configuratie van uitwisselingen +Activity types: Types uitwisseling +Activity type configuration: Configuratie van categorieën van uitwisselingen +Activity Reasons: Onderwerpen van een uitwisseling +Activity Reasons Category: Categorieën van onderwerpen van uitwisselingen +Activity Types Categories: Categorieën van types uitwisseling +Activity Presences: Aanwezigheden bij uitwisselingen +Associated activity reason category is inactive: De gekoppelde onderwerpscategorie is inactief # Crud crud: - activity_type: - title_new: Nouveau type d'échange - title_edit: Edition d'un type d'échange - activity_type_category: - title_new: Nouvelle catégorie de type d'échange - title_edit: Edition d'une catégorie de type d'échange + activity_type: + title_new: Nieuw type uitwisseling + title_edit: Type uitwisseling bewerken + activity_type_category: + title_new: Nieuwe categorie van type uitwisseling + title_edit: Categorie van type uitwisseling bewerken + activity_presence: + title_new: Nieuwe aanwezigheid bij uitwisselingen + title_edit: Aanwezigheid bij uitwisselingen bewerken # activity reason admin -ActivityReason list: Liste des sujets -Create a new activity reason: Créer un nouveau sujet -Active: Actif -Category: Catégorie -ActivityReason creation: Nouveau sujet -ActivityReason edit: Modification d'un sujet -ActivityReason: Sujet d'échange -The entity is inactive and won't be proposed: Le sujet est inactif et ne sera pas proposé -The entity is active and will be proposed: Le sujet est actif et sera proposé +ActivityReason list: Lijst van onderwerpen +Create a new activity reason: Nieuw onderwerp aanmaken +Active: Actief +Category: Categorie +ActivityReason creation: Nieuw onderwerp +ActivityReason edit: Onderwerp bewerken +ActivityReason: Onderwerp van uitwisseling +The entity is inactive and won't be proposed: Het onderwerp is inactief en zal niet worden voorgesteld +The entity is active and will be proposed: Het onderwerp is actief en zal worden voorgesteld #activity reason category admin -ActivityReasonCategory list: Catégories de sujets -Create a new activity category reason: Créer une nouvelle catégorie -ActivityReasonCategory creation: Nouvelle catégorie de sujet -ActivityReasonCategory edit: Modification d'une catégorie de sujet -ActivityReasonCategory: Catégorie de sujet d'échange -ActivityReasonCategory is active and will be proposed: La catégorie est active et sera proposée -ActivityReasonCategory is inactive and won't be proposed: La catégorie est inactive et ne sera pas proposée +ActivityReasonCategory list: Categorieën van onderwerpen +Create a new activity category reason: Nieuwe categorie aanmaken +ActivityReasonCategory creation: Nieuwe categorie van onderwerp +ActivityReasonCategory edit: Categorie van onderwerp bewerken +ActivityReasonCategory: Categorie van onderwerp van uitwisseling +ActivityReasonCategory is active and will be proposed: De categorie is actief en zal worden voorgesteld +ActivityReasonCategory is inactive and won't be proposed: De categorie is inactief en zal niet worden voorgesteld + +#activity presence admin +ActivityPresence list: Lijst van aanwezigheden bij uitwisselingen +Create a new activity presence: Nieuwe "Aanwezigheid bij uitwisselingen" aanmaken # activity type type admin -ActivityType list: Types d'échanges -Create a new activity type: Créer un nouveau type d'échange -Persons visible: Visibilité du champ Personnes -Persons label: Libellé du champ Personnes -User visible: Visibilité du champ Utilisateur -User label: Libellé du champ Utilisateur -Date visible: Visibilité du champ Date -Date label: Libellé du champ Date -Location visible: Visibilité du champ Lieu -Location label: Libellé du champ Lieu -Third parties visible: Visibilité du champ Tiers -Third parties label: Libellé du champ Tiers -Duration time visible: Visibilité du champ Durée -Duration time label: Libellé du champ Durée -Travel time visible: Visibilité du champ Durée de déplacement -Travel time label: Libellé du champ Durée de déplacement -Attendee visible: Visibilité du champ Présence de l'usager -Attendee label: Libellé du champ Présence de l'usager -Reasons visible: Visibilité du champ Sujet -Reasons label: Libellé du champ Sujet -Comment visible: Visibilité du champ Commentaire -Comment label: Libellé du champ Commentaire -Emergency visible: Visibilité du champ Urgent -Emergency label: Libellé du champ Urgent -Accompanying period visible: Visibilité du champ Période d'accompagnement -Accompanying period label: Libellé du champ Période d'accompagnement -Social issues visible: Visibilité du champ Problématiques sociales -Social issues label: Libellé du champ Problématiques sociales -Social actions visible: Visibilité du champ Action sociale -Social actions label: Libellé du champ Action sociale -Users visible: Visibilité du champ Utilisateurs -Users label: Libellé du champ Utilisateurs -Sent received visible: Visibilité du champ Entrant / Sortant -Sent received label: Libellé du champ Entrant / Sortant -Documents visible: Visibilité du champ Documents -Documents label: Libellé du champ Documents +ActivityType list: Types uitwisselingen +Create a new activity type: Nieuw type uitwisseling aanmaken +Persons visible: Zichtbaarheid van het veld Gebruikers +Persons label: Label van het veld Gebruikers +User visible: Zichtbaarheid van het veld Gebruiker +User label: Label van het veld Gebruiker +Date visible: Zichtbaarheid van het veld Datum +Date label: Label van het veld Datum +Location visible: Zichtbaarheid van het veld Plaats +Location label: Label van het veld Plaats +Third parties visible: Zichtbaarheid van het veld Derden +Third parties label: Label van het veld Derden +Duration time visible: Zichtbaarheid van het veld Duur +Duration time label: Label van het veld Duur +Travel time visible: Zichtbaarheid van het veld Reisduur +Travel time label: Label van het veld Reisduur +Attendee visible: Zichtbaarheid van het veld Aanwezigheid van de gebruiker +Attendee label: Label van het veld Aanwezigheid van de gebruiker +Reasons visible: Zichtbaarheid van het veld Onderwerp +Reasons label: Label van het veld Onderwerp +Comment visible: Zichtbaarheid van het veld Opmerking +Comment label: Label van het veld Opmerking +Private comment visible: Zichtbaarheid van het veld Privé Opmerking +Private comment label: Label van het veld Privé Opmerking +Emergency visible: Zichtbaarheid van het veld Urgent +Emergency label: Label van het veld Urgent +Accompanying period visible: Zichtbaarheid van het veld begeleidingstraject +Accompanying period label: Label van het veld begeleidingstraject +Social issues visible: Zichtbaarheid van het veld Sociale problematieken +Social issues label: Label van het veld Sociale problematieken +Social actions visible: Zichtbaarheid van het veld Sociale actie +Social actions label: Label van het veld Sociale actie +Users visible: Zichtbaarheid van het veld Gebruikers +Users label: Label van het veld Gebruikers +Sent received visible: Zichtbaarheid van het veld Inkomend / Uitgaand +Sent received label: Label van het veld Inkomend / Uitgaand +Documents visible: Zichtbaarheid van het veld Documenten +Documents label: Label van het veld Documenten # activity type category admin -ActivityTypeCategory list: Liste des catégories des types d'activité -Create a new activity type category: Créer une nouvelle catégorie de type d'échange +ActivityTypeCategory list: Lijst van categorieën van types uitwisseling +Create a new activity type category: Nieuwe categorie van type uitwisseling aanmaken +Create a new activity in accompanying course: Uitwisseling aanmaken in het traject # activity delete -Remove activity: Supprimer un échange -Are you sure you want to remove the activity about "%name%" ?: Êtes-vous sûr de vouloir supprimer un échange qui concerne "%name%" ? -The activity has been successfully removed.: L'échange a été supprimée. +Remove activity: Uitwisseling verwijderen +Are you sure you want to remove the activity about "%name%" ?: Weet u zeker dat u een uitwisseling wilt verwijderen die betrekking heeft op "%name%"? +The activity has been successfully removed.: De uitwisseling is verwijderd. # exports -Count activities: Nombre d'échanges -Count activities by various parameters.: Compte le nombre d'échanges enregistrées en fonction de différents paramètres. -Sum activity duration: Total de la durée des échanges -Sum activities duration by various parameters.: Additionne la durée des échanges en fonction de différents paramètres. -List activities: Liste les échanges -Number of activities: Nombre d'échanges +Exports of activities linked to a person: Exports van uitwisselingen gekoppeld aan een gebruiker +Number of activities linked to a person: Aantal uitwisselingen gekoppeld aan een gebruiker +Count activities linked to a person: Aantal uitwisselingen +Count activities linked to a person by various parameters.: Telt het aantal geregistreerde uitwisselingen gekoppeld aan een gebruiker op basis van verschillende parameters. +Sum activity linked to a person duration: Duur van uitwisselingen +Sum activities linked to a person duration: Duur van uitwisselingen gekoppeld aan een gebruiker +Sum activities linked to a person duration by various parameters.: Telt de duur van uitwisselingen op basis van verschillende parameters. +List activity linked to a person: Uitwisselingen opsommen +List activities linked to a person: Lijst van uitwisselingen gekoppeld aan een gebruiker +List activities linked to a person description: Maakt de lijst van uitwisselingen op basis van verschillende parameters. + +Exports of activities linked to an accompanying period: Exports van uitwisselingen gekoppeld aan een traject +Number of activities linked to an accompanying period: Aantal uitwisselingen gekoppeld aan een traject +Count activities linked to an accompanying period: Aantal uitwisselingen +Count activities linked to an accompanying period by various parameters.: Telt het aantal geregistreerde uitwisselingen gekoppeld aan een traject op basis van verschillende parameters. +Sum activity linked to an accompanying period duration: Som van de duur van uitwisselingen +Sum activities linked to an accompanying period duration: Som van de duur van uitwisselingen gekoppeld aan een traject +Sum activities linked to an accompanying period duration by various parameters.: Telt de duur van uitwisselingen op basis van verschillende parameters. +Sum activity linked to an accompanying period visit duration: Som van de reisduur van uitwisselingen +Sum activities linked to an accompanying period visit duration: Som van de reisduur van uitwisselingen gekoppeld aan een traject +Sum activities linked to an accompanying period visit duration by various parameters.: Telt de reisduur van uitwisselingen op basis van verschillende parameters. +Average activity linked to an accompanying period duration: Gemiddelde van de duur van uitwisselingen +Average activities linked to an accompanying period duration: Gemiddelde van de duur van uitwisselingen gekoppeld aan een traject +Average activities linked to an accompanying period duration by various parameters.: Gemiddelde van de duur van uitwisselingen op basis van verschillende parameters. +Average activity linked to an accompanying period visit duration: Gemiddelde van de reisduur van uitwisselingen +Average activities linked to an accompanying period visit duration: Gemiddelde van de reisduur van uitwisselingen gekoppeld aan een traject +Average activities linked to an accompanying period visit duration by various parameters.: Gemiddelde van de reisduur van uitwisselingen op basis van verschillende parameters. #filters -Filter by reason: Filtrer par sujet d'activité -'Filtered by reasons: only %list%': 'Filtré par sujet: seulement %list%' -'Filtered by activity type: only %list%': "Filtré par type d'activity: uniquement %list%" -Filtered by date activity: Filtrer par date d'activité -Activities after this date: Activités après cette date -Activities before this date: Activités avant cette date -"Filtered by date of activity: only between %date_from% and %date_to%": "Filtré par date de l'activité: uniquement entre %date_from% et %date_to%" -This date should be after the date given in "Implied in an activity after this date" field: Cette date devrait être postérieure à la date donnée dans le champ "activités après cette date" +Filter by reason: Uitwisselingen filteren op onderwerp +'Filtered by reasons: only %list%': 'Gefilterd op onderwerp: alleen %list%' +'Filtered by activity type: only %list%': "Gefilterd op type uitwisseling: alleen %list%" +Filtered by date activity: Uitwisselingen filteren op datum +Activities after this date: Uitwisselingen na deze datum +Activities before this date: Uitwisselingen vóór deze datum +"Filtered by date of activity: only between %date_from% and %date_to%": "Gefilterd op datum van de uitwisseling: alleen tussen %date_from% en %date_to%" +This date should be after the date given in "Implied in an activity after this date" field: Deze datum moet later zijn dan de datum in het veld "uitwisselingen na deze datum" -Filtered by person having an activity in a period: Uniquement les personnes ayant eu une activité dans la période donnée -Implied in an activity after this date: Impliqué dans une activité après cette date -Implied in an activity before this date: Impliqué dans une activité avant cette date -Filtered by person having an activity between %date_from% and %date_to% with reasons %reasons_name%: Filtré par personnes associées à une activité entre %date_from% et %date_to% avec les sujets %reasons_name% -Activity reasons for those activities: Sujets de ces activités -Filter by activity type: Filtrer par type d'activité +Filter by activity type: Uitwisselingen filteren op type + +Filter activity by location: Uitwisselingen filteren op locatie +'Filtered activity by location: only %locations%': "Gefilterd op locatie: alleen %locations%" +Filter activity by locationtype: Uitwisselingen filteren op type locatie +'Filtered activity by locationtype: only %types%': "Gefilterd op type locatie: alleen %types%" +Accepted locationtype: Types locatie +Accepted users: TMS(en) +Filter activity by emergency: Uitwisselingen filteren op urgentie +'Filtered activity by emergency: only %emergency%': "Gefilterd op urgentie: alleen als %emergency%" +activity is emergency: de uitwisseling is urgent +activity is not emergency: de uitwisseling is niet urgent +Filter activity by sentreceived: Uitwisselingen filteren op verzonden/ontvangen +'Filtered activity by sentreceived: only %sentreceived%': "Gefilterd op verzonden/ontvangen: alleen %sentreceived%" +Accepted sentreceived: '' +Filter activity by linked socialaction: Uitwisselingen filteren op gekoppelde actie +'Filtered activity by linked socialaction: only %actions%': "Gefilterd op gekoppelde actie: alleen %actions%" +Filter activity by linked socialissue: Uitwisselingen filteren op gekoppelde problematiek +'Filtered activity by linked socialissue: only %issues%': "Gefilterd op gekoppelde problematiek: alleen %issues%" +Filter activity by user: Uitwisselingen filteren op hoofdgebruiker +Filter activity by users: Uitwisselingen filteren op deelnemende gebruiker +Filter activity by creator: Uitwisselingen filteren op aanmaker van de uitwisseling +'Filtered activity by user: only %users%': "Gefilterd op referent: alleen %users%" +'Filtered activity by users: only %users%': "Gefilterd op deelnemende gebruikers: alleen %users%" +'Filtered activity by creator: only %users%': "Gefilterd op aanmaker: alleen %users%" +Creators: Aanmakers +Accepted userscope: Diensten + +Filter acp which has no activity: Trajecten filteren die geen uitwisseling hebben +Filtered acp which has no activities: Trajecten zonder gekoppelde uitwisseling filteren +Group acp by activity number: Trajecten groeperen op aantal uitwisselingen #aggregators -Activity type: Type d'activité -Activity user: Utilisateur lié à l'activity -By reason: Par sujet -By category of reason: Par catégorie de sujet -Reason's level: Niveau du sujet -Group by reasons: Sujet d'activité -Aggregate by activity user: Grouper par utilisateur lié à l'activité -Aggregate by activity type: Grouper par type d'activité -Aggregate by activity reason: Grouper par sujet de l'activité +Activity type: Type uitwisseling +Activity user: Gebruiker gekoppeld aan de uitwisseling +By reason: Op onderwerp +By category of reason: Op categorie van onderwerp +Reason's level: Niveau van het onderwerp +Group by reasons: Onderwerp van uitwisseling +Aggregate by activity user: Uitwisselingen groeperen op referent +Aggregate by activity users: Uitwisselingen groeperen op deelnemende gebruikers +Aggregate by activity type: Uitwisselingen groeperen op type +Aggregate by activity reason: Uitwisselingen groeperen op onderwerp -Last activities: Les dernières activités +Group activity by locationtype: Uitwisselingen groeperen op type locatie +Group activity by date: Uitwisselingen groeperen op datum +Frequency: Frequentie +by month: Per maand +by week: Per week +for week: Week +by year: Per jaar +in year: In +Group activity by creator: Uitwisselingen groeperen op aanmaker van de uitwisseling +Group activity by linked thirdparties: Uitwisselingen groeperen op betrokken derde +Accepted thirdparty: Betrokken derde +Group activity by linked socialaction: Uitwisselingen groeperen op gekoppelde actie +Group activity by linked socialissue: Uitwisselingen groeperen op gekoppelde problematiek +Group activity by userscope: Uitwisselingen groeperen op dienst van de aanmaker -See activity in accompanying course context: Voir l'activité dans le contexte du parcours d'accompagnement +Last activities: De laatste uitwisselingen -You get notified of an activity which does not exists any more: Cette notification ne correspond pas à une activité valide. -you are not allowed to see it details: La notification fait référence à une activité à laquelle vous n'avez pas accès. -This is the minimal activity data: Activité n° +See activity in accompanying course context: Uitwisseling bekijken in de context van het begeleidingstraject + +You get notified of an activity which does not exists any more: Deze melding komt niet overeen met een geldige uitwisseling. +you are not allowed to see it details: De melding verwijst naar een uitwisseling waartoe u geen toegang hebt. +This is the minimal activity data: Uitwisseling nr. docgen: - Activity basic: Echange - A basic context for activity: Contexte pour les activités + Activity basic: Uitwisseling + A basic context for activity: Context voor uitwisselingen + Accompanying period with a list of activities: Begeleidingstraject met lijst van uitwisselingen + Accompanying period with a list of activities description: Deze context neemt de informatie van het traject over, en alle uitwisselingen voor een traject. De uitwisselingen worden niet gefilterd. + myActivitiesOnly: Alleen rekening houden met uitwisselingen waarin ik heb deelgenomen + myWorksOnly: Alleen rekening houden met begeleidingsacties waarvan ik referent ben + +export: + export: + count_person_on_activity: + title: Aantal betrokken gebruikers bij uitwisselingen + description: Telt het aantal betrokken gebruikers bij uitwisselingen. Als een gebruiker aanwezig is in meerdere uitwisselingen, wordt hij slechts één keer geteld. + header: Aantal betrokken gebruikers bij uitwisselingen + count_household_on_activity: + title: Aantal betrokken huishoudens bij uitwisselingen + description: Telt het aantal betrokken huishoudens bij uitwisselingen. Als een huishouden aanwezig is in meerdere uitwisselingen, wordt het slechts één keer geteld. Gebruikers zonder huishouden worden niet geteld. + header: Aantal betrokken huishoudens bij uitwisselingen + count_household_on_activity_person: + title: Aantal betrokken huishoudens bij uitwisselingen + description: Telt het aantal betrokken huishoudens bij uitwisselingen. Als een huishouden aanwezig is in meerdere uitwisselingen, wordt het slechts één keer geteld. Gebruikers zonder huishouden worden niet geteld. Wanneer een gebruiker van huishouden verandert, wordt elk huishouden één keer geteld. + header: Aantal betrokken huishoudens bij uitwisselingen + list: + activity: + users name: Naam van de gebruikers + users ids: Identificatie van de gebruikers + third parties ids: Identificatie van de derden + persons ids: Identificatie van de gebruikers + persons name: Naam van de gebruikers + thirds parties: Derden + date: Datum van de uitwisseling + locationName: Locatie + sent received: Verzonden of ontvangen + emergency: Urgentie + accompanying course id: Identificatie van het traject + course circles: Diensten van het traject + travelTime: Reisduur + durationTime: Duur + id: Identificatie + List activities linked to an accompanying course: Somt uitwisselingen op gekoppeld aan een traject op basis van verschillende filters. + List activity linked to a course: Lijst van uitwisselingen gekoppeld aan een traject + commentText: Opmerking + comment_date: Datum van de laatste bewerking van de opmerking + comment_user: Laatste bewerking door + + filter: + activity: + by_users_job: + Filter by users job: Uitwisselingen filteren op beroep van ten minste één deelnemende gebruiker + 'Filtered activity by users job: only %jobs%': 'Gefilterd op beroep van ten minste één deelnemende gebruiker: alleen %jobs%' + by_users_scope: + Filter by users scope: Uitwisselingen filteren op dienst van ten minste één deelnemende gebruiker + 'Filtered activity by users scope: only %scopes%': 'Gefilterd op dienst van ten minste één deelnemende gebruiker: alleen %scopes%' + course_having_activity_between_date: + Title: Trajecten filteren die een uitwisseling hebben ontvangen tussen twee data + Receiving an activity after: Die een uitwisseling hebben ontvangen na + Receiving an activity before: Die een uitwisseling hebben ontvangen vóór + acp_by_activity_type: + 'activity after': Uitwisselingen na + activity after help: Indien leeg gelaten, wordt er geen rekening mee gehouden + activity before: Uitwisselingen vóór + activity before help: Indien leeg gelaten, wordt er geen rekening mee gehouden + person_between_dates: + Implied in an activity after this date: Betrokken bij een uitwisseling na deze datum + Implied in an activity before this date: Betrokken bij een uitwisseling vóór deze datum + Activity reasons for those activities: Onderwerpen van deze uitwisselingen + if no reasons: Als geen enkel onderwerp is aangevinkt, worden alle onderwerpen in aanmerking genomen + title: Gebruikers filteren die gekoppeld zijn geweest aan een uitwisseling tijdens de periode + date mismatch: De einddatum van de periode moet later zijn dan de startdatum + by_creator_scope: + Filter activity by user scope: Uitwisselingen filteren op dienst van de aanmaker van de uitwisseling + 'Filtered activity by user scope: only %scopes%': "Gefilterd op dienst van de aanmaker van de uitwisseling: alleen %scopes%" + by_creator_job: + job_form_label: Beroepen + Filter activity by user job: Uitwisselingen filteren op beroep van de aanmaker van de uitwisseling + 'Filtered activity by user job: only %jobs%': "Gefilterd op beroep van de aanmaker van de uitwisseling: alleen %jobs%" + by_persons: + Filter activity by persons: Uitwisselingen filteren op deelnemende gebruiker + 'Filtered activity by persons: only %persons%': 'Uitwisselingen gefilterd op deelnemende gebruikers: alleen %persons%' + persons taking part on the activity: Gebruikers deelnemend aan de uitwisseling + by_sent_received: + Sent or received: Verzonden of ontvangen + is sent: verzonden + is received: ontvangen + by_presence: + Filter activity by activity presence: Uitwisselingen filteren op aanwezigheid van de gebruiker + presences: Aanwezigheden + 'Filtered by activity presence: only %presences%': 'Gefilterd op aanwezigheid van de gebruiker: alleen %presences%' + + aggregator: + person: + by_person: + title: Uitwisselingen groeperen op gebruiker (gebruikersdossier waarin de uitwisseling is geregistreerd) + person: Gebruiker + by_household: + title: Uitwisselingen groeperen op huishouden + household: Identificatie huishouden + acp: + by_activity_type: + title: Trajecten groeperen op type uitwisseling + after_date: Alleen uitwisselingen na deze datum + before_date: Alleen uitwisselingen vóór deze datum + activity_type: Types uitwisseling + activity: + by_sent_received: + Sent or received: Verzonden of ontvangen + is sent: verzonden + is received: ontvangen + Group activity by sentreceived: Uitwisselingen groeperen op verzonden / ontvangen + by_location: + Activity Location: Locatie van de uitwisseling + Title: Uitwisselingen groeperen op locatie van de uitwisseling + by_user_job: + Users 's job: Beroep van de gebruikers deelnemend aan de uitwisseling + Aggregate by users job: Uitwisselingen groeperen op beroep van de deelnemende gebruikers + by_user_scope: + Users 's scope: Hoofddienst van de gebruikers deelnemend aan de uitwisseling + Aggregate by users scope: Uitwisselingen groeperen op hoofddienst van de gebruiker + by_creator_scope: + Group activity by creator scope: Uitwisselingen groeperen op dienst van de aanmaker van de uitwisseling + Calc date: Berekeningsdatum van de dienst van de aanmaker van de uitwisseling + by_creator_job: + Group activity by creator job: Uitwisselingen groeperen op beroep van de aanmaker van de uitwisseling + Calc date: Berekeningsdatum van het beroep van de aanmaker van de uitwisseling + by_persons: + Group activity by persons: Uitwisselingen groeperen op deelnemende gebruiker + Persons: Deelnemende gebruikers + by_activity_presence: + Group activity by presence: Uitwisselingen groeperen op aanwezigheid van de gebruiker + header: Aanwezigheid van gebruiker(s) + +generic_doc: + filter: + keys: + accompanying_period_activity_document: Document van uitwisselingen van trajecten diff --git a/src/Bundle/ChillAsideActivityBundle/src/translations/messages.nl.yaml b/src/Bundle/ChillAsideActivityBundle/src/translations/messages.nl.yaml index cae3cd059..14d1182be 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/translations/messages.nl.yaml +++ b/src/Bundle/ChillAsideActivityBundle/src/translations/messages.nl.yaml @@ -165,3 +165,60 @@ Phonecall: "Telefoon oproep" Aside activities: Nevenactiviteiten Aside activity types: Types nevenactiviteiten Aside activity type configuration: Configuratie categorieën nevenactiviteiten + +# exports +export: + aside_activity: + List of aside activities: Lijst van nevenactiviteiten + createdAt: Aanmaak + updatedAt: Laatste update + agent_id: Gebruiker + creator_id: Aanmaker + main_scope: Hoofddienst van de gebruiker + main_center: Hoofdterritorium van de gebruiker + aside_activity_type: Categorie nevenactiviteit + date: Datum + duration: Duur + note: Notitie + id: Identificatie + location: Locatie + + Exports of aside activities: Exports van nevenactiviteiten + Count aside activities: Aantal nevenactiviteiten + Count aside activities by various parameters.: Telt het aantal nevenactiviteiten volgens diverse criteria + Average aside activities duration: Gemiddelde duur van nevenactiviteiten + Sum aside activities duration: Duur van nevenactiviteiten + Sum concerned persons count for aside activities: Aantal betrokken gebruikers bij nevenactiviteiten + filter: + Filter by aside activity date: Nevenactiviteiten filteren op datum + Filter by aside activity type: Nevenactiviteiten filteren op type activiteit + 'Filtered by aside activity type: only %type%': "Gefilterd op type nevenactiviteit: alleen %type%" + Filtered by aside activities between %dateFrom% and %dateTo%: Gefilterd op datum van nevenactiviteit, tussen %dateFrom% en %dateTo% + This date should be after the date given in "Implied in an aside activity after this date" field: Deze datum moet later zijn dan de datum in het veld "nevenactiviteiten na deze datum" + Aside activities after this date: Nevenactiviteiten na deze datum + Aside activities before this date: Nevenactiviteiten vóór deze datum + 'Filtered aside activity by user: only %users%': "Gefilterd op gebruiker: alleen %users%" + Filter aside activity by user: Filteren op gebruiker + by_user_job: + 'Filtered aside activities by user jobs: only %jobs%': "Gefilterd op beroep van gebruikers: alleen %jobs%" + Filter by user jobs: Nevenactiviteiten filteren op beroep van gebruikers + by_user_scope: + 'Filtered aside activities by user scope: only %scopes%': "Gefilterd op dienst van gebruikers: alleen %scopes%" + Filter by user scope: Nevenactiviteiten filteren op dienst van gebruiker + Filter by aside activity location: Nevenactiviteiten filteren op locatie + 'Filtered by aside activity location: only %location%': "Gefilterd op locatie: alleen %location%" + aggregator: + Group by aside activity type: Nevenactiviteiten groeperen op type activiteit + Group by concerned persons count: Nevenactiviteiten groeperen op aantal betrokken gebruikers + Concerned persons count: Aantal betrokken gebruikers + Aside activity type: Type nevenactiviteit + by_user_job: + Aggregate by user job: Nevenactiviteiten groeperen op beroep van gebruikers + by_user_scope: + Aggregate by user scope: Nevenactiviteiten groeperen op dienst van gebruikers + Aside activity location: Locatie van nevenactiviteiten + Group by aside activity location: Nevenactiviteiten groeperen op locatie + Aside activity localisation: Locatie + +# ROLES +CHILL_ASIDE_ACTIVITY_STATS: Statistieken voor nevenactiviteiten diff --git a/src/Bundle/ChillBudgetBundle/translations/messages.nl.yml b/src/Bundle/ChillBudgetBundle/translations/messages.nl.yml index de334f79f..113492864 100644 --- a/src/Bundle/ChillBudgetBundle/translations/messages.nl.yml +++ b/src/Bundle/ChillBudgetBundle/translations/messages.nl.yml @@ -74,3 +74,42 @@ The balance: Verschil tussen inkomsten en onkosten Valid since %startDate% until %endDate%: Geldig sinds %startDate% tot %endDate% Valid since %startDate%: Geldig sinds %startDate% + +budget: + admin: + form: + Charge_kind_key: Identificatiesleutel + Resource_kind_key: Identificatiesleutel + This kind must contains only alphabeticals characters, and dashes. This string is in use during document generation. Changes may have side effect on document: Deze sleutel dient om het type last of inkomen te identificeren bij het genereren van documenten. Alleen alfanumerieke tekens zijn toegestaan. Het wijzigen van deze sleutel kan een effect hebben bij het genereren van nieuwe documenten. + +# ROLES +Budget elements: Budget +CHILL_BUDGET_ELEMENT_CREATE: Inkomsten/last aanmaken +CHILL_BUDGET_ELEMENT_DELETE: Inkomsten/last verwijderen +CHILL_BUDGET_ELEMENT_SEE: Inkomstenen/lasten bekijken +CHILL_BUDGET_ELEMENT_UPDATE: Inkomsten/last bewerken + +## admin + +crud: + resource_kind: + title_new: Nieuw type inkomsten + title_edit: Type inkomsten bewerken + charge_kind: + title_new: Nieuw type last + title_edit: Type last bewerken + +admin: + menu: + Resource types: Types inkomsten + Charge types: Types last + title: + Charge Type List: Lijst van types last + Resource Type List: Lijst van types inkomsten + Budget configuration: Configuratie van budgetelementen + new: + Create a new charge type: Nieuw type last aanmaken + Create a new resource type: Nieuw type inkomsten aanmaken + form: + Choose the type of resource: Kies een type inkomsten + Choose the type of charge: Kies een type last diff --git a/src/Bundle/ChillBudgetBundle/translations/validators.nl.yml b/src/Bundle/ChillBudgetBundle/translations/validators.nl.yml index 7281b6380..fa308eb67 100644 --- a/src/Bundle/ChillBudgetBundle/translations/validators.nl.yml +++ b/src/Bundle/ChillBudgetBundle/translations/validators.nl.yml @@ -1,2 +1,8 @@ -The amount cannot be empty: Le montant ne peut pas être vide ou égal à zéro -The budget element's end date must be after the start date: La date de fin doit être après la date de début \ No newline at end of file +The amount cannot be empty: Het bedrag mag niet nul of leeg zijn +The budget element's end date must be after the start date: De einddatum moet later vallen dan de begindatum + +budget: + admin: + form: + kind: + enkel_alphanumeriek diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php index eb5812b4d..d3919d3a3 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\CalendarBundle\Controller; use Chill\CalendarBundle\Repository\CalendarRepository; +use Chill\CalendarBundle\Repository\InviteRepository; use Chill\MainBundle\CRUD\Controller\ApiController; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Serializer\Model\Collection; @@ -23,7 +24,10 @@ use Symfony\Component\Routing\Annotation\Route; class CalendarAPIController extends ApiController { - public function __construct(private readonly CalendarRepository $calendarRepository) {} + public function __construct( + private readonly CalendarRepository $calendarRepository, + private readonly InviteRepository $inviteRepository, + ) {} #[Route(path: '/api/1.0/calendar/calendar/by-user/{id}.{_format}', name: 'chill_api_single_calendar_list_by-user', requirements: ['_format' => 'json'])] public function listByUser(User $user, Request $request, string $_format): JsonResponse @@ -52,16 +56,37 @@ class CalendarAPIController extends ApiController throw new BadRequestHttpException('dateTo not parsable'); } - $total = $this->calendarRepository->countByUser($user, $dateFrom, $dateTo); - $paginator = $this->getPaginatorFactory()->create($total); - $ranges = $this->calendarRepository->findByUser( + // Get calendar items where user is the main user + $ownCalendars = $this->calendarRepository->findByUser( $user, $dateFrom, - $dateTo, - $paginator->getItemsPerPage(), - $paginator->getCurrentPageFirstItemNumber() + $dateTo ); + // Get calendar items from accepted invites + $acceptedInvites = $this->inviteRepository->findAcceptedInvitesByUserAndDateRange($user, $dateFrom, $dateTo); + $inviteCalendars = array_map(fn ($invite) => $invite->getCalendar(), $acceptedInvites); + + // Merge + $allCalendars = array_merge($ownCalendars, $inviteCalendars); + $uniqueCalendars = []; + $seenIds = []; + + foreach ($allCalendars as $calendar) { + $id = $calendar->getId(); + if (!in_array($id, $seenIds, true)) { + $seenIds[] = $id; + $uniqueCalendars[] = $calendar; + } + } + + $total = count($uniqueCalendars); + $paginator = $this->getPaginatorFactory()->create($total); + + $offset = $paginator->getCurrentPageFirstItemNumber(); + $limit = $paginator->getItemsPerPage(); + $ranges = array_slice($uniqueCalendars, $offset, $limit); + $collection = new Collection($ranges, $paginator); return $this->json($collection, Response::HTTP_OK, [], ['groups' => ['calendar:light']]); diff --git a/src/Bundle/ChillCalendarBundle/DependencyInjection/ChillCalendarExtension.php b/src/Bundle/ChillCalendarBundle/DependencyInjection/ChillCalendarExtension.php index 5aa8d8507..1e37a7ebc 100644 --- a/src/Bundle/ChillCalendarBundle/DependencyInjection/ChillCalendarExtension.php +++ b/src/Bundle/ChillCalendarBundle/DependencyInjection/ChillCalendarExtension.php @@ -47,6 +47,8 @@ class ChillCalendarExtension extends Extension implements PrependExtensionInterf } else { $container->setParameter('chill_calendar.short_messages', null); } + + $container->setParameter('chill_calendar.remote_calendar_dsn', $config['remote_calendar_dsn']); } public function prepend(ContainerBuilder $container) diff --git a/src/Bundle/ChillCalendarBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillCalendarBundle/DependencyInjection/Configuration.php index a3e4ae391..e4ca96ca2 100644 --- a/src/Bundle/ChillCalendarBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillCalendarBundle/DependencyInjection/Configuration.php @@ -32,9 +32,10 @@ class Configuration implements ConfigurationInterface ->canBeDisabled() ->children()->end() ->end() // end for short_messages + ->scalarNode('remote_calendar_dsn')->defaultValue('null://null')->cannotBeEmpty()->end() ->arrayNode('remote_calendars_sync')->canBeEnabled() ->children() - ->arrayNode('microsoft_graph')->canBeEnabled() + ->arrayNode('microsoft_graph')->canBeEnabled()->setDeprecated('chill-project/chill-bundles', '4.7.0', 'The child node %node% at path %path% is deprecated: use remote_calendar_dsn instead, with a "msgraph://default" value') ->children() ->end() // end of machine_access_token ->end() // end of microsoft_graph children diff --git a/src/Bundle/ChillCalendarBundle/Entity/CalendarRange.php b/src/Bundle/ChillCalendarBundle/Entity/CalendarRange.php index 12f3ed7e7..34cd5623a 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/CalendarRange.php +++ b/src/Bundle/ChillCalendarBundle/Entity/CalendarRange.php @@ -107,6 +107,11 @@ class CalendarRange implements TrackCreationInterface, TrackUpdateInterface return $this; } + public function hasLocation(): bool + { + return null !== $this->location; + } + public function setLocation(?Location $location): self { $this->location = $location; diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRemoveHandler.php b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRemoveHandler.php index 73e8a0c37..9b3a054a0 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRemoveHandler.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRemoveHandler.php @@ -22,6 +22,7 @@ use Chill\CalendarBundle\Messenger\Message\CalendarRemovedMessage; use Chill\CalendarBundle\RemoteCalendar\Connector\RemoteCalendarConnectorInterface; use Chill\CalendarBundle\Repository\CalendarRangeRepository; use Chill\MainBundle\Repository\UserRepositoryInterface; +use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Messenger\Handler\MessageHandlerInterface; /** @@ -31,7 +32,12 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface; */ class CalendarRemoveHandler implements MessageHandlerInterface { - public function __construct(private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly CalendarRangeRepository $calendarRangeRepository, private readonly UserRepositoryInterface $userRepository) {} + public function __construct( + private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, + private readonly CalendarRangeRepository $calendarRangeRepository, + private readonly UserRepositoryInterface $userRepository, + private readonly EntityManagerInterface $entityManager, + ) {} public function __invoke(CalendarRemovedMessage $message) { @@ -47,5 +53,7 @@ class CalendarRemoveHandler implements MessageHandlerInterface $this->userRepository->find($message->getCalendarUserId()), $associatedRange ); + + $this->entityManager->flush(); } } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/RemoteCalendarConnectorInterface.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/RemoteCalendarConnectorInterface.php index 1e3c16845..644d22ae4 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/RemoteCalendarConnectorInterface.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/RemoteCalendarConnectorInterface.php @@ -21,42 +21,137 @@ namespace Chill\CalendarBundle\RemoteCalendar\Connector; use Chill\CalendarBundle\Entity\Calendar; use Chill\CalendarBundle\Entity\CalendarRange; use Chill\CalendarBundle\Entity\Invite; +use Chill\CalendarBundle\Messenger\Message\CalendarMessage; use Chill\CalendarBundle\RemoteCalendar\Model\RemoteEvent; use Chill\MainBundle\Entity\User; use Symfony\Component\HttpFoundation\Response; +/** + * Contract for connectors that synchronize Chill calendars with a remote + * calendar provider (for example Microsoft 365/Graph, Zimbra, ...). + * + * Implementations act as an adapter between Chill domain objects + * (Calendar, CalendarRange, Invite) and the remote provider API. They must: + * - expose a readiness flow for per-user authorization when applicable + * (see {@see getMakeReadyResponse()} and {@see isReady()}); + * - list and count remote events in a time range for a given user; + * - mirror local lifecycle changes to the remote provider for calendars, + * calendar ranges (availability/busy blocks) and invites/attendees. + * + * Use {@see MSGraphRemoteCalendarConnector} as a reference implementation for + * expected behaviours, error handling and parameter semantics. + */ interface RemoteCalendarConnectorInterface { public function countEventsForUser(User $user, \DateTimeImmutable $startDate, \DateTimeImmutable $endDate): int; /** - * Return a response, more probably a RedirectResponse, where the user - * will be able to fullfill requirements to prepare this connector and - * make it ready. + * Returns a Response (typically a RedirectResponse) that lets the current + * user perform the steps required to make the connector usable (for + * example, OAuth consent or account linking). After completion, the user + * should be redirected back to the given path. */ public function getMakeReadyResponse(string $returnPath): Response; /** - * Return true if the connector is ready to act as a proxy for reading - * remote calendars. + * Returns true when the connector is ready to access the remote provider + * on behalf of the current user (e.g. required tokens/consent exist). */ public function isReady(): bool; /** + * Lists events from the remote provider for the given user and time range. + * + * Implementations should map provider-specific payloads to instances of + * {@see RemoteEvent}. + * * @return array|RemoteEvent[] */ public function listEventsForUser(User $user, \DateTimeImmutable $startDate, \DateTimeImmutable $endDate, ?int $offset = 0, ?int $limit = 50): array; + /** + * Removes a calendar (single event) from the remote provider. + * + * **Note**: calendar (single event) which are canceled will appears in this + * method, and not in syncCalendar method. + * + * Parameters: + * - remoteId: the provider identifier of the remote event to delete. If + * empty, implementations should no-op. + * - remoteAttributes: provider-specific metadata previously stored with the + * local entity (e.g. change keys, etags) that can help perform safe + * concurrency checks when deleting. Implementations may ignore unknown + * keys. + * - user: the user in whose remote calendar the event lives and on whose + * behalf the deletion must be performed. + * - associatedCalendarRange: when provided, the implementation should + * update/synchronize the corresponding remote busy-time block after the + * event removal so that availability stays consistent. + */ public function removeCalendar(string $remoteId, array $remoteAttributes, User $user, ?CalendarRange $associatedCalendarRange = null): void; + /** + * Removes a remote busy-time block (calendar range) identified by + * provider-specific id and attributes for the given user. + * + * Implementations should no-op if the id is empty. + */ public function removeCalendarRange(string $remoteId, array $remoteAttributes, User $user): void; /** + * Synchronizes a Calendar entity to the remote provider. + * + * Typical cases to support (see MSGraph implementation): + * - Creating the event on the remote calendar when it has no remote id. + * - Updating the existing remote event when details or attendees change. + * - Handling main user changes: cancel on the previous user's calendar, + * (re)create associated ranges where needed, then create on the new + * main user's calendar. + * - If the Calendar uses a CalendarRange that already exists remotely, + * implementations should remove/update that remote range when the event + * becomes the source of truth for busy times. + * + * The implementation should not expects to receive calendar which are canceled + * here. + * + * Parameters: + * - calendar: the domain Calendar to mirror remotely. + * - action: a hint about what triggered the sync; implementations should not rely + * solely on this value and must base decisions on the Calendar state. + * - previousCalendarRange: if the Calendar was previously attached to a + * different range, this contains the former range so it can be recreated + * remotely to preserve availability history when applicable. + * - previousMainUser: the former main user, when the main user changed; + * used to cancel the event in the previous user's calendar. + * - oldInvites: the attendee snapshot before the change. Each item is an + * array with keys: inviteId, userId, userEmail, userLabel. + * - newInvites: the attendee snapshot after the change, same shape as + * oldInvites. Implementations can compute diffs to add/remove attendees. + * + * The $action argument is a string tag indicating what happened to the + * calendar. It MUST be one of the constants defined on + * {@see CalendarMessage}: + * - {@see CalendarMessage::CALENDAR_PERSIST} + * - {@see CalendarMessage::CALENDAR_UPDATE} + * * @param array $oldInvites + * + * @phpstan-param (CalendarMessage::CALENDAR_PERSIST|CalendarMessage::CALENDAR_UPDATE) $action */ public function syncCalendar(Calendar $calendar, string $action, ?CalendarRange $previousCalendarRange, ?User $previousMainUser, ?array $oldInvites, ?array $newInvites): void; + /** + * Creates or updates a remote busy-time block representing the provided + * CalendarRange. If the range has a remote id, it should be updated; + * otherwise it should be created remotely, and the range enriched with + * the new id/attributes by the caller. + */ public function syncCalendarRange(CalendarRange $calendarRange): void; + /** + * Synchronizes a single Invite (attendee) change to the remote provider. + * Implementations may need to lookup the attendee's personal calendar to + * find provider-specific identifiers before patching the main event. + */ public function syncInvite(Invite $invite): void; } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/DependencyInjection/RemoteCalendarCompilerPass.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/DependencyInjection/RemoteCalendarCompilerPass.php index c52fc2866..3fb82ac6a 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/DependencyInjection/RemoteCalendarCompilerPass.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/DependencyInjection/RemoteCalendarCompilerPass.php @@ -35,25 +35,46 @@ use TheNetworg\OAuth2\Client\Provider\Azure; class RemoteCalendarCompilerPass implements CompilerPassInterface { + private const ZIMBRA_CONNECTOR = 'Chill\ZimbraBundle\Calendar\Connector\ZimbraConnector'; + + private const MS_GRAPH_SERVICES_TO_REMOVE = [ + MapAndSubscribeUserCalendarCommand::class, + AzureGrantAdminConsentAndAcquireToken::class, + RemoteCalendarConnectAzureController::class, + MachineTokenStorage::class, + MachineHttpClient::class, + MSGraphRemoteCalendarConnector::class, + MSUserAbsenceReaderInterface::class, + MSUserAbsenceSync::class, + ]; + public function process(ContainerBuilder $container) { - $config = $container->getParameter('chill_calendar'); + $config = $container->getParameter('chill_calendar.remote_calendar_dsn'); + if (true === $container->getParameter('chill_calendar')['remote_calendars_sync']['microsoft_graph']['enabled']) { + $dsn = 'msgraph://default'; + } else { + $dsn = $config; + } - if (true === $config['remote_calendars_sync']['microsoft_graph']['enabled']) { + $scheme = parse_url($dsn, PHP_URL_SCHEME); + + if ('msgraph' === $scheme) { $connector = MSGraphRemoteCalendarConnector::class; $container->setAlias(HttpClientInterface::class.' $machineHttpClient', MachineHttpClient::class); - } else { + } elseif ('zimbra+http' === $scheme || 'zimbra+https' === $scheme) { + $connector = self::ZIMBRA_CONNECTOR; + foreach (self::MS_GRAPH_SERVICES_TO_REMOVE as $serviceId) { + $container->removeDefinition($serviceId); + } + } elseif ('null' === $scheme) { $connector = NullRemoteCalendarConnector::class; - // remove services which cannot be loaded - $container->removeDefinition(MapAndSubscribeUserCalendarCommand::class); - $container->removeDefinition(AzureGrantAdminConsentAndAcquireToken::class); - $container->removeDefinition(RemoteCalendarConnectAzureController::class); - $container->removeDefinition(MachineTokenStorage::class); - $container->removeDefinition(MachineHttpClient::class); - $container->removeDefinition(MSGraphRemoteCalendarConnector::class); - $container->removeDefinition(MSUserAbsenceReaderInterface::class); - $container->removeDefinition(MSUserAbsenceSync::class); + foreach (self::MS_GRAPH_SERVICES_TO_REMOVE as $serviceId) { + $container->removeDefinition($serviceId); + } + } else { + throw new \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException('Unsupported remote calendar scheme: '.$scheme); } if (!$container->hasAlias(Azure::class) && $container->hasDefinition('knpu.oauth2.client.azure')) { @@ -62,7 +83,9 @@ class RemoteCalendarCompilerPass implements CompilerPassInterface foreach ([ NullRemoteCalendarConnector::class, - MSGraphRemoteCalendarConnector::class, ] as $serviceId) { + MSGraphRemoteCalendarConnector::class, + self::ZIMBRA_CONNECTOR, + ] as $serviceId) { if ($connector === $serviceId) { $container->getDefinition($serviceId) ->setDecoratedService(RemoteCalendarConnectorInterface::class); diff --git a/src/Bundle/ChillCalendarBundle/Repository/InviteRepository.php b/src/Bundle/ChillCalendarBundle/Repository/InviteRepository.php index 6cb34738c..8fe28f500 100644 --- a/src/Bundle/ChillCalendarBundle/Repository/InviteRepository.php +++ b/src/Bundle/ChillCalendarBundle/Repository/InviteRepository.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\CalendarBundle\Repository; use Chill\CalendarBundle\Entity\Invite; +use Chill\MainBundle\Entity\User; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Doctrine\Persistence\ObjectRepository; @@ -51,6 +52,52 @@ class InviteRepository implements ObjectRepository return $this->entityRepository->findOneBy($criteria); } + /** + * Find accepted invites for a user within a date range. + * + * @return array|Invite[] + */ + public function findAcceptedInvitesByUserAndDateRange(User $user, \DateTimeImmutable $from, \DateTimeImmutable $to): array + { + return $this->buildAcceptedInviteByUserAndDateRangeQuery($user, $from, $to) + ->getQuery() + ->getResult(); + } + + /** + * Count accepted invites for a user within a date range. + */ + public function countAcceptedInvitesByUserAndDateRange(User $user, \DateTimeImmutable $from, \DateTimeImmutable $to): int + { + return $this->buildAcceptedInviteByUserAndDateRangeQuery($user, $from, $to) + ->select('COUNT(c)') + ->getQuery() + ->getSingleScalarResult(); + } + + public function buildAcceptedInviteByUserAndDateRangeQuery(User $user, \DateTimeImmutable $from, \DateTimeImmutable $to) + { + $qb = $this->entityRepository->createQueryBuilder('i'); + + return $qb + ->join('i.calendar', 'c') + ->where( + $qb->expr()->andX( + $qb->expr()->eq('i.user', ':user'), + $qb->expr()->eq('i.status', ':status'), + $qb->expr()->gte('c.startDate', ':startDate'), + $qb->expr()->lte('c.endDate', ':endDate'), + $qb->expr()->isNull('c.cancelReason') + ) + ) + ->setParameters([ + 'user' => $user, + 'status' => Invite::ACCEPTED, + 'startDate' => $from, + 'endDate' => $to, + ]); + } + public function getClassName(): string { return Invite::class; diff --git a/src/Bundle/ChillCalendarBundle/Resources/public/chill/scss/calendar-list.scss b/src/Bundle/ChillCalendarBundle/Resources/public/chill/scss/calendar-list.scss index 56f40c201..6fa84f15a 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/public/chill/scss/calendar-list.scss +++ b/src/Bundle/ChillCalendarBundle/Resources/public/chill/scss/calendar-list.scss @@ -23,14 +23,4 @@ div.calendar-list { border-radius: 0.25rem; text-align: center; } - } - -/*.calendar-list__global { - display: inline-block; - padding: 0.2rem; - min-width: 2rem; - border: 1px solid var(--bs-chill-blue); - border-radius: 0.25rem; - text-align: center; -}*/ diff --git a/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/App2.vue b/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/App2.vue index 6e3d5b61c..40c3200b9 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/App2.vue +++ b/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/MyCalendarRange/App2.vue @@ -108,9 +108,12 @@ {{ formatDate(event.endStr, "time") }}: {{ event.extendedProps.locationName }} - {{ - event.title - }} + + {{ event.title }} + no 'is' { + const idStr = calendarId.match(/_(\d+)$/)?.[1]; + + return `/fr/calendar/calendar/${idStr}/edit`; +}; + onMounted(() => { copyFromWeek.value = dateToISO(getMonday(0)); copyToWeek.value = dateToISO(getMonday(1)); diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_list.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_list.html.twig index c827ca4f4..88ce1b6e5 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_list.html.twig +++ b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_list.html.twig @@ -162,6 +162,7 @@ {% endif %}
    + {% if show_record_actions is not defined or show_record_actions %}
      {% if is_granted('CHILL_CALENDAR_DOC_EDIT', calendar) and calendar.status is not constant('STATUS_CANCELED', calendar) %} {% if templates|length == 0 %} @@ -245,7 +246,7 @@ {% endif %}
    - + {% endif %}
    diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/cancelCalendarByAccompanyingCourse.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/cancelCalendarByAccompanyingCourse.html.twig index 2f6759725..a0d10273b 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/cancelCalendarByAccompanyingCourse.html.twig +++ b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/cancelCalendarByAccompanyingCourse.html.twig @@ -6,6 +6,10 @@ {% block content %} +
    + {{ include('@ChillCalendar/Calendar/_list.html.twig', {context: 'accompanying_course', show_record_actions: false}) }} +
    + {{ form_start(form) }} {{ form_row(form.cancelReason) }} diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/cancelCalendarByPerson.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/cancelCalendarByPerson.html.twig index 76196b23e..4ef1c2e65 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/cancelCalendarByPerson.html.twig +++ b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/cancelCalendarByPerson.html.twig @@ -6,6 +6,10 @@ {% block content %} +
    + {{ include('@ChillCalendar/Calendar/_list.html.twig', {context: 'person', show_record_actions: false}) }} +
    + {{ form_start(form) }} {{ form_row(form.cancelReason) }} diff --git a/src/Bundle/ChillCalendarBundle/translations/messages+intl-icu.nl.yml b/src/Bundle/ChillCalendarBundle/translations/messages+intl-icu.nl.yml new file mode 100644 index 000000000..6a2edf9c4 --- /dev/null +++ b/src/Bundle/ChillCalendarBundle/translations/messages+intl-icu.nl.yml @@ -0,0 +1,8 @@ +chill_calendar: + There are count ignored calendars by date filter: >- + {nbIgnored, plural, + =0 {Er zijn geen afspraken genegeerd door de datumfilter.} + one {Er is een afspraak genegeerd door de datumfilter. Wijzig de datumfilter om deze te laten verschijnen.} + few {# afspraken zijn genegeerd door de datumfilter. Wijzig de datumfilter om deze te laten verschijnen.} + other {# afspraken zijn genegeerd door de datumfilter. Wijzig de datumfilter om deze te laten verschijnen.} + } diff --git a/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml b/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml index 8717dcd9f..b4bdd0679 100644 --- a/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillCalendarBundle/translations/messages.fr.yml @@ -87,6 +87,8 @@ remote_ms_graph: remote_calendar: calendar_range_title: Plage de disponibilité Chill + # small type-hint in remote calendar to says that the appointment is created through an invitation, and not as main referrer + calendar_invite_statement_in_calendar: Par invitation invite: accepted: Accepté diff --git a/src/Bundle/ChillCalendarBundle/translations/messages.nl.yml b/src/Bundle/ChillCalendarBundle/translations/messages.nl.yml index c832138a8..ec962afe6 100644 --- a/src/Bundle/ChillCalendarBundle/translations/messages.nl.yml +++ b/src/Bundle/ChillCalendarBundle/translations/messages.nl.yml @@ -26,3 +26,149 @@ The calendar item has been successfully removed.: De afspraak is verwijdert From the day: Vanaf to the day: tot Transform to activity: In activiteit omzetten +Create a new calendar in accompanying course: Afspraak aanmaken in het traject +Will send SMS: Er zal een herinnerings-sms worden verzonden +Will not send SMS: Er wordt geen herinnerings-sms verzonden +SMS already sent: Er is een sms verzonden + +Canceled by: Geannuleerd door +Calendar configuration: Beheer van afspraken + +crud: + calendar_cancel-reason: + index: + title: Lijst van annuleringsredenen + add_new: Nieuwe toevoegen + title_new: Nieuwe annuleringsreden + title_edit: Annuleringsreden bewerken + +chill_calendar: + canceled: Geannuleerd + cancel_reason: Reden van annulering + cancel_calendar_item: Afspraak annuleren + calendar_canceled: De afspraak is geannuleerd + canceled_by: + user: Gebruiker + person: Gebruiker + other: Andere + Document: Document van een afspraak + form: + The main user is mandatory. He will organize the appointment.: De hoofdgebruiker is verplicht. Hij is de organisator van de gebeurtenis. + Create for referrer: Aanmaken voor de referent + start date filter: Begin van de afspraak + From: Van + To: Tot + Next calendars: Volgende afspraken + Add a document: Document toevoegen + Documents: Documenten + Create and add a document: Aanmaken en document toevoegen + Save and add a document: Opslaan en document toevoegen + Create for me: Afspraak aanmaken voor mezelf + Edit a document: Document bewerken + Document title: Titel + Document object: Document + Add a document from template: Document toevoegen vanaf sjabloon + Upload a document: Document uploaden + Remove a calendar document: Document van een afspraak verwijderen + Are you sure you want to remove the doc?: Weet u zeker dat u het gekoppelde document wilt verwijderen? + Document outdated: De datum en tijd van de afspraak zijn gewijzigd na het aanmaken van het document + + + +remote_ms_graph: + freebusy_statuses: + busy: Bezet + free: Vrij + tentative: In afwachting van bevestiging + oof: Buiten kantoor + workingElsewhere: Werkt elders + unknown: Onbekend + cancel_event_because_main_user_is_%label%: De gebeurtenis is overgedragen aan gebruiker %label% + +remote_calendar: + calendar_range_title: Chill-beschikbaarheidsperiode + +invite: + accepted: Geaccepteerd + declined: Geweigerd + pending: In afwachting + tentative: Voorlopig geaccepteerd + list: + none: Er is geen uitnodiging + title: Mijn uitnodigingen + +# exports +Exports of calendar: Exports van afspraken +Count calendars: Aantal afspraken +Count calendars by various parameters.: Telt het aantal afspraken op basis van verschillende parameters. + +Average appointment duration: Gemiddelde duur van afspraken +Get the average of appointment duration according to various filters: Berekent het gemiddelde van de duur van afspraken op basis van verschillende parameters. + +Sum of appointment durations: Som van de duur van afspraken +Get the sum of appointment durations according to various filters: Berekent de som van de duur van afspraken op basis van verschillende parameters. + +'Filtered by agent: only %agents%': "Gefilterd op agenten: alleen %agents%" +Filter calendars by agent: Afspraken filteren op agenten +Filter calendars between certain dates: Afspraken filteren op datum van de afspraak +'Filtered by calendars between %dateFrom% and %dateTo%': 'Gefilterd op afspraken tussen %dateFrom% en %dateTo%' +'Filtered by calendar range: only %calendarRange%': 'Gefilterd op afspraken per beschikbaarheidsperiode: alleen de %calendarRange%' +Filter by calendar range: Filteren op afspraken binnen een beschikbaarheidsperiode of niet + +Group calendars by agent: Afspraken groeperen op agent +Group calendars by location type: Afspraken groeperen op type locatie +Group calendars by location: Afspraken groeperen op afspraaklocatie +Group calendars by cancel reason: Afspraken groeperen op annuleringsreden +Group calendars by month and year: Afspraken groeperen op maand en jaar +Group calendars by urgency: Afspraken groeperen op urgent of niet + +export: + aggregator.calendar: + agent_job: + Group calendars by agent job: Afspraken groeperen op beroep van de agent + agent_scope: + Group calendars by agent scope: Afspraken groeperen op dienst van de agent + filter.calendar: + agent_job: + Filter calendars by agent job: Afspraken filteren op beroepen van de agenten (hoofdgebruikers) + 'Filtered by agent job: only %jobs%': 'Gefilterd op beroepen van de agenten (hoofdgebruikers): alleen de %jobs%' + agent_scope: + Filter calendars by agent scope: Afspraken filteren op diensten van de agenten (hoofdgebruikers) + 'Filtered by agent scope: only %scopes%': 'Gefilterd op diensten van de agenten (hoofdgebruikers): alleen de diensten %scopes%' + +Scope: Dienst +Job: Beroep +Location type: Type locatie +Location: Afspraaklocatie +by month and year: Per maand en jaar + +is urgent: Urgent +is not urgent: Niet urgent +has calendar range: Binnen een beschikbaarheidsperiode? +Not made within a calendar range: Afspraak binnen een beschikbaarheidsperiode +Made within a calendar range: Afspraak buiten een beschikbaarheidsperiode + +docgen: + calendar: + Base context for calendar: 'Afspraak: basiscontext' + A base context for generating document on calendar: Context voor het genereren van documenten op basis van afspraken + Track changes on datetime and warn user if date time is updated after the doc generation: Wijzigingen in het document volgen en gebruikers waarschuwen dat de datum en tijd zijn gewijzigd na het genereren van het document + Ask main person: Vragen om een gebruiker te kiezen uit de deelnemers aan de afspraken + Main person label: Label om de gebruiker te kiezen + Ask third party: Vragen om een derde te kiezen uit de deelnemers aan de afspraken + Third party label: Label om de derde te kiezen + Destinee: Geadresseerde + None: Geen keuze + title of the generated document: Titel van het gegenereerde document + +CHILL_CALENDAR_CALENDAR_CREATE: Afspraken aanmaken +CHILL_CALENDAR_CALENDAR_EDIT: Afspraken bewerken +CHILL_CALENDAR_CALENDAR_DELETE: Afspraken verwijderen +CHILL_CALENDAR_CALENDAR_SEE: Afspraken bekijken + + +generic_doc: + filter: + keys: + accompanying_period_calendar_document: Document van afspraken van trajecten + person_calendar_document: Document van afspraken van de gebruiker diff --git a/src/Bundle/ChillCalendarBundle/translations/validators.nl.yml b/src/Bundle/ChillCalendarBundle/translations/validators.nl.yml new file mode 100644 index 000000000..d069ac73c --- /dev/null +++ b/src/Bundle/ChillCalendarBundle/translations/validators.nl.yml @@ -0,0 +1,6 @@ +calendar: + At least {{ limit }} person is required.: Minimaal {{ limit }} persoon is vereist voor deze afspraak + An end date is required: Geef een einddatum en -tijd op + A start date is required: Geef een startdatum en -tijd op + A location is required: Geef een locatie op + A main user is mandator: Geef een hoofdgebruiker op diff --git a/src/Bundle/ChillCustomFieldsBundle/translations/messages.nl.yml b/src/Bundle/ChillCustomFieldsBundle/translations/messages.nl.yml index 5fdb3bafe..d75cbc8d2 100644 --- a/src/Bundle/ChillCustomFieldsBundle/translations/messages.nl.yml +++ b/src/Bundle/ChillCustomFieldsBundle/translations/messages.nl.yml @@ -1,3 +1,103 @@ 'Not available in your language': 'Vertaling niet mogelijk in het Nederlands' 'Other value': 'Andere mogelijkheid' -'None': 'Niet gespecifieerd' \ No newline at end of file +'None': 'Niet gespecifieerd' + +#customfieldsgroup rendering +Empty data: Lege gegevens +No data to show: Geen waarden om te tonen + +#customfieldsgroup administration +CustomFieldsGroup list: Groepen van aangepaste velden +CustomFieldsGroup creation: Nieuwe groep van aangepaste velden +Entity: Entiteit +"Is default ?": "Standaard?" +"Some module select default groups for some usage. Example: the default person group is shown under person page.": "Sommige modules selecteren standaardgroepen voor bepaald gebruik. Voorbeeld: de standaard persoonsgroep wordt getoond op de persoonspagina" +Make default: Groep standaard maken +Create a new group: Nieuwe groep aanmaken +CustomFieldsGroup details: Details van de groep aangepaste velden +Fields associated with this group: Velden geassocieerd met deze groep +Any field is currently associated with this group: Geen veld is momenteel geassocieerd met deze groep +Create a new field: Nieuw aangepast veld aanmaken +Add a new field: Aangepast veld toevoegen +ordering: volgorde +label_field: label van het veld +active: actief +No value defined for this option: Geen waarde gedefinieerd voor deze optie +CustomFieldsGroup edit: Bewerken van een groep aangepaste velden +type: type +The custom fields group has been created: De groep aangepaste velden is aangemaakt +The custom fields group has been updated: De groep aangepaste velden is bijgewerkt +The custom fields group form contains errors: Het formulier bevat fouten +The default custom fields group has been changed: De standaardgroep is gewijzigd + + +#menu entries +Custom fields configuration: Aangepaste velden +CustomFields List: Lijst van aangepaste velden +CustomFields Groups: Groep van aangepaste velden + +#customfield administration +Custom fields: Aangepaste velden +CustomFields configuration: Beheer van aangepaste velden +CustomField edit: Wijziging van een aangepast veld +CustomField creation: Nieuw aangepast veld +General informations: Algemene informatie +Options: Opties +Custom fields group: Groep van aangepaste velden +Ordering: Volgorde van verschijning +Required field: Verplicht veld +An answer is required: Een antwoord is vereist +Any answer is required: Geen antwoord is vereist +Back to the group: Terug naar de groep aangepaste velden +Slug: Tekstuele identificatie +The custom field has been created: Het aangepaste veld is aangemaakt +The custom field form contains errors: Het formulier bevat fouten +The custom field has been updated: Het aangepaste veld is bijgewerkt + +#custom field name +choice: keuze +Title: Titel +text: tekst +Text field: Tekstveld +Date field: Datumveld + +#custom field choice +Multiplicity: Multipliciteit +Multiple: Meerdere +Unique: Slechts één keuze mogelijk +Choice display: Weergave van keuzes +Expanded: Uitgebreide keuzes (radioknoppen) +Non expanded: Gegroepeerde keuzes +Allow other: Andere waarde toestaan +No: Nee +Yes: Ja +Other value label (empty if use by default): Label van het veld "andere waarde" +Choices: Keuzes +Add an element: Element toevoegen + +#custom field text +Max length: Maximale lengte +Box appearance: Verschijning van het veld +Multiple boxes on the line: Meerdere velden op de lijn +One box on the line: Slechts één veld op de lijn + +#custom field title +Title level: Titelniveau +Main title: Hoofdtitel +Subtitle: Ondertitel + +#custom field number +Greater or equal than: Groter dan of gelijk aan +Lesser or equal than: Kleiner dan of gelijk aan +Precision: Precisie +Text after the field: Tekst na het veld +Number field: Nummerveld + +#custom field long choice +Options key: Sleutel van opties +Choose a value: Kies een waarde +Long choice field: Veld met vooraf geregistreerde keuzes + +#Custom field date +Greater or equal than (expression like 1 day ago, 2 years ago, +1 month, today, tomorrow, or date with format YYYY-mm-dd): Datum na (geef een PHP-expressie op zoals '1 day ago', '2 years ago', '+1 month', 'today', 'tomorrow', ...) +Lesser or equal than (expression like 1 day ago, 2 years ago, +1 month, today, tomorrow, or date with format YYYY-mm-dd): Datum voor (geef een PHP-expressie op zoals '1 day ago', '2 years ago', '+1 month', 'today', 'tomorrow', ...) diff --git a/src/Bundle/ChillCustomFieldsBundle/translations/validators.nl.yml b/src/Bundle/ChillCustomFieldsBundle/translations/validators.nl.yml new file mode 100644 index 000000000..f105110e4 --- /dev/null +++ b/src/Bundle/ChillCustomFieldsBundle/translations/validators.nl.yml @@ -0,0 +1,3 @@ +Characters not allowed. Only lowercase letters, numbers and "-" are allowed.: Tekens niet toegestaan. Alleen kleine letters, cijfers en "-" zijn toegestaan. +'This date must be after or equal to %date%': Deze datum moet gelijk zijn aan of na %date% +'This date must be before or equal to %date%': Deze datum moet voor of gelijk zijn aan %date% diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnGenerationFails.php b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnGenerationFails.php index b9d538a63..a950b88c0 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnGenerationFails.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnGenerationFails.php @@ -25,6 +25,8 @@ use Symfony\Component\Mailer\MailerInterface; use Symfony\Component\Messenger\Event\WorkerMessageFailedEvent; use Symfony\Contracts\Translation\TranslatorInterface; +// use Symfony\Component\Translation\LocaleSwitcher; + /** * @see OnGenerationFailsTest for test suite */ @@ -40,6 +42,7 @@ final readonly class OnGenerationFails implements EventSubscriberInterface private StoredObjectRepositoryInterface $storedObjectRepository, private TranslatorInterface $translator, private UserRepositoryInterface $userRepository, + // private LocaleSwitcher $localeSwitcher, ) {} public static function getSubscribedEvents() @@ -118,6 +121,25 @@ final readonly class OnGenerationFails implements EventSubscriberInterface return; } + // Implementation with LocaleSwitcher (commented out - to be activated after migration to sf7.2): + /* + $this->localeSwitcher->runWithLocale($creator->getLocale(), function () use ($message, $errors, $template, $creator) { + $email = (new TemplatedEmail()) + ->to($message->getSendResultToEmail()) + ->subject($this->translator->trans('docgen.failure_email.The generation of a document failed')) + ->textTemplate('@ChillDocGenerator/Email/on_generation_failed_email.txt.twig') + ->context([ + 'errors' => $errors, + 'template' => $template, + 'creator' => $creator, + 'stored_object_id' => $message->getDestinationStoredObjectId(), + ]); + + $this->mailer->send($email); + }); + */ + + // Current implementation: $email = (new TemplatedEmail()) ->to($message->getSendResultToEmail()) ->subject($this->translator->trans('docgen.failure_email.The generation of a document failed')) diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationHandler.php b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationHandler.php index 9dd20af91..a67f5a68f 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationHandler.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationHandler.php @@ -27,6 +27,8 @@ use Symfony\Component\Messenger\Exception\UnrecoverableMessageHandlingException; use Symfony\Component\Messenger\Handler\MessageHandlerInterface; use Symfony\Contracts\Translation\TranslatorInterface; +// use Symfony\Component\Translation\LocaleSwitcher; + /** * Handle the request of document generation. */ @@ -46,6 +48,7 @@ class RequestGenerationHandler implements MessageHandlerInterface private readonly MailerInterface $mailer, private readonly TranslatorInterface $translator, private readonly StoredObjectManagerInterface $storedObjectManager, + // private readonly LocaleSwitcher $localeSwitcher, ) {} public function __invoke(RequestGenerationMessage $message) @@ -122,6 +125,30 @@ class RequestGenerationHandler implements MessageHandlerInterface private function sendDataDump(StoredObject $destinationStoredObject, RequestGenerationMessage $message): void { + // Implementation with LocaleSwitcher (commented out - to be activated after migration to sf7.2): + // Note: This method sends emails to admin addresses, not user addresses, so locale switching may not be needed + /* + $this->localeSwitcher->runWithLocale('fr', function () use ($destinationStoredObject, $message) { + // Get the content of the document + $content = $this->storedObjectManager->read($destinationStoredObject); + $filename = $destinationStoredObject->getFilename(); + $contentType = $destinationStoredObject->getType(); + + // Create the email with the document as an attachment + $email = (new TemplatedEmail()) + ->to($message->getSendResultToEmail()) + ->textTemplate('@ChillDocGenerator/Email/send_data_dump_to_admin.txt.twig') + ->context([ + 'filename' => $filename, + ]) + ->subject($this->translator->trans('docgen.data_dump_email.subject')) + ->attach($content, $filename, $contentType); + + $this->mailer->send($email); + }); + */ + + // Current implementation: // Get the content of the document $content = $this->storedObjectManager->read($destinationStoredObject); $filename = $destinationStoredObject->getFilename(); diff --git a/src/Bundle/ChillDocGeneratorBundle/translations/messages+intl-icu.nl.yml b/src/Bundle/ChillDocGeneratorBundle/translations/messages+intl-icu.nl.yml new file mode 100644 index 000000000..7634a39df --- /dev/null +++ b/src/Bundle/ChillDocGeneratorBundle/translations/messages+intl-icu.nl.yml @@ -0,0 +1,2 @@ +docgen: + # Geen ICU berichten nodig voor data_dump_email meer diff --git a/src/Bundle/ChillDocGeneratorBundle/translations/messages.nl.yml b/src/Bundle/ChillDocGeneratorBundle/translations/messages.nl.yml new file mode 100644 index 000000000..d9ef4206c --- /dev/null +++ b/src/Bundle/ChillDocGeneratorBundle/translations/messages.nl.yml @@ -0,0 +1,51 @@ +docgen: + Generate a document: Document genereren + Generate: Genereren + Document generation: Documentgeneratie + Manage templates and document generation: Beheer van gegenereerde documenten en hun sjablonen + Pick template context: Context kiezen + Context: Context + New template: Nieuw sjabloon + Edit template: Sjabloon bewerken + test generate: Generatie testen + With context %name%: 'Met context "%name%"' + + Doc generation failed: Het genereren van dit document is mislukt + Doc generation is pending: Het genereren van dit document is bezig + Come back later: Kom later terug + + Send report to: Rapport verzenden naar + Send report errors to this email address: Foutrapporten worden verzonden naar het opgegeven e-mailadres + Generate as creator: Genereren als + The document will be generated as the given creator: Het document wordt gegenereerd namens de opgegeven gebruiker + Show data instead of generating: Gegevens tonen in plaats van document genereren + + Any template configured: Geen documentsjabloon geconfigureerd + + entity_id_placeholder: Identificatie van de entiteit + + failure_email: + The generation of a document failed: Het genereren van een document is mislukt + The generation of the document %template_name% failed: Het genereren van een document op basis van sjabloon {{ template_name }} is mislukt. + The following errors were encoutered: De volgende fouten zijn opgetreden + Forward this email to your administrator for solving: Stuur dit bericht door naar uw beheerder voor probleemoplossing. + References: Referenties + + data_dump_email: + subject: Inhoud van documentgeneratiegegevens beschikbaar + Dear: Beste + data_dump_ready_and_attached: >- + De inhoud van de gegevens is beschikbaar. U vindt deze als bijlage bij deze e-mail. + filename: >- + Bestandsnaam: %filename% + + + +crud: + docgen_template: + index: + title: Documentgeneratie + add_new: Aanmaken + + +Template file: Sjabloonbestand diff --git a/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php b/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php index 0addd53cc..6e201165d 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php +++ b/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php @@ -17,7 +17,6 @@ use Chill\DocStoreBundle\Entity\PersonDocument; use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\ChillTextareaType; use Chill\MainBundle\Form\Type\ScopePickerType; -use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher; use Chill\MainBundle\Security\Resolver\ScopeResolverDispatcher; use Chill\MainBundle\Templating\TranslatableStringHelperInterface; use Doctrine\ORM\EntityRepository; @@ -30,7 +29,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PersonDocumentType extends AbstractType { - public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly ScopeResolverDispatcher $scopeResolverDispatcher, private readonly ParameterBagInterface $parameterBag, private readonly CenterResolverDispatcher $centerResolverDispatcher) {} + public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly ScopeResolverDispatcher $scopeResolverDispatcher, private readonly ParameterBagInterface $parameterBag) {} public function buildForm(FormBuilderInterface $builder, array $options) { @@ -57,8 +56,8 @@ class PersonDocumentType extends AbstractType if ($isScopeConcerned && $this->parameterBag->get('chill_main')['acl']['form_show_scopes']) { $builder->add('scope', ScopePickerType::class, [ - 'center' => $this->centerResolverDispatcher->resolveCenter($document), 'role' => $options['role'], + 'subject' => $document, ]); } } diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/types/generic_doc.ts b/src/Bundle/ChillDocStoreBundle/Resources/public/types/generic_doc.ts index 04c324b4a..34cf2501d 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/types/generic_doc.ts +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/types/generic_doc.ts @@ -52,36 +52,31 @@ interface BaseMetadataWithHtml extends BaseMetadata { html: string; } -export interface GenericDocForAccompanyingCourseDocument - extends GenericDocForAccompanyingPeriod { +export interface GenericDocForAccompanyingCourseDocument extends GenericDocForAccompanyingPeriod { key: "accompanying_course_document"; metadata: BaseMetadataWithHtml; storedObject: StoredObject; } -export interface GenericDocForAccompanyingCourseActivityDocument - extends GenericDocForAccompanyingPeriod { +export interface GenericDocForAccompanyingCourseActivityDocument extends GenericDocForAccompanyingPeriod { key: "accompanying_course_activity_document"; metadata: BaseMetadataWithHtml; storedObject: StoredObject; } -export interface GenericDocForAccompanyingCourseCalendarDocument - extends GenericDocForAccompanyingPeriod { +export interface GenericDocForAccompanyingCourseCalendarDocument extends GenericDocForAccompanyingPeriod { key: "accompanying_course_calendar_document"; metadata: BaseMetadataWithHtml; storedObject: StoredObject; } -export interface GenericDocForAccompanyingCoursePersonDocument - extends GenericDocForAccompanyingPeriod { +export interface GenericDocForAccompanyingCoursePersonDocument extends GenericDocForAccompanyingPeriod { key: "person_document"; metadata: BaseMetadataWithHtml; storedObject: StoredObject; } -export interface GenericDocForAccompanyingCourseWorkEvaluationDocument - extends GenericDocForAccompanyingPeriod { +export interface GenericDocForAccompanyingCourseWorkEvaluationDocument extends GenericDocForAccompanyingPeriod { key: "accompanying_period_work_evaluation_document"; metadata: BaseMetadataWithHtml; storedObject: StoredObject; diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/types/index.ts b/src/Bundle/ChillDocStoreBundle/Resources/public/types/index.ts index 5b34b8f73..4213d971a 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/types/index.ts +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/types/index.ts @@ -46,8 +46,7 @@ export interface StoredObjectVersionCreated extends StoredObjectVersion { persisted: false; } -export interface StoredObjectVersionPersisted - extends StoredObjectVersionCreated { +export interface StoredObjectVersionPersisted extends StoredObjectVersionCreated { version: number; id: number; createdAt: DateTime | null; @@ -61,8 +60,7 @@ export interface StoredObjectStatusChange { type: string; } -export interface StoredObjectVersionWithPointInTime - extends StoredObjectVersionPersisted { +export interface StoredObjectVersionWithPointInTime extends StoredObjectVersionPersisted { "point-in-times": StoredObjectPointInTime[]; "from-restored": StoredObjectVersionPersisted | null; } diff --git a/src/Bundle/ChillDocStoreBundle/translations/messages+intl-icu.nl.yml b/src/Bundle/ChillDocStoreBundle/translations/messages+intl-icu.nl.yml new file mode 100644 index 000000000..91454bde0 --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/translations/messages+intl-icu.nl.yml @@ -0,0 +1,11 @@ +acc_course_document: + duplicated_at: >- + Gedupliceerd op {at, date, long} om {at, time, short} + +workflow: + public_link: + doc_shared_by_at_explanation: >- + Het document is met u gedeeld door {byUser}, op {at, date, long} om {at, time, short}. + doc_shared_automatically_at_explanation: >- + Het document is met u gedeeld op {at, date, long} om {at, time, short} + diff --git a/src/Bundle/ChillDocStoreBundle/translations/messages.nl.yml b/src/Bundle/ChillDocStoreBundle/translations/messages.nl.yml index f4d8dd453..cbb10f702 100644 --- a/src/Bundle/ChillDocStoreBundle/translations/messages.nl.yml +++ b/src/Bundle/ChillDocStoreBundle/translations/messages.nl.yml @@ -1,2 +1,130 @@ +Document: Document +Documents: Documenten +Documents for %name%: Documenten van %name% +Preparing: In voorbereiding +Ready to show: Klaar om te bekijken +Download: Downloaden +Download existing file: Bestaand bestand downloaden +Create new document: Nieuw document aanmaken +New document for %name%: Nieuw document voor %name% +Editing document for %name%: Document bewerken voor %name% +Edit Document: Document bewerken +Update document: Document bijwerken +Edit attributes: Documenteigenschappen bewerken +Existing document: Bestaand document +No document to download: Geen document om te downloaden +"Choose a document category": Kies een documentcategorie +No document found: Geen document gevonden +The document is successfully registered: Het document is geregistreerd +The document is successfully updated: Het document is bijgewerkt +Any description: Geen beschrijving +Document from person %name%: Document van gebruiker %name% +See the document: Document bekijken + +document: + Any title: Geen titel + replace: Vervangen + Add: Document toevoegen + +generic_doc: + filter: + keys: + accompanying_course_document: Document van het traject + person_document: Documenten van de gebruiker + date-range: Datum van het document + +# delete +Delete document ?: Document verwijderen? +Are you sure you want to remove this document ?: Weet u zeker dat u dit document wilt verwijderen? +The document is successfully removed: Het document is verwijderd + +# dropzone upload +File too big: Bestand te groot +Drop your file or click here: Klik hier of sleep uw nieuwe bestand naar deze zone +Remove file in order to upload a new one: Verwijder dit bestand om een nieuw bestand in te voegen +Max files exceeded. Remove previous files: Maximum aantal bestanden bereikt. Verwijder de vorige +Cancel upload: Upload annuleren +Are you sure you want to cancel this upload ?: Weet u zeker dat u deze upload wilt annuleren? +Upload canceled: Upload geannuleerd +Remove existing file: Bestaand document verwijderen + +stored_object: + Insert a document: Document toevoegen + +# ROLES +PersonDocument: Documenten +CHILL_PERSON_DOCUMENT_CREATE: Document toevoegen +CHILL_PERSON_DOCUMENT_DELETE: Document verwijderen +CHILL_PERSON_DOCUMENT_SEE: Document bekijken +CHILL_PERSON_DOCUMENT_SEE_DETAILS: Details van een document bekijken +CHILL_PERSON_DOCUMENT_UPDATE: Document bewerken + +# Admin +Documents configuration: Documentenconfiguratie +Documents configuration menu: Documenten +Documents categories: Documentcategorieën + +Document category list: Documentcategorieën +Document category show: Documentcategorie bekijken +Document category edit: Documentcategorie bewerken +Creator bundle id: Module +Bundle id: Module +Internal id inside creator bundle: Identificatie +Id inside bundle: Identificatie +Document class: Documentklasse +no records found: +Create new category: Nieuwe categorie aanmaken +Back to the category list: Terug naar de lijst +Create new DocumentCategory: Nieuwe documentcategorie aanmaken +Accompanying period document: Begeleidingstrajectdocument +Person document: Persoonsdocument + +# WOPI EDIT +online_edit_document: Online bewerken + +workflow: + Document deleted: Document verwijderd + public_link: + shared_doc: Gedeeld document + title: Gedeeld document + main_document: Hoofddocument + attachment: Bijlage + +# ROLES +accompanyingCourseDocument: Documenten in begeleidingstrajecten +CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE: Document aanmaken +CHILL_ACCOMPANYING_COURSE_DOCUMENT_DELETE: Document verwijderen +CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE: Documenten bekijken +CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS: Details van een document bekijken +CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE: Document bewerken + entity_display_title: - Doc for evaluation (n°%eval%): Evaluatiedocument (n°%eval%) + Document (n°%doc%): "Document (nr. %doc%)" + Doc for evaluation (n°%eval%): Document van evaluatie nr. %eval% + + +# SIGNATURES + +signatures: + yes: Ja + are_you_sure: Weet u het zeker? + you_are_going_to_sign: U gaat het document ondertekenen + signature_confirmation: Bevestiging van de ondertekening + sign: Ondertekenen + choose_another_signature: Een andere zone kiezen + cancel: Annuleren + last_sign_zone: Vorige ondertekeningszone + next_sign_zone: Volgende ondertekeningszone + add_sign_zone: Ondertekeningszone toevoegen + click_on_document: Klik op het document + last_zone: Vorige zone + next_zone: Volgende zone + add_zone: Zone toevoegen + another_zone: Andere zone + electronic_signature_in_progress: Elektronische ondertekening bezig... + loading: Laden... + remove_sign_zone: Zone verwijderen + return: Terug + see_all_pages: Alle pagina's bekijken + all_pages: Alle pagina's + go_to_signature_unique: Naar de ondertekeningszone gaan diff --git a/src/Bundle/ChillDocStoreBundle/translations/validators.nl.yml b/src/Bundle/ChillDocStoreBundle/translations/validators.nl.yml new file mode 100644 index 000000000..4ae338763 --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/translations/validators.nl.yml @@ -0,0 +1,2 @@ +The file is not stored properly: Het bestand is niet correct geüpload +Upload a document: Upload een document diff --git a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php index 7fac83bf5..b100e47cd 100644 --- a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php +++ b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php @@ -486,7 +486,7 @@ final class ParticipationController extends AbstractController return $this->redirectToRoute( 'chill_event__event_show', - ['event_id' => $event->getId()] + ['id' => $event->getId()] ); } diff --git a/src/Bundle/ChillEventBundle/Resources/views/Event/edit.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Event/edit.html.twig index 55c2fc21f..8fb9393a6 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Event/edit.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Event/edit.html.twig @@ -15,7 +15,6 @@ {{ form_row(edit_form.circle) }} {{ form_row(edit_form.name) }} {{ form_row(edit_form.date) }} - {{ form_row(edit_form.type, { label: "Event type" }) }} {{ form_row(edit_form.themes) }} {{ form_row(edit_form.moderator) }} diff --git a/src/Bundle/ChillEventBundle/Resources/views/Participation/edit-multiple.html.twig b/src/Bundle/ChillEventBundle/Resources/views/Participation/edit-multiple.html.twig index a01c51e49..a2cef3e53 100644 --- a/src/Bundle/ChillEventBundle/Resources/views/Participation/edit-multiple.html.twig +++ b/src/Bundle/ChillEventBundle/Resources/views/Participation/edit-multiple.html.twig @@ -50,7 +50,7 @@
    • - + {{ 'Back to the event'|trans }}
    • diff --git a/src/Bundle/ChillEventBundle/translations/messages+intl-icu.nl.yml b/src/Bundle/ChillEventBundle/translations/messages+intl-icu.nl.yml new file mode 100644 index 000000000..dab1e446a --- /dev/null +++ b/src/Bundle/ChillEventBundle/translations/messages+intl-icu.nl.yml @@ -0,0 +1,27 @@ +total events match the search: >- + { total, plural, + =0 {Geen gebeurtenis komt overeen met de zoektermen} + one {Eén gebeurtenis komt overeen met de zoektermen} + other {# gebeurtenissen komen overeen met de zoektermen} + } + +count participations to this event: >- + { count, plural, + =0 {Geen deelnemer aan de gebeurtenis} + one {Eén deelnemer aan de gebeurtenis} + other {# deelnemers aan de gebeurtenis} + } + +events: + and_other_count_participants: >- + { count, plural, + =0 {Geen andere deelnemer} + one {en één andere deelnemer} + other {en # andere deelnemers} + } + +ignored_participations: >- + { count, plural, + one {De volgende persoon is genegeerd omdat hij/zij al deelneemt aan de gebeurtenis} + other {De volgende personen zijn genegeerd omdat zij al deelnemen aan de gebeurtenis} + } diff --git a/src/Bundle/ChillEventBundle/translations/messages.nl.yml b/src/Bundle/ChillEventBundle/translations/messages.nl.yml new file mode 100644 index 000000000..45c7d0698 --- /dev/null +++ b/src/Bundle/ChillEventBundle/translations/messages.nl.yml @@ -0,0 +1,198 @@ +#events +Event type : Type evenement +Event: Evenement +Events: Evenementen +'Event : %label%': Evenement "%label%" +Participation: Deelname +Participations: Deelnames +Status: Status +Last update: Laatste update +Moderator: Verantwoordelijke +Animators: Animatoren + +#CRUD event +Details of an event: Details van een evenement +See details of the event: Details van het evenement bekijken +Back to details of the event: Terug naar details van het evenement +New event: Nieuw evenement +Back to the most recent events: Terug naar de laatste evenementen +'Back to %person% events': Terug naar evenementen van %person% +Event creation: Evenement aanmaken +Add an event: Evenement toevoegen +Event edit: Evenement bewerken +Edit the event: Evenement bewerken +The event was updated: Het evenement is bijgewerkt +The event was created: Het evenement is aangemaakt +List of events: Lijst van evenementen +Any location for this event: Geen locatie voor dit evenement + +#crud participation +Edit all the participations: Alle deelnames bewerken +Edit the participation: Deelname aan het evenement bewerken +Participation Edit: Deelname bewerken +Add a participation: Deelnemer toevoegen +Participation creation: Deelname toevoegen +Associated person: Gekoppelde gebruiker +Associated event: Gekoppeld evenement +Back to the event: Terug naar het evenement +The participation was created: De deelname is aangemaakt +The participation was updated: De deelname is bijgewerkt +'None of the requested people may participate the event: they are maybe already participating.': 'Geen van de aangegeven personen kan worden toegevoegd aan het evenement: zij nemen mogelijk al deel.' +There are no participation to edit for this event: Er zijn geen deelnames voor dit evenement +The participations have been successfully updated.: De deelnames zijn bijgewerkt. +The participation has been sucessfully removed: De deelname is correct verwijderd. +The event has been sucessfully removed: Het evenement en alle bijbehorende deelnames zijn correct verwijderd. +The participations were created: De deelnames zijn aangemaakt +Events participation: Deelname aan evenementen +Remove participation: Deelname verwijderen +Delete event: Evenement verwijderen +Are you sure you want to remove that participation ?: Weet u zeker dat u deze deelname wilt verwijderen? +Are you sure you want to remove that event ?: Weet u zeker dat u dit evenement en alle bijbehorende deelnames wilt verwijderen? +Any participation for this person: Deze gebruiker neemt niet deel aan evenementen + +#search +Event search: Evenementen zoeken + +CHILL_EVENT_UPDATE: Evenement bewerken +CHILL_EVENT_CREATE: Evenement aanmaken +CHILL_EVENT_SEE: Evenement bekijken +CHILL_EVENT_SEE_DETAILS: Details van een evenement bekijken +CHILL_EVENT_PARTICIPATION_CREATE: Deelname aanmaken +CHILL_EVENT_PARTICIPATION_UPDATE: Deelname bewerken +CHILL_EVENT_PARTICIPATION_SEE: Deelname bekijken +CHILL_EVENT_PARTICIPATION_SEE_DETAILS: Details van een deelname bekijken + +# TODO check place to put this +Next step: Volgende stap +To which territory should the event be associated ?: Aan welk territorium moet het evenement worden gekoppeld? + +# timeline +past: verleden +futur: toekomst +'subscribed by %user% to event "%event%" (%event_type%)': ingeschreven door %user% voor evenement "%event%" (%event_type%) +Show the event: Evenement bekijken + +Subscribe an event: Evenement toevoegen +Pick an event: Evenement kiezen +Pick a type of event: Type evenement kiezen +Pick a moderator: Verantwoordelijke kiezen + +# exports +Select a format: Formaat kiezen +Export: Exporteren + +Count events: Aantal evenementen +Count events by various parameters.: Telt het aantal evenementen volgens diverse criteria +Exports of events: Exports van evenementen + +Filtered by event date: Filteren op datum van evenement +'Filtered by date of event: only between %date_from% and %date_to%': "Gefilterd op datum van evenement: alleen tussen %date_from% en %date_to%" +Events after this date: Evenementen na deze datum +Events before this date: Evenementen voor deze datum +Filtered by event type: Filteren op type evenement +'Filtered by event type: only %list%': "Gefilterd op type: alleen %list%" +Group event by date: Groeperen op datum van evenement +Group by event type: Groeperen op type evenement + +Count event participants: Aantal deelnames +Count participants to an event by various parameters.: Telt het aantal deelnames volgens diverse criteria +Exports of event participants: Exports van deelnames +'Filtered by participant roles: only %list%': "Gefilterd op deelnemersrollen: alleen %list%" +Filter by participant roles: Filteren op deelnemersrollen +Part roles: Deelnemersrollen +Group by participant role: Groeperen op deelnemersrol + + +Events configuration: Configuratie van evenementen +Events configuration menu: Menu van evenementen +Event status: Statussen per type evenement +Event roles: Rollen per type evenement +Event types: Types evenementen +EventType list: Lijst van types evenementen +EventType: Types evenementen +EventType creation: Nieuw type evenement +EventType edit: Type evenement bewerken +Status list: Lijst van statussen +Status creation: Nieuwe status +Status edit: Status bewerken +Role list: Lijst van rollen +Role: Rollen +Role creation: Nieuwe rol +Role edit: Rol bewerken + +xlsx: xlsx +ods: ods +csv: csv + +Create a new role: Nieuwe rol aanmaken +Create a new type: Nieuw type aanmaken +Create a new status: Nieuwe status aanmaken + +event: + admin: + title: + Event budget element list: Lijst van budgetelementen voor een evenement + Select budget type: Selecteer het type budgetelement + new: + Create a new budget kind: Nieuw budgetelement aanmaken + theme: + label: Thema's + fields: + organizationCost: Organisatiekosten + location: Locatie + documents: Documenten + internal animators: Interne animatoren + external animators: Externe animatoren + form: + organisationCost_help: Organisatiekosten voor de structuur. Nuttig voor statistieken. + add_document: Document toevoegen + remove_document: Document verwijderen + Select one or more themes: Selecteer één of meerdere thema's + filter: + event_types: Op types evenement + event_dates: Op datum van evenement + center: Op territorium + by_responsable: Op verantwoordelijke + pick_responsable: Filteren op verantwoordelijken + budget: + resources: Middelen + charges: Lasten + label: Budgetelementen van een evenement + Select a budget element kind: Selecteer een budgetelement + no elements: Er zijn geen elementen + resource type: Middel + charge type: Last + amount: Bedrag + comment: Opmerking + animators: + intern: Interne animatoren + extern: Externe animatoren + +crud: + event_theme: + title_new: Nieuw thema aanmaken + title_edit: Thema bewerken + index: + title: Lijst van thema's + add_new: Nieuw thema aanmaken + event_budget_kind: + title_new: Nieuw budgetelement aanmaken + +export: + event: + list: + title: Lijst van evenementen + description: Maakt de lijst van evenementen aan op basis van verschillende parameters. + +event_id: Identificatie +event_name: Naam +event_date: Datum +event_type: Type evenement +event_center: Territorium +event_moderator: Verantwoordelijke +event_participants_count: Aantal deelnemers +event_location: Locatie +event_budget_resources: Middelen +event_budget_charges: Lasten +event_animators: Animatoren +event_themes: Thema's diff --git a/src/Bundle/ChillEventBundle/translations/validators.nl.yml b/src/Bundle/ChillEventBundle/translations/validators.nl.yml new file mode 100644 index 000000000..132185a18 --- /dev/null +++ b/src/Bundle/ChillEventBundle/translations/validators.nl.yml @@ -0,0 +1,3 @@ +event: + validation: + person_already_participate_to_event: De gebruiker is al ingeschreven voor dit evenement diff --git a/src/Bundle/ChillJobBundle/src/Resources/translations/messages.nl.yml b/src/Bundle/ChillJobBundle/src/Resources/translations/messages.nl.yml new file mode 100644 index 000000000..d83404a09 --- /dev/null +++ b/src/Bundle/ChillJobBundle/src/Resources/translations/messages.nl.yml @@ -0,0 +1,213 @@ +situation_logement: + proprietaire: Eigenaar + locataire: Huurder + heberge_chez_tiers: Gehuisvest bij een derde + heberge_chez_parents: Gehuisvest bij een ouder + hebergement_en_foyer: Gehuisvest in een tehuis + sans_domicile: Zonder vaste woonplaats +niveau_maitrise_langue: + lu: Gelezen + ecrit: Geschreven + parle: Gesproken + aucun: Geen +permis_conduire: + a: Rijbewijs A + b: Rijbewijs B + c: Rijbewijs C + d: Rijbewijs D + e: Rijbewijs E + en_cours: Bezig + pas_de_permis: Geen rijbewijs + caces: CACES + label: "Rijbewijs" +situation_professionnelle: + sans_emploi: Zonder werk + en_activite: Actief + etudiant: Student + etudiant_descolarise: Student zonder school + label: "Professionele situatie" +type_contrat: + cdd: Tijdelijk contract + cdi: Contract voor onbepaalde tijd + contrat_interim: Uitzendcontract + contrat_aide: Gesubsidieerd contract + cdd_insertion: Inschakelingscontract + contrat_extra: Extra contract + service_civique: Burgerdienst + label: "Type contract" +ressource: + salaires: Salaris(sen) + ARE: ARE + are: ARE + ASS: ASS + ass: ASS + RSA: RSA + rsa: RSA + AAH: AAH + aah: AAH + autre: Andere + label: "Inkomen" +accompagnement: + plie: PLIE + pole_emploi: Arbeidsbureau + referent_RSA: RSA-referent + mission_locale: Lokale missie + rqth: RQTH + autre: Andere + label: "Begeleiding" +freins_perso: + situation_administrative: Administratieve situatie + situation_personnelle_et_familiale: Persoonlijke en familiale situatie + comportement: Gedrag + etat_de_sante: Gezondheidstoestand + precarite_situation_materielle: Precaire materiële situatie + condition_ou_absence_logement: Huisvestingsvoorwaarden of ontbreken daarvan + autres: Andere +freins_emploi: + garde_d_enfants: Kinderopvang + sante: Gezondheid + famille: Familie + finances: Financiën + maitrise_de_la_langue: Taalbeheersing + autres: Andere +neet_eligibility: + oui: Ja + non: Nee + en_attente: In afwachting + label: "NEET-geschiktheid" +handicap_recommandation: + travail_esat: Werk in ESAT + milieu_ordinaire: Reguliere omgeving + entreprise_adaptee: Aangepast bedrijf +moyen_transport: + transport_commun: Openbaar vervoer + scooter: Scooter + velo: Fiets + voiture: Auto + autre: Andere + label: "Vervoermiddel" +formation_level: + sans_diplome: Zonder diploma + BEP_CAP: BEP CAP + BAC: BAC + BAC+2: BAC +2 + BAC+3: BAC +3 + BAC+4: BAC +4 + BAC+5: BAC +5 + BAC+8: BAC +8 +formation_type: + formation_initiale: Initiële opleiding + formation_continue: Permanente vorming +diploma_obtained: + fr: In Frankrijk + non-fr: In het buitenland + aucun: Geen +diploma_reconnu: + oui: Ja + non: Nee + nsp: Weet niet +xp_contrat_type: + cddi: CDDI + cdd-6mois: Tijdelijk contract -6 maanden + cdd+6mois: Tijdelijk contract +6 maanden + interim: Uitzendwerk + apprentissage: Leercontract + contrat_prof: Professioneel contract + cui: CUI + cae: CAE + cdi: Contract voor onbepaalde tijd + stage: Stage + volontariat: Vrijwilligerswerk + benevolat: Vrijwilligerswerk + autres: Andere +immersion_objectif: + 'decouvrir_metier': "Een beroep of een activiteitensector ontdekken" + 'confirmer_projet_prof': "Een professioneel project bevestigen" + 'acquerir_experience': "Professionele ervaring opdoen" + 'acquerir_competences': "Nieuwe vaardigheden verwerven" + 'initier_demarche_recrutement': "Een wervingsprocedure initiëren" + 'autre': "Andere" +immersion_savoir_etre: + 'assiduite': "Ijver" + 'ponctualite': "Punctualiteit" + 'respect_consigne_securite': "Respect voor veiligheidsinstructies" + 'relation_hierarchie': "Relatie met de hiërarchie" + 'capacite_adaptation': "Aanpassingsvermogen" + 'motivation_travail': "Werkmotivatie" +immersion_ponctualiteSalarie: + un: Eén vertraging + aucun: Geen vertraging + plusieurs: Meerdere vertragingen +immersion_assiduite: + aucun: Geen afwezigheid + un: Eén afwezigheid + plusieurs: Meerdere afwezigheden +immersion_integreRegle: + 1_temps: Na een bepaalde tijd + rapidement: Snel + pas_encore: Heeft ze nog niet geïntegreerd +immersion_nsp: + oui: Ja + non: Nee + nsp: Weet niet +projet_prof: + type_contrat: + cdd: "Tijdelijk contract" + cdi: "Contract voor onbepaalde tijd" + contrat_insertion: "Inschakelingscontract" + interim: "Uitzendwerk" + indifferent: "Maakt niet uit" + label: "Gezochte type contract" + apprentissage: Leercontract + personnalisation: Personalisatie + creation_entreprise: Bedrijfsoprichting + note: "Opmerkingen gezocht contract" + volume_horaire: + temps_plein: "Voltijds" + temps_partiel: "Deeltijds" + label: "Uurvolume" + note: "Opmerkingen uurvolume" + idee: "Ideeën" + encoursdeconstruction: "In opbouw" + valide: + note: "Opmerkingen gevalideerd" + code: "Codes gevalideerd" + note: "Opmerkingen" + souhait: + code: "Codes wensen" + + +chill_3party: + key_label: + prescripteur: Voorschrijver + entreprise: Bedrijf + +crud: + csfrein: + title_new: Nieuw rapport "belemmering" voor %person% + title_view: Rapport 'Belemmering' voor %person% + title_edit: Rapport "belemmering" bewerken + title_delete: Belemmering verwijderen + button_delete: Verwijderen + confirm_message_delete: %as_string% verwijderen? + cscv: + title_new: Nieuw CV voor %person% + title_view: CV voor %person% + title_edit: CV bewerken + title_delete: CV verwijderen + button_delete: Verwijderen + confirm_message_delete: %as_string% verwijderen? + no_date: Geen datum aangegeven + no_end_date: einddatum onbekend + no_start_date: startdatum onbekend + immersion: + title_new: Nieuwe immersie voor %person% + title_view: Immersie voor %person% + title_edit: Immersie bewerken + title_delete: Immersie verwijderen + button_delete: Verwijderen + confirm_message_delete: %as_string% verwijderen? + projet_prof: + title_new: Nieuw professioneel project voor %person% + title_view: Professioneel project voor %person% + title_edit: Professioneel project bewerken diff --git a/src/Bundle/ChillMainBundle/Action/User/UpdateProfile/UpdateProfileCommand.php b/src/Bundle/ChillMainBundle/Action/User/UpdateProfile/UpdateProfileCommand.php index f0751cb58..061f8e55a 100644 --- a/src/Bundle/ChillMainBundle/Action/User/UpdateProfile/UpdateProfileCommand.php +++ b/src/Bundle/ChillMainBundle/Action/User/UpdateProfile/UpdateProfileCommand.php @@ -15,6 +15,7 @@ use Chill\MainBundle\Entity\User; use Chill\MainBundle\Notification\NotificationFlagManager; use Chill\MainBundle\Validation\Constraint\PhonenumberConstraint; use libphonenumber\PhoneNumber; +use Symfony\Component\Validator\Constraints as Assert; final class UpdateProfileCommand { @@ -23,11 +24,13 @@ final class UpdateProfileCommand public function __construct( #[PhonenumberConstraint] public ?PhoneNumber $phonenumber, + #[Assert\Choice(choices: ['fr', 'nl'], message: 'Locale must be either "fr" or "nl"')] + public string $locale = 'fr', ) {} public static function create(User $user, NotificationFlagManager $flagManager): self { - $updateProfileCommand = new self($user->getPhonenumber()); + $updateProfileCommand = new self($user->getPhonenumber(), $user->getLocale()); foreach ($flagManager->getAllNotificationFlagProviders() as $provider) { $updateProfileCommand->setNotificationFlag( diff --git a/src/Bundle/ChillMainBundle/Action/User/UpdateProfile/UpdateProfileCommandHandler.php b/src/Bundle/ChillMainBundle/Action/User/UpdateProfile/UpdateProfileCommandHandler.php index 4c46e686e..08684b8c6 100644 --- a/src/Bundle/ChillMainBundle/Action/User/UpdateProfile/UpdateProfileCommandHandler.php +++ b/src/Bundle/ChillMainBundle/Action/User/UpdateProfile/UpdateProfileCommandHandler.php @@ -18,6 +18,7 @@ final readonly class UpdateProfileCommandHandler public function updateProfile(User $user, UpdateProfileCommand $command): void { $user->setPhonenumber($command->phonenumber); + $user->setLocale($command->locale); foreach ($command->notificationFlags as $flag => $values) { $user->setNotificationImmediately($flag, $values['immediate_email']); diff --git a/src/Bundle/ChillMainBundle/Controller/UserGroupApiController.php b/src/Bundle/ChillMainBundle/Controller/UserGroupApiController.php index 602b84ec5..0395812b3 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserGroupApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserGroupApiController.php @@ -12,5 +12,12 @@ declare(strict_types=1); namespace Chill\MainBundle\Controller; use Chill\MainBundle\CRUD\Controller\ApiController; +use Symfony\Component\HttpFoundation\Request; -class UserGroupApiController extends ApiController {} +class UserGroupApiController extends ApiController +{ + protected function customizeQuery(string $action, Request $request, $query): void + { + $query->andWhere('e.active = TRUE'); + } +} diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAdministrativeLocation.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAdministrativeLocation.php new file mode 100644 index 000000000..2620620e2 --- /dev/null +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAdministrativeLocation.php @@ -0,0 +1,45 @@ +getReference(LoadLocationType::LOCATION_TYPE.'_0'); + $o->setLocationType($locationType); + $o->setName('Commune de Bruxelles'); + $o->setAvailableForUsers(true); + + $manager->persist($o); + + $this->addReference(self::ADMINISTRATIVE_LOCATION, $o); + echo "Adding one Administrative Location\n"; + + $manager->flush(); + } +} diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php index a1185c655..cc5297214 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php @@ -25,6 +25,8 @@ class LoadLocationType extends AbstractFixture implements ContainerAwareInterfac { private ?ContainerInterface $container = null; + final public const LOCATION_TYPE = 'location_type'; + public function getOrder(): int { return 52; @@ -53,13 +55,15 @@ class LoadLocationType extends AbstractFixture implements ContainerAwareInterfac ], ]; - foreach ($arr as $a) { + foreach ($arr as $index => $a) { $locationType = (new LocationType()) ->setTitle($a['name']) ->setAvailableForUsers(true) ->setActive(true) ->setAddressRequired($a['address_required']); $manager->persist($locationType); + + $this->addReference(self::LOCATION_TYPE.'_'.$index, $locationType); } $manager->flush(); diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUserJob.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUserJob.php new file mode 100644 index 000000000..d12648993 --- /dev/null +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUserJob.php @@ -0,0 +1,41 @@ + 'social worker', 'fr' => 'travailleur social']; + + public function getOrder(): int + { + return 9000; + } + + public function load(ObjectManager $manager): void + { + $o = new UserJob(); + $o->setLabel($this->socialWorker); + + $manager->persist($o); + + $this->addReference(self::USER_JOB, $o); + echo "Adding one AccompanyingPeriod User Job\n"; + + $manager->flush(); + } +} diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php index 70b032238..b5539aa83 100644 --- a/src/Bundle/ChillMainBundle/Entity/User.php +++ b/src/Bundle/ChillMainBundle/Entity/User.php @@ -128,6 +128,12 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, nullable: false, options: ['default' => '[]', 'jsonb' => true])] private array $notificationFlags = []; + /** + * User's preferred locale. + */ + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 5, nullable: false, options: ['default' => 'fr'])] + private string $locale = 'fr'; + /** * User constructor. */ @@ -716,7 +722,14 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter public function getLocale(): string { - return 'fr'; + return $this->locale; + } + + public function setLocale(string $locale): self + { + $this->locale = $locale; + + return $this; } #[Assert\Callback] diff --git a/src/Bundle/ChillMainBundle/Form/Type/ChillDateTimeType.php b/src/Bundle/ChillMainBundle/Form/Type/ChillDateTimeType.php index 0063ee7d9..e9e21fea2 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ChillDateTimeType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ChillDateTimeType.php @@ -37,4 +37,9 @@ class ChillDateTimeType extends AbstractType { return DateTimeType::class; } + + public function getBlockPrefix(): string + { + return 'chill_datetime'; + } } diff --git a/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php b/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php index 6f10626c6..2367bc565 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php @@ -16,6 +16,7 @@ use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Form\DataMapper\ScopePickerDataMapper; use Chill\MainBundle\Security\Authorization\AuthorizationHelperInterface; +use Chill\MainBundle\Security\Resolver\CenterResolverManagerInterface; use Chill\MainBundle\Templating\TranslatableStringHelperInterface; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; @@ -32,65 +33,84 @@ use Symfony\Component\Security\Core\Security; * Allow to pick amongst available scope for the current * user. * - * options : - * - * - `center`: the center of the entity - * - `role` : the role of the user + * Options: + * - `role`: string, the role to check permissions for + * - Either `subject`: object, entity to resolve centers from + * - Or `center`: Center|array|null, the center(s) to check */ class ScopePickerType extends AbstractType { public function __construct( + private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly AuthorizationHelperInterface $authorizationHelper, private readonly Security $security, - private readonly TranslatableStringHelperInterface $translatableStringHelper, + private readonly CenterResolverManagerInterface $centerResolverManager, ) {} public function buildForm(FormBuilderInterface $builder, array $options) { - $items = array_values( + // Compute centers from subject + $centers = $options['center'] ?? null; + if (null === $centers && isset($options['subject'])) { + $centers = $this->centerResolverManager->resolveCenters($options['subject']); + } + + if (null === $centers) { + throw new \RuntimeException('Either "center" or "subject" must be provided'); + } + + $reachableScopes = array_values( array_filter( $this->authorizationHelper->getReachableScopes( $this->security->getUser(), $options['role'], - $options['center'] + $centers ), static fn (Scope $s) => $s->isActive() ) ); - if (0 === \count($items)) { - throw new \RuntimeException('no scopes are reachable. This form should not be shown to user'); + $builder->setAttribute('reachable_scopes_count', count($reachableScopes)); + + if (0 === count($reachableScopes)) { + $builder->setAttribute('has_scopes', false); + + return; } - if (1 !== \count($items)) { + $builder->setAttribute('has_scopes', true); + + if (1 !== count($reachableScopes)) { $builder->add('scope', EntityType::class, [ 'class' => Scope::class, 'placeholder' => 'Choose the circle', 'choice_label' => fn (Scope $c) => $this->translatableStringHelper->localize($c->getName()), - 'choices' => $items, + 'choices' => $reachableScopes, ]); $builder->setDataMapper(new ScopePickerDataMapper()); } else { $builder->add('scope', HiddenType::class, [ - 'data' => $items[0]->getId(), + 'data' => $reachableScopes[0]->getId(), ]); - $builder->setDataMapper(new ScopePickerDataMapper($items[0])); + $builder->setDataMapper(new ScopePickerDataMapper($reachableScopes[0])); } } public function buildView(FormView $view, FormInterface $form, array $options) { $view->vars['fullWidth'] = true; + // display of label is handled by the EntityType + $view->vars['label'] = false; } public function configureOptions(OptionsResolver $resolver) { $resolver - // create `center` option - ->setRequired('center') - ->setAllowedTypes('center', [Center::class, 'array', 'null']) - // create ``role` option ->setRequired('role') - ->setAllowedTypes('role', ['string']); + ->setAllowedTypes('role', ['string']) + ->setDefined('subject') + ->setAllowedTypes('subject', ['object']) + ->setDefined('center') + ->setAllowedTypes('center', [Center::class, 'array', 'null']); } } diff --git a/src/Bundle/ChillMainBundle/Form/Type/UserLocaleType.php b/src/Bundle/ChillMainBundle/Form/Type/UserLocaleType.php new file mode 100644 index 000000000..8e9c7fa62 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Form/Type/UserLocaleType.php @@ -0,0 +1,43 @@ +availableLanguages as $languageCode) { + $choices[Languages::getName($languageCode)] = $languageCode; + } + + $resolver->setDefaults([ + 'choices' => $choices, + 'placeholder' => 'user.locale.placeholder', + 'required' => true, + 'label' => 'user.locale.label', + 'help' => 'user.locale.help', + ]); + } + + public function getParent(): string + { + return ChoiceType::class; + } +} diff --git a/src/Bundle/ChillMainBundle/Form/UpdateProfileType.php b/src/Bundle/ChillMainBundle/Form/UpdateProfileType.php index 6aa8f0943..3806facb9 100644 --- a/src/Bundle/ChillMainBundle/Form/UpdateProfileType.php +++ b/src/Bundle/ChillMainBundle/Form/UpdateProfileType.php @@ -14,6 +14,7 @@ namespace Chill\MainBundle\Form; use Chill\MainBundle\Action\User\UpdateProfile\UpdateProfileCommand; use Chill\MainBundle\Form\Type\ChillPhoneNumberType; use Chill\MainBundle\Form\Type\NotificationFlagsType; +use Chill\MainBundle\Form\Type\UserLocaleType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -26,6 +27,7 @@ class UpdateProfileType extends AbstractType ->add('phonenumber', ChillPhoneNumberType::class, [ 'required' => false, ]) + ->add('locale', UserLocaleType::class) ->add('notificationFlags', NotificationFlagsType::class) ; } diff --git a/src/Bundle/ChillMainBundle/Form/UserType.php b/src/Bundle/ChillMainBundle/Form/UserType.php index 019839961..79f95c20e 100644 --- a/src/Bundle/ChillMainBundle/Form/UserType.php +++ b/src/Bundle/ChillMainBundle/Form/UserType.php @@ -18,6 +18,7 @@ use Chill\MainBundle\Entity\UserJob; use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\ChillPhoneNumberType; use Chill\MainBundle\Form\Type\PickCivilityType; +use Chill\MainBundle\Repository\UserJobRepository; use Chill\MainBundle\Templating\TranslatableStringHelper; use Doctrine\ORM\EntityRepository; use Symfony\Bridge\Doctrine\Form\Type\EntityType; @@ -36,7 +37,7 @@ use Symfony\Component\Validator\Constraints\Regex; class UserType extends AbstractType { - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) {} + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag, private readonly UserJobRepository $userJobRepository) {} public function buildForm(FormBuilderInterface $builder, array $options) { @@ -80,12 +81,7 @@ class UserType extends AbstractType 'placeholder' => 'choose a job', 'class' => UserJob::class, 'choice_label' => fn (UserJob $c) => $this->translatableStringHelper->localize($c->getLabel()), - 'query_builder' => static function (EntityRepository $er) { - $qb = $er->createQueryBuilder('uj'); - $qb->where('uj.active = TRUE'); - - return $qb; - }, + 'choices' => $this->loadAndSortUserJobs(), ]) ->add('mainLocation', EntityType::class, [ 'label' => 'Main location', @@ -96,6 +92,7 @@ class UserType extends AbstractType 'query_builder' => static function (EntityRepository $er) { $qb = $er->createQueryBuilder('l'); $qb->orderBy('l.locationType'); + $qb->orderBy('l.name', 'ASC'); $qb->where('l.availableForUsers = TRUE'); return $qb; @@ -155,6 +152,20 @@ class UserType extends AbstractType } } + private function loadAndSortUserJobs(): array + { + $items = $this->userJobRepository->findBy(['active' => true]); + + usort( + $items, + fn ($a, $b) => mb_strtolower((string) $this->translatableStringHelper->localize($a->getLabel())) + <=> + mb_strtolower((string) $this->translatableStringHelper->localize($b->getLabel())) + ); + + return $items; + } + /** * @param OptionsResolverInterface $resolver */ diff --git a/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php b/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php index 2f888ffd5..1cb64ff4a 100644 --- a/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php +++ b/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php @@ -24,6 +24,8 @@ use Symfony\Component\Mime\Email; use Symfony\Component\Messenger\MessageBusInterface; use Symfony\Contracts\Translation\TranslatorInterface; +// use Symfony\Component\Translation\LocaleSwitcher; + readonly class NotificationMailer { public function __construct( @@ -31,6 +33,7 @@ readonly class NotificationMailer private LoggerInterface $logger, private MessageBusInterface $messageBus, private TranslatorInterface $translator, + // private LocaleSwitcher $localeSwitcher, ) {} public function postPersistComment(NotificationComment $comment, PostPersistEventArgs $eventArgs): void @@ -56,7 +59,7 @@ readonly class NotificationMailer $email ->to($dest->getEmail()) ->subject('Re: '.$comment->getNotification()->getTitle()) - ->textTemplate('@ChillMain/Notification/email_notification_comment_persist.fr.md.twig') + ->textTemplate('@ChillMain/Notification/email_notification_comment_persist.md.twig') ->context([ 'comment' => $comment, 'dest' => $dest, @@ -137,13 +140,53 @@ readonly class NotificationMailer return; } + // Implementation with LocaleSwitcher (commented out - to be activated after migration to sf7.2): + /* + $this->localeSwitcher->runWithLocale($addressee->getLocale(), function () use ($notification, $addressee) { + if ($notification->isSystem()) { + $email = new Email(); + $email->text($notification->getMessage()); + } else { + $email = new TemplatedEmail(); + $email + ->textTemplate('@ChillMain/Notification/email_non_system_notification_content.md.twig') + ->context([ + 'notification' => $notification, + 'dest' => $addressee, + ]); + } + + $email + ->subject($notification->getTitle()) + ->to($addressee->getEmail()); + + try { + $this->mailer->send($email); + $this->logger->info('[NotificationMailer] Email sent successfully', [ + 'notification_id' => $notification->getId(), + 'addressee_email' => $addressee->getEmail(), + 'locale' => $addressee->getLocale(), + ]); + } catch (TransportExceptionInterface $e) { + $this->logger->warning('[NotificationMailer] Could not send an email notification', [ + 'to' => $addressee->getEmail(), + 'notification_id' => $notification->getId(), + 'error_message' => $e->getMessage(), + 'error_trace' => $e->getTraceAsString(), + ]); + throw $e; + } + }); + */ + + // Current implementation: if ($notification->isSystem()) { $email = new Email(); $email->text($notification->getMessage()); } else { $email = new TemplatedEmail(); $email - ->textTemplate('@ChillMain/Notification/email_non_system_notification_content.fr.md.twig') + ->textTemplate('@ChillMain/Notification/email_non_system_notification_content.md.twig') ->context([ 'notification' => $notification, 'dest' => $addressee, @@ -182,9 +225,43 @@ readonly class NotificationMailer return; } + // Implementation with LocaleSwitcher (commented out - to be activated after migration to sf7.2): + /* + $this->localeSwitcher->runWithLocale($user->getLocale(), function () use ($user, $notifications) { + $email = new TemplatedEmail(); + $email + ->htmlTemplate('@ChillMain/Notification/email_daily_digest.md.twig') + ->context([ + 'user' => $user, + 'notifications' => $notifications, + 'notification_count' => count($notifications), + ]) + ->subject($this->translator->trans('notification.Daily Notification Digest')) + ->to($user->getEmail()); + + try { + $this->mailer->send($email); + $this->logger->info('[NotificationMailer] Daily digest email sent successfully', [ + 'user_email' => $user->getEmail(), + 'notification_count' => count($notifications), + 'locale' => $user->getLocale(), + ]); + } catch (TransportExceptionInterface $e) { + $this->logger->warning('[NotificationMailer] Could not send daily digest email', [ + 'to' => $user->getEmail(), + 'notification_count' => count($notifications), + 'error_message' => $e->getMessage(), + 'error_trace' => $e->getTraceAsString(), + ]); + throw $e; + } + }); + */ + + // Current implementation: $email = new TemplatedEmail(); $email - ->htmlTemplate('@ChillMain/Notification/email_daily_digest.fr.md.twig') + ->htmlTemplate('@ChillMain/Notification/email_daily_digest.md.twig') ->context([ 'user' => $user, 'notifications' => $notifications, @@ -222,7 +299,7 @@ readonly class NotificationMailer $email = new TemplatedEmail(); $email - ->textTemplate('@ChillMain/Notification/email_non_system_notification_content_to_email.fr.md.twig') + ->textTemplate('@ChillMain/Notification/email_non_system_notification_content_to_email.md.twig') ->context([ 'notification' => $notification, 'dest' => $emailAddress, diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.ts b/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.ts index e8256b348..97220f9c8 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.ts +++ b/src/Bundle/ChillMainBundle/Resources/public/lib/api/apiMethods.ts @@ -20,8 +20,7 @@ export interface TransportExceptionInterface { name: string; } -export interface ValidationExceptionInterface - extends TransportExceptionInterface { +export interface ValidationExceptionInterface extends TransportExceptionInterface { name: "ValidationException"; error: object; violations: string[]; @@ -41,8 +40,7 @@ export interface AccessExceptionInterface extends TransportExceptionInterface { violations: string[]; } -export interface NotFoundExceptionInterface - extends TransportExceptionInterface { +export interface NotFoundExceptionInterface extends TransportExceptionInterface { name: "NotFoundException"; } @@ -53,8 +51,7 @@ export interface ServerExceptionInterface extends TransportExceptionInterface { body: string; } -export interface ConflictHttpExceptionInterface - extends TransportExceptionInterface { +export interface ConflictHttpExceptionInterface extends TransportExceptionInterface { name: "ConflictHttpException"; violations: string[]; } diff --git a/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig index 5e3edca10..11fc00828 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Form/fields.html.twig @@ -311,3 +311,32 @@ {% endblock %} + +{% block chill_datetime_label %} + +{% endblock %} + +{% block chill_datetime_widget %} +
      + {#date#} + {{ form_widget(form.date, { + attr: { class: 'form-control', style: 'flex: 1 1 auto;' } + }) }} + {#time#} + {{ form_widget(form.time, { + attr: { + class: 'form-select', + style: 'flex: 0 0 200px; max-width: 200px; white-space: nowrap; padding:0;' + } + }) }} +
      +{% endblock %} + +{% block chill_datetime_row %} +
      + {{ block('chill_datetime_label') }} + {{ block('chill_datetime_widget') }} +
      +{% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Login/_login-logo.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Login/_login-logo.html.twig index 751165357..6c5d06de7 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Login/_login-logo.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Login/_login-logo.html.twig @@ -1 +1 @@ - \ No newline at end of file + diff --git a/src/Bundle/ChillMainBundle/Resources/views/Login/login.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Login/login.html.twig index 8a636a8cd..4edbc19f5 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Login/login.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Login/login.html.twig @@ -16,7 +16,7 @@ * along with this program. If not, see . #} - + @@ -35,10 +35,10 @@ <form method="POST" action="{{ path('login_check') }}"> <label for="_username">{{ 'Username'|trans }}</label> - <input type="text" name="_username" value="{{ last_username }}" /> + <input type="text" name="_username" value="{{ last_username }}" id="_username" /> <br/> <label for="_password">{{ 'Password'|trans }}</label> - <input type="password" name="_password" /> + <input type="password" name="_password" id="_password" /> <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}" /> <br/> <button type="submit" name="login">{{ 'Login'|trans }}</button> diff --git a/src/Bundle/ChillMainBundle/Resources/views/Notification/email_daily_digest.fr.md.twig b/src/Bundle/ChillMainBundle/Resources/views/Notification/email_daily_digest.md.twig similarity index 100% rename from src/Bundle/ChillMainBundle/Resources/views/Notification/email_daily_digest.fr.md.twig rename to src/Bundle/ChillMainBundle/Resources/views/Notification/email_daily_digest.md.twig diff --git a/src/Bundle/ChillMainBundle/Resources/views/Notification/email_non_system_notification_content.fr.md.twig b/src/Bundle/ChillMainBundle/Resources/views/Notification/email_non_system_notification_content.md.twig similarity index 88% rename from src/Bundle/ChillMainBundle/Resources/views/Notification/email_non_system_notification_content.fr.md.twig rename to src/Bundle/ChillMainBundle/Resources/views/Notification/email_non_system_notification_content.md.twig index 62e41860b..023f2901a 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Notification/email_non_system_notification_content.fr.md.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Notification/email_non_system_notification_content.md.twig @@ -14,7 +14,7 @@ Vous pouvez visualiser la notification et y répondre ici: -{{ absolute_url(path('chill_main_notification_show', {'_locale': 'fr', 'id': notification.id }, false)) }} +{{ absolute_url(path('chill_main_notification_show', {'_locale': dest.locale, 'id': notification.id }, false)) }} -- Le logiciel Chill diff --git a/src/Bundle/ChillMainBundle/Resources/views/Notification/email_non_system_notification_content_to_email.fr.md.twig b/src/Bundle/ChillMainBundle/Resources/views/Notification/email_non_system_notification_content_to_email.md.twig similarity index 100% rename from src/Bundle/ChillMainBundle/Resources/views/Notification/email_non_system_notification_content_to_email.fr.md.twig rename to src/Bundle/ChillMainBundle/Resources/views/Notification/email_non_system_notification_content_to_email.md.twig diff --git a/src/Bundle/ChillMainBundle/Resources/views/Notification/email_notification_comment_persist.fr.md.twig b/src/Bundle/ChillMainBundle/Resources/views/Notification/email_notification_comment_persist.md.twig similarity index 87% rename from src/Bundle/ChillMainBundle/Resources/views/Notification/email_notification_comment_persist.fr.md.twig rename to src/Bundle/ChillMainBundle/Resources/views/Notification/email_notification_comment_persist.md.twig index b1244da39..e7e212492 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Notification/email_notification_comment_persist.fr.md.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Notification/email_notification_comment_persist.md.twig @@ -13,7 +13,7 @@ Commentaire: Vous pouvez visualiser la notification et y répondre ici: -{{ absolute_url(path('chill_main_notification_show', {'_locale': 'fr', 'id': comment.notification.id }, false)) }} +{{ absolute_url(path('chill_main_notification_show', {'_locale': dest.locale, 'id': comment.notification.id }, false)) }} -- Le logiciel Chill diff --git a/src/Bundle/ChillMainBundle/Resources/views/User/profile.html.twig b/src/Bundle/ChillMainBundle/Resources/views/User/profile.html.twig index 0b268af03..266f75115 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/User/profile.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/User/profile.html.twig @@ -44,6 +44,7 @@ <div> {{ form_start(form) }} {{ form_row(form.phonenumber) }} + {{ form_row(form.locale) }} <h2 class="mb-4">{{ 'user.profile.notification_preferences'|trans }}</h2> <table class="table table-striped align-middle"> diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/workflow_notification_on_transition_completed_content.fr.txt.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/workflow_notification_on_transition_completed_content.fr.txt.twig index 03ddad84f..2b4beb42b 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/workflow_notification_on_transition_completed_content.fr.txt.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/workflow_notification_on_transition_completed_content.fr.txt.twig @@ -1,16 +1,16 @@ {{ dest.label }}, -Un suivi "{{ workflow.text }}" a atteint une nouvelle étape: {{ workflow.text }} +{{ 'workflow.notification.content.new_step_reached'|trans({'%workflow%': workflow.text}) }} -Titre du workflow: "{{ title }}". +{{ 'workflow.notification.content.workflow_title'|trans({'%title%': title}) }} {% if is_dest %} -Vous êtes invités à valider cette étape au plus tôt. +{{ 'workflow.notification.content.validation_needed'|trans }} {% endif %} -Vous pouvez visualiser le workflow sur cette page: +{{ 'workflow.notification.content.view_workflow'|trans }} -{{ absolute_url(path('chill_main_workflow_show', {'id': entity_workflow.id, '_locale': 'fr'})) }} +{{ absolute_url(path('chill_main_workflow_show', {'id': entity_workflow.id, '_locale': dest.locale|default('fr')})) }} -Cordialement, +{{ 'workflow.notification.content.regards'|trans }} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/workflow_notification_on_transition_completed_title.fr.txt.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/workflow_notification_on_transition_completed_title.fr.txt.twig index 9a6bc70a0..0d266cbac 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/workflow_notification_on_transition_completed_title.fr.txt.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/workflow_notification_on_transition_completed_title.fr.txt.twig @@ -1,5 +1,5 @@ {%- if is_dest -%} -Un suivi {{ workflow.text }} demande votre attention: {{ title }} +{{ 'workflow.notification.title.attention_needed'|trans({'%workflow%': workflow.text, '%title%': title}) }} {%- else -%} -Un suivi {{ workflow.text }} a atteint une nouvelle étape: {{ place.text }}: {{ title }} +{{ 'workflow.notification.title.new_step'|trans({'%workflow%': workflow.text, '%place%': place.text, '%title%': title}) }} {%- endif -%} diff --git a/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php b/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php index b325a9345..7ef9eadb2 100644 --- a/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php +++ b/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php @@ -16,11 +16,13 @@ use Symfony\Bridge\Twig\Mime\TemplatedEmail; use Symfony\Component\Mailer\MailerInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; +// use Symfony\Component\Translation\LocaleSwitcher; + class RecoverPasswordHelper { final public const RECOVER_PASSWORD_ROUTE = 'password_recover'; - public function __construct(private readonly TokenManager $tokenManager, private readonly UrlGeneratorInterface $urlGenerator, private readonly MailerInterface $mailer) {} + public function __construct(private readonly TokenManager $tokenManager, private readonly UrlGeneratorInterface $urlGenerator, private readonly MailerInterface $mailer/* , private readonly LocaleSwitcher $localeSwitcher */) {} /** * @param bool $absolute @@ -53,6 +55,24 @@ class RecoverPasswordHelper throw new \UnexpectedValueException('No emaail associated to the user'); } + // Implementation with LocaleSwitcher (commented out - to be activated after migration to sf7.2): + /* + $this->localeSwitcher->runWithLocale($user->getLocale(), function () use ($user, $expiration, $template, $templateParameters, $emailSubject, $additionalUrlParameters) { + $email = (new TemplatedEmail()) + ->subject($emailSubject) + ->to($user->getEmail()) + ->textTemplate($template) + ->context([ + 'user' => $user, + 'url' => $this->generateUrl($user, $expiration, true, $additionalUrlParameters), + ...$templateParameters, + ]); + + $this->mailer->send($email); + }); + */ + + // Current implementation: $email = (new TemplatedEmail()) ->subject($emailSubject) ->to($user->getEmail()) diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php index e8b019bd6..3958b15f0 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php @@ -41,6 +41,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware 'isAbsent' => false, 'absenceStart' => null, 'absenceEnd' => null, + 'enabled' => true, ]; public function __construct(private readonly UserRender $userRender, private readonly ClockInterface $clock) {} @@ -108,6 +109,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware 'isAbsent' => $object->isAbsent(), 'absenceStart' => $this->normalizer->normalize($object->getAbsenceStart(), $format, $absenceDatesContext), 'absenceEnd' => $this->normalizer->normalize($object->getAbsenceEnd(), $format, $absenceDatesContext), + 'enabled' => $object->isEnabled(), ]; if ('docgen' === $format) { diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php index f59b1cd66..33ce83a83 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php @@ -26,6 +26,7 @@ class AddressRender implements ChillEntityRenderInterface 'with_delimiter' => false, 'has_no_address' => false, 'multiline' => true, + 'separator' => ' — ', /* deprecated */ 'extended_infos' => false, ]; @@ -114,7 +115,9 @@ class AddressRender implements ChillEntityRenderInterface public function renderString($addr, array $options): string { - return implode(' — ', $this->renderLines($addr)); + $opts = [...self::DEFAULT_OPTIONS, ...$options]; + + return implode($opts['separator'], $this->renderLines($addr)); } public function supports($entity, array $options): bool diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php index a4d0f48e6..9a808da77 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php @@ -52,7 +52,7 @@ class CommentRender implements ChillEntityRenderInterface public function renderString($entity, array $options): string { - return $entity->getComment(); + return (string) $entity->getComment(); } public function supports($entity, array $options): bool diff --git a/src/Bundle/ChillMainBundle/Tests/Form/Type/ScopePickerTypeTest.php b/src/Bundle/ChillMainBundle/Tests/Form/Type/ScopePickerTypeTest.php index 3d3813748..53ce413d2 100644 --- a/src/Bundle/ChillMainBundle/Tests/Form/Type/ScopePickerTypeTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Form/Type/ScopePickerTypeTest.php @@ -11,11 +11,11 @@ declare(strict_types=1); namespace Form\Type; -use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Form\Type\ScopePickerType; use Chill\MainBundle\Security\Authorization\AuthorizationHelperInterface; +use Chill\MainBundle\Security\Resolver\CenterResolverManagerInterface; use Chill\MainBundle\Templating\TranslatableStringHelperInterface; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder; @@ -39,11 +39,11 @@ final class ScopePickerTypeTest extends TypeTestCase { use ProphecyTrait; - public function estBuildOneScopeIsSuccessful() + public function testBuildOneScopeIsSuccessful() { $form = $this->factory->create(ScopePickerType::class, null, [ - 'center' => new Center(), 'role' => 'ONE_SCOPE', + 'center' => [], ]); $view = $form->createView(); @@ -54,8 +54,8 @@ final class ScopePickerTypeTest extends TypeTestCase public function testBuildThreeScopesIsSuccessful() { $form = $this->factory->create(ScopePickerType::class, null, [ - 'center' => new Center(), 'role' => 'THREE_SCOPE', + 'center' => [], ]); $view = $form->createView(); @@ -66,8 +66,8 @@ final class ScopePickerTypeTest extends TypeTestCase public function testBuildTwoScopesIsSuccessful() { $form = $this->factory->create(ScopePickerType::class, null, [ - 'center' => new Center(), 'role' => 'TWO_SCOPE', + 'center' => [], ]); $view = $form->createView(); @@ -101,10 +101,13 @@ final class ScopePickerTypeTest extends TypeTestCase static fn ($args) => $args[0]['fr'] ); + $centerResolverManager = $this->prophesize(CenterResolverManagerInterface::class); + $type = new ScopePickerType( + $translatableStringHelper->reveal(), $authorizationHelper->reveal(), $security->reveal(), - $translatableStringHelper->reveal() + $centerResolverManager->reveal() ); // add the mocks for creating EntityType diff --git a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php index c58b607e3..2139a44ef 100644 --- a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php @@ -103,6 +103,7 @@ final class UserNormalizerTest extends TestCase 'main_center' => ['context' => Center::class], 'absenceStart' => ['context' => \DateTimeImmutable::class], 'absenceEnd' => ['context' => \DateTimeImmutable::class], + 'enabled' => true, ]]; yield [$userNoPhone, 'docgen', ['docgen:expects' => User::class], @@ -124,6 +125,7 @@ final class UserNormalizerTest extends TestCase 'main_center' => ['context' => Center::class], 'absenceStart' => ['context' => \DateTimeImmutable::class], 'absenceEnd' => ['context' => \DateTimeImmutable::class], + 'enabled' => true, ]]; yield [null, 'docgen', ['docgen:expects' => User::class], [ @@ -144,6 +146,7 @@ final class UserNormalizerTest extends TestCase 'main_center' => ['context' => Center::class], 'absenceStart' => null, 'absenceEnd' => null, + 'enabled' => true, ]]; } } diff --git a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationToUserGroupsOnTransition.php b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationToUserGroupsOnTransition.php index 1eebb03a6..dad18a30c 100644 --- a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationToUserGroupsOnTransition.php +++ b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationToUserGroupsOnTransition.php @@ -22,6 +22,8 @@ use Symfony\Component\Mailer\MailerInterface; use Symfony\Component\Workflow\Event\Event; use Symfony\Component\Workflow\Registry; +// use Symfony\Component\Translation\LocaleSwitcher; + final readonly class NotificationToUserGroupsOnTransition implements EventSubscriberInterface { public function __construct( @@ -31,6 +33,7 @@ final readonly class NotificationToUserGroupsOnTransition implements EventSubscr private MailerInterface $mailer, private EntityManagerInterface $entityManager, private EntityWorkflowManager $entityWorkflowManager, + // private LocaleSwitcher $localeSwitcher, ) {} public static function getSubscribedEvents(): array @@ -87,6 +90,24 @@ final readonly class NotificationToUserGroupsOnTransition implements EventSubscr 'title' => $title, ]; + // Implementation with LocaleSwitcher (commented out - to be activated after migration to sf7.2): + // Note: This sends emails to user groups, not individual users, so locale switching may use default locale + /* + $this->localeSwitcher->runWithLocale('fr', function () use ($context, $userGroup) { + $email = new TemplatedEmail(); + $email + ->htmlTemplate('@ChillMain/Workflow/workflow_notification_on_transition_completed_content_to_user_group.fr.txt.twig') + ->context($context) + ->subject( + $this->engine->render('@ChillMain/Workflow/workflow_notification_on_transition_completed_title.fr.txt.twig', $context) + ) + ->to($userGroup->getEmail()); + + $this->mailer->send($email); + }); + */ + + // Current implementation: $email = new TemplatedEmail(); $email ->htmlTemplate('@ChillMain/Workflow/workflow_notification_on_transition_completed_content_to_user_group.fr.txt.twig') diff --git a/src/Bundle/ChillMainBundle/config/services/form.yaml b/src/Bundle/ChillMainBundle/config/services/form.yaml index e917b37c9..ab7a49c68 100644 --- a/src/Bundle/ChillMainBundle/config/services/form.yaml +++ b/src/Bundle/ChillMainBundle/config/services/form.yaml @@ -12,6 +12,12 @@ services: tags: - { name: form.type, alias: translatable_string } + Chill\MainBundle\Form\Type\UserLocaleType: + arguments: + - "%chill_main.available_languages%" + tags: + - { name: form.type } + chill.main.form.type.select2choice: class: Chill\MainBundle\Form\Type\Select2ChoiceType tags: diff --git a/src/Bundle/ChillMainBundle/migrations/Version20251022140718.php b/src/Bundle/ChillMainBundle/migrations/Version20251022140718.php new file mode 100644 index 000000000..733bf5da1 --- /dev/null +++ b/src/Bundle/ChillMainBundle/migrations/Version20251022140718.php @@ -0,0 +1,33 @@ +<?php + +declare(strict_types=1); + +/* + * Chill is a software for social workers + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Chill\Migrations\Main; + +use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; + +final class Version20251022140718 extends AbstractMigration +{ + public function getDescription(): string + { + return 'Add locale field to users table for user language preferences'; + } + + public function up(Schema $schema): void + { + $this->addSql('ALTER TABLE users ADD locale VARCHAR(5) DEFAULT \'fr\' NOT NULL'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE users DROP locale'); + } +} diff --git a/src/Bundle/ChillMainBundle/translations/date.nl.yml b/src/Bundle/ChillMainBundle/translations/date.nl.yml new file mode 100644 index 000000000..ad134564c --- /dev/null +++ b/src/Bundle/ChillMainBundle/translations/date.nl.yml @@ -0,0 +1,7 @@ +#diff ago. See doc here : http://twig.sensiolabs.org/doc/extensions/date.html +diff.ago.second: '{0} Nu | {1} Een seconde geleden | ]1,Inf] %count% seconden geleden' +diff.ago.minute: '{0} Nu | {1} Een minuut geleden | ]1,Inf] %count% minuten geleden' +diff.ago.hour: '{1} Een uur geleden | ]1,Inf] %count% uur geleden' +diff.ago.day: '{1} Gisteren | ]1,Inf] %count% dagen geleden' +diff.ago.month: '{1} Vorige maand | ]1,Inf] %count% maanden geleden' +diff.ago.year: '{1} Een jaar geleden | ]1,Inf] %count% jaar geleden' diff --git a/src/Bundle/ChillMainBundle/translations/messages+intl-icu.nl.yaml b/src/Bundle/ChillMainBundle/translations/messages+intl-icu.nl.yaml new file mode 100644 index 000000000..d95a19aab --- /dev/null +++ b/src/Bundle/ChillMainBundle/translations/messages+intl-icu.nl.yaml @@ -0,0 +1,155 @@ +years_old: >- + {age, plural, + one {# jaar} + many {# jaar} + other {# jaar} + } + +user_group: + with_count_users: >- + {count, plural, + =0 {Geen lid} + one {1 gebruiker} + many {# gebruikers} + other {# gebruikers} + } + user_removed: Gebruiker {user} is succesvol verwijderd uit groep {user_group} + user_added: Gebruiker {user} is succesvol toegevoegd aan groep {user_group} + label_related_to_user_job: Groep {job} (Beroepsgroep) + +notification: + My notifications with counter: >- + {nb, plural, + =0 {Mijn meldingen} + one {# melding} + few {# meldingen} + other {# meldingen} + } + + counter total notifications: >- + {total, plural, + =0 {Geen melding} + one {# melding} + few {# meldingen} + other {# meldingen} + } + + counter unread notifications: >- + {unread, plural, + =0 {Geen ongelezen} + one {# ongelezen} + few {# ongelezen} + other {# ongelezen} + } + counter comments: >- + {nb, plural, + =0 {Geen opmerking} + one {# opmerking} + few {# opmerkingen} + other {# opmerkingen} + } + +daily_notifications: >- + {notification_count, plural, + =1 {Hier is uw melding van de dag:} + other {Hier zijn uw # meldingen van de dag:} + } + +workflow: + My workflows with counter: >- + {wc, plural, + =0 {Mijn workflows} + one {# workflow} + few {# workflows} + other {# workflows} + } + signature: + signed_statement: 'Handtekening toegepast op {datetime, date, short} om {datetime, time, short}' + rejected_statement: 'Handtekening geweigerd op {datetime, date, short} om {datetime, time, short}' + canceled_statement: 'Handtekening geannuleerd op {datetime, date, short} om {datetime, time, short}' + On hold by: In afwachting door {by} + signature_required_title: >- + {nb_signatures, plural, + =0 {Geen handtekening gevraagd} + one {Handtekening gevraagd} + other {Handtekeningen gevraagd} + } + signatures_title: >- + {nb_signatures, plural, + =0 {Geen handtekening} + one {Handtekening} + other {Handtekeningen} + } + pending_signatures: >- + {nb_signatures, plural, + =0 {Geen handtekening gevraagd} + one {Eén handtekening gevraagd} + other {# handtekeningen gevraagd} + } + send_external_message: + document_available_until: De link is geldig tot {expiration, date, long} om {expiration, time, short}. + explanation: '{sender} stuurt u documenten.' + button_content: 'Documenten bekijken die zijn verzonden door {sender}' + confidentiality: Wij vestigen uw aandacht op het feit dat deze documenten vertrouwelijk zijn. + see_doc_action_description: 'Vertrouwelijke documenten bekijken die zijn verzonden door {sender}' + + external_views: + title: >- + {numberOfSends, plural, + =0 {In afwachting van raadpleging} + =1 {In afwachting van raadpleging} + other {In afwachting van raadplegingen} + } + last_view_at: Laatst bekeken op {at, date, long} om {at, time, short} + number_of_views: >- + {numberOfViews, plural, + =0 {De deling is nooit bekeken} + =1 {De deling is één keer bekeken} + other {De deling is # keer bekeken} + } + public_link: + shared_explanation_until_remaining: >- + Deze deling is actief tot {expireAt, date, long} om {expireAt, time, short}. {viewsCount, plural, + =0 {Deze deling is nog niet bekeken} + one {Deze deling is één keer bekeken} + other {Deze deling is # keer bekeken} + }, {viewsRemaining, plural, + =0 {er zijn geen weergaven meer mogelijk.} + one {er is nog één weergave mogelijk.} + other {er zijn nog # weergaven mogelijk.} + } + +duration: + minute: >- + {m, plural, + =0 {Geen duur} + one {# minuut} + few {# minuten} + other {# minuten} + } + hour: >- + {h, plural, + =0 {Geen duur} + one {# uur} + few {# uur} + other {# uur} + } + day: >- + {d, plural, + =0 {Geen duur} + one {# dag} + few {# dagen} + other {# dagen} + } + +filter_order: + by_date: + From: Vanaf {from_date, date, long} + To: Tot {to_date, date, long} + By: Filteren op + Search: Zoeken in de lijst + By date: Filteren op datum + search_box: Filteren op inhoud + +absence: + You are listed as absent, as of {date, date, short}: Uw afwezigheid is aangegeven vanaf {date, date, short} diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index 797aa6383..b6343312e 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -56,6 +56,10 @@ user: no job: Pas de métier assigné no scope: Pas de service assigné notification_preferences: Préférences pour mes notifications + locale: + label: Langue de communication + help: Langue utilisée pour les notifications par email et autres communications. + placeholder: Choisissez une langue user_group: inactive: Inactif @@ -668,6 +672,17 @@ workflow: reject_are_you_sure: Êtes-vous sûr de vouloir rejeter la signature de %signer% waiting_for: En attente de modification de l'état de la signature + notification: + title: + attention_needed: "Attention requise dans le workflow %workflow% pour %title%" + new_step: "Nouvelle étape dans le workflow %workflow% (%place%) pour %title%" + content: + new_step_reached: "Une nouvelle étape a été atteinte dans le workflow %workflow%." + workflow_title: "Titre du workflow : %title%" + validation_needed: "Votre validation est nécessaire pour cette étape." + view_workflow: "Vous pouvez consulter le workflow ici :" + regards: "Cordialement," + attachments: title: Pièces jointes no_attachment: Aucune pièce jointe @@ -747,7 +762,22 @@ notification: greeting: "Bonjour %user%" intro: "Vous avez reçu %notification_count% nouvelle(s) notification(s)." view_notification: "Vous pouvez visualiser la notification et y répondre ici:" - signature: "Le logiciel Chill" + signature: "L'équipe Chill" + +daily_notifications: "{1}Vous avez 1 nouvelle notification.|]1,Inf[Vous avez %notification_count% nouvelles notifications." + +docgen: + failure_email: + "The generation of a document failed": "La génération d'un document a échoué" + "The generation of the document %template_name% failed": "La génération du document %template_name% a échoué" + "Forward this email to your administrator for solving": "Transmettez cet email à votre administrateur pour résolution" + "References": "Références" + "The following errors were encoutered": "Les erreurs suivantes ont été rencontrées" + data_dump_email: + subject: "Export de données disponible" + "Dear": "Cher utilisateur," + "data_dump_ready_and_attached": "Votre export de données est prêt et joint à cet email." + "filename": "Nom du fichier : %filename%" CHILL_MAIN_COMPOSE_EXPORT: Exécuter des exports et les sauvegarder CHILL_MAIN_GENERATE_SAVED_EXPORT: Exécuter et modifier des exports préalablement sauvegardés @@ -975,3 +1005,6 @@ multiselect: editor: switch_to_simple: Éditeur simple switch_to_complex: Éditeur riche + +login_page: + logo_alt: "Logo de Chill" diff --git a/src/Bundle/ChillMainBundle/translations/messages.nl.yml b/src/Bundle/ChillMainBundle/translations/messages.nl.yml index 22bb6a50e..4cdf4f8a2 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.nl.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.nl.yml @@ -1,55 +1,93 @@ -"This program is free software: you can redistribute it and/or modify it under the terms of the <strong>GNU Affero General Public License</strong>": "Ce programme est un logiciel libre: vous pouvez le redistribuer et/ou le modifier selon les termes de la licence <strong>GNU Affero GPL</strong>" +"This program is free software: you can redistribute it and/or modify it under the terms of the <strong>GNU Affero General Public License</strong>": "Dit programma is vrije software: u kunt het herdistribueren en/of wijzigen onder de voorwaarden van de <strong>GNU Affero GPL</strong>-licentie" User manual: Gebruikershandleiding Search: Zoeken -"Search persons, ...": "Zoek personen, ..." -Person name: Naam / voornaam persoon +"Search persons, ...": "Gebruikers zoeken, ..." +Person name: Naam / Voornaam van de gebruiker Login: Inloggen Logout: Uitloggen -Bad credentials.: Een verkeerd wachtwoord of gebruikersnaam werd opgegeven. -Invalid CSRF token.: Uw sessie is verlopen. +Bad credentials.: Het wachtwoord en de gebruikersnaam komen niet overeen. +Invalid CSRF token.: Uw sessie is verlopen of ongeldig geworden. Username: Gebruikersnaam username: gebruikersnaam Password: Wachtwoord Welcome to %installation_name%: Welkom bij %installation_name% Login to %installation_name%: Inloggen op %installation_name% -Enabled: Ingeschakeld -enabled: ingeschakeld -disabled: uitgeschakeld -Disabled: Uitgeschakeld -Id: Id -Homepage: Hoofdpagina +Enabled: Geactiveerd +enabled: geactiveerd +disabled: gedeactiveerd +Disabled: Gedeactiveerd +Id: identificatie +Homepage: Startpagina Welcome: Welkom Export Menu: Export -Admin Menu: Admin menu +Admin Menu: Beheerdersmenu Details: Details yes: ja no: nee valid: geldig Valid: Geldig -Not valid: Ongeldig -not valid: ongeldig +Not valid: Niet geldig +not valid: niet geldig Confirm: Bevestigen Cancel: Annuleren Save: Opslaan This form contains errors: Dit formulier bevat fouten -Choose an user: Kies een gebruiker -"You are going to leave a page with unsubmitted data. Are you sure you want to leave ?": "U verlaat een pagina waarvan de gegevens niet werden opgeslagen. Bent u zeker deze pagina te willen verlaten?" +Choose an user: Gebruiker kiezen +"You are going to leave a page with unsubmitted data. Are you sure you want to leave ?": "U gaat de pagina verlaten terwijl gegevens niet zijn opgeslagen. Weet u zeker dat u wilt vertrekken?" No value: Geen informatie Last updated by: Laatste update door on: "op " Last updated on: Laatste update op by_user: "door " -lifecycleUpdate: Updates en creatie gebeurtenissen -address_fields: Gegevens gelinked aan het adres +lifecycleUpdate: Gebeurtenissen van aanmaak en update +address_fields: Gegevens gerelateerd aan het adres Datas: Gegevens No title: Geen titel -User profile: Mijn gebruikersprofiel -Phonenumber successfully updated!: Telefoonnummer bijgewerkt! +icon: pictogram +See: Bekijken +Name: Naam +Label: Naam +user: + current_user: Huidige gebruiker + profile: + title: Mijn profiel + Profile successfully updated!: Uw profiel is bijgewerkt! + no job: Geen toegewezen beroep + no scope: Geen toegewezen dienst + notification_preferences: Voorkeuren voor mijn meldingen + locale: + label: Communicatietaal + help: Taal gebruikt voor e-mailmeldingen en andere communicatie. + placeholder: Kies een taal + +user_group: + inactive: Inactief + with_users: Leden + no_users: Geen gekoppelde gebruiker + no_user_groups: Geen gebruikersgroep + no_admin_users: Geen beheerder + Label: Naam van de groep + BackgroundColor: Achtergrondkleur van de badge + ForegroundColor: Letterkleur van de badge + ExcludeKey: Uitsluitingssleutel + ExcludeKeyHelp: Indien relevant, sluiten groepen met dezelfde uitsluitingssleutel elkaar wederzijds uit. + Users: Leden van de groep + adminUsers: Beheerders van de groep + adminUsersHelp: Groepsbeheerders kunnen leden toevoegen of verwijderen uit de groep. + my_groups: Mijn groepen + me_and: Ik en + me_only: Alleen ik + me: Ik + append_users: Gebruikers toevoegen + Email: E-mailadres van de groep + EmailHelp: Indien ingevuld, worden aanvullende meldingen verzonden naar het e-mailadres van de groep (workflow in afwachting, enz.) + +inactive: inactief Edit: Bewerken -Update: Updaten -Back to the list: Terug naar overzicht +Update: Bijwerken +Back to the list: Terug naar de lijst #interval Years: Jaren @@ -61,17 +99,26 @@ Until %date%: Tot %date% until %date%: tot %date% Since: Sinds Until: Tot + +updatedAt: Bijgewerkt op +updatedBy: Bijgewerkt door +createdAt: Aangemaakt op +createdBy: Aangemaakt door + #elements used in software -centers: centra -Centers: Centra -comment: opmerkingen -Comment: Opmerkingen -Pinned comment: Gepinde opmerking -Any comment: Geen opmerkingen -Read more: Meer lezen +centers: territoria +Centers: Territoria +center: territorium +comment: opmerking +Comment: Opmerking +Comments: Opmerkingen +Pinned comment: Vastgezette opmerking +Any comment: Geen opmerking +(more...): (vervolg...) # comment embeddable -No comment associated: Geen opmerkingen +No comment associated: Geen opmerking +private comment: Privé notities #pagination Previous: Vorige @@ -82,136 +129,195 @@ Street address1: Adres regel 1 Street address2: Adres regel 2 Postal code: Postcode Valid from: Geldig vanaf -Choose a postal code: Kies een postcode +Choose a postal code: Postcode kiezen address: - address_homeless: Betreft dit een domicilie adres ? - real address: Domicilie adres - consider homeless: Dit adres is onvolledig + address_homeless: Is het adres een vaste woonplaats? + real address: Adres van een woonplaats + consider homeless: Dit adres is onvolledig + add_an_address_title: Adres aanmaken + edit_an_address_title: Adres bewerken + create_a_new_address: Nieuw adres aanmaken + edit_address: Adres bewerken + select_an_address_title: Adres selecteren + fill_an_address: Adres aanvullen + select_country: Land kiezen + country: Land + select_city: Plaats kiezen + city: Plaats + other_city: Andere plaats + select_address: Adres kiezen + address: Adres + other_address: Ander adres + create_address: Adres onbekend. Klik hier om een nieuw adres aan te maken + isNoAddress: Geen volledig adres + isConfidential: Vertrouwelijk adres + street: Straatnaam + streetNumber: Nummer + floor: Verdieping + corridor: Gang + steps: Trap + flat: Appartement + buildingName: Wooncomplex + extra: Adrestoevoeging + distribution: Cedex + create_postal_code: Plaats onbekend. Klik hier om een nieuwe plaats aan te maken + postalCode_name: Naam + postalCode_code: Postcode + date: Datum van het nieuwe adres + valid_from: Het adres is geldig vanaf + valid_to: Het adres is geldig tot + back_to_the_list: Terug naar de lijst + loading: laden... + address_suggestions: Adressuggestie + address_new_success: Het nieuwe adres is opgeslagen. + address_edit_success: Het adres is bijgewerkt. + wait_redirection: De pagina wordt doorverwezen. + not_yet_address: Er is nog geen adres. Klik op '+ Adres aanmaken' + use_this_address: Dit adres gebruiken + household: + move_date: Verhuisdatum + address more: - floor: verd. - corridor: gang - steps: trap - flat: appart. - buildingName: residentie - extra: "" - distribution: cedex -Create a new address: Maak een nieuw adres aan -Create an address: Maak een adres aan -Update address: Bewerk het adres + floor: verd + corridor: gang + steps: trap + flat: app + buildingName: complex + extra: "" + distribution: cedex +Create a new address: Nieuw adres aanmaken +Create an address: Adres aanmaken +Update address: Adres bewerken City or postal code: Stad of postcode # contact Part of the phonenumber: Deel van het telefoonnummer #serach -Your search is empty. Please provide search terms.: De zoekopdracht is leeg. Gelieve een zoekterm op te geven. -The domain %domain% is unknow. Please check your search.: Het zoekgebied "%domain%" is ongekend. Gelieve uw zoekopdracht te verifiëren. +Your search is empty. Please provide search terms.: De zoekopdracht is leeg. Geef zoektermen op. +The domain %domain% is unknow. Please check your search.: Het zoekdomein "%domain%" is onbekend. Controleer uw zoekopdracht. Invalid terms: Ongeldige zoekopdracht -You should not have more than one domain.: Gelieve slechts één zoekgebied op te geven. +You should not have more than one domain.: U mag niet meer dan één zoekdomein hebben. #used for page title -Search %pattern%: Zoek "%pattern%" +Search %pattern%: Zoeken naar "%pattern%" Results %start%-%end% of %total%: Resultaten %start%-%end% van %total% -See all results: Alle resultaten zien -Advanced search: Geavanceerde zoekopdracht +See all results: Alle resultaten bekijken +Advanced search: Geavanceerd zoeken results: resultaten # timeline -Global timeline: Globale tijdslijn +Global timeline: Globale geschiedenis #admin Create: Aanmaken show: bekijken Show: Bekijken edit: bewerken -Main admin menu: Hoofdmenu admin +Main admin menu: Hoofdmenu beheer Actions: Acties Users and permissions: Gebruikers en rechten -Location and location type: Vestigingen en vestiging types +Location and location type: Locaties en locatietypes +Back to the admin: Beheermenu +"Administration interface": Beheerinterface +Welcome to the admin section !: > + Welkom in de beheerinterface! #permissions -Permissions Menu: Beheer rechten -Permissions management of your chill installation: Beheer rechten voor deze Chill installatie. +Permissions Menu: Rechtenbeheer +Permissions management of your chill installation: Rechtenbeheer van uw instantie #location -Location Menu: Vestigingen en vestiging types -Management of location: Beheer vestigingen en vestiging types - -#admin section -"Administration interface": Admin paneel -Welcome to the admin section !: > - Welkom op het admin paneel ! +Location Menu: Locaties en locatietypes +Management of location: Beheer van locaties en locatietypes #admin section for center's administration -Create a new center: Maak een nieuw centrum aan -Center list: Overzicht centra -Center edit: Bewerk een centrum -Center creation: Aanmaak centrum -New center: Nieuw centrum -Center: Centrum +Create a new center: Nieuw territorium aanmaken +Center list: Lijst van territoria +Center edit: Territorium bewerken +Center creation: Territorium aanmaken +New center: Nieuw territorium +Center: Territorium #admin section for permissions group -Permissions group list: Groepsrechten -Create a new permissions group: Maak een nieuw groepsrecht aan -Permission group "%name%": Groepsrecht "%name%" -Grant those permissions: Rechten toekennen -Which implies: Wat impliceert -Permission group: Groepsrecht -Permissionsgroup: Groepsrecht -New permission group: Nieuw groepsrecht -PermissionsGroup "%name%" edit: Bewerk groepsrecht '%name%' +Permissions group list: Rechtengroepen +Create a new permissions group: Nieuwe rechtengroep aanmaken +Permission group "%name%": Rechtengroep "%name%" +Grant those permissions: Kent deze rechten toe +Which implies: Wat inhoudt +Permission group: Rechtengroep +Permissionsgroup: Rechtengroep +New permission group: Nieuwe rechtengroep +PermissionsGroup "%name%" edit: Rechtengroep '%name%' bewerken Role: Rol -Choose amongst roles: Kies een rol +Choose amongst roles: Rol kiezen +Choose amongst scopes: Dienst kiezen Add permission: Rechten toevoegen -This group does not provide any permission: Deze groep kent geen rechten toe. -The role '%role%' has been removed: De rol "%role%" werd verwijdert uit dit groepsrecht. -The role '%role%' on circle '%scope%' has been removed: De rol "%role%" binnen de cirkel "%scope%" werd verwijdert uit dit groepsrecht. +This group does not provide any permission: Deze groep kent geen rechten toe +The role '%role%' has been removed: De rol "%role%" is verwijderd uit deze rechtengroep +The role '%role%' on circle '%scope%' has been removed: De rol "%role%" op dienst "%scope%" is verwijderd uit deze rechtengroep +Unclassified: Niet geclassificeerd +Help to pick role and scope: Sommige rollen vereisen geen dienst. +The role need scope: Deze rol vereist een dienst. +The role does not need scope: Deze rol vereist geen dienst! #admin section for users +User configuration: Gebruikersbeheer User edit: Gebruiker bewerken -User'status: Gebruikersstatuut -Disabled, the user is not allowed to login: Uitgeschakeld, de gebruiker krijgt geen toestemming om in te loggen. -Enabled, the user is active: Ingeschakeld, de gebruiker kan zich inloggen. -Edit password: Wachtwoord aanpassen +User'status: Status van de gebruiker +Disabled, the user is not allowed to login: Gedeactiveerd, de gebruiker mag niet inloggen +Enabled, the user is active: Actief, de gebruiker kan inloggen +Edit password: Wachtwoord bewerken Repeat the password: Wachtwoord herhalen -Permissions granted: Rechten toegekend -Any permissions granted to this user: Geen enkele rechten werden toegekend aan deze gebruiker +Permissions granted: Toegekende rechten +Any permissions granted to this user: Geen rechten toegekend aan deze gebruiker Grant new permissions: Rechten toevoegen Add a new groupCenter: Rechten toevoegen -The permissions have been successfully added to the user: De rechten werden toegekend aan de gebruiker -The permissions where removed.: De rechten werden verwijdert voor dze gebruiker -Center & groups: Centra en groepen +The permissions have been successfully added to the user: De rechten zijn toegekend aan de gebruiker +The permissions where removed.: De rechten zijn verwijderd. +Center & groups: Territorium en groepen User %username%: Gebruiker %username% Add a new user: Nieuwe gebruiker toevoegen -The permissions have been added: De rechten werden toegevoegd -Edit password for %username%: Wachtwoord voor %username% aanpassen -Change password: Wachtwoord aanpassen -Back to the user edition: Terugkeren naar bewerkingsformulier -Password successfully updated!: Wachtwoord opgeslagen +The permissions have been added: De rechten zijn toegevoegd +Edit password for %username%: Wachtwoord bewerken voor %username% +Change password: Wachtwoord wijzigen +Back to the user edition: Terug naar bewerkingsformulier +Password successfully updated!: Wachtwoord bijgewerkt Flags: Vlaggen +Main location: Hoofdlocatie +Main scope: Dienst +Main center: Territorium +user job: Beroep van de gebruiker +Job: Beroep +Jobs: Beroepen +Choose a main center: Territorium kiezen +Choose a main scope: Dienst kiezen +choose a job: Beroep kiezen +choose a location: Locatie kiezen # admin section for users jobs User jobs: Beroepen # user page for current location -Current location: Huidige vestiging -Edit my current location: Mijn huidige vestiging bewerken -Change current location: CMijn huidige vestiging vernanderen -Set a location: Een vestiging instellen -Current location successfully updated: Huidige vestiging werd opgeslagen -Pick a location: Kies een vestiging. +Current location: Huidige locatie +Edit my current location: Mijn huidige locatie bewerken +Change current location: Huidige locatie wijzigen +Set a location: Locatie aangeven +Current location successfully updated: Huidige locatie bijgewerkt +Pick a location: Locatie kiezen #admin section for circles (old: scopes) -List circles: Cirkels -New circle: Nieuwe cirkel -Circle: Cirkel -Circle edit: Cirkel bewerken -Circle creation: Cirkel aanmaken -Create a new circle: Nieuwe cirkel aanmaken +List circles: Diensten +New circle: Nieuwe dienst +Circle: Dienst +Circle edit: Dienst bewerken +Circle creation: Dienst aanmaken +Create a new circle: Nieuwe dienst aanmaken #admin section for location -Location: Vestigingen -Location type list: Vestiging types -Create a new location type: Nieuwe type vestiging aanmaken +Location: Locatie +pick location: Locatie +Location type list: Lijst van locatietypes +Create a new location type: Nieuw locatietype aanmaken Available for users: Beschikbaar voor gebruikers Editable by users: Bewerkbaar door gebruikers Address required: Adres vereist? @@ -219,251 +325,686 @@ Contact data: Contactgegevens? optional: optioneel required: vereist never: nooit -Create a new location: Nieuwe vestiging aanmaken -Location list: Overzicht vestigingen -Location type: Type vestiging -Phonenumber1: Telefoonnummer 1 -Phonenumber2: Telefoonnummer 2 -Configure location and location type: Configureer vestigingen en types vestiging -Default for: Standaard vestiging +Create a new location: Nieuwe locatie aanmaken +Location list: Lijst van locaties +Location type: Locatietype +Pick a location type: Locatietype kiezen +Phonenumber1: Telefoonnummer +Phonenumber2: Ander telefoonnummer +Location configuration: Configuratie van locaties +Default for: Standaard locatietype voor none: geen person: gebruiker -thirdparty: externe partner +thirdparty: derde +civility: aanspreekvorm + +#admin section for civility +abbreviation: afkorting + +#admin section for language and country +Language and countries menu: Menu Talen & Landen +Languages and countries: Talen & Landen +Management of languages and countries: Beheer van talen & landen +Language configuration: Configuratie van talen & landen +Language list: Lijst van talen +Country list: Lijst van landen +Country code: Landcode # circles / scopes -Choose the circle: Kies een cirkel +Choose the circle: Dienst kiezen +Scope: Dienst Scopes: Diensten #export # export creation step 0 : list of exports -Exports list: Overzicht rapporten -Create an export: Maak een rapport aan +Exports list: Lijst van exports +Create an export: Export aanmaken #export creation step 'center' : pick a center -Pick centers: Kies centra -Pick a center: Kies een centrum -The export will contains only data from the picked centers.: het rapport zal enkel data bevatten voor het geselecteerde centrum. -This will eventually restrict your possibilities in filtering the data.: De filterkeuzes zullen worden aangepast aan de rechten tot raadpleging van de geselecteerde centra. -Go to export options: Ga naar de rapport opties -Pick aggregated centers: Hergroepering centra +Pick centers: Territoria kiezen +Pick a center: Territorium kiezen +The export will contains only data from the picked centers.: De export bevat alleen gegevens van de gekozen territoria. +This will eventually restrict your possibilities in filtering the data.: De filtermogelijkheden worden aangepast aan de raadplegingsrechten voor de gekozen territoria. +Go to export options: Naar de voorbereiding van de export +Pick aggregated centers: Groepering van territoria +uncheck all centers: Alle territoria deselecteren +check all centers: Alle territoria selecteren # export creation step 'export' : choose aggregators, filtering and formatter -Formatter: Formateren -Choose the formatter: Kies het gewenste formaat voor dit rapport. -Export parameters: Rapport parameters +Formatter: Opmaak +Choose the formatter: Kies het gewenste exportformaat. +Export parameters: Exportparameters Filters: Filters -Aggregators: Aggregaten -Go to formatter options: Naar de formateeropties -Choose a format: Kies een formaat +Aggregators: Aggregators +Go to formatter options: Naar de opmaakmogelijkheden +Choose a format: Formaat kiezen #export creation step 'formatter' : choose formatter option Generate the report: Rapport genereren -No options availables. Your report is fully configured.: Geen beschikbare opties. Dit rapport werd volledig geconfigureerd. -Ungrouped exports: Overige expor +No options availables. Your report is fully configured.: Geen opties beschikbaar. Uw rapport is al geconfigureerd. +Ungrouped exports: Andere exports #export download -Download export: Downloaden van rapport -Waiting for your report: Wachten op je rapport -Download your report: Télécharger votre rapport -Problem during download: Problème durant le téléchargement +Download export: Rapport downloaden +Waiting for your report: Wachten op uw rapport +Download your report: Uw rapport downloaden +Problem during download: Probleem tijdens het downloaden # sans valeur -without data: sans valeur +without data: zonder waarde #CSV List Formatter -Add a number on first column: La première colonne est un numéro -Number: Numéro +Add a number on first column: De eerste kolom is een nummer +Number: Nummer # the label which appears in the UI -CSV vertical list: Liste verticale au format CSV -CSV horizontal list: Liste horizontale au format CSV -Spreadsheet list formatter (.xlsx, .ods): Liste au format tableur (.xlsx, .ods) -Order: Ordre -Position: Position -row: ligne -column: colonne -Comma separated values (CSV): Valeurs séparées par des virgules (CSV - tableur) +CSV vertical list: Verticale lijst in CSV-formaat +CSV horizontal list: Horizontale lijst in CSV-formaat +Spreadsheet list formatter (.xlsx, .ods): Lijst in spreadsheetformaat (.xlsx, .ods) +Order: Volgorde +Position: Positie +row: rij +column: kolom +Comma separated values (CSV): Kommagescheiden waarden (CSV - spreadsheet) # spreadsheet formatter -Choose the format: Choisir le format +Choose the format: Formaat kiezen # select2 -"select2.no_results": Aucun résultat -"select2.error_loading": Erreur de chargement des résultats -"select2.searching": Recherche en cours... +"select2.no_results": Geen resultaat +"select2.error_loading": Fout bij het laden van de resultaten +"select2.searching": Zoeken... # change password -Change my password: Modification du mot de passe -Your actual password: Mot de passe actuel +Change my password: Wachtwoord wijzigen +Your actual password: Huidig wachtwoord # recover password -Forgot your password ?: Mot de passe oublié ? -Recover password: Remplacement du mot de passe -Username or email: Nom d'utilisateur ou email -Request recover: Demande de remplacement -Check your email: Vérifiez votre courriel -An email has been sent to your address. Click on the link inside this email to confirm that you are the owner of this account.: Un courriel a été envoyé à votre adresse. Cliquez sur le lien de cet email pour confirmer que vous êtes bien le propriétaire de ce compte. -You requested to recover your password: Vous avez demandé à renouveler votre mot de passe. -Click on the link below to recover your password: Cliquez sur le lien ci-dessous pour re-générer votre mot de passe -Regards,: Cordialement, -Your administrator: Votre administrateur -Recover your password: Regénération du mot de passe -New password set: Le nouveau mot de passe est enregistré -Your password has been set.: Votre mot de passe a été changé. -Log in with your new password: Connectez-vous avec votre nouveau mot de passe +Forgot your password ?: Wachtwoord vergeten? +Recover password: Wachtwoord vervangen +Username or email: Gebruikersnaam of e-mail +Request recover: Verzoek tot vervanging +Check your email: Controleer uw e-mail +An email has been sent to your address. Click on the link inside this email to confirm that you are the owner of this account.: Er is een e-mail verzonden naar uw adres. Klik op de link in deze e-mail om te bevestigen dat u de eigenaar van dit account bent. +You requested to recover your password: U hebt gevraagd om uw wachtwoord te vernieuwen. +Click on the link below to recover your password: Klik op onderstaande link om uw wachtwoord te hergenereren +Regards,: Met vriendelijke groet, +Your administrator: Uw beheerder +Recover your password: Wachtwoord hergenereren +New password set: Het nieuwe wachtwoord is opgeslagen +Your password has been set.: Uw wachtwoord is gewijzigd. +Log in with your new password: Log in met uw nieuwe wachtwoord # impersonate -Exit impersonation: Retour Administrateur -Impersonate: Incarner l'utilisateur -Impersonate mode: Mode fantôme +Exit impersonation: Terug beheerder +Impersonate: Gebruiker incarneren +Impersonate mode: Fantoom-modus crud: - # general items - new: - button_action_form: Créer - link_edit: Modifier - save_and_close: Créer & fermer - save_and_show: Créer & voir - save_and_new: Créer & nouveau - success: Les données ont été créées - edit: - button_action_form: Enregistrer - back_to_view: Voir - save_and_close: Enregistrer & fermer - save_and_show: Enregistrer & voir - success: Les données ont été modifiées - delete: - success: Les données ont été supprimées - link_to_form: Supprimer - default: - success: Les données ont été enregistrées - view: - link_duplicate: Dupliquer - admin_user: - index: - title: Utilisateurs - add_new: Créer - admin_user_job: - index: - title: Métiers - add_new: Créer - title_new: Nouveau métier - title_edit: Modifier un métier - main_location_type: - title_new: Nouveau type de localisation - title_edit: Modifier un type de localisation - main_location: - title_new: Nouvelle localisation - title_edit: Modifier une localisation + # general items + new: + button_action_form: Aanmaken + link_edit: Bewerken + save_and_close: Aanmaken & sluiten + save_and_show: Aanmaken & bekijken + save_and_new: Aanmaken & nieuw + success: De gegevens zijn aangemaakt + edit: + button_action_form: Opslaan + back_to_view: Bekijken + save_and_close: Opslaan & sluiten + save_and_show: Opslaan & bekijken + success: De gegevens zijn gewijzigd + delete: + success: De gegevens zijn verwijderd + link_to_form: Verwijderen + default: + success: De gegevens zijn opgeslagen + view: + link_duplicate: Dupliceren + admin_user: + index: + title: Gebruikers + add_new: Aanmaken + title_edit: Gebruiker bewerken + title_new: Gebruiker aanmaken + admin_user_job: + index: + title: Beroepen + add_new: Aanmaken + title_new: Nieuw beroep + title_edit: Beroep bewerken + admin_user_group: + index: + title: Gebruikersgroepen + add_new: Aanmaken + title_edit: Gebruikersgroep bewerken + title_new: Nieuwe gebruikersgroep + main_location_type: + index: + title: Lijst van locatietypes + add_new: Locatietype toevoegen + title_new: Nieuw locatietype + title_edit: Locatietype bewerken + main_location: + index: + title: Lijst van locaties + add_new: Locatie toevoegen + title_new: Nieuwe locatie + title_edit: Locatie bewerken + main_language: + index: + title: Lijst van talen + add_new: Taal toevoegen + title_new: Nieuwe taal + title_edit: Taal bewerken + main_country: + index: + title: Lijst van landen + add_new: Land toevoegen + title_new: Nieuw land + title_edit: Land bewerken + main_civility: + index: + title: Lijst van aanspreekvormen + add_new: Aanspreekvorm toevoegen + title_new: Nieuwe aanspreekvorm + title_edit: Aanspreekvorm bewerken + regroupment: + index: + title: Lijst van groeperingen + add_new: Groepering toevoegen + title_new: Nieuwe groepering + title_edit: Groepering bewerken + center: + index: + title: Lijst van territoria + add_new: Territorium toevoegen + title_new: Nieuw territorium + title_edit: Territorium bewerken + news_item: + index: + title: Lijst van actualiteiten + add_new: Nieuwe actualiteit aanmaken + title_new: Nieuwe actualiteit + title_view: Actualiteit bekijken + title_edit: Actualiteit bewerken + title_delete: Actualiteit verwijderen + button_delete: Verwijderen + confirm_message_delete: Weet u zeker dat u de actualiteit "%as_string%" wilt verwijderen? + main_gender: + index: + title: Lijst van geslachten + add_new: Geslacht toevoegen + title_new: Nieuw geslacht + title_edit: Geslacht bewerken -No entities: Aucun élément +No entities: Geen element -CHILL_FOO_SEE: Voir un élément -CHILL_FOO_EDIT: Modifier un élément +CHILL_FOO_SEE: Element bekijken +CHILL_FOO_EDIT: Element bewerken +chill_export: Exports (statistieken) #Show templates -Date: Date -By: Par -For: Pour -Created for: Créé pour -Created by: Créé par -Created on: Créé le +Date: Datum +By: Door +For: Voor +Created for: Aangemaakt voor +Created by: Aangemaakt door +Created on: Aangemaakt op # Workflows 💊 -Workflow: Workflow — chemin de décision -Workflow n°%id%: 'Workflow (n°%id%)' +Workflow: Workflow — beslissingspad +Workflow n°%id%: 'Workflow (nr. %id%)' workflow_: Workflow -target: ' (cible)' -Decision: Décision -Join a comment: Laisser un commentaire -Follow workflow: Suivre la décision -Workflow history: Historique de la décision +target: ' (doel)' +Decision: Beslissing +Join a comment: Opmerking achterlaten +Follow workflow: Beslissing volgen +Workflow history: Beslissingsgeschiedenis workflow: - Created by: Créé par - My decision: Ma décision - Next step: Prochaine étape - cc for next steps: Utilisateurs en copie - dest for next steps: Utilisateurs qui valideront la prochaine étape - Freeze: Geler - Freezed: Gelé - freezed document: Le document est gelé - The associated element will be freezed: L'élément associé sera gelé et ne pourra plus être modifié après cette décision. - Finalize: Étape finale - The workflow will be finalized: Le suivi est clôturé lors de cette décision. - No transitions: Aucune transition - Comment added: Commentaire ajouté - This workflow is finalized: Ce suivi est finalisé. - You are not allowed to apply a transition on this workflow: Vous n'êtes pas autorisé à appliquer une décision pour ce suivi - Only those users are allowed: Seuls ces utilisateurs sont autorisés - My workflows: Mes workflows - No workflow: Aucun workflow - subscribed: Workflows suivis - dest: Workflows en attente d'action - cc: Workflows dont je suis en copie - you subscribed to all steps: Vous recevrez une notification à chaque étape - you subscribed to final step: Vous recevrez une notification à l'étape finale - Current step: Étape actuelle - Comment on last change: Commentaire à la transition précédente - Users allowed to apply transition: Utilisateurs pouvant valider cette étape - Users put in Cc: Utilisateurs mis en copie - Workflow deleted with success: Le workflow a été supprimé - Delete workflow ?: Supprimer le workflow ? - Are you sure you want to delete this workflow ?: Êtes-vous sûr·e de vouloir supprimer ce workflow ? - Delete workflow: Supprimer le workflow - Steps is not waiting for transition. Maybe someone apply the transition before you ?: L'étape que vous cherchez a déjà été modifiée par un autre utilisateur. Peut-être quelqu'un a-t-il modifié cette étape avant vous ? - You get access to this step: Vous avez acquis les droits pour appliquer une transition sur ce workflow. - Those users are also granted to apply a transition by using an access key: Ces utilisateurs peuvent également valider cette étape, grâce à un lien d'accès - dest by email: Liens d'autorisation par email - dest by email help: Les adresses email mentionnées ici recevront un lien d'accès. Ce lien d'accès permettra à l'utilisateur de valider cette étape. - Add an email: Ajouter une adresse email - Remove an email: Enlever cette adresse email - Any email: Aucune adresse email - Previous dest without reaction: Workflows clotûrés après action d'un autre utilisateur - Previous workflow without reaction help: Liste des workflows où vous avez été cité comme pouvant réagir à une étape, mais où un autre utilisateur a exécuté une action avant vous. - Previous transitionned: Anciens workflows - Previous workflow transitionned help: Workflows où vous avez exécuté une action. - For: Pour + list: Lijst van gekoppelde workflows + associated: gekoppelde workflow + deleted: Workflow verwijderd + Created by: Aangemaakt door + My decision: Mijn beslissing + Next step: Volgende stap + cc for next steps: Gebruikers in kopie + dest for next steps: Gebruikers die de volgende stap zullen valideren + Freeze: Bevriezen + Freezed: Bevroren + freezed document: Het document is bevroren + The associated element will be freezed: Het gekoppelde element wordt bevroren en kan na deze beslissing niet meer worden gewijzigd. + Finalize: Eindstap + The workflow will be finalized: De opvolging wordt afgesloten bij deze beslissing. + No transitions: Geen transitie + Comment added: Opmerking toegevoegd + This workflow is finalized: Deze opvolging is afgesloten. + You are not allowed to apply a transition on this workflow: U bent niet bevoegd om een beslissing toe te passen voor deze opvolging + Only those users are allowed: Alleen deze gebruikers zijn bevoegd + My workflows: Mijn workflows + No workflow: Geen workflow + subscribed: Gevolgde workflows + cc: Workflows waarvan ik in kopie ben + dest: Workflows in afwachting van actie + you subscribed to all steps: U ontvangt een melding bij elke stap + you subscribed to final step: U ontvangt een melding bij de eindstap + Current step: Huidige stap + Comment on last change: Opmerking bij de vorige transitie + Users allowed to apply transition: Gebruikers die deze stap kunnen valideren + Users put in Cc: Gebruikers in kopie gezet + Workflow deleted with success: De workflow is verwijderd + Delete workflow ?: Workflow verwijderen? + Are you sure you want to delete this workflow ?: Weet u zeker dat u deze workflow wilt verwijderen? + Delete workflow: Workflow verwijderen + Steps is not waiting for transition. Maybe someone apply the transition before you ?: De stap die u zoekt is al gewijzigd door een andere gebruiker. Misschien heeft iemand deze stap voor u gewijzigd? + You get access to this step: U hebt rechten verkregen om een transitie toe te passen op deze workflow. + dest by email: Autorisatielinks per e-mail + dest by email help: De hier vermelde e-mailadressen ontvangen een toegangslink. Deze toegangslink stelt de gebruiker in staat deze stap te valideren. + Add an email: E-mailadres toevoegen + Remove an email: Dit e-mailadres verwijderen + Any email: Geen e-mailadres + Previous dest without reaction: Workflows afgesloten na actie van een andere gebruiker + Previous workflow without reaction help: Lijst van workflows waar u werd genoemd als iemand die op een stap kon reageren, maar waar een andere gebruiker een actie heeft uitgevoerd voor u. + Previous transitionned: Oude workflows + Previous workflow transitionned help: Workflows waar u een actie hebt uitgevoerd. + For: Voor Cc: Cc + At: Op + You must select a next step, pick another decision if no next steps are available: Er is een volgende stap nodig. Kies indien nodig een andere beslissing. + An access key was also sent to those addresses: Een toegangslink is verzonden naar deze adressen + Those users are also granted to apply a transition by using an access key: Deze gebruikers hebben toegang verkregen dankzij de ontvangen link per e-mail + Access link copied: Toegangslink gekopieerd + This link grant any user to apply a transition: De volgende toegangslink maakt het mogelijk een transitie toe te passen + The workflow may be accssed through this link: Een transitie kan worden toegepast op deze workflow dankzij de volgende toegangslink + Put on hold: In wacht zetten + Remove hold: Wacht verwijderen + On hold: In afwachting + Automated transition: Automatische transitie + waiting_for_signature: In afwachting van handtekening + Permissions: Workflows (opvolging van beslissing) + transition_destinee_third_party: Geadresseerde uit externe derden + transition_destinee_third_party_help: Elke geadresseerde ontvangt een beveiligde link per e-mail. + transition_destinee_emails_label: Verzending per e-mail + transition_destinee_add_emails: E-mailadres toevoegen + transition_destinee_remove_emails: Verwijderen + transition_destinee_emails_help: De beveiligde link wordt naar elk aangegeven adres verzonden + sent_through_secured_link: Verzending via beveiligde link + public_views_by_ip: Weergave per IP-adres + May not associate a document: De workflow betreft geen document + + subscribe_final: Melding ontvangen bij de eindstap + unsubscribe_final: Geen melding meer ontvangen bij de eindstap + subscribe_all_steps: Melding ontvangen bij elke stap van de opvolging + unsubscribe_all_steps: Geen melding meer ontvangen bij elke stap van de opvolging -Subscribe final: Recevoir une notification à l'étape finale -Subscribe all steps: Recevoir une notification à chaque étape + public_link: + expired_link_title: Verlopen link + expired_link_explanation: De link is verlopen, u kunt dit document niet meer bekijken. + + send_external_message: + greeting: Goedendag + or_see_link: 'Als het klikken op de knop niet werkt, kunt u de documenten raadplegen door onderstaande link te kopiëren en in uw browser te openen' + use_button: Om toegang te krijgen tot deze documenten, kunt u onderstaande knop gebruiken + see_docs_action_name: Vertrouwelijke documenten bekijken + sender_system_user: de Chill-software + + signature_zone: + title: Elektronische handtekeningen + button_sign: Ondertekenen + button_cancel: Annuleren + button_reject: Weigeren + metadata: + sign_by: 'Handtekening voor %name%' + docType: Documenttype + docNumber: Documentnummer + docExpiration: Vervaldatum + type of signature: Type handtekening + person signatures: Gebruikers selecteren om te ondertekenen + user signature: Gebruiker selecteren om te ondertekenen + persons: Gebruikers + user: Gebruiker + already_signed_alert: De handtekening is al toegepast + + signature: + cancel_signature_of: Annulering van de handtekening van %signer% + cancel_are_you_sure: Weet u zeker dat u de handtekening van %signer% wilt annuleren + reject_signature_of: Weigering van de handtekening van %signer% + reject_are_you_sure: Weet u zeker dat u de handtekening van %signer% wilt weigeren + waiting_for: In afwachting van wijziging van de handtekeningstatus + + notification: + title: + attention_needed: "Aandacht vereist in workflow %workflow% voor %title%" + new_step: "Nieuwe stap in workflow %workflow% (%place%) voor %title%" + content: + new_step_reached: "Een nieuwe stap is bereikt in workflow %workflow%." + workflow_title: "Titel van de workflow: %title%" + validation_needed: "Uw validatie is nodig voor deze stap." + view_workflow: "U kunt de workflow hier raadplegen:" + regards: "Met vriendelijke groet," + + attachments: + title: Bijlagen + no_attachment: Geen bijlage + Add_an_attachment: Bijlage toevoegen + + wait: + title: In afwachting van verwerking + error_while_waiting: De verwerking is mislukt + success: Verwerking voltooid. Doorverwijzing bezig... + + +Subscribe final: Melding ontvangen bij de eindstap +Subscribe all steps: Melding ontvangen bij elke stap +CHILL_MAIN_WORKFLOW_APPLY_ALL_TRANSITION: Transities toepassen op alle workflows notification: - Notification: Notification - Notifications: Notifications - My own notifications: Mes notifications - Notify: Envoyer une notification - Send: Envoyer - Edit notification: Modifier une notification - Notification created: Notification envoyée - Notification updated: La notification a été mise à jour - Any notification received: Aucune notification reçue - Any notification sent: Aucune notification envoyée - Notifications received: Notifications reçues - Notifications sent: Notifications envoyées - comment_appended: Commentaire ajouté - append_comment: Ajouter un commentaire - comment_updated: Commentaire mis à jour - comments_list: Fil de commentaires - show notification from %sender%: Voir la notification de %sender% - is_unread: Non-lue - is_system: notification automatique - list: Notifications - Sent: Envoyé - to: À + Daily Notification Digest: Dagelijks overzicht van meldingen + Notification: Melding + Notifications: Meldingen + My own notifications: Mijn meldingen + Notify: Melding verzenden + Send: Verzenden + Edit notification: Melding bewerken + Notification created: Melding verzonden + Notification updated: De melding is bijgewerkt + Any notification received: Geen melding ontvangen + Any notification sent: Geen melding verzonden + Notifications received: Ontvangen meldingen + Notifications sent: Verzonden meldingen + comment_appended: Opmerking toegevoegd + append_comment: Opmerking toevoegen + comment_updated: Opmerking bijgewerkt + comments_list: Opmerkingendraad + show notification from %sender%: Melding bekijken van %sender% + is_unread: Ongelezen + is_system: automatische melding + list: Meldingen + Sent: Verzonden + to: Aan cc: Cc - sent_to: Destinataire(s) - sent_cc: En copie - from: De - received_from: Expéditeur - you were notified by %sender%: Vous avez été notifié par %sender% - you were notified by system: Vous avez été notifié automatiquement - subject: Objet - see_comments_thread: Voir le fil de commentaires associé - object_prefix: "[CHILL] notification - " - dest by email: Lien d'accès par email - Any email: Aucun email - Add an email: Ajouter un email - dest by email help: Les adresses email mentionnées ici recevront un lien d'accès. Un compte utilisateur sera toujours nécessaire. - Remove an email: Supprimer l'adresse email - Email with access link: Adresse email ayant reçu un lien d'accès + sent_to: Ontvanger(s) + sent_cc: In kopie + from: Van + received_from: Afzender + you were notified by %sender%: U werd verwittigd door %sender% + you were notified by system: U werd automatisch verwittigd + subject: Onderwerp + see_comments_thread: Bijbehorende opmerkingendraad bekijken + object_prefix: "[CHILL] melding - " + dest by email: Toegang via e-mail + Any email: Geen e-mail + Add an email: E-mailadres toevoegen + dest by email help: De hier vermelde e-mailadressen ontvangen een toegangslink. Een gebruikersaccount blijft altijd nodig. + Remove an email: E-mailadres verwijderen + Email with access link: E-mailadres dat een toegangslink ontving + Pick user or user group: Gebruiker of gebruikersgroep selecteren + mark_as_read: Markeren als gelezen + mark_as_unread: Markeren als ongelezen + + flags: + type: Type melding + by-user: Wanneer een gebruiker u een persoonlijke melding stuurt + referrer-acc-course: Wanneer een andere gebruiker u aanduidt als referent van een traject + person-address-move: Wanneer een andere gebruiker de verhuis registreert van een cliënt in een traject waarvoor u referent bent. + person: Melding over een cliënt + workflow-trans: Wanneer een andere gebruiker een transitie toepast op een workflow. + none selected message: Als u geen optie selecteert, ontvangt u geen e-mail over dit type melding. + preferences: + column_title: Voorkeuren + immediate_email: Onmiddellijke e-mail + daily_email: Dagelijks overzicht + no_email: Geen e-mail ontvangen + + daily_digest: + title: "Dagelijks overzicht van meldingen" + greeting: "Hallo %user%" + intro: "U hebt %notification_count% nieuwe melding(en) ontvangen." + view_notification: "U kunt de melding hier bekijken en erop antwoorden:" + signature: "Het Chill-team" + +daily_notifications: "{1}U hebt 1 nieuwe melding.|]1,Inf[U hebt %notification_count% nieuwe meldingen." + +docgen: + failure_email: + "The generation of a document failed": "Het genereren van een document is mislukt" + "The generation of the document %template_name% failed": "Het genereren van document %template_name% is mislukt" + "Forward this email to your administrator for solving": "Stuur deze e-mail door naar uw beheerder voor een oplossing" + "References": "Referenties" + "The following errors were encoutered": "De volgende fouten zijn opgetreden" + data_dump_email: + subject: "Gegevensexport beschikbaar" + "Dear": "Beste gebruiker," + "data_dump_ready_and_attached": "Uw gegevensexport is klaar en als bijlage bij deze e-mail toegevoegd." + "filename": "Bestandsnaam: %filename%" + +CHILL_MAIN_COMPOSE_EXPORT: Exports uitvoeren en opslaan +CHILL_MAIN_GENERATE_SAVED_EXPORT: Opgeslagen exports uitvoeren en wijzigen + + +export: + role: + export_role: Exports + generation: + Export generation is pending: Het aanmaken van de export is bezig + Export generation is pending_short: Bezig + Come back later: Terug naar het overzicht + Too many retries: Te veel pogingen om de beschikbaarheid van de export te controleren. Probeer de pagina te herladen. + Error while generating export: Interne fout tijdens het genereren van de export + Error_short: Fout + Export ready: De export is klaar om te downloaden + address_helper: + id: Adres-ID + street: Straat + streetNumber: Straatnummer + buildingName: Gebouwnaam + corridor: Gang + distribution: Distributie + extra: Extra + flat: Appartement + floor: Verdieping + postcode_code: Postcode + postcode_name: Postcodeomschrijving + country: Land + _as_string: Geformatteerd adres + confidential: Vertrouwelijk adres ? + isNoAddress: Onvolledig adres ? + steps: Trappen + _lat: Breedtegraad + _lon: Lengtegraad + social_action_list: + id: Actie-ID + social_issue_id: ID sociale problematiek + social_issue: Sociale problematiek + desactivation_date: Uitschakelingsdatum + social_issue_ordering: Volgorde van de sociale problematiek + action_label: Begeleidingsactie + action_ordering: Volgorde + goal_label: Doelstelling + goal_id: Doel-ID + goal_result_label: Resultaat + goal_result_id: Resultaat-ID + result_without_goal_label: Resultaat (zonder doelstelling) + result_without_goal_id: Resultaat-ID (zonder doelstelling) + evaluation_title: Evaluatie + evaluation_id: Evaluatie-ID + evaluation_url: Externe URL (evaluatie) + evaluation_delay_month: Meldingstermijn (maanden) + evaluation_delay_week: Meldingstermijn (weken) + evaluation_delay_day: Meldingstermijn (dagen) + +rolling_date: + year_previous_start: Begin van vorig jaar + quarter_previous_start: Begin van het vorige kwartaal + month_previous_start: Begin van vorige maand + week_previous_start: Begin van vorige week + year_current_start: Begin van het lopende jaar + quarter_current_start: Begin van het lopende kwartaal + month_current_start: Begin van deze maand + week_current_start: Begin van deze week + today: Vandaag (geen wijziging van de huidige datum) + year_next_start: Begin van volgend jaar + quarter_next_start: Begin van het volgende kwartaal + month_next_start: Begin van volgende maand + week_next_start: Begin van volgende week + fixed_date: Vaste datum + roll_movement: Wijziging ten opzichte van vandaag + fixed_date_date: Vaste datum + +saved_export: + Any saved export: Geen opgeslagen export + New: Nieuwe opgeslagen export + Edit: Opgeslagen export bewerken + Delete saved ?: Opgeslagen export verwijderen? + Are you sure you want to delete this saved ?: Weet u zeker dat u deze export wilt verwijderen? + Saved exports: Opgeslagen exports + Export is deleted: De export is verwijderd + Saved export is saved!: De export is opgeslagen + Created on %date%: Aangemaakt op %date% + update_title_and_description: Titel en beschrijving bijwerken + update_filters_aggregators_and_execute: Filters en groeperingen bijwerken en downloaden + execute: Genereren + Update existing: Bestaande opgeslagen export bijwerken + Owner: Eigenaar + Shared with others: Gedeeld + Save to new saved export: Opslaan als nieuwe opgeslagen export + Update current saved export: Configuratie van de bestaande export bijwerken + Duplicate: Dupliceren + Duplicated: Gekopieerd + Options updated successfully: De configuratie van de export is bijgewerkt + Share: Delen + Alert auto generated description: De onderstaande beschrijving werd automatisch gegenereerd alsof de export onmiddellijk werd uitgevoerd. Pas ze aan om rekening te houden met parameters die kunnen wijzigen (huidige gebruiker, rollende datums, enz.). + +absence: + # single letter for absence + A: A + My absence: Mijn afwezigheid + Unset absence: Mijn afwezigheidsdata verwijderen + Set absence date: Afwezigheidsdatum instellen + Absence start: Afwezig vanaf + Absence end: Tot + Absent: Afwezig + You are marked as being absent: U staat als afwezig genoteerd. + No absence listed: Geen afwezigheid opgegeven. + Is absent: Afwezig? + +admin: + users: + export_list_csv: Gebruikerslijst (CSV-formaat) + export_permissions_csv: Koppeling gebruikers - permissiegroepen - territorium (CSV-formaat) + export: + id: Identificatie + username: Gebruikersnaam + email: E-mail + enabled: Geactiveerd + civility_id: Aanhef-ID + civility_abbreviation: Afkorting aanhef + civility_name: Aanhef + label: Label + mainCenter_id: ID hoofdterritorium + mainCenter_name: Hoofdterritorium + mainScope_id: ID hoofddienst + mainScope_name: Hoofddienst + userJob_id: ID beroep + userJob_name: Beroep + currentLocation_id: ID huidige locatie + currentLocation_name: Huidige locatie + mainLocation_id: ID hoofdlocatie + mainLocation_name: Hoofdlocatie + absenceStart: Afwezig vanaf + center_id: Territorium-ID + center_name: Territorium + permissionsGroup_id: Permissiegroep-ID + permissionsGroup_name: Permissiegroep + job_scope_histories: + Show history: Historiek bekijken + index: + histories: Historiek van diensten en beroepen + Back to user job: Terug naar gebruiker + job_history: + title: Historiek van beroepen + start: Van + end: Tot + today: lopend + undefined: niet gedefinieerd + user: Gebruiker + job: Beroep + scope_history: + title: Historiek van diensten + start: Van + end: Tot + today: lopend + undefined: niet gedefinieerd + user: Gebruiker + scope: Dienst + dashboard: + title: Dashboard + news: Nieuws + description: Configuratie van het dashboard + + +news: + noDate: Geen einddatum + startDate: Startdatum publicatie + endDate: Einddatum publicatie op de startpagina + title: Overzicht van nieuwsberichten + menu: Nieuws + no_data: Geen nieuwsbericht + read_more: Lees meer + show_details: Nieuwsbericht bekijken + +gender: + genderTranslation: Grammaticale vertaling + not defined: Niet gedefinieerd + pick gender: Kies een gender + Select gender translation: Grammaticale vertaling kiezen + Select gender icon: Te gebruiken pictogram kiezen + +wopi: + online_edit_document: Online bewerken + save_and_quit: Opslaan en afsluiten + loading: Online editor wordt geladen + invalid_title: Onverenigbaar formaat + invalid_message: Sorry, dit documentformaat kan niet online worden bewerkt. + +onthefly: + show: + person: Details van de cliënt + thirdparty: Details van de derde + file_person: Dossier van de cliënt openen + file_thirdparty: Derde bekijken + edit: + person: Cliënt bewerken + thirdparty: Derde bewerken + create: + button: Aanmaken {q} + title: + default: Aanmaak van een nieuwe cliënt of professionele derde + person: Aanmaak van een nieuwe cliënt + thirdparty: Aanmaak van een nieuwe professionele derde + person: een nieuwe cliënt + thirdparty: een nieuwe professionele derde + addContact: + title: Een contact aanmaken voor {q} + resource_comment_title: Er is een opmerking gekoppeld aan deze gesprekspartner + +modal: + action: + close: Sluiten + +multiselect: + placeholder: Kiezen + tag_placeholder: Nieuw element aanmaken + select_label: Enter of klik om te selecteren + deselect_label: Enter of klik om de selectie op te heffen + select_group_label: Druk op "Enter" om deze groep te selecteren + deselect_group_label: Druk op "Enter" om deze groep te deselecteren + selected_label: Geselecteerd + +editor: + switch_to_simple: Eenvoudige editor + switch_to_complex: Rijke editor + +login_page: + logo_alt: "Chill-logo" diff --git a/src/Bundle/ChillMainBundle/translations/validators.nl.yml b/src/Bundle/ChillMainBundle/translations/validators.nl.yml new file mode 100644 index 000000000..85d391ba1 --- /dev/null +++ b/src/Bundle/ChillMainBundle/translations/validators.nl.yml @@ -0,0 +1,45 @@ +# role_scope constraint +# scope presence +The role "%role%" require to be associated with a scope.: De rol "%role%" moet gekoppeld zijn aan een dienst. +The role "%role%" should not be associated with a scope.: De rol "%role%" mag niet gekoppeld zijn aan een dienst. +"The password must contains one letter, one capitalized letter, one number and one special character as *[@#$%!,;:+\"'-/{}~=µ()£]). Other characters are allowed.": "Het wachtwoord moet een hoofdletter, een kleine letter en ten minste één speciaal teken bevatten uit *[@#$%!,;:+\"'-/{}~=µ()£]). Andere tekens zijn toegestaan." +The password fields must match: De wachtwoorden moeten overeenkomen +The password must be greater than {{ limit }} characters: "[1,Inf] Het wachtwoord moet minstens {{ limit }} tekens bevatten" + +A permission is already present for the same role and scope: Er bestaat al een toestemming voor dezelfde rol en dienst. + +#UserCircleConsistency +"{{ username }} is not allowed to see entities published in this circle": "{{ username }} is niet bevoegd om het element te zien dat in deze dienst is gepubliceerd." + +The user in cc cannot be a dest user in the same workflow step: Een gebruiker in Cc kan geen gebruiker zijn die valideert. + +#password request +This username or email does not exists: Deze gebruikersnaam of e-mail bestaat niet in de database + +#phonenumber +This is not a landline phonenumber: Dit nummer is geen geldig vast telefoonnummer +This is not a mobile phonenumber: Dit nummer is geen geldig mobiel nummer +This is not a valid phonenumber: Dit telefoonnummer is niet geldig + +address: + street1-should-be-set: Er moet een adresregel aanwezig zijn + date-should-be-set: De begindatum van geldigheid moet aanwezig zijn + postcode-should-be-set: De postcode moet worden ingevuld + +notification: + At least one addressee: Geef ten minste één geadresseerde op + Title must be defined: Er moet een titel worden aangegeven + Comment content might not be blank: De opmerking kan niet leeg zijn + +workflow: + You must add at least one dest user or email: Geef ten minste één geadresseerde of een e-mailadres op + The user in cc cannot be a dest user in the same workflow step: De gebruiker in kopie kan niet aanwezig zijn in de gebruikers die de volgende stap zullen valideren + transition_has_destinee_if_sent_external: Geef een geadresseerde van de externe verzending op + transition_destinee_not_necessary: Voor deze transitie kunt u geen externe geadresseerden opgeven + You must add a destinee for signing: Geef een gebruiker of een gebruiker op voor ondertekening + +rolling_date: + When fixed date is selected, you must provide a date: Geef de gekozen vaste datum op + +user: + absence_end_requires_start: U kunt geen einddatum van afwezigheid invullen zonder begindatum. diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php index d5299af14..753094ec1 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php @@ -11,15 +11,19 @@ declare(strict_types=1); namespace Chill\PersonBundle\DataFixtures\ORM; +use Chill\MainBundle\DataFixtures\ORM\LoadAdministrativeLocation; use Chill\MainBundle\DataFixtures\ORM\LoadPostalCodes; +use Chill\MainBundle\DataFixtures\ORM\LoadUserJob; use Chill\MainBundle\Entity\Address; use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Country; use Chill\MainBundle\Entity\Gender; use Chill\MainBundle\Entity\GenderEnum; +use Chill\MainBundle\Entity\Location; use Chill\MainBundle\Entity\PostalCode; use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\User; +use Chill\MainBundle\Entity\UserJob; use Chill\MainBundle\Repository\CenterRepository; use Chill\MainBundle\Repository\CountryRepository; use Chill\MainBundle\Repository\GenderRepository; @@ -362,6 +366,10 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord $origin = $this->getReference(LoadAccompanyingPeriodOrigin::ACCOMPANYING_PERIOD_ORIGIN, AccompanyingPeriod\Origin::class); $accompanyingPeriod->setOrigin($origin); $accompanyingPeriod->setIntensity('regular'); + $userJob = $this->getReference(LoadUserJob::USER_JOB, UserJob::class); + $accompanyingPeriod->setJob($userJob); + $administrativeLocation = $this->getReference(LoadAdministrativeLocation::ADMINISTRATIVE_LOCATION, Location::class); + $accompanyingPeriod->setAdministrativeLocation($administrativeLocation); $accompanyingPeriod->setAddressLocation($this->createAddress()); $manager->persist($accompanyingPeriod->getAddressLocation()); $workflow = $this->workflowRegistry->get($accompanyingPeriod); diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index d75a0d9df..aa78774b6 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -866,29 +866,6 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI return $this->calendars; } - /** - * Get next calendars for this person. - * Only returns calendars where this person is in the persons collection and the person property is not null. - * - * @param int $limit Maximum number of calendars to return - * - * @return ReadableCollection<int, Calendar> - */ - public function getNextCalendarsForPerson(int $limit = 5): ReadableCollection - { - $today = new \DateTimeImmutable('today'); - - $filtered = $this->calendars->filter( - fn (Calendar $calendar) => $calendar->getStartDate() >= $today - && $calendar->getPerson() === $this - ); - - $sorted = $filtered->toArray(); - usort($sorted, fn ($a, $b) => $a->getStartDate() <=> $b->getStartDate()); - - return new ArrayCollection(array_slice($sorted, 0, $limit)); - } - public function getCenter(): ?Center { if (null !== $this->centerCurrent) { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue index 408852711..0e843023d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue @@ -20,16 +20,16 @@ </ul> </div> <ul class="record_actions"> - <li> - <button class="btn btn-save" disabled> - {{ $t("confirm.ok") }} - </button> - </li> <li> <a class="btn btn-delete" :href="deleteLink"> {{ $t("confirm.delete") }} </a> </li> + <li> + <button class="btn btn-save" disabled> + {{ $t("confirm.ok") }} + </button> + </li> </ul> </div> @@ -40,6 +40,11 @@ " /> <ul class="record_actions"> + <li> + <a class="btn btn-delete" :href="deleteLink"> + {{ $t("confirm.delete") }} + </a> + </li> <li> <button class="btn btn-save" @@ -48,11 +53,6 @@ {{ $t("confirm.ok") }} </button> </li> - <li> - <a class="btn btn-delete" :href="deleteLink"> - {{ $t("confirm.delete") }} - </a> - </li> </ul> </div> </div> @@ -112,7 +112,7 @@ </template> <template #footer> <button - class="btn btn-danger" + class="btn btn-save" :disabled="disableConfirm" @click="confirmCourse" > diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue index c20c9eb9f..6f459daec 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -293,11 +293,11 @@ function onInputDocumentTitle(event) { }); } -function addDocument({ stored_object, stored_object_version }) { +function addDocument({ stored_object, stored_object_version, file_name }) { let document = { type: "accompanying_period_work_evaluation_document", storedObject: stored_object, - title: "Nouveau document", + title: file_name, }; store.commit("addDocument", { key: props.evaluation.key, diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig index 140cb1995..c373fd58b 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig @@ -81,25 +81,25 @@ </div> {%- if options['addInfo'] -%} <p class="moreinfo"> - {% if person.gender is not null %}{{ person.gender.icon|chill_entity_render_box }}{% endif %} + {% if person.gender is not null %}{{ person.gender.icon|chill_entity_render_box }} {% endif %} {%- if person.deathdate is not null -%} {%- if person.birthdate is not null -%} {# must be on one line to avoid spaces with dash #} <time datetime="{{ person.birthdate|date('Y-m-d') }}" title="{{ 'birthdate'|trans|e('html_attr') }}">{{ person.birthdate|format_date("medium") }}</time>– {%- else -%} - {{ 'Date of death'|trans }}: + <span>{{ 'Date of death'|trans }}: </span> {%- endif -%} {#- must be on one line to avoid spaces with dash -#} <time datetime="{{ person.deathdate|date('Y-m-d') }}" title="{{ 'deathdate'|trans }}">{{ person.deathdate|format_date("medium") }}</time> {%- if options['addAge'] -%} <span class="age"> {{ 'years_old'|trans({ 'age': person.age }) }}</span> {%- endif -%} - {%- if options['addId'] -%} - {%- set personId = person|chill_person_id_render_text %} - <span class="id-number" title="{{ 'Person'|trans ~ ' ' ~ personId }}"> - ({{ personId }}) - </span> - {%- endif -%} +{# {%- if options['addId'] -%}#} +{# {%- set personId = person|chill_person_id_render_text %}#} +{# <span class="id-number" title="{{ 'Person'|trans ~ ' ' ~ personId }}">#} +{# ({{ personId }})#} +{# </span>#} +{# {%- endif -%}#} {%- elseif person.birthdate is not null -%} <time datetime="{{ person.birthdate|date('Y-m-d') }}" title="{{ 'Birthdate'|trans }}"> {{ 'Born the date'|trans({'gender': person.gender ? person.gender.genderTranslation.value : 'neutral', @@ -190,8 +190,6 @@ </li> {% endif %} </ul> - </div> - <div class="item-col"> <ul class="record_actions"> {% if options['customButtons']['before'] is defined %} {{ options['customButtons']['before'] }} diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php index eb588cdaf..0ac921277 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php @@ -168,9 +168,8 @@ final readonly class PersonContext implements PersonContextInterface if ($this->isScopeNecessary($entity)) { $builder->add('scope', ScopePickerType::class, [ - 'center' => $this->centerResolverManager->resolveCenters($entity), 'role' => PersonDocumentVoter::CREATE, - 'label' => 'Scope', + 'subject' => $entity, ]); } } diff --git a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.nl.yaml b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.nl.yaml new file mode 100644 index 000000000..fd85afb8c --- /dev/null +++ b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.nl.yaml @@ -0,0 +1,211 @@ +Born the date: >- + {gender, select, + man {Geboren op {birthdate}} + woman {Geboren op {birthdate}} + neutral {Geboren op {birthdate}} + other {Geboren op {birthdate}} + } + +Requestor: >- + {gender, select, + man {Aanvrager} + woman {Aanvraagster} + neutral {Aanvrager} + } + +accompanying_period: + Participants_without_count: >- + {count, plural, + =0 {Deelnemer} + =1 {Deelnemer} + other {Deelnemers} + } + + number: >- + nr. {id} + +person: + from_the: sinds + And himself: >- + {gender, select, + man {en hijzelf} + woman {en zijzelf} + neutral {en zijzelf} + other {en zijzelf} + } + +household: + Household: Huishouden + Household number: Huishouden {household_num} + Household members: Leden van het huishouden + Household editor: Lidmaatschap invullen + Members at same time: Gelijktijdige leden + Any simultaneous members: Geen gelijktijdige leden + Select people to move: Gebruikers kiezen + Show future or past memberships: >- + {length, plural, + one {Oud lidmaatschap tonen} + many {# oude of toekomstige lidmaatschappen tonen} + other {# oude of toekomstige lidmaatschappen tonen} + } + Show accompanying periods of past or future memberships: >- + {length, plural, + one {De trajecten van een oud lidmaatschap tonen} + many {# trajecten van oude of toekomstige lidmaatschappen tonen} + other {# trajecten van oude of toekomstige lidmaatschappen tonen} + } + Hide memberships: Verbergen + Those members does not share address: Deze gebruikers delen het adres van het huishouden niet. + Any persons into this position: Geen persoon behoort tot het huishouden in deze positie. + Leave household: Huishouden verlaten + Leave: Loskoppelen + person: + leave: De gebruiker verlaat het huishouden + Join: Huishouden aansluiten + Change position: Herpositioneren + Household file: Huishoudendossier + Add a member: Lid toevoegen + Update membership: Bewerken + successfully saved member: Lid succesvol opgeslagen + Start date: Startdatum van het lidmaatschap van het huishouden + End date: Einddatum van het lidmaatschap van het huishouden + Comment: Opmerking + is holder: Is houder + is not holder: Is geen houder + holder: Houder + Edit member household: Lidmaatschap van het huishouden invullen + Edit his household: Zijn lidmaatschap van het huishouden bewerken + Current household members: Huidige leden + Household summary: Overzicht van het huishouden + Accompanying period: Begeleidingstraject + Addresses: Adresgeschiedenis + Relationship: Verwantschap + Budget: Budget + Household relationships: Verwantschappen in het huishouden + Current address: Huidig adres + Household does not have any address currently: Het huishouden heeft momenteel geen adres ingevuld + Edit household members: Lidmaatschap van het huishouden invullen + and x other persons: >- + {x, plural, + one {en één andere persoon} + many {en # andere personen} + other {en # andere personen} + } + Expecting for birth on date: Geboorte verwacht op {date} + Expecting for birth: Geboorte verwacht (datum onbekend) + Any expecting birth: Geen aanstaande geboorte ingevuld. + New comment and expecting birth: Opmerking schrijven + Edit comment and expecting birth: Opmerking bijwerken + Edit member metadata: Aanvullende gegevens + comment_membership: Algemene opmerking over leden + expecting_birth: Geboorte verwacht? + date_expecting_birth: Datum van de verwachte geboorte + data_saved: Gegevens opgeslagen + Household history: Geschiedenis van de huishoudens + Household history for person: Geschiedenis van de huishoudens van de persoon + Household history for %name%: Geschiedenis van de huishoudens voor {name} + Household shared: Woonhuishouden + Household not shared: Huishoudens buiten woonplaats + Members without position: Leden zonder positie + Never in any household: Lid van geen enkel huishouden + Membership currently running: Lopend + from: Sinds + to: Tot + person history: Huishoudens + As member: Als + +household_composition: + Since: >- + Sinds {startDate, date, long} + Still active: Nog steeds actief + Until: >- + Tot {endDate, date, long} + numberOfChildren children in household: >- + {numberOfChildren, plural, + =0 {Geen kind in het huishouden} + one {1 kind in het huishouden} + few {# kinderen in het huishouden} + other {# kinderen in het huishouden} + } + numberOfDependents adult dependents: >- + {numberOfDependents, plural, + =0 {Geen meerderjarige ten laste} + one {1 meerderjarige ten laste} + few {# meerderjarigen ten laste} + other {# meerderjarigen ten laste} + } + numberOfDependentsWithDisabilities dependents with disabilities: >- + {numberOfDependentsWithDisabilities, plural, + =0 {Geen ten laste erkend als persoon met beperking} + one {1 ten laste erkend als persoon met beperking} + few {# ten laste erkend als persoon met beperking} + other {# ten laste erkend als persoon met beperking} + } + +periods: + title: Begeleidingstraject (nr. {id}) + show closed periods: >- + {nb_items, plural, + =0 {Geen afgesloten traject} + one {Eén afgesloten traject of oud traject tonen} + many {# afgesloten trajecten of oude trajecten tonen} + other {# afgesloten trajecten of oude trajecten tonen} + } + hide closed periods: >- + {nb_items, plural, + =0 {Geen afgesloten traject} + one {Eén afgesloten traject of oud traject verbergen} + many {# afgesloten trajecten of oude trajecten verbergen} + other {# afgesloten trajecten of oude trajecten verbergen} + } + +exports: + by_person: + Filtered by person\'s geographical unit (based on address) computed at date, only units: + "Gefilterd op geografische zone op basis van het adres, berekend op {datecalc, date, short}, alleen de volgende zones: {units}" + filter: + person: + without_participation_between_dates: + "Filtered by having no participations during period: between": "Alleen de gebruikers die door geen enkel traject zijn geraakt tussen {dateafter, date, short} en {datebefore, date, short}" + course: + not_having_address_reference: + describe: >- + Alleen de trajecten die niet gelokaliseerd zijn op een referentieadres, op de datum van {date_calc, date, medium} + by_referrer_between_dates: + description: >- + Gefilterd op referent van het traject, tussen twee data: vanaf {start_date, date, medium}, tot {end_date, date, medium}, alleen {agents} + by_user_job: + "Filtered by user job: only job": "Gefilterd op beroep van de referent tussen {startDate, date, short} en {endDate, date, short}: alleen {job}" + by_user_scope: + "Filtered by user main scope: only scopes": "Gefilterd op dienst van de referent tussen {startDate, date, short} en {endDate, date, short}: alleen {scopes}" + work: + by_treating_agent: + Filtered by treating agent at date: >- + De behandelende agenten op { agent_at, date, medium }, alleen {agents} + step_history: + by_date: + description: >- + Statuswijzigingen gefilterd op datum: na { start_date, date, medium } (inclusief), voor { end_date, date, medium } + +'total persons matching the search pattern': >- + { total, plural, + =0 {Geen gebruiker komt overeen met de zoektermen} + one {Eén gebruiker komt overeen met de zoektermen} + many {# gebruikers komen overeen met de zoektermen} + other {# gebruikers komen overeen met de zoektermen} + } + +'nb person with similar name. Please verify that this is a new person': >- + { nb, plural, + =0 {Geen gebruiker heeft een vergelijkbare naam} + one {Eén gebruiker heeft een vergelijkbare naam. Controleer dat het niet om hem/haar gaat.} + other {# gebruikers hebben een vergelijkbare naam. Controleer dat het niet om één van hen gaat} + } + +accompanying_course_evaluation_document: + title: Evaluatie (nr. {id}) - {doc_title} + duplicated_at: >- + Gedupliceerd op {at, date, long} om {at, time, short} + +accompanying_period_work: + title: Begeleidingsactie (nr. {id}) - {action_title} diff --git a/src/Bundle/ChillPersonBundle/translations/messages.nl.yml b/src/Bundle/ChillPersonBundle/translations/messages.nl.yml index 94ddd51b5..c4e48bbaa 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.nl.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.nl.yml @@ -1,4 +1,5 @@ Edit: Wijzigen +Select an option…: Kies een optie… 'First name': Voornaam firstname: voornaam firstName: voornaam @@ -61,6 +62,7 @@ Remove phone: Verwijderen 'Unknown spoken languages': 'Gesproken talen ongekend' Male: Man Female: Vrouw +neutral: Neutraal Both: Non-binair man: Man woman: Vrouw @@ -86,6 +88,22 @@ Civility: Aanspreektitel choose civility: -- All genders: alle genderkeuzes Any person selected: Geen persoon geselecteerd +Create a household and add an address: Een adres toevoegen voor een niet-opgevolgde persoon die alleen woont +A new household will be created. The person will be member of this household.: Er wordt een nieuw huishouden aangemaakt. De persoon wordt lid van dit huishouden. +Comment on the gender: Commentaar over het gender +genderComment: Commentaar over het gender +maritalStatus: Burgerlijke staat +maritalStatusComment: Commentaar over de burgerlijke staat +maritalStatusDate: Datum van de burgerlijke staat +memo: Commentaar +numberOfChildren: Aantal kinderen +contactInfo: Contactopmerkingen +spokenLanguages: Gesproken talen +Employment status: Beroepssituatie +Administrative status: Administratieve situatie + +person: + Identifiers: Identificatoren # dédoublonnage Old person: Dubbel @@ -112,6 +130,7 @@ not-duplicate: Vals-positief Switch to truefalse: Aanduiden als vals-positief Switch to duplicate: Aanduiden als een duplicaat No duplicate candidates: Er werden geen duplicaten of vals-positieve dossiers gedetecteerd +Person1 cannot be the same as Person2: De geselecteerde persoon mag niet dezelfde zijn als dit dossier. # addresses part address_street_address_1: Adres regel 1 @@ -200,6 +219,9 @@ Associated peoples: Betrokken personen Resources: Hulpverlening partners Any requestor to this accompanying course: Er is geen aanvrager voor dit hulpverleningstraject Social actions: Ondersteuningsmaatregelen +Social action: Ondersteuningsmaatregel +Pick a social action: Kies een ondersteuningsmaatregel +Pick a social issue: Kies een hulpvraag Last social actions: Laatste ondersteuningsmaatregelen Social issue: Hulpvraag Social issues: Hulpvragen @@ -214,13 +236,22 @@ No requestor: Geen aanvrager No resources: "Geen hulpverlening partners" Persons associated: Betrokken personen Referrer: Doorverwijzer +Referrer2: Behandelend medewerker Referrers: Doorverwijzers Some peoples does not belong to any household currently. Add them to an household soon: Sommige personen maken nog geen deel uit van een huishouden. Voeg ze zo snel mogelijk aan huishouden toe. Add to household now: Toevoegen aan een huishouden Any resource for this accompanying course: Geen enkele hulpverlening partner course.draft: Ontwerp course.closed: Afgesloten +No referrer: Geen doorverwijzer +course: + draft: Ontwerp + closed: Afgesloten + inactive_short: Buiten actieve lijst + inactive_long: Voor-archief + confirmed: Bevestigd Origin: Oorsprong van de aanvraag +This course is closed: Dit traject is afgesloten Delete accompanying period: Hulpverleningstraject verwijderen Are you sure you want to remove the accompanying period "%id%" ?: Bent u zeker het hulpverleningstraject %id% te willen verwijderen? The accompanying course has been successfully removed.: Het hulpverleningstraject werd verwijdert. @@ -239,6 +270,10 @@ List of resources: "Overzicht steunfiguren" There are no available resources: "Nog geen steunfiguur" no comment found: "Geen enkele opmerking" Select a type: "Kies een type" +person_resource: + person_non_prof: Gebruiker / niet-professionele derde + thirdparty_prof: Professionele derde + freetext: Vrije omschrijving Select a person: "Kies een persoon" Select a thirdparty: "Kies een externe partner" Contact person: "Kies een contactpersoon" @@ -302,10 +337,35 @@ CHILL_PERSON_STATS: Statistieken van personen CHILL_PERSON_LISTS: Overzicht van personen CHILL_PERSON_DUPLICATE: Duplicaten persoon behandelen CHILL_PERSON_ACCOMPANYING_PERIOD_SEE: Hulpverleningstrajecten bekijken +CHILL_PERSON_ACCOMPANYING_PERIOD_CONFIDENTIAL: Vertrouwelijke hulpverleningstrajecten bekijken en bewerken +CHILL_PERSON_ACCOMPANYING_PERIOD_DELETE: Een hulpverleningstraject verwijderen +CHILL_PERSON_ACCOMPANYING_PERIOD_RE_OPEN: Een afgesloten traject heropenen +CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_CONFIDENTIAL_ALL: Vertrouwelijkheid van alle trajecten aanpassen +CHILL_PERSON_ACCOMPANYING_PERIOD_CRUD_CONFIDENTIAL: Vertrouwelijke hulpverleningstrajecten bekijken +CHILL_PERSON_ACCOMPANYING_PERIOD_CREATE: Een hulpverleningstraject aanmaken +CHILL_PERSON_ACCOMPANYING_PERIOD_UPDATE: Een hulpverleningstraject bijwerken +CHILL_PERSON_ACCOMPANYING_PERIOD_FULL: Details bekijken, aanmaken, verwijderen en bijwerken van een hulpverleningstraject +CHILL_PERSON_ACCOMPANYING_COURSE_REASSIGN_BULK: Trajecten in bulk hertoewijzen +CHILL_PERSON_ACCOMPANYING_PERIOD_SEE_DETAILS: Details van een hulpverleningstraject bekijken +CHILL_PERSON_ACCOMPANYING_PERIOD_STATS: Statistieken over hulpverleningstrajecten +CHILL_PERSON_ACCOMPANYING_PERIOD_SEE_CONFIDENTIAL: Vertrouwelijke trajecten bekijken +CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_CREATE: Een ondersteuningsmaatregel aanmaken +CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_DELETE: Een ondersteuningsmaatregel verwijderen +CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_SEE: Ondersteuningsmaatregelen bekijken +CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE: Ondersteuningsmaatregelen bijwerken +CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_STATS: Statistieken over ondersteuningsmaatregelen +CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_SHOW: Evaluaties bekijken +CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_STATS: Statistieken over evaluaties +CHILL_PERSON_HOUSEHOLD_SEE: Huishoudens bekijken +CHILL_PERSON_HOUSEHOLD_EDIT: Huishoudens bewerken +CHILL_PERSON_HOUSEHOLD_STATS: Statistieken over huishoudens #period Period closed!: Hulpverleningstraject afgesloten! Pediod closing form is not valide: Het formulier voor het afsluiten van het hulpverleningstraject is niet geldig. +Consider canceled: Laat trajecten als geannuleerd tellen +Canceled parcours help: Indien aangevinkt worden trajecten met dit sluitingsmotief beschouwd als geannuleerd en niet meegeteld in statistieken. De wijziging geldt ook voor alle onderliggende motieven. +( Canceled period ): (geannuleerd) #widget @@ -313,12 +373,40 @@ Pediod closing form is not valide: Het formulier voor het afsluiten van het hulp Accompanyied people: Begeleide personen ## exports +Exports of persons: Exports van personen +Count people by various parameters.: Het aantal personen tellen op basis van diverse filters. +Count people: Aantal personen Count peoples by various parameters.: Aantal personen tellen die voldoen aan vershillende criteria. Count peoples: Aantal personen List peoples: Overzicht personen Create a list of people according to various filters.: Overzicht geven van personen die voldoen aan bepaalde criteria. Fields to include in export: Velden die toegevoegd moeten worden in de export van gegevens. Address valid at this date: Adres dat geldig is op deze datum. +Data valid at this date: Gegevens geldig op deze datum +Data regarding center, addresses, and so on will be computed at this date: Gegevens over territorium, adres en huishouden worden op deze datum berekend. +List duplicates: Lijst van dubbels +Create a list of duplicate people: Lijst aanmaken van als duplicaat gedetecteerde personen. +Count people participating in an accompanying course: Aantal personen die een traject volgen +Count people participating in an accompanying course by various parameters.: Het aantal trajectdeelnemers tellen op basis van diverse filters. + +Exports of accompanying courses: Exports van hulpverleningstrajecten +Count accompanying courses: Aantal trajecten +Count accompanying courses by various parameters: Het aantal trajecten tellen op basis van diverse filters. +Accompanying courses participation duration and number of participations: Duur en aantal deelnames aan trajecten +Create an average of accompanying courses duration of each person participation to accompanying course, according to filters on persons, accompanying course: Een rapport maken dat de gemiddelde duur van deelname van iedere persoon aan trajecten berekent, met filters op personen en trajecten. +Closingdate to apply: Einddatum te gebruiken wanneer het traject nog niet afgesloten is + +Exports of social work actions: Exports van ondersteuningsmaatregelen +Count social work actions: Aantal maatregelen +Count social work actions by various parameters: Het aantal ondersteuningsmaatregelen tellen op basis van diverse filters. +Average duration of social work actions: Gemiddelde duur van maatregelen +Calculate the average duration of social work actions: Gemiddelde duur van de ondersteuningsmaatregelen berekenen. + +Exports of evaluations: Exports van evaluaties +Count evaluations: Aantal evaluaties +Count evaluation by various parameters.: Het aantal evaluaties tellen op basis van diverse filters. + +Exports of households: Exports van huishoudens ## filters Filter by person gender: Filteren op basis van gender @@ -336,6 +424,43 @@ Born before this date: Geboren voor This field should not be empty: Dit veld mag niet leeg zijn This date should be after the date given in "born after" field: Deze datum moet vallen na de datum in het veld 'geboren na' "Filtered by person's birtdate: between %date_from% and %date_to%": "Filteren op basis van geboortedatum: enkel geboren tussen %date_from% en %date_to%" +"Filtered by person's birthdate: between %date_from% and %date_to%": "Filteren op basis van geboortedatum: enkel geboren tussen %date_from% en %date_to%" + +Filter by person's deathdate: Personen filteren op overlijdensdatum. +"Filtered by person's deathdate: between %date_from% and %date_to%": "Filteren op basis van overlijdensdatum: enkel overleden tussen %date_from% en %date_to%" +Death after this date: Overleden na deze datum +Deathdate before: Overleden voor deze datum +Alive: Levend +Deceased: Overleden +Filter in relation to this date: Filteren ten opzichte van deze datum +"Filtered by a state of %deadOrAlive%: at this date %date_calc%": "Gefilterd op personen die %deadOrAlive% zijn op datum %date_calc%" + +Filter by person's age: Personen filteren op leeftijd. +"Filtered by person's age: between %min_age% and %max_age%": "Gefilterd op leeftijd: tussen %min_age% en %max_age%" +Minimum age: Minimumleeftijd +Maximum age: Maximumleeftijd +The minimum age should be less than the maximum age.: De minimumleeftijd moet lager zijn dan de maximumleeftijd. + +Date during which residential address was valid: Datum waarop het domicilieadres geldig was + +Family composition: Gezins­samenstelling +Family composition at this time: Gezins­samenstelling op dit moment + +Filter by person's marital status: Personen filteren op burgerlijke staat +Filtered by person's marital status: Gefilterd op burgerlijke staat +Marital status at this time: Burgerlijke staat op dit moment + +Filter by entrusted child status: Personen filteren op "toevertrouwd kind" +Filtered by entrusted child status: Enkel personen die "toevertrouwd kind" zijn + +Filter by nomadic status: Personen filteren op "woonwagenbewoner" +Filtered by nomadic status: Enkel personen die "woonwagenbewoner" zijn + +"Filter by person's who have a residential address located at another user": Personen filteren die een domicilieadres hebben bij een andere gebruiker +"Filtered by person's who have a residential address located at another user": Enkel personen met een domicilieadres bij een andere gebruiker + +Filter by person's that are alive or have deceased at a certain date: Personen filteren op levend of overleden op een bepaalde datum +Filtered by person's that are alive or have deceased at a certain date: Enkel personen die levend of overleden zijn op een bepaalde datum "Filter by accompanying period: active period": "Filteren op basis van actieve hulpverleningstrajecten" Having an accompanying period opened after this date: Met een hulpverleningstraject dat geopend werd na deze datum @@ -351,7 +476,168 @@ Having an accompanying period closed after this date: Met een hulpverleningstraj "Having an accompanying period closed before this date": "Met een hulpverleningstraject afgesloten voor deze datum" "Filtered by accompanying period: persons having an accompanying period closed between the %date_from% and %date_to%": "Filteren op basis van hulpverleningstraject: met een traject dat afgesloten werd tussen %date_from% en %date_to%" +Filter by person having an activity in a period: Personen filteren die een uitwisseling hadden in de opgegeven periode +Filtered by person having an activity between %date_from% and %date_to% with reasons %reasons_name%: Enkel personen gelinkt aan een uitwisseling tussen %date_from% en %date_to% met de onderwerpen %reasons_name% + +Filter by social issue: Trajecten filteren op hulpvragen +Accepted socialissues: Hulpvragen +"Filtered by socialissues: only %socialissues%": "Gefilterd op hulpvraag: enkel %socialissues%" +Group by social issue: Trajecten groeperen op hulpvraag + +Accepted steps: Statussen +Step: Status +"Filtered by steps: only %step%": "Gefilterd op trajectstatus: enkel %step%" +Group by step: Trajecten groeperen op trajectstatus + +Filter by geographical unit: Trajecten filteren op geografische zone +Group by geographical unit: Trajecten groeperen op geografische zone +Compute geographical location at date: Datum waarop de geografische locatie wordt berekend +Geographical unit: Geografische zone +acp_geog_agg_unitname: Geografische zone +acp_geog_agg_unitrefid: Sleutel van de geografische zone +Geographical layer: Geografische laag +Select a geographical layer: Kies een geografische laag +Group people by geographical unit based on his address: Personen groeperen op geografische zone (op basis van het adres) +Filter by person's geographical unit (based on address): Personen filteren op geografische zone (op basis van het adres) + +Group by social action: Trajecten groeperen op ondersteuningsmaatregel + +Filter by type of action, goals and results: Ondersteuningsmaatregelen filteren op type, doel en resultaat +'Filtered actions by type, goals and results: %selected%': "Acties gefilterd op: %selected%" + +Filter by evaluation: Trajecten filteren op evaluatie +Accepted evaluations: Evaluaties +Evaluation: Evaluatie +"Filtered by evaluations: only %evals%": "Gefilterd op evaluatie: enkel %evals%" +Group by evaluation: Trajecten groeperen op evaluatie + +Filter accompanying course by activity type: Trajecten filteren op type uitwisseling +Accepted activitytypes: Types uitwisselingen +"Filtered by activity types: only %activitytypes%": "Gefilterd op uitwisselingstype: enkel %activitytypes%" + +Filter by origin: Trajecten filteren op oorsprong +Accepted origins: Oorsprongen +"Filtered by origins: only %origins%": "Gefilterd op oorsprong van het traject: enkel %origins%" +Group by origin: Trajecten groeperen op oorsprong + +Filter by closing motive: Trajecten filteren op sluitingsmotief +Accepted closingmotives: Sluitingsmotieven +"Filtered by closingmotive: only %closingmotives%": "Gefilterd op sluitingsmotief: enkel %closingmotives%" +Group by closing motive: Trajecten groeperen op sluitingsmotief + +Filter by administrative location: Trajecten filteren op administratieve locatie +Accepted locations: Administratieve locaties +Administrative location: Administratieve locatie +"Filtered by administratives locations: only %locations%": "Gefilterd op administratieve locatie: enkel %locations%" +Group by administrative location: Trajecten groeperen op administratieve locatie + +Filter by requestor: Trajecten filteren volgens de aard van de aanvrager +Accepted choices: '' +is person concerned: De aanvrager is een betrokken persoon +is other person: De aanvrager is een persoon maar niet betrokken +no requestor: Het traject heeft geen aanvrager +"Filtered by requestor: only %choice%": "Gefilterd op aanwezigheid van aanvrager onder de betrokken personen: enkel indien %choice%" +Group by requestor: Trajecten groeperen volgens de aard van de aanvrager + +Filter by confidential: Trajecten filteren op vertrouwelijkheid +Accepted confidentials: '' +is confidential: het traject is vertrouwelijk +is not confidential: het traject is niet vertrouwelijk +"Filtered by confidential: only %confidential%": "Gefilterd op vertrouwelijkheid: enkel indien %confidential%" +Confidentiality: Vertrouwelijkheid +Group by confidential: Trajecten groeperen op vertrouwelijkheid + +Filter by emergency: Trajecten filteren op urgentie +Accepted emergency: '' +is emergency: het traject is dringend +is not emergency: het traject is niet dringend +"Filtered by emergency: only %emergency%": "Gefilterd op urgentie: enkel indien %emergency%" +Emergency: Dringend +Group by emergency: Trajecten groeperen op urgentie + +Filter by intensity: Trajecten filteren op intensiteit +Accepted intensities: '' +is occasional: het traject is occasioneel +is regular: het traject is regelmatig +"Filtered by intensity: only %intensity%": "Gefilterd op intensiteit: enkel indien %intensity%" +Intensity: Intensiteit +Group by intensity: Trajecten groeperen op intensiteit + +Filter by active on date: Trajecten filteren die open zijn op een datum +On date: Open op deze datum +"Filtered by actives courses: active on %ondate%": "Trajecten gefilterd: actief op %ondate%" + +Filter by active at least one day between dates: Trajecten filteren die minstens één dag actief waren in de periode +"Filtered by actives courses: at least one day between %datefrom% and %dateto%": "Trajecten gefilterd: minstens één dag actief tussen %datefrom% en %dateto%" + +Filter by referrers: Trajecten filteren op referent +Accepted referrers: Referenten +"Filtered by referrer: only %referrers%": "Gefilterd op referent: enkel %referrers%" +Group by referrers: Trajecten groeperen op referent + +Filter by opened between dates: Trajecten filteren waarvan de openingsdatum tussen twee data ligt +Date from: Startdatum +Date to: Einddatum +"Filtered by opening dates: between %datefrom% and %dateto%": "Trajecten gefilterd op openingsdatum: tussen %datefrom% en %dateto%" + +Filter by temporary location: Trajecten filteren met een tijdelijke locatie +Filter by which has no referrer: Trajecten filteren zonder referent +"Filtered acp which has no referrer on date: %date%": "Gefilterd: trajecten zonder referent op datum %date%" +Has no referrer on this date: Heeft geen referent op deze datum +Filter by which has no action: Trajecten filteren zonder acties +Filtered acp which has no actions: "Gefilterd: enkel trajecten zonder acties" +Group by number of actions: Trajecten groeperen op aantal acties +Filter by creator: Trajecten filteren op aanmaker +'Filtered by creator: only %creators%': 'Gefilterd op aanmaker: enkel %creators%' + +Filter actions without end date: Acties filteren zonder einddatum (open) +Filtered actions without end date: "Gefilterd: enkel acties zonder einddatum (open)" +Filter by start date evaluations: Evaluaties filteren op startdatum +Filter by end date evaluations: Evaluaties filteren op einddatum +start period date: Startdatum van de periode +end period date: Einddatum van de periode +"Filtered by start date: between %start_date% and %end_date%": "Gefilterd op startdatum: tussen %start_date% en %end_date%" +"Filtered by end date: between %start_date% and %end_date%": "Gefilterd op einddatum: tussen %start_date% en %end_date%" +Filter by current evaluations: Evaluaties filteren die lopen +"Filtered by current evaluations": "Gefilterd: enkel lopende evaluaties" + +'Filtered by geographic unit: computed at %date%, only in %units%': 'Gefilterd op geografische eenheid: adres op %date%, enkel eenheden %units%' + +Filter by scope: Filteren op dienst + +Group social work actions by action type: Ondersteuningsmaatregelen groeperen op type +Group social work actions by goal: Ondersteuningsmaatregelen groeperen op doel +Group social work actions by result: Ondersteuningsmaatregelen groeperen op resultaat +Group social work actions by goal and result: Ondersteuningsmaatregelen groeperen op doel en resultaat +Goal Type: Doel +Result Type: Resultaat +Goal and result Type: Doel en resultaat + +Filter by evaluation type: Evaluaties filteren op type +Accepted evaluationtype: Evaluaties +"Filtered by evaluation type: only %evals%": "Gefilterd op evaluatietype: enkel %evals%" +Group by evaluation type: Evaluaties groeperen op type +Evaluation type: Evaluatietype + +Filter evaluations by maxdate mention: Evaluaties filteren met een vervaldatum +Maxdate: '' +maxdate is specified: de vervaldatum is opgegeven +maxdate is not specified: de vervaldatum is niet opgegeven +"Filtered by maxdate: only %choice%": "Gefilterd op vervaldatum: enkel indien %choice%" + +Filter by composition: Huishoudens filteren op gezins­samenstelling +Accepted composition: Gezins­samenstelling +"Filtered by composition: only %compositions% on %ondate%": "Gefilterd op gezins­samenstelling: enkel %compositions%, op datum %ondate%" +Group by composition: Huishoudens groeperen op gezins­samenstelling + +Group by number of children: Huishoudens groeperen op aantal kinderen + ## aggregators +Group by duration: Trajecten groeperen op duur +Rounded month duration: Duur in maanden (afgerond) +current duration: lopend +duration 0 month: 0 maanden (<15 dagen) +' months': ' maanden' Group people by nationality: Personen groeperen per nationaliteit Group by level: Groeperen per niveau Group by continents: Groeperen per continent @@ -359,13 +645,28 @@ Group by country: Groeperen per land Group people by gender: Groeperen op basis van gender -Aggregate by age: Groeperen op basis van -Calculate age in relation to this date: Leeftijd bereken relatief tot deze datum +Group people by their professional situation: Personen groeperen op beroepssituatie +Group people by marital status: Personen groeperen op burgerlijke staat +Group people by administrative status: Personen groeperen op administratieve situatie +Group people by employment status: Personen groeperen op beroepssituatie + +Aggregate by household position: Personen groeperen op positie in het huishouden +Household position in relation to this date: Positie in het huishouden op deze datum +Household position: Positie in het huishouden + +Aggregate by age: Personen groeperen op leeftijd +Calculate age in relation to this date: Leeftijd berekenen ten opzichte van deze datum Group people by country of birth: Personen groeperen op bais van geboorteland Similar persons: Gelijkaardige personen crud: + administrative_status: + index: + title: Administratieve situaties + add_new: Een nieuwe toevoegen + title_new: Nieuwe administratieve situatie toevoegen + title_edit: Deze administratieve situatie bijwerken closing_motive: index: title: Overzicht redenen tot afsluiten @@ -403,6 +704,122 @@ crud: add_new: Nieuw resultaat hulpverleningsmaatregel toevoegen title_new: Nieuw resultaat title_edit: Resultaat bijwerken + employment_status: + index: + title: Beroepssituaties + add_new: Een nieuwe toevoegen + title_new: Nieuwe beroepssituatie toevoegen + title_edit: Deze beroepssituatie bijwerken + origin: + index: + title: Overzicht herkomst van trajecten + add_new: Een nieuwe toevoegen + title_new: Nieuwe oorsprong + title_edit: Oorsprong bijwerken + person_marital-status: + index: + title: Overzicht burgerlijke staten + add_new: Een nieuwe toevoegen + title_new: Nieuwe burgerlijke staat + title_edit: Burgerlijke staat bijwerken + person_resource-kind: + index: + title: Types steunfiguren + add_new: Een nieuw type toevoegen + title_new: Nieuw type steunfiguur + title_edit: Type steunfiguur bijwerken + person_household_position: + index: + title: Posities + add_new: Een nieuwe toevoegen + title_new: Nieuwe positie + title_edit: Positie bijwerken + person_household_composition_type: + index: + title: Gezins­samenstellingen + add_new: Een nieuwe toevoegen + title_new: Nieuwe gezins­samenstelling + title_edit: Gezins­samenstelling bijwerken + person_relation: + index: + title: Verwantschapsrelaties + add_new: Een nieuwe toevoegen + title_new: Nieuwe verwantschapsrelatie + title_edit: Verwantschapsrelatie bijwerken + social_evaluation: + index: + title: Overzicht evaluaties + add_new: Een nieuwe evaluatie toevoegen + title_new: Nieuwe evaluatie + title_edit: Evaluatie bijwerken + +origin: + noActiveAfter: gedeactiveerd na + +evaluation: + deleted: Evaluatie verwijderd + delay: Vertraging + notificationDelay: Notificatietermijn + url: Internetlink + title: Een evaluatie schrijven + status: Status + choose_a_status: Kies een status + startdate: Startdatum + enddate: Einddatum + maxdate: Vervaldatum + warning_interval: Herinnering (dagen) + public_comment: Publieke nota + comment_placeholder: Begin te schrijven ... + generate_a_document: Een document genereren + choose_a_template: Kies een sjabloon + add_a_document: Een document toevoegen + add: Een evaluatie toevoegen + time_spent: Schrijftijd + select_time_spent: Geef de schrijftijd aan + Documents: Documenten + document_add: Een document genereren of uploaden + document_upload: Een document uploaden + document_title: Titel van het document + template_title: Naam van het sjabloon + browse: Een document toevoegen + replace: Vervangen + download: Het bestaande bestand downloaden + notification_notify_referrer: De referent verwittigen + notification_notify_any: Andere gebruikers verwittigen + notification_send: Een notificatie verzenden + document: + edit: Bijwerken + delete: Verwijderen + move: Verplaatsen + duplicate: Dupliceren + duplicate_here: Hier dupliceren + duplicate_to_other_evaluation: Dupliceren naar een andere evaluatie + duplicate_success: Het evaluatiedocument werd gedupliceerd + move_success: Het evaluatiedocument werd verplaatst + +goal: + desactivationDate: Deactiveringsdatum + results: Resultaten + +socialAction: + defaultNotificationDelay: Standaard notificatietermijn + socialIssue: Hulpvraag + +socialIssue: + isParent?: Ouder? + Parent id: ID van de ouder + +household_id: Identificatie van het huishouden +household: + allowHolder: Kan titularis zijn + shareHousehold: Lid van het huishouden + +relation: + title: Eerste lid + reverseTitle: Tweede lid + +days: dagen +years: jaren # specific to closing motive @@ -410,31 +827,40 @@ closing_motive: any parent: Geen ouder new child: Nieuw kind +Person configuration: Configuratie module "Persoon" Configuration of person bundle: Configuratie module "Persoon" person_admin: + accompanying_period: Hulpverleningstrajecten What would you like to configure ?: Wat wil u graag configureren ? closing motives: Redenen tot afsluiten closing motives list: Overzicht redenen tot afsluiten closing motive explanation: > De redenen tot afsluiten geven een indicatie over waarom een hulpverleningstraject werd afgesloten. + origin: Oorsprongen marital status: Burgerlijke staat marital status list: Overzicht burgerlijke staat marital status explanation: > Configureer lijst voor het aanduiden van de burgerlijke staat + person_resource_kind: Type steunfiguur social_issue: Hulpverleningsvragen social_action: Hulpverleningsmaatregelen social_goal: Doelen social_result: Resultaten social_evaluation: Evaluaties + social_work: Sociale begeleiding + relation: Verwantschapsrelaties # specific to accompanying period accompanying_period: + deleted: Hulpverleningstraject verwijderd dates: Periode dates_from_%opening_date%: Actief sinds %opening_date% dates_from_%opening_date%_to_%closing_date%: Actief van %opening_date% tot %closing_date% DRAFT: Ontwerp CONFIRMED: Bevestigd CLOSED: Afgesloten + CONFIRMED_INACTIVE_SHORT: Buiten actieve lijst + CONFIRMED_INACTIVE_LONG: Voor-archief emergency: Dringend occasional: éénmalig regular: regelmatig @@ -464,12 +890,21 @@ fix it: Aanvullen accompanying_course: administrative_location: Administratieve locatie comment is pinned: Deze opmerking is gepinned + comment is unpinned: De opmerking is losgemaakt + +show: Tonen +hide: Verbergen +closed periods: afgesloten trajecten +Accompanying course configuration: Beheer van hulpverleningstrajecten +Social work configuration: Beheer van ondersteuningsmaatregelen # Accompanying Course comments Accompanying Course Comment: Opmerking +Accompanying Course Comments: Opmerkingen Accompanying Course Comment list: Opmerkingen hulpverleningstraject pinned: pinnen Pin comment: Pinnen +Unpin comment: Ontpinnen Post a new comment: Een nieuwe opmerking posten Write a new comment: Een nieuwe opmerking schrijven Edit a comment: Opmerking bijwerken @@ -497,6 +932,9 @@ Concerns household n°%id%: Betrokken huishouden n°%id% Composition: huishoudenssamenstelling Budget: Budget The composition has been successfully removed.: De huishoudenssamenstelling werd verwijdert. +edit address valid from: Datum van de verhuis aanpassen +Edit household address valid from: Datum van de verhuis van het huishouden aanpassen +Household configuration: Beheer van huishoudens # accompanying course work Accompanying Course Actions: Hulpverleningsmaatregelen @@ -504,9 +942,11 @@ Accompanying Course Action: Hulpverleningsmaatregel Are you sure you want to remove this work of the accompanying period %name% ?: Bent u zeker de hulpverleningsmaatregel voor het traject %name% te willen verwijderen? The accompanying period work has been successfully removed.: De hulpverleningsmaatregel werd verwijdert accompanying_course_work: + deleted: Hulpverleningsmaatregel verwijderd create: Voeg een hulpverleningsmaatregel toe Create accompanying course work: Voeg een hulpverleningsmaatregel toe Edit accompanying course work: Hulpverleningsmaatregel bijwerken + Show accompanying course work: Hulpverleningsmaatregel List accompanying course work: Overzicht hulpverleningsmaatregelen action: Hulpverleningsmaatregel create_date: Aanmaakdatum @@ -523,6 +963,13 @@ accompanying_course_work: Any work: Geen enkele hulpverleningsmaatregel remove: Hulpverleningsmaatregel verwijderen social_evaluation: Evaluatie + private_comment: Privéopmerking + timeSpent: Schrijftijd + date_filter: Filteren op datum + types_filter: Filteren op actietype + user_filter: Filteren op intervenant + On-going works over total: Lopende acties / totaal acties van het traject + my_actions_filter: Mijn acties (waar ik optreed) # Person addresses: Verblijfsadres @@ -546,6 +993,8 @@ docgen: A context for accompanying period work evaluation: Context voor de evaluatie van de hulpverleningsmaatregel Person basic: Persoon (basis) A basic context for person: Context voor de personen + Label for third party: Label dat aan gebruikers wordt getoond + Document title: Titel van het gegenereerde document period_notification: period_designated_subject: U bent de doorverwijzer voor dit huplverleningstraject @@ -570,6 +1019,8 @@ household_composition: Add a composition: Een huishoudenssamenstelling toevoegen Update composition: huishoudenssamenstelling bijwerken Create: Een nieuwe huishoudenssamenstelling toewijzen + numberOfDependents: Aantal personen ten laste + numberOfDependentsWithDisabilities: Aantal personen met een erkende handicap ten laste # docgen Linked evaluations: Gerelateerde evaluaties @@ -577,8 +1028,544 @@ Linked evaluations: Gerelateerde evaluaties # Accompanying period per user My accompanying periods: Mijn hulpverleningstrajecten My accompanying periods in draft: Mijn hulpverleningstrajecten in ontwerp +Display draft periods created by me: Toon de trajecten in ontwerp die ik heb gemaakt. Ze zijn enkel zichtbaar voor mij en worden 15 dagen na aanmaak automatisch verwijderd. +Number of periods: Aantal trajecten period_by_user_list: Period by user: Hulpverleningstrajecten per gebruiker Pick a user: Selecteer een gebruiker om zijn/haar hulpverleningstrajecten te zien Any course or no authorization to see them: Deze gebruiker heeft geen hulpverleningstrajecten of geen waartoe u toegang heeft. + +workflow: + doc for evaluation deleted: Document verwijderd in een evaluatie + SocialAction deleted: Ondersteuningsmaatregel verwijderd + signature_list: + title: Handtekening in afwachting + menu: Handtekening in afwachting + no_signatures: Geen aangevraagde handtekeningen + +reassign: + Bulk reassign: Trajecten herverdelen + Current user: Trajecten per referent + Next user: Nieuwe referent + Choose a user and click on "Filter" to apply: Kies een gebruiker en klik op "Filteren" om de trajecten te tonen + All periods on this list will be reassigned to this user, excepted the one you manually reassigned before: Alle trajecten op deze pagina worden aan deze gebruiker toegewezen, behalve die u manueel anders toewijst. + Reassign: Referent toewijzen + List periods to be able to reassign them: Kies een gebruiker en klik op "Filteren" om zijn/haar trajecten te tonen. Daarna kunt u ze herverdelen. + Filter by postal code: Filteren op postcode + Filter course which are located inside a postal code: Alleen trajecten tonen die bij deze postcode gelokaliseerd zijn (een gemeente kan meerdere postcodes hebben). + +notification: + Notify referrer: Referent verwittigen + Notify any: Andere gebruikers verwittigen + +personId: Identificatie van de persoon + +export: + enum: + frequency: + YYYY-IW: per week + YYYY-MM: per maand + YYYY: per jaar + export: + acp_closing: + title: Aantal statuswijzigingen van trajecten + description: Telt het aantal statuswijzigingen van trajecten. Deze export is geschikt om het aantal trajecten te kennen die binnen een periode geopend of gesloten werden (een traject kan binnen de periode gesloten en opnieuw geopend worden). + acp_stats: + avg_duration: Gemiddelde duur van deelname van elke betrokken persoon + count_participations: Aantal afzonderlijke deelnames + count_persons: Aantal verschillende betrokken personen + count_acps: Aantal verschillende trajecten + + nb_household_with_course: + Count households with accompanying course: Aantal huishoudens betrokken bij een traject + Count households: Aantal huishoudens + Count accompanying periods: Aantal trajecten + Count household with accompanying course by various parameters.: Telt het aantal huishoudens met een traject volgens diverse filters. + Date of calculation of household members: Datum waarop de leden van het huishouden worden berekend + + count_accompanying_period_work_associate_person: + title: Aantal acties, filters en groeperingen op de personen van het traject + description: Telt het aantal ondersteuningsmaatregelen met filters en groeperingen op personen, trajecten en acties. De filters en groeperingen op personen werken op de betrokken personen van het traject van de actie. + header: Aantal acties + + count_accompanying_period_work_associate_work: + title: Aantal acties, filters en groeperingen op de personen van de actie + description: Telt het aantal ondersteuningsmaatregelen met filters en groeperingen op personen, trajecten en acties. De filters en groeperingen op personen werken op de betrokken personen van de actie. + header: Aantal acties + count_person_on_acpw_associate_person_on_work: + title: Aantal personen betrokken bij een ondersteuningsmaatregel, filters en groeperingen op de personen van de actie + description: Telt het aantal personen betrokken bij een ondersteuningsmaatregel met filters en groeperingen op personen, trajecten en acties. De filters en groeperingen op personen werken op de betrokken personen van de actie. Als iemand bij meerdere acties betrokken is, wordt hij slechts eenmaal geteld. + header: Aantal personen betrokken bij een actie + + avg_duration_acpw_associate_on_period: + title: Gemiddelde duur van ondersteuningsmaatregelen, filters en groeperingen op de personen van het traject + header: Gemiddelde duur van ondersteuningsmaatregelen (in dagen) + description: Berekent de gemiddelde duur van ondersteuningsmaatregelen met filters en groeperingen op personen, trajecten en acties. De filters en groeperingen werken op de betrokken personen van het traject van de actie. + + avg_duration_acpw_associate_on_work: + title: Gemiddelde duur van ondersteuningsmaatregelen, filters en groeperingen op de personen van de actie + header: Gemiddelde duur van ondersteuningsmaatregelen (in dagen) + description: Berekent de gemiddelde duur van ondersteuningsmaatregelen met filters en groeperingen op personen, trajecten en acties. De filters en groeperingen werken op de betrokken personen van de actie. + + aggregator: + person: + by_household_composition: + Household composition: Huishoudsamenstelling + Group course by household composition: Trajecten groeperen op huishoudsamenstelling + Calc date: Datum voor berekening van de huishoudsamenstelling + by_center: + title: Personen groeperen op territorium + at_date: Datum voor berekening van het territorium + center: Territorium van de persoon + by_postal_code: + title: Personen groeperen op postcode van het adres + at_date: Datum voor berekening van het adres + header: Postcode + + step_history: + by_step: + title: Statuswijzigingen van traject groeperen per stap + header: Nieuwe trajectstatus + by_date: + title: Statuswijzigingen van traject groeperen per datum + header: Datum van statuswijziging van traject + date_grouping_label: Groeperen per + by_closing_motive: + title: Statuswijzigingen van traject groeperen per sluitingsmotief + header: Sluitingsmotief + + course: + by-user: + title: Trajecten groeperen per betrokken persoon + header: Betrokken persoon + by_referrer: + Referrer after: Referent vanaf + Until: Tot + by_referrer_scope: + Referrer and scope after: Referent en dienst vanaf + Until: Tot + by_referrer_job: + Referrer and job after: Referent en beroep vanaf + Until: Tot + by_user_scope: + Group course by referrer's scope: Trajecten groeperen per dienst van de referent + Referrer's scope: Dienst van de trajectreferent + by_user_job: + Group by user job: Trajecten groeperen per beroep van de referent + duration: + day: Duur van het traject in dagen + week: Duur van het traject in weken + month: Duur van het traject in maanden + Precision: Eenheid van de duur + by_number_of_action: + Number of actions: Aantal acties + by_creator_job: + Creator's job: Beroep van de aanmaker + Group by creator job: Trajecten groeperen per beroep van de aanmaker + by_user_working: + title: Trajecten groeperen per intervenant + user: Intervenant + by_job_working: + title: Trajecten groeperen per beroep van de intervenant + job: Beroep van de intervenant + Calc date: Datum voor berekening van het beroep van de intervenant + by_scope_working: + title: Trajecten groeperen per dienst van de intervenant + scope: Dienst van de intervenant + Calc date: Datum voor berekening van de dienst van de intervenant + by_scope: + Group course by scope: Trajecten groeperen per dienst + by_opening_date: + title: Trajecten groeperen per openingsdatum + frequency: Groeperingsinterval + header: Openingsdatum van trajecten (periode) + by_closing_date: + title: Trajecten groeperen per sluitingsdatum + frequency: Groeperingsinterval + header: Sluitingsdatum van trajecten (periode) + + course_work: + by_treating_agent: + Calc date: Referent op datum + Group by treating agent: Acties groeperen per behandelend medewerker + by_current_action: + Current action ?: Lopende actie? + Group by current actions: Acties groeperen op lopend + Current action: Lopende actie + Not current action: Afgeronde actie + by_agent_scope: + Group by treating agent scope: Acties groeperen per dienst van de behandelaar + Calc date: Datum voor berekening van de dienst van de behandelaar + by_agent_job: + Group by treating agent job: Acties groeperen per beroep van de behandelaar + Calc date: Datum voor berekening van het beroep van de behandelaar + by_handling_third_party: + title: Acties groeperen per behandelende derde + header: Behandelende derde + by_creator: + title: Acties groeperen per aanmaker + Creator: Aanmaker van de actie + by_creator_job: + title: Acties groeperen per beroep van de aanmaker + Creator's job: Beroep van de aanmaker + by_creator_scope: + title: Acties groeperen per dienst van de aanmaker + Creator's scope: Dienst van de aanmaker + + eval: + by_end_date: + Has end date ?: Evaluatie in uitvoering? + Group evaluations having end date: Evaluaties groeperen (met of zonder einddatum) + enddate is specified: de einddatum is opgegeven + enddate is not specified: de einddatum is niet opgegeven + Group by end date evaluations: Evaluaties groeperen per week/maand/jaar van de einddatum + End date period: Einde (per periode) + by_start_date_period: + Start date period: Begin (per periode) + Group by start date evaluations: Evaluaties groeperen per week/maand/jaar van de startdatum + by_max_date: + Group by max date evaluations: Evaluaties groeperen per week/maand/jaar van de vervaldatum + Max date: Vervaldatum + filter: + by_geog_unit: + Filtered by person's geographical unit (based on address) computed at %datecalc%, only %units%: Gefilterd op geografische eenheid (op basis van adres), berekend op %datecalc%, enkel %units% + + step_history: + by_step: + title: Statuswijzigingen van traject filteren per stap + pick_steps: Nieuwe stappen + description: "Gefilterd op stap: enkel %steps%" + by_date: + title: Statuswijzigingen van traject filteren per datum + start_date_label: Wijzigingen na + end_date_label: Wijzigingen voor + + person: + by_composition: + Filter by household composition: Personen filteren op huishoudsamenstelling + Accepted compositions: Huishoudsamenstellingen + Date calc: Berekeningsdatum + 'Filtered by composition at %date%: only %compositions%': 'Gefilterd op huishoudsamenstelling, op %date%, enkel %compositions%' + by_no_composition: + Filter persons without household composition: Personen filteren zonder huishoudsamenstelling (noch huishouden) + Persons filtered by no composition at %date%: Enkel personen zonder huishoudsamenstelling op %date% + Date calc: Berekeningsdatum + by_address_ref_status: + Filter by person's address ref status: Personen filteren via vergelijking met referentieadres + to_review: Verschilt van referentieadres + reviewed: Verschilt van referentieadres maar behouden door gebruiker + match: Identiek aan het referentieadres + "Filtered by person\\'s address status computed at %datecalc%, only %statuses%": Gefilterd op vergelijking met referentieadres, berekend op %datecalc%, enkel %statuses% + Filtered by person's address status computed at %datecalc%, only %statuses%: Gefilterd op vergelijking met referentieadres, berekend op %datecalc%, enkel %statuses% + Status: Status + Address at date: Adres op datum + with_participation_between_dates: + date_after: Betrokken bij een traject na + date_before: Betrokken bij een traject voor + title: Personen filteren die minstens één dag aan een traject verbonden waren in de opgegeven periode + 'Filtered by participations during period: between %dateafter% and %datebefore%': 'Gefilterd op personen met een traject tussen %dateafter% en %datebefore%' + without_participation_between_dates: + date_after: Na + date_before: Voor + title: Personen filteren die aan geen enkel traject gekoppeld waren + gender: + no_gender: gender niet gespecificeerd + + course: + not_having_address_reference: + title: Trajecten filteren zonder locatie op een referentieadres + adress_at: Adres op datum + having_info_within_interval: + title: Trajecten filteren die tussen twee data een interventie kregen + start_date: Begin van de periode + end_date: Einde van de periode + Only course with events between %startDate% and %endDate%: Alleen trajecten met een interventie tussen %startDate% en %endDate% + by_user_working: + title: Trajecten filteren per intervenant, tussen twee data + 'Filtered by user working on course: only %users%, between %start_date% and %end_date%': 'Gefilterd op intervenanten van het traject: enkel %users%, tussen %start_date% en %end_date%' + User working after: Interventie na + User working before: Interventie voor + by_job_working: + title: Trajecten filteren per beroep van de intervenant, tussen twee data + 'Filtered by job working on course: only %jobs%, between %start_date% and %end_date%': 'Gefilterd op beroep van intervenanten op het traject: enkel %jobs%, tussen %start_date% en %end_date%' + Job working after: Interventie na + Job working before: Interventie voor + Calc date: Berekeningsdatum + by_scope_working: + title: Trajecten filteren per dienst van de intervenant, tussen twee data + 'Filtered by scope working on course: only %scopes%, between %start_date% and %end_date%': 'Gefilterd op dienst van intervenanten op het traject: enkel %scopes%, tussen %start_date% en %end_date%' + Scope working after: Interventie na + Scope working before: Interventie voor + Calc date: Berekeningsdatum + by_step: + Filter by step: Trajecten filteren op trajectstatus + Filter by step between dates: Trajecten filteren op trajectstatus tussen twee data + steps: Geselecteerde statussen + date_calc: Datum waarop de status geldt + date_from: Status behaald na deze datum + date_to: Status behaald voor deze datum + 'Filtered by steps: only %step% and between %date_from% and %date_to%': 'Gefilterd op status: enkel %step%, tussen %date_from% en %date_to%' + by_user_scope: + Filter by user scope: Trajecten filteren op dienst van de referent + Start from: Referent en dienst vanaf + Until: Tot + by_referrer: + Computation date for referrer: Datum waarop de referent actief was + by_referrer_between_dates: + title: Trajecten filteren op referent (tussen twee data) + start date: De referent was actief na + end date: De referent was actief voor + having_temporarily: + label: Kwaliteit van de locatie + Having a temporarily location: Met een tijdelijke locatie + Having a person's location: Gelokaliseerd bij een persoon + Calculation date: Datum van de locatie + creator_job: + Filter by creator job: Trajecten filteren op beroep van de aanmaker + 'Filtered by creator job: only %jobs%': 'Gefilterd op beroep van de aanmaker: enkel %jobs%' + by_user_job: + Filter by user job: Trajecten filteren op beroep van de referent + Start from: Referent en beroep vanaf + Until: Tot + by_social_action: + title: Trajecten filteren op ondersteuningsmaatregel + Accepted socialactions: Ondersteuningsmaatregelen + accepted socialations help: Indien leeg, worden alle actietypes meegenomen + "Filtered by socialactions: only %socialactions%": "Gefilterd op ondersteuningsmaatregel: enkel %socialactions%, startdatum na %start_date_after% en voor %start_date_before%, einddatum na %end_date_after% en voor %end_date_before%" + start date after: Startdatum van de actie na + start date after help: Wordt genegeerd indien leeg + start date before: Startdatum van de actie voor + start date before help: Wordt genegeerd indien leeg + end date after: Einddatum van de actie na + end date after help: Wordt genegeerd indien leeg. Acties zonder einddatum worden altijd meegenomen. + end date before: Einddatum van de actie voor + end date before help: Wordt genegeerd indien leeg. Acties zonder einddatum worden altijd meegenomen. + date ignored: datumclausule genegeerd + + work: + start_between_dates: + title: Acties filteren waarvan de startdatum tussen twee data ligt + start_date: Startdatum + end_date: Einddatum + keep_null: Acties zonder startdatum behouden + keep_null_help: Indien aangevinkt worden acties zonder startdatum meegeteld. Indien niet, worden ze niet meegeteld. + Only where start date is between %startDate% and %endDate%: Enkel acties waarvan de startdatum tussen %startDate% en %endDate% ligt + end_between_dates: + title: Acties filteren waarvan de einddatum tussen twee data ligt (of actie nog loopt) + start_date: Startdatum + end_date: Einddatum + keep_null: Acties zonder einddatum behouden (lopende acties) + keep_null_help: Indien aangevinkt worden acties zonder einddatum meegeteld. Indien niet, worden ze niet meegeteld. + Only where start date is between %startDate% and %endDate%: Enkel acties waarvan de einddatum tussen %startDate% en %endDate% ligt + by_user_job: + Filter by treating agent job: Acties filteren op beroep van de behandelaar + "Filtered by treating agent job: only %jobs%": "Gefilterd op beroep van de behandelaar: enkel %jobs%" + Calc date: Datum voor berekening van het beroep van de behandelaar + by_user_scope: + Filter by treating agent scope: Acties filteren op dienst van de behandelaar + "Filtered by treating agent scope: only %scopes%": "Gefilterd op dienst van de behandelaar: enkel %scopes%" + Calc date: Datum voor berekening van de dienst van de behandelaar + by_treating_agent: + Filter by treating agent: Acties filteren op behandelend medewerker + Accepted agents: Behandelend medewerker + Calc date: Datum waarop de medewerker als behandelaar actief is + calc_date_help: Dit is de datum waarop de medewerker actief is als behandelaar, niet de datum van de toewijzing. + "Filtered by treating agent: only %agents%": "Gefilterd op behandelend medewerker: enkel %agents%" + by_handling3party: + title: Acties filteren op behandelende derde + Only 3 parties %3parties%: "Alleen acties met als behandelende derde: %3parties%" + pick_3parties: Behandelende derden van de acties + by_creator: + title: Acties filteren op aanmaker + Creators: Aanmaker van de actie + "Filtered by creator: only %creators%": "Gefilterd op aanmaker van de actie: enkel %creators%" + by_creator_job: + title: Acties filteren op beroep van de aanmaker + "Filtered by creator job: only %jobs%": "Gefilterd op beroep van de aanmaker: enkel %jobs%" + by_creator_scope: + title: Acties filteren op dienst van de aanmaker + "Filtered by creator scope: only %scopes%": "Gefilterd op dienst van de aanmaker: enkel %scopes%" + evaluation_between_dates: + title: Acties filteren die gekoppeld zijn aan een evaluatie tussen twee data + description: Enkel acties gekoppeld aan een evaluatie aangemaakt tussen %startDate% en %endDate% + start_date: Startdatum + end_date: Einddatum + + list: + person_with_acp: + List peoples having an accompanying period: Lijst van personen met een hulpverleningstraject + List peoples having an accompanying period with period details: Lijst van betrokken personen met details per traject + Create a list of people having an accompaying periods, according to various filters.: Maak een lijst van personen met een traject, volgens diverse criteria over traject of persoon + Create a list of people having an accompaying periods with details of period, according to various filters.: Maak een lijst van personen met een traject, volgens diverse criteria, met trajectdetails toegevoegd. + + acp: + List of accompanying periods: Lijst van hulpverleningstrajecten + Generate a list of accompanying periods, filtered on different parameters.: Genereer een lijst van trajecten, gefilterd op verschillende parameters. + Date of calculation for associated elements: Datum voor berekening van gekoppelde elementen + The associated referree, localisation, and other elements will be valid at this date: De gekoppelde referent, locatie en andere elementen zijn geldig op deze datum + acpId: Traject-ID + openingDate: Openingsdatum van het traject + closingDate: Sluitingsdatum van het traject + closingMotive: Sluitingsmotief + job: Beroep + confidential: Vertrouwelijk + emergency: Dringend + intensity: Intensiteit + acpCreatedAt: Aangemaakt op + acpUpdatedAt: Laatste update op + acpOrigin: Oorsprong van het traject + origin: Oorsprong van het traject + acpClosingMotive: Sluitingsmotief + acpJob: Beroep van het traject + acpCreatedBy_id: Aangemaakt door (ID) + acpCreatedBy: Aangemaakt door + acpUpdatedBy_id: Laatste wijziging door (ID) + acpUpdatedBy: Laatste wijziging door + administrativeLocation: Administratieve locatie + step: Stap + stepSince: Laatste wijziging van de stap + referrer: Referent + referrerSince: Referent sinds + locationIsPerson: Traject gelokaliseerd bij een betrokken persoon + locationIsTemp: Traject met tijdelijke locatie of gelokaliseerd bij een persoon + locationPersonName: Persoon bij wie het traject gelokaliseerd is + locationPersonId: ID van de persoon bij wie het traject gelokaliseerd is + acpaddress_fieldscountry: Land van het adres + isRequestorPerson: Is de aanvrager een persoon? + requestorPersonId: ID van de aanvrager (persoon) + acprequestorPerson: Naam van de aanvrager (persoon) + scopes: Diensten + socialIssues: Hulpvragen + requestorPerson: Aanvrager (persoon) + requestorThirdParty: Aanvrager (derde) + acpParticipantPersons: Betrokken personen + acpParticipantPersonsIds: Betrokken personen (ID's) + duration: Duur van het traject (in dagen) + centers: Territoria van de personen + + eval: + List of evaluations: Lijst van evaluaties + Generate a list of evaluations, filtered on different parameters: Genereer een lijst van evaluaties, gefilterd op verschillende parameters. + Date of calculation for associated elements: Datum voor berekening van gekoppelde elementen + help_description: De gekoppelde elementen, zoals referent en adres, worden op deze datum geëvalueerd + id: Evaluatie-ID + startDate: Startdatum + endDate: Einddatum + maxDate: Vervaldatum + warningInterval: Herinnering + acpw_id: Actie-ID + acpw_startDate: Start van de actie + acpw_endDate: Einde van de actie + acpw_socialaction_id: Actie-ID + acpw_socialaction: Titel van de actie + acpw_socialissue: Hulpvraag + acpw_note: Opmerking over de actie + acpw_acp_id: Traject-ID + acpw_acp_user: Referent van het traject + acpw_referrers: Behandelend medewerker op de opgegeven datum + acpw_persons_id: ID van de betrokken personen + acpw_persons: Betrokken personen van de actie + comment: Opmerking bij de evaluatie + eval_title: Titel van de evaluatie + createdAt: Aanmaakdatum + updatedAt: Wijzigingsdatum + createdBy: Aangemaakt door + updatedBy: Gewijzigd door + timeSpent: Schrijftijd (minuten) + + acpw_associate_work: + List of accompanying period works: Lijst van acties, filters op de personen van de actie + List description: Telt het aantal ondersteuningsmaatregelen met mogelijke filters op personen, trajecten en acties. De filters en groeperingen hebben betrekking op de betrokken personen van de actie. + + acpw_associate_period: + List of accompanying period works: Lijst van acties, filters op de personen van het traject + List description: Genereer een lijst van ondersteuningsmaatregelen met mogelijke filters op personen, trajecten en acties. De personenfilters werken op de betrokken personen van het traject van de actie. + + acpw: + List of accompanying period works: Lijst van acties + List description: Genereer een lijst van ondersteuningsmaatregelen, gefilterd op verschillende parameters. + Date of calculation for associated elements: Datum voor berekening van gekoppelde elementen + help_description: De behandelend medewerker van de actie is geldig op deze datum + id: Actie-ID + startDate: Startdatum + endDate: Einddatum + note: Opmerking over de actie + createdAt: Aanmaakdatum + updatedAt: Wijzigingsdatum + socialActionId: Actie-ID + socialAction: Titel van de actie + socialIssue: Hulpvraag + createdBy: Aangemaakt door + updatedBy: Gewijzigd door + acp_id: Traject-ID + acp_user: Referent van het traject + acpwReferrers: Behandelende medewerkers + referrer: Referent van het traject + personsId: ID's van de betrokken personen + personsName: Betrokken personen van de actie + goalsId: Doel-ID's + goalsTitle: Doelen + goalResultsId: Resultaat-ID's van doelen + goalResultsTitle: Resultaten van doelen + resultsId: Resultaat-ID's + resultsTitle: Resultaten + evaluationsId: Evaluatie-ID's + evaluationsTitle: Evaluaties + + household: + List household associated with accompanying period title: Lijst van huishoudens betrokken bij een traject + List description: Genereer de lijst van huishoudens, gefilterd volgens diverse parameters. + Date of calculation for associated elements: Datum voor berekening van gekoppelde elementen + help_description: De gekoppelde elementen, zoals adres, leden en samenstelling van het huishouden, zijn geldig op deze datum + id: Huishouden-ID + address: Adres van het huishouden + membersId: ID's van de leden van het huishouden + membersName: Leden van het huishouden + membersCount: Aantal leden + compositionNumberOfChildren: Aantal kinderen in de samenstelling + compositionComment: Opmerking over de samenstelling + compositionType: Type samenstelling + + acpaddress_fieldscountry: Land + +social_action: + and children: en afgeleiden + +social_issue: + and children: en afgeleiden + +generic_doc: + filter: + keys: + accompanying_period_work_evaluation_document: Document van ondersteuningsmaatregelen + +entity_display_title: + Evaluation (n°%eval%): Evaluatie (n°%eval%) + Work (n°%w%): Ondersteuningsmaatregel (n°%w%) + Accompanying Course (n°%w%): Hulpverleningstraject (n°%w%) + +acpw_duplicate: + title: Ondersteuningsmaatregelen samenvoegen + description: Deze samenvoeging bewaart de oudste startdatum, de meest recente einddatum, alle evaluaties, documenten en workflows. Behandelaars en derde partijen worden samengevoegd. Opmerkingen worden achter elkaar geplaatst. + Select accompanying period work: Een ondersteuningsmaatregel selecteren + Select an evaluation: Een evaluatie selecteren + Assign duplicate: Een dubbele ondersteuningsmaatregel aanduiden + Accompanying period work to delete: Ondersteuningsmaatregel te verwijderen + Accompanying period work to delete explanation: Deze ondersteuningsmaatregel wordt verwijderd. + Accompanying period work to keep: Ondersteuningsmaatregel te behouden + to keep: Te behouden ondersteuningsmaatregel + to delete: Te verwijderen ondersteuningsmaatregel + Successfully merged: Ondersteuningsmaatregel succesvol samengevoegd. + You cannot merge a accompanying period work with itself. Please choose a different one: U kunt een ondersteuningsmaatregel niet met zichzelf samenvoegen. Kies een andere. + +my_parcours_filters: + referrer_parcours_and_acpw: Behandelend medewerker of referent + referrer_acpw: Behandelend medewerker van een actie + referrer_parcours: Referent + parcours_intervening: Intervenant + is_open: Open trajecten + is_closed: Afgesloten trajecten + +document_duplicate: + to_evaluation_success: Het document werd gedupliceerd diff --git a/src/Bundle/ChillPersonBundle/translations/validators.nl.yml b/src/Bundle/ChillPersonBundle/translations/validators.nl.yml index 014fa0822..2ca6e1549 100644 --- a/src/Bundle/ChillPersonBundle/translations/validators.nl.yml +++ b/src/Bundle/ChillPersonBundle/translations/validators.nl.yml @@ -9,4 +9,69 @@ 'Opening date is not valid': 'Startdatum is ongeldig' 'Opening date can not be null': 'Startdatum kan niet nul zijn' 'Closing date is not valid': 'De datum van afsluiten is niet correct' -'Closing date can not be null': 'De datum van afsluiten kan niet nul zijn' \ No newline at end of file +'Closing date can not be null': 'De datum van afsluiten kan niet nul zijn' +The date of closing is before the date of opening: De sluitingsdatum ligt voor de openingsdatum +The closing date must be later than the date of creation: De sluitingsdatum moet later zijn dan de aanmaakdatum van het traject +The birthdate must be before %date%: De geboortedatum moet voor %date% zijn +'Invalid phone number: it should begin with the international prefix starting with "+", hold only digits and be smaller than 20 characters. Ex: +33123456789': 'Ongeldig telefoonnummer: het moet beginnen met het internationale voorvoegsel voorafgegaan door "+", alleen cijfers bevatten en minder dan 20 tekens zijn. Bijv.: +31623456789' +'Invalid phone number: it should begin with the international prefix starting with "+", hold only digits and be smaller than 20 characters. Ex: +33623456789': 'Ongeldig telefoonnummer: het moet beginnen met het internationale voorvoegsel voorafgegaan door "+", alleen cijfers bevatten en minder dan 20 tekens zijn. Bijv.: +33623456789' +'The email is not valid': 'Het e-mailadres is niet geldig' +Two addresses has the same validFrom date: De geldigheidsdatum is identiek aan die van een ander adres +The firstname cannot be empty: De voornaam kan niet leeg zijn +The lastname cannot be empty: De achternaam kan niet leeg zijn +The gender must be set: Het geslacht moet worden ingevuld +You are not allowed to perform this action: U heeft niet het recht om deze waarde te wijzigen. +Sorry, but someone else has already changed this entity. Please refresh the page and apply the changes again: Sorry, maar iemand anders heeft deze entiteit al gewijzigd. Vernieuw de pagina en pas de wijzigingen opnieuw toe + +A center is required: Een territorium is vereist + +#export list +You must select at least one element: U moet ten minste één element selecteren + +# filter by person birthdate +The "date to" should not be empty: Het veld "geboren vóór deze datum" kan niet leeg zijn +The "date from" should not be empty: Het veld "geboren na deze datum" kan niet leeg zijn +The date "date to" should be after the date given in "date from" field: De datum "geboren vóór deze datum" moet eerder zijn dan de datum "geboren na deze datum". + +# filter by nationality +A nationality must be selected: Een nationaliteit moet worden gekozen + +# aggregator by country, nationality +You should select an option: Een optie moet worden gekozen. + +# aggregator by age +The date should not be empty: De datum mag niet leeg zijn + +# household +household: + max_holder_overflowed_infinity: Er kunnen niet meer dan twee houders tegelijk zijn. Met deze wijziging zal dit aantal vanaf {{ start }} worden overschreden. + max_holder_overflowed: Er kunnen niet meer dan twee houders tegelijk zijn. Met deze wijziging zal dit aantal tussen {{ start }} en {{ end }} worden overschreden. +household_membership: + The end date must be after start date: De einddatum van het lidmaatschap moet later zijn dan de begindatum. + Person with membership covering: Een gebruiker kan niet tegelijkertijd tot twee huishoudens behoren. Met deze wijziging zou %person_name% vanaf %from% tot %nbHousehold% huishoudens behoren. + +# Accompanying period +'{{ name }} is already associated to this accompanying course.': '{{ name }} is al gekoppeld aan dit traject.' +A course must contains at least one social issue: 'Een traject moet aan ten minste één sociale problematiek worden gekoppeld' +A course must be associated to at least one scope: 'Een traject moet aan ten minste één dienst worden gekoppeld' +The social %name% issue cannot be deleted because it is associated with an activity or an action: 'De sociale problematiek "%name%" kan niet worden verwijderd omdat deze is gekoppeld aan een uitwisseling of een actie' +A confidential parcours must have a referrer: 'Een vertrouwelijk traject moet een referent hebben' +Only the referrer can change the confidentiality of a parcours: 'Alleen de referent kan de vertrouwelijkheid wijzigen' + +# resource +You must associate at least one entity: Koppel een gebruiker, een derde of geef een vrije beschrijving op +You cannot associate a resource with the same person: U kunt de gebruiker zelf niet als hulpbron toevoegen. + +#location +The period must remain located: 'Een traject moet worden gelokaliseerd' +The person where the course is located must be associated to the course. Change course's location before removing the person.: "Het traject is gelokaliseerd bij deze gebruiker. Wijzig de lokalisatie van het traject voordat u de gebruiker verwijdert" + +#relationship +relationship: + duplicate: Er bestaat al een verwantschapsrelatie tussen deze 2 gebruikers + +person_creation: + If you want to create an household, an address is required: Voor het aanmaken van een huishouden is een adres vereist + +accompanying_course_work: + The endDate should be greater or equal than the start date: De einddatum moet gelijk zijn aan of later dan de begindatum diff --git a/src/Bundle/ChillReportBundle/translations/messages.intl-icu.nl.yaml b/src/Bundle/ChillReportBundle/translations/messages.intl-icu.nl.yaml new file mode 100644 index 000000000..3d7b67836 --- /dev/null +++ b/src/Bundle/ChillReportBundle/translations/messages.intl-icu.nl.yaml @@ -0,0 +1,7 @@ +total reports matching the search: >- + { total, plural, + =0 {Geen enkel rapport voldoet aan de zoekterm(en)} + one {Één rapport voldoet aan de zoekterm(en)} + many {# rapporten voldoen aan de zoekterm(en)} + other {# rapporten voldoen aan de zoekterm(en)} + } diff --git a/src/Bundle/ChillReportBundle/translations/messages.nl.yml b/src/Bundle/ChillReportBundle/translations/messages.nl.yml index 54bd178ff..77acf83ec 100644 --- a/src/Bundle/ChillReportBundle/translations/messages.nl.yml +++ b/src/Bundle/ChillReportBundle/translations/messages.nl.yml @@ -1,31 +1,55 @@ -'Report edit': Dossier uitgave -'Save report': Bewaar consultatiegegevens -'Reset report': Verwijder consultatiegegevens -'Add a report': Voeg een consultatierapport toe -'Add report': 'Voeg rapport toe' -'Create a new report': 'Maak een nieuw consultatieblad aan' -'Report view': "Details van de consultatiegegevens" -'Update the report': 'Vul dossier aan' -'Report list': 'Overzicht van de consultaties' +'Report edit': "Rapport bewerken" +'Save report': "Rapport opslaan" +'Reset report': "Resetten" +'Add a report': "Rapport toevoegen" +'Add report': 'Rapport toevoegen' +'Create a new report': 'Nieuw rapport aanmaken' +'Report view': "Details van een rapport" +'Update the report': 'Rapport bewerken' +'Report list': 'Lijst van rapporten' Details: Details -Person: Person -Scope: Scope +Person: Gebruiker +Scope: Dienst Date: Datum User: Gebruiker -'Report type': 'Soort of verslag' -'View the report': "Bekijk de consultatiegegevens" +'Report type': 'Type rapport' +'View the report': "Rapport bekijken" +Report data: Rapportgegevens +'Report view : %name%': 'Rapport: %name%' +Report: Rapport +No report registered for this person.: Geen rapport voor deze gebruiker. #Flash messages -'Success : report created!': "De consultatiegegevens zijn correct ingevuld!" -'The form is not valid. The report has not been created !': "De gegevens zijn niet correct, er wordt geen rapport gemaakt" -'Success : report updated!': "Update is gelukt" -'The form is not valid. The report has not been updated !': "Update is mislukt, probeer opnieuw." +'Success : report created!': "Succes: het rapport is aangemaakt!" +'The form is not valid. The report has not been created !': "Het formulier bevat fouten, het rapport is niet aangemaakt" +'Success : report updated!': "Succes: het rapport is bijgewerkt!" +'The form is not valid. The report has not been updated !': "Het formulier bevat fouten, het rapport is niet bijgewerkt" #Exception messags -'Unable to find this report.': Dossier is onvindbaar -'This is not the report of the person.': "Dit is niet het dossier van deze person" +'Unable to find this report.': Rapport niet gevonden. +'This is not the report of the person.': "De persoon en het geselecteerde rapport zijn niet gekoppeld" -'You are going to leave a page with unsubmitted data. Are you sure you want to leave ?': 'U bent aan te vertrekken een pagina die veranderdt datas behoudt. Bent u er zeker van dat u wil vertrekken ?' + +#search +'You may not set a date argument and a date in default': U hebt twee datums ingevoerd, één met het datumargument en de andere in de standaard zoekzone. Geef één van beide op +'You must provide either a date:YYYY-mm-dd argument or a YYYY-mm-dd default search': Geef ofwel een argument date:YYYY-mm-dd op, ofwel een datum in de standaardzoekopdracht. +'Reports search results': Zoeken in de rapporten #timeline -'%user% has filled a %report_label% report on %date%': "%user% heeft een rapport '%report_label%' toegevoegd om %date%" +'%user% has filled a %report_label% report': "%user% heeft een rapport '%report_label%' toegevoegd" + +#roles +CHILL_REPORT_UPDATE: Rapporten bewerken +CHILL_REPORT_SEE: Rapporten bekijken +CHILL_REPORT_CREATE: Rapporten aanmaken +CHILL_REPORT_LISTS: Lijst van rapporten + + +#exports +"List for report '%type%'": Lijst van rapporten "%type%" +"Generate list of report '%type%'": Genereert een lijst van rapporten "%type%" +"Report's question": Vraag van het rapport +Filter by report's date: Filteren op rapportdatum +Report is after this date: Rapporten na deze datum +Report is before this date: Rapporten vóór deze datum +"Filtered by report's date: between %date_from% and %date_to%": "Gefilterd op rapportdatum: tussen %date_from% en %date_to%" diff --git a/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php b/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php index 7e572e078..1883263a1 100644 --- a/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php +++ b/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php @@ -27,7 +27,11 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class SingleTaskType extends AbstractType { - public function __construct(private readonly ParameterBagInterface $parameterBag, private readonly CenterResolverDispatcherInterface $centerResolverDispatcher, private readonly ScopeResolverDispatcher $scopeResolverDispatcher) {} + public function __construct( + private readonly ParameterBagInterface $parameterBag, + private readonly CenterResolverDispatcherInterface $centerResolverDispatcher, + private readonly ScopeResolverDispatcher $scopeResolverDispatcher, + ) {} public function buildForm(FormBuilderInterface $builder, array $options) { @@ -64,8 +68,8 @@ class SingleTaskType extends AbstractType if ($isScopeConcerned && $this->parameterBag->get('chill_main')['acl']['form_show_scopes']) { $builder ->add('circle', ScopePickerType::class, [ - 'center' => $center, 'role' => $options['role'], + 'subject' => $task, 'required' => true, ]); } diff --git a/src/Bundle/ChillTaskBundle/Resources/views/SingleTask/Person/list.html.twig b/src/Bundle/ChillTaskBundle/Resources/views/SingleTask/Person/list.html.twig index ffdd17a39..a4d5d81c9 100644 --- a/src/Bundle/ChillTaskBundle/Resources/views/SingleTask/Person/list.html.twig +++ b/src/Bundle/ChillTaskBundle/Resources/views/SingleTask/Person/list.html.twig @@ -5,7 +5,7 @@ {% block title 'Tasks for {{ name }}'|trans({ '{{ name }}' : person|chill_entity_render_string }) %} {% block content %} - <div class="col-md-10 col-xxl"> + <div class="task-list""> <h1>{{ block('title') }}</h1> diff --git a/src/Bundle/ChillTaskBundle/Resources/views/SingleTask/index.html.twig b/src/Bundle/ChillTaskBundle/Resources/views/SingleTask/index.html.twig index 02ab79664..658d9cba1 100644 --- a/src/Bundle/ChillTaskBundle/Resources/views/SingleTask/index.html.twig +++ b/src/Bundle/ChillTaskBundle/Resources/views/SingleTask/index.html.twig @@ -37,7 +37,7 @@ {% endblock %} {% else %} {% block content %} - <div class="col-md-10 col-xxl tasks"> + <div class="col-md-9 col-xxl tasks"> {% include '@ChillTask/SingleTask/AccompanyingCourse/list.html.twig' %} </div> diff --git a/src/Bundle/ChillTaskBundle/translations/messages+intl-icu.nl.yml b/src/Bundle/ChillTaskBundle/translations/messages+intl-icu.nl.yml new file mode 100644 index 000000000..80fd7e219 --- /dev/null +++ b/src/Bundle/ChillTaskBundle/translations/messages+intl-icu.nl.yml @@ -0,0 +1,14 @@ +#widget +nb tasks over deadline: >- + {nb, plural, + =0 {Geen taak met overschreden deadline} + one {Eén taak met overschreden deadline} + other {# taken met overschreden deadline} + } + +nb tasks near deadline: >- + {nb, plural, + =0 {Geen taak in herinnering} + one {Eén taak in herinnering} + other {# taken in herinnering} + } diff --git a/src/Bundle/ChillTaskBundle/translations/messages.nl.yml b/src/Bundle/ChillTaskBundle/translations/messages.nl.yml new file mode 100644 index 000000000..d90de6f1d --- /dev/null +++ b/src/Bundle/ChillTaskBundle/translations/messages.nl.yml @@ -0,0 +1,117 @@ +Tasks: "Taken" +"New task": "Nieuwe taak" +"Add a new task": "Nieuwe taak toevoegen" +Title: Titel +Description: Beschrijving +Assignee: "Toegewezen persoon" +Scope: Dienst +"Start date": "Startdatum" +"End date": "Einddatum" +"Warning date": "Waarschuwingsdatum" +"Warning interval": "Waarschuwingstermijn vóór de einddatum" +"Unknown dates": "Data niet gespecificeerd" +"N": "" +"Unit": "" +Task: Taak +Details: Details +Person: Gebruiker +Date: Datum +Dates: Data +User: Gebruiker +"Task list": "Takenlijst" +"Tasks with expired deadline": "Taken met een overschreden einddatum" +"Tasks with warning deadline reached": "Taken met een bereikte waarschuwingsdatum" +"Current tasks": "Lopende taken" +"Closed tasks": Afgesloten taken +"Tasks not started": "Niet-begonnen taken" +"Task start date": "Startdatum" +"Task warning date": "Waarschuwingsdatum" +"Task end date": "Einddatum" +"Start": "Start" +"Warning": "Waarschuwing" +"End": "Einddatum" +"Task type": "Type" +"Task status": "Status" +"Edit the task": "Taak bewerken" +"Edit task": "Taak bewerken" +"Save task": "Taak opslaan" +"View the task": "Taak bekijken" +"Update the task": "Taak bijwerken" +"Remove task": "Taak verwijderen" +"Delete": "Verwijderen" +"Change task status": "Status wijzigen" +'Are you sure you want to remove the task about "%name%" ?': 'Weet u zeker dat u de taak van "%name%" wilt verwijderen?' +'Are you sure you want to remove the task "%title%" ?': 'Weet u zeker dat u de taak "%title%" wilt verwijderen?' +"See more": "Meer zien" +"Associated tasks": "Gekoppelde taken" +"My tasks": "Mijn taken" +"Tasks for this accompanying period": "Taken voor dit begeleidingstraject" +"Tasks for {{ name }}": "Taken voor {{ name }}" +"No description": "Geen beschrijving" +"No dates specified": "Data niet gespecificeerd" +"No one assignee": "Geen toegewezen gebruiker" +"Task types": Taaktypes +Days: Dag(en) +Weeks: Week/Weken +Months: Maand(en) +Year: Jaar/Jaren +Filter the tasks: Taken filteren +Filter: Filteren +Any user: Alle gebruikers +Unassigned: Niet toegewezen +Associated person: Gekoppelde gebruiker +Default task: Standaardtaak +Not assigned: Geen toegewezen gebruiker +For person: Voor +By: Door +Any tasks: Geen taak +Filter by user: Filteren op gebruiker(s) + +# transitions - default task definition +"new": "nieuw" +"in_progress": "bezig" +"closed": "gesloten" +"canceled": "verwijderd" +start: starten +close: afsluiten +cancel: annuleren +Start_verb: Starten +Close_verb: Afsluiten +Set this task to cancel state: Deze taak markeren als geannuleerd +"%user% has closed the task": "%user% heeft de taak gesloten" +"%user% has canceled the task": "%user% heeft de taak geannuleerd" +"%user% has started the task": "%user% heeft de taak gestart" +"%user% has created the task": "%user% heeft de taak ingevoerd" +Are you sure you want to close this task ?: Weet u zeker dat u deze taak wilt afsluiten? +Are you sure you want to cancel this task ?: Weet u zeker dat u deze taak wilt annuleren? +Are you sure you want to start this task ?: Weet u zeker dat u deze taak wilt starten? + +#Flash messages +"The task is created": "De taak is aangemaakt" +"There is no tasks.": Geen taak. +"The task has been successfully removed.": "De taak is succesvol verwijderd" +"This form contains errors": "Dit formulier bevat fouten" +"The task has been updated": "De taak is bijgewerkt" +"The transition is successfully applied": "De transitie is succesvol toegepast" +"The transition could not be applied": "De transitie kon niet worden toegepast" + +Tasks near deadline: Taken met naderende einddatum +Tasks over deadline: Taken met overschreden einddatum +Tasks without alert: Taken met toekomstige of zonder einddatum + +#title +My tasks near deadline: Mijn taken met naderende einddatum +My tasks over deadline: Mijn taken met overschreden einddatum + +#transition page +Apply transition on task <em>%title%</em>: Transitie toepassen op taak <em>%title%</em> + +All centers: Alle territoria + +# ROLES +CHILL_TASK_TASK_CREATE: Taak toevoegen +CHILL_TASK_TASK_DELETE: Taak verwijderen +CHILL_TASK_TASK_SHOW: Taak bekijken +CHILL_TASK_TASK_UPDATE: Taak bewerken +CHILL_TASK_TASK_CREATE_FOR_COURSE: Taak aanmaken voor een traject +CHILL_TASK_TASK_CREATE_FOR_PERSON: Taak aanmaken voor een gebruiker diff --git a/src/Bundle/ChillTaskBundle/translations/validators.nl.yml b/src/Bundle/ChillTaskBundle/translations/validators.nl.yml new file mode 100644 index 000000000..cb2ab7fe5 --- /dev/null +++ b/src/Bundle/ChillTaskBundle/translations/validators.nl.yml @@ -0,0 +1,4 @@ +The start date must be before the end date: De startdatum moet voor de einddatum liggen +This form contains errors: Het formulier bevat fouten +The start date must be before warning date: De startdatum moet voor de waarschuwingsdatum liggen +An end date is required if a warning interval is set: Een einddatum is vereist wanneer een herinneringsinterval is ingesteld diff --git a/src/Bundle/ChillThirdPartyBundle/translations/messages.nl.yml b/src/Bundle/ChillThirdPartyBundle/translations/messages.nl.yml new file mode 100644 index 000000000..213997522 --- /dev/null +++ b/src/Bundle/ChillThirdPartyBundle/translations/messages.nl.yml @@ -0,0 +1,169 @@ +Third party: Externe partner +Third parties: Externe partners +third parties: externe partners +firstname: Voornaam +name: Naam +telephone: Telefoon +telephone2: Ander telefoonnummer +adress: Adres +email: E-mail +comment: Opmerking +thirdparty.type: type +thirdparty.Type: Type +thirdparty.No_phonenumber: Geen telefoonnummer +thirdparty.No_email: Geen e-mail +thirdparty.No_comment: Geen opmerking + +thirdparty.NameCompany: Dienst/Afdeling +thirdparty.Acronym: Afkorting +thirdparty.Categories: Categorieën +thirdparty.no_categories: Geen categorie +thirdparty.Child: Contactpersoon +thirdparty.child: Contactpersoon +thirdparty.Children: Contactpersonen +thirdparty.children: Contactpersonen +thirdparty.Parent: Institutionele externe partner +thirdparty.Parents: Institutionele externe partners +thirdparty.Civility: Aanspreekvorm +thirdparty.choose civility: -- +thirdparty.Profession: Hoedanigheid +thirdparty.choose profession: -- +thirdparty.CreatedAt.short: 'Aangemaakt op ' +thirdparty.UpdatedAt.short: 'Gewijzigd op ' +thirdparty.UpdateBy.short: ' door ' +thirdparty.CreatedAt.long: Aanmaakdatum +thirdparty.UpdatedAt.long: Datum van de laatste wijziging +thirdparty.UpdateBy.long: Gebruiker die de laatste wijziging heeft uitgevoerd +thirdparty.A company: Een rechtspersoon +thirdparty.company: Rechtspersoon +thirdparty.A contact: Een natuurlijk persoon +thirdparty.contact: Natuurlijk persoon +thirdparty.Contact of: Contact van +thirdparty.a_company_explanation: >- + Rechtspersonen kunnen één of meerdere contacten hebben, intern aan de instelling. Het is ook mogelijk om + hen een afkorting en de naam van een dienst toe te kennen. +thirdparty.a_contact_explanation: >- + Natuurlijke personen hebben geen afkorting, dienst of onderliggende contacten. Het is mogelijk om hen + een aanspreekvorm en een beroep toe te kennen. +thirdparty.Which kind of third party ?: Welk type externe partner wilt u aanmaken? +thirdparty.Contact data are confidential: Contactgegevens zijn vertrouwelijk + +New third party: Nieuwe externe partner toevoegen +Show third party %name%: Externe partner "%name%" +Create third party: Externe partner aanmaken +Update third party %name%: Externe partner "%name%" bijwerken +List of third parties: Lijst van externe partners +Third party updated: De externe partner is bijgewerkt +Third party created: De externe partner is aangemaakt +thirdparty.Status: Status +Active, shown to users: Actief, zichtbaar voor gebruikers +Active: Actief +shown to users: zichtbaar voor gebruikers +Inactive, not shown to users: Inactief, onzichtbaar voor gebruikers +Inactive: Inactief +not shown to users: onzichtbaar voor gebruikers +Show thirdparty: Externe partner bekijken +Add a contact: Contact toevoegen +Remove a contact: Verwijderen +Contacts: Contacten +No contacts associated: Geen contact + +No nameCompany given: Geen bedrijfsnaam ingevuld +No acronym given: Geen afkorting ingevuld +No phone given: Geen telefoon ingevuld +No email given: Geen e-mailadres ingevuld + +The party is visible in those centers: De externe partner is zichtbaar in deze territoria +The party is not visible in any center: De externe partner is niet gekoppeld aan een territorium +No third parties: Geen externe partners +Any third party selected: Geen externe partner geselecteerd + +Thirdparty handling: Behandelende externe partner +Thirdparty workers: Tussenkomende externe partners +Third party category: Categorieën van externe partners + +Third party configuration: Beheer van externe partners + +# person resource +Select a thirdparty: "Kies een externe partner" +Contact person: "Contactpersoon" + +# Residential address +The address of a third party: Het adres van een externe partner +residential_address_third_party_explanation: Het adres zal worden gekoppeld aan dat van een externe partner. +Host third party: Het adres van een externe partner kiezen + +# ROLES +CHILL_3PARTY_3PARTY_CREATE: Externe partner toevoegen +CHILL_3PARTY_3PARTY_SHOW: Externe partner bekijken +CHILL_3PARTY_3PARTY_UPDATE: Externe partner bewerken + +# crud: +crud: + 3party_3party: + index: + add_new: Aanmaken + thirdparty_thirdparty-category: + index: + title: Lijst van categorieën van externe partners + add_new: Nieuwe toevoegen + title_new: Nieuwe categorie van externe partners + title_edit: Categorie van externe partners bewerken + +# docgen +docgen: + A context for person with a third party (for sending mail): Een context van een persoon met een externe partner (om bijvoorbeeld een brief naar deze externe partner te sturen) + Person with third party: Persoon met keuze van een externe partner + Ask for thirdParty: Vragen aan de gebruiker om een externe partner te specificeren + thirdParty label: Benaming van de externe partner + +# exports +export: + list: + acp: + isRequestorThirdParty: Is de aanvrager een externe partner? + requestorThirdPartyId: Identificatie van de externe partner + acprequestorThirdPaty: Naam van de aanvragende externe partner + acpw: + handlingThierParty: Behandelende externe partner + thirdParties: Tussenkomende externe partner + +# exports filters/aggregators +Filtered by person\'s who have a residential address located at a thirdparty of type %thirparty_type%: Alleen de gebruikers die een woonadres hebben bij een externe partner van categorie %thirdparty_type% +is thirdparty: De aanvrager is een externe partner + +Filter by person's who have a residential address located at a thirdparty of type: Gebruikers filteren die een woonadres hebben bij een externe partner +"Filtered by person's who have a residential address located at a thirdparty of type %thirdparty_type% and valid on %date_calc%": "Alleen de gebruikers die een woonadres hebben bij een externe partner van categorie %thirdparty_type% en geldig op datum %date_calc%" + +# admin +admin: + export_description: Lijst van externe partners (CSV-formaat) + +Profession: Beroep +Firstname: Voornaam +Name_company: Dienst/Afdeling +Address: Adres +Civility: Aanspreekvorm +Id: Identificatie +Contact id: Identificatie van het contact +Contact name: Naam van het contact +Contact firstname: Voornaam van het contact +Contact phone: Telefoon van het contact +Contact phone2: Andere telefoon van het contact +Telephone2: Andere telefoon +Contact email: E-mail van het contact +Contact address: Adres van het contact +Contact profession: Beroep van het contact + +thirdparty_duplicate: + title: Dubbele externe partners samenvoegen + find: Een dubbele externe partner aanwijzen + Thirdparty to keep: Te behouden externe partner + Thirdparty to delete: Te verwijderen externe partner + Thirdparty to delete explanation: Deze externe partner zal worden verwijderd. Alleen de contacten van deze externe partner, hieronder opgesomd, zullen worden overgedragen. + Thirdparty to keep explanation: Deze externe partner zal worden behouden + Data to keep: Bewaarde gegevens + You cannot merge a thirdparty with itself. Please choose a different thirdparty: U kunt een externe partner niet met zichzelf samenvoegen. Kies een andere externe partner. + A thirdparty can only be merged with a thirdparty of the same kind: Een externe partner kan alleen worden samengevoegd met een externe partner van hetzelfde type. + Two child thirdparties must have the same parent: Twee externe partners van het type "contact" moeten gelinked zijn aan dezelfde hiërarchische "ouder". + Merge successful: Het samenvoegen is succesvol uitgevoerd diff --git a/src/Bundle/ChillThirdPartyBundle/translations/validators.nl.yml b/src/Bundle/ChillThirdPartyBundle/translations/validators.nl.yml new file mode 100644 index 000000000..1dc2fd7da --- /dev/null +++ b/src/Bundle/ChillThirdPartyBundle/translations/validators.nl.yml @@ -0,0 +1,2 @@ +thirdParty: + thirdParty_has_no_email: De externe partner {{ thirdParty }} heeft geen e-mail adres. diff --git a/src/Bundle/ChillWopiBundle/src/translations/messages.nl.yml b/src/Bundle/ChillWopiBundle/src/translations/messages.nl.yml new file mode 100644 index 000000000..410e80dc5 --- /dev/null +++ b/src/Bundle/ChillWopiBundle/src/translations/messages.nl.yml @@ -0,0 +1,2 @@ +wopi_editor: + document unsupported for edition: Dit formaat van document is niet bewerkbaar. diff --git a/symfony.lock b/symfony.lock index 6409f0c1d..5724d23b9 100644 --- a/symfony.lock +++ b/symfony.lock @@ -2,6 +2,9 @@ "champs-libres/wopi-bundle": { "version": "dev-master" }, + "chill-project/chill-zimbra-bundle": { + "version": "dev-472-zimbra-connector" + }, "doctrine/annotations": { "version": "1.14", "recipe": { @@ -260,6 +263,15 @@ "src/Kernel.php" ] }, + "symfony/loco-translation-provider": { + "version": "6.0", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "5.3", + "ref": "500b568fcdf2de12ac18e157e11820114db89986" + } + }, "symfony/mailer": { "version": "5.4", "recipe": {