Merge remote-tracking branch 'origin/master' into issue442_toggle_emergency

This commit is contained in:
Julien Fastré 2022-03-01 14:52:56 +01:00
commit 8b8f6027cc
233 changed files with 4800 additions and 1961 deletions

View File

@ -12,9 +12,46 @@ and this project adheres to
<!-- write down unreleased development here -->
* [parcours] Toggle emergency/intensity only by referrer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/442)
* [docstore] Add an API entrypoint for StoredObject (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/466)
* [person] Add the possibility of uploading existing documents to AccPeriodWorkEvaluationDocument (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/466)
* [person] Add title to AccPeriodWorkEvaluationDocument (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/466)
* [person] Order social issues by the field "ordering" (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/388)
* [Person/Household list] when listing other simultaneous members of an household, exclude the members on person, not on members (avoid to show two membersship with the same person)
* [Person] Display suffixText in RenderPerson, PersonText.vue, RenderPersonBox.vue (was made for displaying "enfant confie") (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/441)
## Test releases
### test release 2022-02-21
* [notifications] Word 'un' changed to number '1' for notifications in user menu (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/483)
* [documents] 'gabarit' changed to 'modèle' (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/405)
* [person_resources] Menu name and order changed (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/460)
* workflow: fix sending notifications
* [thirdparty] Extend the thirdparty search to thirdparty children (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/448)
* [person]: AddPersons: allow creation of person or thirdparty only (no users) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/422)
* [person]: AddPersons: allow creation of person or thirdparty depending on allowed types (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/422)
* [person]: AddPersons: add suggestion of name when creating new person or thirdparty (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/422)
* [main] Address: fix small bug: when modifying an address without street (isNoAddress), also check errors if street is an empty string as back-end change null value to empty string for street (and streetNumber)
* [main] Address: stronger client-side validation of addresses (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/449)
* [thirdparty] Add a contact to a thirdparty from within onTheFly (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/345)
* [person] accompanying course: filter suggested entities by open participations (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/415)
[activity] can click through the cross icon for removing person in concerned group (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/476)
[activity] correct associated persons by considering only open participations (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/476)
* [person_resources]: Renderboxes used to display person/thirdparty info (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/465)
* [Household]: Add end date in HouseholdMember form for 'enfant hors menage' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/434)
* [homepage_widget]: If no sender then display as 'notification automatique' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/435)
* [parcours]: Order social activities and only display most recent three in parcours resumé (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/481)
* [3party]: 3party: redirect to parent when contact (child) is opened in view page
* [parcours / addresses]: launch an event when a person change address (either through changing household or because the household is associated to a new address). If the person is localising a course, the course location go back to a temporarily address.
* [thirdparty]: address/phonenumber/email/fonction displayed in thirdpartyrenderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/401)
* [thirdparty_contact]: in search results the 'qualité' is displayed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/465)
* [bug]: fix confidential toggle of address in thirdpartyrenderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/460)
## Test releases
* Creation of PickCivilityType, and implementation in PersonType and ThirdpartyType
* [renderbox]: Fix display of address (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/462)
* [renderbox]: Add email in personRenderBox, this was not yet displayed.
### test release 2022-02-14
* AddPersons: remove ul-li html tags from AddPersons (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/419)
@ -23,7 +60,7 @@ and this project adheres to
* [person] accompanying course work: fix on-the-fly update of thirdParty
* fix normalisation of accompanying course requestor api (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/378)
* [person] add a returnPath when clicking on some Person or ThirdParty badge (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/427)
* [person] accompanying course work: fix on-the-fly update of thirdParty
* [person] accompanying course work: fix on-the-fly update of thirdParty
* [on-the-fly] close modal only after validation
* [person] correct thirdparty PATCH url + add email and altnames in AddPerson and serializer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/433)
* change order for accompanying course work list
@ -40,7 +77,7 @@ and this project adheres to
* [address]: Correction residential address 'depuis le' (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/459)
* [Documents]: List view adapted to display more information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/414)
* [Thirdparty_contact]: address blurred if confidential in view page (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/450)
* [homepage_widget]: If no sender then display as 'notification automatique' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/435)
### test release 2021-02-01
@ -61,7 +98,19 @@ and this project adheres to
* [AddAddress] disable multiselect search, and rely only on most pertinent Cities and Street computed backend
* [fast_actions] improve fast-actions buttons override mechanism, fix https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/413
* [homepage widget] add vue homepage_widget with asynchone loading, give a global view resume of the user concerned actions, notifications, etc.
* [thirdparty] Add a contact to a thirdparty from within onTheFly (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/345)
## Test releases
=======
* [homepage widget] add vue homepage_widget with asynchone loading, give a global view resume of the user concerned actions, notifications, etc.
>>>>>>> issue422_and_others_on_AddPersons
=======
* [homepage widget] add vue homepage_widget with asynchone loading, give a global view resume of the user concerned actions, notifications, etc.
* [thirdparty] Add a contact to a thirdparty from within onTheFly (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/345)
>>>>>>> b0d50d315c8e00959a967badac9cf5057ab2b4bc
### test release 2021-01-31
* [person] accompanying course: optimisation: do not fetch some resources for the banner (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/409)

View File

@ -25,11 +25,6 @@ parameters:
count: 1
path: src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php
-
message: "#^Access to an undefined property Chill\\\\PersonBundle\\\\Household\\\\MembersEditorFactory\\:\\:\\$validator\\.$#"
count: 2
path: src/Bundle/ChillPersonBundle/Household/MembersEditorFactory.php
-
message: "#^Variable variables are not allowed\\.$#"
count: 4

View File

