mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-12 17:55:00 +00:00
Compare commits
1 Commits
v3.0.0-alp
...
226-upgrad
Author | SHA1 | Date | |
---|---|---|---|
b19a1ba53b
|
@@ -1,5 +0,0 @@
|
|||||||
kind: Feature
|
|
||||||
body: '[DX] move async-upload-bundle features into chill-bundles'
|
|
||||||
time: 2023-12-12T15:48:41.954970271+01:00
|
|
||||||
custom:
|
|
||||||
Issue: "221"
|
|
5
.changes/unreleased/Fixed-20231127-210138.yaml
Normal file
5
.changes/unreleased/Fixed-20231127-210138.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
kind: Fixed
|
||||||
|
body: 'Export: fix list person with custom fields'
|
||||||
|
time: 2023-11-27T21:01:38.260730706+01:00
|
||||||
|
custom:
|
||||||
|
Issue: ""
|
@@ -1,6 +0,0 @@
|
|||||||
kind: Fixed
|
|
||||||
body: Fix resolving of centers for an household, which will fix in turn the access
|
|
||||||
control
|
|
||||||
time: 2024-04-10T10:37:36.462484988+02:00
|
|
||||||
custom:
|
|
||||||
Issue: ""
|
|
@@ -1,5 +0,0 @@
|
|||||||
## v2.14.1 - 2023-11-29
|
|
||||||
### Fixed
|
|
||||||
* Export: fix list person with custom fields
|
|
||||||
* ([#100](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/100)) Add a paginator to budget elements (resource and charge types) in the admin
|
|
||||||
* Fix error in ListEvaluation when "handling agents" are alone
|
|
@@ -1,11 +0,0 @@
|
|||||||
## v2.15.0 - 2023-12-11
|
|
||||||
### Feature
|
|
||||||
* ([#191](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/191)) Add export "number of household associate with an exchange"
|
|
||||||
* ([#235](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/235)) Export: add dates on the filter "filter course by activity type"
|
|
||||||
### Fixed
|
|
||||||
* ([#214](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/214)) Fix error when posting an empty comment on an accompanying period.
|
|
||||||
* ([#233](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/233)) Fix "filter evaluation by evaluation type" (and add select2 to the list of evaluation types to pick)
|
|
||||||
* ([#234](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/234)) Fix "filter aside activity by date"
|
|
||||||
|
|
||||||
* ([#228](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/228)) Fix export of activity for people created before the introduction of the createdAt column on person (during v1)
|
|
||||||
* ([#246](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/246)) Do not show activities, evaluations and social work when associated to a confidential accompanying period, except for the users which are allowed to see them
|
|
@@ -1,5 +0,0 @@
|
|||||||
## v2.15.1 - 2023-12-20
|
|
||||||
### Fixed
|
|
||||||
* Fix the household export query to exclude accompanying periods that are in draft state.
|
|
||||||
### DX
|
|
||||||
* ([#167](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/167)) Fixed readthedocs compilation by updating readthedocs config file and requirements for Sphinx
|
|
@@ -1,5 +0,0 @@
|
|||||||
## v2.15.2 - 2024-01-11
|
|
||||||
### Fixed
|
|
||||||
* Fix the id_seq used when creating a new accompanying period participation during fusion of two person files
|
|
||||||
### DX
|
|
||||||
* Set placeholder to False for expanded EntityType form fields where required is set to False.
|
|
@@ -1,15 +0,0 @@
|
|||||||
## v2.16.0 - 2024-02-08
|
|
||||||
### Feature
|
|
||||||
* ([#231](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/231)) Create new filter for persons having a participation in an accompanying period during a certain time span
|
|
||||||
* ([#241](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/241)) [Export][List of accompanyign period] Add two columns: the list of persons participating to the period, and their ids
|
|
||||||
* ([#244](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/244)) Add capability to generate export about change of steps of accompanying period, and generate exports for this
|
|
||||||
* ([#253](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/253)) Export: group accompanying period by person participating
|
|
||||||
* ([#243](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/243)) Export: add filter for courses not linked to a reference address
|
|
||||||
* ([#229](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/229)) Allow to group activities linked with accompanying period by reason
|
|
||||||
* ([#115](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/115)) Prevent social work to be saved when another user edited conccurently the social work
|
|
||||||
* Modernize the event bundle, with some new fields and multiple improvements
|
|
||||||
### Fixed
|
|
||||||
* ([#220](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/220)) Fix error in logs about wrong typing of eventArgs in onEditNotificationComment method
|
|
||||||
* ([#256](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/256)) Fix the conditions upon which social actions should be optional or required in relation to social issues within the activity creation form
|
|
||||||
### UX
|
|
||||||
* ([#260](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/260)) Order list of centers alphabetically in dropdown 'user' section admin.
|
|
@@ -1,3 +0,0 @@
|
|||||||
## v2.16.1 - 2024-02-09
|
|
||||||
### Fixed
|
|
||||||
* Force bootstrap version to avoid error in builds with newer version
|
|
@@ -1,3 +0,0 @@
|
|||||||
## v2.16.2 - 2024-02-21
|
|
||||||
### Fixed
|
|
||||||
* Check for null values in closing motive of parcours d'accompagnement for correct rendering of template
|
|
@@ -1,5 +0,0 @@
|
|||||||
## v2.16.3 - 2024-02-26
|
|
||||||
### Fixed
|
|
||||||
* ([#236](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/236)) Fix translation of user job -> 'service' must be 'métier'
|
|
||||||
### UX
|
|
||||||
* ([#232](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/232)) Order user jobs and services alphabetically in export filters
|
|
@@ -1,9 +0,0 @@
|
|||||||
## v2.17.0 - 2024-03-19
|
|
||||||
### Feature
|
|
||||||
* ([#237](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/237)) New export filter for social actions with an evaluation created between two dates
|
|
||||||
* ([#258](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/258)) In the list of accompangying period, add the list of person's centers and the duration of the course
|
|
||||||
* ([#238](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/238)) Allow to customize list person with new fields
|
|
||||||
* ([#159](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/159)) Admin can publish news on the homepage
|
|
||||||
### Fixed
|
|
||||||
* ([#264](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/264)) Fix languages: load the languages in all availables languages configured for Chill
|
|
||||||
* ([#259](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/259)) Keep a consistent behaviour between the filtering of activities within the document generation (model "accompanying period with activities"), and the same filter in the list of activities for an accompanying period
|
|
@@ -1,5 +0,0 @@
|
|||||||
## v2.18.0 - 2024-03-26
|
|
||||||
### Feature
|
|
||||||
* ([#268](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/268)) Improve admin UX to configure document templates for document generation
|
|
||||||
### Fixed
|
|
||||||
* ([#267](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/267)) Fix the join between job and user in the user list (admin): show only the current user job
|
|
@@ -1,3 +0,0 @@
|
|||||||
## v2.18.1 - 2024-03-26
|
|
||||||
### Fixed
|
|
||||||
* Fix layout issue in document generation for admin (minor)
|
|
@@ -23,7 +23,3 @@ max_line_length = 0
|
|||||||
indent_size = 2
|
indent_size = 2
|
||||||
indent_style = space
|
indent_style = space
|
||||||
|
|
||||||
[.rst]
|
|
||||||
ident_size = 3
|
|
||||||
ident_style = space
|
|
||||||
|
|
||||||
|
94
.env
94
.env
@@ -1,94 +0,0 @@
|
|||||||
# * .env contains default values for the environment variables needed by the app
|
|
||||||
# * .env.local uncommitted file with local overrides
|
|
||||||
# * .env.$APP_ENV committed environment-specific defaults
|
|
||||||
# * .env.$APP_ENV.local uncommitted environment-specific overrides
|
|
||||||
#
|
|
||||||
# Real environment variables win over .env files.
|
|
||||||
#
|
|
||||||
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
|
|
||||||
# https://symfony.com/doc/current/configuration/secrets.html
|
|
||||||
#
|
|
||||||
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
|
|
||||||
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
|
|
||||||
|
|
||||||
## Locale
|
|
||||||
LOCALE=fr
|
|
||||||
|
|
||||||
###> symfony/framework-bundle ###
|
|
||||||
# this should be set in docker-compose.yml file
|
|
||||||
APP_ENV=prod
|
|
||||||
APP_SECRET=ChangeItf2b58287ef7f9976409d3f6c72529e99ChangeIt
|
|
||||||
TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
|
|
||||||
TRUSTED_HOSTS='^(localhost|example\.com|nginx)$'
|
|
||||||
###< symfony/framework-bundle ###
|
|
||||||
|
|
||||||
## Wopi server for editing documents online
|
|
||||||
WOPI_SERVER=http://collabora:9980
|
|
||||||
|
|
||||||
# must be manually set in .env.local
|
|
||||||
# ADMIN_PASSWORD=
|
|
||||||
|
|
||||||
###> symfony/mailer ###
|
|
||||||
# MAILER_DSN=null://null
|
|
||||||
###< symfony/mailer ###
|
|
||||||
|
|
||||||
## Notifications
|
|
||||||
NOTIFICATION_HOST=localhost:8001
|
|
||||||
NOTIFICATION_FROM_EMAIL=admin@chill.social
|
|
||||||
NOTIFICATION_FROM_NAME="Chill <admin@chill.social>"
|
|
||||||
|
|
||||||
## Pgadmin credential
|
|
||||||
PGADMIN_DEFAULT_EMAIL=
|
|
||||||
PGADMIN_DEFAULT_PASSWORD=
|
|
||||||
|
|
||||||
## OVH OpenStack Storage Container
|
|
||||||
ASYNC_UPLOAD_TEMP_URL_KEY=
|
|
||||||
ASYNC_UPLOAD_TEMP_URL_BASE_PATH=
|
|
||||||
ASYNC_UPLOAD_TEMP_URL_CONTAINER=
|
|
||||||
|
|
||||||
## Redis Cache
|
|
||||||
REDIS_HOST=redis
|
|
||||||
REDIS_PORT=6379
|
|
||||||
REDIS_URL=redis://${REDIS_HOST}:${REDIS_PORT}
|
|
||||||
|
|
||||||
## Twilio
|
|
||||||
TWILIO_SID=~
|
|
||||||
TWILIO_SECRET=~
|
|
||||||
DEFAULT_CARRIER_CODE=BE
|
|
||||||
|
|
||||||
ADD_ADDRESS_DEFAULT_COUNTRY=BE
|
|
||||||
|
|
||||||
ADD_ADDRESS_MAP_CENTER_X=50.8443
|
|
||||||
ADD_ADDRESS_MAP_CENTER_Y=4.3523
|
|
||||||
ADD_ADDRESS_MAP_CENTER_Z=15
|
|
||||||
|
|
||||||
SHORT_MESSAGE_DSN=null://null
|
|
||||||
|
|
||||||
## DOCKER IMAGES REGISTRY
|
|
||||||
#IMAGE_PHP=
|
|
||||||
#IMAGE_NGINX=
|
|
||||||
|
|
||||||
## DOCKER IMAGES TAG
|
|
||||||
#VERSION=test
|
|
||||||
#VERSION=prod
|
|
||||||
|
|
||||||
###> symfony/messenger ###
|
|
||||||
# Choose one of the transports below
|
|
||||||
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
|
|
||||||
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
|
|
||||||
MESSENGER_TRANSPORT_DSN=sync://
|
|
||||||
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
|
|
||||||
###< symfony/messenger ###
|
|
||||||
|
|
||||||
###> doctrine/doctrine-bundle ###
|
|
||||||
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
|
|
||||||
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
|
|
||||||
#
|
|
||||||
DATABASE_URL="postgresql://postgres:postgres@db:5432/postgres?serverVersion=14&charset=utf8"
|
|
||||||
###< doctrine/doctrine-bundle ###
|
|
||||||
|
|
||||||
###> lexik/jwt-authentication-bundle ###
|
|
||||||
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
|
|
||||||
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
|
|
||||||
JWT_PASSPHRASE=2a30f6ba26521a2613821da35f28386e
|
|
||||||
###< lexik/jwt-authentication-bundle ###
|
|
@@ -4,8 +4,6 @@
|
|||||||
KERNEL_CLASS='App\Kernel'
|
KERNEL_CLASS='App\Kernel'
|
||||||
APP_SECRET='$ecretf0rt3st'
|
APP_SECRET='$ecretf0rt3st'
|
||||||
|
|
||||||
TRUSTED_HOSTS=
|
|
||||||
|
|
||||||
ADMIN_PASSWORD=password
|
ADMIN_PASSWORD=password
|
||||||
|
|
||||||
LOCALE=fr
|
LOCALE=fr
|
||||||
|
@@ -20,7 +20,6 @@ services:
|
|||||||
|
|
||||||
# Set any variables we need
|
# Set any variables we need
|
||||||
variables:
|
variables:
|
||||||
APP_ENV: test
|
|
||||||
GIT_DEPTH: 1
|
GIT_DEPTH: 1
|
||||||
# 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
|
||||||
@@ -35,8 +34,6 @@ variables:
|
|||||||
DEFAULT_CARRIER_CODE: BE
|
DEFAULT_CARRIER_CODE: BE
|
||||||
# force a timezone
|
# force a timezone
|
||||||
TZ: Europe/Brussels
|
TZ: Europe/Brussels
|
||||||
# avoid direct deprecations (using symfony phpunit bridge: https://symfony.com/doc/4.x/components/phpunit_bridge.html#internal-deprecations
|
|
||||||
SYMFONY_DEPRECATIONS_HELPER: max[total]=99999999&max[self]=0&max[direct]=45&verbose=0
|
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- Composer install
|
- Composer install
|
||||||
@@ -54,7 +51,7 @@ build:
|
|||||||
paths:
|
paths:
|
||||||
- .cache/
|
- .cache/
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 day
|
expire_in: 30 min
|
||||||
paths:
|
paths:
|
||||||
- bin
|
- bin
|
||||||
- vendor/
|
- vendor/
|
||||||
@@ -68,7 +65,7 @@ code_style:
|
|||||||
paths:
|
paths:
|
||||||
- .cache/
|
- .cache/
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 day
|
expire_in: 30 min
|
||||||
paths:
|
paths:
|
||||||
- bin
|
- bin
|
||||||
- vendor/
|
- vendor/
|
||||||
@@ -82,7 +79,7 @@ phpstan_tests:
|
|||||||
paths:
|
paths:
|
||||||
- .cache/
|
- .cache/
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 day
|
expire_in: 30 min
|
||||||
paths:
|
paths:
|
||||||
- bin
|
- bin
|
||||||
- vendor/
|
- vendor/
|
||||||
@@ -97,7 +94,7 @@ rector_tests:
|
|||||||
paths:
|
paths:
|
||||||
- .cache/
|
- .cache/
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 day
|
expire_in: 30 min
|
||||||
paths:
|
paths:
|
||||||
- bin
|
- bin
|
||||||
- vendor/
|
- vendor/
|
||||||
@@ -121,10 +118,10 @@ unit_tests:
|
|||||||
- php tests/console doctrine:migrations:migrate -n --env=test
|
- php tests/console doctrine:migrations:migrate -n --env=test
|
||||||
- php tests/console chill:db:sync-views --env=test
|
- php tests/console chill:db:sync-views --env=test
|
||||||
- php -d memory_limit=2G tests/console cache:clear --env=test
|
- php -d memory_limit=2G tests/console cache:clear --env=test
|
||||||
- php -d memory_limit=3G tests/console doctrine:fixtures:load -n --env=test
|
- php -d memory_limit=3G tests/console doctrine:fixtures:load -n
|
||||||
- php -d memory_limit=4G bin/phpunit --colors=never --exclude-group dbIntensive
|
- php -d memory_limit=4G bin/phpunit --colors=never --exclude-group dbIntensive
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 day
|
expire_in: 30 min
|
||||||
paths:
|
paths:
|
||||||
- bin
|
- bin
|
||||||
- vendor/
|
- vendor/
|
||||||
|
@@ -112,7 +112,6 @@ $rules = array_merge(
|
|||||||
],
|
],
|
||||||
'sort_algorithm' => 'alpha',
|
'sort_algorithm' => 'alpha',
|
||||||
],
|
],
|
||||||
'single_line_empty_body' => true,
|
|
||||||
],
|
],
|
||||||
$rules,
|
$rules,
|
||||||
$riskyRules,
|
$riskyRules,
|
||||||
|
@@ -1,14 +1,10 @@
|
|||||||
---
|
---
|
||||||
version: 2
|
version: 2
|
||||||
|
|
||||||
build:
|
|
||||||
os: ubuntu-22.04
|
|
||||||
tools:
|
|
||||||
python: "3.7"
|
|
||||||
|
|
||||||
sphinx:
|
sphinx:
|
||||||
configuration: docs/source/conf.py
|
configuration: docs/source/conf.py
|
||||||
|
|
||||||
python:
|
python:
|
||||||
|
version: 3.7
|
||||||
install:
|
install:
|
||||||
- requirements: docs/requirements.txt
|
- requirements: docs/requirements.txt
|
||||||
|
80
CHANGELOG.md
80
CHANGELOG.md
@@ -6,86 +6,6 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
|
|||||||
and is generated by [Changie](https://github.com/miniscruff/changie).
|
and is generated by [Changie](https://github.com/miniscruff/changie).
|
||||||
|
|
||||||
|
|
||||||
## v2.18.1 - 2024-03-26
|
|
||||||
### Fixed
|
|
||||||
* Fix layout issue in document generation for admin (minor)
|
|
||||||
|
|
||||||
## v2.18.0 - 2024-03-26
|
|
||||||
### Feature
|
|
||||||
* ([#268](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/268)) Improve admin UX to configure document templates for document generation
|
|
||||||
### Fixed
|
|
||||||
* ([#267](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/267)) Fix the join between job and user in the user list (admin): show only the current user job
|
|
||||||
|
|
||||||
## v2.17.0 - 2024-03-19
|
|
||||||
### Feature
|
|
||||||
* ([#237](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/237)) New export filter for social actions with an evaluation created between two dates
|
|
||||||
* ([#258](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/258)) In the list of accompangying period, add the list of person's centers and the duration of the course
|
|
||||||
* ([#238](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/238)) Allow to customize list person with new fields
|
|
||||||
* ([#159](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/159)) Admin can publish news on the homepage
|
|
||||||
### Fixed
|
|
||||||
* ([#264](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/264)) Fix languages: load the languages in all availables languages configured for Chill
|
|
||||||
* ([#259](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/259)) Keep a consistent behaviour between the filtering of activities within the document generation (model "accompanying period with activities"), and the same filter in the list of activities for an accompanying period
|
|
||||||
|
|
||||||
## v2.16.3 - 2024-02-26
|
|
||||||
### Fixed
|
|
||||||
* ([#236](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/236)) Fix translation of user job -> 'service' must be 'métier'
|
|
||||||
### UX
|
|
||||||
* ([#232](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/232)) Order user jobs and services alphabetically in export filters
|
|
||||||
|
|
||||||
## v2.16.2 - 2024-02-21
|
|
||||||
### Fixed
|
|
||||||
* Check for null values in closing motive of parcours d'accompagnement for correct rendering of template
|
|
||||||
|
|
||||||
## v2.16.1 - 2024-02-09
|
|
||||||
### Fixed
|
|
||||||
* Force bootstrap version to avoid error in builds with newer version
|
|
||||||
|
|
||||||
## v2.16.0 - 2024-02-08
|
|
||||||
### Feature
|
|
||||||
* ([#231](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/231)) Create new filter for persons having a participation in an accompanying period during a certain time span
|
|
||||||
* ([#241](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/241)) [Export][List of accompanyign period] Add two columns: the list of persons participating to the period, and their ids
|
|
||||||
* ([#244](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/244)) Add capability to generate export about change of steps of accompanying period, and generate exports for this
|
|
||||||
* ([#253](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/253)) Export: group accompanying period by person participating
|
|
||||||
* ([#243](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/243)) Export: add filter for courses not linked to a reference address
|
|
||||||
* ([#229](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/229)) Allow to group activities linked with accompanying period by reason
|
|
||||||
* ([#115](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/115)) Prevent social work to be saved when another user edited conccurently the social work
|
|
||||||
* Modernize the event bundle, with some new fields and multiple improvements
|
|
||||||
### Fixed
|
|
||||||
* ([#220](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/220)) Fix error in logs about wrong typing of eventArgs in onEditNotificationComment method
|
|
||||||
* ([#256](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/256)) Fix the conditions upon which social actions should be optional or required in relation to social issues within the activity creation form
|
|
||||||
### UX
|
|
||||||
* ([#260](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/260)) Order list of centers alphabetically in dropdown 'user' section admin.
|
|
||||||
|
|
||||||
## v2.15.2 - 2024-01-11
|
|
||||||
### Fixed
|
|
||||||
* Fix the id_seq used when creating a new accompanying period participation during fusion of two person files
|
|
||||||
### DX
|
|
||||||
* Set placeholder to False for expanded EntityType form fields where required is set to False.
|
|
||||||
|
|
||||||
## v2.15.1 - 2023-12-20
|
|
||||||
### Fixed
|
|
||||||
* Fix the household export query to exclude accompanying periods that are in draft state.
|
|
||||||
### DX
|
|
||||||
* ([#167](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/167)) Fixed readthedocs compilation by updating readthedocs config file and requirements for Sphinx
|
|
||||||
|
|
||||||
## v2.15.0 - 2023-12-11
|
|
||||||
### Feature
|
|
||||||
* ([#191](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/191)) Add export "number of household associate with an exchange"
|
|
||||||
* ([#235](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/235)) Export: add dates on the filter "filter course by activity type"
|
|
||||||
### Fixed
|
|
||||||
* ([#214](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/214)) Fix error when posting an empty comment on an accompanying period.
|
|
||||||
* ([#233](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/233)) Fix "filter evaluation by evaluation type" (and add select2 to the list of evaluation types to pick)
|
|
||||||
* ([#234](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/234)) Fix "filter aside activity by date"
|
|
||||||
|
|
||||||
* ([#228](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/228)) Fix export of activity for people created before the introduction of the createdAt column on person (during v1)
|
|
||||||
* ([#246](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/246)) Do not show activities, evaluations and social work when associated to a confidential accompanying period, except for the users which are allowed to see them
|
|
||||||
|
|
||||||
## v2.14.1 - 2023-11-29
|
|
||||||
### Fixed
|
|
||||||
* Export: fix list person with custom fields
|
|
||||||
* ([#100](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/100)) Add a paginator to budget elements (resource and charge types) in the admin
|
|
||||||
* Fix error in ListEvaluation when "handling agents" are alone
|
|
||||||
|
|
||||||
## v2.14.0 - 2023-11-24
|
## v2.14.0 - 2023-11-24
|
||||||
### Feature
|
### Feature
|
||||||
* ([#161](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/161)) Export: in filter "Filter accompanying period work (social action) by type, goal and result", order the items alphabetically or with the defined order
|
* ([#161](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/161)) Export: in filter "Filter accompanying period work (social action) by type, goal and result", order the items alphabetically or with the defined order
|
||||||
|
117
MIGRATION.md
117
MIGRATION.md
@@ -1,117 +0,0 @@
|
|||||||
|
|
||||||
# Switch to symfony 5.0
|
|
||||||
|
|
||||||
- the tag `chill.role` is now renamed to `chill_main.provide_role`.
|
|
||||||
|
|
||||||
**Note**: It is not necessary to apply this tag on service definition: the tag is automatically applyied if the
|
|
||||||
service implements `\Chill\MainBundle\Security\ProvideRoleInterface`.
|
|
||||||
|
|
||||||
- those annotation can be converted to attribute:
|
|
||||||
|
|
||||||
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\AccompanyingPeriodValidity`
|
|
||||||
- `Chill\PersonBundle\Validator\Constraints\Household\HouseholdMembershipSequential`
|
|
||||||
- `Chill\PersonBundle\Validator\Constraints\Household\MaxHolder`
|
|
||||||
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ConfidentialCourseMustHaveReferrer`
|
|
||||||
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\LocationValidity`
|
|
||||||
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ParticipationOverlap`
|
|
||||||
- `Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ResourceDuplicateCheck`
|
|
||||||
- `Chill\PersonBundle\Validator\Constraints\Person\Birthdate`
|
|
||||||
- `Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenter`
|
|
||||||
- `Chill\PersonBundle\Validator\Constraints\Relationship\RelationshipNoDuplicate`
|
|
||||||
- `Chill\ActivityBundle\Validator\Constraints\ActivityValidity`
|
|
||||||
- `Chill\DocStoreBundle\Validator\Constraints\AsyncFileExists`
|
|
||||||
- `Chill\MainBundle\Validation\Constraint\PhonenumberConstraint`
|
|
||||||
- `Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency`
|
|
||||||
- `Chill\MainBundle\Workflow\Validator\EntityWorkflowCreation`
|
|
||||||
|
|
||||||
Here is the rector rule that can be used to switch attributes to annotations:
|
|
||||||
|
|
||||||
```php
|
|
||||||
$rectorConfig->ruleWithConfiguration(\Rector\Php80\Rector\Class_\AnnotationToAttributeRector::class, [
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\AccompanyingPeriodValidity'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Household\HouseholdMembershipSequential'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Household\MaxHolder'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ConfidentialCourseMustHaveReferrer'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\LocationValidity'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ParticipationOverlap'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ResourceDuplicateCheck'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Person\Birthdate'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenter'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Relationship\RelationshipNoDuplicate'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\ActivityBundle\Validator\Constraints\ActivityValidity'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\DocStoreBundle\Validator\Constraints\AsyncFileExists'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Validation\Constraint\PhonenumberConstraint'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Workflow\Validator\EntityWorkflowCreation'),
|
|
||||||
]);
|
|
||||||
```
|
|
||||||
|
|
||||||
- to keep cleaner definition in container's dependency injection and framework bundle, the definition of crud or api
|
|
||||||
requires to define explicitly a controller.
|
|
||||||
|
|
||||||
Before:
|
|
||||||
|
|
||||||
```php
|
|
||||||
$container->prependExtensionConfig('chill_main', [
|
|
||||||
'apis' => [
|
|
||||||
[
|
|
||||||
'class' => ThirdParty::class,
|
|
||||||
'name' => 'thirdparty',
|
|
||||||
'base_path' => '/api/1.0/thirdparty/thirdparty',
|
|
||||||
'actions' => [
|
|
||||||
'_entity' => [
|
|
||||||
'methods' => [
|
|
||||||
Request::METHOD_GET => true,
|
|
||||||
Request::METHOD_HEAD => true,
|
|
||||||
Request::METHOD_POST => true,
|
|
||||||
Request::METHOD_PUT => true,
|
|
||||||
Request::METHOD_PATCH => true,
|
|
||||||
],
|
|
||||||
'roles' => [
|
|
||||||
Request::METHOD_GET => ThirdPartyVoter::SHOW,
|
|
||||||
Request::METHOD_HEAD => ThirdPartyVoter::SHOW,
|
|
||||||
Request::METHOD_POST => ThirdPartyVoter::CREATE,
|
|
||||||
Request::METHOD_PUT => ThirdPartyVoter::CREATE,
|
|
||||||
Request::METHOD_PATCH => ThirdPartyVoter::CREATE,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
|
|
||||||
After:
|
|
||||||
|
|
||||||
```php
|
|
||||||
$container->prependExtensionConfig('chill_main', [
|
|
||||||
'apis' => [
|
|
||||||
[
|
|
||||||
'class' => ThirdParty::class,
|
|
||||||
'controller' => ThirdPartyApiController::class,
|
|
||||||
'name' => 'thirdparty',
|
|
||||||
'base_path' => '/api/1.0/thirdparty/thirdparty',
|
|
||||||
'actions' => [
|
|
||||||
'_entity' => [
|
|
||||||
'methods' => [
|
|
||||||
Request::METHOD_GET => true,
|
|
||||||
Request::METHOD_HEAD => true,
|
|
||||||
Request::METHOD_POST => true,
|
|
||||||
Request::METHOD_PUT => true,
|
|
||||||
Request::METHOD_PATCH => true,
|
|
||||||
],
|
|
||||||
'roles' => [
|
|
||||||
Request::METHOD_GET => ThirdPartyVoter::SHOW,
|
|
||||||
Request::METHOD_HEAD => ThirdPartyVoter::SHOW,
|
|
||||||
Request::METHOD_POST => ThirdPartyVoter::CREATE,
|
|
||||||
Request::METHOD_PUT => ThirdPartyVoter::CREATE,
|
|
||||||
Request::METHOD_PATCH => ThirdPartyVoter::CREATE,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
@@ -12,6 +12,7 @@
|
|||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-openssl": "*",
|
"ext-openssl": "*",
|
||||||
"ext-redis": "*",
|
"ext-redis": "*",
|
||||||
|
"champs-libres/async-uploader-bundle": "dev-sf4#d57134aee8e504a83c902ff0cf9f8d36ac418290",
|
||||||
"champs-libres/wopi-bundle": "dev-master@dev",
|
"champs-libres/wopi-bundle": "dev-master@dev",
|
||||||
"champs-libres/wopi-lib": "dev-master@dev",
|
"champs-libres/wopi-lib": "dev-master@dev",
|
||||||
"doctrine/doctrine-bundle": "^2.1",
|
"doctrine/doctrine-bundle": "^2.1",
|
||||||
@@ -32,47 +33,27 @@
|
|||||||
"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",
|
"spomky-labs/base64url": "^2.0",
|
||||||
"symfony/asset": "^5.4",
|
"symfony/browser-kit": "^4.4",
|
||||||
"symfony/browser-kit": "^5.4",
|
|
||||||
"symfony/cache": "^5.4",
|
|
||||||
"symfony/clock": "^6.2",
|
"symfony/clock": "^6.2",
|
||||||
"symfony/config": "^5.4",
|
"symfony/css-selector": "^4.4",
|
||||||
"symfony/console": "^5.4",
|
"symfony/expression-language": "^4.4",
|
||||||
"symfony/css-selector": "^5.4",
|
"symfony/form": "^4.4",
|
||||||
"symfony/dom-crawler": "^5.4",
|
"symfony/framework-bundle": "^4.4",
|
||||||
"symfony/error-handler": "^5.4",
|
"symfony/http-client": "^4.4 || ^5",
|
||||||
"symfony/event-dispatcher": "^5.4",
|
"symfony/http-foundation": "^4.4",
|
||||||
"symfony/expression-language": "^5.4",
|
"symfony/intl": "^4.4",
|
||||||
"symfony/filesystem": "^5.4",
|
|
||||||
"symfony/finder": "^5.4",
|
|
||||||
"symfony/form": "^5.4",
|
|
||||||
"symfony/framework-bundle": "^5.4",
|
|
||||||
"symfony/http-client": "^5.4",
|
|
||||||
"symfony/http-foundation": "^5.4",
|
|
||||||
"symfony/intl": "^5.4",
|
|
||||||
"symfony/mailer": "^5.4",
|
"symfony/mailer": "^5.4",
|
||||||
"symfony/messenger": "^5.4",
|
"symfony/messenger": "^5.4",
|
||||||
"symfony/mime": "^5.4",
|
"symfony/mime": "^5.4",
|
||||||
"symfony/monolog-bundle": "^3.5",
|
"symfony/monolog-bundle": "^3.5",
|
||||||
"symfony/options-resolver": "^5.4",
|
"symfony/security-bundle": "^4.4",
|
||||||
"symfony/process": "^5.4",
|
"symfony/serializer": "^5.3",
|
||||||
"symfony/property-access": "^5.4",
|
"symfony/translation": "^4.4",
|
||||||
"symfony/property-info": "^5.4",
|
"symfony/twig-bundle": "^4.4",
|
||||||
"symfony/routing": "^5.4",
|
"symfony/validator": "^4.4",
|
||||||
"symfony/security-bundle": "^5.4",
|
|
||||||
"symfony/security-core": "^5.4",
|
|
||||||
"symfony/security-csrf": "^5.4",
|
|
||||||
"symfony/security-guard": "^5.4",
|
|
||||||
"symfony/security-http": "^5.4",
|
|
||||||
"symfony/serializer": "^5.4",
|
|
||||||
"symfony/string": "^5.4",
|
|
||||||
"symfony/templating": "^5.4",
|
|
||||||
"symfony/translation": "^5.4",
|
|
||||||
"symfony/twig-bundle": "^5.4",
|
|
||||||
"symfony/validator": "^5.4",
|
|
||||||
"symfony/webpack-encore-bundle": "^1.11",
|
"symfony/webpack-encore-bundle": "^1.11",
|
||||||
"symfony/workflow": "^5.4",
|
"symfony/workflow": "^4.4",
|
||||||
"symfony/yaml": "^5.4",
|
"symfony/yaml": "^4.4",
|
||||||
"thenetworg/oauth2-azure": "^2.0",
|
"thenetworg/oauth2-azure": "^2.0",
|
||||||
"twig/extra-bundle": "^3.0",
|
"twig/extra-bundle": "^3.0",
|
||||||
"twig/intl-extra": "^3.0",
|
"twig/intl-extra": "^3.0",
|
||||||
@@ -92,14 +73,16 @@
|
|||||||
"phpstan/phpstan-deprecation-rules": "^1.1",
|
"phpstan/phpstan-deprecation-rules": "^1.1",
|
||||||
"phpstan/phpstan-strict-rules": "^1.0",
|
"phpstan/phpstan-strict-rules": "^1.0",
|
||||||
"phpunit/phpunit": ">= 7.5",
|
"phpunit/phpunit": ">= 7.5",
|
||||||
"rector/rector": "^1.0.0",
|
"psalm/plugin-phpunit": "^0.18.4",
|
||||||
"symfony/debug-bundle": "^5.4",
|
"psalm/plugin-symfony": "^4.0.2",
|
||||||
"symfony/dotenv": "^5.4",
|
"rector/rector": "^0.17.7",
|
||||||
|
"symfony/debug-bundle": "^5.1",
|
||||||
|
"symfony/dotenv": "^4.4",
|
||||||
"symfony/maker-bundle": "^1.20",
|
"symfony/maker-bundle": "^1.20",
|
||||||
"symfony/phpunit-bridge": "^5.4",
|
"symfony/phpunit-bridge": "^4.4",
|
||||||
"symfony/runtime": "^5.4",
|
"symfony/stopwatch": "^4.4",
|
||||||
"symfony/stopwatch": "^5.4",
|
"symfony/var-dumper": "^4.4",
|
||||||
"symfony/var-dumper": "^5.4"
|
"vimeo/psalm": "^4.30.0"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"symfony/symfony": "*"
|
"symfony/symfony": "*"
|
||||||
|
@@ -27,7 +27,7 @@ To compile this documentation :
|
|||||||
Contribute
|
Contribute
|
||||||
===========
|
===========
|
||||||
|
|
||||||
Issue tracker : https://gitlab.com/Chill-Projet/chill-bundles/-/issues
|
Issue tracker : https://git.framasoft.org/groups/Chill-project/issues
|
||||||
|
|
||||||
Licence
|
Licence
|
||||||
=======
|
=======
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
docutils==0.13.1
|
docutils==0.13.1
|
||||||
Pygments==2.2.0
|
Pygments==2.2.0
|
||||||
sphinx==1.8.5
|
sphinx==1.8.5
|
||||||
Jinja2<3.1
|
|
||||||
git+https://github.com/fabpot/sphinx-php.git@v2.0.2#egg_name=sphinx-php
|
git+https://github.com/fabpot/sphinx-php.git@v2.0.2#egg_name=sphinx-php
|
||||||
jsx-lexer===0.0.8
|
jsx-lexer===0.0.8
|
||||||
sphinx_rtd_theme==0.5.0
|
sphinx_rtd_theme==0.5.0
|
||||||
|
@@ -242,129 +242,3 @@ This is an example of the *filter by birthdate*. This filter asks some informati
|
|||||||
Continue to explain the export framework
|
Continue to explain the export framework
|
||||||
|
|
||||||
.. _main bundle: https://git.framasoft.org/Chill-project/Chill-Main
|
.. _main bundle: https://git.framasoft.org/Chill-project/Chill-Main
|
||||||
|
|
||||||
|
|
||||||
With many-to-* relationship, why should we set WHERE clauses in an EXISTS subquery instead of a JOIN ?
|
|
||||||
``````````````````````````````````````````````````````````````````````````````````````````````````````
|
|
||||||
|
|
||||||
As we described above, the doctrine builder is converted into a sql query. Let's see how to compute the "number of course
|
|
||||||
which count at least one activity type with the id 7". For the purpose of this demonstration, we will restrict this on
|
|
||||||
two accompanying period only: the ones with id 329 and 334.
|
|
||||||
|
|
||||||
Let's see the list of activities associated with those accompanying period:
|
|
||||||
|
|
||||||
.. code-block:: sql
|
|
||||||
|
|
||||||
SELECT id, accompanyingperiod_id, type_id FROM activity WHERE accompanyingperiod_id IN (329, 334) AND type_id = 7
|
|
||||||
ORDER BY accompanyingperiod_id;
|
|
||||||
|
|
||||||
We see that we have 6 activities for the accompanying period with id 329, and only one for the 334's one.
|
|
||||||
|
|
||||||
.. csv-table::
|
|
||||||
:header: id, accompanyingperiod_id, type_id
|
|
||||||
|
|
||||||
990,329,7
|
|
||||||
986,329,7
|
|
||||||
987,329,7
|
|
||||||
993,329,7
|
|
||||||
991,329,7
|
|
||||||
992,329,7
|
|
||||||
1000,334,7
|
|
||||||
|
|
||||||
Let's calculate the average duration for those accompanying periods, and the number of period:
|
|
||||||
|
|
||||||
.. code-block:: sql
|
|
||||||
|
|
||||||
SELECT AVG(age(COALESCE(closingdate, CURRENT_DATE), openingdate)), COUNT(id) from chill_person_accompanying_period WHERE id IN (329, 334);
|
|
||||||
|
|
||||||
The result of this query is:
|
|
||||||
|
|
||||||
.. csv-table::
|
|
||||||
:header: AVG, COUNT
|
|
||||||
|
|
||||||
2 years 2 mons 21 days 12 hours 0 mins 0.0 secs,2
|
|
||||||
|
|
||||||
Now, we count the number of accompanying period, adding a :code:`JOIN` clause which make a link to the :code:`activity` table, and add a :code:`WHERE` clause to keep
|
|
||||||
only the accompanying period which contains the given activity type:
|
|
||||||
|
|
||||||
.. code-block:: sql
|
|
||||||
|
|
||||||
SELECT COUNT(chill_person_accompanying_period.id) from chill_person_accompanying_period
|
|
||||||
JOIN activity ON chill_person_accompanying_period.id = activity.accompanyingperiod_id
|
|
||||||
WHERE chill_person_accompanying_period.id IN (329, 334) AND activity.type_id = 7;
|
|
||||||
|
|
||||||
What are the results here ?
|
|
||||||
|
|
||||||
.. csv-table::
|
|
||||||
:header: COUNT
|
|
||||||
|
|
||||||
7
|
|
||||||
|
|
||||||
:code:`7` ! Why this result ? Because the number of lines is duplicated for each activity. Let's see the list of rows which
|
|
||||||
are taken into account for the computation:
|
|
||||||
|
|
||||||
.. code-block:: sql
|
|
||||||
|
|
||||||
SELECT chill_person_accompanying_period.id, activity.id from chill_person_accompanying_period
|
|
||||||
JOIN activity ON chill_person_accompanying_period.id = activity.accompanyingperiod_id
|
|
||||||
WHERE chill_person_accompanying_period.id IN (329, 334) AND activity.type_id = 7;
|
|
||||||
|
|
||||||
.. csv-table::
|
|
||||||
:header: accompanyingperiod.id, activity.id
|
|
||||||
|
|
||||||
329,993
|
|
||||||
334,1000
|
|
||||||
329,987
|
|
||||||
329,990
|
|
||||||
329,991
|
|
||||||
329,992
|
|
||||||
329,986
|
|
||||||
|
|
||||||
For each activity, a row is created and, as we count the number of non-null :code:`accompanyingperiod.id` columns, we
|
|
||||||
count one entry for each activity (actually, we count the number of activities).
|
|
||||||
|
|
||||||
So, let's use the :code:`DISTINCT` keyword to count only once the equal ids:
|
|
||||||
|
|
||||||
.. code-block::
|
|
||||||
|
|
||||||
SELECT COUNT(DISTINCT chill_person_accompanying_period.id) from chill_person_accompanying_period
|
|
||||||
JOIN activity ON chill_person_accompanying_period.id = activity.accompanyingperiod_id
|
|
||||||
WHERE chill_person_accompanying_period.id IN (329, 334) AND activity.type_id = 7;
|
|
||||||
|
|
||||||
Now, it works again...
|
|
||||||
|
|
||||||
.. csv-table::
|
|
||||||
:header: COUNT
|
|
||||||
|
|
||||||
2
|
|
||||||
|
|
||||||
But, for the average duration, this won't work: the duration which are equals (because the :code:`openingdate` is the same and
|
|
||||||
:code:`closingdate` is still :code:`NULL`, for instance) will be counted only once, which will give unexpected result.
|
|
||||||
|
|
||||||
The solution is to move the condition "having an activity with activity type with id 7" in a :code:`EXISTS` clause:
|
|
||||||
|
|
||||||
.. code-block:: sql
|
|
||||||
|
|
||||||
SELECT COUNT(chill_person_accompanying_period.id) from chill_person_accompanying_period
|
|
||||||
WHERE chill_person_accompanying_period.id IN (329, 334) AND EXISTS (SELECT 1 FROM activity WHERE type_id = 7 AND accompanyingperiod_id = chill_person_accompanying_period.id);
|
|
||||||
|
|
||||||
The result is correct without :code:`DISTINCT` keyword:
|
|
||||||
|
|
||||||
.. csv-table::
|
|
||||||
:header: COUNT
|
|
||||||
|
|
||||||
2
|
|
||||||
|
|
||||||
And we can now compute the average duration without fear:
|
|
||||||
|
|
||||||
.. code-block:: sql
|
|
||||||
|
|
||||||
SELECT AVG(age(COALESCE(closingdate, CURRENT_DATE), openingdate)) from chill_person_accompanying_period
|
|
||||||
WHERE chill_person_accompanying_period.id IN (329, 334) AND EXISTS (SELECT 1 FROM activity WHERE type_id = 7 AND accompanyingperiod_id = chill_person_accompanying_period.id);
|
|
||||||
|
|
||||||
Give the result:
|
|
||||||
|
|
||||||
.. csv-table::
|
|
||||||
:header: AVG
|
|
||||||
|
|
||||||
2 years 2 mons 21 days 12 hours 0 mins 0.0 secs
|
|
||||||
|
@@ -15,12 +15,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
|||||||
|
|
||||||
class example extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController
|
class example extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
public function yourAction()
|
public function yourAction()
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
// first, get the number of total item are available
|
// first, get the number of total item are available
|
||||||
$total = $em
|
$total = $em
|
||||||
->createQuery('SELECT COUNT (item.id) FROM ChillMyBundle:Item item')
|
->createQuery('SELECT COUNT (item.id) FROM ChillMyBundle:Item item')
|
||||||
|
@@ -18,9 +18,6 @@ use Symfony\Component\Security\Core\Role\Role;
|
|||||||
|
|
||||||
class ConsultationController extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController
|
class ConsultationController extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @param int $id personId
|
* @param int $id personId
|
||||||
*
|
*
|
||||||
@@ -51,7 +48,7 @@ class ConsultationController extends \Symfony\Bundle\FrameworkBundle\Controller\
|
|||||||
);
|
);
|
||||||
|
|
||||||
// create a query which take circles into account
|
// create a query which take circles into account
|
||||||
$consultations = $this->managerRegistry->getManager()
|
$consultations = $this->getDoctrine()->getManager()
|
||||||
->createQuery('SELECT c FROM ChillHealthBundle:Consultation c '
|
->createQuery('SELECT c FROM ChillHealthBundle:Consultation c '
|
||||||
. 'WHERE c.patient = :person AND c.circle IN(:circles) '
|
. 'WHERE c.patient = :person AND c.circle IN(:circles) '
|
||||||
. 'ORDER BY c.date DESC')
|
. 'ORDER BY c.date DESC')
|
||||||
|
@@ -48,8 +48,8 @@ Clone or download the chill-skeleton project and `cd` into the main directory.
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
git clone https://gitea.champs-libres.be/Chill-project/chill-skeleton-basic.git
|
git clone https://gitlab.com/Chill-Projet/chill-skeleton-basic.git
|
||||||
cd chill-skeleton-basic
|
cd chill-app
|
||||||
|
|
||||||
|
|
||||||
As a developer, the code will stay on your computer and will be executed in docker container. To avoid permission problem, the code should be run with the same uid/gid from your current user. This is why we get your current user id with the command ``id -u`` in each following scripts.
|
As a developer, the code will stay on your computer and will be executed in docker container. To avoid permission problem, the code should be run with the same uid/gid from your current user. This is why we get your current user id with the command ``id -u`` in each following scripts.
|
||||||
|
@@ -5,74 +5,72 @@ Add condition with distinct alias on each export join clauses (Indicators + Filt
|
|||||||
|
|
||||||
These are alias conventions :
|
These are alias conventions :
|
||||||
|
|
||||||
| Entity | Join | Attribute | Alias |
|
| Entity | Join | Attribute | Alias |
|
||||||
|:----------------------------------------|:----------------------------------------|:-------------------------------------------|:-------------------------------------------|
|
|:----------------------------------------|:----------------------------------------|:-------------------------------------------|:---------------------------------------|
|
||||||
| AccompanyingPeriodStepHistory::class | | | acpstephistory (contexte ACP_STEP_HISTORY) |
|
| AccompanyingPeriod::class | | | acp |
|
||||||
| | AccompanyingPeriod::class | acpstephistory.period | acp |
|
| | AccompanyingPeriodWork::class | acp.works | acpw |
|
||||||
| AccompanyingPeriod::class | | | acp |
|
| | AccompanyingPeriodParticipation::class | acp.participations | acppart |
|
||||||
| | AccompanyingPeriodWork::class | acp.works | acpw |
|
| | Location::class | acp.administrativeLocation | acploc |
|
||||||
| | AccompanyingPeriodParticipation::class | acp.participations | acppart |
|
| | ClosingMotive::class | acp.closingMotive | acpmotive |
|
||||||
| | Location::class | acp.administrativeLocation | acploc |
|
| | UserJob::class | acp.job | acpjob |
|
||||||
| | ClosingMotive::class | acp.closingMotive | acpmotive |
|
| | Origin::class | acp.origin | acporigin |
|
||||||
| | UserJob::class | acp.job | acpjob |
|
| | Scope::class | acp.scopes | acpscope |
|
||||||
| | Origin::class | acp.origin | acporigin |
|
| | SocialIssue::class | acp.socialIssues | acpsocialissue |
|
||||||
| | Scope::class | acp.scopes | acpscope |
|
| | User::class | acp.user | acpuser |
|
||||||
| | SocialIssue::class | acp.socialIssues | acpsocialissue |
|
| | AccompanyingPeriopStepHistory::class | acp.stepHistories | acpstephistories |
|
||||||
| | User::class | acp.user | acpuser |
|
| | AccompanyingPeriodInfo::class | not existing (using custom WITH clause) | acpinfo |
|
||||||
| | AccompanyingPeriopStepHistory::class | acp.stepHistories | acpstephistories |
|
| AccompanyingPeriodWork::class | | | acpw |
|
||||||
| | AccompanyingPeriodInfo::class | not existing (using custom WITH clause) | acpinfo |
|
| | AccompanyingPeriodWorkEvaluation::class | acpw.accompanyingPeriodWorkEvaluations | workeval |
|
||||||
| AccompanyingPeriodWork::class | | | acpw |
|
| | SocialAction::class | acpw.socialAction | acpwsocialaction |
|
||||||
| | AccompanyingPeriodWorkEvaluation::class | acpw.accompanyingPeriodWorkEvaluations | workeval |
|
| | Goal::class | acpw.goals | goal |
|
||||||
| | SocialAction::class | acpw.socialAction | acpwsocialaction |
|
| | Result::class | acpw.results | result |
|
||||||
| | Goal::class | acpw.goals | goal |
|
| AccompanyingPeriodParticipation::class | | | acppart |
|
||||||
| | Result::class | acpw.results | result |
|
| | Person::class | acppart.person | partperson |
|
||||||
| AccompanyingPeriodParticipation::class | | | acppart |
|
| AccompanyingPeriodWorkEvaluation::class | | | workeval |
|
||||||
| | Person::class | acppart.person | partperson |
|
| | Evaluation::class | workeval.evaluation | eval |
|
||||||
| AccompanyingPeriodWorkEvaluation::class | | | workeval |
|
| AccompanyingPeriodInfo::class | | | acpinfo |
|
||||||
| | Evaluation::class | workeval.evaluation | eval |
|
| | User::class | acpinfo.user | acpinfo_user |
|
||||||
| AccompanyingPeriodInfo::class | | | acpinfo |
|
| Goal::class | | | goal |
|
||||||
| | User::class | acpinfo.user | acpinfo_user |
|
| | Result::class | goal.results | goalresult |
|
||||||
| Goal::class | | | goal |
|
| Person::class | | | person |
|
||||||
| | Result::class | goal.results | goalresult |
|
| | Center::class | person.center | center |
|
||||||
| Person::class | | | person |
|
| | HouseholdMember::class | partperson.householdParticipations | householdmember |
|
||||||
| | Center::class | person.center | center |
|
| | MaritalStatus::class | person.maritalStatus | personmarital |
|
||||||
| | HouseholdMember::class | partperson.householdParticipations | householdmember |
|
| | VendeePerson::class | | vp |
|
||||||
| | MaritalStatus::class | person.maritalStatus | personmarital |
|
| | VendeePersonMineur::class | | vpm |
|
||||||
| | VendeePerson::class | | vp |
|
| | CurrentPersonAddress::class | person.currentPersonAddress | currentPersonAddress (on a given date) |
|
||||||
| | VendeePersonMineur::class | | vpm |
|
| ResidentialAddress::class | | | resaddr |
|
||||||
| | CurrentPersonAddress::class | person.currentPersonAddress | currentPersonAddress (on a given date) |
|
| | ThirdParty::class | resaddr.hostThirdParty | tparty |
|
||||||
| ResidentialAddress::class | | | resaddr |
|
| ThirdParty::class | | | tparty |
|
||||||
| | ThirdParty::class | resaddr.hostThirdParty | tparty |
|
| | ThirdPartyCategory::class | tparty.categories | tpartycat |
|
||||||
| ThirdParty::class | | | tparty |
|
| HouseholdMember::class | | | householdmember |
|
||||||
| | ThirdPartyCategory::class | tparty.categories | tpartycat |
|
| | Household::class | householdmember.household | household |
|
||||||
| HouseholdMember::class | | | householdmember |
|
| | Person::class | householdmember.person | memberperson |
|
||||||
| | Household::class | householdmember.household | household |
|
| | | memberperson.center | membercenter |
|
||||||
| | Person::class | householdmember.person | memberperson |
|
| Household::class | | | household |
|
||||||
| | | memberperson.center | membercenter |
|
| | HouseholdComposition::class | household.compositions | composition |
|
||||||
| Household::class | | | household |
|
| Activity::class | | | activity |
|
||||||
| | HouseholdComposition::class | household.compositions | composition |
|
| | Person::class | activity.person | actperson |
|
||||||
| Activity::class | | | activity |
|
| | AccompanyingPeriod::class | activity.accompanyingPeriod | acp |
|
||||||
| | Person::class | activity.person | actperson |
|
| | Person::class | activity\_person\_having\_activity.person | person\_person\_having\_activity |
|
||||||
| | AccompanyingPeriod::class | activity.accompanyingPeriod | acp |
|
| | ActivityReason::class | activity\_person\_having\_activity.reasons | reasons\_person\_having\_activity |
|
||||||
| | Person::class | activity\_person\_having\_activity.person | person\_person\_having\_activity |
|
| | ActivityType::class | activity.activityType | acttype |
|
||||||
| | ActivityReason::class | activity\_person\_having\_activity.reasons | reasons\_person\_having\_activity |
|
| | Location::class | activity.location | actloc |
|
||||||
| | ActivityType::class | activity.activityType | acttype |
|
| | SocialAction::class | activity.socialActions | actsocialaction |
|
||||||
| | Location::class | activity.location | actloc |
|
| | SocialIssue::class | activity.socialIssues | actsocialssue |
|
||||||
| | SocialAction::class | activity.socialActions | actsocialaction |
|
| | ThirdParty::class | activity.thirdParties | acttparty |
|
||||||
| | SocialIssue::class | activity.socialIssues | actsocialssue |
|
| | User::class | activity.user | actuser |
|
||||||
| | ThirdParty::class | activity.thirdParties | acttparty |
|
| | User::class | activity.users | actusers |
|
||||||
| | User::class | activity.user | actuser |
|
| | ActivityReason::class | activity.reasons | actreasons |
|
||||||
| | User::class | activity.users | actusers |
|
| | Center::class | actperson.center | actcenter |
|
||||||
| | ActivityReason::class | activity.reasons | actreasons |
|
| | Person::class | activity.createdBy | actcreator |
|
||||||
| | Center::class | actperson.center | actcenter |
|
| ActivityReason::class | | | actreasons |
|
||||||
| | Person::class | activity.createdBy | actcreator |
|
| | ActivityReasonCategory::class | actreason.category | actreasoncat |
|
||||||
| ActivityReason::class | | | actreasons |
|
| Calendar::class | | | cal |
|
||||||
| | ActivityReasonCategory::class | actreason.category | actreasoncat |
|
| | CancelReason::class | cal.cancelReason | calcancel |
|
||||||
| Calendar::class | | | cal |
|
| | Location::class | cal.location | calloc |
|
||||||
| | CancelReason::class | cal.cancelReason | calcancel |
|
| | User::class | cal.user | caluser |
|
||||||
| | Location::class | cal.location | calloc |
|
| VendeePerson::class | | | vp |
|
||||||
| | User::class | cal.user | caluser |
|
| | SituationProfessionelle::class | vp.situationProfessionelle | vpprof |
|
||||||
| VendeePerson::class | | | vp |
|
| | StatutLogement::class | vp.statutLogement | vplog |
|
||||||
| | SituationProfessionelle::class | vp.situationProfessionelle | vpprof |
|
| | TempsDeTravail::class | vp.tempsDeTravail | vptt |
|
||||||
| | StatutLogement::class | vp.statutLogement | vplog |
|
|
||||||
| | TempsDeTravail::class | vp.tempsDeTravail | vptt |
|
|
||||||
|
@@ -14,15 +14,12 @@
|
|||||||
"@ckeditor/ckeditor5-vue": "^4.0.1",
|
"@ckeditor/ckeditor5-vue": "^4.0.1",
|
||||||
"@symfony/webpack-encore": "^4.1.0",
|
"@symfony/webpack-encore": "^4.1.0",
|
||||||
"@tsconfig/node14": "^1.0.1",
|
"@tsconfig/node14": "^1.0.1",
|
||||||
"@types/dompurify": "^3.0.5",
|
|
||||||
"bindings": "^1.5.0",
|
"bindings": "^1.5.0",
|
||||||
"bootstrap": "5.2.3",
|
"bootstrap": "^5.3.0",
|
||||||
"chokidar": "^3.5.1",
|
"chokidar": "^3.5.1",
|
||||||
"dompurify": "^3.1.0",
|
|
||||||
"fork-awesome": "^1.1.7",
|
"fork-awesome": "^1.1.7",
|
||||||
"jquery": "^3.6.0",
|
"jquery": "^3.6.0",
|
||||||
"node-sass": "^8.0.0",
|
"node-sass": "^8.0.0",
|
||||||
"marked": "^12.0.1",
|
|
||||||
"popper.js": "^1.16.1",
|
"popper.js": "^1.16.1",
|
||||||
"postcss-loader": "^7.0.2",
|
"postcss-loader": "^7.0.2",
|
||||||
"raw-loader": "^4.0.2",
|
"raw-loader": "^4.0.2",
|
||||||
@@ -49,7 +46,7 @@
|
|||||||
"es6-promise": "^4.2.8",
|
"es6-promise": "^4.2.8",
|
||||||
"leaflet": "^1.7.1",
|
"leaflet": "^1.7.1",
|
||||||
"masonry-layout": "^4.2.2",
|
"masonry-layout": "^4.2.2",
|
||||||
"mime": "^4.0.0",
|
"mime": "^3.0.0",
|
||||||
"swagger-ui": "^4.15.5",
|
"swagger-ui": "^4.15.5",
|
||||||
"vis-network": "^9.1.0",
|
"vis-network": "^9.1.0",
|
||||||
"vue": "^3.2.37",
|
"vue": "^3.2.37",
|
||||||
|
@@ -1,58 +0,0 @@
|
|||||||
# See https://github.com/doctrine/orm/issues/11313 for a follow-up
|
|
||||||
parameters:
|
|
||||||
ignoreErrors:
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Fetching deprecated class constant ASC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
|
|
||||||
use Order\\:\\:Ascending instead$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Fetching deprecated class constant ASC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
|
|
||||||
use Order\\:\\:Ascending instead$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Entity/Notification.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Fetching deprecated class constant DESC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
|
|
||||||
use Order\\:\\:Descending instead$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Fetching deprecated class constant DESC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
|
|
||||||
use Order\\:\\:Descending instead$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Fetching deprecated class constant DESC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
|
|
||||||
use Order\\:\\:Descending instead$#
|
|
||||||
"""
|
|
||||||
count: 2
|
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/Household/Household.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Fetching deprecated class constant DESC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
|
|
||||||
use Order\\:\\:Descending instead$#
|
|
||||||
"""
|
|
||||||
count: 2
|
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/Person.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Fetching deprecated class constant DESC of class Doctrine\\\\Common\\\\Collections\\\\Criteria\\:
|
|
||||||
use Order\\:\\:Descending instead$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
|
|
@@ -100,6 +100,11 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillEventBundle/Controller/EventController.php
|
path: src/Bundle/ChillEventBundle/Controller/EventController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$name of method Symfony\\\\Component\\\\Form\\\\FormFactoryInterface\\:\\:createNamedBuilder\\(\\) expects string, null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillEventBundle/Controller/EventController.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, Chill\\\\MainBundle\\\\Entity\\\\Center given\\.$#"
|
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, Chill\\\\MainBundle\\\\Entity\\\\Center given\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
@@ -160,6 +165,11 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillMainBundle/Controller/ExportController.php
|
path: src/Bundle/ChillMainBundle/Controller/ExportController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$name of method Symfony\\\\Component\\\\Form\\\\FormFactoryInterface\\:\\:createNamedBuilder\\(\\) expects string, null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/ExportController.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#3 \\$alias of method Chill\\\\MainBundle\\\\Controller\\\\ExportController\\:\\:exportFormStep\\(\\) expects string, Symfony\\\\Component\\\\HttpFoundation\\\\Request given\\.$#"
|
message: "#^Parameter \\#3 \\$alias of method Chill\\\\MainBundle\\\\Controller\\\\ExportController\\:\\:exportFormStep\\(\\) expects string, Symfony\\\\Component\\\\HttpFoundation\\\\Request given\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
@@ -1,30 +1,5 @@
|
|||||||
parameters:
|
parameters:
|
||||||
ignoreErrors:
|
ignoreErrors:
|
||||||
-
|
|
||||||
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Form/PersonType.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
|
|
||||||
count: 2
|
|
||||||
path: src/Bundle/ChillMainBundle/Repository/NotificationRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Foreach overwrites \\$key with its key variable\\.$#"
|
message: "#^Foreach overwrites \\$key with its key variable\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
@@ -1,153 +0,0 @@
|
|||||||
parameters:
|
|
||||||
ignoreErrors:
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
|
|
||||||
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
|
|
||||||
"""
|
|
||||||
count: 2
|
|
||||||
path: src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
|
|
||||||
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
|
|
||||||
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
|
|
||||||
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
|
|
||||||
"""
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
|
|
||||||
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
|
|
||||||
"""
|
|
||||||
count: 2
|
|
||||||
path: src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
|
|
||||||
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Encoder\\\\EncoderFactory\\:
|
|
||||||
since Symfony 5\\.3, use \\{@link PasswordHasherFactory\\} instead$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
|
|
||||||
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Controller/MenuController.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
|
|
||||||
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Controller/SearchController.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
|
|
||||||
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Controller/UserController.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Encoder\\\\EncoderFactory\\:
|
|
||||||
since Symfony 5\\.3, use \\{@link PasswordHasherFactory\\} instead$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
|
|
||||||
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
|
|
||||||
"""
|
|
||||||
count: 2
|
|
||||||
path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
|
|
||||||
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
|
|
||||||
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
|
|
||||||
"""
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillMainBundle/Validation/Validator/UserUniqueEmailAndUsername.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
|
|
||||||
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Validator/Constraints/Entity/UserCircleConsistencyValidator.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
|
|
||||||
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
|
|
||||||
"""
|
|
||||||
count: 13
|
|
||||||
path: src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
|
|
||||||
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
|
|
||||||
"""
|
|
||||||
count: 4
|
|
||||||
path: src/Bundle/ChillPersonBundle/Controller/PersonController.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Call to deprecated method get\\(\\) of class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController\\:
|
|
||||||
since Symfony 5\\.4, use method or constructor injection in your controller instead$#
|
|
||||||
"""
|
|
||||||
count: 7
|
|
||||||
path: src/Bundle/ChillReportBundle/Controller/ReportController.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: """
|
|
||||||
#^Call to deprecated method getUsername\\(\\) of class Chill\\\\MainBundle\\\\Entity\\\\User\\:
|
|
||||||
since Symfony 5\\.3, use getUserIdentifier\\(\\) instead$#
|
|
||||||
"""
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php
|
|
@@ -1,5 +1,36 @@
|
|||||||
parameters:
|
parameters:
|
||||||
ignoreErrors:
|
ignoreErrors:
|
||||||
|
-
|
||||||
|
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/ChillActivityBundle/Controller/ActivityController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Call to deprecated method setType\\(\\) of class Chill\\\\ActivityBundle\\\\Entity\\\\Activity\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Entity/ActivityReason.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.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/ChillActivityBundle/Form/ActivityType.php
|
||||||
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
@@ -9,10 +40,201 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php
|
path: src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.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/ChillActivityBundle/Timeline/TimelineActivityProvider.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldChoice\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bridge\\\\Twig\\\\TwigEngine\\:
|
||||||
|
since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Used function LogicException not found\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldDate\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\:
|
||||||
|
since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Parameter \\$twigEngine of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldLongChoice\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bridge\\\\Twig\\\\TwigEngine\\:
|
||||||
|
since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldNumber\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\:
|
||||||
|
since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldText\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\:
|
||||||
|
since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Parameter \\$templating of method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldTitle\\:\\:__construct\\(\\) has typehint with deprecated class Symfony\\\\Bundle\\\\TwigBundle\\\\TwigEngine\\:
|
||||||
|
since version 4\\.3, to be removed in 5\\.0; use Twig instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
|
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php
|
path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.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: 6
|
||||||
|
path: src/Bundle/ChillEventBundle/Controller/EventController.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/ChillEventBundle/Form/EventType.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/ChillEventBundle/Form/Type/PickEventType.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/ChillFamilyMembersBundle/Security/Voter/FamilyMemberVoter.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Parameter \\$role of method Chill\\\\MainBundle\\\\CRUD\\\\Controller\\\\CRUDController\\:\\:getReachableCenters\\(\\) has typehint with 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/ChillMainBundle/CRUD/Controller/CRUDController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Call to deprecated method getLanguageBundle\\(\\) of class Symfony\\\\Component\\\\Intl\\\\Intl\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use \\{@see Languages\\} or \\{@see Scripts\\} instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Call to deprecated method getRegionBundle\\(\\) of class Symfony\\\\Component\\\\Intl\\\\Intl\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use \\{@see Countries\\} instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.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/ChillMainBundle/Controller/PermissionsGroupController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Parameter \\$role of anonymous function has typehint with 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/ChillMainBundle/Controller/PermissionsGroupController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Call to deprecated method getLanguageBundle\\(\\) of class Symfony\\\\Component\\\\Intl\\\\Intl\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use \\{@see Languages\\} or \\{@see Scripts\\} instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\MainBundle\\\\Entity\\\\User\\:\\:getRoles\\(\\) has typehint with 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/ChillMainBundle/Entity/User.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Class Chill\\\\MainBundle\\\\Form\\\\Event\\\\CustomizeFormEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
|
||||||
|
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Form/Event/CustomizeFormEvent.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/ChillMainBundle/Form/Type/ScopePickerType.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/ChillMainBundle/Form/Type/UserPickerType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillMainBundle/Repository/NotificationRepository.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Parameter \\$attribute of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:userHasAccess\\(\\) has typehint with 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/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
@@ -22,6 +244,14 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
|
path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Parameter \\$role of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:getReachableCircles\\(\\) has typehint with 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/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
#^Parameter \\$centerResolverDispatcher of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\DefaultVoterHelper\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
|
#^Parameter \\$centerResolverDispatcher of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\DefaultVoterHelper\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
|
||||||
@@ -46,6 +276,14 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperGenerator.php
|
path: src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperGenerator.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Class Chill\\\\MainBundle\\\\Security\\\\PasswordRecover\\\\PasswordRecoverEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
|
||||||
|
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
#^Class Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcher implements deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
|
#^Class Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcher implements deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
|
||||||
@@ -54,6 +292,35 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php
|
path: src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Class Chill\\\\MainBundle\\\\Templating\\\\Events\\\\DelegatedBlockRenderingEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
|
||||||
|
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Templating/Events/DelegatedBlockRenderingEvent.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Class Chill\\\\PersonBundle\\\\Actions\\\\ActionEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
|
||||||
|
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Actions/ActionEvent.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Class Chill\\\\PersonBundle\\\\Controller\\\\AccompanyingCourseController extends deprecated class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\Controller\\:
|
||||||
|
since Symfony 4\\.2, use "Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController" instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
#^Call to deprecated method getCurrentAccompanyingPeriod\\(\\) of class Chill\\\\PersonBundle\\\\Entity\\\\Person\\:
|
#^Call to deprecated method getCurrentAccompanyingPeriod\\(\\) of class Chill\\\\PersonBundle\\\\Entity\\\\Person\\:
|
||||||
@@ -62,10 +329,56 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php
|
path: src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Class Chill\\\\PersonBundle\\\\Controller\\\\PersonDuplicateController extends deprecated class Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\Controller\\:
|
||||||
|
since Symfony 4\\.2, use "Symfony\\\\Bundle\\\\FrameworkBundle\\\\Controller\\\\AbstractController" instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Access to deprecated property \\$proxyAccompanyingPeriodOpenState of class Chill\\\\PersonBundle\\\\Entity\\\\Person\\.$#"
|
message: "#^Access to deprecated property \\$proxyAccompanyingPeriodOpenState of class Chill\\\\PersonBundle\\\\Entity\\\\Person\\.$#"
|
||||||
count: 2
|
count: 2
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/Person.php
|
path: src/Bundle/ChillPersonBundle/Entity/Person.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/Form/AccompanyingPeriodType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Form/PersonType.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/ChillPersonBundle/Form/Type/PickPersonType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Class Chill\\\\PersonBundle\\\\Privacy\\\\AccompanyingPeriodPrivacyEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
|
||||||
|
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Privacy/AccompanyingPeriodPrivacyEvent.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Class Chill\\\\PersonBundle\\\\Privacy\\\\PrivacyEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
|
||||||
|
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Privacy/PrivacyEvent.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
#^Parameter \\$centerResolverDispatcher of method Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriodACLAwareRepository\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
|
#^Parameter \\$centerResolverDispatcher of method Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriodACLAwareRepository\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
|
||||||
@@ -74,6 +387,48 @@ 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/Widget/PersonListWidget.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/ChillReportBundle/Controller/ReportController.php
|
||||||
|
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Parameter \\$role of method Chill\\\\ReportBundle\\\\Form\\\\ReportType\\:\\:appendScopeChoices\\(\\) has typehint with 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/ChillReportBundle/Form/ReportType.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/ChillReportBundle/Search/ReportSearch.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/ChillTaskBundle/Controller/SingleTaskController.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
#^Parameter \\$centerResolverDispatcher of method Chill\\\\TaskBundle\\\\Controller\\\\SingleTaskController\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
|
#^Parameter \\$centerResolverDispatcher of method Chill\\\\TaskBundle\\\\Controller\\\\SingleTaskController\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
|
||||||
@@ -82,6 +437,46 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php
|
path: src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Parameter \\$role of method Chill\\\\TaskBundle\\\\Controller\\\\SingleTaskController\\:\\:setCreateForm\\(\\) has typehint with 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/ChillTaskBundle/Controller/SingleTaskController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Class Chill\\\\TaskBundle\\\\Event\\\\TaskEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
|
||||||
|
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillTaskBundle/Event/TaskEvent.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Class Chill\\\\TaskBundle\\\\Event\\\\UI\\\\UIEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
|
||||||
|
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillTaskBundle/Event/UI/UIEvent.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: 4
|
||||||
|
path: src/Bundle/ChillTaskBundle/Form/SingleTaskListType.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/ChillTaskBundle/Form/SingleTaskType.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
#^Parameter \\$centerResolverDispatcher of method Chill\\\\TaskBundle\\\\Form\\\\SingleTaskType\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
|
#^Parameter \\$centerResolverDispatcher of method Chill\\\\TaskBundle\\\\Form\\\\SingleTaskType\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
|
||||||
@@ -89,3 +484,28 @@ parameters:
|
|||||||
"""
|
"""
|
||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillTaskBundle/Form/SingleTaskType.php
|
path: src/Bundle/ChillTaskBundle/Form/SingleTaskType.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/ChillTaskBundle/Repository/SingleTaskRepository.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Class Chill\\\\TaskBundle\\\\Security\\\\Authorization\\\\AuthorizationEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
|
||||||
|
since Symfony 4\\.3, use "Symfony\\\\Contracts\\\\EventDispatcher\\\\Event" instead$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.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/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php
|
||||||
|
|
||||||
|
@@ -31,5 +31,4 @@ includes:
|
|||||||
- phpstan-baseline-level-3.neon
|
- phpstan-baseline-level-3.neon
|
||||||
- phpstan-baseline-level-4.neon
|
- phpstan-baseline-level-4.neon
|
||||||
- phpstan-baseline-level-5.neon
|
- phpstan-baseline-level-5.neon
|
||||||
- phpstan-deprecations-sf54.neon
|
|
||||||
- phpstan-baseline-deprecations-doctrine-orm.neon
|
|
||||||
|
@@ -1,13 +1,29 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="vendor/autoload.php" executionOrder="depends,defects" beStrictAboutOutputDuringTests="true" failOnRisky="true" failOnWarning="true" colors="true" cacheDirectory="var/cache/phpunit.rector.cache" requireCoverageMetadata="true" beStrictAboutCoverageMetadata="true">
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
<testsuites>
|
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
|
||||||
<testsuite name="default">
|
bootstrap="tests/app/vendor/autoload.php"
|
||||||
<directory>utils/rector/tests</directory>
|
cacheResultFile=".cache/phpunit/test-results-rector"
|
||||||
</testsuite>
|
executionOrder="depends,defects"
|
||||||
</testsuites>
|
forceCoversAnnotation="true"
|
||||||
<source>
|
beStrictAboutCoversAnnotation="true"
|
||||||
<include>
|
beStrictAboutOutputDuringTests="true"
|
||||||
<directory suffix=".php">utils/rector/src</directory>
|
beStrictAboutTodoAnnotatedTests="true"
|
||||||
</include>
|
convertDeprecationsToExceptions="true"
|
||||||
</source>
|
failOnRisky="true"
|
||||||
|
failOnWarning="true"
|
||||||
|
verbose="true"
|
||||||
|
colors="true"
|
||||||
|
>
|
||||||
|
<testsuites>
|
||||||
|
<testsuite name="default">
|
||||||
|
<directory>utils/rector/tests</directory>
|
||||||
|
</testsuite>
|
||||||
|
</testsuites>
|
||||||
|
|
||||||
|
<coverage cacheDirectory=".cache/phpunit/code-coverage-rector"
|
||||||
|
processUncoveredFiles="true">
|
||||||
|
<include>
|
||||||
|
<directory suffix=".php">utils/rector/src</directory>
|
||||||
|
</include>
|
||||||
|
</coverage>
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
116
phpunit.xml.dist
116
phpunit.xml.dist
@@ -1,73 +1,85 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<!-- 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" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="tests/bootstrap.php">
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
<php>
|
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
|
||||||
<ini name="error_reporting" value="-1"/>
|
backupGlobals="false"
|
||||||
<server name="APP_ENV" value="test" force="true"/>
|
colors="true"
|
||||||
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=93&max[indirect]=999999"/>
|
bootstrap="tests/bootstrap.php"
|
||||||
<server name="SHELL_VERBOSITY" value="-1"/>
|
>
|
||||||
<env name="KERNEL_CLASS" value="\App\Kernel"/>
|
<php>
|
||||||
</php>
|
<ini name="error_reporting" value="-1" />
|
||||||
<testsuites>
|
<server name="APP_ENV" value="test" force="true" />
|
||||||
<!--
|
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=0&max[indirect]=999999" />
|
||||||
|
<server name="SHELL_VERBOSITY" value="-1" />
|
||||||
|
<env name="KERNEL_CLASS" value="\App\Kernel" />
|
||||||
|
</php>
|
||||||
|
|
||||||
|
<testsuites>
|
||||||
|
<!--
|
||||||
<testsuite name="ActivityBundle">
|
<testsuite name="ActivityBundle">
|
||||||
<directory suffix="Test.php">src/Bundle/ChillActivityBundle/Tests/</directory>
|
<directory suffix="Test.php">src/Bundle/ChillActivityBundle/Tests/</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
-->
|
-->
|
||||||
<testsuite name="AsideActivityBundle">
|
<testsuite name="AsideActivityBundle">
|
||||||
<directory suffix="Test.php">src/Bundle/ChillAsideActivityBundle/src/Tests/</directory>
|
<directory suffix="Test.php">src/Bundle/ChillAsideActivityBundle/src/Tests/</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
<testsuite name="BudgetBundle">
|
<testsuite name="BudgetBundle">
|
||||||
<directory suffix="Test.php">src/Bundle/ChillBudgetBundle/Tests/</directory>
|
<directory suffix="Test.php">src/Bundle/ChillBudgetBundle/Tests/</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
<testsuite name="CalendarBundle">
|
<testsuite name="CalendarBundle">
|
||||||
<directory suffix="Test.php">src/Bundle/ChillCalendarBundle/Tests/</directory>
|
<directory suffix="Test.php">src/Bundle/ChillCalendarBundle/Tests/</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
<!-- Missing CustomFieldBundle -->
|
<!-- Missing CustomFieldBundle -->
|
||||||
<testsuite name="DocGeneratorBundle">
|
<testsuite name="DocGeneratorBundle">
|
||||||
<directory suffix="Test.php">src/Bundle/ChillDocGeneratorBundle/tests/</directory>
|
<directory suffix="Test.php">src/Bundle/ChillDocGeneratorBundle/tests/</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
<testsuite name="DocStoreBundle">
|
<testsuite name="DocStoreBundle">
|
||||||
<directory suffix="Test.php">src/Bundle/ChillDocStoreBundle/Tests/</directory>
|
<directory suffix="Test.php">src/Bundle/ChillDocStoreBundle/Tests/</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
<!--
|
<!--
|
||||||
<testsuite name="EventBundle">
|
<testsuite name="EventBundle">
|
||||||
<directory suffix="Test.php">src/Bundle/ChillEventBundle/tests/</directory>
|
<directory suffix="Test.php">src/Bundle/ChillEventBundle/tests/</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
-->
|
-->
|
||||||
<testsuite name="MainBundle">
|
<testsuite name="MainBundle">
|
||||||
<directory suffix="Test.php">src/Bundle/ChillMainBundle/Tests/</directory>
|
<directory suffix="Test.php">src/Bundle/ChillMainBundle/Tests/</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
<testsuite name="PersonBundle">
|
<testsuite name="PersonBundle">
|
||||||
<directory suffix="Test.php">src/Bundle/ChillPersonBundle/Tests/</directory>
|
<directory suffix="Test.php">src/Bundle/ChillPersonBundle/Tests/</directory>
|
||||||
<!-- we are rewriting accompanying periods... Work in progress -->
|
<!-- we are rewriting accompanying periods... Work in progress -->
|
||||||
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php</exclude>
|
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php</exclude>
|
||||||
<!-- we are rewriting address, Work in progress -->
|
<!-- we are rewriting address, Work in progress -->
|
||||||
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php</exclude>
|
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php</exclude>
|
||||||
<!-- find a solution to create multiple configs -->
|
<!-- find a solution to create multiple configs -->
|
||||||
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php</exclude>
|
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php</exclude>
|
||||||
<!-- temporarily removed, the time to find a fix -->
|
<!-- temporarily removed, the time to find a fix -->
|
||||||
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonDuplicateControllerViewTest.php</exclude>
|
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonDuplicateControllerViewTest.php</exclude>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
<!--
|
<!--
|
||||||
<testsuite name="ReportBundle">
|
<testsuite name="ReportBundle">
|
||||||
<directory suffix="Test.php">src/Bundle/ChillReportBundle/Tests/</directory>
|
<directory suffix="Test.php">src/Bundle/ChillReportBundle/Tests/</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
-->
|
-->
|
||||||
<!--
|
<!--
|
||||||
<testsuite name="TaskBundle">
|
<testsuite name="TaskBundle">
|
||||||
<directory suffix="Test.php">src/Bundle/ChillTaskBundle/Tests</directory>
|
<directory suffix="Test.php">src/Bundle/ChillTaskBundle/Tests</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
-->
|
-->
|
||||||
<testsuite name="ThirdPartyBundle">
|
<testsuite name="ThirdPartyBundle">
|
||||||
<directory suffix="Test.php">src/Bundle/ChillThirdPartyBundle/Tests</directory>
|
<directory suffix="Test.php">src/Bundle/ChillThirdPartyBundle/Tests</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
<testsuite name="WopiBundle">
|
<testsuite name="WopiBundle">
|
||||||
<directory suffix="Test.php">src/Bundle/ChillWopiBundle/tests/</directory>
|
<directory suffix="Test.php">src/Bundle/ChillWopiBundle/tests/</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
<!-- Run `composer require symfony/panther` before enabling this extension -->
|
|
||||||
<!--
|
<listeners>
|
||||||
|
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
|
||||||
|
</listeners>
|
||||||
|
|
||||||
|
<!-- Run `composer require symfony/panther` before enabling this extension -->
|
||||||
|
<!--
|
||||||
<extensions>
|
<extensions>
|
||||||
<extension class="Symfony\Component\Panther\ServerExtension" />
|
<extension class="Symfony\Component\Panther\ServerExtension" />
|
||||||
</extensions>
|
</extensions>
|
||||||
|
52
rector.php
52
rector.php
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
|
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
|
||||||
use Rector\Config\RectorConfig;
|
use Rector\Config\RectorConfig;
|
||||||
use Rector\Php80\Rector\Class_\AnnotationToAttributeRector;
|
|
||||||
use Rector\Set\ValueObject\LevelSetList;
|
use Rector\Set\ValueObject\LevelSetList;
|
||||||
|
|
||||||
return static function (RectorConfig $rectorConfig): void {
|
return static function (RectorConfig $rectorConfig): void {
|
||||||
@@ -20,7 +19,7 @@ return static function (RectorConfig $rectorConfig): void {
|
|||||||
__DIR__ . '/src',
|
__DIR__ . '/src',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$rectorConfig->symfonyContainerXml(__DIR__ . '/var/cache/dev/test/App_KernelTestDebugContainer.xml ');
|
$rectorConfig->symfonyContainerXml(__DIR__ . '/var/cache/dev/testsApp_KernelDevDebugContainer.xml');
|
||||||
$rectorConfig->symfonyContainerPhp(__DIR__ . '/tests/symfony-container.php');
|
$rectorConfig->symfonyContainerPhp(__DIR__ . '/tests/symfony-container.php');
|
||||||
|
|
||||||
//$rectorConfig->cacheClass(\Rector\Caching\ValueObject\Storage\FileCacheStorage::class);
|
//$rectorConfig->cacheClass(\Rector\Caching\ValueObject\Storage\FileCacheStorage::class);
|
||||||
@@ -28,64 +27,29 @@ return static function (RectorConfig $rectorConfig): void {
|
|||||||
|
|
||||||
// register a single rule
|
// register a single rule
|
||||||
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
|
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
|
||||||
|
|
||||||
// part of the symfony 54 rules
|
|
||||||
$rectorConfig->rule(\Rector\Symfony\Symfony53\Rector\StaticPropertyFetch\KernelTestCaseContainerPropertyDeprecationRector::class);
|
|
||||||
$rectorConfig->rule(\Rector\Symfony\Symfony60\Rector\MethodCall\GetHelperControllerToServiceRector::class);
|
|
||||||
$rectorConfig->disableParallel();
|
$rectorConfig->disableParallel();
|
||||||
|
|
||||||
//define sets of rules
|
//define sets of rules
|
||||||
$rectorConfig->sets([
|
$rectorConfig->sets([
|
||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_50,
|
LevelSetList::UP_TO_PHP_82,
|
||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_50_TYPES,
|
\Rector\Symfony\Set\SymfonyLevelSetList::UP_TO_SYMFONY_44,
|
||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_51,
|
|
||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_52,
|
|
||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_53,
|
|
||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_54,
|
|
||||||
\Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY,
|
\Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY,
|
||||||
\Rector\Doctrine\Set\DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
|
\Rector\PHPUnit\Set\PHPUnitLevelSetList::UP_TO_PHPUNIT_90,
|
||||||
]);
|
|
||||||
|
|
||||||
$rectorConfig->ruleWithConfiguration(\Rector\Php80\Rector\Class_\AnnotationToAttributeRector::class, [
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Symfony\Component\Serializer\Annotation\Context'),
|
|
||||||
]);
|
|
||||||
|
|
||||||
// migrate for phpunit
|
|
||||||
$rectorConfig->rules([
|
|
||||||
\Rector\PHPUnit\PHPUnit100\Rector\Class_\StaticDataProviderClassMethodRector::class,
|
|
||||||
\Rector\PHPUnit\PHPUnit100\Rector\Class_\PublicDataProviderClassMethodRector::class
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// some routes are added twice if it remains activated
|
// some routes are added twice if it remains activated
|
||||||
// $rectorConfig->rule(\Rector\Symfony\Configs\Rector\ClassMethod\AddRouteAnnotationRector::class);
|
// $rectorConfig->rule(\Rector\Symfony\Configs\Rector\ClassMethod\AddRouteAnnotationRector::class);
|
||||||
|
|
||||||
// chill rules
|
// chill rules
|
||||||
$rectorConfig->rules([
|
//$rectorConfig->rule(\Chill\Utils\Rector\Rector\ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector::class);
|
||||||
\Chill\Utils\Rector\Rector\ChillBundleMakeDataProviderStaticForAbstractExportTestRector::class,
|
|
||||||
]);
|
|
||||||
|
|
||||||
// skip some path...
|
// skip some path...
|
||||||
$rectorConfig->skip([
|
$rectorConfig->skip([
|
||||||
|
// we need to discuss this: are we going to have FALSE in tests instead of an error ?
|
||||||
|
\Rector\Php71\Rector\FuncCall\CountOnNullRector::class,
|
||||||
|
|
||||||
// we must adapt service definition
|
// we must adapt service definition
|
||||||
\Rector\Symfony\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector::class,
|
\Rector\Symfony\Symfony28\Rector\MethodCall\GetToConstructorInjectionRector::class,
|
||||||
\Rector\Symfony\Symfony34\Rector\Closure\ContainerGetNameToTypeInTestsRector::class,
|
\Rector\Symfony\Symfony34\Rector\Closure\ContainerGetNameToTypeInTestsRector::class,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$rectorConfig->ruleWithConfiguration(AnnotationToAttributeRector::class, [
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\AccompanyingPeriodValidity'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Household\HouseholdMembershipSequential'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Household\MaxHolder'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ConfidentialCourseMustHaveReferrer'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\LocationValidity'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ParticipationOverlap'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\AccompanyingPeriod\ResourceDuplicateCheck'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Person\Birthdate'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenter'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\PersonBundle\Validator\Constraints\Relationship\RelationshipNoDuplicate'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\ActivityBundle\Validator\Constraints\ActivityValidity'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\DocStoreBundle\Validator\Constraints\AsyncFileExists'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Validation\Constraint\PhonenumberConstraint'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency'),
|
|
||||||
new \Rector\Php80\ValueObject\AnnotationToAttribute('Chill\MainBundle\Workflow\Validator\EntityWorkflowCreation'),
|
|
||||||
]);
|
|
||||||
};
|
};
|
||||||
|
@@ -28,4 +28,3 @@ Version 1.5.5
|
|||||||
|
|
||||||
- [activity] replace dropdown for selecting reasons and use chillEntity for reason rendering
|
- [activity] replace dropdown for selecting reasons and use chillEntity for reason rendering
|
||||||
- fix bug: error when trying to edit activity of which the type has been deactivated
|
- fix bug: error when trying to edit activity of which the type has been deactivated
|
||||||
|
|
||||||
|
@@ -24,7 +24,6 @@ use Chill\MainBundle\Entity\UserJob;
|
|||||||
use Chill\MainBundle\Pagination\PaginatorFactory;
|
use Chill\MainBundle\Pagination\PaginatorFactory;
|
||||||
use Chill\MainBundle\Repository\LocationRepository;
|
use Chill\MainBundle\Repository\LocationRepository;
|
||||||
use Chill\MainBundle\Repository\UserRepositoryInterface;
|
use Chill\MainBundle\Repository\UserRepositoryInterface;
|
||||||
use Chill\MainBundle\Security\ChillSecurity;
|
|
||||||
use Chill\MainBundle\Security\Resolver\CenterResolverManagerInterface;
|
use Chill\MainBundle\Security\Resolver\CenterResolverManagerInterface;
|
||||||
use Chill\MainBundle\Templating\Listing\FilterOrderHelper;
|
use Chill\MainBundle\Templating\Listing\FilterOrderHelper;
|
||||||
use Chill\MainBundle\Templating\Listing\FilterOrderHelperFactoryInterface;
|
use Chill\MainBundle\Templating\Listing\FilterOrderHelperFactoryInterface;
|
||||||
@@ -68,13 +67,13 @@ final class ActivityController extends AbstractController
|
|||||||
private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory,
|
private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory,
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
private readonly PaginatorFactory $paginatorFactory,
|
private readonly PaginatorFactory $paginatorFactory,
|
||||||
private readonly ChillSecurity $security
|
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes a Activity entity.
|
* Deletes a Activity entity.
|
||||||
|
*
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/activity/{id}/delete", name="chill_activity_activity_delete", methods={"GET", "POST", "DELETE"})
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/{id}/delete', name: 'chill_activity_activity_delete', methods: ['GET', 'POST', 'DELETE'])]
|
|
||||||
public function deleteAction(Request $request, mixed $id)
|
public function deleteAction(Request $request, mixed $id)
|
||||||
{
|
{
|
||||||
$view = null;
|
$view = null;
|
||||||
@@ -142,8 +141,9 @@ final class ActivityController extends AbstractController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a form to edit an existing Activity entity.
|
* Displays a form to edit an existing Activity entity.
|
||||||
|
*
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/activity/{id}/edit", name="chill_activity_activity_edit", methods={"GET", "POST", "PUT"})
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/{id}/edit', name: 'chill_activity_activity_edit', methods: ['GET', 'POST', 'PUT'])]
|
|
||||||
public function editAction(int $id, Request $request): Response
|
public function editAction(int $id, Request $request): Response
|
||||||
{
|
{
|
||||||
$view = null;
|
$view = null;
|
||||||
@@ -236,8 +236,9 @@ final class ActivityController extends AbstractController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Lists all Activity entities.
|
* Lists all Activity entities.
|
||||||
|
*
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/activity/", name="chill_activity_activity_list")
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/', name: 'chill_activity_activity_list')]
|
|
||||||
public function listAction(Request $request): Response
|
public function listAction(Request $request): Response
|
||||||
{
|
{
|
||||||
$view = null;
|
$view = null;
|
||||||
@@ -341,7 +342,9 @@ final class ActivityController extends AbstractController
|
|||||||
return $filterBuilder->build();
|
return $filterBuilder->build();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/new', name: 'chill_activity_activity_new', methods: ['POST', 'GET'])]
|
/**
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/activity/new", name="chill_activity_activity_new", methods={"POST", "GET"})
|
||||||
|
*/
|
||||||
public function newAction(Request $request): Response
|
public function newAction(Request $request): Response
|
||||||
{
|
{
|
||||||
$view = null;
|
$view = null;
|
||||||
@@ -381,7 +384,7 @@ final class ActivityController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$entity = new Activity();
|
$entity = new Activity();
|
||||||
$entity->setUser($this->security->getUser());
|
$entity->setUser($this->getUser());
|
||||||
|
|
||||||
if ($person instanceof Person) {
|
if ($person instanceof Person) {
|
||||||
$entity->setPerson($person);
|
$entity->setPerson($person);
|
||||||
@@ -396,7 +399,7 @@ final class ActivityController extends AbstractController
|
|||||||
$entity->setDate(new \DateTime('now'));
|
$entity->setDate(new \DateTime('now'));
|
||||||
|
|
||||||
if ($request->query->has('activityData')) {
|
if ($request->query->has('activityData')) {
|
||||||
$activityData = $request->query->all('activityData');
|
$activityData = $request->query->get('activityData');
|
||||||
|
|
||||||
if (\array_key_exists('durationTime', $activityData) && $activityType->getDurationTimeVisible() > 0) {
|
if (\array_key_exists('durationTime', $activityData) && $activityType->getDurationTimeVisible() > 0) {
|
||||||
$durationTimeInMinutes = $activityData['durationTime'];
|
$durationTimeInMinutes = $activityData['durationTime'];
|
||||||
@@ -449,7 +452,7 @@ final class ActivityController extends AbstractController
|
|||||||
if (\array_key_exists('comment', $activityData) && $activityType->getCommentVisible() > 0) {
|
if (\array_key_exists('comment', $activityData) && $activityType->getCommentVisible() > 0) {
|
||||||
$comment = new CommentEmbeddable();
|
$comment = new CommentEmbeddable();
|
||||||
$comment->setComment($activityData['comment']);
|
$comment->setComment($activityData['comment']);
|
||||||
$comment->setUserId($this->security->getUser()->getId());
|
$comment->setUserId($this->getUser()->getid());
|
||||||
$comment->setDate(new \DateTime('now'));
|
$comment->setDate(new \DateTime('now'));
|
||||||
$entity->setComment($comment);
|
$entity->setComment($comment);
|
||||||
}
|
}
|
||||||
@@ -510,7 +513,7 @@ final class ActivityController extends AbstractController
|
|||||||
|
|
||||||
$activity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']);
|
$activity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']);
|
||||||
|
|
||||||
$defaultLocation = $this->security->getUser()->getCurrentLocation();
|
$defaultLocation = $this->getUser()->getCurrentLocation();
|
||||||
|
|
||||||
return $this->render($view, [
|
return $this->render($view, [
|
||||||
'person' => $person,
|
'person' => $person,
|
||||||
@@ -522,7 +525,9 @@ final class ActivityController extends AbstractController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/select-type', name: 'chill_activity_activity_select_type')]
|
/**
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/activity/select-type", name="chill_activity_activity_select_type")
|
||||||
|
*/
|
||||||
public function selectTypeAction(Request $request): Response
|
public function selectTypeAction(Request $request): Response
|
||||||
{
|
{
|
||||||
$view = null;
|
$view = null;
|
||||||
@@ -563,11 +568,13 @@ final class ActivityController extends AbstractController
|
|||||||
'person' => $person,
|
'person' => $person,
|
||||||
'accompanyingCourse' => $accompanyingPeriod,
|
'accompanyingCourse' => $accompanyingPeriod,
|
||||||
'data' => $data,
|
'data' => $data,
|
||||||
'activityData' => $request->query->all('activityData'),
|
'activityData' => $request->query->get('activityData', []),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/activity/{id}/show', name: 'chill_activity_activity_show')]
|
/**
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/activity/{id}/show", name="chill_activity_activity_show")
|
||||||
|
*/
|
||||||
public function showAction(Request $request, int $id): Response
|
public function showAction(Request $request, int $id): Response
|
||||||
{
|
{
|
||||||
$entity = $this->activityRepository->find($id);
|
$entity = $this->activityRepository->find($id);
|
||||||
@@ -666,8 +673,8 @@ final class ActivityController extends AbstractController
|
|||||||
throw $this->createNotFoundException('Accompanying Period not found');
|
throw $this->createNotFoundException('Accompanying Period not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Add permission
|
// TODO Add permission
|
||||||
// $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
|
// $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
|
||||||
} else {
|
} else {
|
||||||
throw $this->createNotFoundException('Person or Accompanying Period not found');
|
throw $this->createNotFoundException('Person or Accompanying Period not found');
|
||||||
}
|
}
|
||||||
|
@@ -22,12 +22,11 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
*/
|
*/
|
||||||
class ActivityReasonCategoryController extends AbstractController
|
class ActivityReasonCategoryController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new ActivityReasonCategory entity.
|
* Creates a new ActivityReasonCategory entity.
|
||||||
|
*
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreasoncategory/create", name="chill_activity_activityreasoncategory_create", methods={"POST"})
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/create', name: 'chill_activity_activityreasoncategory_create', methods: ['POST'])]
|
|
||||||
public function createAction(Request $request)
|
public function createAction(Request $request)
|
||||||
{
|
{
|
||||||
$entity = new ActivityReasonCategory();
|
$entity = new ActivityReasonCategory();
|
||||||
@@ -35,7 +34,7 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$em->persist($entity);
|
$em->persist($entity);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
@@ -50,13 +49,14 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a form to edit an existing ActivityReasonCategory entity.
|
* Displays a form to edit an existing ActivityReasonCategory entity.
|
||||||
|
*
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreasoncategory/{id}/edit", name="chill_activity_activityreasoncategory_edit")
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/edit', name: 'chill_activity_activityreasoncategory_edit')]
|
|
||||||
public function editAction(mixed $id)
|
public function editAction(mixed $id)
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(ActivityReasonCategory::class)->find($id);
|
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
|
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
|
||||||
@@ -72,13 +72,14 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Lists all ActivityReasonCategory entities.
|
* Lists all ActivityReasonCategory entities.
|
||||||
|
*
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreasoncategory/", name="chill_activity_activityreasoncategory")
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/', name: 'chill_activity_activityreasoncategory')]
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
$entities = $em->getRepository(ActivityReasonCategory::class)->findAll();
|
$entities = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->findAll();
|
||||||
|
|
||||||
return $this->render('@ChillActivity/ActivityReasonCategory/index.html.twig', [
|
return $this->render('@ChillActivity/ActivityReasonCategory/index.html.twig', [
|
||||||
'entities' => $entities,
|
'entities' => $entities,
|
||||||
@@ -87,8 +88,9 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a form to create a new ActivityReasonCategory entity.
|
* Displays a form to create a new ActivityReasonCategory entity.
|
||||||
|
*
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreasoncategory/new", name="chill_activity_activityreasoncategory_new")
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/new', name: 'chill_activity_activityreasoncategory_new')]
|
|
||||||
public function newAction()
|
public function newAction()
|
||||||
{
|
{
|
||||||
$entity = new ActivityReasonCategory();
|
$entity = new ActivityReasonCategory();
|
||||||
@@ -102,13 +104,14 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds and displays a ActivityReasonCategory entity.
|
* Finds and displays a ActivityReasonCategory entity.
|
||||||
|
*
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreasoncategory/{id}/show", name="chill_activity_activityreasoncategory_show")
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/show', name: 'chill_activity_activityreasoncategory_show')]
|
|
||||||
public function showAction(mixed $id)
|
public function showAction(mixed $id)
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(ActivityReasonCategory::class)->find($id);
|
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
|
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
|
||||||
@@ -121,13 +124,14 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Edits an existing ActivityReasonCategory entity.
|
* Edits an existing ActivityReasonCategory entity.
|
||||||
|
*
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreasoncategory/{id}/update", name="chill_activity_activityreasoncategory_update", methods={"POST", "PUT"})
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/update', name: 'chill_activity_activityreasoncategory_update', methods: ['POST', 'PUT'])]
|
|
||||||
public function updateAction(Request $request, mixed $id)
|
public function updateAction(Request $request, mixed $id)
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(ActivityReasonCategory::class)->find($id);
|
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
|
throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.');
|
||||||
|
@@ -24,12 +24,13 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|||||||
*/
|
*/
|
||||||
class ActivityReasonController extends AbstractController
|
class ActivityReasonController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly ActivityReasonRepository $activityReasonRepository, private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
public function __construct(private readonly ActivityReasonRepository $activityReasonRepository) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new ActivityReason entity.
|
* Creates a new ActivityReason entity.
|
||||||
|
*
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreason/create", name="chill_activity_activityreason_create", methods={"POST"})
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/create', name: 'chill_activity_activityreason_create', methods: ['POST'])]
|
|
||||||
public function createAction(Request $request)
|
public function createAction(Request $request)
|
||||||
{
|
{
|
||||||
$entity = new ActivityReason();
|
$entity = new ActivityReason();
|
||||||
@@ -37,7 +38,7 @@ class ActivityReasonController extends AbstractController
|
|||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$em->persist($entity);
|
$em->persist($entity);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
@@ -52,13 +53,14 @@ class ActivityReasonController extends AbstractController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a form to edit an existing ActivityReason entity.
|
* Displays a form to edit an existing ActivityReason entity.
|
||||||
|
*
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreason/{id}/edit", name="chill_activity_activityreason_edit")
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/edit', name: 'chill_activity_activityreason_edit')]
|
|
||||||
public function editAction(mixed $id)
|
public function editAction(mixed $id)
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(ActivityReason::class)->find($id);
|
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id);
|
||||||
|
|
||||||
if (null === $entity) {
|
if (null === $entity) {
|
||||||
throw new NotFoundHttpException('Unable to find ActivityReason entity.');
|
throw new NotFoundHttpException('Unable to find ActivityReason entity.');
|
||||||
@@ -74,11 +76,12 @@ class ActivityReasonController extends AbstractController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Lists all ActivityReason entities.
|
* Lists all ActivityReason entities.
|
||||||
|
*
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreason/", name="chill_activity_activityreason")
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/', name: 'chill_activity_activityreason')]
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
$entities = $this->activityReasonRepository->findAll();
|
$entities = $this->activityReasonRepository->findAll();
|
||||||
|
|
||||||
@@ -89,8 +92,9 @@ class ActivityReasonController extends AbstractController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a form to create a new ActivityReason entity.
|
* Displays a form to create a new ActivityReason entity.
|
||||||
|
*
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreason/new", name="chill_activity_activityreason_new")
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/new', name: 'chill_activity_activityreason_new')]
|
|
||||||
public function newAction()
|
public function newAction()
|
||||||
{
|
{
|
||||||
$entity = new ActivityReason();
|
$entity = new ActivityReason();
|
||||||
@@ -104,13 +108,14 @@ class ActivityReasonController extends AbstractController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds and displays a ActivityReason entity.
|
* Finds and displays a ActivityReason entity.
|
||||||
|
*
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreason/{id}/show", name="chill_activity_activityreason_show")
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/show', name: 'chill_activity_activityreason_show')]
|
|
||||||
public function showAction(mixed $id)
|
public function showAction(mixed $id)
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(ActivityReason::class)->find($id);
|
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find ActivityReason entity.');
|
throw $this->createNotFoundException('Unable to find ActivityReason entity.');
|
||||||
@@ -123,13 +128,14 @@ class ActivityReasonController extends AbstractController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Edits an existing ActivityReason entity.
|
* Edits an existing ActivityReason entity.
|
||||||
|
*
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activityreason/{id}/update", name="chill_activity_activityreason_update", methods={"POST", "PUT"})
|
||||||
*/
|
*/
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/update', name: 'chill_activity_activityreason_update', methods: ['POST', 'PUT'])]
|
|
||||||
public function updateAction(Request $request, mixed $id)
|
public function updateAction(Request $request, mixed $id)
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
$entity = $em->getRepository(ActivityReason::class)->find($id);
|
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (!$entity) {
|
||||||
throw $this->createNotFoundException('Unable to find ActivityReason entity.');
|
throw $this->createNotFoundException('Unable to find ActivityReason entity.');
|
||||||
|
@@ -18,14 +18,18 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|||||||
*/
|
*/
|
||||||
class AdminController extends AbstractController
|
class AdminController extends AbstractController
|
||||||
{
|
{
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activity', name: 'chill_activity_admin_index')]
|
/**
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activity", name="chill_activity_admin_index")
|
||||||
|
*/
|
||||||
public function indexActivityAction()
|
public function indexActivityAction()
|
||||||
{
|
{
|
||||||
return $this->render('@ChillActivity/Admin/layout_activity.html.twig');
|
return $this->render('@ChillActivity/Admin/layout_activity.html.twig');
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activity_redirect_to_main', name: 'chill_admin_aside_activity_redirect_to_admin_index', options: [null])]
|
/**
|
||||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activity_redirect_to_main', name: 'chill_admin_activity_redirect_to_admin_index')]
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activity_redirect_to_main", name="chill_admin_aside_activity_redirect_to_admin_index", options={null})
|
||||||
|
* @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/activity_redirect_to_main", name="chill_admin_activity_redirect_to_admin_index")
|
||||||
|
*/
|
||||||
public function redirectToAdminIndexAction()
|
public function redirectToAdminIndexAction()
|
||||||
{
|
{
|
||||||
return $this->redirectToRoute('chill_main_admin_central');
|
return $this->redirectToRoute('chill_main_admin_central');
|
||||||
|
@@ -64,7 +64,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface
|
|||||||
->setPerson($person)
|
->setPerson($person)
|
||||||
->setDate($this->faker->dateTimeThisYear())
|
->setDate($this->faker->dateTimeThisYear())
|
||||||
->setDurationTime($this->faker->dateTime(36000))
|
->setDurationTime($this->faker->dateTime(36000))
|
||||||
->setActivityType($this->getRandomActivityType())
|
->setType($this->getRandomActivityType())
|
||||||
->setScope($this->getRandomScope());
|
->setScope($this->getRandomScope());
|
||||||
|
|
||||||
// ->setAttendee($this->faker->boolean())
|
// ->setAttendee($this->faker->boolean())
|
||||||
|
@@ -25,12 +25,14 @@ use Chill\MainBundle\Entity\HasScopesInterface;
|
|||||||
use Chill\MainBundle\Entity\Location;
|
use Chill\MainBundle\Entity\Location;
|
||||||
use Chill\MainBundle\Entity\Scope;
|
use Chill\MainBundle\Entity\Scope;
|
||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
|
use Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency;
|
||||||
use Chill\PersonBundle\AccompanyingPeriod\SocialIssueConsistency\AccompanyingPeriodLinkedWithSocialIssuesEntityInterface;
|
use Chill\PersonBundle\AccompanyingPeriod\SocialIssueConsistency\AccompanyingPeriodLinkedWithSocialIssuesEntityInterface;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
||||||
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
|
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
|
||||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||||
|
use DateTime;
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
@@ -41,12 +43,25 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Activity.
|
* Class Activity.
|
||||||
|
*
|
||||||
|
* @ORM\Entity(repositoryClass="Chill\ActivityBundle\Repository\ActivityRepository")
|
||||||
|
*
|
||||||
|
* @ORM\Table(name="activity")
|
||||||
|
*
|
||||||
|
* @ORM\HasLifecycleCallbacks
|
||||||
|
*
|
||||||
|
* @DiscriminatorMap(typeProperty="type", mapping={
|
||||||
|
* "activity": Activity::class
|
||||||
|
* })
|
||||||
|
*
|
||||||
|
* @ActivityValidator\ActivityValidity
|
||||||
|
*
|
||||||
|
* TODO see if necessary
|
||||||
|
* UserCircleConsistency(
|
||||||
|
* "CHILL_ACTIVITY_SEE_DETAILS",
|
||||||
|
* getUserFunction="getUser",
|
||||||
|
* path="scope")
|
||||||
*/
|
*/
|
||||||
#[DiscriminatorMap(typeProperty: 'type', mapping: ['activity' => Activity::class])]
|
|
||||||
#[ORM\Entity(repositoryClass: \Chill\ActivityBundle\Repository\ActivityRepository::class)]
|
|
||||||
#[ORM\HasLifecycleCallbacks]
|
|
||||||
#[ORM\Table(name: 'activity')]
|
|
||||||
#[ActivityValidator\ActivityValidity] // TODO see if necessary
|
|
||||||
class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface, HasCentersInterface, HasScopesInterface, TrackCreationInterface, TrackUpdateInterface
|
class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface, HasCentersInterface, HasScopesInterface, TrackCreationInterface, TrackUpdateInterface
|
||||||
{
|
{
|
||||||
use TrackCreationTrait;
|
use TrackCreationTrait;
|
||||||
@@ -57,115 +72,176 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
|||||||
|
|
||||||
final public const SENTRECEIVED_SENT = 'sent';
|
final public const SENTRECEIVED_SENT = 'sent';
|
||||||
|
|
||||||
#[Groups(['read'])]
|
/**
|
||||||
#[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class)]
|
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod")
|
||||||
|
*
|
||||||
|
* @Groups({"read"})
|
||||||
|
*/
|
||||||
private ?AccompanyingPeriod $accompanyingPeriod = null;
|
private ?AccompanyingPeriod $accompanyingPeriod = null;
|
||||||
|
|
||||||
#[Groups(['read', 'docgen:read'])]
|
/**
|
||||||
#[SerializedName('activityType')]
|
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityType")
|
||||||
#[ORM\ManyToOne(targetEntity: ActivityType::class)]
|
*
|
||||||
#[ORM\JoinColumn(name: 'type_id')]
|
* @Groups({"read", "docgen:read"})
|
||||||
|
*
|
||||||
|
* @SerializedName("activityType")
|
||||||
|
*
|
||||||
|
* @ORM\JoinColumn(name="type_id")
|
||||||
|
*/
|
||||||
private ActivityType $activityType;
|
private ActivityType $activityType;
|
||||||
|
|
||||||
#[Groups(['docgen:read'])]
|
/**
|
||||||
#[ORM\ManyToOne(targetEntity: ActivityPresence::class)]
|
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityPresence")
|
||||||
|
*
|
||||||
|
* @Groups({"docgen:read"})
|
||||||
|
*/
|
||||||
private ?ActivityPresence $attendee = null;
|
private ?ActivityPresence $attendee = null;
|
||||||
|
|
||||||
#[Groups(['docgen:read'])]
|
/**
|
||||||
#[ORM\Embedded(class: CommentEmbeddable::class, columnPrefix: 'comment_')]
|
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\CommentEmbeddable", columnPrefix="comment_")
|
||||||
|
*
|
||||||
|
* @Groups({"docgen:read"})
|
||||||
|
*/
|
||||||
private CommentEmbeddable $comment;
|
private CommentEmbeddable $comment;
|
||||||
|
|
||||||
#[Groups(['docgen:read'])]
|
/**
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE)]
|
* @ORM\Column(type="datetime")
|
||||||
|
*
|
||||||
|
* @Groups({"docgen:read"})
|
||||||
|
*/
|
||||||
private \DateTime $date;
|
private \DateTime $date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @ORM\ManyToMany(targetEntity="Chill\DocStoreBundle\Entity\StoredObject", cascade={"persist"})
|
||||||
|
*
|
||||||
|
* @Assert\Valid(traverse=true)
|
||||||
|
*
|
||||||
* @var Collection<StoredObject>
|
* @var Collection<StoredObject>
|
||||||
*/
|
*/
|
||||||
#[Assert\Valid(traverse: true)]
|
|
||||||
#[ORM\ManyToMany(targetEntity: StoredObject::class, cascade: ['persist'])]
|
|
||||||
private Collection $documents;
|
private Collection $documents;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TIME_MUTABLE, nullable: true)]
|
/**
|
||||||
|
* @ORM\Column(type="time", nullable=true)
|
||||||
|
*/
|
||||||
private ?\DateTime $durationTime = null;
|
private ?\DateTime $durationTime = null;
|
||||||
|
|
||||||
#[Groups(['docgen:read'])]
|
/**
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => false])]
|
* @ORM\Column(type="boolean", options={"default": false})
|
||||||
|
*
|
||||||
|
* @Groups({"docgen:read"})
|
||||||
|
*/
|
||||||
private bool $emergency = false;
|
private bool $emergency = false;
|
||||||
|
|
||||||
#[Groups(['read', 'docgen:read'])]
|
/**
|
||||||
#[ORM\Id]
|
* @ORM\Id
|
||||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
*
|
||||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
* @ORM\Column(name="id", type="integer")
|
||||||
|
*
|
||||||
|
* @ORM\GeneratedValue(strategy="AUTO")
|
||||||
|
*
|
||||||
|
* @Groups({"read", "docgen:read"})
|
||||||
|
*/
|
||||||
private ?int $id = null;
|
private ?int $id = null;
|
||||||
|
|
||||||
#[Groups(['read', 'docgen:read'])]
|
/**
|
||||||
#[ORM\ManyToOne(targetEntity: Location::class)]
|
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Location")
|
||||||
|
*
|
||||||
|
* @groups({"read", "docgen:read"})
|
||||||
|
*/
|
||||||
private ?Location $location = null;
|
private ?Location $location = null;
|
||||||
|
|
||||||
#[ORM\ManyToOne(targetEntity: Person::class)]
|
/**
|
||||||
|
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person")
|
||||||
|
*/
|
||||||
private ?Person $person = null;
|
private ?Person $person = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\Person")
|
||||||
|
*
|
||||||
|
* @Groups({"read", "docgen:read"})
|
||||||
|
*
|
||||||
* @var Collection<Person>
|
* @var Collection<Person>
|
||||||
*/
|
*/
|
||||||
#[Groups(['read', 'docgen:read'])]
|
|
||||||
#[ORM\ManyToMany(targetEntity: Person::class)]
|
|
||||||
private Collection $persons;
|
private Collection $persons;
|
||||||
|
|
||||||
#[ORM\Embedded(class: PrivateCommentEmbeddable::class, columnPrefix: 'privateComment_')]
|
/**
|
||||||
|
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable", columnPrefix="privateComment_")
|
||||||
|
*/
|
||||||
private PrivateCommentEmbeddable $privateComment;
|
private PrivateCommentEmbeddable $privateComment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @ORM\ManyToMany(targetEntity="Chill\ActivityBundle\Entity\ActivityReason")
|
||||||
|
*
|
||||||
|
* @Groups({"docgen:read"})
|
||||||
|
*
|
||||||
* @var Collection<ActivityReason>
|
* @var Collection<ActivityReason>
|
||||||
*/
|
*/
|
||||||
#[Groups(['docgen:read'])]
|
|
||||||
#[ORM\ManyToMany(targetEntity: ActivityReason::class)]
|
|
||||||
private Collection $reasons;
|
private Collection $reasons;
|
||||||
|
|
||||||
#[Groups(['docgen:read'])]
|
/**
|
||||||
#[ORM\ManyToOne(targetEntity: Scope::class)]
|
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Scope")
|
||||||
|
*
|
||||||
|
* @Groups({"docgen:read"})
|
||||||
|
*/
|
||||||
private ?Scope $scope = null;
|
private ?Scope $scope = null;
|
||||||
|
|
||||||
#[Groups(['docgen:read'])]
|
/**
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, options: ['default' => ''])]
|
* @ORM\Column(type="string", options={"default": ""})
|
||||||
|
*
|
||||||
|
* @Groups({"docgen:read"})
|
||||||
|
*/
|
||||||
private string $sentReceived = '';
|
private string $sentReceived = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialAction")
|
||||||
|
*
|
||||||
|
* @ORM\JoinTable(name="chill_activity_activity_chill_person_socialaction")
|
||||||
|
*
|
||||||
|
* @Groups({"read", "docgen:read"})
|
||||||
|
*
|
||||||
* @var Collection<SocialAction>
|
* @var Collection<SocialAction>
|
||||||
*/
|
*/
|
||||||
#[Groups(['read', 'docgen:read'])]
|
|
||||||
#[ORM\ManyToMany(targetEntity: SocialAction::class)]
|
|
||||||
#[ORM\JoinTable(name: 'chill_activity_activity_chill_person_socialaction')]
|
|
||||||
private Collection $socialActions;
|
private Collection $socialActions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialIssue")
|
||||||
|
*
|
||||||
|
* @ORM\JoinTable(name="chill_activity_activity_chill_person_socialissue")
|
||||||
|
*
|
||||||
|
* @Groups({"read", "docgen:read"})
|
||||||
|
*
|
||||||
* @var Collection<SocialIssue>
|
* @var Collection<SocialIssue>
|
||||||
*/
|
*/
|
||||||
#[Groups(['read', 'docgen:read'])]
|
|
||||||
#[ORM\ManyToMany(targetEntity: SocialIssue::class)]
|
|
||||||
#[ORM\JoinTable(name: 'chill_activity_activity_chill_person_socialissue')]
|
|
||||||
private Collection $socialIssues;
|
private Collection $socialIssues;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty")
|
||||||
|
*
|
||||||
|
* @Groups({"read", "docgen:read"})
|
||||||
|
*
|
||||||
* @var Collection<ThirdParty>
|
* @var Collection<ThirdParty>
|
||||||
*/
|
*/
|
||||||
#[Groups(['read', 'docgen:read'])]
|
|
||||||
#[ORM\ManyToMany(targetEntity: ThirdParty::class)]
|
|
||||||
private Collection $thirdParties;
|
private Collection $thirdParties;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TIME_MUTABLE, nullable: true)]
|
/**
|
||||||
|
* @ORM\Column(type="time", nullable=true)
|
||||||
|
*/
|
||||||
private ?\DateTime $travelTime = null;
|
private ?\DateTime $travelTime = null;
|
||||||
|
|
||||||
#[Groups(['docgen:read'])]
|
/**
|
||||||
#[ORM\ManyToOne(targetEntity: User::class)]
|
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
|
||||||
|
*
|
||||||
|
* @Groups({"docgen:read"})
|
||||||
|
*/
|
||||||
private ?User $user = null;
|
private ?User $user = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\User")
|
||||||
|
*
|
||||||
|
* @Groups({"read", "docgen:read"})
|
||||||
|
*
|
||||||
* @var Collection<User>
|
* @var Collection<User>
|
||||||
*/
|
*/
|
||||||
#[Groups(['read', 'docgen:read'])]
|
|
||||||
#[ORM\ManyToMany(targetEntity: User::class)]
|
|
||||||
private Collection $users;
|
private Collection $users;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
@@ -309,7 +385,9 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
|||||||
return $this->documents;
|
return $this->documents;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Groups(['docgen:read'])]
|
/**
|
||||||
|
* @Groups({"docgen:read"})
|
||||||
|
*/
|
||||||
public function getDurationMinute(): int
|
public function getDurationMinute(): int
|
||||||
{
|
{
|
||||||
if (null === $this->durationTime) {
|
if (null === $this->durationTime) {
|
||||||
@@ -437,7 +515,9 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
|||||||
return $this->travelTime;
|
return $this->travelTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Groups(['docgen:read'])]
|
/**
|
||||||
|
* @Groups({"docgen:read"})
|
||||||
|
*/
|
||||||
public function getTravelTimeMinute(): int
|
public function getTravelTimeMinute(): int
|
||||||
{
|
{
|
||||||
if (null === $this->travelTime) {
|
if (null === $this->travelTime) {
|
||||||
|
@@ -16,24 +16,38 @@ use Symfony\Component\Serializer\Annotation as Serializer;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ActivityPresence.
|
* Class ActivityPresence.
|
||||||
|
*
|
||||||
|
* @ORM\Entity
|
||||||
|
*
|
||||||
|
* @ORM\Table(name="activitytpresence")
|
||||||
|
*
|
||||||
|
* @ORM\HasLifecycleCallbacks
|
||||||
*/
|
*/
|
||||||
#[ORM\Entity]
|
|
||||||
#[ORM\HasLifecycleCallbacks]
|
|
||||||
#[ORM\Table(name: 'activitytpresence')]
|
|
||||||
class ActivityPresence
|
class ActivityPresence
|
||||||
{
|
{
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
/**
|
||||||
|
* @ORM\Column(type="boolean")
|
||||||
|
*/
|
||||||
private bool $active = true;
|
private bool $active = true;
|
||||||
|
|
||||||
#[Serializer\Groups(['docgen:read'])]
|
/**
|
||||||
#[ORM\Id]
|
* @ORM\Id
|
||||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
*
|
||||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
* @ORM\Column(name="id", type="integer")
|
||||||
|
*
|
||||||
|
* @ORM\GeneratedValue(strategy="AUTO")
|
||||||
|
*
|
||||||
|
* @Serializer\Groups({"docgen:read"})
|
||||||
|
*/
|
||||||
private ?int $id = null;
|
private ?int $id = null;
|
||||||
|
|
||||||
#[Serializer\Groups(['docgen:read'])]
|
/**
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
* @ORM\Column(type="json")
|
||||||
#[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])]
|
*
|
||||||
|
* @Serializer\Groups({"docgen:read"})
|
||||||
|
*
|
||||||
|
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
|
||||||
|
*/
|
||||||
private array $name = [];
|
private array $name = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -15,24 +15,39 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ActivityReason.
|
* Class ActivityReason.
|
||||||
|
*
|
||||||
|
* @ORM\Entity
|
||||||
|
*
|
||||||
|
* @ORM\Table(name="activityreason")
|
||||||
|
*
|
||||||
|
* @ORM\HasLifecycleCallbacks
|
||||||
*/
|
*/
|
||||||
#[ORM\Entity]
|
|
||||||
#[ORM\HasLifecycleCallbacks]
|
|
||||||
#[ORM\Table(name: 'activityreason')]
|
|
||||||
class ActivityReason
|
class ActivityReason
|
||||||
{
|
{
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
/**
|
||||||
|
* @ORM\Column(type="boolean")
|
||||||
|
*/
|
||||||
private bool $active = true;
|
private bool $active = true;
|
||||||
|
|
||||||
#[ORM\ManyToOne(targetEntity: ActivityReasonCategory::class, inversedBy: 'reasons')]
|
/**
|
||||||
|
* @ORM\ManyToOne(
|
||||||
|
* targetEntity="Chill\ActivityBundle\Entity\ActivityReasonCategory",
|
||||||
|
* inversedBy="reasons")
|
||||||
|
*/
|
||||||
private ?ActivityReasonCategory $category = null;
|
private ?ActivityReasonCategory $category = null;
|
||||||
|
|
||||||
#[ORM\Id]
|
/**
|
||||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
* @ORM\Id
|
||||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
*
|
||||||
|
* @ORM\Column(name="id", type="integer")
|
||||||
|
*
|
||||||
|
* @ORM\GeneratedValue(strategy="AUTO")
|
||||||
|
*/
|
||||||
private ?int $id = null;
|
private ?int $id = null;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
/**
|
||||||
|
* @ORM\Column(type="json")
|
||||||
|
*/
|
||||||
private array $name;
|
private array $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -17,32 +17,45 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ActivityReasonCategory.
|
* Class ActivityReasonCategory.
|
||||||
|
*
|
||||||
|
* @ORM\Entity
|
||||||
|
*
|
||||||
|
* @ORM\Table(name="activityreasoncategory")
|
||||||
|
*
|
||||||
|
* @ORM\HasLifecycleCallbacks
|
||||||
*/
|
*/
|
||||||
#[ORM\Entity]
|
|
||||||
#[ORM\HasLifecycleCallbacks]
|
|
||||||
#[ORM\Table(name: 'activityreasoncategory')]
|
|
||||||
class ActivityReasonCategory implements \Stringable
|
class ActivityReasonCategory implements \Stringable
|
||||||
{
|
{
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
/**
|
||||||
|
* @ORM\Column(type="boolean")
|
||||||
|
*/
|
||||||
private bool $active = true;
|
private bool $active = true;
|
||||||
|
|
||||||
#[ORM\Id]
|
/**
|
||||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
* @ORM\Id
|
||||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
*
|
||||||
|
* @ORM\Column(name="id", type="integer")
|
||||||
|
*
|
||||||
|
* @ORM\GeneratedValue(strategy="AUTO")
|
||||||
|
*/
|
||||||
private ?int $id = null;
|
private ?int $id = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
|
*
|
||||||
|
* @ORM\Column(type="json")
|
||||||
*/
|
*/
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
|
||||||
private $name;
|
private $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array of ActivityReason.
|
* Array of ActivityReason.
|
||||||
*
|
*
|
||||||
* @var Collection<ActivityReason>
|
* @var Collection<ActivityReason>
|
||||||
|
*
|
||||||
|
* @ORM\OneToMany(
|
||||||
|
* targetEntity="Chill\ActivityBundle\Entity\ActivityReason",
|
||||||
|
* mappedBy="category")
|
||||||
*/
|
*/
|
||||||
#[ORM\OneToMany(targetEntity: ActivityReason::class, mappedBy: 'category')]
|
|
||||||
private Collection $reasons;
|
private Collection $reasons;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -19,10 +19,13 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ActivityType.
|
* Class ActivityType.
|
||||||
|
*
|
||||||
|
* @ORM\Entity
|
||||||
|
*
|
||||||
|
* @ORM\Table(name="activitytype")
|
||||||
|
*
|
||||||
|
* @ORM\HasLifecycleCallbacks
|
||||||
*/
|
*/
|
||||||
#[ORM\Entity]
|
|
||||||
#[ORM\HasLifecycleCallbacks]
|
|
||||||
#[ORM\Table(name: 'activitytype')]
|
|
||||||
class ActivityType
|
class ActivityType
|
||||||
{
|
{
|
||||||
final public const FIELD_INVISIBLE = 0;
|
final public const FIELD_INVISIBLE = 0;
|
||||||
@@ -33,169 +36,262 @@ class ActivityType
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated not in use
|
* @deprecated not in use
|
||||||
|
*
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
*/
|
*/
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
|
||||||
private string $accompanyingPeriodLabel = '';
|
private string $accompanyingPeriodLabel = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated not in use
|
* @deprecated not in use
|
||||||
|
*
|
||||||
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||||
*/
|
*/
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
|
|
||||||
private int $accompanyingPeriodVisible = self::FIELD_INVISIBLE;
|
private int $accompanyingPeriodVisible = self::FIELD_INVISIBLE;
|
||||||
|
|
||||||
#[Groups(['read'])]
|
/**
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
* @ORM\Column(type="boolean")
|
||||||
|
*
|
||||||
|
* @Groups({"read"})
|
||||||
|
*/
|
||||||
private bool $active = true;
|
private bool $active = true;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
private string $attendeeLabel = '';
|
private string $attendeeLabel = '';
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
|
/**
|
||||||
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||||
|
*/
|
||||||
private int $attendeeVisible = self::FIELD_OPTIONAL;
|
private int $attendeeVisible = self::FIELD_OPTIONAL;
|
||||||
|
|
||||||
#[ORM\ManyToOne(targetEntity: ActivityTypeCategory::class)]
|
/**
|
||||||
|
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityTypeCategory")
|
||||||
|
*/
|
||||||
private ?ActivityTypeCategory $category = null;
|
private ?ActivityTypeCategory $category = null;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
private string $commentLabel = '';
|
private string $commentLabel = '';
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
|
/**
|
||||||
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||||
|
*/
|
||||||
private int $commentVisible = self::FIELD_OPTIONAL;
|
private int $commentVisible = self::FIELD_OPTIONAL;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
private string $dateLabel = '';
|
private string $dateLabel = '';
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 2])]
|
/**
|
||||||
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 2})
|
||||||
|
*/
|
||||||
private int $dateVisible = self::FIELD_REQUIRED;
|
private int $dateVisible = self::FIELD_REQUIRED;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
private string $documentsLabel = '';
|
private string $documentsLabel = '';
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
|
/**
|
||||||
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||||
|
*/
|
||||||
private int $documentsVisible = self::FIELD_OPTIONAL;
|
private int $documentsVisible = self::FIELD_OPTIONAL;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
private string $durationTimeLabel = '';
|
private string $durationTimeLabel = '';
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
|
/**
|
||||||
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||||
|
*/
|
||||||
private int $durationTimeVisible = self::FIELD_OPTIONAL;
|
private int $durationTimeVisible = self::FIELD_OPTIONAL;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
private string $emergencyLabel = '';
|
private string $emergencyLabel = '';
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
|
/**
|
||||||
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||||
|
*/
|
||||||
private int $emergencyVisible = self::FIELD_INVISIBLE;
|
private int $emergencyVisible = self::FIELD_INVISIBLE;
|
||||||
|
|
||||||
#[Groups(['docgen:read'])]
|
/**
|
||||||
#[ORM\Id]
|
* @ORM\Id
|
||||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
*
|
||||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
* @ORM\Column(name="id", type="integer")
|
||||||
|
*
|
||||||
|
* @ORM\GeneratedValue(strategy="AUTO")
|
||||||
|
*
|
||||||
|
* @Groups({"docgen:read"})
|
||||||
|
*/
|
||||||
private ?int $id = null;
|
private ?int $id = null;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
private string $locationLabel = '';
|
private string $locationLabel = '';
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
|
/**
|
||||||
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||||
|
*/
|
||||||
private int $locationVisible = self::FIELD_INVISIBLE;
|
private int $locationVisible = self::FIELD_INVISIBLE;
|
||||||
|
|
||||||
#[Groups(['read', 'docgen:read'])]
|
/**
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
* @ORM\Column(type="json")
|
||||||
#[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])]
|
*
|
||||||
|
* @Groups({"read", "docgen:read"})
|
||||||
|
*
|
||||||
|
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
|
||||||
|
*/
|
||||||
private array $name = [];
|
private array $name = [];
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, options: ['default' => '0.0'])]
|
/**
|
||||||
|
* @ORM\Column(type="float", options={"default": "0.0"})
|
||||||
|
*/
|
||||||
private float $ordering = 0.0;
|
private float $ordering = 0.0;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
private string $personLabel = '';
|
private string $personLabel = '';
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
private string $personsLabel = '';
|
private string $personsLabel = '';
|
||||||
|
|
||||||
#[Groups(['read'])]
|
/**
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||||
|
*
|
||||||
|
* @Groups({"read"})
|
||||||
|
*/
|
||||||
private int $personsVisible = self::FIELD_OPTIONAL;
|
private int $personsVisible = self::FIELD_OPTIONAL;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 2])]
|
/**
|
||||||
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 2})
|
||||||
|
*/
|
||||||
private int $personVisible = self::FIELD_REQUIRED;
|
private int $personVisible = self::FIELD_REQUIRED;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
private string $privateCommentLabel = '';
|
private string $privateCommentLabel = '';
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
|
/**
|
||||||
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||||
|
*/
|
||||||
private int $privateCommentVisible = self::FIELD_OPTIONAL;
|
private int $privateCommentVisible = self::FIELD_OPTIONAL;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
private string $reasonsLabel = '';
|
private string $reasonsLabel = '';
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
|
/**
|
||||||
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||||
|
*/
|
||||||
private int $reasonsVisible = self::FIELD_OPTIONAL;
|
private int $reasonsVisible = self::FIELD_OPTIONAL;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
private string $sentReceivedLabel = '';
|
private string $sentReceivedLabel = '';
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
|
/**
|
||||||
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||||
|
*/
|
||||||
private int $sentReceivedVisible = self::FIELD_OPTIONAL;
|
private int $sentReceivedVisible = self::FIELD_OPTIONAL;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
private string $socialActionsLabel = '';
|
private string $socialActionsLabel = '';
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
|
/**
|
||||||
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||||
|
*/
|
||||||
private int $socialActionsVisible = self::FIELD_INVISIBLE;
|
private int $socialActionsVisible = self::FIELD_INVISIBLE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*
|
||||||
* @deprecated not in use
|
* @deprecated not in use
|
||||||
*/
|
*/
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
|
||||||
private string $socialDataLabel = '';
|
private string $socialDataLabel = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||||
|
*
|
||||||
* @deprecated not in use
|
* @deprecated not in use
|
||||||
*/
|
*/
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
|
|
||||||
private int $socialDataVisible = self::FIELD_INVISIBLE;
|
private int $socialDataVisible = self::FIELD_INVISIBLE;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
private string $socialIssuesLabel = '';
|
private string $socialIssuesLabel = '';
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
|
/**
|
||||||
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||||
|
*/
|
||||||
private int $socialIssuesVisible = self::FIELD_INVISIBLE;
|
private int $socialIssuesVisible = self::FIELD_INVISIBLE;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
private string $thirdPartiesLabel = '';
|
private string $thirdPartiesLabel = '';
|
||||||
|
|
||||||
#[Groups(['read'])]
|
/**
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||||
|
*
|
||||||
|
* @Groups({"read"})
|
||||||
|
*/
|
||||||
private int $thirdPartiesVisible = self::FIELD_INVISIBLE;
|
private int $thirdPartiesVisible = self::FIELD_INVISIBLE;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
private string $travelTimeLabel = '';
|
private string $travelTimeLabel = '';
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
|
/**
|
||||||
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||||
|
*/
|
||||||
private int $travelTimeVisible = self::FIELD_OPTIONAL;
|
private int $travelTimeVisible = self::FIELD_OPTIONAL;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
private string $userLabel = '';
|
private string $userLabel = '';
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, nullable: false, options: ['default' => ''])]
|
/**
|
||||||
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
private string $usersLabel = '';
|
private string $usersLabel = '';
|
||||||
|
|
||||||
#[Groups(['read'])]
|
/**
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 1])]
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||||
|
*
|
||||||
|
* @Groups({"read"})
|
||||||
|
*/
|
||||||
private int $usersVisible = self::FIELD_OPTIONAL;
|
private int $usersVisible = self::FIELD_OPTIONAL;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::SMALLINT, nullable: false, options: ['default' => 2])]
|
/**
|
||||||
|
* @ORM\Column(type="smallint", nullable=false, options={"default": 2})
|
||||||
|
*/
|
||||||
private int $userVisible = self::FIELD_REQUIRED;
|
private int $userVisible = self::FIELD_REQUIRED;
|
||||||
|
|
||||||
#[Assert\Callback]
|
/**
|
||||||
|
* @Assert\Callback
|
||||||
|
*/
|
||||||
public function checkSocialActionsVisibility(ExecutionContextInterface $context, mixed $payload)
|
public function checkSocialActionsVisibility(ExecutionContextInterface $context, mixed $payload)
|
||||||
{
|
{
|
||||||
if ($this->socialIssuesVisible !== $this->socialActionsVisible) {
|
if ($this->socialIssuesVisible !== $this->socialActionsVisible) {
|
||||||
// if social issues are invisible then social actions cannot be optional or required + if social issues are optional then social actions shouldn't be required
|
if (!(2 === $this->socialIssuesVisible && 1 === $this->socialActionsVisible)) {
|
||||||
if (
|
|
||||||
(0 === $this->socialIssuesVisible && (1 === $this->socialActionsVisible || 2 === $this->socialActionsVisible))
|
|
||||||
|| (1 === $this->socialIssuesVisible && 2 === $this->socialActionsVisible)
|
|
||||||
) {
|
|
||||||
$context
|
$context
|
||||||
->buildViolation('The socialActionsVisible value is not compatible with the socialIssuesVisible value')
|
->buildViolation('The socialActionsVisible value is not compatible with the socialIssuesVisible value')
|
||||||
->atPath('socialActionsVisible')
|
->atPath('socialActionsVisible')
|
||||||
|
@@ -13,23 +13,37 @@ namespace Chill\ActivityBundle\Entity;
|
|||||||
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
#[ORM\Entity]
|
/**
|
||||||
#[ORM\HasLifecycleCallbacks]
|
* @ORM\Entity
|
||||||
#[ORM\Table(name: 'activitytypecategory')]
|
*
|
||||||
|
* @ORM\Table(name="activitytypecategory")
|
||||||
|
*
|
||||||
|
* @ORM\HasLifecycleCallbacks
|
||||||
|
*/
|
||||||
class ActivityTypeCategory
|
class ActivityTypeCategory
|
||||||
{
|
{
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
/**
|
||||||
|
* @ORM\Column(type="boolean")
|
||||||
|
*/
|
||||||
private bool $active = true;
|
private bool $active = true;
|
||||||
|
|
||||||
#[ORM\Id]
|
/**
|
||||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
* @ORM\Id
|
||||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
*
|
||||||
|
* @ORM\Column(name="id", type="integer")
|
||||||
|
*
|
||||||
|
* @ORM\GeneratedValue(strategy="AUTO")
|
||||||
|
*/
|
||||||
private ?int $id = null;
|
private ?int $id = null;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
/**
|
||||||
|
* @ORM\Column(type="json")
|
||||||
|
*/
|
||||||
private array $name = [];
|
private array $name = [];
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, options: ['default' => '0.0'])]
|
/**
|
||||||
|
* @ORM\Column(type="float", options={"default": "0.0"})
|
||||||
|
*/
|
||||||
private float $ordering = 0.0;
|
private float $ordering = 0.0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -56,7 +56,7 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function getLabels($key, array $values, mixed $data)
|
public function getLabels($key, array $values, mixed $data)
|
||||||
{
|
{
|
||||||
return function (int|string|null $value): string {
|
return function (null|int|string $value): string {
|
||||||
if ('_header' === $value) {
|
if ('_header' === $value) {
|
||||||
return 'export.aggregator.acp.by_activity_type.activity_type';
|
return 'export.aggregator.acp.by_activity_type.activity_type';
|
||||||
}
|
}
|
||||||
|
@@ -31,7 +31,7 @@ final readonly class ActivityPresenceAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function getLabels($key, array $values, mixed $data)
|
public function getLabels($key, array $values, mixed $data)
|
||||||
{
|
{
|
||||||
return function (int|string|null $value): string {
|
return function (null|int|string $value): string {
|
||||||
if ('_header' === $value) {
|
if ('_header' === $value) {
|
||||||
return 'export.aggregator.activity.by_activity_presence.header';
|
return 'export.aggregator.activity.by_activity_presence.header';
|
||||||
}
|
}
|
||||||
|
@@ -56,7 +56,7 @@ class ActivityTypeAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function getLabels($key, array $values, $data): \Closure
|
public function getLabels($key, array $values, $data): \Closure
|
||||||
{
|
{
|
||||||
return function (int|string|null $value): string {
|
return function (null|int|string $value): string {
|
||||||
if ('_header' === $value) {
|
if ('_header' === $value) {
|
||||||
return 'Activity type';
|
return 'Activity type';
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,7 @@ declare(strict_types=1);
|
|||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Aggregator;
|
namespace Chill\ActivityBundle\Export\Aggregator\PersonAggregators;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
use Chill\ActivityBundle\Repository\ActivityReasonCategoryRepository;
|
use Chill\ActivityBundle\Repository\ActivityReasonCategoryRepository;
|
||||||
@@ -25,11 +25,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
|||||||
|
|
||||||
class ActivityReasonAggregator implements AggregatorInterface, ExportElementValidatedInterface
|
class ActivityReasonAggregator implements AggregatorInterface, ExportElementValidatedInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(protected ActivityReasonCategoryRepository $activityReasonCategoryRepository, protected ActivityReasonRepository $activityReasonRepository, protected TranslatableStringHelper $translatableStringHelper) {}
|
||||||
protected ActivityReasonCategoryRepository $activityReasonCategoryRepository,
|
|
||||||
protected ActivityReasonRepository $activityReasonRepository,
|
|
||||||
protected TranslatableStringHelper $translatableStringHelper
|
|
||||||
) {}
|
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
{
|
{
|
||||||
@@ -53,7 +49,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
|||||||
|
|
||||||
// make a jointure only if needed
|
// make a jointure only if needed
|
||||||
if (!\in_array('actreasons', $qb->getAllAliases(), true)) {
|
if (!\in_array('actreasons', $qb->getAllAliases(), true)) {
|
||||||
$qb->leftJoin('activity.reasons', 'actreasons');
|
$qb->innerJoin('activity.reasons', 'actreasons');
|
||||||
}
|
}
|
||||||
|
|
||||||
// join category if necessary
|
// join category if necessary
|
||||||
@@ -64,12 +60,19 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$qb->addGroupBy($alias);
|
// add the "group by" part
|
||||||
|
$groupBy = $qb->getDQLPart('groupBy');
|
||||||
|
|
||||||
|
if (\count($groupBy) > 0) {
|
||||||
|
$qb->addGroupBy($alias);
|
||||||
|
} else {
|
||||||
|
$qb->groupBy($alias);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
{
|
{
|
||||||
return Declarations::ACTIVITY;
|
return Declarations::ACTIVITY_PERSON;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
@@ -91,9 +94,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
|||||||
|
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [];
|
||||||
'level' => 'reasons',
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
@@ -1,147 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view
|
|
||||||
* the LICENSE file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Export\LinkedToACP;
|
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
|
||||||
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
|
||||||
use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|
||||||
use Chill\MainBundle\Export\ExportInterface;
|
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
|
|
||||||
use Chill\PersonBundle\Entity\Household\HouseholdMember;
|
|
||||||
use Chill\PersonBundle\Entity\Person\PersonCenterHistory;
|
|
||||||
use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
|
||||||
use Doctrine\ORM\EntityRepository;
|
|
||||||
use Doctrine\ORM\Query;
|
|
||||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
|
||||||
|
|
||||||
final readonly class CountHouseholdOnActivity implements ExportInterface, GroupedExportInterface
|
|
||||||
{
|
|
||||||
private EntityRepository $repository;
|
|
||||||
|
|
||||||
private bool $filterStatsByCenters;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
EntityManagerInterface $em,
|
|
||||||
ParameterBagInterface $parameterBag,
|
|
||||||
) {
|
|
||||||
$this->repository = $em->getRepository(Activity::class);
|
|
||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder) {}
|
|
||||||
|
|
||||||
public function getFormDefaultData(): array
|
|
||||||
{
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getAllowedFormattersTypes(): array
|
|
||||||
{
|
|
||||||
return [FormatterInterface::TYPE_TABULAR];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return 'export.export.count_household_on_activity.description';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getGroup(): string
|
|
||||||
{
|
|
||||||
return 'Exports of activities linked to an accompanying period';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getLabels($key, array $values, $data)
|
|
||||||
{
|
|
||||||
if ('export_count_activity' !== $key) {
|
|
||||||
throw new \LogicException("the key {$key} is not used by this export");
|
|
||||||
}
|
|
||||||
|
|
||||||
return static fn ($value) => '_header' === $value ? 'export.export.count_household_on_activity.header' : $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getQueryKeys($data): array
|
|
||||||
{
|
|
||||||
return ['export_count_activity'];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getResult($query, $data)
|
|
||||||
{
|
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTitle(): string
|
|
||||||
{
|
|
||||||
return 'export.export.count_household_on_activity.title';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getType(): string
|
|
||||||
{
|
|
||||||
return Declarations::ACTIVITY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
|
||||||
{
|
|
||||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
|
||||||
|
|
||||||
$qb = $this->repository
|
|
||||||
->createQueryBuilder('activity')
|
|
||||||
->join('activity.persons', 'person')
|
|
||||||
->join('activity.accompanyingPeriod', 'acp')
|
|
||||||
->join(
|
|
||||||
HouseholdMember::class,
|
|
||||||
'householdmember',
|
|
||||||
Query\Expr\Join::WITH,
|
|
||||||
'person.id = IDENTITY(householdmember.person) AND householdmember.startDate <= activity.date AND (householdmember.endDate IS NULL OR householdmember.endDate > activity.date)'
|
|
||||||
)
|
|
||||||
->join('householdmember.household', 'household');
|
|
||||||
|
|
||||||
if ($this->filterStatsByCenters) {
|
|
||||||
$qb
|
|
||||||
->andWhere(
|
|
||||||
$qb->expr()->exists(
|
|
||||||
'SELECT 1 FROM '.AccompanyingPeriodParticipation::class.' acl_count_part
|
|
||||||
JOIN '.PersonCenterHistory::class.' acl_count_person_history WITH IDENTITY(acl_count_person_history.person) = IDENTITY(acl_count_part.person)
|
|
||||||
WHERE acl_count_part.accompanyingPeriod = acp.id AND acl_count_person_history.center IN (:authorized_centers)
|
|
||||||
'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
->setParameter('authorized_centers', $centers);
|
|
||||||
}
|
|
||||||
|
|
||||||
AccompanyingCourseExportHelper::addClosingMotiveExclusionClause($qb);
|
|
||||||
|
|
||||||
$qb->select('COUNT(DISTINCT household.id) as export_count_activity');
|
|
||||||
|
|
||||||
return $qb;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function requiredRole(): string
|
|
||||||
{
|
|
||||||
return ActivityStatsVoter::STATS;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function supportsModifiers(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Declarations::ACTIVITY,
|
|
||||||
Declarations::ACTIVITY_ACP,
|
|
||||||
PersonDeclarations::ACP_TYPE,
|
|
||||||
PersonDeclarations::PERSON_TYPE,
|
|
||||||
PersonDeclarations::HOUSEHOLD_TYPE,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
@@ -20,18 +20,23 @@ use Chill\MainBundle\Export\AccompanyingCourseExportHelper;
|
|||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
use Chill\MainBundle\Export\Helper\TranslatableStringExportLabelHelper;
|
use Chill\MainBundle\Export\Helper\TranslatableStringExportLabelHelper;
|
||||||
use Chill\MainBundle\Export\ListInterface;
|
use Chill\MainBundle\Export\ListInterface;
|
||||||
use Chill\PersonBundle\Export\Helper\FilterListAccompanyingPeriodHelperInterface;
|
use Chill\PersonBundle\Entity\Person\PersonCenterHistory;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
final readonly class ListActivity implements ListInterface, GroupedExportInterface
|
class ListActivity implements ListInterface, GroupedExportInterface
|
||||||
{
|
{
|
||||||
|
private readonly bool $filterStatsByCenters;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ListActivityHelper $helper,
|
private readonly ListActivityHelper $helper,
|
||||||
private EntityManagerInterface $entityManager,
|
private readonly EntityManagerInterface $entityManager,
|
||||||
private TranslatableStringExportLabelHelper $translatableStringExportLabelHelper,
|
private readonly TranslatableStringExportLabelHelper $translatableStringExportLabelHelper,
|
||||||
private FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper,
|
ParameterBagInterface $parameterBag,
|
||||||
) {}
|
) {
|
||||||
|
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
||||||
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
@@ -114,7 +119,19 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa
|
|||||||
->leftJoin('acppart.person', 'person')
|
->leftJoin('acppart.person', 'person')
|
||||||
->andWhere('acppart.startDate != acppart.endDate OR acppart.endDate IS NULL');
|
->andWhere('acppart.startDate != acppart.endDate OR acppart.endDate IS NULL');
|
||||||
|
|
||||||
$this->filterListAccompanyingPeriodHelper->addFilterAccompanyingPeriods($qb, $requiredModifiers, $acl, $data);
|
if ($this->filterStatsByCenters) {
|
||||||
|
$qb
|
||||||
|
->andWhere(
|
||||||
|
$qb->expr()->exists(
|
||||||
|
'SELECT 1
|
||||||
|
FROM '.PersonCenterHistory::class.' acl_count_person_history
|
||||||
|
WHERE acl_count_person_history.person = person
|
||||||
|
AND acl_count_person_history.center IN (:authorized_centers)
|
||||||
|
'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
->setParameter('authorized_centers', $centers);
|
||||||
|
}
|
||||||
|
|
||||||
$qb
|
$qb
|
||||||
// some grouping are necessary
|
// some grouping are necessary
|
||||||
|
@@ -1,138 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view
|
|
||||||
* the LICENSE file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Export\LinkedToPerson;
|
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
|
||||||
use Chill\ActivityBundle\Repository\ActivityRepository;
|
|
||||||
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
|
||||||
use Chill\MainBundle\Export\ExportInterface;
|
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
|
||||||
use Chill\PersonBundle\Entity\Household\HouseholdMember;
|
|
||||||
use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
|
|
||||||
use Doctrine\ORM\Query;
|
|
||||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
|
||||||
|
|
||||||
final readonly class CountHouseholdOnActivity implements ExportInterface, GroupedExportInterface
|
|
||||||
{
|
|
||||||
private bool $filterStatsByCenters;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
private ActivityRepository $activityRepository,
|
|
||||||
ParameterBagInterface $parameterBag,
|
|
||||||
) {
|
|
||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder) {}
|
|
||||||
|
|
||||||
public function getFormDefaultData(): array
|
|
||||||
{
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getAllowedFormattersTypes()
|
|
||||||
{
|
|
||||||
return [FormatterInterface::TYPE_TABULAR];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDescription()
|
|
||||||
{
|
|
||||||
return 'export.export.count_household_on_activity_person.description';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getGroup(): string
|
|
||||||
{
|
|
||||||
return 'Exports of activities linked to a person';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getLabels($key, array $values, $data)
|
|
||||||
{
|
|
||||||
if ('export_count_activity' !== $key) {
|
|
||||||
throw new \LogicException("the key {$key} is not used by this export");
|
|
||||||
}
|
|
||||||
|
|
||||||
return static fn ($value) => '_header' === $value ? 'export.export.count_household_on_activity_person.header' : $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getQueryKeys($data)
|
|
||||||
{
|
|
||||||
return ['export_count_activity'];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getResult($query, $data)
|
|
||||||
{
|
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTitle()
|
|
||||||
{
|
|
||||||
return 'export.export.count_household_on_activity_person.title';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getType(): string
|
|
||||||
{
|
|
||||||
return Declarations::ACTIVITY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
|
||||||
{
|
|
||||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
|
||||||
|
|
||||||
$qb = $this->activityRepository
|
|
||||||
->createQueryBuilder('activity')
|
|
||||||
->join('activity.person', 'person')
|
|
||||||
->join(
|
|
||||||
HouseholdMember::class,
|
|
||||||
'householdmember',
|
|
||||||
Query\Expr\Join::WITH,
|
|
||||||
'person = householdmember.person AND householdmember.startDate <= activity.date AND (householdmember.endDate IS NULL OR householdmember.endDate > activity.date)'
|
|
||||||
)
|
|
||||||
->join('householdmember.household', 'household');
|
|
||||||
|
|
||||||
$qb->select('COUNT(DISTINCT household.id) as export_count_activity');
|
|
||||||
|
|
||||||
if ($this->filterStatsByCenters) {
|
|
||||||
$qb
|
|
||||||
->join('person.centerHistory', 'centerHistory')
|
|
||||||
->where(
|
|
||||||
$qb->expr()->andX(
|
|
||||||
$qb->expr()->lte('centerHistory.startDate', 'activity.date'),
|
|
||||||
$qb->expr()->orX(
|
|
||||||
$qb->expr()->isNull('centerHistory.endDate'),
|
|
||||||
$qb->expr()->gt('centerHistory.endDate', 'activity.date')
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
->andWhere($qb->expr()->in('centerHistory.center', ':centers'))
|
|
||||||
->setParameter('centers', $centers);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $qb;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function requiredRole(): string
|
|
||||||
{
|
|
||||||
return ActivityStatsVoter::STATS;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function supportsModifiers()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Declarations::ACTIVITY,
|
|
||||||
Declarations::ACTIVITY_PERSON,
|
|
||||||
PersonDeclarations::PERSON_TYPE,
|
|
||||||
PersonDeclarations::HOUSEHOLD_TYPE,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
@@ -15,22 +15,17 @@ use Chill\ActivityBundle\Entity\Activity;
|
|||||||
use Chill\ActivityBundle\Entity\ActivityType;
|
use Chill\ActivityBundle\Entity\ActivityType;
|
||||||
use Chill\ActivityBundle\Repository\ActivityTypeRepositoryInterface;
|
use Chill\ActivityBundle\Repository\ActivityTypeRepositoryInterface;
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Chill\MainBundle\Form\Type\PickRollingDateType;
|
|
||||||
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
|
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
use Chill\PersonBundle\Export\Declarations;
|
use Chill\PersonBundle\Export\Declarations;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
final readonly class ActivityTypeFilter implements FilterInterface
|
class ActivityTypeFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private const BASE_EXISTS = 'SELECT 1 FROM '.Activity::class.' act_type_filter_activity WHERE act_type_filter_activity.accompanyingPeriod = acp';
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ActivityTypeRepositoryInterface $activityTypeRepository,
|
private readonly ActivityTypeRepositoryInterface $activityTypeRepository,
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper,
|
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
||||||
private RollingDateConverterInterface $rollingDateConverter,
|
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
@@ -40,26 +35,13 @@ final readonly class ActivityTypeFilter implements FilterInterface
|
|||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$exists = self::BASE_EXISTS;
|
$qb->andWhere(
|
||||||
|
$qb->expr()->exists(
|
||||||
if (count($data['accepted_activitytypes']) > 0) {
|
'SELECT 1 FROM '.Activity::class.' act_type_filter_activity
|
||||||
$exists .= ' AND act_type_filter_activity.activityType IN (:act_type_filter_activity_types)';
|
WHERE act_type_filter_activity.activityType IN (:act_type_filter_activity_types) AND act_type_filter_activity.accompanyingPeriod = acp'
|
||||||
$qb->setParameter('act_type_filter_activity_types', $data['accepted_activitytypes']);
|
)
|
||||||
}
|
);
|
||||||
|
$qb->setParameter('act_type_filter_activity_types', $data['accepted_activitytypes']);
|
||||||
if (null !== $data['date_after']) {
|
|
||||||
$exists .= ' AND act_type_filter_activity.date >= :act_type_filter_activity_date_after';
|
|
||||||
$qb->setParameter('act_type_filter_activity_date_after', $this->rollingDateConverter->convert($data['date_after']));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null !== $data['date_before']) {
|
|
||||||
$exists .= ' AND act_type_filter_activity.date >= :act_type_filter_activity_date_before';
|
|
||||||
$qb->setParameter('act_type_filter_activity_date_before', $this->rollingDateConverter->convert($data['date_before']));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (self::BASE_EXISTS !== $exists) {
|
|
||||||
$qb->andWhere($qb->expr()->exists($exists));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn()
|
public function applyOn()
|
||||||
@@ -78,27 +60,11 @@ final readonly class ActivityTypeFilter implements FilterInterface
|
|||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$builder->add('date_after', PickRollingDateType::class, [
|
|
||||||
'label' => 'export.filter.activity.acp_by_activity_type.activity after',
|
|
||||||
'help' => 'export.filter.activity.acp_by_activity_type.activity after help',
|
|
||||||
'required' => false,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$builder->add('date_before', PickRollingDateType::class, [
|
|
||||||
'label' => 'export.filter.activity.acp_by_activity_type.activity before',
|
|
||||||
'help' => 'export.filter.activity.acp_by_activity_type.activity before help',
|
|
||||||
'required' => false,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFormDefaultData(): array
|
public function getFormDefaultData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [];
|
||||||
'accepted_activitytypes' => [],
|
|
||||||
'date_after' => null,
|
|
||||||
'date_before' => null,
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
@@ -109,12 +75,8 @@ final readonly class ActivityTypeFilter implements FilterInterface
|
|||||||
$types[] = $this->translatableStringHelper->localize($aty->getName());
|
$types[] = $this->translatableStringHelper->localize($aty->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
return ['export.filter.activity.acp_by_activity_type.acp_containing_at_least_one_activitytypes', [
|
return ['export.filter.activity.acp_by_activity_type.acp_containing_at_least_one_%activitytypes%', [
|
||||||
'activitytypes' => implode(', ', $types),
|
'%activitytypes%' => implode(', ', $types),
|
||||||
'has_date_after' => null !== $data['date_after'] ? 1 : 0,
|
|
||||||
'date_after' => $this->rollingDateConverter->convert($data['date_after']),
|
|
||||||
'has_date_before' => null !== $data['date_before'] ? 1 : 0,
|
|
||||||
'date_before' => $this->rollingDateConverter->convert($data['date_before']),
|
|
||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -79,7 +79,7 @@ final readonly class CreatorJobFilter implements FilterInterface
|
|||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('jobs', EntityType::class, [
|
->add('jobs', EntityType::class, [
|
||||||
'choices' => $this->userJobRepository->findAllActive(),
|
'choices' => $this->userJobRepository->findAllOrderedByName(),
|
||||||
'class' => UserJob::class,
|
'class' => UserJob::class,
|
||||||
'choice_label' => fn (UserJob $s) => $this->translatableStringHelper->localize(
|
'choice_label' => fn (UserJob $s) => $this->translatableStringHelper->localize(
|
||||||
$s->getLabel()
|
$s->getLabel()
|
||||||
|
@@ -15,7 +15,6 @@ use Chill\ActivityBundle\Export\Declarations;
|
|||||||
use Chill\MainBundle\Entity\Scope;
|
use Chill\MainBundle\Entity\Scope;
|
||||||
use Chill\MainBundle\Entity\User\UserScopeHistory;
|
use Chill\MainBundle\Entity\User\UserScopeHistory;
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Chill\MainBundle\Repository\ScopeRepositoryInterface;
|
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||||
use Doctrine\ORM\Query\Expr\Join;
|
use Doctrine\ORM\Query\Expr\Join;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
@@ -27,8 +26,7 @@ class CreatorScopeFilter implements FilterInterface
|
|||||||
private const PREFIX = 'acp_act_filter_creator_scope';
|
private const PREFIX = 'acp_act_filter_creator_scope';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly TranslatableStringHelper $translatableStringHelper,
|
private readonly TranslatableStringHelper $translatableStringHelper
|
||||||
private readonly ScopeRepositoryInterface $scopeRepository,
|
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
@@ -77,7 +75,6 @@ class CreatorScopeFilter implements FilterInterface
|
|||||||
$builder
|
$builder
|
||||||
->add('scopes', EntityType::class, [
|
->add('scopes', EntityType::class, [
|
||||||
'class' => Scope::class,
|
'class' => Scope::class,
|
||||||
'choices' => $this->scopeRepository->findAllActive(),
|
|
||||||
'choice_label' => fn (Scope $s) => $this->translatableStringHelper->localize(
|
'choice_label' => fn (Scope $s) => $this->translatableStringHelper->localize(
|
||||||
$s->getName()
|
$s->getName()
|
||||||
),
|
),
|
||||||
|
@@ -16,7 +16,6 @@ use Chill\ActivityBundle\Export\Declarations;
|
|||||||
use Chill\MainBundle\Entity\User\UserJobHistory;
|
use Chill\MainBundle\Entity\User\UserJobHistory;
|
||||||
use Chill\MainBundle\Entity\UserJob;
|
use Chill\MainBundle\Entity\UserJob;
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Chill\MainBundle\Repository\UserJobRepositoryInterface;
|
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
@@ -28,8 +27,7 @@ class UsersJobFilter implements FilterInterface
|
|||||||
private const PREFIX = 'act_filter_user_job';
|
private const PREFIX = 'act_filter_user_job';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
||||||
private readonly UserJobRepositoryInterface $userJobRepository
|
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
@@ -70,7 +68,6 @@ class UsersJobFilter implements FilterInterface
|
|||||||
$builder
|
$builder
|
||||||
->add('jobs', EntityType::class, [
|
->add('jobs', EntityType::class, [
|
||||||
'class' => UserJob::class,
|
'class' => UserJob::class,
|
||||||
'choices' => $this->userJobRepository->findAllActive(),
|
|
||||||
'choice_label' => fn (UserJob $j) => $this->translatableStringHelper->localize($j->getLabel()),
|
'choice_label' => fn (UserJob $j) => $this->translatableStringHelper->localize($j->getLabel()),
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
|
@@ -95,7 +95,7 @@ class ActivityType extends AbstractType
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var AccompanyingPeriod|null $accompanyingPeriod */
|
/** @var \Chill\PersonBundle\Entity\AccompanyingPeriod|null $accompanyingPeriod */
|
||||||
$accompanyingPeriod = null;
|
$accompanyingPeriod = null;
|
||||||
|
|
||||||
if ($options['accompanyingPeriod'] instanceof AccompanyingPeriod) {
|
if ($options['accompanyingPeriod'] instanceof AccompanyingPeriod) {
|
||||||
@@ -183,7 +183,6 @@ class ActivityType extends AbstractType
|
|||||||
$builder->add('attendee', EntityType::class, [
|
$builder->add('attendee', EntityType::class, [
|
||||||
'label' => $activityType->getLabel('attendee'),
|
'label' => $activityType->getLabel('attendee'),
|
||||||
'required' => $activityType->isRequired('attendee'),
|
'required' => $activityType->isRequired('attendee'),
|
||||||
'placeholder' => false,
|
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'class' => ActivityPresence::class,
|
'class' => ActivityPresence::class,
|
||||||
'choice_label' => fn (ActivityPresence $activityPresence) => $this->translatableStringHelper->localize($activityPresence->getName()),
|
'choice_label' => fn (ActivityPresence $activityPresence) => $this->translatableStringHelper->localize($activityPresence->getName()),
|
||||||
@@ -405,7 +404,7 @@ class ActivityType extends AbstractType
|
|||||||
->setAllowedTypes('center', ['null', Center::class, 'array'])
|
->setAllowedTypes('center', ['null', Center::class, 'array'])
|
||||||
->setAllowedTypes('role', ['string'])
|
->setAllowedTypes('role', ['string'])
|
||||||
->setAllowedTypes('activityType', \Chill\ActivityBundle\Entity\ActivityType::class)
|
->setAllowedTypes('activityType', \Chill\ActivityBundle\Entity\ActivityType::class)
|
||||||
->setAllowedTypes('accompanyingPeriod', [AccompanyingPeriod::class, 'null']);
|
->setAllowedTypes('accompanyingPeriod', [\Chill\PersonBundle\Entity\AccompanyingPeriod::class, 'null']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockPrefix(): string
|
public function getBlockPrefix(): string
|
||||||
|
@@ -27,7 +27,7 @@ final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
{
|
{
|
||||||
/** @var Person $person */
|
/** @var \Chill\PersonBundle\Entity\Person $person */
|
||||||
$person = $parameters['person'];
|
$person = $parameters['person'];
|
||||||
|
|
||||||
if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) {
|
if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) {
|
||||||
|
@@ -242,8 +242,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos
|
|||||||
thirdparties.thirdpartyids,
|
thirdparties.thirdpartyids,
|
||||||
persons.personids,
|
persons.personids,
|
||||||
actions.socialactionids,
|
actions.socialactionids,
|
||||||
issues.socialissueids,
|
issues.socialissueids
|
||||||
a.user_id
|
|
||||||
|
|
||||||
FROM activity a
|
FROM activity a
|
||||||
LEFT JOIN chill_main_location location ON a.location_id = location.id
|
LEFT JOIN chill_main_location location ON a.location_id = location.id
|
||||||
@@ -283,7 +282,6 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos
|
|||||||
->addJoinedEntityResult(ActivityPresence::class, 'activityPresence', 'a', 'attendee')
|
->addJoinedEntityResult(ActivityPresence::class, 'activityPresence', 'a', 'attendee')
|
||||||
->addFieldResult('activityPresence', 'presence_id', 'id')
|
->addFieldResult('activityPresence', 'presence_id', 'id')
|
||||||
->addFieldResult('activityPresence', 'presence_name', 'name')
|
->addFieldResult('activityPresence', 'presence_name', 'name')
|
||||||
->addScalarResult('user_id', 'userId', Types::INTEGER)
|
|
||||||
|
|
||||||
// results which cannot be mapped into entity
|
// results which cannot be mapped into entity
|
||||||
->addScalarResult('comment_comment', 'comment', Types::TEXT)
|
->addScalarResult('comment_comment', 'comment', Types::TEXT)
|
||||||
|
@@ -35,14 +35,14 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum
|
|||||||
private Security $security
|
private Security $security
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface
|
public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQueryInterface
|
||||||
{
|
{
|
||||||
$query = $this->buildBaseFetchQueryActivityDocumentLinkedToPersonFromPersonContext($person, $startDate, $endDate, $content);
|
$query = $this->buildBaseFetchQueryActivityDocumentLinkedToPersonFromPersonContext($person, $startDate, $endDate, $content);
|
||||||
|
|
||||||
return $this->addFetchQueryByPersonACL($query, $person);
|
return $this->addFetchQueryByPersonACL($query, $person);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildBaseFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery
|
public function buildBaseFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery
|
||||||
{
|
{
|
||||||
$storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class);
|
$storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class);
|
||||||
$activityMetadata = $this->em->getClassMetadata(Activity::class);
|
$activityMetadata = $this->em->getClassMetadata(Activity::class);
|
||||||
@@ -71,7 +71,7 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum
|
|||||||
return $this->addWhereClauses($query, $startDate, $endDate, $content);
|
return $this->addWhereClauses($query, $startDate, $endDate, $content);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery
|
public function buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery
|
||||||
{
|
{
|
||||||
$storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class);
|
$storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class);
|
||||||
$activityMetadata = $this->em->getClassMetadata(Activity::class);
|
$activityMetadata = $this->em->getClassMetadata(Activity::class);
|
||||||
@@ -122,7 +122,7 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum
|
|||||||
return $this->addWhereClauses($query, $startDate, $endDate, $content);
|
return $this->addWhereClauses($query, $startDate, $endDate, $content);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function addWhereClauses(FetchQuery $query, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery
|
private function addWhereClauses(FetchQuery $query, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery
|
||||||
{
|
{
|
||||||
$storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class);
|
$storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class);
|
||||||
|
|
||||||
|
@@ -25,12 +25,12 @@ interface ActivityDocumentACLAwareRepositoryInterface
|
|||||||
*
|
*
|
||||||
* This method must check the rights to see a document: the user must be allowed to see the given activities
|
* This method must check the rights to see a document: the user must be allowed to see the given activities
|
||||||
*/
|
*/
|
||||||
public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface;
|
public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQueryInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a fetch query for querying document's activities for an activity in accompanying periods, but for a given person.
|
* Return a fetch query for querying document's activities for an activity in accompanying periods, but for a given person.
|
||||||
*
|
*
|
||||||
* This method must check the rights to see a document: the user must be allowed to see the given accompanying periods
|
* This method must check the rights to see a document: the user must be allowed to see the given accompanying periods
|
||||||
*/
|
*/
|
||||||
public function buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery;
|
public function buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery;
|
||||||
}
|
}
|
||||||
|
@@ -34,7 +34,7 @@ class ActivityPresenceRepository implements ActivityPresenceRepositoryInterface
|
|||||||
return $this->repository->findAll();
|
return $this->repository->findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
|
public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array
|
||||||
{
|
{
|
||||||
return $this->findBy($criteria, $orderBy, $limit, $offset);
|
return $this->findBy($criteria, $orderBy, $limit, $offset);
|
||||||
}
|
}
|
||||||
|
@@ -25,7 +25,7 @@ interface ActivityPresenceRepositoryInterface
|
|||||||
/**
|
/**
|
||||||
* @return array|ActivityPresence[]
|
* @return array|ActivityPresence[]
|
||||||
*/
|
*/
|
||||||
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array;
|
public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array;
|
||||||
|
|
||||||
public function findOneBy(array $criteria): ?ActivityPresence;
|
public function findOneBy(array $criteria): ?ActivityPresence;
|
||||||
|
|
||||||
|
@@ -48,7 +48,7 @@ final class ActivityTypeRepository implements ActivityTypeRepositoryInterface
|
|||||||
/**
|
/**
|
||||||
* @return array|ActivityType[]
|
* @return array|ActivityType[]
|
||||||
*/
|
*/
|
||||||
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
|
public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array
|
||||||
{
|
{
|
||||||
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
|
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
|
||||||
}
|
}
|
||||||
|
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\ActivityBundle\Service\DocGenerator;
|
namespace Chill\ActivityBundle\Service\DocGenerator;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityPresence;
|
use Chill\ActivityBundle\Entity\ActivityPresence;
|
||||||
use Chill\ActivityBundle\Entity\ActivityType;
|
use Chill\ActivityBundle\Entity\ActivityType;
|
||||||
use Chill\ActivityBundle\Repository\ActivityACLAwareRepositoryInterface;
|
use Chill\ActivityBundle\Repository\ActivityACLAwareRepositoryInterface;
|
||||||
@@ -112,7 +111,7 @@ class ListActivitiesByAccompanyingPeriodContext implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return list<Activity>
|
* @return list
|
||||||
*/
|
*/
|
||||||
private function filterActivitiesByUser(array $activities, User $user): array
|
private function filterActivitiesByUser(array $activities, User $user): array
|
||||||
{
|
{
|
||||||
@@ -120,22 +119,16 @@ class ListActivitiesByAccompanyingPeriodContext implements
|
|||||||
array_filter(
|
array_filter(
|
||||||
$activities,
|
$activities,
|
||||||
function ($activity) use ($user) {
|
function ($activity) use ($user) {
|
||||||
$u = $activity['user'];
|
|
||||||
|
|
||||||
if (null !== $u && $u['username'] === $user->getUserIdentifier()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$activityUsernames = array_map(static fn ($user) => $user['username'], $activity['users'] ?? []);
|
$activityUsernames = array_map(static fn ($user) => $user['username'], $activity['users'] ?? []);
|
||||||
|
|
||||||
return \in_array($user->getUserIdentifier(), $activityUsernames, true);
|
return \in_array($user->getUsername(), $activityUsernames, true);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return list<AccompanyingPeriod\AccompanyingPeriodWork>
|
* @return list
|
||||||
*/
|
*/
|
||||||
private function filterWorksByUser(array $works, User $user): array
|
private function filterWorksByUser(array $works, User $user): array
|
||||||
{
|
{
|
||||||
@@ -143,9 +136,9 @@ class ListActivitiesByAccompanyingPeriodContext implements
|
|||||||
array_filter(
|
array_filter(
|
||||||
$works,
|
$works,
|
||||||
function ($work) use ($user) {
|
function ($work) use ($user) {
|
||||||
$workUsernames = array_map(static fn (User $user) => $user['username'], $work['referrers'] ?? []);
|
$workUsernames = array_map(static fn ($user) => $user['username'], $work['referrers'] ?? []);
|
||||||
|
|
||||||
return \in_array($user->getUserIdentifier(), $workUsernames, true);
|
return \in_array($user->getUsername(), $workUsernames, true);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -222,15 +215,6 @@ class ListActivitiesByAccompanyingPeriodContext implements
|
|||||||
foreach ($activities as $row) {
|
foreach ($activities as $row) {
|
||||||
$activity = $row[0];
|
$activity = $row[0];
|
||||||
|
|
||||||
$user = match (null === $row['userId']) {
|
|
||||||
false => $this->userRepository->find($row['userId']),
|
|
||||||
true => null,
|
|
||||||
};
|
|
||||||
|
|
||||||
$activity['user'] = $this->normalizer->normalize($user, 'docgen', [
|
|
||||||
AbstractNormalizer::GROUPS => ['docgen:read'], 'docgen:expects' => User::class,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$activity['date'] = $this->normalizer->normalize($activity['date'], 'docgen', [
|
$activity['date'] = $this->normalizer->normalize($activity['date'], 'docgen', [
|
||||||
AbstractNormalizer::GROUPS => ['docgen:read'], 'docgen:expects' => \DateTime::class,
|
AbstractNormalizer::GROUPS => ['docgen:read'], 'docgen:expects' => \DateTime::class,
|
||||||
]);
|
]);
|
||||||
|
@@ -36,7 +36,7 @@ final readonly class AccompanyingPeriodActivityGenericDocProvider implements Gen
|
|||||||
private ActivityDocumentACLAwareRepositoryInterface $activityDocumentACLAwareRepository,
|
private ActivityDocumentACLAwareRepositoryInterface $activityDocumentACLAwareRepository,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
|
public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface
|
||||||
{
|
{
|
||||||
$storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class);
|
$storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class);
|
||||||
$activityMetadata = $this->em->getClassMetadata(Activity::class);
|
$activityMetadata = $this->em->getClassMetadata(Activity::class);
|
||||||
@@ -99,7 +99,7 @@ final readonly class AccompanyingPeriodActivityGenericDocProvider implements Gen
|
|||||||
return $this->security->isGranted(AccompanyingPeriodVoter::SEE, $person);
|
return $this->security->isGranted(AccompanyingPeriodVoter::SEE, $person);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
|
public function buildFetchQueryForPerson(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface
|
||||||
{
|
{
|
||||||
return $this->activityDocumentACLAwareRepository
|
return $this->activityDocumentACLAwareRepository
|
||||||
->buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext($person, $startDate, $endDate, $content);
|
->buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext($person, $startDate, $endDate, $content);
|
||||||
|
@@ -27,7 +27,7 @@ final readonly class PersonActivityGenericDocProvider implements GenericDocForPe
|
|||||||
private ActivityDocumentACLAwareRepositoryInterface $personActivityDocumentACLAwareRepository,
|
private ActivityDocumentACLAwareRepositoryInterface $personActivityDocumentACLAwareRepository,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
|
public function buildFetchQueryForPerson(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface
|
||||||
{
|
{
|
||||||
return $this->personActivityDocumentACLAwareRepository->buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(
|
return $this->personActivityDocumentACLAwareRepository->buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(
|
||||||
$person,
|
$person,
|
||||||
|
@@ -310,7 +310,7 @@ final class ActivityControllerTest extends WebTestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ActivityType
|
* @return \Chill\ActivityBundle\Entity\ActivityType
|
||||||
*/
|
*/
|
||||||
private function getRandomActivityType()
|
private function getRandomActivityType()
|
||||||
{
|
{
|
||||||
|
@@ -36,9 +36,9 @@ class ByActivityTypeAggregatorTest extends AbstractAggregatorTest
|
|||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$this->rollingDateConverter = self::getContainer()->get(RollingDateConverterInterface::class);
|
$this->rollingDateConverter = self::$container->get(RollingDateConverterInterface::class);
|
||||||
$this->activityTypeRepository = self::getContainer()->get(ActivityTypeRepositoryInterface::class);
|
$this->activityTypeRepository = self::$container->get(ActivityTypeRepositoryInterface::class);
|
||||||
$this->translatableStringHelper = self::getContainer()->get(TranslatableStringHelperInterface::class);
|
$this->translatableStringHelper = self::$container->get(TranslatableStringHelperInterface::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
||||||
@@ -50,7 +50,7 @@ class ByActivityTypeAggregatorTest extends AbstractAggregatorTest
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[
|
[
|
||||||
@@ -72,10 +72,11 @@ class ByActivityTypeAggregatorTest extends AbstractAggregatorTest
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getQueryBuilders(): iterable
|
public function getQueryBuilders()
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
|
||||||
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
|
@@ -29,7 +29,7 @@ final class BySocialActionAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->aggregator = self::getContainer()->get('chill.activity.export.bysocialaction_aggregator');
|
$this->aggregator = self::$container->get('chill.activity.export.bysocialaction_aggregator');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
||||||
@@ -37,17 +37,18 @@ final class BySocialActionAggregatorTest extends AbstractAggregatorTest
|
|||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[],
|
[],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getQueryBuilders(): iterable
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
|
||||||
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
|
@@ -29,7 +29,7 @@ final class BySocialIssueAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->aggregator = self::getContainer()->get('chill.activity.export.bysocialissue_aggregator');
|
$this->aggregator = self::$container->get('chill.activity.export.bysocialissue_aggregator');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
||||||
@@ -37,17 +37,18 @@ final class BySocialIssueAggregatorTest extends AbstractAggregatorTest
|
|||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[],
|
[],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getQueryBuilders(): iterable
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
|
||||||
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
|
@@ -31,8 +31,8 @@ class ActivityPresenceAggregatorTest extends AbstractAggregatorTest
|
|||||||
protected function setUp(): void
|
protected function setUp(): void
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$this->translatableStringHelper = self::getContainer()->get(TranslatableStringHelperInterface::class);
|
$this->translatableStringHelper = self::$container->get(TranslatableStringHelperInterface::class);
|
||||||
$this->activityPresenceRepository = self::getContainer()->get(ActivityPresenceRepositoryInterface::class);
|
$this->activityPresenceRepository = self::$container->get(ActivityPresenceRepositoryInterface::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
||||||
@@ -40,17 +40,18 @@ class ActivityPresenceAggregatorTest extends AbstractAggregatorTest
|
|||||||
return new ActivityPresenceAggregator($this->activityPresenceRepository, $this->translatableStringHelper);
|
return new ActivityPresenceAggregator($this->activityPresenceRepository, $this->translatableStringHelper);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[],
|
[],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getQueryBuilders(): iterable
|
public function getQueryBuilders()
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
|
||||||
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
|
@@ -34,14 +34,14 @@ final class ActivityTypeAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->aggregator = self::getContainer()->get(ActivityTypeAggregator::class);
|
$this->aggregator = self::$container->get(ActivityTypeAggregator::class);
|
||||||
|
|
||||||
$request = $this->prophesize()
|
$request = $this->prophesize()
|
||||||
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
||||||
|
|
||||||
$request->getLocale()->willReturn('fr');
|
$request->getLocale()->willReturn('fr');
|
||||||
|
|
||||||
self::getContainer()->get('request_stack')
|
self::$container->get('request_stack')
|
||||||
->push($request->reveal());
|
->push($request->reveal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,17 +50,18 @@ final class ActivityTypeAggregatorTest extends AbstractAggregatorTest
|
|||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[],
|
[],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getQueryBuilders(): iterable
|
public function getQueryBuilders()
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
|
||||||
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
|
@@ -34,14 +34,14 @@ final class ActivityUserAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->aggregator = self::getContainer()->get('chill.activity.export.user_aggregator');
|
$this->aggregator = self::$container->get('chill.activity.export.user_aggregator');
|
||||||
|
|
||||||
$request = $this->prophesize()
|
$request = $this->prophesize()
|
||||||
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
||||||
|
|
||||||
$request->getLocale()->willReturn('fr');
|
$request->getLocale()->willReturn('fr');
|
||||||
|
|
||||||
self::getContainer()->get('request_stack')
|
self::$container->get('request_stack')
|
||||||
->push($request->reveal());
|
->push($request->reveal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,17 +50,18 @@ final class ActivityUserAggregatorTest extends AbstractAggregatorTest
|
|||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[],
|
[],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getQueryBuilders(): iterable
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
|
||||||
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
|
@@ -29,7 +29,7 @@ final class ByThirdpartyAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->aggregator = self::getContainer()->get(ByThirdpartyAggregator::class);
|
$this->aggregator = self::$container->get(ByThirdpartyAggregator::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
||||||
@@ -37,17 +37,18 @@ final class ByThirdpartyAggregatorTest extends AbstractAggregatorTest
|
|||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[],
|
[],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getQueryBuilders(): iterable
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
|
||||||
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
|
@@ -29,7 +29,7 @@ final class ByUserAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->aggregator = self::getContainer()->get(ByCreatorAggregator::class);
|
$this->aggregator = self::$container->get(ByCreatorAggregator::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
||||||
@@ -37,17 +37,18 @@ final class ByUserAggregatorTest extends AbstractAggregatorTest
|
|||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[],
|
[],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getQueryBuilders(): iterable
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
|
||||||
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
|
@@ -29,7 +29,7 @@ final class CreatorJobAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->aggregator = self::getContainer()->get(CreatorJobAggregator::class);
|
$this->aggregator = self::$container->get(CreatorJobAggregator::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
||||||
@@ -37,17 +37,18 @@ final class CreatorJobAggregatorTest extends AbstractAggregatorTest
|
|||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[],
|
[],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getQueryBuilders(): iterable
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
|
||||||
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
|
@@ -29,7 +29,7 @@ final class CreatorScopeAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->aggregator = self::getContainer()->get(CreatorScopeAggregator::class);
|
$this->aggregator = self::$container->get(CreatorScopeAggregator::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
||||||
@@ -37,17 +37,18 @@ final class CreatorScopeAggregatorTest extends AbstractAggregatorTest
|
|||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[],
|
[],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getQueryBuilders(): iterable
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
|
||||||
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
|
@@ -29,7 +29,7 @@ final class DateAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->aggregator = self::getContainer()->get(DateAggregator::class);
|
$this->aggregator = self::$container->get(DateAggregator::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
||||||
@@ -37,7 +37,7 @@ final class DateAggregatorTest extends AbstractAggregatorTest
|
|||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[
|
[
|
||||||
@@ -52,10 +52,11 @@ final class DateAggregatorTest extends AbstractAggregatorTest
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getQueryBuilders(): iterable
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
|
||||||
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
|
@@ -29,7 +29,7 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->aggregator = self::getContainer()->get(LocationTypeAggregator::class);
|
$this->aggregator = self::$container->get(LocationTypeAggregator::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
||||||
@@ -37,17 +37,18 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest
|
|||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[],
|
[],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getQueryBuilders(): iterable
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
|
||||||
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
|
@@ -9,10 +9,10 @@ declare(strict_types=1);
|
|||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Tests\Export\Aggregator;
|
namespace Chill\ActivityBundle\Tests\Export\Aggregator\PersonAggregators;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Chill\ActivityBundle\Export\Aggregator\ActivityReasonAggregator;
|
use Chill\ActivityBundle\Export\Aggregator\PersonAggregators\ActivityReasonAggregator;
|
||||||
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Prophecy\PhpUnit\ProphecyTrait;
|
use Prophecy\PhpUnit\ProphecyTrait;
|
||||||
@@ -32,16 +32,15 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->aggregator = self::getContainer()->get(ActivityReasonAggregator::class);
|
$this->aggregator = self::$container->get(ActivityReasonAggregator::class);
|
||||||
/*
|
|
||||||
$request = $this->prophesize()
|
|
||||||
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
|
||||||
$this->aggregator = self::$container->get(ActivityReasonAggregator::class);
|
|
||||||
|
|
||||||
$request->getLocale()->willReturn('fr');
|
$request = $this->prophesize()
|
||||||
|
->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
||||||
|
|
||||||
self::getContainer()->get('request_stack')
|
$request->getLocale()->willReturn('fr');
|
||||||
->push($request->reveal());*/
|
|
||||||
|
self::$container->get('request_stack')
|
||||||
|
->push($request->reveal());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
||||||
@@ -49,7 +48,7 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
|
|||||||
return $this->aggregator;
|
return $this->aggregator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
['level' => 'reasons'],
|
['level' => 'reasons'],
|
||||||
@@ -57,20 +56,16 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getQueryBuilders(): iterable
|
public function getQueryBuilders(): array
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
|
||||||
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(activity.id)')
|
->select('count(activity.id)')
|
||||||
->from(Activity::class, 'activity')
|
->from(Activity::class, 'activity'),
|
||||||
->join('activity.person', 'person'),
|
|
||||||
$em->createQueryBuilder()
|
|
||||||
->select('count(activity.id)')
|
|
||||||
->from(Activity::class, 'activity')
|
|
||||||
->join('activity.accompanyingPeriod', 'accompanyingPeriod'),
|
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
->select('count(activity.id)')
|
->select('count(activity.id)')
|
||||||
->from(Activity::class, 'activity')
|
->from(Activity::class, 'activity')
|
@@ -29,7 +29,7 @@ class PersonAggregatorTest extends AbstractAggregatorTest
|
|||||||
protected function setUp(): void
|
protected function setUp(): void
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$this->labelPersonHelper = self::getContainer()->get(LabelPersonHelper::class);
|
$this->labelPersonHelper = self::$container->get(LabelPersonHelper::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
||||||
@@ -37,15 +37,16 @@ class PersonAggregatorTest extends AbstractAggregatorTest
|
|||||||
return new PersonAggregator($this->labelPersonHelper);
|
return new PersonAggregator($this->labelPersonHelper);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData()
|
||||||
{
|
{
|
||||||
return [[]];
|
return [[]];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getQueryBuilders(): iterable
|
public function getQueryBuilders()
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
|
||||||
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
|
@@ -30,7 +30,7 @@ class PersonsAggregatorTest extends AbstractAggregatorTest
|
|||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$this->labelPersonHelper = self::getContainer()->get(LabelPersonHelper::class);
|
$this->labelPersonHelper = self::$container->get(LabelPersonHelper::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAggregator()
|
public function getAggregator()
|
||||||
@@ -38,17 +38,18 @@ class PersonsAggregatorTest extends AbstractAggregatorTest
|
|||||||
return new PersonsAggregator($this->labelPersonHelper);
|
return new PersonsAggregator($this->labelPersonHelper);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[],
|
[],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getQueryBuilders(): iterable
|
public function getQueryBuilders()
|
||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
|
||||||
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
$em->createQueryBuilder()
|
$em->createQueryBuilder()
|
||||||
|
@@ -29,20 +29,20 @@ final class AvgActivityDurationTest extends AbstractExportTest
|
|||||||
|
|
||||||
public function getExport()
|
public function getExport()
|
||||||
{
|
{
|
||||||
$activityRepository = self::getContainer()->get(ActivityRepository::class);
|
$activityRepository = self::$container->get(ActivityRepository::class);
|
||||||
|
|
||||||
yield new AvgActivityDuration($activityRepository, $this->getParameters(true));
|
yield new AvgActivityDuration($activityRepository, $this->getParameters(true));
|
||||||
yield new AvgActivityDuration($activityRepository, $this->getParameters(false));
|
yield new AvgActivityDuration($activityRepository, $this->getParameters(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[],
|
[],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getModifiersCombination(): array
|
public function getModifiersCombination(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
['activity'],
|
['activity'],
|
||||||
|
@@ -29,20 +29,20 @@ final class AvgActivityVisitDurationTest extends AbstractExportTest
|
|||||||
|
|
||||||
public function getExport()
|
public function getExport()
|
||||||
{
|
{
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
yield new AvgActivityVisitDuration($em, $this->getParameters(true));
|
yield new AvgActivityVisitDuration($em, $this->getParameters(true));
|
||||||
yield new AvgActivityVisitDuration($em, $this->getParameters(false));
|
yield new AvgActivityVisitDuration($em, $this->getParameters(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[],
|
[],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getModifiersCombination(): array
|
public function getModifiersCombination(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
['activity'],
|
['activity'],
|
||||||
|
@@ -29,20 +29,20 @@ final class CountActivityTest extends AbstractExportTest
|
|||||||
|
|
||||||
public function getExport()
|
public function getExport()
|
||||||
{
|
{
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
yield new CountActivity($em, $this->getParameters(true));
|
yield new CountActivity($em, $this->getParameters(true));
|
||||||
yield new CountActivity($em, $this->getParameters(false));
|
yield new CountActivity($em, $this->getParameters(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[],
|
[],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getModifiersCombination(): array
|
public function getModifiersCombination(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
['activity'],
|
['activity'],
|
||||||
|
@@ -1,60 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view
|
|
||||||
* the LICENSE file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Tests\Export\Export\LinkedToACP;
|
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
|
||||||
use Chill\ActivityBundle\Export\Export\LinkedToACP\CountHouseholdOnActivity;
|
|
||||||
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
|
||||||
use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @internal
|
|
||||||
*
|
|
||||||
* @coversNothing
|
|
||||||
*/
|
|
||||||
class CountHouseholdOnActivityTest extends AbstractExportTest
|
|
||||||
{
|
|
||||||
private EntityManagerInterface $entityManager;
|
|
||||||
|
|
||||||
protected function setUp(): void
|
|
||||||
{
|
|
||||||
self::bootKernel();
|
|
||||||
$this->entityManager = self::getContainer()->get(EntityManagerInterface::class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getExport()
|
|
||||||
{
|
|
||||||
yield new CountHouseholdOnActivity($this->entityManager, $this->getParameters(true));
|
|
||||||
yield new CountHouseholdOnActivity($this->entityManager, $this->getParameters(false));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getFormData(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
[],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getModifiersCombination(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
[
|
|
||||||
Declarations::ACTIVITY,
|
|
||||||
Declarations::ACTIVITY_ACP,
|
|
||||||
PersonDeclarations::ACP_TYPE,
|
|
||||||
PersonDeclarations::PERSON_TYPE,
|
|
||||||
PersonDeclarations::HOUSEHOLD_TYPE,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
@@ -31,18 +31,18 @@ class CountPersonsOnActivityTest extends AbstractExportTest
|
|||||||
|
|
||||||
public function getExport()
|
public function getExport()
|
||||||
{
|
{
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
yield new CountPersonsOnActivity($em, $this->getParameters(true));
|
yield new CountPersonsOnActivity($em, $this->getParameters(true));
|
||||||
yield new CountPersonsOnActivity($em, $this->getParameters(false));
|
yield new CountPersonsOnActivity($em, $this->getParameters(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData()
|
||||||
{
|
{
|
||||||
return [[]];
|
return [[]];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getModifiersCombination(): array
|
public function getModifiersCombination()
|
||||||
{
|
{
|
||||||
return [[
|
return [[
|
||||||
Declarations::ACTIVITY,
|
Declarations::ACTIVITY,
|
||||||
|
@@ -29,20 +29,20 @@ final class SumActivityDurationTest extends AbstractExportTest
|
|||||||
|
|
||||||
public function getExport()
|
public function getExport()
|
||||||
{
|
{
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
yield new SumActivityDuration($em, $this->getParameters(true));
|
yield new SumActivityDuration($em, $this->getParameters(true));
|
||||||
yield new SumActivityDuration($em, $this->getParameters(false));
|
yield new SumActivityDuration($em, $this->getParameters(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[],
|
[],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getModifiersCombination(): array
|
public function getModifiersCombination(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
['activity'],
|
['activity'],
|
||||||
|
@@ -28,25 +28,25 @@ final class SumActivityVisitDurationTest extends AbstractExportTest
|
|||||||
{
|
{
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
|
|
||||||
$this->export = self::getContainer()->get('chill.activity.export.sum_activity_visit_duration_linked_to_acp');
|
$this->export = self::$container->get('chill.activity.export.sum_activity_visit_duration_linked_to_acp');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getExport()
|
public function getExport()
|
||||||
{
|
{
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
|
|
||||||
yield new SumActivityVisitDuration($em, $this->getParameters(true));
|
yield new SumActivityVisitDuration($em, $this->getParameters(true));
|
||||||
yield new SumActivityVisitDuration($em, $this->getParameters(false));
|
yield new SumActivityVisitDuration($em, $this->getParameters(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[],
|
[],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getModifiersCombination(): array
|
public function getModifiersCombination(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
['activity'],
|
['activity'],
|
||||||
|
@@ -29,20 +29,20 @@ final class CountActivityTest extends AbstractExportTest
|
|||||||
|
|
||||||
public function getExport()
|
public function getExport()
|
||||||
{
|
{
|
||||||
$activityRepository = self::getContainer()->get(ActivityRepository::class);
|
$activityRepository = self::$container->get(ActivityRepository::class);
|
||||||
|
|
||||||
yield new CountActivity($activityRepository, $this->getParameters(true));
|
yield new CountActivity($activityRepository, $this->getParameters(true));
|
||||||
yield new CountActivity($activityRepository, $this->getParameters(false));
|
yield new CountActivity($activityRepository, $this->getParameters(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[],
|
[],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getModifiersCombination(): array
|
public function getModifiersCombination(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
['activity'],
|
['activity'],
|
||||||
|
@@ -1,59 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view
|
|
||||||
* the LICENSE file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Tests\Export\Export\LinkedToPerson;
|
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
|
||||||
use Chill\ActivityBundle\Export\Export\LinkedToPerson\CountHouseholdOnActivity;
|
|
||||||
use Chill\ActivityBundle\Repository\ActivityRepository;
|
|
||||||
use Chill\MainBundle\Test\Export\AbstractExportTest;
|
|
||||||
use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @internal
|
|
||||||
*
|
|
||||||
* @coversNothing
|
|
||||||
*/
|
|
||||||
class CountHouseholdOnActivityTest extends AbstractExportTest
|
|
||||||
{
|
|
||||||
private ActivityRepository $activityRepository;
|
|
||||||
|
|
||||||
protected function setUp(): void
|
|
||||||
{
|
|
||||||
self::bootKernel();
|
|
||||||
$this->activityRepository = self::getContainer()->get(ActivityRepository::class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getExport()
|
|
||||||
{
|
|
||||||
yield new CountHouseholdOnActivity($this->activityRepository, $this->getParameters(true));
|
|
||||||
yield new CountHouseholdOnActivity($this->activityRepository, $this->getParameters(false));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getFormData(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
[],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getModifiersCombination(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
[
|
|
||||||
Declarations::ACTIVITY,
|
|
||||||
Declarations::ACTIVITY_PERSON,
|
|
||||||
PersonDeclarations::PERSON_TYPE,
|
|
||||||
PersonDeclarations::HOUSEHOLD_TYPE,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
@@ -39,16 +39,16 @@ final class ListActivityTest extends AbstractExportTest
|
|||||||
|
|
||||||
$request->getLocale()->willReturn('fr');
|
$request->getLocale()->willReturn('fr');
|
||||||
|
|
||||||
self::getContainer()->get('request_stack')
|
self::$container->get('request_stack')
|
||||||
->push($request->reveal());
|
->push($request->reveal());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getExport()
|
public function getExport()
|
||||||
{
|
{
|
||||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
$em = self::$container->get(EntityManagerInterface::class);
|
||||||
$translator = self::getContainer()->get(TranslatorInterface::class);
|
$translator = self::$container->get(TranslatorInterface::class);
|
||||||
$translatableStringHelper = self::getContainer()->get(TranslatableStringHelperInterface::class);
|
$translatableStringHelper = self::$container->get(TranslatableStringHelperInterface::class);
|
||||||
$activityRepository = self::getContainer()->get(ActivityRepository::class);
|
$activityRepository = self::$container->get(ActivityRepository::class);
|
||||||
|
|
||||||
yield new ListActivity(
|
yield new ListActivity(
|
||||||
$em,
|
$em,
|
||||||
@@ -67,7 +67,7 @@ final class ListActivityTest extends AbstractExportTest
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormData(): array
|
public function getFormData()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
['fields' => [
|
['fields' => [
|
||||||
@@ -89,7 +89,7 @@ final class ListActivityTest extends AbstractExportTest
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getModifiersCombination(): array
|
public function getModifiersCombination()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
['activity'],
|
['activity'],
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user