mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-14 18:54:59 +00:00
Compare commits
5 Commits
issue385_c
...
convert_to
Author | SHA1 | Date | |
---|---|---|---|
85e1754af0 | |||
e94bbc1271 | |||
fb9df1dba0 | |||
a579ff96a1 | |||
cb1002ca04 |
@@ -3,3 +3,4 @@
|
|||||||
# Run tests from root to adapt your own environment
|
# Run tests from root to adapt your own environment
|
||||||
KERNEL_CLASS='App\Kernel'
|
KERNEL_CLASS='App\Kernel'
|
||||||
APP_SECRET='$ecretf0rt3st'
|
APP_SECRET='$ecretf0rt3st'
|
||||||
|
DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres?serverVersion=12&charset=utf8
|
||||||
|
@@ -20,8 +20,6 @@ variables:
|
|||||||
# Configure postgres environment variables (https://hub.docker.com/r/_/postgres/)
|
# Configure postgres environment variables (https://hub.docker.com/r/_/postgres/)
|
||||||
POSTGRES_USER: postgres
|
POSTGRES_USER: postgres
|
||||||
POSTGRES_PASSWORD: postgres
|
POSTGRES_PASSWORD: postgres
|
||||||
# configure database access
|
|
||||||
DATABASE_URL: postgresql://postgres:postgres@db:5432/postgres?serverVersion=12&charset=utf8
|
|
||||||
# fetch the chill-app using git submodules
|
# fetch the chill-app using git submodules
|
||||||
GIT_SUBMODULE_STRATEGY: recursive
|
GIT_SUBMODULE_STRATEGY: recursive
|
||||||
REDIS_HOST: redis
|
REDIS_HOST: redis
|
||||||
@@ -62,7 +60,7 @@ code_style:
|
|||||||
- bin
|
- bin
|
||||||
- tests/app/vendor/
|
- tests/app/vendor/
|
||||||
|
|
||||||
phpstan_tests:
|
sa_tests:
|
||||||
stage: Tests
|
stage: Tests
|
||||||
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
||||||
script:
|
script:
|
||||||
@@ -73,17 +71,6 @@ phpstan_tests:
|
|||||||
- bin
|
- bin
|
||||||
- tests/app/vendor/
|
- tests/app/vendor/
|
||||||
|
|
||||||
psalm_tests:
|
|
||||||
stage: Tests
|
|
||||||
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
|
||||||
script:
|
|
||||||
- bin/grumphp run --tasks=psalm
|
|
||||||
artifacts:
|
|
||||||
expire_in: 30 min
|
|
||||||
paths:
|
|
||||||
- bin
|
|
||||||
- tests/app/vendor/
|
|
||||||
|
|
||||||
unit_tests:
|
unit_tests:
|
||||||
stage: Tests
|
stage: Tests
|
||||||
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
||||||
@@ -92,7 +79,7 @@ unit_tests:
|
|||||||
- php -d memory_limit=2G tests/app/bin/console cache:clear --env=dev
|
- php -d memory_limit=2G tests/app/bin/console cache:clear --env=dev
|
||||||
- php -d memory_limit=3G tests/app/bin/console doctrine:fixtures:load -n
|
- php -d memory_limit=3G tests/app/bin/console doctrine:fixtures:load -n
|
||||||
- php -d memory_limit=2G tests/app/bin/console cache:clear --env=test
|
- php -d memory_limit=2G tests/app/bin/console cache:clear --env=test
|
||||||
- php -d memory_limit=4G bin/phpunit --colors=never
|
- php -d memory_limit=3G bin/phpunit --colors=never
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 30 min
|
expire_in: 30 min
|
||||||
paths:
|
paths:
|
||||||
|
124
CHANGELOG.md
124
CHANGELOG.md
@@ -11,124 +11,10 @@ and this project adheres to
|
|||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
<!-- write down unreleased development here -->
|
<!-- write down unreleased development here -->
|
||||||
* [person] name suggestions within create person form when person is created departing from a search input (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/377)
|
|
||||||
* [parcours]: bug fix when comment is pinned all other comments remain in the collection (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/385)
|
|
||||||
|
|
||||||
## Test releases
|
|
||||||
|
|
||||||
### test release 2022-01-19
|
|
||||||
* vuejs: add dead information on all on-the-fly person render boxes, in vis graph and other templates (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/271)
|
|
||||||
* [thirdparty] fix bug in 3rd party view: types was replaced by thirdPartyTypes
|
|
||||||
* [main] location form type: fix unmapped address field (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/246)
|
|
||||||
* [activity] fix wrong import of js assets for adding and viewing documents in activity (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/83 & https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/176)
|
|
||||||
* [person]: space added between deathdate and age in twig renderbox (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/380)
|
|
||||||
|
|
||||||
### test release 2022-01-17
|
|
||||||
|
|
||||||
* [main] Add editableByUser field to locationType entity, adapt the admin template and add this condition in the location-type endpoint (see https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/297)
|
|
||||||
* [main] Add mainLocation field to User entity and add it in user form type
|
|
||||||
* rewrite page which allow to select activity
|
|
||||||
* [main] Add mainLocation field to User entity and add it in user form type
|
|
||||||
* [course list in person context] show full username/label for ref
|
|
||||||
* [accompanying period work] remove the possibility to generate document from an accompanying period work
|
|
||||||
|
|
||||||
## Test releases
|
|
||||||
* vuejs: add validation on required fields for AddPerson, Address and Location components
|
|
||||||
* vuejs: treat 422 validation errors in locations and AddPerson components
|
|
||||||
|
|
||||||
### test release 2022-01-12
|
|
||||||
|
|
||||||
* fix thirdparty normalizer on telephone field: https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/322
|
|
||||||
|
|
||||||
### test release 2022-01-11
|
|
||||||
|
|
||||||
* vuejs: translate in French all multiselect widgets
|
|
||||||
* [address] define address lines according postal standards for France and Belgium (default) and change AddressRender, chill_entity_render_box and AddressRenderBox.vue
|
|
||||||
* [household] change translations (champs-libres/departement-de-la-vendee/accent-suivi-developpement#109)
|
|
||||||
* [household] add address i18n in household component (champs-libres/departement-de-la-vendee/accent-suivi-developpement#158)
|
|
||||||
* [household] add on the fly i18n in household component
|
|
||||||
* [household] redirect to the household page when a household is created from a person (champs-libres/departement-de-la-vendee/accent-suivi-developpement#175)
|
|
||||||
* [household] household member editor: display alert if some members have already an household (champs-libres/departement-de-la-vendee/accent-suivi-developpement#172)
|
|
||||||
* [household] household member editor: do not add in new members if the member is included in the members of household (champs-libres/departement-de-la-vendee/accent-suivi-developpement#123)
|
|
||||||
* [household] household member editor: remove markNoAddress button (champs-libres/departement-de-la-vendee/accent-suivi-developpement#109)
|
|
||||||
* [person]: ordering fields in add person (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/61)
|
|
||||||
* [person]: Add email and alt names in add person (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/61)
|
|
||||||
* [accompanyingCourse] Add a delete action and delete buttons to delete a accompanying course when step = DRAFT (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/64)
|
|
||||||
* [accompanyingCourse] Add a administrative location in the accompanying course, set the user current location as default, allow to select a location in a select field and do not allow to confirm the accompanying course if location is empty.
|
|
||||||
* [accompanyingCourse] Add the administrative location in the available variables for document generation
|
|
||||||
* AddAddress: optimize loading: wait for the user finish typing;
|
|
||||||
* UserPicker: fix bug with deprecated role
|
|
||||||
* docgen: add base context + tests
|
|
||||||
* docgen: add age for person
|
|
||||||
* [household menu] fix filiation order https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/265
|
|
||||||
* [AddAddress]: optimize loading: wait for the user finish typing;
|
|
||||||
* [UserPicker]: fix bug with deprecated role
|
|
||||||
* [docgen]: add base context + tests
|
|
||||||
* [docgen]: add age for person
|
|
||||||
* [task]: fix dropdown menu style + fix bug in singleTaskController (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/338)
|
|
||||||
* Household: fix bug when moving person on the same day (see https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/281)
|
|
||||||
* Household: show date validFrom and validTo when moving
|
|
||||||
* address reference: add index for refid
|
|
||||||
* [accompanyingCourse_work] fix styles conflicts + fix bug with remove goal (remove goals one at a time)
|
|
||||||
* [accompanyingCourse] improve masonry on resume page, add origin
|
|
||||||
* [notification] new notification interface, can be associated to AccompanyingCourse/Period, Activities.
|
|
||||||
* List notifications, show, and comment in User section
|
|
||||||
* Notify button and contextual notification box on associated objects pages
|
|
||||||
* [accompanyingCourse] add a comment for each resource associated. A modal allow to save comment. Comment is displayed in on-the-fly show modal of the accompanyingCourse context (edit page + resume page).
|
|
||||||
|
|
||||||
### test release 2021-12-14
|
|
||||||
|
|
||||||
* [asideactivity] creation of aside activity category fixed (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/262)
|
|
||||||
* [vendee/person] fix typo "situation professionelle" => "situation professionnelle"
|
|
||||||
* [main] add availableForUsers condition from locationType in the location API endpoint (champs-libres/departement-de-la-vendee/accent-suivi-developpement#248)
|
|
||||||
* [main] add the current location of the user as API point + add it in the activity location list (champs-libres/departement-de-la-vendee/accent-suivi-developpement#247)
|
|
||||||
* [activity] improve show/new/edit templates, fix SEE and SEE_DETAILS acl
|
|
||||||
* [badges] create specific badge for TMS, and make person/thirdparty badges clickable with on-the-fly modal in :
|
|
||||||
* concerned groups items (activity, calendar)
|
|
||||||
* accompanyingCourseWork lists
|
|
||||||
* accompanyingCourse lists
|
|
||||||
* [acompanyingCourse] add initial comment on Resume page
|
|
||||||
* [person] create button full width (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/330)
|
|
||||||
|
|
||||||
### test release 2021-12-11
|
|
||||||
|
|
||||||
* [main] add order field to civility
|
|
||||||
* [main] change address format in case the country is France, in Address render box and address normalizer
|
|
||||||
* [person] add validator for accompanying period with a test on social issues (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/76)
|
|
||||||
* [activity] fix visibility for location
|
|
||||||
* [origin] fix origin: use correctly the translatable strings
|
|
||||||
* /!\ everyone must update the origin table. As there is only one row, execute `update chill_person_accompanying_period_origin set label = jsonb_build_object('fr', 'appel téléphonique');`
|
|
||||||
* [person] redirect bug fixed.
|
|
||||||
* [action] add an unrelated issue within action creation.
|
|
||||||
* [origin] fix origin: use correctly the translatable strings
|
|
||||||
* /!\ everyone must update the origin table. As there is only one row, execute `update chill_person_accompanying_period_origin set label = jsonb_build_object('fr', 'appel téléphonique');`
|
|
||||||
* [main] change order of civilities in civility fixtures (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191)
|
|
||||||
* [person] set min attr in the minimum of children field (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191)
|
|
||||||
* [person] add marital status date in person view (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191)
|
|
||||||
* [person] show number of children + allow set number of children to null (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191)
|
|
||||||
* [person] show acceptSMS option (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191)
|
|
||||||
* [person] add death information in person render box in twig and vue render boxes (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191)
|
|
||||||
* [asideactivity] creation of aside activity category fixed (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/262)
|
|
||||||
* [vendee/person] fix typo "situation professionelle" => "situation professionnelle"
|
|
||||||
* [accompanyingcourse_work] Changes in layout/behavior of edit form (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/321)
|
|
||||||
* [badge-entity] design coherency between pills badge-person and 3 kinds of badge-thirdparty
|
|
||||||
* [AddPersons] suggestions row are clickable, not only checkbox
|
|
||||||
|
|
||||||
### test release 2021-12-06
|
|
||||||
|
|
||||||
* [main] address: use search API end points for getting postal code and reference address (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/316)
|
|
||||||
* [main] address: in edit mode, select the encoded values in multiselect for address reference and city (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/316)
|
|
||||||
* [person search] fix bug when using birthdate after and birthdate before
|
* [person search] fix bug when using birthdate after and birthdate before
|
||||||
* [person search] increase pertinence when lastname begins with search pattern
|
* [person search] increase pertinence when lastname begins with search pattern
|
||||||
* [activity/actions] Améliore la cohérence du design entre
|
|
||||||
* la page résumé d'un parcours (liste d'actions récentes et liste d'activités récentes)
|
## Test releases
|
||||||
* la page liste des actions
|
|
||||||
* la page liste des activités (contexte personne / contexte parcours)
|
|
||||||
* [household] field to edit wheter person is titulaire of household or not removed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/322)
|
|
||||||
* [activity] create work if a work with same social action is not associated to the activity
|
|
||||||
* [visgraph] improve and fix bugs on vis-network relationship graph
|
|
||||||
* [bugfix] posting of birth- and deathdate through api fixed.
|
|
||||||
* [suggestions] improve suggestions lists
|
|
||||||
|
|
||||||
### Test release 2021-11-19 - bis
|
### Test release 2021-11-19 - bis
|
||||||
|
|
||||||
@@ -137,7 +23,6 @@ and this project adheres to
|
|||||||
* [activity] layout for issues / actions
|
* [activity] layout for issues / actions
|
||||||
* [activity][bugfix] in edit mode, the form will now load the social action list
|
* [activity][bugfix] in edit mode, the form will now load the social action list
|
||||||
|
|
||||||
|
|
||||||
### Test release 2021-11-29
|
### Test release 2021-11-29
|
||||||
|
|
||||||
* [person] suggest entities (person | thirdparty) when creating/editing the accompanying course (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/119)
|
* [person] suggest entities (person | thirdparty) when creating/editing the accompanying course (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/119)
|
||||||
@@ -165,9 +50,6 @@ and this project adheres to
|
|||||||
* [activity] for a new activity: suggest and create on-the-fly locations based on the accompanying course location + location of the suggested parties
|
* [activity] for a new activity: suggest and create on-the-fly locations based on the accompanying course location + location of the suggested parties
|
||||||
* [calendar] for a new rdv: suggest and create on-the-fly locations based on the accompanying course location + location of the suggested parties
|
* [calendar] for a new rdv: suggest and create on-the-fly locations based on the accompanying course location + location of the suggested parties
|
||||||
|
|
||||||
|
|
||||||
## Test releases
|
|
||||||
|
|
||||||
### Test release 2021-11-22
|
### Test release 2021-11-22
|
||||||
|
|
||||||
* [activity] delete admin_user_show in twig template because this route is not defined and should be defined
|
* [activity] delete admin_user_show in twig template because this route is not defined and should be defined
|
||||||
@@ -282,7 +164,7 @@ and this project adheres to
|
|||||||
* fast creation buttons
|
* fast creation buttons
|
||||||
* add ordering for types
|
* add ordering for types
|
||||||
|
|
||||||
* [AccompanyingCourse Resume page] dashboard for AccompanyingCourseWork and for Activities;
|
* [AccompanyingCourse Resume page] badge-title for AccompanyingCourseWork and for Activities;
|
||||||
* Improve badges behaviour with small screens;
|
* Improve badges behaviour with small screens;
|
||||||
|
|
||||||
* [ThirdParty]:
|
* [ThirdParty]:
|
||||||
|
@@ -397,6 +397,7 @@ Créer une liste de suggestions à enlever (avec une croix rouge cliquable, l'an
|
|||||||
<li>
|
<li>
|
||||||
<span>
|
<span>
|
||||||
item
|
item
|
||||||
|
<a></a>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -404,8 +405,7 @@ Créer une liste de suggestions à enlever (avec une croix rouge cliquable, l'an
|
|||||||
Créer un titre enlevable (avec une croix rouge cliquable, l'ancre a est vide)
|
Créer un titre enlevable (avec une croix rouge cliquable, l'ancre a est vide)
|
||||||
```html
|
```html
|
||||||
<div class="item-title">
|
<div class="item-title">
|
||||||
<span>title</span>
|
title
|
||||||
|
<a></a>
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
Les classes `cols` ou `inline` peuvent être ajoutées à côté de `list-suggest` pour modifier la disposition de la liste.
|
|
||||||
Dans le dernier exemple, on met une classe `removable` sur le span, si on veut pouvoir enlever l'élément.
|
|
||||||
|
@@ -1,56 +1,51 @@
|
|||||||
{
|
{
|
||||||
"name": "chill-project/chill-bundles",
|
"name": "chill-project/chill-bundles",
|
||||||
"description": "Most used bundles for chill-project",
|
|
||||||
"license": "AGPL-3.0-only",
|
|
||||||
"type": "library",
|
"type": "library",
|
||||||
|
"description": "Most used bundles for chill-project",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"chill",
|
"chill",
|
||||||
"social worker"
|
"social worker"
|
||||||
],
|
],
|
||||||
|
"license": "AGPL-3.0-only",
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.4",
|
"champs-libres/async-uploader-bundle": "dev-sf4",
|
||||||
"champs-libres/async-uploader-bundle": "dev-sf4#d57134aee8e504a83c902ff0cf9f8d36ac418290",
|
"champs-libres/wopi-bundle": "dev-master",
|
||||||
"champs-libres/wopi-bundle": "dev-master#59b468503b9413f8d588ef9e626e7675560db3d8",
|
"composer/package-versions-deprecated": "^1.10",
|
||||||
"champs-libres/wopi-lib": "dev-master#0e1da19bb6de820080b8651867a7e475be590060",
|
|
||||||
"doctrine/doctrine-bundle": "^2.1",
|
"doctrine/doctrine-bundle": "^2.1",
|
||||||
"doctrine/doctrine-migrations-bundle": "^3.0",
|
"doctrine/doctrine-migrations-bundle": "^3.0",
|
||||||
"doctrine/orm": "^2.7",
|
"doctrine/orm": "^2.7",
|
||||||
"erusev/parsedown": "^1.7",
|
"erusev/parsedown": "^1.7",
|
||||||
"graylog2/gelf-php": "^1.5",
|
"graylog2/gelf-php": "^1.5",
|
||||||
|
"knplabs/knp-menu": "^3.1",
|
||||||
"knplabs/knp-menu-bundle": "^3.0",
|
"knplabs/knp-menu-bundle": "^3.0",
|
||||||
"knplabs/knp-time-bundle": "^1.12",
|
"knplabs/knp-time-bundle": "^1.12",
|
||||||
"league/csv": "^9.7.1",
|
"league/csv": "^9.7.1",
|
||||||
"nyholm/psr7": "^1.4",
|
"nyholm/psr7": "^1.4",
|
||||||
"ocramius/package-versions": "^1.10",
|
|
||||||
"phpoffice/phpspreadsheet": "^1.16",
|
"phpoffice/phpspreadsheet": "^1.16",
|
||||||
"ramsey/uuid-doctrine": "^1.7",
|
"ramsey/uuid-doctrine": "^1.7",
|
||||||
"sensio/framework-extra-bundle": "^5.5",
|
"sensio/framework-extra-bundle": "^5.5",
|
||||||
"spomky-labs/base64url": "^2.0",
|
"symfony/asset": "4.*",
|
||||||
"symfony/asset": "^4.4",
|
"symfony/browser-kit": "^5.2",
|
||||||
"symfony/browser-kit": "^4.4",
|
"symfony/css-selector": "^5.2",
|
||||||
"symfony/css-selector": "^4.4",
|
"symfony/expression-language": "4.*",
|
||||||
"symfony/expression-language": "^4.4",
|
"symfony/form": "4.*",
|
||||||
"symfony/form": "^4.4",
|
"symfony/intl": "4.*",
|
||||||
"symfony/framework-bundle": "^4.4",
|
"symfony/mime": "^4 || ^5",
|
||||||
"symfony/intl": "^4.4",
|
|
||||||
"symfony/mailer": "^5.4",
|
|
||||||
"symfony/mime": "^5.4",
|
|
||||||
"symfony/monolog-bundle": "^3.5",
|
"symfony/monolog-bundle": "^3.5",
|
||||||
"symfony/security-bundle": "^4.4",
|
"symfony/security-bundle": "4.*",
|
||||||
"symfony/serializer": "^5.3",
|
"symfony/serializer": "^5.2",
|
||||||
"symfony/swiftmailer-bundle": "^3.5",
|
"symfony/swiftmailer-bundle": "^3.5",
|
||||||
"symfony/templating": "^4.4",
|
"symfony/templating": "4.*",
|
||||||
"symfony/translation": "^4.4",
|
"symfony/translation": "4.*",
|
||||||
"symfony/twig-bundle": "^4.4",
|
"symfony/twig-bundle": "^4.4",
|
||||||
"symfony/validator": "^4.4",
|
"symfony/validator": "4.*",
|
||||||
"symfony/webpack-encore-bundle": "^1.11",
|
"symfony/webpack-encore-bundle": "^1.11",
|
||||||
"symfony/workflow": "^4.4",
|
"symfony/workflow": "4.*",
|
||||||
"symfony/yaml": "^4.4",
|
"symfony/yaml": "4.*",
|
||||||
"twig/extra-bundle": "^3.0",
|
"twig/extra-bundle": "^2.12 || ^3.0",
|
||||||
"twig/intl-extra": "^3.0",
|
"twig/intl-extra": "^3.0",
|
||||||
"twig/markdown-extra": "^3.3",
|
"twig/markdown-extra": "^3.3",
|
||||||
"twig/string-extra": "^3.3",
|
"twig/twig": "^2.12 || ^3.0"
|
||||||
"twig/twig": "^3.0"
|
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"symfony/symfony": "*"
|
"symfony/symfony": "*"
|
||||||
@@ -60,28 +55,19 @@
|
|||||||
"drupol/php-conventions": "^5",
|
"drupol/php-conventions": "^5",
|
||||||
"fakerphp/faker": "^1.13",
|
"fakerphp/faker": "^1.13",
|
||||||
"nelmio/alice": "^3.8",
|
"nelmio/alice": "^3.8",
|
||||||
"phpspec/prophecy-phpunit": "^2.0",
|
|
||||||
"phpstan/phpstan-strict-rules": "^1.0",
|
"phpstan/phpstan-strict-rules": "^1.0",
|
||||||
"phpunit/phpunit": ">= 7.5",
|
"phpunit/phpunit": "^7.0",
|
||||||
"symfony/debug-bundle": "^5.1",
|
"symfony/debug-bundle": "^5.1",
|
||||||
"symfony/dotenv": "^4.4",
|
"symfony/dotenv": "^5.1",
|
||||||
"symfony/maker-bundle": "^1.20",
|
"symfony/maker-bundle": "^1.20",
|
||||||
"symfony/phpunit-bridge": "^4.4",
|
"symfony/phpunit-bridge": "^5.2",
|
||||||
"symfony/stopwatch": "^4.4",
|
"symfony/stopwatch": "^5.1",
|
||||||
"symfony/var-dumper": "^4.4",
|
"symfony/var-dumper": "4.*",
|
||||||
"symfony/web-profiler-bundle": "^4.4"
|
"symfony/web-profiler-bundle": "^5.0"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"bin-dir": "bin",
|
"bin-dir": "bin",
|
||||||
"optimize-autoloader": true,
|
"vendor-dir": "tests/app/vendor"
|
||||||
"sort-packages": true,
|
|
||||||
"vendor-dir": "tests/app/vendor",
|
|
||||||
"allow-plugins": {
|
|
||||||
"composer/package-versions-deprecated": true,
|
|
||||||
"phpstan/extension-installer": true,
|
|
||||||
"ergebnis/composer-normalize": true,
|
|
||||||
"phpro/grumphp": true
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
@@ -108,19 +94,8 @@
|
|||||||
"Chill\\DocGeneratorBundle\\Tests\\": "src/Bundle/ChillDocGeneratorBundle/tests"
|
"Chill\\DocGeneratorBundle\\Tests\\": "src/Bundle/ChillDocGeneratorBundle/tests"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"config": {
|
"minimum-stability": "dev",
|
||||||
"allow-plugins": {
|
"prefer-stable": true,
|
||||||
"composer/package-versions-deprecated": true,
|
|
||||||
"phpstan/extension-installer": true,
|
|
||||||
"ergebnis/composer-normalize": true,
|
|
||||||
"phpro/grumphp": true,
|
|
||||||
"ocramius/package-versions": true
|
|
||||||
},
|
|
||||||
"bin-dir": "bin",
|
|
||||||
"optimize-autoloader": true,
|
|
||||||
"sort-packages": true,
|
|
||||||
"vendor-dir": "tests/app/vendor"
|
|
||||||
},
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"auto-scripts": {
|
"auto-scripts": {
|
||||||
"cache:clear": "symfony-cmd",
|
"cache:clear": "symfony-cmd",
|
||||||
|
@@ -91,9 +91,7 @@ class CountPerson implements ExportInterface
|
|||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
// we gather all center the user choose.
|
// we gather all center the user choose.
|
||||||
$centers = array_map(static function ($el) {
|
$centers = array_map(static function ($el) { return $el['center']; }, $acl);
|
||||||
return $el['center'];
|
|
||||||
}, $acl);
|
|
||||||
|
|
||||||
$qb = $this->entityManager->createQueryBuilder();
|
$qb = $this->entityManager->createQueryBuilder();
|
||||||
|
|
||||||
|
@@ -11,16 +11,16 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\MainBundle\DependencyInjection;
|
namespace Chill\MainBundle\DependencyInjection;
|
||||||
|
|
||||||
use Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait;
|
use Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait;
|
||||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configure the main bundle.
|
* Configure the main bundle.
|
||||||
*/
|
*/
|
||||||
class ChillMainConfiguration implements ConfigurationInterface
|
class ChillMainConfiguration implements ConfigurationInterface
|
||||||
{
|
{
|
||||||
use AddWidgetConfigurationTrait;
|
use AddWidgetConfigurationTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -60,4 +60,4 @@ class ChillMainConfiguration implements ConfigurationInterface
|
|||||||
|
|
||||||
return $treeBuilder;
|
return $treeBuilder;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
25
grumphp.yml
25
grumphp.yml
@@ -12,28 +12,3 @@ parameters:
|
|||||||
tasks.phpcsfixer.allow_risky: true
|
tasks.phpcsfixer.allow_risky: true
|
||||||
tasks.phpcsfixer.diff: true
|
tasks.phpcsfixer.diff: true
|
||||||
tasks.phpstan.level: 1
|
tasks.phpstan.level: 1
|
||||||
tasks.phpstan.blocking: true
|
|
||||||
tasks.phpstan.ignore_patterns:
|
|
||||||
- "/.github/"
|
|
||||||
- "/.idea/"
|
|
||||||
- "/build/"
|
|
||||||
- "/benchmarks/"
|
|
||||||
- "/docs/"
|
|
||||||
- "/node_modules/"
|
|
||||||
- "/resource/"
|
|
||||||
- "/spec/"
|
|
||||||
- "/var/"
|
|
||||||
- "/vendor/"
|
|
||||||
|
|
||||||
# Psalm
|
|
||||||
tasks.psalm.blocking: true
|
|
||||||
tasks.psalm.ignore_patterns:
|
|
||||||
- "/.github/"
|
|
||||||
- "/.idea/"
|
|
||||||
- "/build/"
|
|
||||||
- "/benchmarks/"
|
|
||||||
- "/node_modules/"
|
|
||||||
- "/resource/"
|
|
||||||
- "/spec/"
|
|
||||||
- "/var/"
|
|
||||||
- "/vendor/"
|
|
||||||
|
@@ -10,6 +10,16 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php
|
path: src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Instantiated class PhpOffice\\\\PhpWord\\\\TemplateProcessor not found\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Instantiated class PhpOffice\\\\PhpWord\\\\TemplateProcessor not found\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Variable \\$participation might not be defined\\.$#"
|
message: "#^Variable \\$participation might not be defined\\.$#"
|
||||||
count: 3
|
count: 3
|
||||||
|
@@ -417,6 +417,15 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
|
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message:
|
||||||
|
"""
|
||||||
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 3
|
||||||
|
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message:
|
message:
|
||||||
"""
|
"""
|
||||||
@@ -426,6 +435,15 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
|
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message:
|
||||||
|
"""
|
||||||
|
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message:
|
message:
|
||||||
"""
|
"""
|
||||||
@@ -507,6 +525,24 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillEventBundle/Search/EventSearch.php
|
path: src/Bundle/ChillEventBundle/Search/EventSearch.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message:
|
||||||
|
"""
|
||||||
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillEventBundle/Search/EventSearch.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message:
|
||||||
|
"""
|
||||||
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillEventBundle/Timeline/TimelineEventProvider.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message:
|
message:
|
||||||
"""
|
"""
|
||||||
@@ -859,6 +895,11 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php
|
path: src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Call to deprecated method setTimeout\\(\\) of class Redis\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverLocker.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message:
|
message:
|
||||||
"""
|
"""
|
||||||
@@ -1270,6 +1311,16 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php
|
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message:
|
||||||
|
"""
|
||||||
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php
|
||||||
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message:
|
message:
|
||||||
"""
|
"""
|
||||||
|
@@ -315,6 +315,11 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillMainBundle/Security/PasswordRecover/TokenManager.php
|
path: src/Bundle/ChillMainBundle/Security/PasswordRecover/TokenManager.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
|
||||||
|
count: 3
|
||||||
|
path: src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
|
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
|
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="tests/app/vendor/phpunit/phpunit/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="tests/app/tests/bootstrap.php"
|
bootstrap="tests/app/tests/bootstrap.php"
|
||||||
|
2006
psalm-baseline.xml
2006
psalm-baseline.xml
File diff suppressed because it is too large
Load Diff
16
psalm.xml
16
psalm.xml
@@ -1,16 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<psalm
|
|
||||||
errorLevel="7"
|
|
||||||
resolveFromConfigFile="true"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xmlns="https://getpsalm.org/schema/config"
|
|
||||||
xsi:schemaLocation="https://getpsalm.org/schema/config tests/app/vendor/vimeo/psalm/config.xsd"
|
|
||||||
errorBaseline="psalm-baseline.xml"
|
|
||||||
>
|
|
||||||
<projectFiles>
|
|
||||||
<directory name="src" />
|
|
||||||
<ignoreFiles>
|
|
||||||
<directory name="./tests/" />
|
|
||||||
</ignoreFiles>
|
|
||||||
</projectFiles>
|
|
||||||
</psalm>
|
|
@@ -39,7 +39,6 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Symfony\Component\Serializer\SerializerInterface;
|
use Symfony\Component\Serializer\SerializerInterface;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
|
|
||||||
final class ActivityController extends AbstractController
|
final class ActivityController extends AbstractController
|
||||||
@@ -308,10 +307,8 @@ final class ActivityController extends AbstractController
|
|||||||
$activityData = $request->query->get('activityData');
|
$activityData = $request->query->get('activityData');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (!$activityType instanceof \Chill\ActivityBundle\Entity\ActivityType
|
||||||
!$activityType instanceof \Chill\ActivityBundle\Entity\ActivityType
|
|| !$activityType->isActive()) {
|
||||||
|| !$activityType->isActive()
|
|
||||||
) {
|
|
||||||
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
|
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
|
||||||
|
|
||||||
if (null !== $activityData) {
|
if (null !== $activityData) {
|
||||||
|
@@ -14,6 +14,7 @@ namespace Chill\ActivityBundle\Controller;
|
|||||||
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
|
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
|
||||||
use Chill\ActivityBundle\Form\ActivityReasonCategoryType;
|
use Chill\ActivityBundle\Form\ActivityReasonCategoryType;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
|
@@ -14,6 +14,7 @@ namespace Chill\ActivityBundle\Controller;
|
|||||||
use Chill\ActivityBundle\Entity\ActivityReason;
|
use Chill\ActivityBundle\Entity\ActivityReason;
|
||||||
use Chill\ActivityBundle\Form\ActivityReasonType;
|
use Chill\ActivityBundle\Form\ActivityReasonType;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
|
@@ -19,7 +19,6 @@ use Chill\MainBundle\Entity\RoleScope;
|
|||||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -41,7 +41,6 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf
|
|||||||
$loader->load('services/form.yaml');
|
$loader->load('services/form.yaml');
|
||||||
$loader->load('services/templating.yaml');
|
$loader->load('services/templating.yaml');
|
||||||
$loader->load('services/accompanyingPeriodConsistency.yaml');
|
$loader->load('services/accompanyingPeriodConsistency.yaml');
|
||||||
$loader->load('services/doctrine.entitylistener.yaml');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function prepend(ContainerBuilder $container)
|
public function prepend(ContainerBuilder $container)
|
||||||
|
@@ -13,7 +13,6 @@ namespace Chill\ActivityBundle\DependencyInjection;
|
|||||||
|
|
||||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||||
|
|
||||||
use function is_int;
|
use function is_int;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -47,8 +47,7 @@ use Symfony\Component\Serializer\Annotation\SerializedName;
|
|||||||
* })
|
* })
|
||||||
* @ActivityValidator\ActivityValidity
|
* @ActivityValidator\ActivityValidity
|
||||||
*
|
*
|
||||||
* TODO see if necessary
|
* @UserCircleConsistency(
|
||||||
* UserCircleConsistency(
|
|
||||||
* "CHILL_ACTIVITY_SEE_DETAILS",
|
* "CHILL_ACTIVITY_SEE_DETAILS",
|
||||||
* getUserFunction="getUser",
|
* getUserFunction="getUser",
|
||||||
* path="scope")
|
* path="scope")
|
||||||
|
@@ -163,6 +163,16 @@ class ActivityType
|
|||||||
*/
|
*/
|
||||||
private int $personVisible = self::FIELD_REQUIRED;
|
private int $personVisible = self::FIELD_REQUIRED;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
|
private string $placeLabel = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||||
|
*/
|
||||||
|
private int $placeVisible = self::FIELD_OPTIONAL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
*/
|
*/
|
||||||
@@ -396,6 +406,16 @@ class ActivityType
|
|||||||
return $this->personVisible;
|
return $this->personVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPlaceLabel(): string
|
||||||
|
{
|
||||||
|
return $this->placeLabel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPlaceVisible(): int
|
||||||
|
{
|
||||||
|
return $this->placeVisible;
|
||||||
|
}
|
||||||
|
|
||||||
public function getReasonsLabel(): string
|
public function getReasonsLabel(): string
|
||||||
{
|
{
|
||||||
return $this->reasonsLabel;
|
return $this->reasonsLabel;
|
||||||
@@ -668,6 +688,20 @@ class ActivityType
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setPlaceLabel(string $placeLabel): self
|
||||||
|
{
|
||||||
|
$this->placeLabel = $placeLabel;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setPlaceVisible(int $placeVisible): self
|
||||||
|
{
|
||||||
|
$this->placeVisible = $placeVisible;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function setReasonsLabel(string $reasonsLabel): self
|
public function setReasonsLabel(string $reasonsLabel): self
|
||||||
{
|
{
|
||||||
$this->reasonsLabel = $reasonsLabel;
|
$this->reasonsLabel = $reasonsLabel;
|
||||||
|
@@ -1,77 +0,0 @@
|
|||||||
<?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\ActivityBundle\EntityListener;
|
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
|
||||||
use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepository;
|
|
||||||
use DateTimeImmutable;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
|
||||||
|
|
||||||
use function in_array;
|
|
||||||
|
|
||||||
class ActivityEntityListener
|
|
||||||
{
|
|
||||||
private EntityManagerInterface $em;
|
|
||||||
|
|
||||||
private AccompanyingPeriodWorkRepository $workRepository;
|
|
||||||
|
|
||||||
public function __construct(EntityManagerInterface $em, AccompanyingPeriodWorkRepository $workRepository)
|
|
||||||
{
|
|
||||||
$this->em = $em;
|
|
||||||
$this->workRepository = $workRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function persistActionToCourse(Activity $activity)
|
|
||||||
{
|
|
||||||
if ($activity->getAccompanyingPeriod() instanceof AccompanyingPeriod) {
|
|
||||||
$period = $activity->getAccompanyingPeriod();
|
|
||||||
|
|
||||||
$accompanyingCourseWorks = $this->workRepository->findByAccompanyingPeriod($period);
|
|
||||||
$periodActions = [];
|
|
||||||
$now = new DateTimeImmutable();
|
|
||||||
|
|
||||||
foreach ($accompanyingCourseWorks as $key => $work) {
|
|
||||||
// take only the actions which are still opened
|
|
||||||
if ($work->getEndDate() === null || $work->getEndDate() > ($activity->getDate() ?? $now)) {
|
|
||||||
$periodActions[$key] = spl_object_hash($work->getSocialAction());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$associatedPersons = $activity->getPersonsAssociated();
|
|
||||||
$associatedThirdparties = $activity->getThirdParties();
|
|
||||||
|
|
||||||
foreach ($activity->getSocialActions() as $action) {
|
|
||||||
if (in_array(spl_object_hash($action), $periodActions, true)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$newAction = new AccompanyingPeriodWork();
|
|
||||||
$newAction->setSocialAction($action);
|
|
||||||
$period->addWork($newAction);
|
|
||||||
|
|
||||||
$date = DateTimeImmutable::createFromMutable($activity->getDate());
|
|
||||||
$newAction->setStartDate($date);
|
|
||||||
|
|
||||||
foreach ($associatedPersons as $person) {
|
|
||||||
$newAction->addPerson($person);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($associatedThirdparties as $thirdparty) {
|
|
||||||
$newAction->setHandlingThierparty($thirdparty);
|
|
||||||
}
|
|
||||||
$this->em->persist($newAction);
|
|
||||||
$this->em->flush();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -25,7 +25,6 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
|||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
|
@@ -27,7 +27,6 @@ use Symfony\Component\Security\Core\Role\Role;
|
|||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
use Symfony\Component\Validator\Constraints\Callback;
|
use Symfony\Component\Validator\Constraints\Callback;
|
||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
use function count;
|
use function count;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
@@ -190,9 +189,7 @@ class ListActivity implements ListInterface
|
|||||||
|
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static function ($el) {
|
$centers = array_map(static function ($el) { return $el['center']; }, $acl);
|
||||||
return $el['center'];
|
|
||||||
}, $acl);
|
|
||||||
|
|
||||||
// throw an error if any fields are present
|
// throw an error if any fields are present
|
||||||
if (!array_key_exists('fields', $data)) {
|
if (!array_key_exists('fields', $data)) {
|
||||||
|
@@ -25,7 +25,6 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
|||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
|
@@ -24,7 +24,6 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
|||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInterface
|
class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInterface
|
||||||
|
@@ -31,7 +31,6 @@ use Symfony\Component\Form\FormEvents;
|
|||||||
use Symfony\Component\Form\FormInterface;
|
use Symfony\Component\Form\FormInterface;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
class PersonHavingActivityBetweenDateFilter implements ExportElementValidatedInterface, FilterInterface
|
class PersonHavingActivityBetweenDateFilter implements ExportElementValidatedInterface, FilterInterface
|
||||||
|
@@ -48,7 +48,6 @@ use Symfony\Component\Form\FormEvent;
|
|||||||
use Symfony\Component\Form\FormEvents;
|
use Symfony\Component\Form\FormEvents;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
class ActivityType extends AbstractType
|
class ActivityType extends AbstractType
|
||||||
@@ -261,10 +260,6 @@ class ActivityType extends AbstractType
|
|||||||
return implode(',', $personIds);
|
return implode(',', $personIds);
|
||||||
},
|
},
|
||||||
function (?string $personsAsString): array {
|
function (?string $personsAsString): array {
|
||||||
if (null === $personsAsString) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return array_map(
|
return array_map(
|
||||||
fn (string $id): ?Person => $this->om->getRepository(Person::class)->findOneBy(['id' => (int) $id]),
|
fn (string $id): ?Person => $this->om->getRepository(Person::class)->findOneBy(['id' => (int) $id]),
|
||||||
explode(',', $personsAsString)
|
explode(',', $personsAsString)
|
||||||
@@ -287,10 +282,6 @@ class ActivityType extends AbstractType
|
|||||||
return implode(',', $thirdpartyIds);
|
return implode(',', $thirdpartyIds);
|
||||||
},
|
},
|
||||||
function (?string $thirdpartyAsString): array {
|
function (?string $thirdpartyAsString): array {
|
||||||
if (null === $thirdpartyAsString) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return array_map(
|
return array_map(
|
||||||
fn (string $id): ?ThirdParty => $this->om->getRepository(ThirdParty::class)->findOneBy(['id' => (int) $id]),
|
fn (string $id): ?ThirdParty => $this->om->getRepository(ThirdParty::class)->findOneBy(['id' => (int) $id]),
|
||||||
explode(',', $thirdpartyAsString)
|
explode(',', $thirdpartyAsString)
|
||||||
@@ -307,7 +298,6 @@ class ActivityType extends AbstractType
|
|||||||
'allow_add' => true,
|
'allow_add' => true,
|
||||||
'button_add_label' => 'activity.Insert a document',
|
'button_add_label' => 'activity.Insert a document',
|
||||||
'button_remove_label' => 'activity.Remove a document',
|
'button_remove_label' => 'activity.Remove a document',
|
||||||
'empty_collection_explain' => 'No documents',
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -325,10 +315,6 @@ class ActivityType extends AbstractType
|
|||||||
return implode(',', $userIds);
|
return implode(',', $userIds);
|
||||||
},
|
},
|
||||||
function (?string $usersAsString): array {
|
function (?string $usersAsString): array {
|
||||||
if (null === $usersAsString) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return array_map(
|
return array_map(
|
||||||
fn (string $id): ?User => $this->om->getRepository(User::class)->findOneBy(['id' => (int) $id]),
|
fn (string $id): ?User => $this->om->getRepository(User::class)->findOneBy(['id' => (int) $id]),
|
||||||
explode(',', $usersAsString)
|
explode(',', $usersAsString)
|
||||||
@@ -346,7 +332,7 @@ class ActivityType extends AbstractType
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return (string) $location->getId();
|
return $location->getId();
|
||||||
},
|
},
|
||||||
function (?string $id): ?Location {
|
function (?string $id): ?Location {
|
||||||
return $this->om->getRepository(Location::class)->findOneBy(['id' => (int) $id]);
|
return $this->om->getRepository(Location::class)->findOneBy(['id' => (int) $id]);
|
||||||
@@ -393,7 +379,7 @@ class ActivityType extends AbstractType
|
|||||||
$timezoneUTC = new DateTimeZone('GMT');
|
$timezoneUTC = new DateTimeZone('GMT');
|
||||||
/** @var DateTime $data */
|
/** @var DateTime $data */
|
||||||
$data = $formEvent->getData() === null ?
|
$data = $formEvent->getData() === null ?
|
||||||
DateTime::createFromFormat('U', '300') :
|
DateTime::createFromFormat('U', 300) :
|
||||||
$formEvent->getData();
|
$formEvent->getData();
|
||||||
$seconds = $data->getTimezone()->getOffset($data);
|
$seconds = $data->getTimezone()->getOffset($data);
|
||||||
$data->setTimeZone($timezoneUTC);
|
$data->setTimeZone($timezoneUTC);
|
||||||
|
@@ -55,7 +55,7 @@ class ActivityTypeType extends AbstractType
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$fields = [
|
$fields = [
|
||||||
'persons', 'user', 'date', 'location', 'persons',
|
'persons', 'user', 'date', 'place', 'persons',
|
||||||
'thirdParties', 'durationTime', 'travelTime', 'attendee',
|
'thirdParties', 'durationTime', 'travelTime', 'attendee',
|
||||||
'reasons', 'comment', 'sentReceived', 'documents',
|
'reasons', 'comment', 'sentReceived', 'documents',
|
||||||
'emergency', 'socialIssues', 'socialActions', 'users',
|
'emergency', 'socialIssues', 'socialActions', 'users',
|
||||||
|
@@ -36,10 +36,8 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
{
|
{
|
||||||
$period = $parameters['accompanyingCourse'];
|
$period = $parameters['accompanyingCourse'];
|
||||||
|
|
||||||
if (
|
if (AccompanyingPeriod::STEP_DRAFT !== $period->getStep()
|
||||||
AccompanyingPeriod::STEP_DRAFT !== $period->getStep()
|
&& $this->security->isGranted(ActivityVoter::SEE, $period)) {
|
||||||
&& $this->security->isGranted(ActivityVoter::SEE, $period)
|
|
||||||
) {
|
|
||||||
$menu->addChild($this->translator->trans('Activity'), [
|
$menu->addChild($this->translator->trans('Activity'), [
|
||||||
'route' => 'chill_activity_activity_list',
|
'route' => 'chill_activity_activity_list',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
|
@@ -14,7 +14,6 @@ namespace Chill\ActivityBundle\Menu;
|
|||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
final class AdminMenuBuilder implements LocalMenuBuilderInterface
|
final class AdminMenuBuilder implements LocalMenuBuilderInterface
|
||||||
|
@@ -1,45 +0,0 @@
|
|||||||
<?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\ActivityBundle\Notification;
|
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
|
||||||
use Chill\ActivityBundle\Repository\ActivityRepository;
|
|
||||||
use Chill\MainBundle\Entity\Notification;
|
|
||||||
use Chill\MainBundle\Notification\NotificationHandlerInterface;
|
|
||||||
|
|
||||||
final class ActivityNotificationHandler implements NotificationHandlerInterface
|
|
||||||
{
|
|
||||||
private ActivityRepository $activityRepository;
|
|
||||||
|
|
||||||
public function __construct(ActivityRepository $activityRepository)
|
|
||||||
{
|
|
||||||
$this->activityRepository = $activityRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTemplate(Notification $notification, array $options = []): string
|
|
||||||
{
|
|
||||||
return '@ChillActivity/Activity/showInNotification.html.twig';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTemplateData(Notification $notification, array $options = []): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'notification' => $notification,
|
|
||||||
'activity' => $this->activityRepository->find($notification->getRelatedEntityId()),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function supports(Notification $notification, array $options = []): bool
|
|
||||||
{
|
|
||||||
return $notification->getRelatedEntityClass() === Activity::class;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -0,0 +1,33 @@
|
|||||||
|
<?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\ActivityBundle\Notification;
|
||||||
|
|
||||||
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
|
use Chill\MainBundle\Entity\Notification;
|
||||||
|
|
||||||
|
final class ActivityNotificationRenderer
|
||||||
|
{
|
||||||
|
public function getTemplate()
|
||||||
|
{
|
||||||
|
return '@ChillActivity/Activity/showInNotification.html.twig';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTemplateData(Notification $notification)
|
||||||
|
{
|
||||||
|
return ['notification' => $notification];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function supports(Notification $notification, array $options = []): bool
|
||||||
|
{
|
||||||
|
return $notification->getRelatedEntityClass() === Activity::class;
|
||||||
|
}
|
||||||
|
}
|
@@ -22,7 +22,6 @@ use Doctrine\ORM\EntityManagerInterface;
|
|||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
@@ -168,9 +167,7 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
|
|||||||
$reachableScopes = $this->authorizationHelper->getReachableScopes($this->tokenStorage->getToken()->getUser(), $role, $center);
|
$reachableScopes = $this->authorizationHelper->getReachableScopes($this->tokenStorage->getToken()->getUser(), $role, $center);
|
||||||
// we get the ids for those scopes
|
// we get the ids for those scopes
|
||||||
$reachablesScopesId = array_map(
|
$reachablesScopesId = array_map(
|
||||||
static function (Scope $scope) {
|
static function (Scope $scope) { return $scope->getId(); },
|
||||||
return $scope->getId();
|
|
||||||
},
|
|
||||||
$reachableScopes
|
$reachableScopes
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -31,8 +31,6 @@ class ActivityRepository extends ServiceEntityRepository
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated use @see{ActivityACLAwareRepositoryInterface::findByAccompanyingPeriod}
|
|
||||||
*
|
|
||||||
* @return Activity[]
|
* @return Activity[]
|
||||||
*/
|
*/
|
||||||
public function findByAccompanyingPeriod(AccompanyingPeriod $period, array $scopes, ?bool $allowNullScope = false, ?int $limit = 100, ?int $offset = 0, array $orderBy = ['date' => 'desc']): array
|
public function findByAccompanyingPeriod(AccompanyingPeriod $period, array $scopes, ?bool $allowNullScope = false, ?int $limit = 100, ?int $offset = 0, array $orderBy = ['date' => 'desc']): array
|
||||||
|
@@ -9,9 +9,8 @@ div.new-activity-select-type {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: flex-start;
|
justify-content: center;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
margin-bottom: 30px;
|
|
||||||
|
|
||||||
div.bloc {
|
div.bloc {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
@@ -25,16 +24,14 @@ div.new-activity-select-type {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//// ACTIVITY LIST PAGE
|
//// ACTIVITY LIST PAGE
|
||||||
// precise dashboard specific details
|
// precise badge-title specific details
|
||||||
|
|
||||||
p.date-label {
|
|
||||||
display: inline-block;
|
|
||||||
margin: 0 0.5em 0 0;
|
|
||||||
font-weight: 700;
|
|
||||||
font-size: 18pt;
|
|
||||||
}
|
|
||||||
div.dashboard,
|
|
||||||
h2.badge-title {
|
h2.badge-title {
|
||||||
|
div.duration {
|
||||||
|
font-size: smaller;
|
||||||
|
padding-left: 1em;
|
||||||
|
margin-top: 1em;
|
||||||
|
}
|
||||||
ul.list-content {
|
ul.list-content {
|
||||||
font-size: 70%;
|
font-size: 70%;
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
@@ -42,13 +39,16 @@ h2.badge-title {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
li {
|
li {
|
||||||
margin-bottom: 0.2em;
|
margin-bottom: 0.2em;
|
||||||
// exception: change bg color for action badges above dashboard
|
// exception: change bg color for action badges above badge-title
|
||||||
.bg-light {
|
.bg-light {
|
||||||
background-color: $chill-light-gray !important;
|
background-color: $chill-light-gray !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
div.main {
|
||||||
|
padding: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
//// ACTIVITY SHOW AND FORM PAGES
|
//// ACTIVITY SHOW AND FORM PAGES
|
||||||
// Exceptions for flex-bloc in concerned-groups
|
// Exceptions for flex-bloc in concerned-groups
|
||||||
|
@@ -17,14 +17,6 @@ const getLocations = () => fetchResults('/api/1.0/main/location.json');
|
|||||||
|
|
||||||
const getLocationTypes = () => fetchResults('/api/1.0/main/location-type.json');
|
const getLocationTypes = () => fetchResults('/api/1.0/main/location-type.json');
|
||||||
|
|
||||||
const getUserCurrentLocation =
|
|
||||||
() => fetch('/api/1.0/main/user-current-location.json')
|
|
||||||
.then(response => {
|
|
||||||
if (response.ok) { return response.json(); }
|
|
||||||
throw Error('Error with request resource response');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Load Location Type by defaultFor
|
* Load Location Type by defaultFor
|
||||||
* @param {string} entity - can be "person" or "thirdparty"
|
* @param {string} entity - can be "person" or "thirdparty"
|
||||||
@@ -56,6 +48,5 @@ export {
|
|||||||
getLocations,
|
getLocations,
|
||||||
getLocationTypes,
|
getLocationTypes,
|
||||||
getLocationTypeByDefaultFor,
|
getLocationTypeByDefaultFor,
|
||||||
postLocation,
|
postLocation
|
||||||
getUserCurrentLocation
|
|
||||||
};
|
};
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
</persons-bloc>
|
</persons-bloc>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="getContext === 'accompanyingCourse' && suggestedEntities.length > 0">
|
<div v-if="getContext === 'accompanyingCourse' && suggestedEntities.length > 0">
|
||||||
<ul class="list-suggest add-items inline">
|
<ul class="list-suggest add-items">
|
||||||
<li v-for="(p, i) in suggestedEntities" @click="addSuggestedEntity(p)" :key="`suggestedEntities-${i}`">
|
<li v-for="p in suggestedEntities" @click="addSuggestedEntity(p)">
|
||||||
<span>{{ p.text }}</span>
|
<span>{{ p.text }}</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<li>
|
<li>
|
||||||
<span :title="person.text">
|
<span :title="person.text">
|
||||||
<span class="chill_denomination" @click.prevent="$emit('remove', person)">{{ textCutted }}</span>
|
<span class="chill_denomination">{{ textCutted }}</span>
|
||||||
|
<a @click.prevent="$emit('remove', person)"></a>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -15,16 +15,14 @@
|
|||||||
:searchable="true"
|
:searchable="true"
|
||||||
:placeholder="$t('activity.choose_location')"
|
:placeholder="$t('activity.choose_location')"
|
||||||
:custom-label="customLabel"
|
:custom-label="customLabel"
|
||||||
:select-label="$t('multiselect.select_label')"
|
:options="locations"
|
||||||
:deselect-label="$t('multiselect.deselect_label')"
|
|
||||||
:selected-label="$t('multiselect.selected_label')"
|
|
||||||
:options="availableLocations"
|
|
||||||
group-values="locations"
|
group-values="locations"
|
||||||
group-label="locationGroup"
|
group-label="locationGroup"
|
||||||
v-model="location"
|
v-model="location"
|
||||||
>
|
>
|
||||||
</VueMultiselect>
|
</VueMultiselect>
|
||||||
<new-location v-bind:availableLocations="availableLocations"></new-location>
|
|
||||||
|
<new-location v-bind:locations="locations"></new-location>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</teleport>
|
</teleport>
|
||||||
@@ -34,6 +32,7 @@
|
|||||||
import { mapState, mapGetters } from "vuex";
|
import { mapState, mapGetters } from "vuex";
|
||||||
import VueMultiselect from "vue-multiselect";
|
import VueMultiselect from "vue-multiselect";
|
||||||
import NewLocation from "./Location/NewLocation.vue";
|
import NewLocation from "./Location/NewLocation.vue";
|
||||||
|
import { getLocations, getLocationTypeByDefaultFor } from "../api.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Location",
|
name: "Location",
|
||||||
@@ -41,8 +40,13 @@ export default {
|
|||||||
NewLocation,
|
NewLocation,
|
||||||
VueMultiselect,
|
VueMultiselect,
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
locations: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["activity", "availableLocations"]),
|
...mapState(["activity"]),
|
||||||
...mapGetters(["suggestedEntities"]),
|
...mapGetters(["suggestedEntities"]),
|
||||||
location: {
|
location: {
|
||||||
get() {
|
get() {
|
||||||
@@ -53,6 +57,53 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
getLocations().then(
|
||||||
|
(results) => {
|
||||||
|
getLocationTypeByDefaultFor('person').then(
|
||||||
|
(personLocationType) => {
|
||||||
|
if (personLocationType) {
|
||||||
|
const personLocation = this.makeAccompanyingPeriodLocation(personLocationType);
|
||||||
|
const concernedPersonsLocation =
|
||||||
|
this.makeConcernedPersonsLocation(personLocationType);
|
||||||
|
getLocationTypeByDefaultFor('thirdparty').then(
|
||||||
|
thirdpartyLocationType => {
|
||||||
|
const concernedThirdPartiesLocation =
|
||||||
|
this.makeConcernedThirdPartiesLocation(thirdpartyLocationType);
|
||||||
|
this.locations = [
|
||||||
|
{
|
||||||
|
locationGroup: 'Localisation du parcours',
|
||||||
|
locations: [personLocation]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
locationGroup: 'Parties concernées',
|
||||||
|
locations: [...concernedPersonsLocation, ...concernedThirdPartiesLocation]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
locationGroup: 'Autres localisations',
|
||||||
|
locations: results
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
this.locations = [
|
||||||
|
{
|
||||||
|
locationGroup: 'Localisations',
|
||||||
|
locations: response.results
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
if (window.default_location_id) {
|
||||||
|
let location = this.locations.filter(
|
||||||
|
(l) => l.id === window.default_location_id
|
||||||
|
);
|
||||||
|
this.$store.dispatch("updateLocation", location);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
})
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
labelAccompanyingCourseLocation(value) {
|
labelAccompanyingCourseLocation(value) {
|
||||||
return `${value.address.text} (${value.locationType.title.fr})`
|
return `${value.address.text} (${value.locationType.title.fr})`
|
||||||
@@ -66,6 +117,58 @@ export default {
|
|||||||
: value.locationType.title.fr
|
: value.locationType.title.fr
|
||||||
: '';
|
: '';
|
||||||
},
|
},
|
||||||
|
makeConcernedPersonsLocation(locationType) {
|
||||||
|
let locations = [];
|
||||||
|
this.suggestedEntities.forEach(
|
||||||
|
(e) => {
|
||||||
|
if (e.type === 'person' && e.current_household_address !== null){
|
||||||
|
locations.push({
|
||||||
|
type: 'location',
|
||||||
|
id: -this.suggestedEntities.indexOf(e)*10,
|
||||||
|
onthefly: true,
|
||||||
|
name: e.text,
|
||||||
|
address: {
|
||||||
|
id: e.current_household_address.address_id,
|
||||||
|
},
|
||||||
|
locationType: locationType
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return locations;
|
||||||
|
},
|
||||||
|
makeConcernedThirdPartiesLocation(locationType) {
|
||||||
|
let locations = [];
|
||||||
|
this.suggestedEntities.forEach(
|
||||||
|
(e) => {
|
||||||
|
if (e.type === 'thirdparty' && e.address !== null){
|
||||||
|
locations.push({
|
||||||
|
type: 'location',
|
||||||
|
id: -this.suggestedEntities.indexOf(e)*10,
|
||||||
|
onthefly: true,
|
||||||
|
name: e.text,
|
||||||
|
address: { id: e.address.address_id },
|
||||||
|
locationType: locationType
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return locations;
|
||||||
|
},
|
||||||
|
makeAccompanyingPeriodLocation(locationType) {
|
||||||
|
const accPeriodLocation = this.activity.accompanyingPeriod.location;
|
||||||
|
return {
|
||||||
|
type: 'location',
|
||||||
|
id: -1,
|
||||||
|
onthefly: true,
|
||||||
|
name: '__AccompanyingCourseLocation__',
|
||||||
|
address: {
|
||||||
|
id: accPeriodLocation.address_id,
|
||||||
|
text: `${accPeriodLocation.text} - ${accPeriodLocation.postcode.code} ${accPeriodLocation.postcode.name}`
|
||||||
|
},
|
||||||
|
locationType: locationType
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@@ -18,6 +18,15 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<form>
|
<form>
|
||||||
|
<div class="form-floating mb-3">
|
||||||
|
<p v-if="errors.length">
|
||||||
|
<b>{{ $t('activity.errors') }}</b>
|
||||||
|
<ul>
|
||||||
|
<li v-for="error in errors" :key="error">{{ error }}</li>
|
||||||
|
</ul>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-floating mb-3">
|
<div class="form-floating mb-3">
|
||||||
<select class="form-select form-select-lg" id="type" required v-model="selectType">
|
<select class="form-select form-select-lg" id="type" required v-model="selectType">
|
||||||
<option selected disabled value="">{{ $t('activity.choose_location_type') }}</option>
|
<option selected disabled value="">{{ $t('activity.choose_location_type') }}</option>
|
||||||
@@ -53,12 +62,6 @@
|
|||||||
<input class="form-control form-control-lg" id="email" v-model="inputEmail" placeholder />
|
<input class="form-control form-control-lg" id="email" v-model="inputEmail" placeholder />
|
||||||
<label for="email">{{ $t('activity.location_fields.email') }}</label>
|
<label for="email">{{ $t('activity.location_fields.email') }}</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="alert alert-warning" v-if="errors.length">
|
|
||||||
<ul>
|
|
||||||
<li v-for="(e, i) in errors" :key="i">{{ e }}</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:footer>
|
<template v-slot:footer>
|
||||||
@@ -78,8 +81,7 @@
|
|||||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal.vue';
|
import Modal from 'ChillMainAssets/vuejs/_components/Modal.vue';
|
||||||
import AddAddress from "ChillMainAssets/vuejs/Address/components/AddAddress.vue";
|
import AddAddress from "ChillMainAssets/vuejs/Address/components/AddAddress.vue";
|
||||||
import { mapState } from "vuex";
|
import { mapState } from "vuex";
|
||||||
import { getLocationTypes } from "../../api";
|
import { getLocationTypes, postLocation } from "../../api";
|
||||||
import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "NewLocation",
|
name: "NewLocation",
|
||||||
@@ -87,7 +89,7 @@ export default {
|
|||||||
Modal,
|
Modal,
|
||||||
AddAddress,
|
AddAddress,
|
||||||
},
|
},
|
||||||
props: ['availableLocations'],
|
props: ['locations'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
errors: [],
|
errors: [],
|
||||||
@@ -221,6 +223,7 @@ export default {
|
|||||||
},
|
},
|
||||||
saveNewLocation() {
|
saveNewLocation() {
|
||||||
if (this.checkForm()) {
|
if (this.checkForm()) {
|
||||||
|
console.log('saveNewLocation', this.selected);
|
||||||
let body = {
|
let body = {
|
||||||
type: 'location',
|
type: 'location',
|
||||||
name: this.selected.name,
|
name: this.selected.name,
|
||||||
@@ -239,28 +242,23 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
postLocation(body)
|
||||||
makeFetch('POST', '/api/1.0/main/location.json', body)
|
.then(
|
||||||
.then(response => {
|
location => new Promise(resolve => {
|
||||||
this.$store.dispatch('addAvailableLocationGroup', {
|
this.locations.push(location);
|
||||||
locationGroup: 'Localisations nouvellement créées',
|
this.$store.dispatch('updateLocation', location);
|
||||||
locations: [response]
|
resolve();
|
||||||
});
|
|
||||||
this.$store.dispatch('updateLocation', response);
|
|
||||||
this.modal.showModal = false;
|
this.modal.showModal = false;
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
).catch(
|
||||||
if (error.name === 'ValidationException') {
|
err => {
|
||||||
for (let v of error.violations) {
|
this.errors.push(err.message);
|
||||||
this.errors.push(v);
|
|
||||||
}
|
}
|
||||||
} else {
|
);
|
||||||
this.errors.push('An error occurred');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
submitNewAddress(payload) {
|
submitNewAddress(payload) {
|
||||||
|
console.log('submitNewAddress', payload);
|
||||||
this.selected.addressId = payload.addressId;
|
this.selected.addressId = payload.addressId;
|
||||||
this.addAddress.context.addressId = payload.addressId;
|
this.addAddress.context.addressId = payload.addressId;
|
||||||
this.addAddress.context.edit = true;
|
this.addAddress.context.edit = true;
|
||||||
|
@@ -9,9 +9,9 @@
|
|||||||
|
|
||||||
<check-social-issue
|
<check-social-issue
|
||||||
v-for="issue in socialIssuesList"
|
v-for="issue in socialIssuesList"
|
||||||
:key="issue.id"
|
v-bind:key="issue.id"
|
||||||
:issue="issue"
|
v-bind:issue="issue"
|
||||||
:selection="socialIssuesSelected"
|
v-bind:selection="socialIssuesSelected"
|
||||||
@updateSelected="updateIssuesSelected">
|
@updateSelected="updateIssuesSelected">
|
||||||
</check-social-issue>
|
</check-social-issue>
|
||||||
|
|
||||||
@@ -21,18 +21,18 @@
|
|||||||
label="text"
|
label="text"
|
||||||
track-by="id"
|
track-by="id"
|
||||||
open-direction="bottom"
|
open-direction="bottom"
|
||||||
:close-on-select="true"
|
v-bind:close-on-select="true"
|
||||||
:preserve-search="false"
|
v-bind:preserve-search="false"
|
||||||
:reset-after="true"
|
v-bind:reset-after="true"
|
||||||
:hide-selected="true"
|
v-bind:hide-selected="true"
|
||||||
:taggable="false"
|
v-bind:taggable="false"
|
||||||
:multiple="false"
|
v-bind:multiple="false"
|
||||||
:searchable="true"
|
v-bind:searchable="true"
|
||||||
:allow-empty="true"
|
v-bind:allow-empty="true"
|
||||||
:show-labels="false"
|
v-bind:show-labels="false"
|
||||||
:loading="issueIsLoading"
|
v-bind:loading="issueIsLoading"
|
||||||
:placeholder="$t('activity.choose_other_social_issue')"
|
v-bind:placeholder="$t('activity.choose_other_social_issue')"
|
||||||
:options="socialIssuesOther"
|
v-bind:options="socialIssuesOther"
|
||||||
@select="addIssueInList">
|
@select="addIssueInList">
|
||||||
</VueMultiselect>
|
</VueMultiselect>
|
||||||
</div>
|
</div>
|
||||||
@@ -58,9 +58,9 @@
|
|||||||
<check-social-action
|
<check-social-action
|
||||||
v-if="socialIssuesSelected.length || socialActionsSelected.length"
|
v-if="socialIssuesSelected.length || socialActionsSelected.length"
|
||||||
v-for="action in socialActionsList"
|
v-for="action in socialActionsList"
|
||||||
:key="action.id"
|
v-bind:key="action.id"
|
||||||
:action="action"
|
v-bind:action="action"
|
||||||
:selection="socialActionsSelected"
|
v-bind:selection="socialActionsSelected"
|
||||||
@updateSelected="updateActionsSelected">
|
@updateSelected="updateActionsSelected">
|
||||||
</check-social-action>
|
</check-social-action>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
import { personMessages } from 'ChillPersonAssets/vuejs/_js/i18n'
|
import { personMessages } from 'ChillPersonAssets/vuejs/_js/i18n'
|
||||||
import { multiSelectMessages } from 'ChillMainAssets/vuejs/_js/i18n'
|
|
||||||
|
|
||||||
const activityMessages = {
|
const activityMessages = {
|
||||||
fr: {
|
fr: {
|
||||||
@@ -34,11 +33,12 @@ const activityMessages = {
|
|||||||
},
|
},
|
||||||
create_address: 'Créer une adresse',
|
create_address: 'Créer une adresse',
|
||||||
edit_address: "Modifier l'adresse"
|
edit_address: "Modifier l'adresse"
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.assign(activityMessages.fr, personMessages.fr, multiSelectMessages.fr);
|
Object.assign(activityMessages.fr, personMessages.fr);
|
||||||
|
|
||||||
export {
|
export {
|
||||||
activityMessages
|
activityMessages
|
||||||
|
@@ -12,11 +12,7 @@ const hasLocation = document.querySelector('#location') !== null;
|
|||||||
const hasPerson = document.querySelector('#add-persons') !== null;
|
const hasPerson = document.querySelector('#add-persons') !== null;
|
||||||
|
|
||||||
const app = createApp({
|
const app = createApp({
|
||||||
template: `<app
|
template: `<app :hasSocialIssues="hasSocialIssues", :hasLocation="hasLocation", :hasPerson="hasPerson"></app>`,
|
||||||
:hasSocialIssues="hasSocialIssues"
|
|
||||||
:hasLocation="hasLocation"
|
|
||||||
:hasPerson="hasPerson"
|
|
||||||
></app>`,
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
hasSocialIssues,
|
hasSocialIssues,
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
import 'es6-promise/auto';
|
import 'es6-promise/auto';
|
||||||
import { createStore } from 'vuex';
|
import { createStore } from 'vuex';
|
||||||
import { postLocation } from './api';
|
import { postLocation } from './api';
|
||||||
import prepareLocations from './store.locations.js';
|
|
||||||
|
|
||||||
const debug = process.env.NODE_ENV !== 'production';
|
const debug = process.env.NODE_ENV !== 'production';
|
||||||
//console.log('window.activity', window.activity);
|
//console.log('window.activity', window.activity);
|
||||||
@@ -26,7 +25,6 @@ const store = createStore({
|
|||||||
activity: window.activity,
|
activity: window.activity,
|
||||||
socialIssuesOther: [],
|
socialIssuesOther: [],
|
||||||
socialActionsList: [],
|
socialActionsList: [],
|
||||||
availableLocations: [],
|
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
suggestedEntities(state) {
|
suggestedEntities(state) {
|
||||||
@@ -202,9 +200,6 @@ const store = createStore({
|
|||||||
console.log("### mutation: updateLocation", value);
|
console.log("### mutation: updateLocation", value);
|
||||||
state.activity.location = value;
|
state.activity.location = value;
|
||||||
},
|
},
|
||||||
addAvailableLocationGroup(state, group) {
|
|
||||||
state.availableLocations.push(group);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
addIssueSelected({ commit }, issue) {
|
addIssueSelected({ commit }, issue) {
|
||||||
@@ -240,9 +235,6 @@ const store = createStore({
|
|||||||
});
|
});
|
||||||
commit("updateActionsSelected", payload);
|
commit("updateActionsSelected", payload);
|
||||||
},
|
},
|
||||||
addAvailableLocationGroup({ commit }, payload) {
|
|
||||||
commit("addAvailableLocationGroup", payload);
|
|
||||||
},
|
|
||||||
addPersonsInvolved({ commit }, payload) {
|
addPersonsInvolved({ commit }, payload) {
|
||||||
//console.log('### action addPersonsInvolved', payload.result.type);
|
//console.log('### action addPersonsInvolved', payload.result.type);
|
||||||
switch (payload.result.type) {
|
switch (payload.result.type) {
|
||||||
@@ -343,6 +335,4 @@ const store = createStore({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
prepareLocations(store);
|
|
||||||
|
|
||||||
export default store;
|
export default store;
|
||||||
|
@@ -1,123 +0,0 @@
|
|||||||
import {getLocations, getLocationTypeByDefaultFor, getUserCurrentLocation} from "./api";
|
|
||||||
|
|
||||||
const makeConcernedPersonsLocation = (locationType, store) => {
|
|
||||||
let locations = [];
|
|
||||||
store.getters.suggestedEntities.forEach(
|
|
||||||
(e) => {
|
|
||||||
if (e.type === 'person' && e.current_household_address !== null){
|
|
||||||
locations.push({
|
|
||||||
type: 'location',
|
|
||||||
id: -store.getters.suggestedEntities.indexOf(e)*10,
|
|
||||||
onthefly: true,
|
|
||||||
name: e.text,
|
|
||||||
address: {
|
|
||||||
id: e.current_household_address.address_id,
|
|
||||||
},
|
|
||||||
locationType: locationType
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
return locations;
|
|
||||||
};
|
|
||||||
const makeConcernedThirdPartiesLocation = (locationType, store) => {
|
|
||||||
let locations = [];
|
|
||||||
store.getters.suggestedEntities.forEach(
|
|
||||||
(e) => {
|
|
||||||
if (e.type === 'thirdparty' && e.address !== null){
|
|
||||||
locations.push({
|
|
||||||
type: 'location',
|
|
||||||
id: -store.getters.suggestedEntities.indexOf(e)*10,
|
|
||||||
onthefly: true,
|
|
||||||
name: e.text,
|
|
||||||
address: { id: e.address.address_id },
|
|
||||||
locationType: locationType
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
return locations;
|
|
||||||
};
|
|
||||||
const makeAccompanyingPeriodLocation = (locationType, store) => {
|
|
||||||
const accPeriodLocation = store.state.activity.accompanyingPeriod.location;
|
|
||||||
return {
|
|
||||||
type: 'location',
|
|
||||||
id: -1,
|
|
||||||
onthefly: true,
|
|
||||||
name: '__AccompanyingCourseLocation__',
|
|
||||||
address: {
|
|
||||||
id: accPeriodLocation.address_id,
|
|
||||||
text: `${accPeriodLocation.text} - ${accPeriodLocation.postcode.code} ${accPeriodLocation.postcode.name}`
|
|
||||||
},
|
|
||||||
locationType: locationType
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function prepareLocations(store) {
|
|
||||||
|
|
||||||
// find the locations
|
|
||||||
let allLocations = getLocations().then(
|
|
||||||
(results) => {
|
|
||||||
store.commit('addAvailableLocationGroup', {
|
|
||||||
locationGroup: 'Autres localisations',
|
|
||||||
locations: results
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
let currentLocation = getUserCurrentLocation().then(
|
|
||||||
userCurrentLocation => {
|
|
||||||
if (null !== userCurrentLocation) {
|
|
||||||
store.commit('addAvailableLocationGroup', {
|
|
||||||
locationGroup: 'Ma localisation',
|
|
||||||
locations: [userCurrentLocation]
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
let partiesLocations = [], partyPromise;
|
|
||||||
['person', 'thirdparty'].forEach(kind => {
|
|
||||||
partyPromise = getLocationTypeByDefaultFor(kind).then(
|
|
||||||
(kindLocationType) => {
|
|
||||||
if (kindLocationType) {
|
|
||||||
let concernedKindLocations;
|
|
||||||
if (kind === 'person') {
|
|
||||||
concernedKindLocations = makeConcernedPersonsLocation(kindLocationType, store);
|
|
||||||
// add location for the parcours into suggestions
|
|
||||||
const personLocation = makeAccompanyingPeriodLocation(kindLocationType, store);
|
|
||||||
store.commit('addAvailableLocationGroup', {
|
|
||||||
locationGroup: 'Localisation du parcours',
|
|
||||||
locations: [personLocation]
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
concernedKindLocations = makeConcernedThirdPartiesLocation(kindLocationType, store);
|
|
||||||
}
|
|
||||||
|
|
||||||
store.commit('addAvailableLocationGroup', {
|
|
||||||
locationGroup: kind === 'person' ? 'Usagers concernés' : 'Tiers concernés',
|
|
||||||
locations: concernedKindLocations,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
partiesLocations.push(partyPromise);
|
|
||||||
});
|
|
||||||
|
|
||||||
// when all location are loaded
|
|
||||||
Promise.all([allLocations, currentLocation, ...partiesLocations]).then(() => {
|
|
||||||
console.log('current location in activity', store.state.activity.location);
|
|
||||||
console.log('default loation id', window.default_location_id);
|
|
||||||
if (window.default_location_id) {
|
|
||||||
for (let group of store.state.availableLocations) {
|
|
||||||
console.log(group);
|
|
||||||
let location = group.locations.find((l) => l.id === window.default_location_id);
|
|
||||||
console.log(location);
|
|
||||||
if (location !== undefined) {
|
|
||||||
store.dispatch('updateLocation', location);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
@@ -18,8 +18,7 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
|
|
||||||
// This check prevents access to debug front controllers that are deployed by accident to production servers.
|
// This check prevents access to debug front controllers that are deployed by accident to production servers.
|
||||||
// Feel free to remove this, extend it, or make something more sophisticated.
|
// Feel free to remove this, extend it, or make something more sophisticated.
|
||||||
if (
|
if (isset($_SERVER['HTTP_CLIENT_IP'])
|
||||||
isset($_SERVER['HTTP_CLIENT_IP'])
|
|
||||||
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|
||||||
|| !(in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1'], true) || \PHP_SAPI === 'cli-server')
|
|| !(in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1'], true) || \PHP_SAPI === 'cli-server')
|
||||||
) {
|
) {
|
||||||
|
@@ -1,151 +0,0 @@
|
|||||||
{% set t = activity.type %}
|
|
||||||
<div class="item-bloc activity-item{% if itemBlocClass is defined %} {{ itemBlocClass }}{% endif %}">
|
|
||||||
|
|
||||||
<div class="item-row">
|
|
||||||
<div class="wrap-list">
|
|
||||||
<div class="wl-row">
|
|
||||||
<div class="wl-col title">
|
|
||||||
{% if activity.date %}
|
|
||||||
<p class="date-label">
|
|
||||||
{{ activity.date|format_date('short') }}
|
|
||||||
</p>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<div class="wl-col list">
|
|
||||||
<h2 class="badge-title">
|
|
||||||
<span class="title_label"></span>
|
|
||||||
<span class="title_action">
|
|
||||||
{{ activity.type.name | localize_translatable_string }}
|
|
||||||
|
|
||||||
{% if activity.emergency %}
|
|
||||||
<span class="badge bg-danger rounded-pill fs-6 float-end">{{ 'Emergency'|trans|upper }}</span>
|
|
||||||
{% endif %}
|
|
||||||
</span>
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="item-row column separator">
|
|
||||||
<div class="wrap-list">
|
|
||||||
{% if activity.location and t.locationVisible %}
|
|
||||||
<div class="wl-row">
|
|
||||||
<div class="wl-col title"><h3>{{ 'location'|trans }}</h3></div>
|
|
||||||
<div class="wl-col list">
|
|
||||||
<p class="wl-item">
|
|
||||||
{{ activity.location.name }}
|
|
||||||
<span>({{ activity.location.locationType.title|localize_translatable_string }})</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if activity.sentReceived is not empty and t.sentReceivedVisible %}
|
|
||||||
<div class="wl-row">
|
|
||||||
<div class="wl-col title"><h3>{{ 'Sent received'|trans }}</h3></div>
|
|
||||||
<div class="wl-col list">
|
|
||||||
<p class="wl-item">
|
|
||||||
{{ activity.sentReceived|capitalize|trans }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if activity.user and t.userVisible %}
|
|
||||||
<div class="wl-row">
|
|
||||||
<div class="wl-col title"><h3>{{ 'Referrer'|trans }}</h3></div>
|
|
||||||
<div class="wl-col list">
|
|
||||||
<p class="wl-item">
|
|
||||||
{{ activity.user|chill_entity_render_string|capitalize }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {
|
|
||||||
'context': context,
|
|
||||||
'render': 'wrap-list',
|
|
||||||
'entity': activity,
|
|
||||||
'badge_person': true
|
|
||||||
} %}
|
|
||||||
|
|
||||||
<div class="wrap-list">
|
|
||||||
{%- if activity.reasons is not empty and t.reasonsVisible -%}
|
|
||||||
<div class="wl-row">
|
|
||||||
<div class="wl-col title">
|
|
||||||
<h3>{{ 'Reasons'|trans }}</h3>
|
|
||||||
</div>
|
|
||||||
<div class="wl-col list">
|
|
||||||
{% for r in activity.reasons %}
|
|
||||||
<p class="wl-item reasons">
|
|
||||||
{{ r|chill_entity_render_box }}
|
|
||||||
</p>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{%- if activity.socialIssues is not empty and t.socialIssuesVisible -%}
|
|
||||||
<div class="wl-row">
|
|
||||||
<div class="wl-col title">
|
|
||||||
<h3>{{ 'Social issues'|trans }}</h3>
|
|
||||||
</div>
|
|
||||||
<div class="wl-col list">
|
|
||||||
{% for r in activity.socialIssues %}
|
|
||||||
<p class="wl-item social-issues">
|
|
||||||
{{ r|chill_entity_render_box }}
|
|
||||||
</p>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{%- if activity.socialActions is not empty and t.socialActionsVisible -%}
|
|
||||||
<div class="wl-row">
|
|
||||||
<div class="wl-col title">
|
|
||||||
<h3>{{ 'Social actions'|trans }}</h3>
|
|
||||||
</div>
|
|
||||||
<div class="wl-col list">
|
|
||||||
{% for r in activity.socialActions %}
|
|
||||||
<p class="wl-item social-actions">
|
|
||||||
{{ r|chill_entity_render_box }}
|
|
||||||
</p>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if activity.comment.comment is not empty and is_granted('CHILL_ACTIVITY_SEE_DETAILS', activity) %}
|
|
||||||
<div class="wl-row">
|
|
||||||
<div class="wl-col title">
|
|
||||||
<h3>{{ 'Comment'|trans }}</h3>
|
|
||||||
</div>
|
|
||||||
<div class="wl-col list">
|
|
||||||
{{ activity.comment|chill_entity_render_box({
|
|
||||||
'disable_markdown': false,
|
|
||||||
'limit_lines': 3,
|
|
||||||
'metadata': false
|
|
||||||
}) }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{# Only if ACL SEE_DETAILS AND/OR only on template SHOW ??
|
|
||||||
durationTime
|
|
||||||
travelTime
|
|
||||||
comment
|
|
||||||
documents
|
|
||||||
attendee
|
|
||||||
#}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="item-row separator">
|
|
||||||
<ul class="record_actions">
|
|
||||||
{{ recordAction }}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
@@ -0,0 +1,110 @@
|
|||||||
|
<h2 class="badge-title">
|
||||||
|
<span class="title_label">
|
||||||
|
|
||||||
|
{% if activity.date %}
|
||||||
|
<h3>{{ activity.date|format_date('short') }}</h3>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<div class="duration">
|
||||||
|
{% if activity.durationTime and t.durationTimeVisible %}
|
||||||
|
<p>
|
||||||
|
<abbr class="fa fa-fw fa-hourglass-end" title="{{ 'Duration Time'|trans }}"></abbr>
|
||||||
|
{{ activity.durationTime|date('H:i') }}
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if activity.travelTime and t.travelTimeVisible %}
|
||||||
|
<p>
|
||||||
|
<abbr class="fa fa-fw fa-car" title="{{ 'Travel time'|trans }}"></abbr>
|
||||||
|
{{ activity.travelTime|date('H:i') }}
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
<span class="title_action">
|
||||||
|
|
||||||
|
{{ activity.type.name | localize_translatable_string }}
|
||||||
|
|
||||||
|
{% if activity.emergency %}
|
||||||
|
<span class="badge bg-danger rounded-pill fs-6">{{ 'Emergency'|trans|upper }}</span>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<ul class="small_in_title mt-3">
|
||||||
|
|
||||||
|
{% if activity.sentReceived is not empty and t.sentReceivedVisible %}
|
||||||
|
<li>
|
||||||
|
<span class="item-key">{{ 'Sent received'|trans ~ ' : ' }}</span>
|
||||||
|
<b>{{ activity.sentReceived|capitalize|trans }}</b>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if activity.location and t.locationVisible %}
|
||||||
|
<li>
|
||||||
|
<span class="item-key">{{ 'location'|trans ~ ': ' }}</span>
|
||||||
|
<b>
|
||||||
|
<span>{{ activity.location.locationType.title|localize_translatable_string }}</span>
|
||||||
|
{{ activity.location.name }}
|
||||||
|
</b>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if activity.user and t.userVisible %}
|
||||||
|
<li>
|
||||||
|
<span class="item-key">{{ 'Referrer'|trans ~ ': ' }}</span>
|
||||||
|
<b>{{ activity.user.usernameCanonical }}</b>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<li class="associated-persons">
|
||||||
|
<span class="item-key">{{ 'Participants'|trans ~ ' : ' }}</span>
|
||||||
|
{% for p in activity.personsAssociated %}
|
||||||
|
<span class="badge-person">{{ p|chill_entity_render_box }}</span>
|
||||||
|
{% endfor %}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul class="list-content my-3">
|
||||||
|
{%- if t.reasonsVisible -%}
|
||||||
|
{%- if activity.reasons is not empty -%}
|
||||||
|
<li class="reasons">
|
||||||
|
{% for r in activity.reasons %}
|
||||||
|
{{ r|chill_entity_render_box }}
|
||||||
|
{% endfor %}
|
||||||
|
</li>
|
||||||
|
{%- endif -%}
|
||||||
|
{% endif %}
|
||||||
|
{%- if t.socialIssuesVisible %}
|
||||||
|
{%- if activity.socialIssues is not empty -%}
|
||||||
|
<li class="social-issues">
|
||||||
|
{% for r in activity.socialIssues %}
|
||||||
|
{{ r|chill_entity_render_box }}
|
||||||
|
{% endfor %}
|
||||||
|
</li>
|
||||||
|
{%- endif -%}
|
||||||
|
{% endif %}
|
||||||
|
{%- if t.socialActionsVisible -%}
|
||||||
|
{%- if activity.socialActions is not empty -%}
|
||||||
|
<li class="social-actions">
|
||||||
|
{% for r in activity.socialActions %}
|
||||||
|
{{ r|chill_entity_render_box }}
|
||||||
|
{% endfor %}
|
||||||
|
</li>
|
||||||
|
{%- endif -%}
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</span>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
{% if context == 'person' and activity.accompanyingPeriod is not empty %}
|
||||||
|
<div class="mt-3">
|
||||||
|
<a class="btn btn-sm btn-outline-primary"
|
||||||
|
title="{{ 'Period number %number%'|trans({'%number%': activity.accompanyingPeriod.id}) }}"
|
||||||
|
href="{{ chill_path_add_return_path(
|
||||||
|
"chill_person_accompanying_course_index",
|
||||||
|
{ 'accompanying_period_id': activity.accompanyingPeriod.id }
|
||||||
|
) }}"><i class="fa fa-random"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
@@ -3,16 +3,6 @@
|
|||||||
{{ path(pathname, parms) }}
|
{{ path(pathname, parms) }}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro insert_onthefly(type, entity, parent = null) %}
|
|
||||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
|
||||||
action: 'show', displayBadge: true,
|
|
||||||
targetEntity: { name: type, id: entity.id },
|
|
||||||
buttonText: entity|chill_entity_render_string,
|
|
||||||
isDead: entity.deathdate is not null,
|
|
||||||
parent: parent
|
|
||||||
} %}
|
|
||||||
{% endmacro %}
|
|
||||||
|
|
||||||
{% macro computeWidth(nbBlocks) %}
|
{% macro computeWidth(nbBlocks) %}
|
||||||
{{ 'flex-basis: ' ~ (100 / nbBlocks)|round(1) ~ '%;' }}
|
{{ 'flex-basis: ' ~ (100 / nbBlocks)|round(1) ~ '%;' }}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
@@ -23,7 +13,6 @@
|
|||||||
{% set blocks = blocks|merge([{
|
{% set blocks = blocks|merge([{
|
||||||
'title': 'Others persons'|trans,
|
'title': 'Others persons'|trans,
|
||||||
'items': entity.persons,
|
'items': entity.persons,
|
||||||
'type': 'person',
|
|
||||||
'path' : 'chill_person_view',
|
'path' : 'chill_person_view',
|
||||||
'key' : 'person_id'
|
'key' : 'person_id'
|
||||||
}]) %}
|
}]) %}
|
||||||
@@ -31,13 +20,11 @@
|
|||||||
{% set blocks = blocks|merge([{
|
{% set blocks = blocks|merge([{
|
||||||
'title': 'Persons in accompanying course'|trans,
|
'title': 'Persons in accompanying course'|trans,
|
||||||
'items': entity.personsAssociated,
|
'items': entity.personsAssociated,
|
||||||
'type': 'person',
|
|
||||||
'path' : 'chill_person_view',
|
'path' : 'chill_person_view',
|
||||||
'key' : 'person_id'
|
'key' : 'person_id'
|
||||||
},{
|
},{
|
||||||
'title': 'Third persons'|trans,
|
'title': 'Third persons'|trans,
|
||||||
'items': entity.personsNotAssociated,
|
'items': entity.personsNotAssociated,
|
||||||
'type': 'person',
|
|
||||||
'path' : 'chill_person_view',
|
'path' : 'chill_person_view',
|
||||||
'key' : 'person_id',
|
'key' : 'person_id',
|
||||||
}]) %}
|
}]) %}
|
||||||
@@ -47,7 +34,6 @@
|
|||||||
{% set blocks = blocks|merge([{
|
{% set blocks = blocks|merge([{
|
||||||
'title': 'Third parties'|trans,
|
'title': 'Third parties'|trans,
|
||||||
'items': entity.thirdParties,
|
'items': entity.thirdParties,
|
||||||
'type': 'thirdparty',
|
|
||||||
'path' : 'chill_crud_3party_3party_view',
|
'path' : 'chill_crud_3party_3party_view',
|
||||||
'key' : 'id',
|
'key' : 'id',
|
||||||
}]) %}
|
}]) %}
|
||||||
@@ -56,12 +42,11 @@
|
|||||||
{% set blocks = blocks|merge([{
|
{% set blocks = blocks|merge([{
|
||||||
'title': 'Users concerned'|trans,
|
'title': 'Users concerned'|trans,
|
||||||
'items': entity.users,
|
'items': entity.users,
|
||||||
'type': 'user',
|
|
||||||
'key' : 'id',
|
'key' : 'id',
|
||||||
}]) %}
|
}]) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if (render == 'bloc') %}
|
{% if (with_display == 'bloc') %}
|
||||||
<div class="{{ context }} flex-bloc concerned-groups">
|
<div class="{{ context }} flex-bloc concerned-groups">
|
||||||
{% for bloc in blocks %}
|
{% for bloc in blocks %}
|
||||||
|
|
||||||
@@ -74,12 +59,22 @@
|
|||||||
<ul class="list-content">
|
<ul class="list-content">
|
||||||
{% for item in bloc.items %}
|
{% for item in bloc.items %}
|
||||||
<li>
|
<li>
|
||||||
{% if bloc.type == 'user' %}
|
{% if bloc.path is defined %}
|
||||||
<span class="badge-user">
|
<a href="{{ _self.href(bloc.path, bloc.key, item.id) }}">
|
||||||
{{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false }) }}
|
<span class="{% if (badge_person is defined and badge_person == true) %}badge-person{% else %}badge bg-primary{% endif %}">
|
||||||
|
{{ item|chill_entity_render_box({
|
||||||
|
'render': 'raw',
|
||||||
|
'addAltNames': false
|
||||||
|
}) }}
|
||||||
</span>
|
</span>
|
||||||
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ _self.insert_onthefly(bloc.type, item) }}
|
<span class="{% if (badge_person is defined and badge_person == true) %}badge-person{% else %}badge bg-primary{% endif %}">
|
||||||
|
{{ item|chill_entity_render_box({
|
||||||
|
'render': 'raw',
|
||||||
|
'addAltNames': false
|
||||||
|
}) }}
|
||||||
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -92,7 +87,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if (render == 'row') %}
|
{% if (with_display == 'row') %}
|
||||||
<div class="concerned-groups">
|
<div class="concerned-groups">
|
||||||
{% for bloc in blocks %}
|
{% for bloc in blocks %}
|
||||||
<div class="group">
|
<div class="group">
|
||||||
@@ -101,12 +96,20 @@
|
|||||||
<ul class="list-content">
|
<ul class="list-content">
|
||||||
{% for item in bloc.items %}
|
{% for item in bloc.items %}
|
||||||
<li>
|
<li>
|
||||||
{% if bloc.type == 'user' %}
|
{% if bloc.path is defined %}
|
||||||
<span class="badge-user">
|
<a href="{{ _self.href(bloc.path, bloc.key, item.id) }}">
|
||||||
{{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false }) }}
|
<span class="{% if (badge_person is defined and badge_person == true) %}badge-person{% else %}badge bg-primary{% endif %}">
|
||||||
|
{{ item|chill_entity_render_box({
|
||||||
|
'render': 'raw',
|
||||||
|
'addAltNames': false
|
||||||
|
}) }}
|
||||||
</span>
|
</span>
|
||||||
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ _self.insert_onthefly(bloc.type, item) }}
|
{{ item|chill_entity_render_box({
|
||||||
|
'render': 'raw',
|
||||||
|
'addAltNames': false
|
||||||
|
}) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -117,24 +120,30 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if (render == 'wrap-list') %}
|
{% if (with_display == 'wrap-list') %}
|
||||||
<div class="concerned-groups wrap-list">
|
<div class="concerned-groups wrap-list">
|
||||||
{% for bloc in blocks %}
|
{% for bloc in blocks %}
|
||||||
<div class="wl-row">
|
<div class="wl-row">
|
||||||
{% if bloc.items|length > 0 %}
|
{% if bloc.items|length > 0 %}
|
||||||
<div class="wl-col title">
|
<div class="wl-col title">
|
||||||
<h3>{{ bloc.title }}</h3>
|
<h4>{{ bloc.title }}</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="wl-col list">
|
<div class="wl-col list">
|
||||||
{% for item in bloc.items %}
|
{% for item in bloc.items %}
|
||||||
|
|
||||||
<span class="wl-item">
|
<span class="wl-item {% if (badge_person is defined and badge_person == true) %}badge-person{% else %}badge bg-primary{% endif %}">
|
||||||
{% if bloc.type == 'user' %}
|
{% if bloc.path is defined %}
|
||||||
<span class="badge-user">
|
<a href="{{ _self.href(bloc.path, bloc.key, item.id) }}">
|
||||||
{{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false }) }}
|
{{ item|chill_entity_render_box({
|
||||||
</span>
|
'render': 'raw',
|
||||||
|
'addAltNames': false
|
||||||
|
}) }}
|
||||||
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ _self.insert_onthefly(bloc.type, item) }}
|
{{ item|chill_entity_render_box({
|
||||||
|
'render': 'raw',
|
||||||
|
'addAltNames': false
|
||||||
|
}) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
@@ -1,12 +1,5 @@
|
|||||||
<h1>
|
<h1>{{ "Update activity"|trans }}</h1>
|
||||||
{{ "Update activity"|trans }}
|
<h2 class="chill-green mb-4">{{ entity.type.name|localize_translatable_string }}</h2>
|
||||||
</h1>
|
|
||||||
<h2 class="badge-title mb-5">
|
|
||||||
<span class="title_label"></span>
|
|
||||||
<span class="title_action">
|
|
||||||
{{ entity.type.name | localize_translatable_string }}
|
|
||||||
</span>
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
{{ form_start(edit_form) }}
|
{{ form_start(edit_form) }}
|
||||||
{{ form_errors(edit_form) }}
|
{{ form_errors(edit_form) }}
|
||||||
@@ -44,7 +37,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{%- if edit_form.persons is defined or edit_form.thirdParties is defined or edit_form.users is defined -%}
|
{%- if edit_form.persons is defined or edit_form.thirdParties is defined or edit_form.users is defined -%}
|
||||||
<h2 class="chill-blue">{{ 'Concerned groups'|trans }}</h2>
|
<h2 class="chill-red">{{ 'Concerned groups'|trans }}</h2>
|
||||||
|
|
||||||
{%- if edit_form.persons is defined -%}
|
{%- if edit_form.persons is defined -%}
|
||||||
{{ form_widget(edit_form.persons) }}
|
{{ form_widget(edit_form.persons) }}
|
||||||
@@ -60,7 +53,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
<h2 class="chill-blue">{{ 'Activity data'|trans }}</h2>
|
<h2 class="chill-red">{{ 'Activity data'|trans }}</h2>
|
||||||
|
|
||||||
{%- if edit_form.date is defined -%}
|
{%- if edit_form.date is defined -%}
|
||||||
{{ form_row(edit_form.date) }}
|
{{ form_row(edit_form.date) }}
|
||||||
@@ -80,6 +73,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{%- if edit_form.comment is defined -%}
|
{%- if edit_form.comment is defined -%}
|
||||||
|
{# TODO .. public and private #}
|
||||||
{{ form_row(edit_form.comment) }}
|
{{ form_row(edit_form.comment) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@@ -103,7 +97,7 @@
|
|||||||
{% set accompanying_course_id = accompanyingCourse.id %}
|
{% set accompanying_course_id = accompanyingCourse.id %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<ul class="record_actions sticky-form-buttons">
|
<ul class="record_actions sticky-form-buttons">
|
||||||
<li class="cancel">
|
<li class="cancel">
|
||||||
<a href="{{ path('chill_activity_activity_show', { 'id': entity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id } ) }}" class="btn btn-cancel">
|
<a href="{{ path('chill_activity_activity_show', { 'id': entity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id } ) }}" class="btn btn-cancel">
|
||||||
{{ 'Cancel'|trans }}
|
{{ 'Cancel'|trans }}
|
||||||
@@ -112,7 +106,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<button class="btn btn-update" type="submit">{{ 'Save'|trans }}</button>
|
<button class="btn btn-update" type="submit">{{ 'Save'|trans }}</button>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{{ form_end(edit_form) }}
|
{{ form_end(edit_form) }}
|
||||||
|
|
||||||
{# {{ form(delete_form) }} #}
|
{# {{ form(delete_form) }} #}
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
{% block js %}
|
{% block js %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
{{ encore_entry_script_tags('mod_async_upload') }}
|
{{ encore_entry_link_tags('mod_async_upload') }}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.addEventListener('DOMContentLoaded', function (e) {
|
window.addEventListener('DOMContentLoaded', function (e) {
|
||||||
chill.displayAlertWhenLeavingModifiedForm('form[name="{{ edit_form.vars.form.vars.name }}"]',
|
chill.displayAlertWhenLeavingModifiedForm('form[name="{{ edit_form.vars.form.vars.name }}"]',
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block js %}
|
{% block js %}
|
||||||
{{ encore_entry_script_tags('mod_async_upload') }}
|
{{ encore_entry_link_tags('mod_async_upload') }}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.addEventListener('DOMContentLoaded', function (e) {
|
window.addEventListener('DOMContentLoaded', function (e) {
|
||||||
chill.displayAlertWhenLeavingModifiedForm('form[name="{{ edit_form.vars.form.vars.name }}"]',
|
chill.displayAlertWhenLeavingModifiedForm('form[name="{{ edit_form.vars.form.vars.name }}"]',
|
||||||
|
@@ -1,61 +1,3 @@
|
|||||||
{% macro recordAction(activity, context = null, person_id = null, accompanying_course_id = null) %}
|
|
||||||
{% if no_action is not defined or no_action == false %}
|
|
||||||
<li>
|
|
||||||
<a class="btn btn-notify" href="{{ chill_path_add_return_path('chill_main_notification_create', {
|
|
||||||
'entityClass': 'Chill\\ActivityBundle\\Entity\\Activity',
|
|
||||||
'entityId': activity.id
|
|
||||||
}) }}">{{ 'notification.Notify'|trans }}</a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
{% if context == 'person' and activity.accompanyingPeriod is not empty %}
|
|
||||||
{#
|
|
||||||
Disable person_id in following links, for redirect to accompanyingCourse context
|
|
||||||
#}
|
|
||||||
{% set person_id = null %}
|
|
||||||
{% set accompanying_course_id = activity.accompanyingPeriod.id %}
|
|
||||||
<li>
|
|
||||||
<a href="{{ chill_path_add_return_path('chill_activity_activity_list',{
|
|
||||||
'accompanying_period_id': accompanying_course_id
|
|
||||||
}) }}"
|
|
||||||
class="btn btn-primary"
|
|
||||||
title="{{ 'See activity in accompanying course context'|trans }}">
|
|
||||||
<i class="fa fa-random fa-fw"></i>
|
|
||||||
{{ 'Period number %number%'|trans({'%number%': accompanying_course_id}) }}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
<li>
|
|
||||||
<a href="{{ path('chill_activity_activity_show', {'id': activity.id,
|
|
||||||
'person_id': person_id,
|
|
||||||
'accompanying_period_id': accompanying_course_id
|
|
||||||
}) }}"
|
|
||||||
class="btn btn-show"
|
|
||||||
title="{{ 'Show'|trans }}"></a>
|
|
||||||
</li>
|
|
||||||
{% if no_action is not defined or no_action == false %}
|
|
||||||
{% if is_granted('CHILL_ACTIVITY_UPDATE', activity) %}
|
|
||||||
<li>
|
|
||||||
<a href="{{ path('chill_activity_activity_edit', {'id': activity.id,
|
|
||||||
'person_id': person_id,
|
|
||||||
'accompanying_period_id': accompanying_course_id
|
|
||||||
}) }}"
|
|
||||||
class="btn btn-update"
|
|
||||||
title="{{ 'Edit'|trans }}"></a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
{% if is_granted('CHILL_ACTIVITY_DELETE', activity) %}
|
|
||||||
<li>
|
|
||||||
<a href="{{ path('chill_activity_activity_delete', {'id': activity.id,
|
|
||||||
'person_id': person_id,
|
|
||||||
'accompanying_period_id': accompanying_course_id
|
|
||||||
}) }}"
|
|
||||||
class="btn btn-delete"
|
|
||||||
title="{{ 'Delete'|trans }}"></a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
{% endmacro %}
|
|
||||||
|
|
||||||
<div class="context-{{ context }}">
|
<div class="context-{{ context }}">
|
||||||
|
|
||||||
{% if activities|length == 0 %}
|
{% if activities|length == 0 %}
|
||||||
@@ -66,10 +8,56 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<div class="flex-table activity-list">
|
<div class="flex-table activity-list">
|
||||||
{% for activity in activities %}
|
{% for activity in activities %}
|
||||||
{% include 'ChillActivityBundle:Activity:_list_item.html.twig' with {
|
{% set t = activity.type %}
|
||||||
|
<div class="item-bloc">
|
||||||
|
<div class="item-row">
|
||||||
|
{% include '@ChillActivity/Activity/activity-badge-title.html.twig' %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if activity.comment.comment is not empty
|
||||||
|
or activity.persons|length > 0
|
||||||
|
or activity.thirdParties|length > 0
|
||||||
|
or activity.users|length > 0
|
||||||
|
%}
|
||||||
|
<div class="main">
|
||||||
|
{% if activity.comment.comment is not empty %}
|
||||||
|
{{ activity.comment|chill_entity_render_box({
|
||||||
|
'disable_markdown': false,
|
||||||
|
'limit_lines': 3,
|
||||||
|
'metadata': false,
|
||||||
|
}) }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {
|
||||||
'context': context,
|
'context': context,
|
||||||
'recordAction': _self.recordAction(activity, context, person_id, accompanying_course_id)
|
'with_display': 'row',
|
||||||
|
'entity': activity,
|
||||||
|
'badge_person': true
|
||||||
} %}
|
} %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<div class="item-row separator">
|
||||||
|
<div class="updatedBy"></div>
|
||||||
|
<ul class="record_actions">
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_activity_activity_show', { 'id': activity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}"
|
||||||
|
class="btn btn-sm btn-show "></a>
|
||||||
|
</li>
|
||||||
|
{% if no_action is not defined or no_action == false %}
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_activity_activity_edit', { 'id': activity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}"
|
||||||
|
class="btn btn-sm btn-update "></a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_activity_activity_delete', { 'id': activity.id, 'person_id' : person_id, 'accompanying_period_id': accompanying_course_id } ) }}"
|
||||||
|
class="btn btn-sm btn-delete "></a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@@ -4,17 +4,6 @@
|
|||||||
|
|
||||||
{% block title %}{{ 'Activity list' |trans }}{% endblock title %}
|
{% block title %}{{ 'Activity list' |trans }}{% endblock title %}
|
||||||
|
|
||||||
|
|
||||||
{% block js %}
|
|
||||||
{{ parent() }}
|
|
||||||
{{ encore_entry_script_tags('mod_notification_toggle_read_status') }}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block css %}
|
|
||||||
{{ parent() }}
|
|
||||||
{{ encore_entry_link_tags('mod_notification_toggle_read_status') }}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
{% set person_id = null %}
|
{% set person_id = null %}
|
||||||
@@ -34,8 +23,8 @@
|
|||||||
{% if is_granted('CHILL_ACTIVITY_CREATE', accompanyingCourse) %}
|
{% if is_granted('CHILL_ACTIVITY_CREATE', accompanyingCourse) %}
|
||||||
<ul class="record_actions sticky-form-buttons">
|
<ul class="record_actions sticky-form-buttons">
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_activity_activity_new', {'person_id': person_id, 'accompanying_period_id': accompanying_course_id}) }}"
|
<a href="{{ path('chill_activity_activity_new', {'person_id': person_id, 'accompanying_period_id': accompanying_course_id}) }}" class="btn btn-create">
|
||||||
class="btn btn-create">{{ 'Create'|trans }}
|
{{ 'Create'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@@ -20,16 +20,6 @@
|
|||||||
|
|
||||||
{% block title %}{{ 'Activity list' |trans }}{% endblock title %}
|
{% block title %}{{ 'Activity list' |trans }}{% endblock title %}
|
||||||
|
|
||||||
{% block js %}
|
|
||||||
{{ parent() }}
|
|
||||||
{{ encore_entry_script_tags('mod_notification_toggle_read_status') }}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block css %}
|
|
||||||
{{ parent() }}
|
|
||||||
{{ encore_entry_link_tags('mod_notification_toggle_read_status') }}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block personcontent %}
|
{% block personcontent %}
|
||||||
|
|
||||||
{% set person_id = null %}
|
{% set person_id = null %}
|
||||||
|
@@ -3,88 +3,10 @@
|
|||||||
{% set t = activity.type %}
|
{% set t = activity.type %}
|
||||||
|
|
||||||
<a href="{{ path('chill_activity_activity_show', { 'id': activity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}"
|
<a href="{{ path('chill_activity_activity_show', { 'id': activity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}"
|
||||||
class="dashboard-link" title="{{ 'Show the activity'|trans }}">
|
class="badge-link" title="{{ 'Show the activity'|trans }}">
|
||||||
|
|
||||||
<div class="dashboard">
|
{% include '@ChillActivity/Activity/activity-badge-title.html.twig' %}
|
||||||
<span class="title_label"></span>
|
|
||||||
<span class="title_action">
|
|
||||||
|
|
||||||
{%- if activity.date -%}
|
|
||||||
<p class="date-label">{{ activity.date|format_date('short') }}</p>
|
|
||||||
{%- endif -%}
|
|
||||||
|
|
||||||
<span class="like-h3">{{ activity.type.name | localize_translatable_string }}</span>
|
|
||||||
|
|
||||||
{% if activity.emergency %}
|
|
||||||
<span class="badge bg-danger rounded-pill fs-6">{{ 'Emergency'|trans|upper }}</span>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<ul class="small_in_title mt-3">
|
|
||||||
|
|
||||||
{% if activity.sentReceived is not empty and t.sentReceivedVisible %}
|
|
||||||
<li>
|
|
||||||
<span class="item-key">{{ 'Sent received'|trans ~ ' : ' }}</span>
|
|
||||||
<b>{{ activity.sentReceived|capitalize|trans }}</b>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if activity.location and t.locationVisible %}
|
|
||||||
<li>
|
|
||||||
<span class="item-key">{{ 'location'|trans ~ ': ' }}</span>
|
|
||||||
<b>
|
|
||||||
<span>{{ activity.location.locationType.title|localize_translatable_string }}</span>
|
|
||||||
{{ activity.location.name }}
|
|
||||||
</b>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if activity.user and t.userVisible %}
|
|
||||||
<li>
|
|
||||||
<span class="item-key">{{ 'Referrer'|trans ~ ': ' }}</span>
|
|
||||||
<b>{{ activity.user.usernameCanonical }}</b>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<li class="associated-persons">
|
|
||||||
<span class="item-key">{{ 'Participants'|trans ~ ' : ' }}</span>
|
|
||||||
{% for p in activity.personsAssociated %}
|
|
||||||
<span class="badge-person">{{ p|chill_entity_render_box }}</span>
|
|
||||||
{% endfor %}
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<ul class="list-content my-3">
|
|
||||||
{%- if t.reasonsVisible -%}
|
|
||||||
{%- if activity.reasons is not empty -%}
|
|
||||||
<li class="reasons">
|
|
||||||
{% for r in activity.reasons %}
|
|
||||||
{{ r|chill_entity_render_box }}
|
|
||||||
{% endfor %}
|
|
||||||
</li>
|
|
||||||
{%- endif -%}
|
|
||||||
{% endif %}
|
|
||||||
{%- if t.socialIssuesVisible %}
|
|
||||||
{%- if activity.socialIssues is not empty -%}
|
|
||||||
<li class="social-issues">
|
|
||||||
{% for r in activity.socialIssues %}
|
|
||||||
{{ r|chill_entity_render_box }}
|
|
||||||
{% endfor %}
|
|
||||||
</li>
|
|
||||||
{%- endif -%}
|
|
||||||
{% endif %}
|
|
||||||
{%- if t.socialActionsVisible -%}
|
|
||||||
{%- if activity.socialActions is not empty -%}
|
|
||||||
<li class="social-actions">
|
|
||||||
{% for r in activity.socialActions %}
|
|
||||||
{{ r|chill_entity_render_box }}
|
|
||||||
{% endfor %}
|
|
||||||
</li>
|
|
||||||
{%- endif -%}
|
|
||||||
{% endif %}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
@@ -1,16 +1,10 @@
|
|||||||
<h1>
|
<h1>{{ "Activity creation"|trans ~ ' :' }}</h1>
|
||||||
{{ "Activity creation"|trans }}
|
<h2 class="chill-green mb-4">{{ entity.type.name|localize_translatable_string }}</h2>
|
||||||
</h1>
|
|
||||||
<h2 class="badge-title mb-5">
|
|
||||||
<span class="title_label"></span>
|
|
||||||
<span class="title_action">
|
|
||||||
{{ entity.type.name | localize_translatable_string }}
|
|
||||||
</span>
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
{{ form_start(form) }}
|
{{ form_start(form) }}
|
||||||
{{ form_errors(form) }}
|
{{ form_errors(form) }}
|
||||||
|
|
||||||
|
|
||||||
{%- if form.emergency is defined -%}
|
{%- if form.emergency is defined -%}
|
||||||
{{ form_row(form.emergency) }}
|
{{ form_row(form.emergency) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -45,7 +39,7 @@
|
|||||||
|
|
||||||
{%- if form.persons is defined or form.thirdParties is defined or form.users is defined -%}
|
{%- if form.persons is defined or form.thirdParties is defined or form.users is defined -%}
|
||||||
|
|
||||||
<h2 class="chill-blue">{{ 'Concerned groups'|trans }}</h2>
|
<h2 class="chill-red">{{ 'Concerned groups'|trans }}</h2>
|
||||||
|
|
||||||
{%- if form.persons is defined -%}
|
{%- if form.persons is defined -%}
|
||||||
{{ form_widget(form.persons) }}
|
{{ form_widget(form.persons) }}
|
||||||
@@ -61,7 +55,7 @@
|
|||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<h2 class="chill-blue">{{ 'Activity data'|trans }}</h2>
|
<h2 class="chill-red">{{ 'Activity data'|trans }}</h2>
|
||||||
|
|
||||||
{%- if form.date is defined -%}
|
{%- if form.date is defined -%}
|
||||||
{{ form_row(form.date) }}
|
{{ form_row(form.date) }}
|
||||||
@@ -109,7 +103,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<button class="btn btn-save" type="submit">
|
<button class="btn btn-create" type="submit">
|
||||||
{{ 'Create'|trans }}
|
{{ 'Create'|trans }}
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block js %}
|
{% block js %}
|
||||||
{{ encore_entry_script_tags('mod_async_upload') }}
|
{{ encore_entry_link_tags('mod_async_upload') }}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.addEventListener('DOMContentLoaded', function (e) {
|
window.addEventListener('DOMContentLoaded', function (e) {
|
||||||
chill.displayAlertWhenLeavingUnsubmittedForm('form[name="{{ form.vars.form.vars.name }}"]',
|
chill.displayAlertWhenLeavingUnsubmittedForm('form[name="{{ form.vars.form.vars.name }}"]',
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
'activityData': activityData
|
'activityData': activityData
|
||||||
}) }}">
|
}) }}">
|
||||||
|
|
||||||
<div class="btn btn-primary">
|
<div class="bloc btn btn-primary btn-lg btn-block">
|
||||||
{{ activityType.name|localize_translatable_string }}
|
{{ activityType.name|localize_translatable_string }}
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
@@ -1,46 +1,26 @@
|
|||||||
{%- set t = entity.type -%}
|
{%- set t = entity.type -%}
|
||||||
{%- import "@ChillDocStore/Macro/macro.html.twig" as m -%}
|
{%- import "@ChillDocStore/Macro/macro.html.twig" as m -%}
|
||||||
|
|
||||||
<h1>{{ "Activity"|trans }}</h1>
|
<h1>
|
||||||
|
{{ "Activity"|trans }}
|
||||||
<div class="flex-table">
|
{%- if t.emergencyVisible and entity.emergency -%}
|
||||||
<div class="item-bloc">
|
<span class="badge bg-secondary">
|
||||||
|
{{- 'Emergency'|trans -}}
|
||||||
<div class="item-row">
|
|
||||||
<div class="wrap-list">
|
|
||||||
<div class="wl-row">
|
|
||||||
<div class="wl-col title">
|
|
||||||
{% if entity.date %}
|
|
||||||
<p class="date-label">
|
|
||||||
{{ entity.date|format_date('short') }}
|
|
||||||
</p>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<div class="wl-col list">
|
|
||||||
<h2 class="badge-title">
|
|
||||||
<span class="title_label"></span>
|
|
||||||
<span class="title_action">
|
|
||||||
{{ entity.type.name | localize_translatable_string }}
|
|
||||||
{% if entity.emergency %}
|
|
||||||
<span class="badge bg-danger rounded-pill fs-6 float-end">{{ 'Emergency'|trans|upper }}</span>
|
|
||||||
{% endif %}
|
|
||||||
</span>
|
</span>
|
||||||
</h2>
|
{%- endif -%}
|
||||||
</div>
|
</h1>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="item-row separator">
|
<dl class="chill_view_data">
|
||||||
<dl class="chill_view_data">
|
|
||||||
<dt class="inline">{{ 'Referrer'|trans|capitalize }}</dt>
|
<dt class="inline">{{ 'by'|trans|capitalize }}</dt>
|
||||||
<dd>{{ entity.user|chill_entity_render_box }}</dd>
|
<dd>{{ entity.user }}</dd>
|
||||||
|
|
||||||
|
<dt class="inline">{{ 'Type'|trans }}</dt>
|
||||||
|
<dd>{{ entity.type.name | localize_translatable_string }}</dd>
|
||||||
|
|
||||||
{%- if entity.scope -%}
|
{%- if entity.scope -%}
|
||||||
<dt class="inline">{{ 'Scope'|trans }}</dt>
|
<dt class="inline">{{ 'Scope'|trans }}</dt>
|
||||||
<dd>
|
<dd><span class="scope">{{ entity.scope.name|localize_translatable_string }}</span></dd>
|
||||||
<span class="scope">{{ entity.scope.name|localize_translatable_string }}</span>
|
|
||||||
</dd>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if t.socialIssuesVisible %}
|
{% if t.socialIssuesVisible %}
|
||||||
@@ -58,7 +38,7 @@
|
|||||||
<dt class="inline">{{ 'Social actions'|trans }}</dt>
|
<dt class="inline">{{ 'Social actions'|trans }}</dt>
|
||||||
<dd>
|
<dd>
|
||||||
{% if entity.socialActions|length == 0 %}
|
{% if entity.socialActions|length == 0 %}
|
||||||
<span class="chill-no-data-statement">{{ 'No social actions associated'|trans }}</span>
|
<p class="chill-no-data-statement">{{ 'No social actions associated'|trans }}</p>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% for sa in entity.socialActions %}{{ sa|chill_entity_render_box }}{% endfor %}
|
{% for sa in entity.socialActions %}{{ sa|chill_entity_render_box }}{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -67,34 +47,18 @@
|
|||||||
|
|
||||||
{% if t.reasonsVisible %}
|
{% if t.reasonsVisible %}
|
||||||
<dt class="inline">{{ 'Reasons'|trans }}</dt>
|
<dt class="inline">{{ 'Reasons'|trans }}</dt>
|
||||||
<dd>
|
|
||||||
{%- if entity.reasons is empty -%}
|
{%- if entity.reasons is empty -%}
|
||||||
<span class="chill-no-data-statement">{{ 'No reason associated'|trans }}</span>
|
<dd><span class="chill-no-data-statement">{{ 'No reason associated'|trans }}</span></dd>
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
{% for r in entity.reasons %}{{ r|chill_entity_render_box }}{% endfor %}
|
<dd>{% for r in entity.reasons %}{{ r|chill_entity_render_box }} {% endfor %}</dd>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
</dd>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
<h2 class="chill-red">{{ 'Concerned groups'|trans }}</h2>
|
||||||
</div>
|
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {'context': context, 'with_display': 'bloc', 'badge_person': 'true' } %}
|
||||||
|
|
||||||
<h2 class="chill-blue">{{ 'Concerned groups'|trans }}</h2>
|
<h2 class="chill-red">{{ 'Activity data'|trans }}</h2>
|
||||||
|
|
||||||
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {
|
|
||||||
'context': context,
|
|
||||||
'render': 'bloc',
|
|
||||||
'badge_person': 'true'
|
|
||||||
} %}
|
|
||||||
|
|
||||||
<h2 class="chill-blue">{{ 'Activity data'|trans }}</h2>
|
|
||||||
|
|
||||||
<div class="flex-table">
|
|
||||||
<div class="item-bloc">
|
|
||||||
|
|
||||||
<dl class="chill_view_data">
|
|
||||||
<dt class="inline">{{ 'Date'|trans }}</dt>
|
<dt class="inline">{{ 'Date'|trans }}</dt>
|
||||||
<dd>{{ entity.date|format_date('long') }}</dd>
|
<dd>{{ entity.date|format_date('long') }}</dd>
|
||||||
|
|
||||||
@@ -104,82 +68,61 @@
|
|||||||
{% if entity.location is not null %}
|
{% if entity.location is not null %}
|
||||||
<p>
|
<p>
|
||||||
{{ entity.location.name }}
|
{{ entity.location.name }}
|
||||||
<span>({{ entity.location.locationType.title|localize_translatable_string }})</span>
|
<span> ({{ entity.location.locationType.title|localize_translatable_string }})</span>
|
||||||
</p>
|
</p>
|
||||||
<div class="ms-3">{{ entity.location.address|chill_entity_render_box }}</div>
|
{{ entity.location.address|chill_entity_render_box }}
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
|
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</dd>
|
</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if t.durationTimeVisible and is_granted('CHILL_ACTIVITY_SEE_DETAILS', entity) %}
|
{% if t.durationTimeVisible %}
|
||||||
<dt class="inline">{{ 'Duration Time'|trans }}</dt>
|
<dt class="inline">{{ 'Duration Time'|trans }}</dt>
|
||||||
<dd>
|
<dd>{% if entity.durationTime is not null %}
|
||||||
{% if entity.durationTime is not null %}
|
|
||||||
{{ entity.durationTime|date('H:i') }}
|
{{ entity.durationTime|date('H:i') }}
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="chill-no-data-statement">{{ 'None'|trans|capitalize }}</span>
|
{{ 'None'|trans|capitalize }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</dd>
|
</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if t.travelTimeVisible and is_granted('CHILL_ACTIVITY_SEE_DETAILS', entity) %}
|
{% if t.travelTimeVisible %}
|
||||||
<dt class="inline">{{ 'Travel time'|trans }}</dt>
|
<dt class="inline">{{ 'Travel time'|trans }}</dt>
|
||||||
<dd>
|
<dd>{% if entity.travelTime is not null %}
|
||||||
{% if entity.travelTime is not null %}
|
|
||||||
{{ entity.travelTime|date('H:i') }}
|
{{ entity.travelTime|date('H:i') }}
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="chill-no-data-statement">{{ 'None'|trans|capitalize }}</span>
|
{{ 'None'|trans|capitalize }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</dd>
|
</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if t.commentVisible and is_granted('CHILL_ACTIVITY_SEE_DETAILS', entity) %}
|
{% if t.commentVisible %}
|
||||||
<dt class="inline">{{ 'activity.comment'|trans }}</dt>
|
<dt class="inline">{{ 'activity.comment'|trans }}</dt>
|
||||||
<dd>
|
|
||||||
{%- if entity.comment.empty -%}
|
{%- if entity.comment.empty -%}
|
||||||
<span class="chill-no-data-statement">{{ 'No comment associated'|trans }}</span>
|
<dd><span class="chill-no-data-statement">{{ 'No comment associated'|trans }}</span></dd>
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
{{ entity.comment|chill_entity_render_box }}
|
<dd>{{ entity.comment|chill_entity_render_box }}</dd>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
</dd>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if t.documentsVisible and is_granted('CHILL_ACTIVITY_SEE_DETAILS', entity) %}
|
{% if t.documentsVisible and entity.documents|length > 0 %}
|
||||||
<dt class="inline">{{ 'Documents'|trans }}</dt>
|
<dt>{{ 'Documents'|trans }}</dt>
|
||||||
<dd>
|
<dd>
|
||||||
{% if entity.documents|length > 0 %}
|
|
||||||
<ul>
|
<ul>
|
||||||
{% for d in entity.documents %}
|
{% for d in entity.documents %}
|
||||||
<li>{{ m.download_button(d) }}</li>
|
<li>{{ m.download_button(d) }}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% else %}
|
|
||||||
<span class="chill-no-data-statement">{{ 'Any document found'|trans }}</span>
|
|
||||||
{% endif %}
|
|
||||||
</dd>
|
</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if t.attendeeVisible and is_granted('CHILL_ACTIVITY_SEE_DETAILS', entity) %}
|
{% if t.attendeeVisible %}
|
||||||
<dt class="inline">{{ 'Attendee'|trans }}</dt>
|
<dt class="inline">{{ 'Attendee'|trans }}</dt>
|
||||||
<dd>
|
<dd>{% if entity.attendee is not null %}{% if entity.attendee %}{{ 'present'|trans|capitalize }} {% else %} {{ 'not present'|trans|capitalize }}{% endif %}{% else %}{{ 'None'|trans|capitalize }}{% endif %}</dd>
|
||||||
{% if entity.attendee is not null %}
|
|
||||||
{% if entity.attendee %}
|
|
||||||
{{ 'present'|trans|capitalize }}
|
|
||||||
{% else %}
|
|
||||||
{{ 'not present'|trans|capitalize }}
|
|
||||||
{% endif %}
|
|
||||||
{% else %}
|
|
||||||
<span class="chill-no-data-statement">{{ 'None'|trans|capitalize }}</span>
|
|
||||||
{% endif %}
|
|
||||||
</dd>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% set person_id = null %}
|
{% set person_id = null %}
|
||||||
{% if person %}
|
{% if person %}
|
||||||
@@ -197,18 +140,23 @@
|
|||||||
{{ 'Back to the list'|trans }}
|
{{ 'Back to the list'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% if is_granted('CHILL_ACTIVITY_UPDATE', entity) %}
|
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-update" href="{{ path('chill_activity_activity_edit', { 'id': entity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}">
|
<a class="btn btn-update" href="{{ path('chill_activity_activity_edit', { 'id': entity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}">
|
||||||
{{ 'Edit'|trans }}
|
{{ 'Edit'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
|
||||||
|
{# TODO
|
||||||
{% if is_granted('CHILL_ACTIVITY_DELETE', entity) %}
|
{% if is_granted('CHILL_ACTIVITY_DELETE', entity) %}
|
||||||
|
#}
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_activity_activity_delete', { 'id': entity.id, 'person_id' : person_id, 'accompanying_period_id': accompanying_course_id } ) }}" class="btn btn-delete">
|
<a href="{{ path('chill_activity_activity_delete', { 'id': entity.id, 'person_id' : person_id, 'accompanying_period_id': accompanying_course_id } ) }}" class="btn btn-delete">
|
||||||
{{ 'Delete'|trans }}
|
{{ 'Delete'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
{#
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
#}
|
||||||
</ul>
|
</ul>
|
||||||
|
@@ -4,40 +4,12 @@
|
|||||||
|
|
||||||
{% block title 'Show the activity'|trans %}
|
{% block title 'Show the activity'|trans %}
|
||||||
|
|
||||||
{% block js %}
|
|
||||||
{{ parent() }}
|
|
||||||
{{ encore_entry_script_tags('mod_notification_toggle_read_status') }}
|
|
||||||
{{ encore_entry_script_tags('mod_async_upload') }}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block css %}
|
|
||||||
{{ parent() }}
|
|
||||||
{{ encore_entry_link_tags('mod_notification_toggle_read_status') }}
|
|
||||||
{{ encore_entry_link_tags('mod_async_upload') }}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %}
|
{% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %}
|
||||||
|
|
||||||
{% block content -%}
|
{% block content -%}
|
||||||
<div class="activity-show">
|
<div class="activity-show">
|
||||||
|
|
||||||
{% include 'ChillActivityBundle:Activity:show.html.twig' with {'context': 'accompanyingCourse'} %}
|
{% include 'ChillActivityBundle:Activity:show.html.twig' with {'context': 'accompanyingCourse'} %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
||||||
{% block block_post_menu %}
|
|
||||||
<div class="post-menu pt-4">
|
|
||||||
|
|
||||||
<div class="d-grid gap-2">
|
|
||||||
<a class="btn btn-primary" href="{{ chill_path_add_return_path('chill_main_notification_create', {'entityClass': 'Chill\\ActivityBundle\\Entity\\Activity', 'entityId': entity.id}) }}">
|
|
||||||
<i class="fa fa-paper-plane fa-fw"></i>
|
|
||||||
{{ 'notification.Notify'|trans }}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% set notifications = chill_list_notifications('Chill\\ActivityBundle\\Entity\\Activity', entity.id) %}
|
|
||||||
{% if notifications is not empty %}
|
|
||||||
{{ notifications|raw }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
||||||
|
@@ -1,27 +1,2 @@
|
|||||||
{% macro recordAction(activity) %}
|
|
||||||
<li>
|
|
||||||
<a href="{{ path('chill_activity_activity_show', {'id': activity.id }) }}"
|
|
||||||
class="btn btn-show" title="{{ 'Show the activity'|trans }}"></a>
|
|
||||||
</li>
|
|
||||||
{% endmacro %}
|
|
||||||
|
|
||||||
{% if activity is not null %}
|
<a href="{{ path('chill_activity_activity_show', {'id': notification.relatedEntityId }) }}">Go to Activity</a>
|
||||||
<div class="flex-table">
|
|
||||||
{% if is_granted('CHILL_ACTIVITY_SEE', activity) %}
|
|
||||||
{% include 'ChillActivityBundle:Activity:_list_item.html.twig' with {
|
|
||||||
'recordAction': _self.recordAction(activity),
|
|
||||||
'context': 'accompanyingCourse',
|
|
||||||
'itemBlocClass': 'bg-chill-llight-gray'
|
|
||||||
} %}
|
|
||||||
{% else %}
|
|
||||||
<div class="alert alert-warning border-warning border-1">
|
|
||||||
{{ 'This is the minimal activity data'|trans ~ ': ' ~ activity.id }}<br>
|
|
||||||
{{ 'you are not allowed to see it details'|trans }}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
<div class="alert alert-warning border-warning border-1">
|
|
||||||
{{ 'You get notified of an activity which does not exists any more'|trans }}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
@@ -4,40 +4,12 @@
|
|||||||
|
|
||||||
{% block title 'Show the activity'|trans %}
|
{% block title 'Show the activity'|trans %}
|
||||||
|
|
||||||
{% block js %}
|
|
||||||
{{ parent() }}
|
|
||||||
{{ encore_entry_script_tags('mod_notification_toggle_read_status') }}
|
|
||||||
{{ encore_entry_link_tags('mod_async_upload') }}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block css %}
|
|
||||||
{{ parent() }}
|
|
||||||
{{ encore_entry_link_tags('mod_notification_toggle_read_status') }}
|
|
||||||
{{ encore_entry_link_tags('mod_async_upload') }}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %}
|
{% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %}
|
||||||
|
|
||||||
{% block personcontent -%}
|
{% block personcontent -%}
|
||||||
<div class="activity-show">
|
<div class="activity-show">
|
||||||
|
|
||||||
{% include 'ChillActivityBundle:Activity:show.html.twig' with {'context': 'person'} %}
|
{% include 'ChillActivityBundle:Activity:show.html.twig' with {'context': 'person'} %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock personcontent %}
|
{% endblock personcontent %}
|
||||||
|
|
||||||
{% block block_post_menu %}
|
|
||||||
<div class="post-menu pt-4">
|
|
||||||
|
|
||||||
<div class="d-grid gap-2">
|
|
||||||
<a class="btn btn-primary" href="{{ chill_path_add_return_path('chill_main_notification_create', {'entityClass': 'Chill\\ActivityBundle\\Entity\\Activity', 'entityId': entity.id}) }}">
|
|
||||||
<i class="fa fa-paper-plane fa-fw"></i>
|
|
||||||
{{ 'notification.Notify'|trans }}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% set notifications = chill_list_notifications('Chill\\ActivityBundle\\Entity\\Activity', entity.id) %}
|
|
||||||
{% if notifications is not empty %}
|
|
||||||
{{ notifications|raw }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
||||||
|
@@ -15,7 +15,6 @@ use Chill\MainBundle\Entity\Center;
|
|||||||
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
|
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
|
||||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||||
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
|
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||||
@@ -65,10 +64,8 @@ class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierar
|
|||||||
|
|
||||||
protected function supports($attribute, $subject)
|
protected function supports($attribute, $subject)
|
||||||
{
|
{
|
||||||
if (
|
if ($subject instanceof Center
|
||||||
$subject instanceof Center
|
&& in_array($attribute, $this->getAttributes(), true)) {
|
||||||
&& in_array($attribute, $this->getAttributes(), true)
|
|
||||||
) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,7 +24,6 @@ use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
|||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||||
@@ -93,8 +92,6 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
|
|||||||
public function getRoles(): array
|
public function getRoles(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
self::SEE,
|
|
||||||
self::SEE_DETAILS,
|
|
||||||
self::CREATE_PERSON,
|
self::CREATE_PERSON,
|
||||||
self::CREATE_ACCOMPANYING_COURSE,
|
self::CREATE_ACCOMPANYING_COURSE,
|
||||||
self::UPDATE,
|
self::UPDATE,
|
||||||
|
@@ -66,7 +66,7 @@ final class ActivityReasonCategoryControllerTest extends WebTestCase
|
|||||||
$crawler = $client->followRedirect();
|
$crawler = $client->followRedirect();
|
||||||
|
|
||||||
// Check the entity has been delete on the list
|
// Check the entity has been delete on the list
|
||||||
$this->assertDoesNotMatchRegularExpression('/Foo/', $client->getResponse()->getContent());
|
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@@ -66,7 +66,7 @@ final class ActivityReasonControllerTest extends WebTestCase
|
|||||||
$crawler = $client->followRedirect();
|
$crawler = $client->followRedirect();
|
||||||
|
|
||||||
// Check the entity has been delete on the list
|
// Check the entity has been delete on the list
|
||||||
$this->assertDoesNotMatchRegularExpression('/Foo/', $client->getResponse()->getContent());
|
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@@ -66,7 +66,7 @@ final class ActivityTypeControllerTest extends WebTestCase
|
|||||||
$crawler = $client->followRedirect();
|
$crawler = $client->followRedirect();
|
||||||
|
|
||||||
// Check the entity has been delete on the list
|
// Check the entity has been delete on the list
|
||||||
$this->assertDoesNotMatchRegularExpression('/Foo/', $client->getResponse()->getContent());
|
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@@ -26,7 +26,7 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
|
|||||||
*/
|
*/
|
||||||
private $aggregator;
|
private $aggregator;
|
||||||
|
|
||||||
protected function setUp(): void
|
public function setUp()
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@ final class ActivityTypeAggregatorTest extends AbstractAggregatorTest
|
|||||||
*/
|
*/
|
||||||
private $aggregator;
|
private $aggregator;
|
||||||
|
|
||||||
protected function setUp(): void
|
public function setUp()
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@ final class ActivityUserAggregatorTest extends AbstractAggregatorTest
|
|||||||
*/
|
*/
|
||||||
private $aggregator;
|
private $aggregator;
|
||||||
|
|
||||||
protected function setUp(): void
|
public function setUp()
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@ final class CountActivityTest extends AbstractExportTest
|
|||||||
*/
|
*/
|
||||||
private $export;
|
private $export;
|
||||||
|
|
||||||
protected function setUp(): void
|
public function setUp()
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@ final class ListActivityTest extends AbstractExportTest
|
|||||||
*/
|
*/
|
||||||
private $export;
|
private $export;
|
||||||
|
|
||||||
protected function setUp(): void
|
public function setUp()
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@ final class StatActivityDurationSumTest extends AbstractExportTest
|
|||||||
*/
|
*/
|
||||||
private $export;
|
private $export;
|
||||||
|
|
||||||
protected function setUp(): void
|
public function setUp()
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
|
@@ -25,7 +25,7 @@ final class ActivityReasonFilterTest extends AbstractFilterTest
|
|||||||
*/
|
*/
|
||||||
private $filter;
|
private $filter;
|
||||||
|
|
||||||
protected function setUp(): void
|
public function setUp()
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest
|
|||||||
*/
|
*/
|
||||||
private $filter;
|
private $filter;
|
||||||
|
|
||||||
protected function setUp(): void
|
public function setUp()
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
|
@@ -45,7 +45,7 @@ final class ActivityTypeTest extends KernelTestCase
|
|||||||
*/
|
*/
|
||||||
protected $user;
|
protected $user;
|
||||||
|
|
||||||
protected function setUp(): void
|
public function setUp()
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ final class TranslatableActivityReasonTest extends TypeTestCase
|
|||||||
*/
|
*/
|
||||||
private static $prophet;
|
private static $prophet;
|
||||||
|
|
||||||
protected function setUp(): void
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
}
|
}
|
||||||
|
@@ -31,7 +31,7 @@ final class TranslatableActivityTypeTest extends KernelTestCase
|
|||||||
*/
|
*/
|
||||||
protected $container;
|
protected $container;
|
||||||
|
|
||||||
protected function setUp(): void
|
public function setUp()
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
|
@@ -44,7 +44,7 @@ final class ActivityVoterTest extends KernelTestCase
|
|||||||
*/
|
*/
|
||||||
protected $voter;
|
protected $voter;
|
||||||
|
|
||||||
protected function setUp(): void
|
public function setUp()
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$this->voter = self::$kernel->getContainer()
|
$this->voter = self::$kernel->getContainer()
|
||||||
|
@@ -24,7 +24,6 @@ use RuntimeException;
|
|||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Symfony\Component\Security\Core\User\UserInterface;
|
use Symfony\Component\Security\Core\User\UserInterface;
|
||||||
|
|
||||||
use function implode;
|
use function implode;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
use function strtr;
|
use function strtr;
|
||||||
|
@@ -17,7 +17,6 @@ use Symfony\Component\Validator\Constraint;
|
|||||||
use Symfony\Component\Validator\ConstraintValidator;
|
use Symfony\Component\Validator\ConstraintValidator;
|
||||||
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
||||||
use Symfony\Component\Validator\Exception\UnexpectedValueException;
|
use Symfony\Component\Validator\Exception\UnexpectedValueException;
|
||||||
|
|
||||||
use function array_merge;
|
use function array_merge;
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
|
@@ -1,15 +0,0 @@
|
|||||||
services:
|
|
||||||
Chill\ActivityBundle\EntityListener\ActivityEntityListener:
|
|
||||||
autowire: true
|
|
||||||
autoconfigure: true
|
|
||||||
tags:
|
|
||||||
-
|
|
||||||
name: 'doctrine.orm.entity_listener'
|
|
||||||
event: 'postPersist'
|
|
||||||
entity: 'Chill\ActivityBundle\Entity\Activity'
|
|
||||||
method: 'persistActionToCourse'
|
|
||||||
-
|
|
||||||
name: 'doctrine.orm.entity_listener'
|
|
||||||
event: 'postUpdate'
|
|
||||||
entity: 'Chill\ActivityBundle\Entity\Activity'
|
|
||||||
method: 'persistActionToCourse'
|
|
@@ -13,7 +13,6 @@ namespace Chill\Migrations\Activity;
|
|||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,34 +0,0 @@
|
|||||||
<?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\Migrations\Activity;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
final class Version20211207152023 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->throwIrreversibleMigrationException('placevisible and placelabel could not be created');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return 'DROP place visible and place label, which are replaced by location';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql('ALTER TABLE activitytype DROP placevisible');
|
|
||||||
$this->addSql('ALTER TABLE activitytype DROP placelabel');
|
|
||||||
}
|
|
||||||
}
|
|
@@ -76,7 +76,7 @@ activity:
|
|||||||
Insert a document: Insérer un document
|
Insert a document: Insérer un document
|
||||||
Remove a document: Supprimer le document
|
Remove a document: Supprimer le document
|
||||||
comment: Commentaire
|
comment: Commentaire
|
||||||
No documents: Pas de documents
|
|
||||||
|
|
||||||
#timeline
|
#timeline
|
||||||
'%user% has done an %activity_type%': '%user% a effectué une activité de type "%activity_type%"'
|
'%user% has done an %activity_type%': '%user% a effectué une activité de type "%activity_type%"'
|
||||||
@@ -146,8 +146,8 @@ User visible: Visibilité du champ Utilisateur
|
|||||||
User label: Libellé du champ Utilisateur
|
User label: Libellé du champ Utilisateur
|
||||||
Date visible: Visibilité du champ Date
|
Date visible: Visibilité du champ Date
|
||||||
Date label: Libellé du champ Date
|
Date label: Libellé du champ Date
|
||||||
Location visible: Visibilité du champ Lieu
|
Place visible: Visibilité du champ Lieu
|
||||||
Location label: Libellé du champ Lieu
|
Place label: Libellé du champ Lieu
|
||||||
Third parties visible: Visibilité du champ Tiers
|
Third parties visible: Visibilité du champ Tiers
|
||||||
Third parties label: Libellé du champ Tiers
|
Third parties label: Libellé du champ Tiers
|
||||||
Duration time visible: Visibilité du champ Durée
|
Duration time visible: Visibilité du champ Durée
|
||||||
@@ -222,9 +222,3 @@ Aggregate by activity type: Aggréger par type d'activité
|
|||||||
Aggregate by activity reason: Aggréger par sujet de l'activité
|
Aggregate by activity reason: Aggréger par sujet de l'activité
|
||||||
|
|
||||||
Last activities: Les dernières activités
|
Last activities: Les dernières activités
|
||||||
|
|
||||||
See activity in accompanying course context: Voir l'activité dans le contexte du parcours d'accompagnement
|
|
||||||
|
|
||||||
You get notified of an activity which does not exists any more: Cette notification ne correspond pas à une activité valide.
|
|
||||||
you are not allowed to see it details: La notification fait référence à une activité à laquelle vous n'avez pas accès.
|
|
||||||
This is the minimal activity data: Activité n°
|
|
||||||
|
@@ -19,7 +19,6 @@ use DateTimeImmutable;
|
|||||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
|
|
||||||
use function random_int;
|
use function random_int;
|
||||||
|
|
||||||
class LoadAsideActivity extends Fixture implements DependentFixtureInterface
|
class LoadAsideActivity extends Fixture implements DependentFixtureInterface
|
||||||
|
@@ -18,12 +18,10 @@ class LoadAsideActivityCategory extends \Doctrine\Bundle\FixturesBundle\Fixture
|
|||||||
{
|
{
|
||||||
public function load(ObjectManager $manager)
|
public function load(ObjectManager $manager)
|
||||||
{
|
{
|
||||||
foreach (
|
foreach ([
|
||||||
[
|
|
||||||
'Appel téléphonique',
|
'Appel téléphonique',
|
||||||
'Formation',
|
'Formation',
|
||||||
] as $key => $label
|
] as $key => $label) {
|
||||||
) {
|
|
||||||
$category = new AsideActivityCategory();
|
$category = new AsideActivityCategory();
|
||||||
$category->setTitle(['fr' => $label]);
|
$category->setTitle(['fr' => $label]);
|
||||||
$manager->persist($category);
|
$manager->persist($category);
|
||||||
|
@@ -13,7 +13,6 @@ namespace Chill\AsideActivityBundle\DependencyInjection;
|
|||||||
|
|
||||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||||
|
|
||||||
use function is_int;
|
use function is_int;
|
||||||
|
|
||||||
class Configuration implements ConfigurationInterface
|
class Configuration implements ConfigurationInterface
|
||||||
|
@@ -162,12 +162,8 @@ class AsideActivityCategory
|
|||||||
public function setParent(?self $parent): self
|
public function setParent(?self $parent): self
|
||||||
{
|
{
|
||||||
// cache the old result for changing it during validaiton
|
// cache the old result for changing it during validaiton
|
||||||
if ($this->parent) {
|
|
||||||
$this->oldParent = $this->parent;
|
$this->oldParent = $this->parent;
|
||||||
}
|
|
||||||
|
|
||||||
$this->parent = $parent;
|
$this->parent = $parent;
|
||||||
dump($this);
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@@ -32,7 +32,6 @@ use Symfony\Component\Form\FormEvent;
|
|||||||
use Symfony\Component\Form\FormEvents;
|
use Symfony\Component\Form\FormEvents;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
final class AsideActivityFormType extends AbstractType
|
final class AsideActivityFormType extends AbstractType
|
||||||
@@ -138,7 +137,7 @@ final class AsideActivityFormType extends AbstractType
|
|||||||
$timezoneUTC = new DateTimeZone('GMT');
|
$timezoneUTC = new DateTimeZone('GMT');
|
||||||
/** @var DateTimeImmutable $data */
|
/** @var DateTimeImmutable $data */
|
||||||
$data = $formEvent->getData() === null ?
|
$data = $formEvent->getData() === null ?
|
||||||
DateTime::createFromFormat('U', '300') :
|
DateTime::createFromFormat('U', 300) :
|
||||||
$formEvent->getData();
|
$formEvent->getData();
|
||||||
$seconds = $data->getTimezone()->getOffset($data);
|
$seconds = $data->getTimezone()->getOffset($data);
|
||||||
$data->setTimeZone($timezoneUTC);
|
$data->setTimeZone($timezoneUTC);
|
||||||
|
@@ -13,7 +13,6 @@ namespace Chill\AsideActivityBundle\Menu;
|
|||||||
|
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\Security\Core\Security;
|
use Symfony\Component\Security\Core\Security;
|
||||||
|
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
final class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface
|
final class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface
|
||||||
|
@@ -26,7 +26,7 @@ final class AsideActivityControllerTest extends WebTestCase
|
|||||||
{
|
{
|
||||||
use PrepareClientTrait;
|
use PrepareClientTrait;
|
||||||
|
|
||||||
protected function setUp(): void
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
@@ -13,7 +13,6 @@ namespace Chill\AMLI\BudgetBundle\Calculator;
|
|||||||
|
|
||||||
use Chill\AMLI\BudgetBundle\Entity\AbstractElement;
|
use Chill\AMLI\BudgetBundle\Entity\AbstractElement;
|
||||||
use OutOfBoundsException;
|
use OutOfBoundsException;
|
||||||
|
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
use function array_keys;
|
use function array_keys;
|
||||||
use function implode;
|
use function implode;
|
||||||
|
@@ -21,7 +21,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
use function get_class;
|
use function get_class;
|
||||||
|
|
||||||
abstract class AbstractElementController extends Controller
|
abstract class AbstractElementController extends Controller
|
||||||
|
@@ -22,7 +22,6 @@ use Psr\Log\LoggerInterface;
|
|||||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
use function array_merge;
|
use function array_merge;
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
|
@@ -21,7 +21,6 @@ use Symfony\Component\Form\Extension\Core\Type\MoneyType;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
use function array_flip;
|
use function array_flip;
|
||||||
use function asort;
|
use function asort;
|
||||||
|
|
||||||
|
@@ -21,7 +21,6 @@ use Symfony\Component\Form\Extension\Core\Type\MoneyType;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
use function array_flip;
|
use function array_flip;
|
||||||
|
|
||||||
class ResourceType extends AbstractType
|
class ResourceType extends AbstractType
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user