@ -105,15 +105,6 @@ parameters:
count: 1
path: src/Bundle/ChillActivityBundle/Export/Export/ListActivity.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\ActivityBundle\\\\Export\\\\Export\\\\ListActivity\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillActivityBundle/Export/Export/ListActivity.php
-
message:
"""
@ -141,15 +132,6 @@ parameters:
count: 1
path: src/Bundle/ChillActivityBundle/Export/Export/StatActivityDuration.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\ActivityBundle\\\\Export\\\\Filter\\\\ActivityDateFilter\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php
-
message:
"""
@ -195,15 +177,6 @@ parameters:
count: 1
path: src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\ActivityBundle\\\\Export\\\\Filter\\\\PersonHavingActivityBetweenDateFilter\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillActivityBundle/Export/Filter/PersonHavingActivityBetweenDateFilter.php
-
message:
"""
@ -213,15 +186,6 @@ parameters:
count: 1
path: src/Bundle/ChillActivityBundle/Export/Filter/PersonHavingActivityBetweenDateFilter.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\ActivityBundle\\\\Menu\\\\PersonMenuBuilder\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php
-
message:
"""
@ -258,15 +222,6 @@ parameters:
count: 1
path: src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\AsideActivityBundle\\\\Menu\\\\UserMenuBuilder\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillAsideActivityBundle/src/Menu/UserMenuBuilder.php
-
message:
"""
@ -276,15 +231,6 @@ parameters:
count: 1
path: src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\AMLI\\\\BudgetBundle\\\\Controller\\\\AbstractElementController\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php
-
message:
"""
@ -294,24 +240,6 @@ parameters:
count: 1
path: src/Bundle/ChillBudgetBundle/Controller/ElementController.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\AMLI\\\\BudgetBundle\\\\Controller\\\\ElementController\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillBudgetBundle/Controller/ElementController.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\AMLI\\\\BudgetBundle\\\\Menu\\\\UserMenuBuilder\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillBudgetBundle/Menu/UserMenuBuilder.php
-
message:
"""
@ -321,15 +249,6 @@ parameters:
count: 1
path: src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\CalendarBundle\\\\Menu\\\\UserMenuBuilder\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillCalendarBundle/Menu/UserMenuBuilder.php
-
message:
"""
@ -399,15 +318,6 @@ parameters:
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\CustomFieldsBundle\\\\Form\\\\CustomFieldsGroupType\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldsGroupType.php
-
message:
"""
@ -417,15 +327,6 @@ parameters:
count: 6
path: src/Bundle/ChillEventBundle/Controller/EventController.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\EventBundle\\\\Controller\\\\EventController\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillEventBundle/Controller/EventController.php
-
message:
"""
@ -444,42 +345,6 @@ parameters:
count: 1
path: src/Bundle/ChillEventBundle/Form/Type/PickEventType.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\EventBundle\\\\Form\\\\Type\\\\PickEventType\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillEventBundle/Form/Type/PickEventType.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\EventBundle\\\\Form\\\\Type\\\\PickRoleType\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillEventBundle/Form/Type/PickRoleType.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\EventBundle\\\\Form\\\\Type\\\\PickStatusType\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillEventBundle/Form/Type/PickStatusType.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\EventBundle\\\\Menu\\\\PersonMenuBuilder\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillEventBundle/Menu/PersonMenuBuilder.php
-
message:
"""
@ -489,24 +354,6 @@ parameters:
count: 1
path: src/Bundle/ChillEventBundle/Search/EventSearch.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\AMLI\\\\FamilyMembersBundle\\\\Controller\\\\FamilyMemberController\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillFamilyMembersBundle/Controller/FamilyMemberController.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\AMLI\\\\FamilyMembersBundle\\\\Menu\\\\UserMenuBuilder\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillFamilyMembersBundle/Menu/UserMenuBuilder.php
-
message:
"""
@ -516,24 +363,6 @@ parameters:
count: 1
path: src/Bundle/ChillFamilyMembersBundle/Security/Voter/FamilyMemberVoter.php
-
message:
"""
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php
-
message:
"""
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php
-
message:
"""
@ -543,15 +372,6 @@ parameters:
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php
-
message:
"""
#^Return type of method Chill\\\\MainBundle\\\\CRUD\\\\Controller\\\\CRUDController\\:\\:getTranslator\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php
-
message:
"""
@ -570,24 +390,6 @@ parameters:
count: 1
path: src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\MainBundle\\\\Controller\\\\ExportController\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Controller/ExportController.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\MainBundle\\\\Controller\\\\PasswordController\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Controller/PasswordController.php
-
message:
"""
@ -660,42 +462,6 @@ parameters:
count: 1
path: src/Bundle/ChillMainBundle/Export/ExportManager.php
-
message:
"""
#^Parameter \\$translatorInterface of method Chill\\\\MainBundle\\\\Export\\\\Formatter\\\\CSVListFormatter\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php
-
message:
"""
#^Parameter \\$translatorInterface of method Chill\\\\MainBundle\\\\Export\\\\Formatter\\\\CSVPivotedListFormatter\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php
-
message:
"""
#^Parameter \\$translatorInterface of method Chill\\\\MainBundle\\\\Export\\\\Formatter\\\\SpreadSheetFormatter\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php
-
message:
"""
#^Parameter \\$translatorInterface of method Chill\\\\MainBundle\\\\Export\\\\Formatter\\\\SpreadsheetListFormatter\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php
-
message:
"""
@ -714,15 +480,6 @@ parameters:
count: 1
path: src/Bundle/ChillMainBundle/Form/Event/CustomizeFormEvent.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\MainBundle\\\\Form\\\\Type\\\\PostalCodeType\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Form/Type/PostalCodeType.php
-
message:
"""
@ -746,38 +503,11 @@ parameters:
count: 1
path: src/Bundle/ChillMainBundle/Form/UserType.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\MainBundle\\\\Notification\\\\Mailer\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Notification/Mailer.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Repository/NotificationRepository.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\MainBundle\\\\Routing\\\\MenuBuilder\\\\SectionMenuBuilder\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Routing/MenuBuilder/SectionMenuBuilder.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\MainBundle\\\\Routing\\\\MenuComposer\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Routing/MenuComposer.php
-
message:
"""
@ -864,15 +594,6 @@ parameters:
count: 1
path: src/Bundle/ChillMainBundle/Templating/Events/DelegatedBlockRenderingEvent.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\MainBundle\\\\Validation\\\\Validator\\\\RoleScopeScopePresence\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php
-
message:
"""
@ -918,33 +639,6 @@ parameters:
count: 1
path: src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\PersonBundle\\\\Controller\\\\HouseholdController\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Controller/HouseholdController.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\PersonBundle\\\\Controller\\\\HouseholdMemberController\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\PersonBundle\\\\Controller\\\\PersonController\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Controller/PersonController.php
-
message:
"""
@ -954,15 +648,6 @@ parameters:
count: 1
path: src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\PersonBundle\\\\Controller\\\\PersonDuplicateController\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php
-
message: "#^Access to deprecated property \\$proxyAccompanyingPeriodOpenState of class Chill\\\\PersonBundle\\\\Entity\\\\Person\\.$#"
count: 2
@ -977,15 +662,6 @@ parameters:
count: 1
path: src/Bundle/ChillPersonBundle/Export/Aggregator/AgeAggregator.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\PersonBundle\\\\Export\\\\Aggregator\\\\CountryOfBirthAggregator\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Export/Aggregator/CountryOfBirthAggregator.php
-
message:
"""
@ -995,15 +671,6 @@ parameters:
count: 1
path: src/Bundle/ChillPersonBundle/Export/Aggregator/CountryOfBirthAggregator.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\PersonBundle\\\\Export\\\\Aggregator\\\\GenderAggregator\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Export/Aggregator/GenderAggregator.php
-
message:
"""
@ -1013,15 +680,6 @@ parameters:
count: 1
path: src/Bundle/ChillPersonBundle/Export/Aggregator/GenderAggregator.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\PersonBundle\\\\Export\\\\Aggregator\\\\NationalityAggregator\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Export/Aggregator/NationalityAggregator.php
-
message:
"""
@ -1058,15 +716,6 @@ parameters:
count: 1
path: src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\PersonBundle\\\\Export\\\\Export\\\\ListPerson\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php
-
message:
"""
@ -1094,15 +743,6 @@ parameters:
count: 1
path: src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\PersonBundle\\\\Export\\\\Export\\\\ListPersonDuplicate\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php
-
message:
"""
@ -1148,15 +788,6 @@ parameters:
count: 1
path: src/Bundle/ChillPersonBundle/Export/Filter/BirthdateFilter.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\GenderFilter\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Export/Filter/GenderFilter.php
-
message:
"""
@ -1198,24 +829,6 @@ parameters:
count: 1
path: src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\PersonBundle\\\\Form\\\\Type\\\\PickPersonType\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\PersonBundle\\\\Menu\\\\SectionMenuBuilder\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillPersonBundle/Menu/SectionMenuBuilder.php
-
message:
"""
@ -1279,15 +892,6 @@ parameters:
count: 1
path: src/Bundle/ChillReportBundle/Export/Export/ReportList.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\ReportBundle\\\\Export\\\\Export\\\\ReportList\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillReportBundle/Export/Export/ReportList.php
-
message:
"""
@ -1297,15 +901,6 @@ parameters:
count: 1
path: src/Bundle/ChillReportBundle/Export/Export/ReportList.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\ReportBundle\\\\Export\\\\Export\\\\ReportListProvider\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillReportBundle/Export/Export/ReportListProvider.php
-
message:
"""
@ -1387,15 +982,6 @@ parameters:
count: 1
path: src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\TaskBundle\\\\Controller\\\\TaskController\\:\\:applyTransitionAction\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillTaskBundle/Controller/TaskController.php
-
message:
"""
@ -1441,33 +1027,6 @@ parameters:
count: 1
path: src/Bundle/ChillTaskBundle/Form/SingleTaskType.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\TaskBundle\\\\Menu\\\\MenuBuilder\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillTaskBundle/Menu/MenuBuilder.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\TaskBundle\\\\Menu\\\\SectionMenuBuilder\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillTaskBundle/Menu/SectionMenuBuilder.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\TaskBundle\\\\Menu\\\\UserMenuBuilder\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillTaskBundle/Menu/UserMenuBuilder.php
-
message:
"""
@ -1504,33 +1063,6 @@ parameters:
count: 3
path: src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\ThirdPartyBundle\\\\Controller\\\\ThirdPartyController\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\ThirdPartyBundle\\\\Form\\\\Type\\\\PickThirdPartyType\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyType.php
-
message:
"""
#^Parameter \\$translator of method Chill\\\\ThirdPartyBundle\\\\Menu\\\\MenuBuilder\\:\\:__construct\\(\\) has typehint with deprecated interface Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\:
since Symfony 4\\.2, use Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface instead$#
"""
count: 1
path: src/Bundle/ChillThirdPartyBundle/Menu/MenuBuilder.php
-
message:
"""

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="v4.15.0@a1b5e489e6fcebe40cb804793d964e99fc347820">
<files psalm-version="4.18.0.0">
<file src="src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php">
<UndefinedClass occurrences="4">
<code>'ChillActivityBundle:ActivityReasonCategory'</code>
@ -47,6 +47,11 @@
<code>Activity[]|array</code>
</UndefinedDocblockClass>
</file>
<file src="src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/AppKernel.php">
<DuplicateClass occurrences="1">
<code>AppKernel</code>
</DuplicateClass>
</file>
<file src="src/Bundle/ChillActivityBundle/Resources/test/Fixtures/App/app/autoload.php">
<MissingFile occurrences="1">
<code>require __DIR__ . '/../../../../../vendor/autoload.php'</code>
@ -164,72 +169,18 @@
<code>type</code>
</UndefinedDocblockClass>
</file>
<file src="src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityReasonAggregatorTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityTypeAggregatorTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityUserAggregatorTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillActivityBundle/Tests/Export/Export/CountActivityTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillActivityBundle/Tests/Export/Export/ListActivityTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillActivityBundle/Tests/Export/Export/StatActivityDurationSumTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityReasonFilterTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
<UndefinedDocblockClass occurrences="1">
<code>\Chill\PersonBundle\Export\Filter\PersonHavingActivityBetweenDateFilter</code>
</UndefinedDocblockClass>
</file>
<file src="src/Bundle/ChillActivityBundle/Tests/Form/ActivityTypeTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
<TooFewArguments occurrences="2"/>
<UndefinedDocblockClass occurrences="1">
<code>Prophecy\Prophet</code>
</UndefinedDocblockClass>
</file>
<file src="src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityTypeTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
<UndefinedDocblockClass occurrences="1">
<code>type</code>
</UndefinedDocblockClass>
@ -254,11 +205,6 @@
<code>$asideActivityCategory</code>
</ParamNameMismatch>
</file>
<file src="src/Bundle/ChillAsideActivityBundle/src/Tests/Controller/AsideActivityControllerTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillBudgetBundle/Calculator/CalculatorManager.php">
<InvalidStaticInvocation occurrences="3">
<code>$calculator::getAlias()</code>
@ -288,11 +234,6 @@
<code>'ChillCalendarBundle:Calendar'</code>
</UndefinedClass>
</file>
<file src="src/Bundle/ChillCalendarBundle/Tests/Controller/CalendarControllerTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php">
<UndefinedClass occurrences="1">
<code>'ChillCustomFieldsBundle:CustomFieldsGroup'</code>
@ -397,10 +338,6 @@
</UndefinedDocblockClass>
</file>
<file src="src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsChoiceTest.php">
<MethodSignatureMismatch occurrences="2">
<code>public function setUp()</code>
<code>public function tearDown()</code>
</MethodSignatureMismatch>
<UndefinedDocblockClass occurrences="4">
<code>type</code>
<code>type</code>
@ -408,61 +345,6 @@
<code>type</code>
</UndefinedDocblockClass>
</file>
<file src="src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsNumberTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsTextTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillCustomFieldsBundle/Tests/Form/Extension/PostTextIntegerExtensionTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillCustomFieldsBundle/Tests/Form/Extension/PostTextNumberExtensionTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillCustomFieldsBundle/Tests/Service/CustomFieldsHelperTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillCustomFieldsBundle/Tests/Templating/Twig/CustomFieldRenderingTwigTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillCustomFieldsBundle/Tests/Templating/Twig/CustomFieldsGroupRenderingTwigTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Encoder/DocGenEncoderTest.php">
<MethodSignatureMismatch occurrences="1">
<code>protected function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Normalizer/DocGenObjectNormalizerTest.php">
<MethodSignatureMismatch occurrences="1">
<code>protected function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillDocGeneratorBundle/tests/Service/Context/BaseContextDataTest.php">
<MethodSignatureMismatch occurrences="1">
<code>protected function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseController.php">
<UndefinedClass occurrences="1">
<code>'ChillDocStoreBundle:AccompanyingCourseDocument'</code>
</UndefinedClass>
</file>
<file src="src/Bundle/ChillDocStoreBundle/Controller/DocumentCategoryController.php">
<UndefinedClass occurrences="3">
<code>'ChillDocStoreBundle:DocumentCategory'</code>
@ -470,11 +352,6 @@
<code>'ChillDocStoreBundle:DocumentCategory'</code>
</UndefinedClass>
</file>
<file src="src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php">
<UndefinedClass occurrences="1">
<code>'ChillDocStoreBundle:PersonDocument'</code>
</UndefinedClass>
</file>
<file src="src/Bundle/ChillDocStoreBundle/Entity/Document.php">
<UndefinedDocblockClass occurrences="1">
<code>\Chill\PersonBundle\Entity\user</code>
@ -570,9 +447,6 @@
<InvalidParamDefault occurrences="1">
<code>type</code>
</InvalidParamDefault>
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
<UndefinedClass occurrences="8">
<code>'ChillEventBundle:Event'</code>
<code>'ChillEventBundle:Event'</code>
@ -588,10 +462,6 @@
</UndefinedDocblockClass>
</file>
<file src="src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php">
<MethodSignatureMismatch occurrences="2">
<code>public function setUp()</code>
<code>public function tearDown()</code>
</MethodSignatureMismatch>
<UndefinedClass occurrences="1">
<code>'ChillMainBundle:Scope'</code>
</UndefinedClass>
@ -891,11 +761,6 @@
<code>OptionsResolverInterface</code>
</UndefinedDocblockClass>
</file>
<file src="src/Bundle/ChillMainBundle/Notification/Mailer.php">
<UndefinedDocblockClass occurrences="1">
<code>\Symfony\Component\Mailer\Exception\TransportExceptionInterface</code>
</UndefinedDocblockClass>
</file>
<file src="src/Bundle/ChillMainBundle/Pagination/PageGenerator.php">
<UndefinedVariable occurrences="1">
<code>$current</code>
@ -924,11 +789,6 @@
<code>$onlyEnabled</code>
</ParamNameMismatch>
</file>
<file src="src/Bundle/ChillMainBundle/Resources/test/Fixtures/App/app/AppKernel.php">
<DuplicateClass occurrences="1">
<code>AppKernel</code>
</DuplicateClass>
</file>
<file src="src/Bundle/ChillMainBundle/Resources/test/Fixtures/App/app/autoload.php">
<MissingFile occurrences="1">
<code>require __DIR__ . '/../../../../../vendor/autoload.php'</code>
@ -1056,158 +916,15 @@
</UndefinedClass>
</file>
<file src="src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
<UndefinedDocblockClass occurrences="1">
<code>type</code>
</UndefinedDocblockClass>
</file>
<file src="src/Bundle/ChillMainBundle/Tests/Authorization/ParentRoleHelperTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillMainBundle/Tests/Controller/AddressControllerTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillMainBundle/Tests/Controller/UserControllerTest.php">
<MethodSignatureMismatch occurrences="2">
<code>protected function tearDown()</code>
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php">
<MethodSignatureMismatch occurrences="2">
<code>public function setUp()</code>
<code>public function tearDown()</code>
</MethodSignatureMismatch>
<UndefinedDocblockClass occurrences="40">
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>Prophecy\Prophet</code>
</UndefinedDocblockClass>
</file>
<file src="src/Bundle/ChillMainBundle/Tests/Form/Type/PickCenterTypeTest.php">
<UndefinedClass occurrences="1">
<code>CenterType</code>
</UndefinedClass>
<UndefinedDocblockClass occurrences="1">
<code>CenterType</code>
</UndefinedDocblockClass>
</file>
<file src="src/Bundle/ChillMainBundle/Tests/Pagination/PageTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillMainBundle/Tests/Pagination/PaginatorTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillMainBundle/Tests/Routing/Loader/RouteLoaderTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillMainBundle/Tests/Search/AbstractSearchTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillMainBundle/Tests/Search/SearchProviderTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
<UndefinedDocblockClass occurrences="1">
<code>unknown</code>
</UndefinedDocblockClass>
</file>
<file src="src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillMainBundle/Tests/Security/Resolver/CenterResolverDispatcherTest.php">
<MethodSignatureMismatch occurrences="1">
<code>protected function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillMainBundle/Tests/Security/Resolver/DefaultScopeResolverTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillMainBundle/Tests/Security/Resolver/ScopeResolverDispatcherTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DateNormalizerTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DoctrineExistingEntityNormalizerTest.php">
<MethodSignatureMismatch occurrences="1">
<code>protected function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillMainBundle/Tests/Services/MenuComposerTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillMainBundle/Tests/Templating/Entity/AddressRenderTest.php">
<MethodSignatureMismatch occurrences="1">
<code>protected function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php">
<UndefinedDocblockClass occurrences="1">
<code>unknown</code>
@ -1412,20 +1129,6 @@
<code>OptionsResolverInterface</code>
</UndefinedDocblockClass>
</file>
<file src="src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php">
<UndefinedClass occurrences="6">
<code>$qb</code>
<code>$qb</code>
<code>$qb</code>
<code>QueryBuilder</code>
<code>SocialAction</code>
<code>SocialAction</code>
</UndefinedClass>
<UndefinedVariable occurrences="2">
<code>$action</code>
<code>$orderBy</code>
</UndefinedVariable>
</file>
<file src="src/Bundle/ChillPersonBundle/Resources/test/Fixtures/App/app/AppKernel.php">
<DuplicateClass occurrences="1">
<code>AppKernel</code>
@ -1505,33 +1208,13 @@
</ParamNameMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/AccompanyingPeriodConfidentialTest.php">
<MethodSignatureMismatch occurrences="2">
<code>public function setUp()</code>
<code>public static function setUpBeforeClass()</code>
</MethodSignatureMismatch>
<UndefinedClass occurrences="2">
<code>AccompanyingPeriodRepository</code>
<code>stdClass</code>
</UndefinedClass>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php">
<MethodSignatureMismatch occurrences="2">
<code>public function setUp()</code>
<code>public static function setUpBeforeClass()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseControllerTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php">
<InvalidThrow occurrences="1"/>
<MethodSignatureMismatch occurrences="3">
<code>public function setUp()</code>
<code>public function tearDown()</code>
<code>public static function setUpBeforeClass()</code>
</MethodSignatureMismatch>
<UndefinedClass occurrences="3">
<code>'ChillMainBundle:Center'</code>
<code>'ChillPersonBundle:AccompanyingPeriod\ClosingMotive'</code>
@ -1543,40 +1226,19 @@
</UndefinedDocblockClass>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php">
<MethodSignatureMismatch occurrences="1">
<code>protected function tearDown()</code>
</MethodSignatureMismatch>
<UndefinedClass occurrences="1">
<code>User</code>
</UndefinedClass>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdControllerTest.php">
<MethodSignatureMismatch occurrences="1">
<code>protected function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php">
<InvalidScope occurrences="1">
<code>$this</code>
</InvalidScope>
<MethodSignatureMismatch occurrences="2">
<code>public function setUp()</code>
<code>public static function setUpBeforeClass()</code>
</MethodSignatureMismatch>
<UndefinedClass occurrences="1">
<code>'ChillPersonBundle:Person'</code>
</UndefinedClass>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public static function tearDownAfterClass()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateTest.php">
<MethodSignatureMismatch occurrences="2">
<code>public function setUp()</code>
<code>public function tearDown()</code>
</MethodSignatureMismatch>
<UndefinedClass occurrences="2">
<code>'ChillMainBundle:Country'</code>
<code>'ChillPersonBundle:Person'</code>
@ -1586,140 +1248,25 @@
</UndefinedDocblockClass>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php">
<MethodSignatureMismatch occurrences="2">
<code>public function setUp()</code>
<code>public function tearDown()</code>
</MethodSignatureMismatch>
<UndefinedClass occurrences="2">
<code>'ChillMainBundle:Country'</code>
<code>'ChillPersonBundle:Person'</code>
</UndefinedClass>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewTest.php">
<MethodSignatureMismatch occurrences="2">
<code>public function setUp()</code>
<code>public function tearDown()</code>
</MethodSignatureMismatch>
<UndefinedClass occurrences="1">
<code>'ChillPersonBundle:Person'</code>
</UndefinedClass>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewWithHiddenFieldsTest.php">
<MethodSignatureMismatch occurrences="2">
<code>public function setUp()</code>
<code>public function tearDown()</code>
</MethodSignatureMismatch>
<UndefinedClass occurrences="1">
<code>'ChillPersonBundle:Person'</code>
</UndefinedClass>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Controller/PersonDuplicateControllerViewTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Controller/RelationshipApiControllerTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Controller/SocialIssueApiControllerTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Entity/AccompanyingPeriodTest.php">
<AssignmentToVoid occurrences="1">
<code>$participationL</code>
</AssignmentToVoid>
<NullReference occurrences="1">
<code>getEndDate</code>
</NullReference>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AgeAggregatorTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/GenderAggregatorTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/NationalityAggregatorTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Export/Export/CountPersonTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Export/Export/ListPersonTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingPeriodFilterTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Export/Filter/BirthdayFilterTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Export/Filter/GenderFilterTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Form/Type/PickPersonTypeTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Household/MembersEditorTest.php">
<MethodSignatureMismatch occurrences="1">
<code>protected function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Security/Authorization/PersonVoterTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodWorkDocGenNormalizerTest.php">
<MethodSignatureMismatch occurrences="1">
<code>protected function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/HouseholdNormalizerTest.php">
<MethodSignatureMismatch occurrences="1">
<code>protected function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php">
<MethodSignatureMismatch occurrences="1">
<code>protected function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonJsonNormalizerTest.php">
<MethodSignatureMismatch occurrences="1">
<code>protected function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Validator/Person/PersonValidationTest.php">
<MethodSignatureMismatch occurrences="1">
<code>protected function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Tests/Workflows/AccompanyingPeriodLifecycle.php">
<MethodSignatureMismatch occurrences="1">
<code>protected function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php">
<UndefinedClass occurrences="1">
@ -1820,20 +1367,13 @@
<code>require __DIR__ . '/../../../../../vendor/autoload.php'</code>
</MissingFile>
</file>
<file src="src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php">
<MethodSignatureMismatch occurrences="1">
<code>public function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php">
<InvalidParamDefault occurrences="1">
<code>type</code>
</InvalidParamDefault>
<MethodSignatureMismatch occurrences="2">
<code>public function setUp()</code>
<code>public static function setUpBeforeClass()</code>
</MethodSignatureMismatch>
<UndefinedDocblockClass occurrences="29">
<UndefinedDocblockClass occurrences="31">
<code>$client</code>
<code>$client</code>
<code>$client</code>
<code>$client</code>
<code>$client</code>
@ -1865,16 +1405,7 @@
<code>type</code>
</UndefinedDocblockClass>
</file>
<file src="src/Bundle/ChillReportBundle/Tests/DependencyInjection/ChillReportExtensionTest.php">
<UndefinedClass occurrences="1">
<code>Exception</code>
</UndefinedClass>
</file>
<file src="src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php">
<MethodSignatureMismatch occurrences="2">
<code>public function setUp()</code>
<code>public static function setUpBeforeClass()</code>
</MethodSignatureMismatch>
<UndefinedDocblockClass occurrences="3">
<code>type</code>
<code>type</code>
@ -1882,10 +1413,6 @@
</UndefinedDocblockClass>
</file>
<file src="src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php">
<MethodSignatureMismatch occurrences="2">
<code>public function setUp()</code>
<code>public function tearDown()</code>
</MethodSignatureMismatch>
<UndefinedClass occurrences="1">
<code>'ChillCustomFieldsBundle:CustomFieldsGroup'</code>
</UndefinedClass>
@ -1958,11 +1485,6 @@
<code>CacheItempPoolInterface</code>
</UndefinedDocblockClass>
</file>
<file src="src/Bundle/ChillTaskBundle/Tests/Controller/SingleTaskControllerTest.php">
<MethodSignatureMismatch occurrences="1">
<code>protected function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillThirdPartyBundle/DependencyInjection/CompilerPass/ThirdPartyTypeCompilerPass.php">
<UndefinedClass occurrences="1">
<code>$taggedService-&gt;getClass()::getKey()</code>
@ -1988,11 +1510,6 @@
<code>$thirdParty</code>
</ParamNameMismatch>
</file>
<file src="src/Bundle/ChillThirdPartyBundle/Tests/Serializer/Normalizer/ThirdPartyJsonDenormalizerTest.php">
<MethodSignatureMismatch occurrences="1">
<code>protected function setUp()</code>
</MethodSignatureMismatch>
</file>
<file src="src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php">
<UndefinedDocblockClass occurrences="6">
<code>$object</code>

View File

@ -357,7 +357,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
if (null !== $this->accompanyingPeriod) {
$personsAssociated = [];
foreach ($this->accompanyingPeriod->getParticipations() as $participation) {
foreach ($this->accompanyingPeriod->getOpenParticipations() as $participation) {
if ($this->persons->contains($participation->getPerson())) {
$personsAssociated[] = $participation->getPerson();
}

View File

@ -24,9 +24,9 @@ use Doctrine\ORM\Query;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use function array_key_exists;
use function count;

View File

@ -21,7 +21,7 @@ use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormError;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
class ActivityDateFilter implements FilterInterface
{

View File

@ -29,8 +29,8 @@ use Symfony\Component\Form\FormError;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use function count;

View File

@ -15,7 +15,7 @@ use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
class PersonMenuBuilder implements LocalMenuBuilderInterface
{

View File

@ -1,7 +1,7 @@
<template>
<li>
<span :title="person.text">
<span class="chill_denomination" @click.prevent="$emit('remove', person)">
<span :title="person.text" @click.prevent="$emit('remove', person)">
<span class="chill_denomination">
<person-text :person="person" :isCut="true"></person-text>
</span>
</span>

View File

@ -22,7 +22,7 @@ use Chill\DocStoreBundle\Repository\DocumentCategoryRepository;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Templating\Entity\PersonRender;
use Chill\PersonBundle\Templating\Entity\PersonRenderInterface;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
@ -43,7 +43,7 @@ class ActivityContext implements
private NormalizerInterface $normalizer;
private PersonRender $personRender;
private PersonRenderInterface $personRender;
private TranslatableStringHelperInterface $translatableStringHelper;
@ -54,7 +54,7 @@ class ActivityContext implements
NormalizerInterface $normalizer,
TranslatableStringHelperInterface $translatableStringHelper,
EntityManagerInterface $em,
PersonRender $personRender,
PersonRenderInterface $personRender,
TranslatorInterface $translator,
BaseContextData $baseContextData
) {

View File

@ -16,7 +16,7 @@ use Chill\TaskBundle\Templating\UI\CountNotificationTask;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
class UserMenuBuilder implements LocalMenuBuilderInterface
{

View File

@ -20,7 +20,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use function get_class;

View File

@ -21,7 +21,7 @@ use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use function array_merge;
use function count;

View File

@ -15,7 +15,7 @@ use Chill\AMLI\BudgetBundle\Security\Authorization\BudgetElementVoter;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
class UserMenuBuilder implements LocalMenuBuilderInterface
{

View File

@ -2,6 +2,6 @@ services:
Chill\AMLI\BudgetBundle\Menu\UserMenuBuilder:
arguments:
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
$translator: '@Symfony\Component\Translation\TranslatorInterface'
$translator: '@Symfony\Contracts\Translation\TranslatorInterface'
tags:
- { name: 'chill.menu_builder' }

View File

@ -16,7 +16,7 @@ use Chill\TaskBundle\Templating\UI\CountNotificationTask;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
class UserMenuBuilder implements LocalMenuBuilderInterface
{

View File

@ -19,7 +19,7 @@ use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use function count;

View File

@ -16,8 +16,8 @@
<div class="input-group mb-3">
<select class="form-select" v-model="template">
<option disabled selected value="">{{ $t('choose_a_template') }}</option>
<template v-for="t in templates">
<option v-bind:value="t.id">{{ t.name.fr || 'Aucun nom défini' }}</option>
<template v-for="t in templates" :key="t.id">
<option :value="t.id" >{{ t.name.fr || 'Aucun nom défini' }}</option>
</template>
</select>
<a v-if="canGenerate" class="btn btn-update btn-sm change-icon" :href="buildUrlGenerate" @click.prevent="clickGenerate($event, buildUrlGenerate)"><i class="fa fa-fw fa-cog"></i></a>

View File

@ -2,11 +2,11 @@ docgen:
Generate a document: Génerer un document
Generate: Génerer
Document generation: Génération de documents
Manage templates and document generation: Gestion des documents générés et de leurs gabarits
Manage templates and document generation: Gestion des documents générés et de leurs modèles
Pick template context: Choisir un contexte
Context: Contexte
New template: Nouveau gabarit
Edit template: Modifier gabarit
New template: Nouveau modèle
Edit template: Modifier modèle
test generate: Tester la génération
With context: 'Avec le contexte :'

View File

@ -17,6 +17,7 @@ use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
/**
@ -46,6 +47,28 @@ class ChillDocStoreExtension extends Extension implements PrependExtensionInterf
$this->prependRoute($container);
$this->prependAuthorization($container);
$this->prependTwig($container);
$this->prependApis($container);
}
protected function prependApis(ContainerBuilder $container)
{
$container->prependExtensionConfig('chill_main', [
'apis' => [
[
'class' => \Chill\DocStoreBundle\Entity\StoredObject::class,
'name' => 'stored_object',
'base_path' => '/api/1.0/docstore/stored-object',
'base_role' => 'ROLE_USER',
'actions' => [
'_entity' => [
'methods' => [
Request::METHOD_POST => true,
],
],
],
],
],
]);
}
protected function prependAuthorization(ContainerBuilder $container)

View File

@ -34,19 +34,19 @@ class StoredObject implements AsyncFileInterface, Document
{
/**
* @ORM\Column(type="datetime", name="creation_date")
* @Serializer\Groups({"read"})
* @Serializer\Groups({"read", "write"})
*/
private DateTimeInterface $creationDate;
/**
* @ORM\Column(type="json", name="datas")
* @Serializer\Groups({"read"})
* @Serializer\Groups({"read", "write"})
*/
private array $datas = [];
/**
* @ORM\Column(type="text")
* @Serializer\Groups({"read"})
* @Serializer\Groups({"read", "write"})
*/
private $filename;
@ -54,30 +54,32 @@ class StoredObject implements AsyncFileInterface, Document
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Serializer\Groups({"read"})
* @Serializer\Groups({"read", "write"})
*/
private $id;
/**
* @var int[]
* @ORM\Column(type="json", name="iv")
* @Serializer\Groups({"write"})
*/
private array $iv = [];
/**
* @ORM\Column(type="json", name="key")
* @Serializer\Groups({"write"})
*/
private array $keyInfos = [];
/**
* @ORM\Column(type="text", name="type")
* @Serializer\Groups({"read"})
* @Serializer\Groups({"read", "write"})
*/
private string $type = '';
/**
* @ORM\Column(type="uuid", unique=true)
* @Serializer\Groups({"read"})
* @Serializer\Groups({"read", "write"})
*/
private UuidInterface $uuid;

View File

@ -4,12 +4,12 @@ var initializeDownload = require('./downloader.js');
/**
*
*
* define a dropzone for chill usage
*
* An event is launched when dropzone is initialize, allowing to customize events
*
* An event is launched when dropzone is initialize, allowing to customize events
* on dropzone :
*
*
* ```
* window.addEventListener("chill_dropzone_initialized", (e) => {
* // do something with dropzone:
@ -18,7 +18,7 @@ var initializeDownload = require('./downloader.js');
* });
* });
* ```
*
*
*/
// load css
@ -37,7 +37,6 @@ var keyDefinition = {
var searchForZones = function(root) {
var zones = root.querySelectorAll('div[data-stored-object]');
for(let i=0; i < zones.length; i++) {
initialize(zones[i]);
}
@ -48,32 +47,32 @@ var getUploadUrl = function(zoneData, files) {
generateTempUrlPost = zoneData.zone.querySelector('input[data-async-file-upload]').dataset.generateTempUrlPost,
oReq = new XMLHttpRequest()
;
// arg, dropzone, you cannot handle async upload...
oReq.open("GET", generateTempUrlPost, false);
oReq.send();
if (oReq.readyState !== XMLHttpRequest.DONE) {
throw new Error("Error while fetching url to upload");
}
zoneData.params = JSON.parse(oReq.responseText);
return zoneData.params.url;
};
var encryptFile = function(originalFile, zoneData, done) {
var
var
iv = crypto.getRandomValues(new Uint8Array(16)),
reader = new FileReader(),
jsKey, rawKey
;
zoneData.originalType = originalFile.type;
reader.onload = e => {
window.crypto.subtle.generateKey(keyDefinition, true, [ "encrypt", "decrypt" ])
.then(key => {
.then(key => {
jsKey = key;
// we register the key somwhere
@ -90,34 +89,34 @@ var encryptFile = function(originalFile, zoneData, done) {
rawKey: rawKey,
iv: iv
};
done(new File( [ encrypted ], zoneData.suffix));
});
};
reader.readAsArrayBuffer(originalFile);
};
var addBelowButton = (btn, zone, zoneData) => {
let
belowZone = zone.querySelector('.chill-dropzone__below-zone');
if (belowZone === null) {
belowZone = document.createElement('div');
belowZone.classList.add('chill-dropzone__below-zone');
zone.appendChild(belowZone);
}
belowZone.appendChild(btn);
};
var createZone = (zone, zoneData) => {
var
var
created = document.createElement('div'),
initMessage = document.createElement('div'),
initContent = zone.dataset.labelInitMessage,
dropzoneI;
created.classList.add('dropzone');
initMessage.classList.add('dz-message');
initMessage.appendChild(document.createTextNode(initContent));
@ -142,7 +141,7 @@ var createZone = (zone, zoneData) => {
return zoneData.suffix;
}
});
dropzoneI.on("sending", function(file, xhr, formData) {
formData.append("redirect", zoneData.params.redirect);
formData.append("max_file_size", zoneData.params.max_file_size);
@ -150,24 +149,24 @@ var createZone = (zone, zoneData) => {
formData.append("expires", zoneData.params.expires);
formData.append("signature", zoneData.params.signature);
});
dropzoneI.on("success", function(file, response) {
zoneData.currentFile = file;
storeDataInForm(zone, zoneData);
});
dropzoneI.on("addedfile", function(file) {
if (zoneData.hasOwnProperty('currentFile')) {
dropzoneI.removeFile(zoneData.currentFile);
}
});
dropzoneI.on("removedfile", function(file) {
removeDataInForm(zone, zoneData);
});
zone.insertBefore(created, zone.firstChild);
let event = new CustomEvent("chill_dropzone_initialized", {
detail: {
dropzone: dropzoneI,
@ -179,7 +178,7 @@ var createZone = (zone, zoneData) => {
var initialize = function(zone) {
var
var
allowRemove = zone.dataset.allowRemove,
zoneData = { zone: zone, suffix: createFilename(), allowRemove: allowRemove, old: null }
;
@ -204,13 +203,13 @@ var createFilename = () => {
};
var storeDataInForm = (zone, zoneData) => {
var
var
inputKey = zone.querySelector('input[data-stored-object-key]'),
inputIv = zone.querySelector('input[data-stored-object-iv]'),
inputObject = zone.querySelector('input[data-async-file-upload]'),
inputType = zone.querySelector('input[data-async-file-type]')
;
inputKey.value = JSON.stringify(zoneData.crypto.rawKey);
inputIv.value = JSON.stringify(Array.from(zoneData.crypto.iv));
inputType.value = zoneData.originalType;
@ -220,18 +219,18 @@ var storeDataInForm = (zone, zoneData) => {
};
const restoreDataInForm = (zone, zoneData) => {
var
var
inputKey = zone.querySelector('input[data-stored-object-key]'),
inputIv = zone.querySelector('input[data-stored-object-iv]'),
inputObject = zone.querySelector('input[data-async-file-upload]'),
inputType = zone.querySelector('input[data-async-file-type]')
;
if (zoneData.old === null) {
console.log('should not have restored data');
return;
}
inputKey.value = zoneData.old.key;
inputIv.value = zoneData.old.iv;
inputType.value = zoneData.old.type;
@ -241,21 +240,21 @@ const restoreDataInForm = (zone, zoneData) => {
};
const hasDataInForm = (zone, zoneData) => {
var
var
inputObject = zone.querySelector('input[data-async-file-upload]')
;
return inputObject.value.length > 0;
};
var removeDataInForm = (zone, zoneData) => {
var
var
inputKey = zone.querySelector('input[data-stored-object-key]'),
inputIv = zone.querySelector('input[data-stored-object-iv]'),
inputObject = zone.querySelector('input[data-async-file-upload]'),
inputType = zone.querySelector('input[data-async-file-type]')
;
// store data for future usage
zoneData.old = {
key: inputKey.value,
@ -268,7 +267,7 @@ var removeDataInForm = (zone, zoneData) => {
inputIv.value = "";
inputType.value = "";
inputObject.value = "";
insertDownloadButton(zone);
};
@ -279,25 +278,25 @@ var insertRemoveButton = (zone, zoneData) => {
labelRemove = zone.dataset.dictRemove,
labelCancel = 'Restaurer'
;
removeButton.classList.add('btn', 'btn-delete');
removeButton.textContent = labelRemove;
cancelButton.classList.add('btn', 'btn-cancel');
cancelButton.textContent = labelCancel;
removeButton.addEventListener('click', (e) => {
e.preventDefault();
if (zoneData.allowRemove === 'true') {
removeDataInForm(zone, zoneData);
cancelButton.addEventListener('click', (e) => {
e.preventDefault();
restoreDataInForm(zone, zoneData);
cancelButton.remove();
zone.querySelector('.dropzone').remove();
initialize(zone);
});
}
@ -306,16 +305,16 @@ var insertRemoveButton = (zone, zoneData) => {
removeButton.remove();
createZone(zone, zoneData);
});
addBelowButton(removeButton, zone, zoneData);
// zone.appendChild(removeButton);
};
const removeDownloadButton = (zone, zoneData) => {
var
var
existingButtons = zone.querySelectorAll('a[data-download-button]')
;
// remove existing
existingButtons.forEach(function(b) {
b.remove();
@ -323,7 +322,7 @@ const removeDownloadButton = (zone, zoneData) => {
};
var insertDownloadButton = (zone, zoneData) => {
var
var
existingButtons = zone.querySelectorAll('a[data-download-button]'),
newButton = document.createElement('a'),
inputKey = zone.querySelector('input[data-stored-object-key]'),
@ -336,18 +335,18 @@ var insertDownloadButton = (zone, zoneData) => {
tempUrlGenerator = zone.dataset.tempUrlGenerator,
tempUrlGeneratorParams = new URLSearchParams()
;
// remove existing
existingButtons.forEach(function(b) {
b.remove();
});
if (inputObject.value === '') {
return;
}
tempUrlGeneratorParams.append('object_name', inputObject.value);
newButton.dataset.downloadButton = true;
newButton.dataset.key = inputKey.value;
newButton.dataset.iv = inputIv.value;
@ -357,7 +356,7 @@ var insertDownloadButton = (zone, zoneData) => {
newButton.dataset.tempUrlGetGenerator = tempUrlGenerator + '?' + tempUrlGeneratorParams.toString();
newButton.classList.add('btn', 'btn-download', 'dz-bt-below-dropzone');
newButton.textContent = labelQuietButton;
addBelowButton(newButton, zone, zoneData);
//zone.appendChild(newButton);
initializeDownload(zone);
@ -370,3 +369,5 @@ window.addEventListener('load', function(e) {
window.addEventListener('collection-add-entry', function(e) {
searchForZones(e.detail.entry);
});
export { searchForZones };

View File

@ -0,0 +1,157 @@
<template>
<a class="btn btn-create" :title="$t(buttonTitle)" @click="openModal">
<span>{{ $t(buttonTitle) }}</span>
</a>
<teleport to="body">
<div>
<modal v-if="modal.showModal"
:modalDialogClass="modal.modalDialogClass"
@close="modal.showModal = false">
<template v-slot:header>
{{ $t('upload_a_document') }}
</template>
<template v-slot:body>
<div id="dropZoneWrapper" ref="dropZoneWrapper">
<div
data-stored-object="data-stored-object"
:data-label-preparing="$t('data_label_preparing')"
:data-label-quiet-button="$t('data_label_quiet_button')"
:data-label-ready="$t('data_label_ready')"
:data-dict-file-too-big="$t('data_dict_file_too_big')"
:data-dict-default-message="$t('data_dict_default_message')"
:data-dict-remove-file="$t('data_dict_remove_file')"
:data-dict-max-files-exceeded="$t('data_dict_max_files_exceeded')"
:data-dict-cancel-upload="$t('data_dict_cancel_upload')"
:data-dict-cancel-upload-confirm="$t('data_dict_cancel_upload_confirm')"
:data-dict-upload-canceled="$t('data_dict_upload_canceled')"
:data-dict-remove="$t('data_dict_remove')"
:data-allow-remove="!options.required"
data-temp-url-generator="/asyncupload/temp_url/generate/GET">
<input
type="hidden"
data-async-file-upload="data-async-file-upload"
data-generate-temp-url-post="/asyncupload/temp_url/generate/post?expires_delay=180&amp;submit_delay=3600"
data-temp-url-get="/asyncupload/temp_url/generate/GET"
:data-max-files="options.maxFiles"
:data-max-post-size="options.maxPostSize"
:v-model="dataAsyncFileUpload"
>
<input
type="hidden"
data-stored-object-key="1"
>
<input
type="hidden"
data-stored-object-iv="1"
>
<input
type="hidden"
data-async-file-type="1"
>
</div>
</div>
</template>
<template v-slot:footer>
<button class="btn btn-create"
@click.prevent="saveDocument">
{{ $t('action.add')}}
</button>
</template>
</modal>
</div>
</teleport>
</template>
<script>
import Modal from 'ChillMainAssets/vuejs/_components/Modal';
import { searchForZones } from '../../module/async_upload/uploader';
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
const i18n = {
messages: {
fr: {
upload_a_document: "Téléversez un document",
data_label_preparing: "Chargement...",
data_label_quiet_button: "Téléchargez le fichier existant",
data_label_ready: "Prêt à montrer",
data_dict_file_too_big: "Fichier trop volumineux",
data_dict_default_message: "Glissez votre fichier ou cliquez ici",
data_dict_remove_file: "Enlevez votre fichier pour en téléversez un autre",
data_dict_max_files_exceeded: "Nombre maximum de fichiers atteint. Enlevez les fichiers précédents",
data_dict_cancel_upload: "Annulez le téléversement",
data_dict_cancel_upload_confirm: "Êtes-vous sûr·e de vouloir annuler ce téléversement?",
data_dict_upload_canceled: "Téléversement annulé",
data_dict_remove: "Enlevez le fichier existant",
}
}
};
export default {
name: "AddAsyncUpload",
components: {
Modal
},
i18n,
props: [
'buttonTitle',
'options'
],
emits: ['addDocument'],
data() {
return {
modal: {
showModal: false,
modalDialogClass: "modal-dialog-centered modal-md"
},
}
},
updated() {
if (this.modal.showModal){
searchForZones(this.$refs.dropZoneWrapper);
}
},
methods: {
openModal() {
this.modal.showModal = true;
},
saveDocument() {
const dropzone = this.$refs.dropZoneWrapper;
if (dropzone) {
const inputKey = dropzone.querySelector('input[data-stored-object-key]');
const inputIv = dropzone.querySelector('input[data-stored-object-iv]');
const inputObject = dropzone.querySelector('input[data-async-file-upload]');
const inputType = dropzone.querySelector('input[data-async-file-type]');
const url = '/api/1.0/docstore/stored-object.json';
const body = {
filename: inputObject.value,
keyInfos: JSON.parse(inputKey.value),
iv: JSON.parse(inputIv.value),
type: inputType.value,
};
makeFetch('POST', url, body)
.then(r => {
this.$emit("addDocument", r);
this.modal.showModal = false;
})
.catch((error) => {
if (error.name === 'ValidationException') {
for (let v of error.violations) {
this.$toast.open({message: v });
}
} else {
console.error(error);
this.$toast.open({message: 'An error occurred'});
}
});
} else {
this.$toast.open({message: 'An error occurred - drop zone not found'});
}
}
}
}
</script>

View File

@ -1,19 +0,0 @@
{% import '@ChillMain/Workflow/macro_breadcrumb.html.twig' as m %}
<div class="flex-grow-1 {% if add_classes is defined %}{{ add_classes }}{% else %}h2{% endif %}">
<div>
{% if concerne is defined and concerne == true %}
<span class="item-key">{{ 'Concerne'|trans }}: </span>
{% endif %}
{{ 'workflow.Document (n°%doc%)'|trans({'%doc%': document.id}) }}
{% if description is defined and description == true %}
{{ ' — ' ~ document.title }}
{% endif %}
</div>
{% if breadcrumb is defined and breadcrumb == true %}
{{ m.breadcrumb(_context) }}
{% endif %}
</div>

View File

@ -10,16 +10,18 @@
{{ parent() }}
{{ encore_entry_script_tags('mod_async_upload') }}
{{ encore_entry_script_tags('mod_docgen_picktemplate') }}
{{ encore_entry_script_tags('mod_entity_workflow_pick') }}
{% endblock %}
{% block css %}
{{ parent() }}
{{ encore_entry_link_tags('mod_async_upload') }}
{{ encore_entry_link_tags('mod_docgen_picktemplate') }}
{{ encore_entry_link_tags('mod_entity_workflow_pick') }}
{% endblock %}
{% block content %}
<div class="col-md-10 col-xxl">
<div class="document-list">
<h1>{{ 'Documents' }}</h1>
{% if documents|length == 0 %}
@ -27,7 +29,7 @@
{% else %}
<div class="flex-table chill-task-list">
{% for document in documents %}
{% include 'ChillDocStoreBundle:List:list_item.html.twig' %}
{% include '@ChillDocStore/List/list_item.html.twig' %}
{% endfor %}
</div>
{% endif %}

View File

@ -48,6 +48,9 @@
<div>
{% if document.course is defined %}
<ul class="record_actions">
<li>
{{ chill_entity_workflow_list('Chill\\DocStoreBundle\\Entity\\AccompanyingCourseDocument', document.id) }}
</li>
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS', document) %}
<li>
{{ m.download_button(document.object, document.title) }}

View File

@ -0,0 +1,55 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\DocStoreBundle\Serializer\Normalizer;
use Chill\DocStoreBundle\Entity\StoredObject;
use Chill\DocStoreBundle\Repository\StoredObjectRepository;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\ObjectToPopulateTrait;
use function array_key_exists;
use function is_array;
class StoredObjectDenormalizer implements DenormalizerInterface
{
use ObjectToPopulateTrait;
private StoredObjectRepository $storedObjectRepository;
public function __construct(StoredObjectRepository $storedObjectRepository)
{
$this->storedObjectRepository = $storedObjectRepository;
}
public function denormalize($data, $type, $format = null, array $context = [])
{
$object = $this->extractObjectToPopulate(StoredObject::class, $context);
if (null !== $object) {
return $object;
}
return $this->storedObjectRepository->find($data['id']);
}
public function supportsDenormalization($data, $type, $format = null)
{
if (false === is_array($data)) {
return false;
}
if (false === array_key_exists('id', $data)) {
return false;
}
return StoredObject::class === $type;
}
}

View File

@ -14,19 +14,51 @@ namespace Chill\DocStoreBundle\Workflow;
use Chill\DocStoreBundle\Entity\AccompanyingCourseDocument;
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
use Chill\MainBundle\Workflow\EntityWorkflowHandlerInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Symfony\Contracts\Translation\TranslatorInterface;
class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandlerInterface
{
private EntityRepository $repository;
private TranslatorInterface $translator;
/**
* TODO: injecter le repository directement.
*/
public function __construct(EntityManagerInterface $em)
{
public function __construct(
EntityManagerInterface $em,
TranslatorInterface $translator
) {
$this->repository = $em->getRepository(AccompanyingCourseDocument::class);
$this->translator = $translator;
}
public function getEntityData(EntityWorkflow $entityWorkflow, array $options = []): array
{
$course = $this->getRelatedEntity($entityWorkflow)
->getCourse();
$persons = [];
if (null !== $course) {
$persons = $course->getCurrentParticipations()->map(static function (AccompanyingPeriodParticipation $participation) {
return $participation->getPerson();
})->toArray();
}
return [
'persons' => array_values($persons),
];
}
public function getEntityTitle(EntityWorkflow $entityWorkflow, array $options = []): string
{
$doc = $this->getRelatedEntity($entityWorkflow);
return $this->translator->trans('workflow.Document (n°%doc%)', ['%doc%' => $entityWorkflow->getRelatedEntityId()])
. ' - ' . $doc->getTitle();
}
public function getRelatedEntity(EntityWorkflow $entityWorkflow): ?AccompanyingCourseDocument
@ -52,16 +84,6 @@ class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandler
];
}
public function getTemplateTitle(EntityWorkflow $entityWorkflow, array $options = []): string
{
return '@ChillDocStore/AccompanyingCourseDocument/_workflow.title.html.twig';
}
public function getTemplateTitleData(EntityWorkflow $entityWorkflow, array $options = []): array
{
return $this->getTemplateData($entityWorkflow, $options);
}
public function supports(EntityWorkflow $entityWorkflow, array $options = []): bool
{
return $entityWorkflow->getRelatedEntityClass() === AccompanyingCourseDocument::class;

View File

@ -0,0 +1,46 @@
---
openapi: "3.0.0"
info:
version: "1.0.0"
title: "Chill api"
description: "Api documentation for chill. Currently, work in progress"
servers:
- url: "/api"
description: "Your current dev server"
components:
schemas:
StoredObject:
type: object
properties:
id:
type: integer
filename:
type: string
type:
type: string
paths:
/1.0/docstore/stored-object.json:
post:
tags:
- storedobject
summary: Create a stored object
requestBody:
description: "A stored object"
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/StoredObject"
responses:
200:
description: "OK"
content:
application/json:
schema:
$ref: "#/components/schemas/StoredObject"
403:
description: "Unauthorized"
422:
description: "Invalid data"

View File

@ -1,4 +1,7 @@
module.exports = function(encore)
{
encore.addAliases({
ChillDocStoreAssets: __dirname + '/Resources/public'
});
encore.addEntry('mod_async_upload', __dirname + '/Resources/public/module/async_upload/index.js');
};

View File

@ -33,3 +33,10 @@ services:
resource: './../Workflow/'
autoconfigure: true
autowire: true
Chill\DocStoreBundle\Serializer\Normalizer\:
autowire: true
resource: '../Serializer/Normalizer/'
tags:
- { name: 'serializer.normalizer', priority: 16 }

View File

@ -38,7 +38,7 @@ use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use function count;

View File

@ -28,7 +28,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use function in_array;
use function is_array;

View File

@ -21,7 +21,7 @@ use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
* Allow to pick a choice amongst different choices.

View File

@ -21,7 +21,7 @@ use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
* Allow to pick amongst type.

View File

@ -15,7 +15,7 @@ use Chill\EventBundle\Security\Authorization\EventVoter;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
class PersonMenuBuilder implements LocalMenuBuilderInterface
{

View File

@ -5,7 +5,7 @@ services:
$eventDispatcher: '@Symfony\Component\EventDispatcher\EventDispatcherInterface'
$authorizationHelper: '@Chill\MainBundle\Security\Authorization\AuthorizationHelper'
$formFactoryInterface: '@Symfony\Component\Form\FormFactoryInterface'
$translator: '@Symfony\Component\Translation\TranslatorInterface'
$translator: '@Symfony\Contracts\Translation\TranslatorInterface'
$paginator: '@chill_main.paginator_factory'
public: true
tags: ['controller.service_arguments']

View File

@ -44,6 +44,6 @@ services:
$tokenStorage: "@security.token_storage"
$authorizationHelper: "@chill.main.security.authorization.helper"
$urlGenerator: '@Symfony\Component\Routing\Generator\UrlGeneratorInterface'
$translator: '@Symfony\Component\Translation\TranslatorInterface'
$translator: '@Symfony\Contracts\Translation\TranslatorInterface'
tags:
- { name: form.type }

View File

@ -2,6 +2,6 @@ services:
Chill\EventBundle\Menu\PersonMenuBuilder:
arguments:
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
$translator: '@Symfony\Component\Translation\TranslatorInterface'
$translator: '@Symfony\Contracts\Translation\TranslatorInterface'
tags:
- { name: 'chill.menu_builder' }

View File

@ -24,7 +24,7 @@ use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
class FamilyMemberController extends AbstractController
{

View File

@ -15,7 +15,7 @@ use Chill\AMLI\FamilyMembersBundle\Security\Voter\FamilyMemberVoter;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
class UserMenuBuilder implements LocalMenuBuilderInterface
{

View File

@ -2,6 +2,6 @@ services:
Chill\AMLI\FamilyMembersBundle\Menu\UserMenuBuilder:
arguments:
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
$translator: '@Symfony\Component\Translation\TranslatorInterface'
$translator: '@Symfony\Contracts\Translation\TranslatorInterface'
tags:
- { name: 'chill.menu_builder' }

View File

@ -20,8 +20,8 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Serializer\SerializerInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use function array_merge;

View File

@ -27,7 +27,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Serializer\SerializerInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use function array_key_exists;
use function array_merge;

View File

@ -29,7 +29,6 @@ use Chill\MainBundle\Security\ProvideRoleInterface;
use Chill\MainBundle\Security\Resolver\CenterResolverInterface;
use Chill\MainBundle\Security\Resolver\ScopeResolverInterface;
use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
use Chill\MainBundle\Templating\Entity\CompilerPass as RenderEntityCompilerPass;
use Chill\MainBundle\Templating\UI\NotificationCounterInterface;
use Chill\MainBundle\Workflow\EntityWorkflowHandlerInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@ -70,7 +69,6 @@ class ChillMainBundle extends Bundle
$container->addCompilerPass(new MenuCompilerPass());
$container->addCompilerPass(new ACLFlagsCompilerPass());
$container->addCompilerPass(new GroupingCenterCompilerPass());
$container->addCompilerPass(new RenderEntityCompilerPass());
$container->addCompilerPass(new CRUDControllerCompilerPass());
}
}

View File

@ -0,0 +1,24 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Controller;
use Chill\MainBundle\CRUD\Controller\ApiController;
use Chill\MainBundle\Pagination\PaginatorInterface;
use Symfony\Component\HttpFoundation\Request;
class CivilityApiController extends ApiController
{
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format)
{
return $query->addOrderBy('e.order', 'ASC');
}
}

View File

@ -24,7 +24,7 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use function count;
use function serialize;

View File

@ -27,9 +27,9 @@ use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
* Class PasswordController.

View File

@ -11,7 +11,12 @@ declare(strict_types=1);
namespace Chill\MainBundle\Controller;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
use Chill\MainBundle\Pagination\PaginatorFactory;
use Chill\MainBundle\Repository\Workflow\EntityWorkflowRepository;
use Chill\MainBundle\Serializer\Model\Collection;
use Chill\MainBundle\Serializer\Model\Counter;
use Doctrine\ORM\EntityManagerInterface;
use LogicException;
use Symfony\Component\HttpFoundation\JsonResponse;
@ -21,17 +26,71 @@ use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\Serializer\SerializerInterface;
class WorkflowApiController
{
private EntityManagerInterface $entityManager;
private EntityWorkflowRepository $entityWorkflowRepository;
private PaginatorFactory $paginatorFactory;
private Security $security;
public function __construct(Security $security, EntityManagerInterface $entityManager)
{
private SerializerInterface $serializer;
public function __construct(
EntityManagerInterface $entityManager,
EntityWorkflowRepository $entityWorkflowRepository,
PaginatorFactory $paginatorFactory,
Security $security,
SerializerInterface $serializer
) {
$this->entityManager = $entityManager;
$this->entityWorkflowRepository = $entityWorkflowRepository;
$this->paginatorFactory = $paginatorFactory;
$this->security = $security;
$this->serializer = $serializer;
}
/**
* Return a list of workflow which are waiting an action for the user.
*
* @Route("/api/1.0/main/workflow/my", methods={"GET"})
*/
public function myWorkflow(Request $request): JsonResponse
{
if (!$this->security->isGranted('ROLE_USER') || !$this->security->getUser() instanceof User) {
throw new AccessDeniedException();
}
$total = $this->entityWorkflowRepository->countByDest($this->security->getUser());
if ($request->query->getBoolean('countOnly', false)) {
return new JsonResponse(
$this->serializer->serialize(new Counter($total), 'json'),
JsonResponse::HTTP_OK,
[],
true
);
}
$paginator = $this->paginatorFactory->create($total);
$workflows = $this->entityWorkflowRepository->findByDest(
$this->security->getUser(),
['id' => 'DESC'],
$paginator->getItemsPerPage(),
$paginator->getCurrentPageFirstItemNumber()
);
return new JsonResponse(
$this->serializer->serialize(new Collection($workflows, $paginator), 'json', ['groups' => ['read']]),
JsonResponse::HTTP_OK,
[],
true
);
}
/**

View File

@ -11,21 +11,26 @@ declare(strict_types=1);
namespace Chill\MainBundle\Controller;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
use Chill\MainBundle\Entity\Workflow\EntityWorkflowComment;
use Chill\MainBundle\Entity\Workflow\EntityWorkflowStep;
use Chill\MainBundle\Form\EntityWorkflowCommentType;
use Chill\MainBundle\Form\WorkflowStepType;
use Chill\MainBundle\Pagination\PaginatorFactory;
use Chill\MainBundle\Repository\Workflow\EntityWorkflowRepository;
use Chill\MainBundle\Security\Authorization\EntityWorkflowVoter;
use Chill\MainBundle\Workflow\EntityWorkflowManager;
use Chill\MainBundle\Workflow\Validator\StepDestValid;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Exception\BadRequestException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Component\Workflow\Registry;
use Symfony\Component\Workflow\TransitionBlocker;
@ -80,7 +85,9 @@ class WorkflowController extends AbstractController
$entityWorkflow
->setRelatedEntityClass($request->query->get('entityClass'))
->setRelatedEntityId($request->query->getInt('entityId'))
->setWorkflowName($request->query->get('workflow'));
->setWorkflowName($request->query->get('workflow'))
->addSubscriberToStep($this->getUser())
->addSubscriberToFinal($this->getUser());
$errors = $this->validator->validate($entityWorkflow, null, ['creation']);
@ -104,6 +111,121 @@ class WorkflowController extends AbstractController
return $this->redirectToRoute('chill_main_workflow_show', ['id' => $entityWorkflow->getId()]);
}
/**
* @Route("/{_locale}/main/workflow/{id}/delete", name="chill_main_workflow_delete")
*/
public function delete(EntityWorkflow $entityWorkflow, Request $request): Response
{
$this->denyAccessUnlessGranted(EntityWorkflowVoter::DELETE, $entityWorkflow);
$form = $this->createForm(FormType::class);
$form->add('submit', SubmitType::class, ['label' => 'workflow.Delete workflow']);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$this->entityManager->remove($entityWorkflow);
$this->entityManager->flush();
$this->addFlash('success', $this->translator->trans('workflow.Workflow deleted with success'));
return $this->redirectToRoute('chill_main_homepage');
}
return $this->render('@ChillMain/Workflow/delete.html.twig', [
'entityWorkflow' => $entityWorkflow,
'delete_form' => $form->createView(),
'handler' => $this->entityWorkflowManager->getHandler($entityWorkflow),
]);
}
/**
* @Route("/{_locale}/main/workflow-step/{id}/access_key", name="chill_main_workflow_grant_access_by_key")
*/
public function getAccessByAccessKey(EntityWorkflowStep $entityWorkflowStep, Request $request): Response
{
if (null === $accessKey = $request->query->get('accessKey', null)) {
throw new BadRequestException('accessKey is missing');
}
if (!$this->getUser() instanceof User) {
throw new AccessDeniedException('Not a valid user');
}
if ($entityWorkflowStep->getAccessKey() !== $accessKey) {
throw new AccessDeniedException('Access key is invalid');
}
if (!$entityWorkflowStep->isWaitingForTransition()) {
$this->addFlash('error', $this->translator->trans('workflow.Steps is not waiting for transition. Maybe someone apply the transition before you ?'));
} else {
$entityWorkflowStep->addDestUserByAccessKey($this->getUser());
$this->entityManager->flush();
$this->addFlash('success', $this->translator->trans('workflow.You get access to this step'));
}
return $this->redirectToRoute('chill_main_workflow_show', ['id' => $entityWorkflowStep->getEntityWorkflow()->getId()]);
}
/**
* Previous workflows where the user has applyed a transition.
*
* @Route("/{_locale}/main/workflow/list/previous_transitionned", name="chill_main_workflow_list_previous_transitionned")
*/
public function myPreviousWorkflowsTransitionned(Request $request): Response
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');
$total = $this->entityWorkflowRepository->countByPreviousTransitionned($this->getUser());
$paginator = $this->paginatorFactory->create($total);
$workflows = $this->entityWorkflowRepository->findByPreviousTransitionned(
$this->getUser(),
['createdAt' => 'DESC'],
$paginator->getItemsPerPage(),
$paginator->getCurrentPageFirstItemNumber()
);
return $this->render(
'@ChillMain/Workflow/list.html.twig',
[
'help' => 'workflow.Previous workflow transitionned help',
'workflows' => $this->buildHandler($workflows),
'paginator' => $paginator,
'step' => 'previous_transitionned',
]
);
}
/**
* Previous workflows where the user was mentioned, but did not give any reaction.
*
* @Route("/{_locale}/main/workflow/list/previous_without_reaction", name="chill_main_workflow_list_previous_without_reaction")
*/
public function myPreviousWorkflowsWithoutReaction(Request $request): Response
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');
$total = $this->entityWorkflowRepository->countByPreviousDestWithoutReaction($this->getUser());
$paginator = $this->paginatorFactory->create($total);
$workflows = $this->entityWorkflowRepository->findByPreviousDestWithoutReaction(
$this->getUser(),
['createdAt' => 'DESC'],
$paginator->getItemsPerPage(),
$paginator->getCurrentPageFirstItemNumber()
);
return $this->render(
'@ChillMain/Workflow/list.html.twig',
[
'help' => 'workflow.Previous workflow without reaction help',
'workflows' => $this->buildHandler($workflows),
'paginator' => $paginator,
'step' => 'previous_without_reaction',
]
);
}
/**
* @Route("/{_locale}/main/workflow/list/dest", name="chill_main_workflow_list_dest")
*/
@ -197,24 +319,22 @@ class WorkflowController extends AbstractController
);
}
$entityWorkflow->futureDestUsers = $transitionForm['future_dest_users']->getData();
$entityWorkflow->futureDestEmails = $transitionForm['future_dest_emails']->getData();
$workflow->apply($entityWorkflow, $transition);
foreach ($transitionForm['future_dest_users']->getData() as $user) {
$entityWorkflow->getCurrentStep()->addDestUser($user);
}
$errors = $this->validator->validate(
$entityWorkflow->getCurrentStep(),
new StepDestValid()
);
if (count($errors) === 0) {
$this->entityManager->flush();
return $this->redirectToRoute('chill_main_workflow_show', ['id' => $entityWorkflow->getId()]);
foreach ($transitionForm['future_dest_emails']->getData() as $email) {
$entityWorkflow->getCurrentStep()->addDestEmail($email);
}
return new Response((string) $errors, Response::HTTP_UNPROCESSABLE_ENTITY);
$this->entityManager->flush();
return $this->redirectToRoute('chill_main_workflow_show', ['id' => $entityWorkflow->getId()]);
}
if ($transitionForm->isSubmitted() && !$transitionForm->isValid()) {
@ -241,8 +361,8 @@ class WorkflowController extends AbstractController
return $this->render(
'@ChillMain/Workflow/index.html.twig',
[
'handler' => $handler,
'handler_template' => $handler->getTemplate($entityWorkflow),
'handler_template_title' => $handler->getTemplateTitle($entityWorkflow),
'handler_template_data' => $handler->getTemplateData($entityWorkflow),
'transition_form' => isset($transitionForm) ? $transitionForm->createView() : null,
'entity_workflow' => $entityWorkflow,

View File

@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\DependencyInjection;
use Chill\MainBundle\Controller\AddressApiController;
use Chill\MainBundle\Controller\CivilityApiController;
use Chill\MainBundle\Controller\LocationController;
use Chill\MainBundle\Controller\LocationTypeController;
use Chill\MainBundle\Controller\UserController;
@ -559,6 +560,21 @@ class ChillMainExtension extends Extension implements
],
],
],
[
'class' => \Chill\MainBundle\Entity\Civility::class,
'name' => 'civility',
'base_path' => '/api/1.0/main/civility',
'base_role' => 'ROLE_USER',
'controller' => CivilityApiController::class,
'actions' => [
'_index' => [
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true,
],
],
],
],
],
]);
}

View File

@ -139,12 +139,10 @@ class Address
private $point;
/**
* @var PostalCode
*
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\PostalCode")
* @Groups({"write"})
*/
private $postcode;
private ?PostalCode $postcode = null;
/**
* @var string|null
@ -306,10 +304,8 @@ class Address
/**
* Get postcode.
*
* @return PostalCode
*/
public function getPostcode()
public function getPostcode(): ?PostalCode
{
return $this->postcode;
}

View File

@ -17,6 +17,7 @@ use Symfony\Component\Serializer\Annotation as Serializer;
/**
* @ORM\Table(name="chill_main_civility")
* @ORM\Entity
* @Serializer\DiscriminatorMap(typeProperty="type", mapping={"chill_main_civility": Civility::class})
*/
class Civility
{
@ -29,6 +30,7 @@ class Civility
/**
* @ORM\Column(type="boolean")
* @Serializer\Groups({"read"})
*/
private bool $active = true;

View File

@ -41,6 +41,28 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface
use TrackUpdateTrait;
/**
* a list of future dest emails for the next steps.
*
* This is in used in order to let controller inform who will be the future emails which will validate
* the next step. This is necessary to perform some computation about the next emails, before they are
* associated to the entity EntityWorkflowStep.
*
* @var array|string[]
*/
public array $futureDestEmails = [];
/**
* a list of future dest users for the next steps.
*
* This is in used in order to let controller inform who will be the future users which will validate
* the next step. This is necessary to perform some computation about the next users, before they are
* associated to the entity EntityWorkflowStep.
*
* @var array|User[]
*/
public array $futureDestUsers = [];
/**
* @ORM\OneToMany(targetEntity=EntityWorkflowComment::class, mappedBy="entityWorkflow", orphanRemoval=true)
*

View File

@ -27,6 +27,11 @@ use function in_array;
*/
class EntityWorkflowStep
{
/**
* @ORM\Column(type="text", nullable=false)
*/
private string $accessKey;
/**
* @ORM\Column(type="text", options={"default": ""})
*/
@ -48,6 +53,12 @@ class EntityWorkflowStep
*/
private Collection $destUser;
/**
* @ORM\ManyToMany(targetEntity=User::class)
* @ORM\JoinTable(name="chill_main_workflow_entity_step_user_by_accesskey")
*/
private Collection $destUserByAccessKey;
/**
* @ORM\ManyToOne(targetEntity=EntityWorkflow::class, inversedBy="steps")
*/
@ -86,7 +97,7 @@ class EntityWorkflowStep
private ?string $transitionAfter = null;
/**
* @ORM\Column(type="datetime_immutable")
* @ORM\Column(type="datetime_immutable", nullable=true, options={"default": null})
*/
private ?DateTimeImmutable $transitionAt = null;
@ -104,6 +115,8 @@ class EntityWorkflowStep
public function __construct()
{
$this->destUser = new ArrayCollection();
$this->destUserByAccessKey = new ArrayCollection();
$this->accessKey = bin2hex(openssl_random_pseudo_bytes(32));
}
public function addDestEmail(string $email): self
@ -119,11 +132,45 @@ class EntityWorkflowStep
{
if (!$this->destUser->contains($user)) {
$this->destUser[] = $user;
$this->getEntityWorkflow()
->addSubscriberToFinal($user)
->addSubscriberToStep($user);
}
return $this;
}
public function addDestUserByAccessKey(User $user): self
{
if (!$this->destUserByAccessKey->contains($user) && !$this->destUser->contains($user)) {
$this->destUserByAccessKey[] = $user;
$this->getEntityWorkflow()
->addSubscriberToFinal($user)
->addSubscriberToStep($user);
}
return $this;
}
public function getAccessKey(): string
{
return $this->accessKey;
}
/**
* get all the users which are allowed to apply a transition: those added manually, and
* those added automatically bu using an access key.
*/
public function getAllDestUser(): Collection
{
return new ArrayCollection(
[
...$this->getDestUser()->toArray(),
...$this->getDestUserByAccessKey()->toArray(),
]
);
}
public function getComment(): string
{
return $this->comment;
@ -140,13 +187,21 @@ class EntityWorkflowStep
}
/**
* @return ArrayCollection|Collection
* get dest users added by the creator.
*
* You should **not** rely on this method to get all users which are able to
* apply a transition on this step. Use @see{EntityWorkflowStep::getAllDestUser} instead.
*/
public function getDestUser()
public function getDestUser(): collection
{
return $this->destUser;
}
public function getDestUserByAccessKey(): Collection
{
return $this->destUserByAccessKey;
}
public function getEntityWorkflow(): ?EntityWorkflow
{
return $this->entityWorkflow;
@ -197,6 +252,19 @@ class EntityWorkflowStep
return $this->freezeAfter;
}
public function isWaitingForTransition(): bool
{
if (null !== $this->transitionAfter) {
return false;
}
if ($this->isFinal()) {
return false;
}
return true;
}
public function removeDestEmail(string $email): self
{
$this->destEmail = array_filter($this->destEmail, static function (string $existing) use ($email) {
@ -213,6 +281,13 @@ class EntityWorkflowStep
return $this;
}
public function removeDestUserByAccessKey(User $user): self
{
$this->destUserByAccessKey->removeElement($user);
return $this;
}
public function setComment(?string $comment): EntityWorkflowStep
{
$this->comment = (string) $comment;

View File

@ -18,7 +18,7 @@ use OutOfBoundsException;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use function array_key_exists;
use function array_keys;

View File

@ -17,7 +17,7 @@ use LogicException;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use function array_map;
use function count;

View File

@ -19,7 +19,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use function array_map;
use function array_merge;

View File

@ -23,7 +23,7 @@ use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use function array_key_exists;
use function array_keys;

View File

@ -0,0 +1,57 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Form\Type;
use Chill\MainBundle\Entity\Civility;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolver;
class PickCivilityType extends AbstractType
{
private TranslatableStringHelper $translatableStringHelper;
public function __construct(TranslatableStringHelper $translatableStringHelper)
{
$this->translatableStringHelper = $translatableStringHelper;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefault('label', 'Civility')
->setDefault(
'choice_label',
function (Civility $civility): string {
return $this->translatableStringHelper->localize($civility->getName());
}
)
->setDefault(
'query_builder',
static function (EntityRepository $er): QueryBuilder {
return $er->createQueryBuilder('c')
->where('c.active = true')
->orderBy('c.order');
},
)
->setDefault('placeholder', 'choose civility')
->setDefault('class', Civility::class);
}
public function getParent()
{
return EntityType::class;
}
}

View File

@ -20,7 +20,7 @@ use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
* A form to pick between PostalCode.

View File

@ -13,6 +13,7 @@ namespace Chill\MainBundle\Form;
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
use Chill\MainBundle\Entity\Workflow\EntityWorkflowStep;
use Chill\MainBundle\Form\Type\ChillCollectionType;
use Chill\MainBundle\Form\Type\ChillTextareaType;
use Chill\MainBundle\Form\Type\PickUserDynamicType;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
@ -21,8 +22,14 @@ use LogicException;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Constraints\Email;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\NotNull;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Component\Workflow\Registry;
use Symfony\Component\Workflow\Transition;
use function array_key_exists;
@ -146,6 +153,22 @@ class WorkflowStepType extends AbstractType
'label' => 'workflow.dest for next steps',
'multiple' => true,
'mapped' => false,
])
->add('future_dest_emails', ChillCollectionType::class, [
'label' => 'workflow.dest by email',
'help' => 'workflow.dest by email help',
'mapped' => false,
'allow_add' => true,
'entry_type' => EmailType::class,
'button_add_label' => 'workflow.Add an email',
'button_remove_label' => 'workflow.Remove an email',
'empty_collection_explain' => 'workflow.Any email',
'entry_options' => [
'constraints' => [
new NotNull(), new NotBlank(), new Email(['checkMX' => true]),
],
'label' => 'Email',
],
]);
}
@ -175,6 +198,37 @@ class WorkflowStepType extends AbstractType
->setRequired('transition')
->setAllowedTypes('transition', 'bool')
->setRequired('entity_workflow')
->setAllowedTypes('entity_workflow', EntityWorkflow::class);
->setAllowedTypes('entity_workflow', EntityWorkflow::class)
->setDefault('constraints', [
new Callback(
function ($step, ExecutionContextInterface $context, $payload) {
/** @var EntityWorkflowStep $step */
$form = $context->getObject();
$workflow = $this->registry->get($step->getEntityWorkflow(), $step->getEntityWorkflow()->getWorkflowName());
$transition = $form['transition']->getData();
$toFinal = true;
foreach ($transition->getTos() as $to) {
$meta = $workflow->getMetadataStore()->getPlaceMetadata($to);
if (
!array_key_exists('isFinal', $meta) || false === $meta['isFinal']
) {
$toFinal = false;
}
}
$destUsers = $form['future_dest_users']->getData();
$destEmails = $form['future_dest_emails']->getData();
if (!$toFinal && [] === $destUsers && [] === $destEmails) {
$context
->buildViolation('workflow.You must add at least one dest user or email')
->atPath('future_dest_users')
->addViolation();
}
}
),
]);
}
}

View File

@ -16,7 +16,7 @@ use Psr\Log\LoggerInterface;
use Swift_Mailer;
use Swift_Message;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use Twig\Environment;
use function call_user_func;

View File

@ -34,6 +34,20 @@ class EntityWorkflowRepository implements ObjectRepository
return (int) $qb->getQuery()->getSingleScalarResult();
}
public function countByPreviousDestWithoutReaction(User $user): int
{
$qb = $this->buildQueryByPreviousDestWithoutReaction($user)->select('count(ew)');
return (int) $qb->getQuery()->getSingleScalarResult();
}
public function countByPreviousTransitionned(User $user): int
{
$qb = $this->buildQueryByPreviousTransitionned($user)->select('count(ew)');
return (int) $qb->getQuery()->getSingleScalarResult();
}
public function countBySubscriber(User $user): int
{
$qb = $this->buildQueryBySubscriber($user)->select('count(ew)');
@ -78,6 +92,32 @@ class EntityWorkflowRepository implements ObjectRepository
return $qb->getQuery()->getResult();
}
public function findByPreviousDestWithoutReaction(User $user, ?array $orderBy = null, $limit = null, $offset = null): array
{
$qb = $this->buildQueryByPreviousDestWithoutReaction($user)->select('ew');
foreach ($orderBy as $key => $sort) {
$qb->addOrderBy('ew.' . $key, $sort);
}
$qb->setMaxResults($limit)->setFirstResult($offset);
return $qb->getQuery()->getResult();
}
public function findByPreviousTransitionned(User $user, ?array $orderBy = null, $limit = null, $offset = null): array
{
$qb = $this->buildQueryByPreviousTransitionned($user)->select('ew')->distinct(true);
foreach ($orderBy as $key => $sort) {
$qb->addOrderBy('ew.' . $key, $sort);
}
$qb->setMaxResults($limit)->setFirstResult($offset);
return $qb->getQuery()->getResult();
}
public function findBySubscriber(User $user, ?array $orderBy = null, $limit = null, $offset = null): array
{
$qb = $this->buildQueryBySubscriber($user)->select('ew');
@ -120,6 +160,41 @@ class EntityWorkflowRepository implements ObjectRepository
return $qb;
}
private function buildQueryByPreviousDestWithoutReaction(User $user): QueryBuilder
{
$qb = $this->repository->createQueryBuilder('ew');
$qb->join('ew.steps', 'step');
$qb->where(
$qb->expr()->andX(
$qb->expr()->isMemberOf(':user', 'step.destUser'),
$qb->expr()->neq('step.transitionBy', ':user'),
)
);
$qb->setParameter('user', $user);
return $qb;
}
private function buildQueryByPreviousTransitionned(User $user): QueryBuilder
{
$qb = $this->repository->createQueryBuilder('ew');
$qb->join('ew.steps', 'step');
$qb->where(
$qb->expr()->andX(
$qb->expr()->eq('step.transitionBy', ':user'),
)
);
$qb->setParameter('user', $user);
return $qb;
}
private function buildQueryBySubscriber(User $user): QueryBuilder
{
$qb = $this->repository->createQueryBuilder('ew');

View File

@ -72,7 +72,7 @@ section.chill-entity {
}
}
p {
display: inline-block;
// display: inline-block;
margin: 0 0 0 1.5em;
text-indent: -1.5em;

View File

@ -50,7 +50,7 @@ var handleAdd = function(button) {
empty_explain = collection.querySelector('li[data-collection-empty-explain]'),
entry = document.createElement('li'),
event = new CustomEvent('collection-add-entry', { detail: { collection: collection, entry: entry } }),
counter = collection.childNodes.length,
counter = collection.childNodes.length + parseInt(Math.random() * 1000000)
content
;
content = prototype.replace(new RegExp('__name__', 'g'), counter);

View File

@ -1,10 +1,15 @@
.confidential{
display: flex;
position: relative;
}
.toggle{
margin-left: 30px;
margin-top: 5px;
cursor: pointer;
position: absolute;
bottom: 0px;
right: 10px;
z-index: 5;
}
.blur {
-webkit-filter: blur(5px);

View File

@ -3,7 +3,7 @@ import {ShowHide} from 'ChillMainAssets/lib/show_hide/show_hide.js';
window.addEventListener('DOMContentLoaded', function() {
let
divTransitions = document.querySelector('#transitions'),
futureDestUsersContainer = document.querySelector('#futureDestUsers')
futureDestUsersContainer = document.querySelector('#futureDests')
;
if (null !== divTransitions) {
@ -67,24 +67,4 @@ window.addEventListener('DOMContentLoaded', function() {
});
}
// validate form
let form = document.querySelector('form[name="workflow_step"]');
if (form === null) {
console.error('form to validate not found');
}
form.addEventListener('submit', function (event) {
const datas = new FormData(event.target);
if (datas.has('workflow_step[future_dest_users]')) {
const dests = JSON.parse(datas.get('workflow_step[future_dest_users]'));
if (dests === null || (dests instanceof Array && dests.length === 0)) {
event.preventDefault();
console.log('no users!');
window.alert('Indiquez un utilisateur pour traiter la prochaine étape.');
}
}
});
});

View File

@ -260,8 +260,7 @@ export default {
editPane: false,
datePane: false,
loading: false,
success: false,
dirty: false
success: false
},
errors: [],
defaultz: {
@ -537,17 +536,19 @@ export default {
checkErrors() {
this.errors = [];
if (this.flag.dirty) {
if (this.entity.selected.country === null) {
this.errors.push("Un pays doit être sélectionné.");
}
if (this.entity.selected.country === null) {
this.errors.push("Un pays doit être sélectionné.");
}
if (this.entity.selected.city === null) {
this.errors.push("Une ville doit être sélectionnée.");
} else {
if (Object.keys(this.entity.selected.city).length === 0) {
this.errors.push("Une ville doit être sélectionnée.");
}
if (!this.entity.selected.isNoAddress) {
if (this.entity.selected.address.street === null || this.entity.selected.address.streetNumber === null) {
this.errors.push("Une adresse doit être sélectionnée.");
}
}
if (!this.entity.selected.isNoAddress) {
if (this.entity.selected.address.street === null || this.entity.selected.address.street === '' || this.entity.selected.address.streetNumber === null || this.entity.selected.address.streetNumber === '') {
this.errors.push("Une adresse doit être sélectionnée.");
}
}
},
@ -567,7 +568,7 @@ export default {
this.entity.selected.country = this.context.edit ? this.entity.address.country : {};
this.entity.selected.postcode = this.context.edit ? this.entity.address.postcode : {};
this.entity.selected.city = {};
this.entity.selected.city = this.context.edit ? this.entity.address.postcode : {};
this.entity.selected.address = {};
this.entity.selected.address.street = this.context.edit ? this.entity.address.street: null;
@ -583,6 +584,8 @@ export default {
this.entity.selected.writeNew.address = this.context.edit && this.entity.address.addressReference === null && this.entity.address.street.length > 0
this.entity.selected.writeNew.postcode = false // NB: this used to be this.context.edit, but think it was erroneous;
console.log('!! just set writeNew.postcode to', this.entity.selected.writeNew.postcode);
this.checkErrors();
},
/*

View File

@ -111,11 +111,9 @@ export default {
this.entity.selected.address.streetNumber = value.streetNumber;
this.entity.selected.writeNew.address = false;
this.updateMapCenter(value.point);
this.flag.dirty = true;
this.checkErrors();
},
remove() {
this.flag.dirty = true;
this.entity.selected.address = {};
this.checkErrors();
},
@ -158,7 +156,6 @@ export default {
this.entity.selected.address.street = addr.street;
this.entity.selected.address.streetNumber = addr.number;
this.entity.selected.writeNew.address = true;
this.flag.dirty = true;
this.checkErrors();
}
},

View File

@ -125,11 +125,9 @@ export default {
if (value.center) {
this.updateMapCenter(value.center);
}
this.flag.dirty = true;
this.checkErrors();
},
remove() {
this.flag.dirty = true;
this.entity.selected.city = {};
this.checkErrors();
},

View File

@ -51,7 +51,6 @@ export default {
init() {
if (this.value !== undefined) {
this.selectCountry(this.value);
this.flag.dirty = false;
}
},
selectCountryByCode(countryCode) {
@ -67,7 +66,6 @@ export default {
this.checkErrors();
},
remove() {
this.flag.dirty = true;
this.entity.selected.country = null;
this.checkErrors();
},

View File

@ -157,6 +157,7 @@ export default {
set(value) {
console.log('isNoAddress value', value);
this.entity.selected.isNoAddress = value;
this.checkErrors();
},
get() {
return this.entity.selected.isNoAddress;

View File

@ -1,7 +1,7 @@
<template>
<h2>{{ $t('main_title') }}</h2>
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link"
@ -23,7 +23,6 @@
:class="{'active': activeTab === 'MyAccompanyingCourses'}"
@click="selectTab('MyAccompanyingCourses')">
{{ $t('my_accompanying_courses.tab') }}
<tab-counter :count="state.accompanyingCourses.count"></tab-counter>
</a>
</li>
<li class="nav-item">
@ -51,11 +50,19 @@
<tab-counter :count="state.tasks.alert.count"></tab-counter>
</a>
</li>
<li class="nav-item">
<a class="nav-link"
:class="{'active': activeTab === 'MyWorkflows'}"
@click="selectTab('MyWorkflows')">
{{ $t('my_workflows.tab') }}
<tab-counter :count="state.workflows.count"></tab-counter>
</a>
</li>
<li class="nav-item loading ms-auto py-2" v-if="loading">
<i class="fa fa-circle-o-notch fa-spin fa-lg text-chill-gray" :title="$t('loading')"></i>
</li>
</ul>
<div class="my-4">
<my-customs
v-if="activeTab === 'MyCustoms'">
@ -75,6 +82,9 @@
<my-notifications
v-else-if="activeTab === 'MyNotifications'">
</my-notifications>
<my-workflows
v-else-if="activeTab === 'MyWorkflows'">
</my-workflows>
</div>
</template>
@ -85,6 +95,7 @@ import MyEvaluations from './MyEvaluations';
import MyTasks from './MyTasks';
import MyAccompanyingCourses from './MyAccompanyingCourses';
import MyNotifications from './MyNotifications';
import MyWorkflows from './MyWorkflows.vue';
import TabCounter from './TabCounter';
import { mapState } from "vuex";
@ -95,6 +106,7 @@ export default {
MyWorks,
MyEvaluations,
MyTasks,
MyWorkflows,
MyAccompanyingCourses,
MyNotifications,
TabCounter,
@ -126,6 +138,7 @@ export default {
'MyWorks',
'MyEvaluations',
'MyTasks',
'MyWorkflows',
]) {
this.$store.dispatch('getByTab', { tab: m, param: "countOnly=1" });
}

View File

@ -66,6 +66,8 @@ export default {
return appMessages.fr.the_activity;
case 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod':
return appMessages.fr.the_course;
case 'Chill\\MainBundle\\Entity\\Workflow\\EntityWorkflow':
return appMessages.fr.the_workflow;
default:
throw 'notification type unknown';
}
@ -76,6 +78,8 @@ export default {
return `/fr/activity/${n.relatedEntityId}/show`
case 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod':
return `/fr/parcours/${n.relatedEntityId}`
case 'Chill\\MainBundle\\Entity\\Workflow\\EntityWorkflow':
return `/fr/main/workflow/${n.relatedEntityId}/show`
default:
throw 'notification type unknown';
}

View File

@ -0,0 +1,88 @@
<template>
<div class="alert alert-light">{{ $t('my_workflows.description') }}</div>
<span v-if="noResults" class="chill-no-data-statement">{{ $t('no_data') }}</span>
<tab-table v-else>
<template v-slot:thead>
<th scope="col">{{ $t('Object_workflow') }}</th>
<th scope="col">{{ $t('Step') }}</th>
<th scope="col">{{ $t('concerned_users') }}</th>
<th scope="col"></th>
</template>
<template v-slot:tbody>
<tr v-for="(w, i) in workflows.results" :key="`workflow-${i}`">
<td>{{ w.title }}</td>
<td>
<div class="workflow">
<div class="breadcrumb">
<i class="fa fa-circle me-1 text-chill-yellow mx-2"></i>
<span class="mx-2">{{ getStep(w) }}</span>
</div>
</div>
</td>
<td v-if="w.datas.persons !== null">
<span v-for="p in w.datas.persons" class="me-1" :key="p.id">
<on-the-fly
:type="p.type"
:id="p.id"
:buttonText="p.textAge"
:displayBadge="'true' === 'true'"
action="show">
</on-the-fly>
</span>
</td>
<td>
<a class="btn btn-sm btn-show" :href="getUrl(w)">
{{ $t('show_entity', { entity: $t('the_workflow') }) }}
</a>
</td>
</tr>
</template>
</tab-table>
</template>
<script>
import { mapState, mapGetters } from "vuex";
import TabTable from "./TabTable";
import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly';
export default {
name: "MyWorkflows",
components: {
TabTable,
OnTheFly
},
computed: {
...mapState([
'workflows',
]),
...mapGetters([
'isWorkflowsLoaded',
]),
noResults() {
if (!this.isWorkflowsLoaded) {
return false;
} else {
return this.workflows.count === 0;
}
},
},
methods: {
getUrl(w) {
return `/fr/main/workflow/${w.id}/show`;
},
getStep(w) {
const lastStep = w.steps.length - 1
return w.steps[lastStep].currentStep.text;
}
},
}
</script>
<style scoped>
span.outdated {
font-weight: bold;
color: var(--bs-warning);
}
</style>

View File

@ -22,6 +22,10 @@ const appMessages = {
tab: "Mes notifications",
description: "Liste des notifications reçues et non lues.",
},
my_workflows: {
tab: "Mes workflows",
description: "Liste des workflows en attente d'une action."
},
opening_date: "Date d'ouverture",
social_issues: "Problématiques sociales",
concerned_persons: "Usagers concernés",
@ -33,12 +37,16 @@ const appMessages = {
From: "Expéditeur",
Subject: "Objet",
Entity: "Associé à",
Step: "Étape",
concerned_users: "Usagers concernés",
Object_workflow: "Objet du workflow",
show_entity: "Voir {entity}",
the_activity: "l'échange",
the_course: "le parcours",
the_action: "l'action",
the_evaluation: "l'évaluation",
the_task: "la tâche",
the_workflow: "le workflow",
StartDate: "Date d'ouverture",
SocialAction: "Action d'accompagnement",
no_data: "Aucun résultats",
@ -61,4 +69,4 @@ Object.assign(appMessages.fr);
export {
appMessages
};
};

View File

@ -1,12 +1,6 @@
import 'es6-promise/auto';
import { createStore } from 'vuex';
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
import MyCustoms from "../MyCustoms";
import MyWorks from "../MyWorks";
import MyEvaluations from "../MyEvaluations";
import MyTasks from "../MyTasks";
import MyAccompanyingCourses from "../MyAccompanyingCourses";
import MyNotifications from "../MyNotifications";
const debug = process.env.NODE_ENV !== 'production';
@ -27,6 +21,7 @@ const store = createStore({
},
accompanyingCourses: {},
notifications: {},
workflows: {},
errorMsg: [],
loading: false
},
@ -49,6 +44,9 @@ const store = createStore({
isNotificationsLoaded(state) {
return !isEmpty(state.notifications);
},
isWorkflowsLoaded(state) {
return !isEmpty(state.workflows);
},
counter(state) {
return {
works: state.works.count,
@ -57,6 +55,7 @@ const store = createStore({
tasksAlert: state.tasks.alert.count,
accompanyingCourses: state.accompanyingCourses.count,
notifications: state.notifications.count,
workflows: state.workflows.count
}
}
},
@ -85,6 +84,9 @@ const store = createStore({
//console.log('addNotifications', notifications);
state.notifications = notifications;
},
addWorkflows(state, workflows) {
state.workflows = workflows;
},
setLoading(state, bool) {
state.loading = bool;
},
@ -180,14 +182,30 @@ const store = createStore({
const url = `/api/1.0/main/notification/my/unread${'?'+ param}`;
makeFetch('GET', url)
.then((response) => {
console.log('notifications', response)
commit('addNotifications', response);
commit('setLoading', false);
})
.catch((error) => {
commit('catchError', error);
throw error;
})
;
});
}
break;
case 'MyWorkflows':
if (!getters.isWorflowsLoaded) {
commit('setLoading', true);
const url = '/api/1.0/main/workflow/my';
makeFetch('GET', url)
.then((response) => {
console.log('workflows', response)
commit('addWorkflows', response);
commit('setLoading', false);
})
.catch((error) => {
commit('catchError', error);
throw error;
});
}
break;
default:

View File

@ -1,6 +1,6 @@
<template>
<ul class="nav nav-tabs">
<li class="nav-item">
<li v-if="allowedTypes.includes('person')" class="nav-item">
<a class="nav-link" :class="{ active: isActive('person') }">
<label for="person">
<input type="radio" name="person" id="person" v-model="radioType" value="person">
@ -8,7 +8,7 @@
</label>
</a>
</li>
<li class="nav-item">
<li v-if="allowedTypes.includes('thirdparty')" class="nav-item">
<a class="nav-link" :class="{ active: isActive('thirdparty') }">
<label for="thirdparty">
<input type="radio" name="thirdparty" id="thirdparty" v-model="radioType" value="thirdparty">
@ -21,14 +21,16 @@
<div class="my-4">
<on-the-fly-person
v-if="type === 'person'"
v-bind:action="action"
:action="action"
:query="query"
ref="castPerson"
>
</on-the-fly-person>
<on-the-fly-thirdparty
v-if="type === 'thirdparty'"
v-bind:action="action"
:action="action"
:query="query"
ref="castThirdparty"
>
</on-the-fly-thirdparty>
@ -38,18 +40,17 @@
<script>
import OnTheFlyPerson from 'ChillPersonAssets/vuejs/_components/OnTheFly/Person.vue';
import OnTheFlyThirdparty from 'ChillThirdPartyAssets/vuejs/_components/OnTheFly/ThirdParty.vue';
import { postPerson } from "ChillPersonAssets/vuejs/_api/OnTheFly";
export default {
name: "OnTheFlyCreate",
props: ['action'],
props: ['action', 'allowedTypes', 'query'],
components: {
OnTheFlyPerson,
OnTheFlyThirdparty
},
data() {
return {
type: 'person' //by default
type: null
}
},
computed: {
@ -61,7 +62,10 @@ export default {
get() {
return this.type;
}
}
},
},
mounted() {
this.type = (this.allowedTypes.length === 1 && this.allowedTypes.includes('thirdparty')) ? 'thirdparty' : 'person'
},
methods: {
isActive(tab) {
@ -73,8 +77,7 @@ export default {
return this.$refs.castPerson.$data.person;
case 'thirdparty':
let data = this.$refs.castThirdparty.$data.thirdparty;
data.name = data.text;
if (data.address !== undefined) {
if (data.address !== undefined && data.address !== null) {
data.address = { id: data.address.address_id }
} else {
data.address = null;

View File

@ -1,11 +1,11 @@
<template>
<a v-if="isDisplayBadge" @click="openModal">
<span class="chill-entity" :class="badgeType">
{{ buttonText }}<span v-if="isDead"> ()</span>
</span>
</a>
<a v-else class="btn btn-sm" target="_blank"
<a v-if="isDisplayBadge" @click="openModal">
<span class="chill-entity" :class="badgeType">
{{ buttonText }}<span v-if="isDead"> ()</span>
</span>
</a>
<a v-else class="btn btn-sm" target="_blank"
:class="classAction"
:title="$t(titleAction)"
@click="openModal">
@ -18,7 +18,8 @@
@close="modal.showModal = false">
<template v-slot:header>
<h3 class="modal-title">{{ $t(titleModal) }}</h3>
<h3 v-if="parent" class="modal-title">{{ $t(titleModal, {q: parent.text}) }}</h3>
<h3 v-else class="modal-title">{{ $t(titleModal) }}</h3>
</template>
<template v-slot:body v-if="type === 'person'">
@ -29,10 +30,10 @@
ref="castPerson">
</on-the-fly-person>
<div v-if="hasResourceComment">
<h3>{{ $t('onthefly.resource_comment_title') }}</h3>
<blockquote class="chill-user-quote">
{{ parent.comment }}
</blockquote>
<h3>{{ $t('onthefly.resource_comment_title') }}</h3>
<blockquote class="chill-user-quote">
{{ parent.comment }}
</blockquote>
</div>
</template>
@ -44,16 +45,27 @@
ref="castThirdparty">
</on-the-fly-thirdparty>
<div v-if="hasResourceComment">
<h3>{{ $t('onthefly.resource_comment_title') }}</h3>
<blockquote class="chill-user-quote">
{{ parent.comment }}
</blockquote>
<h3>{{ $t('onthefly.resource_comment_title') }}</h3>
<blockquote class="chill-user-quote">
{{ parent.comment }}
</blockquote>
</div>
</template>
<template v-slot:body v-else-if="parent">
<on-the-fly-thirdparty
:parent="parent"
:action="action"
type="thirdparty"
ref="castThirdparty">
</on-the-fly-thirdparty>
</template>
<template v-slot:body v-else>
<on-the-fly-create
:action="action"
:allowedTypes="allowedTypes"
:query="query"
ref="castNew">
</on-the-fly-create>
</template>
@ -81,6 +93,7 @@ import Modal from 'ChillMainAssets/vuejs/_components/Modal.vue';
import OnTheFlyCreate from './Create.vue';
import OnTheFlyPerson from 'ChillPersonAssets/vuejs/_components/OnTheFly/Person.vue';
import OnTheFlyThirdparty from 'ChillThirdPartyAssets/vuejs/_components/OnTheFly/ThirdParty.vue';
import { postThirdparty } from "ChillThirdPartyAssets/vuejs/_api/OnTheFly";
export default {
name: 'OnTheFly',
@ -90,7 +103,7 @@ export default {
OnTheFlyThirdparty,
OnTheFlyCreate
},
props: ['type', 'id', 'action', 'buttonText', 'displayBadge', 'isDead', 'parent'],
props: ['type', 'id', 'action', 'buttonText', 'displayBadge', 'isDead', 'parent', 'allowedTypes', 'query'],
emits: ['saveFormOnTheFly'],
data() {
return {
@ -102,12 +115,11 @@ export default {
},
computed: {
hasResourceComment() {
//console.log('hasResourceComment', this.parent);
return (typeof this.parent !== 'undefined' && this.parent !== null)
&& this.action === 'show'
&& this.parent.type === 'accompanying_period_resource'
&& (this.parent.comment !== null && this.parent.comment !== '')
;
return (typeof this.parent !== 'undefined' && this.parent !== null)
&& this.action === 'show'
&& this.parent.type === 'accompanying_period_resource'
&& (this.parent.comment !== null && this.parent.comment !== '')
;
},
classAction() {
switch (this.action) {
@ -117,6 +129,8 @@ export default {
return 'btn-update';
case 'create':
return 'btn-create';
case 'addContact':
return 'btn-tpchild';
}
},
titleAction() {
@ -127,8 +141,17 @@ export default {
return 'action.edit';
case 'create':
return 'action.create';
case 'addContact':
return 'action.addContact';
}
},
titleCreate() {
return this.allowedTypes.every(t => t === 'person')
? 'onthefly.create.title.person'
: this.allowedTypes.every(t => t === 'thirdparty')
? 'onthefly.create.title.thirdparty'
: 'onthefly.create.title.default'
},
titleModal() {
switch (this.action) {
case 'show':
@ -136,7 +159,9 @@ export default {
case 'edit':
return 'onthefly.edit.' + this.type;
case 'create':
return 'onthefly.create.title';
return this.titleCreate;
case 'addContact':
return 'onthefly.addContact.title';
}
},
titleMessage() {
@ -170,8 +195,8 @@ export default {
this.modal.showModal = false;
},
openModal() {
//console.log('## OPEN ON THE FLY MODAL');
//console.log('## type:', this.type, ', action:', this.action);
// console.log('## OPEN ON THE FLY MODAL');
// console.log('## type:', this.type, ', action:', this.action);
this.modal.showModal = true;
this.$nextTick(function() {
//this.$refs.search.focus();
@ -181,7 +206,7 @@ export default {
this.$data.action = action;
},
saveAction() {
console.log('saveAction button: create/edit action with', this.type);
// console.log('saveAction button: create/edit action with', this.type);
let
type = this.type,
data = {} ;
@ -193,17 +218,28 @@ export default {
case 'thirdparty':
data = this.$refs.castThirdparty.$data.thirdparty;
/* never executed ? */
break;
default:
if (typeof this.type === 'undefined') { // action=create
type = this.$refs.castNew.radioType;
data = this.$refs.castNew.castDataByType();
if (typeof this.type === 'undefined') { // action=create or addContact
console.log('will rewrite data');
if (this.action === 'addContact') {
type = 'thirdparty'
data = this.$refs.castThirdparty.$data.thirdparty;
console.log('data original', data);
data.parent = {type: "thirdparty", id: this.parent.id};
} else {
type = this.$refs.castNew.radioType;
data = this.$refs.castNew.castDataByType();
console.log(data)
}
} else {
throw 'error with object type';
}
}
console.log('type', type);
console.log('data', data);
// pass datas to parent
this.$emit('saveFormOnTheFly', { type: type, data: data });
},
@ -223,4 +259,8 @@ export default {
a {
cursor: pointer;
}
/* .btn-add-contact {
background-color: pink;
} */
</style>

View File

@ -9,15 +9,25 @@ const ontheflyMessages = {
},
edit: {
person: "Modifier un usager",
thirdparty: "Modifier un tiers"
thirdparty: "Modifier un tiers",
},
create: {
button: "Créer \"{q}\"",
title: "Création d'un nouvel usager ou d'un tiers professionnel",
title: {
default: "Création d'un nouvel usager ou d'un tiers professionnel",
person: "Création d'un nouvel usager",
thirdparty: "Création d'un nouveau tiers professionnel",
},
person: "un nouvel usager",
thirdparty: "un nouveau tiers professionnel"
},
resource_comment_title: "Un commentaire est associé à cet interlocuteur"
addContact: {
title: "Créer un contact pour {q}"
},
resource_comment_title: "Un commentaire est associé à cet interlocuteur",
addContact: {
title: "Créer un contact pour {q}"
}
}
}
}

View File

@ -1,6 +1,6 @@
<template>
<div :class="classes">
<div class="confidential-content" :class="{ 'blur': isBlurred }">
<div class="confidential">
<div :class="{ 'blur': isBlurred }">
<slot name="confidential-content"></slot>
</div>
<div>
@ -29,18 +29,5 @@ export default {
<style scoped lang='scss'>
.confidential{
align-items: center;
display: flex;
}
.toggle{
margin-top: 28px;
cursor: pointer;
display: block;
float: right;
margin-right: 20px;
}
.blur {
-webkit-filter: blur(5px);
-moz-filter: blur(5px);
filter: blur(5px);
}
</style>

View File

@ -27,7 +27,6 @@
</p>
</div>
</template>
</confidential>
</div>
@ -94,6 +93,7 @@ export default {
return this.isMultiline === true ? "multiline" : "";
},
isConfidential() {
console.log(this.address.confidential)
return this.address.confidential;
}
}

View File

@ -5,7 +5,7 @@
<div>
<div class="item-row col">
<h2>Workflow</h2>
<h2>{{ w.title }}</h2>
<div class="flex-grow-1 ms-3 h3">
<div class="visually-hidden">
{{ w.relatedEntityClass }}

View File

@ -12,6 +12,8 @@
:relatedEntityClass="this.relatedEntityClass"
:relatedEntityId="this.relatedEntityId"
:workflowsAvailables="workflowsAvailables"
:preventDefaultMoveToGenerate="this.$props.preventDefaultMoveToGenerate"
:goToGenerateWorkflowPayload="this.goToGenerateWorkflowPayload"
@go-to-generate-workflow="goToGenerateWorkflow"
></pick-workflow>
@ -36,6 +38,7 @@
:relatedEntityId="this.relatedEntityId"
:workflowsAvailables="workflowsAvailables"
:preventDefaultMoveToGenerate="this.$props.preventDefaultMoveToGenerate"
:goToGenerateWorkflowPayload="this.goToGenerateWorkflowPayload"
@go-to-generate-workflow="this.goToGenerateWorkflow"
></pick-workflow>
</template>
@ -83,6 +86,10 @@ export default {
required: false,
default: false,
},
goToGenerateWorkflowPayload: {
required: false,
default: {}
},
},
data() {
return {
@ -105,7 +112,7 @@ export default {
this.modal.showModal = true;
},
goToGenerateWorkflow(data) {
console.log('go to generate workflow intercepted');
console.log('go to generate workflow intercepted', data);
this.$emit('goToGenerateWorkflow', data);
}
},

View File

@ -37,6 +37,10 @@ export default {
required: false,
default: false,
},
goToGenerateWorkflowPayload: {
required: false,
default: {}
},
},
emits: ['goToGenerateWorkflow'],
methods: {
@ -51,7 +55,7 @@ export default {
window.location.assign(this.makeLink(workflowName));
}
this.$emit('goToGenerateWorkflow', {event, workflowName, link: this.makeLink(workflowName)});
this.$emit('goToGenerateWorkflow', {event, workflowName, link: this.makeLink(workflowName), payload: this.goToGenerateWorkflowPayload});
}
}
}

View File

@ -46,7 +46,8 @@ const messages = {
person: "Quitter la page et ouvrir la fiche de l'usager",
thirdparty: "Quitter la page et voir le tiers",
},
refresh: 'Rafraîchir'
refresh: 'Rafraîchir',
addContact: 'Ajouter un contact'
},
nav: {
next: "Suivant",

View File

@ -3,6 +3,8 @@
{% if transition_form is not null %}
{{ form_start(transition_form) }}
{{ form_errors(transition_form) }}
{% set step = entity_workflow.currentStepChained %}
{% set labels = workflow_metadata(entity_workflow, 'label', step.currentStep) %}
{% set label = labels is null ? step.currentStep : labels|localize_translatable_string %}
@ -60,8 +62,10 @@
{{ form_row(transition_form.freezeAfter) }}
{% endif %}
<div id="futureDestUsers">
<div id="futureDests">
{{ form_row(transition_form.future_dest_users) }}
{{ form_row(transition_form.future_dest_emails) }}
</div>
<p>{{ form_label(transition_form.comment) }}</p>
@ -82,13 +86,23 @@
<p>{{ 'workflow.This workflow is finalized'|trans }}</p>
{% else %}
<p>{{ 'workflow.You are not allowed to apply a transition on this workflow'|trans }}</p>
<p>{{ 'workflow.Only those users are allowed'|trans }}:</p>
{% if entity_workflow.currentStep.destUser|length > 0 %}
<p><b>{{ 'workflow.Only those users are allowed'|trans }}&nbsp;:</b></p>
<ul>
{% for u in entity_workflow.currentStep.destUser -%}
<li>{{ u|chill_entity_render_box }}</li>
{%- endfor %}
</ul>
{% endif %}
<ul>
{% for u in entity_workflow.currentStep.destUser -%}
<li>{{ u|chill_entity_render_box }}</li>
{%- endfor %}
</ul>
{% if entity_workflow.currentStep.destUserByAccessKey|length > 0 %}
<p><b>{{ 'workflow.Those users are also granted to apply a transition by using an access key'|trans }}&nbsp;:</b></p>
<ul>
{% for u in entity_workflow.currentStep.destUserByAccessKey %}
<li>{{ u|chill_entity_render_box }}</li>
{% endfor %}
</ul>
{% endif %}
{% endif %}
</div>

View File

@ -7,7 +7,7 @@
<div data-list-workflows="1"
data-workflows="{{ entity_workflows_json|json_encode|e('html_attr') }}"
data-allow-create="{{ acl }}"
data-related-entity-class="{{ blank_workflow.relatedEntityClass }}"
data-related-entity-id="{{ blank_workflow.relatedEntityId }}"
data-workflows-availables="{{ workflows_availables|json_encode()|e('html_attr') }}"
data-related-entity-class="{{ relatedEntityClass }}"
data-related-entity-id="{{ relatedEntityId }}"
data-workflows-availables="{{ workflows_available|json_encode()|e('html_attr') }}"
></div>

View File

@ -69,15 +69,26 @@
</blockquote>
</div>
{% endif %}
{% if loop.last and step.destUser|length > 0 %}
{% if loop.last and step.allDestUser|length > 0 %}
<div class="item-row separator">
<div>
<p><b>{{ 'workflow.Users allowed to apply transition'|trans }}&nbsp;: </b></p>
<ul>
{% for u in step.destUser %}
<li>{{ u|chill_entity_render_box }}</li>
{% endfor %}
</ul>
{% if step.destUser|length > 0 %}
<p><b>{{ 'workflow.Users allowed to apply transition'|trans }}&nbsp;: </b></p>
<ul>
{% for u in step.destUser %}
<li>{{ u|chill_entity_render_box }}</li>
{% endfor %}
</ul>
{% endif %}
{% if step.destUserByAccessKey|length > 0 %}
<p><b>{{ 'workflow.Those users are also granted to apply a transition by using an access key'|trans }}&nbsp;:</b></p>
<ul>
{% for u in step.destUserByAccessKey %}
<li>{{ u|chill_entity_render_box }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
</div>
{% endif %}

View File

@ -0,0 +1,29 @@
{% extends '@ChillMain/layout.html.twig' %}
{% block title 'workflow.Delete workflow ?'|trans %}
{% block display_content %}
<h2>
{{ handler.entityTitle(entityWorkflow) }}
</h2>
{% include handler.template(entityWorkflow) with handler.templateData(entityWorkflow)|merge({
'display_action': false
}) %}
{% endblock %}
{% block content %}
<div class="container chill-md-10">
{{ include('@ChillMain/Util/confirmation_template.html.twig',
{
'title' : 'workflow.Delete workflow ?'|trans,
'confirm_question' : 'workflow.Are you sure you want to delete this workflow ?'|trans,
'display_content' : block('display_content'),
'cancel_route' : 'chill_main_workflow_show',
'cancel_parameters' : {'id' : entityWorkflow.id},
'form' : delete_form
} ) }}
</div>
{% endblock %}

View File

@ -21,10 +21,12 @@
{{ encore_entry_link_tags('mod_wopi_link') }}
{% endblock %}
{% import '@ChillMain/Workflow/macro_breadcrumb.html.twig' as macro %}
{% block content %}
<div class="col-10 workflow">
<h1 class="mb-5">{{ block('title') }}</h1>
{# handler_template:
- src/Bundle/ChillPersonBundle/Resources/views/Workflow/_evaluation.html.twig
- src/Bundle/ChillPersonBundle/Resources/views/Workflow/_accompanying_period_work.html.twig
@ -32,11 +34,26 @@
#}
<section class="step my-4">
<div class="mb-5">
{% include handler_template_title with handler_template_data|merge({'breadcrumb': true }) %}
<h2>{{ handler.entityTitle(entity_workflow) }}</h2>
{{ macro.breadcrumb({'entity_workflow': entity_workflow}) }}
</div>
{% include handler_template with handler_template_data|merge({'display_action': true }) %}
{% if is_granted('CHILL_MAIN_WORKFLOW_DELETE', entity_workflow) %}
<ul class="record_actions">
<li>
<a class="btn btn-delete"
href="{{ chill_path_add_return_path('chill_main_workflow_delete', {'id': entity_workflow.id}) }}"
>
{{ 'workflow.Delete workflow'|trans }}
</a>
</li>
</ul>
{% endif %}
</section>
<section class="step my-4">{% include '@ChillMain/Workflow/_follow.html.twig' %}</section>
<section class="step my-4">{% include '@ChillMain/Workflow/_decision.html.twig' %}</section>{#
<section class="step my-4">{% include '@ChillMain/Workflow/_comment.html.twig' %}</section> #}

View File

@ -8,9 +8,10 @@
{% block content %}
<div class="col-10 workflow">
<h1 class="mb-5">{{ block('title') }}</h1>
<ul class="nav nav-pills justify-content-center">
<li class="nav-item">
<a href="{{ path('chill_main_workflow_list_subscribed') }}"
@ -24,8 +25,24 @@
{{ 'workflow.dest'|trans }}
</a>
</li>
<li class="nav-item">
<a href="{{ path('chill_main_workflow_list_previous_without_reaction') }}"
class="nav-link {% if step == 'previous_without_reaction' %}active{% endif %}">
{{ 'workflow.Previous dest without reaction'|trans }}
</a>
</li>
<li class="nav-item">
<a href="{{ path('chill_main_workflow_list_previous_transitionned') }}"
class="nav-link {% if step == 'previous_transitionned' %}active{% endif %}">
{{ 'workflow.Previous transitionned'|trans }}
</a>
</li>
</ul>
{% if help is defined %}
<p style="margin-top: 2rem;">{{ help|trans }}</p>
{% endif %}
{% if workflows|length == 0 %}
<p class="chill-no-data-statement">{{ 'workflow.No workflow'|trans }}</p>
{% else %}
@ -36,26 +53,24 @@
<button type="button" class="accordion-button collapsed"
data-bs-toggle="collapse" data-bs-target="#flush-collapse-{{ l.entity_workflow.id }}"
aria-expanded="false" aria-controls="flush-collapse-{{ l.entity_workflow.id }}">
<div class="item-row col">
<h2>
{{ 'workflow_'|trans }}
{{ l.handler.entityTitle(l.entity_workflow) }}
</h2>
{% include l.handler.templateTitle(l.entity_workflow) with l.handler.templateTitleData(l.entity_workflow)|merge({
'description': true,
'add_classes': 'ms-3 h3'
}) %}
</div>
</button>
{{ macro.breadcrumb(l) }}
<div>
{{ macro.breadcrumb(l) }}
</div>
</div>
<div id="flush-collapse-{{ l.entity_workflow.id }}"
class="accordion-collapse collapse"
aria-labelledby="flush-heading-{{ l.entity_workflow.id }}"
data-bs-parent="#workflow-fold">
<div class="item-row flex-column">
{% include l.handler.template(l.entity_workflow) with l.handler.templateData(l.entity_workflow)|merge({
'display_action': false
@ -78,6 +93,13 @@
</div>
<div class="item-col">
<ul class="record_actions">
{% if is_granted('CHILL_MAIN_WORKFLOW_DELETE', l.entity_workflow) %}
<li>
<a class="btn btn-delete"
href="{{ chill_path_add_return_path('chill_main_workflow_delete', {'id': l.entity_workflow.id}) }}"
></a>
</li>
{% endif %}
<li>
<a href="{{ path('chill_main_workflow_show', {'id': l.entity_workflow.id}) }}"
class="btn btn-show">
@ -87,7 +109,7 @@
</ul>
</div>
</div>
</div>
</div>
{% endfor %}

View File

@ -0,0 +1,15 @@
Madame, Monsieur,
Un suivi "{{ workflow.text }}" a atteint une nouvelle étape: {{ workflow.text }}.
Titre du workflow: "{{ entityTitle }}".
Vous êtes invité·e à valider cette étape. Pour obtenir un accès, vous pouvez cliquer sur le lien suivant:
{{ absolute_url(path('chill_main_workflow_grant_access_by_key', {'id': entity_workflow.currentStep.id, 'accessKey': entity_workflow.currentStep.accessKey})) }}
Dès que vous aurez cliqué une fois sur le lien, vous serez autorisé à valider cette étape.
Notez que vous devez disposer d'un compte utilisateur valide dans Chill.
Cordialement,

View File

@ -0,0 +1 @@
Un suivi {{ workflow.text }} demande votre attention: {{ entityTitle }}

View File

@ -15,7 +15,7 @@ use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Chill\MainBundle\Security\Authorization\ChillExportVoter;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
* Class SectionMenuBuilder.

View File

@ -15,7 +15,7 @@ use Knp\Menu\FactoryInterface;
use Knp\Menu\ItemInterface;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use function array_key_exists;
use function array_merge;

View File

@ -23,6 +23,8 @@ class EntityWorkflowVoter extends Voter
{
public const CREATE = 'CHILL_MAIN_WORKFLOW_CREATE';
public const DELETE = 'CHILL_MAIN_WORKFLOW_DELETE';
public const SEE = 'CHILL_MAIN_WORKFLOW_SEE';
private EntityWorkflowManager $manager;
@ -40,7 +42,11 @@ class EntityWorkflowVoter extends Voter
return $subject instanceof EntityWorkflow && in_array($attribute, self::getRoles(), true);
}
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
/**
* @param EntityWorkflow $subject
* @param mixed $attribute
*/
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
{
switch ($attribute) {
case self::CREATE:
@ -55,6 +61,9 @@ class EntityWorkflowVoter extends Voter
return $this->security->isGranted($entityAttribute, $handler->getRelatedEntity($subject));
case self::DELETE:
return $subject->getStep() === 'initial';
default:
throw new UnexpectedValueException("attribute {$attribute} not supported");
}
@ -65,6 +74,7 @@ class EntityWorkflowVoter extends Voter
return [
self::SEE,
self::CREATE,
self::DELETE,
];
}
}

View File

@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\Serializer\Normalizer;
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
use Chill\MainBundle\Workflow\EntityWorkflowManager;
use Chill\MainBundle\Workflow\Helper\MetadataExtractor;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
@ -22,12 +23,18 @@ class EntityWorkflowNormalizer implements NormalizerInterface, NormalizerAwareIn
{
use NormalizerAwareTrait;
private EntityWorkflowManager $entityWorkflowManager;
private MetadataExtractor $metadataExtractor;
private Registry $registry;
public function __construct(MetadataExtractor $metadataExtractor, Registry $registry)
{
public function __construct(
EntityWorkflowManager $entityWorkflowManager,
MetadataExtractor $metadataExtractor,
Registry $registry
) {
$this->entityWorkflowManager = $entityWorkflowManager;
$this->metadataExtractor = $metadataExtractor;
$this->registry = $registry;
}
@ -40,6 +47,7 @@ class EntityWorkflowNormalizer implements NormalizerInterface, NormalizerAwareIn
public function normalize($object, ?string $format = null, array $context = [])
{
$workflow = $this->registry->get($object, $object->getWorkflowName());
$handler = $this->entityWorkflowManager->getHandler($object);
return [
'type' => 'entity_workflow',
@ -49,6 +57,8 @@ class EntityWorkflowNormalizer implements NormalizerInterface, NormalizerAwareIn
'workflow' => $this->metadataExtractor->buildArrayPresentationForWorkflow($workflow),
'currentStep' => $this->normalizer->normalize($object->getCurrentStep(), $format, $context),
'steps' => $this->normalizer->normalize($object->getStepsChained(), $format, $context),
'datas' => $this->normalizer->normalize($handler->getEntityData($object), $format, $context),
'title' => $handler->getEntityTitle($object),
];
}

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