mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-10 16:55:00 +00:00
Compare commits
358 Commits
fix_deathd
...
issue357_f
Author | SHA1 | Date | |
---|---|---|---|
|
db65134743 | ||
7af4c3434e | |||
46c6d0e293 | |||
bb0a04b19a | |||
8d3ba314e0 | |||
9e48a1db0a | |||
6c71cb0e80 | |||
11d4450244 | |||
5a79df0e0a | |||
c0c2131be0 | |||
e6ea2674c2 | |||
39b5ce0320 | |||
e0ee817421 | |||
8159144f26 | |||
630115fd3a | |||
87cf8d737e | |||
ecda740d81 | |||
c9e3960238 | |||
782e098e31 | |||
34ff91979b | |||
|
a09c8ee8af | ||
|
a312a9463d | ||
|
0035128138 | ||
|
49cb154672 | ||
|
1a7ec9e396 | ||
|
fa0b9271c2 | ||
|
c7b9a1a3fe | ||
|
f1c61a2387 | ||
|
8f6a70b240 | ||
|
40e4bf953f | ||
|
378f3a16fc | ||
abcc8557ce | |||
15342f85d3 | |||
b679d833da | |||
f8ca349d9e | |||
a8978a52b9 | |||
b1bffd875c | |||
b23161fa1d | |||
e540baaa4f | |||
9fe744f09f | |||
6b1310148f | |||
1650f30a59 | |||
f6386a13ac | |||
e437705714 | |||
f79225fc2b | |||
7564c2fde1 | |||
2c4d06371c | |||
8e012982f5 | |||
ba893e8429 | |||
b153fc19f6 | |||
098c2fbaa0 | |||
479e4ffe64 | |||
42a14fbd6b | |||
46ca74fc70 | |||
ae931b5869 | |||
fded08aaaa | |||
d60938352b | |||
af6f3043ae | |||
8afd1ee275 | |||
5a739380cd | |||
a1ec2b637d | |||
584b77bbf4 | |||
e84182cdac | |||
01d51da7e1 | |||
|
699dcc85de | ||
e677c0fe2f | |||
|
edeaaf0218 | ||
afae3b58c2 | |||
95027e93c6 | |||
a3ea28d307 | |||
|
921dd639bf | ||
a40077e91b | |||
8de5c8900a | |||
efc3e3915b | |||
98ab3b66ba | |||
b1cd85971a | |||
0a3b50568d | |||
69b5c98d2e | |||
5c4bef26e8 | |||
bdf4b71080 | |||
c60d46c68b | |||
be4b8a94f0 | |||
a54cc70fd6 | |||
18959f60e2 | |||
7d4ca8d149 | |||
442e2a1ede | |||
c32b767d9b | |||
140f53b81f | |||
b9e5734039 | |||
f5f5d66f3d | |||
1e0c62b09d | |||
78cf817921 | |||
40a457ba69 | |||
66aac8908c | |||
c17fd968be | |||
6f561f57a6 | |||
4f1540c541 | |||
4ef024516c | |||
ebc6d21ba6 | |||
d31661ae7a | |||
f76f7a1641 | |||
|
f63afea2ce | ||
|
660e45ac59 | ||
|
e619e58a6e | ||
160d382e07 | |||
a8fe049ecd | |||
3a207b2c5d | |||
|
08de360677 | ||
|
e2ad590310 | ||
|
6ebcd87508 | ||
|
06f8014b76 | ||
|
52f817bde7 | ||
af2eca0d03 | |||
|
33913867ee | ||
bcd25fa950 | |||
|
acf7142bad | ||
|
c8c5af8d14 | ||
|
aa6b770bfe | ||
|
4d5d5265df | ||
|
d19c5c9e41 | ||
|
cf588c97c0 | ||
|
f3f5cc550c | ||
|
c7d00ca937 | ||
|
e3c0dca1d1 | ||
|
f4c8d0b09a | ||
68ea0a1086 | |||
5bb5468198 | |||
5fead5b467 | |||
|
72a15bb823 | ||
0edd5667e0 | |||
862f9aefb0 | |||
45dd21e02a | |||
5bf1b9d8bd | |||
7bc4ad9779 | |||
1576507f7e | |||
9ddfd194be | |||
8fe94bd117 | |||
9d638fe897 | |||
478c3b3247 | |||
dc581fcf57 | |||
bd909b0061 | |||
58c7560a1c | |||
9e67d9586d | |||
982dd78828 | |||
1055fd9398 | |||
5089bba4d7 | |||
433307020a | |||
5a5ff5f54a | |||
a0b112e8db | |||
cb88a37885 | |||
9647785d8b | |||
1ad6a958e2 | |||
f453dbb543 | |||
b323ddae05 | |||
d5d64cdf65 | |||
700bb02374 | |||
bd3919efcb | |||
f6f0786d38 | |||
5cebcfddb7 | |||
11824adda4 | |||
d62893827b | |||
e972beee11 | |||
|
6a0ce72836 | ||
|
f93b1935ee | ||
|
64ec3e62da | ||
|
492d5caaf0 | ||
|
2ed3a91d8e | ||
|
b55c19cd9e | ||
|
70ca203e23 | ||
|
58a13d932f | ||
|
11c6f6d84a | ||
|
3d0be940f0 | ||
|
ea839a4b52 | ||
793f7724a7 | |||
40e7bfef4d | |||
|
d692793714 | ||
|
01ef9617d6 | ||
|
530ad497bc | ||
|
e2bc868495 | ||
|
b743475761 | ||
|
b3823161af | ||
|
beeb69c70d | ||
|
8401ce2656 | ||
|
b7360955f7 | ||
|
8c3fb6dfa7 | ||
|
c84ba5371d | ||
|
4d9c643977 | ||
f117dcd703 | |||
67c1760b51 | |||
97792fd85f | |||
ae43e23ec6 | |||
6a4d7fbece | |||
1a0dcfa8d0 | |||
66f407ab8c | |||
c7e992fd1a | |||
3d16f68f54 | |||
36890a2256 | |||
395920bd51 | |||
773aee5534 | |||
a6cc6221d6 | |||
37ed6b7591 | |||
cdc335372f | |||
e0bed186b8 | |||
d588c36308 | |||
06cbe8325c | |||
400ce3ac82 | |||
14aab637eb | |||
6296c7a307 | |||
b613a2f49b | |||
91bee4aad3 | |||
45b71b207e | |||
751a418c1f | |||
8cf08f66d5 | |||
b7c0548212 | |||
408a14926f | |||
efdd96b69f | |||
10ebf0b63a | |||
d4a5735e15 | |||
9453fc2dd5 | |||
f01b87b348 | |||
689f612382 | |||
17a81d7e66 | |||
6501a0148e | |||
44d38bcef5 | |||
75dda5b999 | |||
46ecab24c2 | |||
45c608cd48 | |||
ecbe30ae53 | |||
4e8492db70 | |||
48f62a2a17 | |||
decc74c040 | |||
de790d11a8 | |||
3a9fac08c3 | |||
f4fe297765 | |||
264bd76461 | |||
45bcb27b79 | |||
cf22a49487 | |||
e71e369f15 | |||
1a604ecf65 | |||
da7bfa8a4e | |||
d3127bed6d | |||
3c1c07dc64 | |||
530267a9b0 | |||
f9dd1c5231 | |||
f2fd30b690 | |||
3d3cc9aeb4 | |||
8b2a8544b8 | |||
be5f54c142 | |||
1fbe044729 | |||
60032c96f7 | |||
976f2fd41a | |||
19741530bf | |||
6e079fa771 | |||
8c14232a91 | |||
a983b34f0d | |||
4970cf000e | |||
1422ddeb2a | |||
9afc8c64ad | |||
200f1749f1 | |||
4645ede7d1 | |||
6016038813 | |||
d40b0e88ed | |||
f26863487b | |||
5b531a0529 | |||
a25123ee38 | |||
2524229941 | |||
119a9981af | |||
decc18596b | |||
eea72c9bcd | |||
717b71ff54 | |||
64015479b1 | |||
18fa4eb586 | |||
47574f82aa | |||
12309ca1b5 | |||
20c95a179d | |||
d5290e4bdd | |||
f4396459a0 | |||
f8071d32c0 | |||
4dc490beb7 | |||
52a137ee77 | |||
985d8f0eae | |||
|
f0a8aa6c90 | ||
|
bbebaa9fae | ||
5526790d42 | |||
|
159dba0dc3 | ||
550b4775bf | |||
|
f2c724726a | ||
133e4858dc | |||
b3ee745479 | |||
|
13faf6fe5a | ||
|
da12aedb53 | ||
|
af87b3f6da | ||
|
872090e02a | ||
|
4b432c64b0 | ||
|
8493a64794 | ||
|
82c027fe2a | ||
7f2e3ee8e2 | |||
7129b3149b | |||
|
1e99ca2ca5 | ||
cc42a4ae51 | |||
6c28ff00ab | |||
d7db8400d2 | |||
16b3be322a | |||
329026e36c | |||
19a53ada88 | |||
4c31100dc7 | |||
536a1a46da | |||
5ed7572f95 | |||
f1067661d4 | |||
3592434623 | |||
94ec165c4c | |||
1c3c2be176 | |||
edaad844aa | |||
2edf36b6c5 | |||
95e45a8ad2 | |||
9004686a13 | |||
e266fa0e5d | |||
75ba56fa09 | |||
12d6829b98 | |||
7b5e96771f | |||
8a9024de13 | |||
9387d37746 | |||
24a404964b | |||
534a8bb3af | |||
21e3da0266 | |||
85a1fcca18 | |||
793f5116ab | |||
5d24bd4d11 | |||
70ab232149 | |||
027c01fc58 | |||
fdc5127c74 | |||
b8d48f04ae | |||
f1b1771d6b | |||
62dabbe1e7 | |||
4101392190 | |||
3f1bed0b1c | |||
79fbdcdee4 | |||
3d8d79323e | |||
32178e22fe | |||
60a8c20896 | |||
9d8011da61 | |||
789eeadb40 | |||
f206fdb08c | |||
9d5409d8d9 | |||
e297d82533 | |||
32a7734d30 | |||
|
8affeb08d9 | ||
|
047083812e | ||
|
49da5fe060 | ||
|
bcdddcde9b | ||
|
64d3edfc42 | ||
|
912f9bacdb | ||
|
55e94fbe2a | ||
|
c5acfc9bbc | ||
|
780b7db8cb | ||
|
d71d1beb42 | ||
|
3d3ce7814b | ||
|
438cb7317a |
@@ -3,4 +3,3 @@
|
||||
# Run tests from root to adapt your own environment
|
||||
KERNEL_CLASS='App\Kernel'
|
||||
APP_SECRET='$ecretf0rt3st'
|
||||
DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres?serverVersion=12&charset=utf8
|
||||
|
@@ -20,6 +20,8 @@ variables:
|
||||
# Configure postgres environment variables (https://hub.docker.com/r/_/postgres/)
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
# configure database access
|
||||
DATABASE_URL: postgresql://postgres:postgres@db:5432/postgres?serverVersion=12&charset=utf8
|
||||
# fetch the chill-app using git submodules
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
REDIS_HOST: redis
|
||||
@@ -60,7 +62,7 @@ code_style:
|
||||
- bin
|
||||
- tests/app/vendor/
|
||||
|
||||
sa_tests:
|
||||
phpstan_tests:
|
||||
stage: Tests
|
||||
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
||||
script:
|
||||
@@ -71,6 +73,17 @@ sa_tests:
|
||||
- bin
|
||||
- tests/app/vendor/
|
||||
|
||||
psalm_tests:
|
||||
stage: Tests
|
||||
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
||||
script:
|
||||
- bin/grumphp run --tasks=psalm
|
||||
artifacts:
|
||||
expire_in: 30 min
|
||||
paths:
|
||||
- bin
|
||||
- tests/app/vendor/
|
||||
|
||||
unit_tests:
|
||||
stage: Tests
|
||||
image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
|
||||
@@ -79,7 +92,7 @@ unit_tests:
|
||||
- php -d memory_limit=2G tests/app/bin/console cache:clear --env=dev
|
||||
- php -d memory_limit=3G tests/app/bin/console doctrine:fixtures:load -n
|
||||
- php -d memory_limit=2G tests/app/bin/console cache:clear --env=test
|
||||
- php -d memory_limit=3G bin/phpunit --colors=never
|
||||
- php -d memory_limit=4G bin/phpunit --colors=never
|
||||
artifacts:
|
||||
expire_in: 30 min
|
||||
paths:
|
||||
|
63
CHANGELOG.md
63
CHANGELOG.md
@@ -11,9 +11,65 @@ and this project adheres to
|
||||
## Unreleased
|
||||
|
||||
<!-- write down unreleased development here -->
|
||||
* vuejs: add validation on required fields for AddPerson, Address and Location components
|
||||
* vuejs: treat 422 validation errors in locations and AddPerson components
|
||||
|
||||
## Test releases
|
||||
|
||||
### test release 2022-01-12
|
||||
|
||||
* fix thirdparty normalizer on telephone field: https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/322
|
||||
|
||||
### test release 2022-01-11
|
||||
|
||||
* vuejs: translate in French all multiselect widgets
|
||||
* [address] define address lines according postal standards for France and Belgium (default) and change AddressRender, chill_entity_render_box and AddressRenderBox.vue
|
||||
* [household] change translations (champs-libres/departement-de-la-vendee/accent-suivi-developpement#109)
|
||||
* [household] add address i18n in household component (champs-libres/departement-de-la-vendee/accent-suivi-developpement#158)
|
||||
* [household] add on the fly i18n in household component
|
||||
* [household] redirect to the household page when a household is created from a person (champs-libres/departement-de-la-vendee/accent-suivi-developpement#175)
|
||||
* [household] household member editor: display alert if some members have already an household (champs-libres/departement-de-la-vendee/accent-suivi-developpement#172)
|
||||
* [household] household member editor: do not add in new members if the member is included in the members of household (champs-libres/departement-de-la-vendee/accent-suivi-developpement#123)
|
||||
* [household] household member editor: remove markNoAddress button (champs-libres/departement-de-la-vendee/accent-suivi-developpement#109)
|
||||
* [person]: ordering fields in add person (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/61)
|
||||
* [person]: Add email and alt names in add person (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/61)
|
||||
* [accompanyingCourse] Add a delete action and delete buttons to delete a accompanying course when step = DRAFT (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/64)
|
||||
* [accompanyingCourse] Add a administrative location in the accompanying course, set the user current location as default, allow to select a location in a select field and do not allow to confirm the accompanying course if location is empty.
|
||||
* [accompanyingCourse] Add the administrative location in the available variables for document generation
|
||||
* AddAddress: optimize loading: wait for the user finish typing;
|
||||
* UserPicker: fix bug with deprecated role
|
||||
* docgen: add base context + tests
|
||||
* docgen: add age for person
|
||||
* [household menu] fix filiation order https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/265
|
||||
* [AddAddress]: optimize loading: wait for the user finish typing;
|
||||
* [UserPicker]: fix bug with deprecated role
|
||||
* [docgen]: add base context + tests
|
||||
* [docgen]: add age for person
|
||||
* [task]: fix dropdown menu style + fix bug in singleTaskController (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/338)
|
||||
* Household: fix bug when moving person on the same day (see https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/281)
|
||||
* Household: show date validFrom and validTo when moving
|
||||
* address reference: add index for refid
|
||||
* [accompanyingCourse_work] fix styles conflicts + fix bug with remove goal (remove goals one at a time)
|
||||
* [accompanyingCourse] improve masonry on resume page, add origin
|
||||
* [notification] new notification interface, can be associated to AccompanyingCourse/Period, Activities.
|
||||
* List notifications, show, and comment in User section
|
||||
* Notify button and contextual notification box on associated objects pages
|
||||
* [accompanyingCourse] add a comment for each resource associated. A modal allow to save comment. Comment is displayed in on-the-fly show modal of the accompanyingCourse context (edit page + resume page).
|
||||
|
||||
### test release 2021-12-14
|
||||
|
||||
* [asideactivity] creation of aside activity category fixed (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/262)
|
||||
* [vendee/person] fix typo "situation professionelle" => "situation professionnelle"
|
||||
* [main] add availableForUsers condition from locationType in the location API endpoint (champs-libres/departement-de-la-vendee/accent-suivi-developpement#248)
|
||||
* [main] add the current location of the user as API point + add it in the activity location list (champs-libres/departement-de-la-vendee/accent-suivi-developpement#247)
|
||||
* [activity] improve show/new/edit templates, fix SEE and SEE_DETAILS acl
|
||||
* [badges] create specific badge for TMS, and make person/thirdparty badges clickable with on-the-fly modal in :
|
||||
* concerned groups items (activity, calendar)
|
||||
* accompanyingCourseWork lists
|
||||
* accompanyingCourse lists
|
||||
* [acompanyingCourse] add initial comment on Resume page
|
||||
* [person] create button full width (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/330)
|
||||
|
||||
### test release 2021-12-11
|
||||
|
||||
* [main] add order field to civility
|
||||
@@ -34,6 +90,9 @@ and this project adheres to
|
||||
* [person] add death information in person render box in twig and vue render boxes (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191)
|
||||
* [asideactivity] creation of aside activity category fixed (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/262)
|
||||
* [vendee/person] fix typo "situation professionelle" => "situation professionnelle"
|
||||
* [accompanyingcourse_work] Changes in layout/behavior of edit form (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/321)
|
||||
* [badge-entity] design coherency between pills badge-person and 3 kinds of badge-thirdparty
|
||||
* [AddPersons] suggestions row are clickable, not only checkbox
|
||||
|
||||
### test release 2021-12-06
|
||||
|
||||
@@ -50,10 +109,6 @@ and this project adheres to
|
||||
* [visgraph] improve and fix bugs on vis-network relationship graph
|
||||
* [bugfix] posting of birth- and deathdate through api fixed.
|
||||
* [suggestions] improve suggestions lists
|
||||
* [badge-entity] design coherency between badge-person and 3 kinds of badge-thirdparty
|
||||
* [AddPersons] suggestions row are clickable, not only checkbox
|
||||
* [activity] improve show/new/edit templates, fix SEE and SEE_DETAILS acl
|
||||
* [activity][calendar] concerned groups items are clickable with on-the-fly modal, create specific badge for TMS column
|
||||
|
||||
### Test release 2021-11-19 - bis
|
||||
|
||||
|
@@ -397,7 +397,6 @@ Créer une liste de suggestions à enlever (avec une croix rouge cliquable, l'an
|
||||
<li>
|
||||
<span>
|
||||
item
|
||||
<a></a>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -405,8 +404,8 @@ Créer une liste de suggestions à enlever (avec une croix rouge cliquable, l'an
|
||||
Créer un titre enlevable (avec une croix rouge cliquable, l'ancre a est vide)
|
||||
```html
|
||||
<div class="item-title">
|
||||
title
|
||||
<a></a>
|
||||
<span>title</span>
|
||||
</div>
|
||||
```
|
||||
Les classes `cols` ou `inline` peuvent être ajoutées à côté de `list-suggest` pour modifier la disposition de la liste.
|
||||
Dans le dernier exemple, on met une classe `removable` sur le span, si on veut pouvoir enlever l'élément.
|
||||
|
@@ -1,52 +1,56 @@
|
||||
{
|
||||
"name": "chill-project/chill-bundles",
|
||||
"type": "library",
|
||||
"description": "Most used bundles for chill-project",
|
||||
"license": "AGPL-3.0-only",
|
||||
"type": "library",
|
||||
"keywords": [
|
||||
"chill",
|
||||
"social worker"
|
||||
],
|
||||
"license": "AGPL-3.0-only",
|
||||
"require": {
|
||||
"champs-libres/async-uploader-bundle": "dev-sf4",
|
||||
"champs-libres/wopi-bundle": "dev-master",
|
||||
"composer/package-versions-deprecated": "^1.10",
|
||||
"php": "^7.4",
|
||||
"champs-libres/async-uploader-bundle": "dev-sf4#d57134aee8e504a83c902ff0cf9f8d36ac418290",
|
||||
"champs-libres/wopi-bundle": "dev-master#59b468503b9413f8d588ef9e626e7675560db3d8",
|
||||
"champs-libres/wopi-lib": "dev-master#0e1da19bb6de820080b8651867a7e475be590060",
|
||||
"doctrine/doctrine-bundle": "^2.1",
|
||||
"doctrine/doctrine-migrations-bundle": "^3.0",
|
||||
"doctrine/orm": "^2.7",
|
||||
"erusev/parsedown": "^1.7",
|
||||
"graylog2/gelf-php": "^1.5",
|
||||
"knplabs/knp-menu": "^3.1",
|
||||
"knplabs/knp-menu-bundle": "^3.0",
|
||||
"knplabs/knp-time-bundle": "^1.12",
|
||||
"league/csv": "^9.7.1",
|
||||
"nyholm/psr7": "^1.4",
|
||||
"ocramius/package-versions": "^1.10",
|
||||
"phpoffice/phpspreadsheet": "^1.16",
|
||||
"ramsey/uuid-doctrine": "^1.7",
|
||||
"sensio/framework-extra-bundle": "^5.5",
|
||||
"spomky-labs/base64url": "^2.0",
|
||||
"symfony/asset": "4.*",
|
||||
"symfony/browser-kit": "^5.2",
|
||||
"symfony/css-selector": "^5.2",
|
||||
"symfony/expression-language": "4.*",
|
||||
"symfony/form": "4.*",
|
||||
"symfony/intl": "4.*",
|
||||
"symfony/mime": "^4 || ^5",
|
||||
"symfony/asset": "^4.4",
|
||||
"symfony/browser-kit": "^4.4",
|
||||
"symfony/css-selector": "^4.4",
|
||||
"symfony/expression-language": "^4.4",
|
||||
"symfony/form": "^4.4",
|
||||
"symfony/framework-bundle": "^4.4",
|
||||
"symfony/intl": "^4.4",
|
||||
"symfony/mailer": "^5.4",
|
||||
"symfony/mime": "^5.4",
|
||||
"symfony/monolog-bundle": "^3.5",
|
||||
"symfony/security-bundle": "4.*",
|
||||
"symfony/serializer": "^5.2",
|
||||
"symfony/security-bundle": "^4.4",
|
||||
"symfony/serializer": "^5.3",
|
||||
"symfony/swiftmailer-bundle": "^3.5",
|
||||
"symfony/templating": "4.*",
|
||||
"symfony/translation": "4.*",
|
||||
"symfony/templating": "^4.4",
|
||||
"symfony/translation": "^4.4",
|
||||
"symfony/twig-bundle": "^4.4",
|
||||
"symfony/validator": "4.*",
|
||||
"symfony/validator": "^4.4",
|
||||
"symfony/webpack-encore-bundle": "^1.11",
|
||||
"symfony/workflow": "4.*",
|
||||
"symfony/yaml": "4.*",
|
||||
"twig/extra-bundle": "^2.12 || ^3.0",
|
||||
"symfony/workflow": "^4.4",
|
||||
"symfony/yaml": "^4.4",
|
||||
"twig/extra-bundle": "^3.0",
|
||||
"twig/intl-extra": "^3.0",
|
||||
"twig/markdown-extra": "^3.3",
|
||||
"twig/twig": "^2.12 || ^3.0"
|
||||
"twig/string-extra": "^3.3",
|
||||
"twig/twig": "^3.0"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/symfony": "*"
|
||||
@@ -56,19 +60,28 @@
|
||||
"drupol/php-conventions": "^5",
|
||||
"fakerphp/faker": "^1.13",
|
||||
"nelmio/alice": "^3.8",
|
||||
"phpspec/prophecy-phpunit": "^2.0",
|
||||
"phpstan/phpstan-strict-rules": "^1.0",
|
||||
"phpunit/phpunit": "^7.0",
|
||||
"phpunit/phpunit": ">= 7.5",
|
||||
"symfony/debug-bundle": "^5.1",
|
||||
"symfony/dotenv": "^5.1",
|
||||
"symfony/dotenv": "^4.4",
|
||||
"symfony/maker-bundle": "^1.20",
|
||||
"symfony/phpunit-bridge": "^5.2",
|
||||
"symfony/stopwatch": "^5.1",
|
||||
"symfony/var-dumper": "4.*",
|
||||
"symfony/web-profiler-bundle": "^5.0"
|
||||
"symfony/phpunit-bridge": "^4.4",
|
||||
"symfony/stopwatch": "^4.4",
|
||||
"symfony/var-dumper": "^4.4",
|
||||
"symfony/web-profiler-bundle": "^4.4"
|
||||
},
|
||||
"config": {
|
||||
"bin-dir": "bin",
|
||||
"vendor-dir": "tests/app/vendor"
|
||||
"optimize-autoloader": true,
|
||||
"sort-packages": true,
|
||||
"vendor-dir": "tests/app/vendor",
|
||||
"allow-plugins": {
|
||||
"composer/package-versions-deprecated": true,
|
||||
"phpstan/extension-installer": true,
|
||||
"ergebnis/composer-normalize": true,
|
||||
"phpro/grumphp": true
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
@@ -95,8 +108,19 @@
|
||||
"Chill\\DocGeneratorBundle\\Tests\\": "src/Bundle/ChillDocGeneratorBundle/tests"
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true,
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"composer/package-versions-deprecated": true,
|
||||
"phpstan/extension-installer": true,
|
||||
"ergebnis/composer-normalize": true,
|
||||
"phpro/grumphp": true,
|
||||
"ocramius/package-versions": true
|
||||
},
|
||||
"bin-dir": "bin",
|
||||
"optimize-autoloader": true,
|
||||
"sort-packages": true,
|
||||
"vendor-dir": "tests/app/vendor"
|
||||
},
|
||||
"scripts": {
|
||||
"auto-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
|
@@ -91,7 +91,9 @@ class CountPerson implements ExportInterface
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||
{
|
||||
// we gather all center the user choose.
|
||||
$centers = array_map(static function ($el) { return $el['center']; }, $acl);
|
||||
$centers = array_map(static function ($el) {
|
||||
return $el['center'];
|
||||
}, $acl);
|
||||
|
||||
$qb = $this->entityManager->createQueryBuilder();
|
||||
|
||||
|
@@ -11,53 +11,53 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\DependencyInjection;
|
||||
|
||||
use Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
|
||||
/**
|
||||
* Configure the main bundle.
|
||||
*/
|
||||
class ChillMainConfiguration implements ConfigurationInterface
|
||||
{
|
||||
use AddWidgetConfigurationTrait;
|
||||
/**
|
||||
* Configure the main bundle.
|
||||
*/
|
||||
class ChillMainConfiguration implements ConfigurationInterface
|
||||
{
|
||||
use AddWidgetConfigurationTrait;
|
||||
|
||||
/**
|
||||
* @var ContainerBuilder
|
||||
*/
|
||||
private $containerBuilder;
|
||||
/**
|
||||
* @var ContainerBuilder
|
||||
*/
|
||||
private $containerBuilder;
|
||||
|
||||
public function __construct(
|
||||
array $widgetFactories,
|
||||
ContainerBuilder $containerBuilder
|
||||
) {
|
||||
// we register here widget factories (see below)
|
||||
$this->setWidgetFactories($widgetFactories);
|
||||
// we will need the container builder later...
|
||||
$this->containerBuilder = $containerBuilder;
|
||||
}
|
||||
public function __construct(
|
||||
array $widgetFactories,
|
||||
ContainerBuilder $containerBuilder
|
||||
) {
|
||||
// we register here widget factories (see below)
|
||||
$this->setWidgetFactories($widgetFactories);
|
||||
// we will need the container builder later...
|
||||
$this->containerBuilder = $containerBuilder;
|
||||
}
|
||||
|
||||
public function getConfigTreeBuilder()
|
||||
{
|
||||
$treeBuilder = new TreeBuilder();
|
||||
$rootNode = $treeBuilder->root('chill_main');
|
||||
public function getConfigTreeBuilder()
|
||||
{
|
||||
$treeBuilder = new TreeBuilder();
|
||||
$rootNode = $treeBuilder->root('chill_main');
|
||||
|
||||
$rootNode
|
||||
->children()
|
||||
$rootNode
|
||||
->children()
|
||||
|
||||
// ...
|
||||
->arrayNode('widgets')
|
||||
->canBeDisabled()
|
||||
->children()
|
||||
// we declare here all configuration for homepage place
|
||||
->append($this->addWidgetsConfiguration('homepage', $this->containerBuilder))
|
||||
->end() // end of widgets/children
|
||||
->end() // end of widgets
|
||||
->end() // end of root/children
|
||||
->end() // end of root
|
||||
// ...
|
||||
->arrayNode('widgets')
|
||||
->canBeDisabled()
|
||||
->children()
|
||||
// we declare here all configuration for homepage place
|
||||
->append($this->addWidgetsConfiguration('homepage', $this->containerBuilder))
|
||||
->end() // end of widgets/children
|
||||
->end() // end of widgets
|
||||
->end() // end of root/children
|
||||
->end() // end of root
|
||||
;
|
||||
|
||||
return $treeBuilder;
|
||||
}
|
||||
}
|
||||
return $treeBuilder;
|
||||
}
|
||||
}
|
||||
|
25
grumphp.yml
25
grumphp.yml
@@ -12,3 +12,28 @@ parameters:
|
||||
tasks.phpcsfixer.allow_risky: true
|
||||
tasks.phpcsfixer.diff: true
|
||||
tasks.phpstan.level: 1
|
||||
tasks.phpstan.blocking: true
|
||||
tasks.phpstan.ignore_patterns:
|
||||
- "/.github/"
|
||||
- "/.idea/"
|
||||
- "/build/"
|
||||
- "/benchmarks/"
|
||||
- "/docs/"
|
||||
- "/node_modules/"
|
||||
- "/resource/"
|
||||
- "/spec/"
|
||||
- "/var/"
|
||||
- "/vendor/"
|
||||
|
||||
# Psalm
|
||||
tasks.psalm.blocking: true
|
||||
tasks.psalm.ignore_patterns:
|
||||
- "/.github/"
|
||||
- "/.idea/"
|
||||
- "/build/"
|
||||
- "/benchmarks/"
|
||||
- "/node_modules/"
|
||||
- "/resource/"
|
||||
- "/spec/"
|
||||
- "/var/"
|
||||
- "/vendor/"
|
||||
|
@@ -417,15 +417,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
|
||||
|
||||
-
|
||||
message:
|
||||
"""
|
||||
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||
"""
|
||||
count: 3
|
||||
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
|
||||
|
||||
-
|
||||
message:
|
||||
"""
|
||||
@@ -435,15 +426,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
|
||||
|
||||
-
|
||||
message:
|
||||
"""
|
||||
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||
"""
|
||||
count: 1
|
||||
path: src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php
|
||||
|
||||
-
|
||||
message:
|
||||
"""
|
||||
@@ -877,11 +859,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php
|
||||
|
||||
-
|
||||
message: "#^Call to deprecated method setTimeout\\(\\) of class Redis\\.$#"
|
||||
count: 1
|
||||
path: src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverLocker.php
|
||||
|
||||
-
|
||||
message:
|
||||
"""
|
||||
|
@@ -315,11 +315,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Bundle/ChillMainBundle/Security/PasswordRecover/TokenManager.php
|
||||
|
||||
-
|
||||
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
|
||||
count: 3
|
||||
path: src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php
|
||||
|
||||
-
|
||||
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
|
||||
count: 1
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
|
||||
xsi:noNamespaceSchemaLocation="tests/app/vendor/phpunit/phpunit/phpunit.xsd"
|
||||
backupGlobals="false"
|
||||
colors="true"
|
||||
bootstrap="tests/app/tests/bootstrap.php"
|
||||
|
2006
psalm-baseline.xml
Normal file
2006
psalm-baseline.xml
Normal file
File diff suppressed because it is too large
Load Diff
16
psalm.xml
Normal file
16
psalm.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0"?>
|
||||
<psalm
|
||||
errorLevel="7"
|
||||
resolveFromConfigFile="true"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="https://getpsalm.org/schema/config"
|
||||
xsi:schemaLocation="https://getpsalm.org/schema/config tests/app/vendor/vimeo/psalm/config.xsd"
|
||||
errorBaseline="psalm-baseline.xml"
|
||||
>
|
||||
<projectFiles>
|
||||
<directory name="src" />
|
||||
<ignoreFiles>
|
||||
<directory name="./tests/" />
|
||||
</ignoreFiles>
|
||||
</projectFiles>
|
||||
</psalm>
|
@@ -39,6 +39,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Serializer\SerializerInterface;
|
||||
|
||||
use function array_key_exists;
|
||||
|
||||
final class ActivityController extends AbstractController
|
||||
@@ -307,8 +308,10 @@ final class ActivityController extends AbstractController
|
||||
$activityData = $request->query->get('activityData');
|
||||
}
|
||||
|
||||
if (!$activityType instanceof \Chill\ActivityBundle\Entity\ActivityType
|
||||
|| !$activityType->isActive()) {
|
||||
if (
|
||||
!$activityType instanceof \Chill\ActivityBundle\Entity\ActivityType
|
||||
|| !$activityType->isActive()
|
||||
) {
|
||||
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
|
||||
|
||||
if (null !== $activityData) {
|
||||
|
@@ -14,7 +14,6 @@ namespace Chill\ActivityBundle\Controller;
|
||||
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
|
||||
use Chill\ActivityBundle\Form\ActivityReasonCategoryType;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
|
@@ -14,7 +14,6 @@ namespace Chill\ActivityBundle\Controller;
|
||||
use Chill\ActivityBundle\Entity\ActivityReason;
|
||||
use Chill\ActivityBundle\Form\ActivityReasonType;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
|
@@ -19,6 +19,7 @@ use Chill\MainBundle\Entity\RoleScope;
|
||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
|
@@ -13,6 +13,7 @@ namespace Chill\ActivityBundle\DependencyInjection;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
|
||||
use function is_int;
|
||||
|
||||
/**
|
||||
|
@@ -25,6 +25,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
|
||||
use function array_key_exists;
|
||||
use function count;
|
||||
|
||||
|
@@ -27,6 +27,7 @@ use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
use Symfony\Component\Validator\Constraints\Callback;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
|
||||
use function array_key_exists;
|
||||
use function count;
|
||||
use function in_array;
|
||||
@@ -189,7 +190,9 @@ class ListActivity implements ListInterface
|
||||
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||
{
|
||||
$centers = array_map(static function ($el) { return $el['center']; }, $acl);
|
||||
$centers = array_map(static function ($el) {
|
||||
return $el['center'];
|
||||
}, $acl);
|
||||
|
||||
// throw an error if any fields are present
|
||||
if (!array_key_exists('fields', $data)) {
|
||||
|
@@ -25,6 +25,7 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
|
||||
use function array_key_exists;
|
||||
use function count;
|
||||
|
||||
|
@@ -24,6 +24,7 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
|
||||
use function count;
|
||||
|
||||
class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInterface
|
||||
|
@@ -31,6 +31,7 @@ use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
|
||||
use function count;
|
||||
|
||||
class PersonHavingActivityBetweenDateFilter implements ExportElementValidatedInterface, FilterInterface
|
||||
|
@@ -48,6 +48,7 @@ use Symfony\Component\Form\FormEvent;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
|
||||
use function in_array;
|
||||
|
||||
class ActivityType extends AbstractType
|
||||
|
@@ -36,8 +36,10 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
$period = $parameters['accompanyingCourse'];
|
||||
|
||||
if (AccompanyingPeriod::STEP_DRAFT !== $period->getStep()
|
||||
&& $this->security->isGranted(ActivityVoter::SEE, $period)) {
|
||||
if (
|
||||
AccompanyingPeriod::STEP_DRAFT !== $period->getStep()
|
||||
&& $this->security->isGranted(ActivityVoter::SEE, $period)
|
||||
) {
|
||||
$menu->addChild($this->translator->trans('Activity'), [
|
||||
'route' => 'chill_activity_activity_list',
|
||||
'routeParameters' => [
|
||||
|
@@ -14,6 +14,7 @@ namespace Chill\ActivityBundle\Menu;
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
use function in_array;
|
||||
|
||||
final class AdminMenuBuilder implements LocalMenuBuilderInterface
|
||||
|
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\ActivityBundle\Notification;
|
||||
|
||||
use Chill\ActivityBundle\Entity\Activity;
|
||||
use Chill\ActivityBundle\Repository\ActivityRepository;
|
||||
use Chill\MainBundle\Entity\Notification;
|
||||
use Chill\MainBundle\Notification\NotificationHandlerInterface;
|
||||
|
||||
final class ActivityNotificationHandler implements NotificationHandlerInterface
|
||||
{
|
||||
private ActivityRepository $activityRepository;
|
||||
|
||||
public function __construct(ActivityRepository $activityRepository)
|
||||
{
|
||||
$this->activityRepository = $activityRepository;
|
||||
}
|
||||
|
||||
public function getTemplate(Notification $notification, array $options = []): string
|
||||
{
|
||||
return '@ChillActivity/Activity/showInNotification.html.twig';
|
||||
}
|
||||
|
||||
public function getTemplateData(Notification $notification, array $options = []): array
|
||||
{
|
||||
return [
|
||||
'notification' => $notification,
|
||||
'activity' => $this->activityRepository->find($notification->getRelatedEntityId()),
|
||||
];
|
||||
}
|
||||
|
||||
public function supports(Notification $notification, array $options = []): bool
|
||||
{
|
||||
return $notification->getRelatedEntityClass() === Activity::class;
|
||||
}
|
||||
}
|
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\ActivityBundle\Notification;
|
||||
|
||||
use Chill\ActivityBundle\Entity\Activity;
|
||||
use Chill\MainBundle\Entity\Notification;
|
||||
|
||||
final class ActivityNotificationRenderer
|
||||
{
|
||||
public function getTemplate()
|
||||
{
|
||||
return '@ChillActivity/Activity/showInNotification.html.twig';
|
||||
}
|
||||
|
||||
public function getTemplateData(Notification $notification)
|
||||
{
|
||||
return ['notification' => $notification];
|
||||
}
|
||||
|
||||
public function supports(Notification $notification, array $options = []): bool
|
||||
{
|
||||
return $notification->getRelatedEntityClass() === Activity::class;
|
||||
}
|
||||
}
|
@@ -22,6 +22,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
use function count;
|
||||
use function in_array;
|
||||
|
||||
@@ -167,7 +168,9 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
|
||||
$reachableScopes = $this->authorizationHelper->getReachableScopes($this->tokenStorage->getToken()->getUser(), $role, $center);
|
||||
// we get the ids for those scopes
|
||||
$reachablesScopesId = array_map(
|
||||
static function (Scope $scope) { return $scope->getId(); },
|
||||
static function (Scope $scope) {
|
||||
return $scope->getId();
|
||||
},
|
||||
$reachableScopes
|
||||
);
|
||||
|
||||
|
@@ -11,7 +11,7 @@ import Location from './components/Location.vue';
|
||||
|
||||
export default {
|
||||
name: "App",
|
||||
props: ['hasSocialIssues', 'hasLocation', 'hasPerson'],
|
||||
props: ['hasSocialIssues', 'hasLocation', 'hasPerson'],
|
||||
components: {
|
||||
ConcernedGroups,
|
||||
SocialIssuesAcc,
|
||||
|
@@ -17,6 +17,14 @@ const getLocations = () => fetchResults('/api/1.0/main/location.json');
|
||||
|
||||
const getLocationTypes = () => fetchResults('/api/1.0/main/location-type.json');
|
||||
|
||||
const getUserCurrentLocation =
|
||||
() => fetch('/api/1.0/main/user-current-location.json')
|
||||
.then(response => {
|
||||
if (response.ok) { return response.json(); }
|
||||
throw Error('Error with request resource response');
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
* Load Location Type by defaultFor
|
||||
* @param {string} entity - can be "person" or "thirdparty"
|
||||
@@ -48,5 +56,6 @@ export {
|
||||
getLocations,
|
||||
getLocationTypes,
|
||||
getLocationTypeByDefaultFor,
|
||||
postLocation
|
||||
postLocation,
|
||||
getUserCurrentLocation
|
||||
};
|
||||
|
@@ -12,7 +12,7 @@
|
||||
</div>
|
||||
<div v-if="getContext === 'accompanyingCourse' && suggestedEntities.length > 0">
|
||||
<ul class="list-suggest add-items inline">
|
||||
<li v-for="p in suggestedEntities" @click="addSuggestedEntity(p)">
|
||||
<li v-for="(p, i) in suggestedEntities" @click="addSuggestedEntity(p)" :key="`suggestedEntities-${i}`">
|
||||
<span>{{ p.text }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
@@ -1,8 +1,7 @@
|
||||
<template>
|
||||
<li>
|
||||
<span :title="person.text">
|
||||
<span class="chill_denomination">{{ textCutted }}</span>
|
||||
<a @click.prevent="$emit('remove', person)"></a>
|
||||
<span class="chill_denomination" @click.prevent="$emit('remove', person)">{{ textCutted }}</span>
|
||||
</span>
|
||||
</li>
|
||||
</template>
|
||||
|
@@ -15,14 +15,16 @@
|
||||
:searchable="true"
|
||||
:placeholder="$t('activity.choose_location')"
|
||||
:custom-label="customLabel"
|
||||
:options="locations"
|
||||
:select-label="$t('multiselect.select_label')"
|
||||
:deselect-label="$t('multiselect.deselect_label')"
|
||||
:selected-label="$t('multiselect.selected_label')"
|
||||
:options="availableLocations"
|
||||
group-values="locations"
|
||||
group-label="locationGroup"
|
||||
v-model="location"
|
||||
>
|
||||
</VueMultiselect>
|
||||
|
||||
<new-location v-bind:locations="locations"></new-location>
|
||||
<new-location v-bind:availableLocations="availableLocations"></new-location>
|
||||
</div>
|
||||
</div>
|
||||
</teleport>
|
||||
@@ -32,7 +34,6 @@
|
||||
import { mapState, mapGetters } from "vuex";
|
||||
import VueMultiselect from "vue-multiselect";
|
||||
import NewLocation from "./Location/NewLocation.vue";
|
||||
import { getLocations, getLocationTypeByDefaultFor } from "../api.js";
|
||||
|
||||
export default {
|
||||
name: "Location",
|
||||
@@ -40,13 +41,8 @@ export default {
|
||||
NewLocation,
|
||||
VueMultiselect,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
locations: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(["activity"]),
|
||||
...mapState(["activity", "availableLocations"]),
|
||||
...mapGetters(["suggestedEntities"]),
|
||||
location: {
|
||||
get() {
|
||||
@@ -57,53 +53,6 @@ export default {
|
||||
},
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
getLocations().then(
|
||||
(results) => {
|
||||
getLocationTypeByDefaultFor('person').then(
|
||||
(personLocationType) => {
|
||||
if (personLocationType) {
|
||||
const personLocation = this.makeAccompanyingPeriodLocation(personLocationType);
|
||||
const concernedPersonsLocation =
|
||||
this.makeConcernedPersonsLocation(personLocationType);
|
||||
getLocationTypeByDefaultFor('thirdparty').then(
|
||||
thirdpartyLocationType => {
|
||||
const concernedThirdPartiesLocation =
|
||||
this.makeConcernedThirdPartiesLocation(thirdpartyLocationType);
|
||||
this.locations = [
|
||||
{
|
||||
locationGroup: 'Localisation du parcours',
|
||||
locations: [personLocation]
|
||||
},
|
||||
{
|
||||
locationGroup: 'Parties concernées',
|
||||
locations: [...concernedPersonsLocation, ...concernedThirdPartiesLocation]
|
||||
},
|
||||
{
|
||||
locationGroup: 'Autres localisations',
|
||||
locations: results
|
||||
}
|
||||
];
|
||||
}
|
||||
)
|
||||
} else {
|
||||
this.locations = [
|
||||
{
|
||||
locationGroup: 'Localisations',
|
||||
locations: response.results
|
||||
}
|
||||
];
|
||||
}
|
||||
if (window.default_location_id) {
|
||||
let location = this.locations.filter(
|
||||
(l) => l.id === window.default_location_id
|
||||
);
|
||||
this.$store.dispatch("updateLocation", location);
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
labelAccompanyingCourseLocation(value) {
|
||||
return `${value.address.text} (${value.locationType.title.fr})`
|
||||
@@ -117,58 +66,6 @@ export default {
|
||||
: value.locationType.title.fr
|
||||
: '';
|
||||
},
|
||||
makeConcernedPersonsLocation(locationType) {
|
||||
let locations = [];
|
||||
this.suggestedEntities.forEach(
|
||||
(e) => {
|
||||
if (e.type === 'person' && e.current_household_address !== null){
|
||||
locations.push({
|
||||
type: 'location',
|
||||
id: -this.suggestedEntities.indexOf(e)*10,
|
||||
onthefly: true,
|
||||
name: e.text,
|
||||
address: {
|
||||
id: e.current_household_address.address_id,
|
||||
},
|
||||
locationType: locationType
|
||||
});
|
||||
}
|
||||
}
|
||||
)
|
||||
return locations;
|
||||
},
|
||||
makeConcernedThirdPartiesLocation(locationType) {
|
||||
let locations = [];
|
||||
this.suggestedEntities.forEach(
|
||||
(e) => {
|
||||
if (e.type === 'thirdparty' && e.address !== null){
|
||||
locations.push({
|
||||
type: 'location',
|
||||
id: -this.suggestedEntities.indexOf(e)*10,
|
||||
onthefly: true,
|
||||
name: e.text,
|
||||
address: { id: e.address.address_id },
|
||||
locationType: locationType
|
||||
});
|
||||
}
|
||||
}
|
||||
)
|
||||
return locations;
|
||||
},
|
||||
makeAccompanyingPeriodLocation(locationType) {
|
||||
const accPeriodLocation = this.activity.accompanyingPeriod.location;
|
||||
return {
|
||||
type: 'location',
|
||||
id: -1,
|
||||
onthefly: true,
|
||||
name: '__AccompanyingCourseLocation__',
|
||||
address: {
|
||||
id: accPeriodLocation.address_id,
|
||||
text: `${accPeriodLocation.text} - ${accPeriodLocation.postcode.code} ${accPeriodLocation.postcode.name}`
|
||||
},
|
||||
locationType: locationType
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@@ -18,15 +18,6 @@
|
||||
</template>
|
||||
<template v-slot:body>
|
||||
<form>
|
||||
<div class="form-floating mb-3">
|
||||
<p v-if="errors.length">
|
||||
<b>{{ $t('activity.errors') }}</b>
|
||||
<ul>
|
||||
<li v-for="error in errors" :key="error">{{ error }}</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="form-floating mb-3">
|
||||
<select class="form-select form-select-lg" id="type" required v-model="selectType">
|
||||
<option selected disabled value="">{{ $t('activity.choose_location_type') }}</option>
|
||||
@@ -62,6 +53,12 @@
|
||||
<input class="form-control form-control-lg" id="email" v-model="inputEmail" placeholder />
|
||||
<label for="email">{{ $t('activity.location_fields.email') }}</label>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-warning" v-if="errors.length">
|
||||
<ul>
|
||||
<li v-for="(e, i) in errors" :key="i">{{ e }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</template>
|
||||
<template v-slot:footer>
|
||||
@@ -81,7 +78,8 @@
|
||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal.vue';
|
||||
import AddAddress from "ChillMainAssets/vuejs/Address/components/AddAddress.vue";
|
||||
import { mapState } from "vuex";
|
||||
import { getLocationTypes, postLocation } from "../../api";
|
||||
import { getLocationTypes } from "../../api";
|
||||
import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods';
|
||||
|
||||
export default {
|
||||
name: "NewLocation",
|
||||
@@ -89,7 +87,7 @@ export default {
|
||||
Modal,
|
||||
AddAddress,
|
||||
},
|
||||
props: ['locations'],
|
||||
props: ['availableLocations'],
|
||||
data() {
|
||||
return {
|
||||
errors: [],
|
||||
@@ -223,7 +221,6 @@ export default {
|
||||
},
|
||||
saveNewLocation() {
|
||||
if (this.checkForm()) {
|
||||
console.log('saveNewLocation', this.selected);
|
||||
let body = {
|
||||
type: 'location',
|
||||
name: this.selected.name,
|
||||
@@ -242,23 +239,28 @@ export default {
|
||||
}
|
||||
});
|
||||
}
|
||||
postLocation(body)
|
||||
.then(
|
||||
location => new Promise(resolve => {
|
||||
this.locations.push(location);
|
||||
this.$store.dispatch('updateLocation', location);
|
||||
resolve();
|
||||
this.modal.showModal = false;
|
||||
})
|
||||
).catch(
|
||||
err => {
|
||||
this.errors.push(err.message);
|
||||
|
||||
makeFetch('POST', '/api/1.0/main/location.json', body)
|
||||
.then(response => {
|
||||
this.$store.dispatch('addAvailableLocationGroup', {
|
||||
locationGroup: 'Localisations nouvellement créées',
|
||||
locations: [response]
|
||||
});
|
||||
this.$store.dispatch('updateLocation', response);
|
||||
this.modal.showModal = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === 'ValidationException') {
|
||||
for (let v of error.violations) {
|
||||
this.errors.push(v);
|
||||
}
|
||||
} else {
|
||||
this.errors.push('An error occurred');
|
||||
}
|
||||
);
|
||||
})
|
||||
};
|
||||
},
|
||||
submitNewAddress(payload) {
|
||||
console.log('submitNewAddress', payload);
|
||||
this.selected.addressId = payload.addressId;
|
||||
this.addAddress.context.addressId = payload.addressId;
|
||||
this.addAddress.context.edit = true;
|
||||
|
@@ -9,9 +9,9 @@
|
||||
|
||||
<check-social-issue
|
||||
v-for="issue in socialIssuesList"
|
||||
v-bind:key="issue.id"
|
||||
v-bind:issue="issue"
|
||||
v-bind:selection="socialIssuesSelected"
|
||||
:key="issue.id"
|
||||
:issue="issue"
|
||||
:selection="socialIssuesSelected"
|
||||
@updateSelected="updateIssuesSelected">
|
||||
</check-social-issue>
|
||||
|
||||
@@ -21,18 +21,18 @@
|
||||
label="text"
|
||||
track-by="id"
|
||||
open-direction="bottom"
|
||||
v-bind:close-on-select="true"
|
||||
v-bind:preserve-search="false"
|
||||
v-bind:reset-after="true"
|
||||
v-bind:hide-selected="true"
|
||||
v-bind:taggable="false"
|
||||
v-bind:multiple="false"
|
||||
v-bind:searchable="true"
|
||||
v-bind:allow-empty="true"
|
||||
v-bind:show-labels="false"
|
||||
v-bind:loading="issueIsLoading"
|
||||
v-bind:placeholder="$t('activity.choose_other_social_issue')"
|
||||
v-bind:options="socialIssuesOther"
|
||||
:close-on-select="true"
|
||||
:preserve-search="false"
|
||||
:reset-after="true"
|
||||
:hide-selected="true"
|
||||
:taggable="false"
|
||||
:multiple="false"
|
||||
:searchable="true"
|
||||
:allow-empty="true"
|
||||
:show-labels="false"
|
||||
:loading="issueIsLoading"
|
||||
:placeholder="$t('activity.choose_other_social_issue')"
|
||||
:options="socialIssuesOther"
|
||||
@select="addIssueInList">
|
||||
</VueMultiselect>
|
||||
</div>
|
||||
@@ -58,9 +58,9 @@
|
||||
<check-social-action
|
||||
v-if="socialIssuesSelected.length || socialActionsSelected.length"
|
||||
v-for="action in socialActionsList"
|
||||
v-bind:key="action.id"
|
||||
v-bind:action="action"
|
||||
v-bind:selection="socialActionsSelected"
|
||||
:key="action.id"
|
||||
:action="action"
|
||||
:selection="socialActionsSelected"
|
||||
@updateSelected="updateActionsSelected">
|
||||
</check-social-action>
|
||||
</template>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import { personMessages } from 'ChillPersonAssets/vuejs/_js/i18n'
|
||||
import { multiSelectMessages } from 'ChillMainAssets/vuejs/_js/i18n'
|
||||
|
||||
const activityMessages = {
|
||||
fr: {
|
||||
@@ -33,12 +34,11 @@ const activityMessages = {
|
||||
},
|
||||
create_address: 'Créer une adresse',
|
||||
edit_address: "Modifier l'adresse"
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Object.assign(activityMessages.fr, personMessages.fr);
|
||||
Object.assign(activityMessages.fr, personMessages.fr, multiSelectMessages.fr);
|
||||
|
||||
export {
|
||||
activityMessages
|
||||
|
@@ -12,7 +12,11 @@ const hasLocation = document.querySelector('#location') !== null;
|
||||
const hasPerson = document.querySelector('#add-persons') !== null;
|
||||
|
||||
const app = createApp({
|
||||
template: `<app :hasSocialIssues="hasSocialIssues", :hasLocation="hasLocation", :hasPerson="hasPerson"></app>`,
|
||||
template: `<app
|
||||
:hasSocialIssues="hasSocialIssues"
|
||||
:hasLocation="hasLocation"
|
||||
:hasPerson="hasPerson"
|
||||
></app>`,
|
||||
data() {
|
||||
return {
|
||||
hasSocialIssues,
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import 'es6-promise/auto';
|
||||
import { createStore } from 'vuex';
|
||||
import { postLocation } from './api';
|
||||
import prepareLocations from './store.locations.js';
|
||||
|
||||
const debug = process.env.NODE_ENV !== 'production';
|
||||
//console.log('window.activity', window.activity);
|
||||
@@ -25,6 +26,7 @@ const store = createStore({
|
||||
activity: window.activity,
|
||||
socialIssuesOther: [],
|
||||
socialActionsList: [],
|
||||
availableLocations: [],
|
||||
},
|
||||
getters: {
|
||||
suggestedEntities(state) {
|
||||
@@ -200,6 +202,9 @@ const store = createStore({
|
||||
console.log("### mutation: updateLocation", value);
|
||||
state.activity.location = value;
|
||||
},
|
||||
addAvailableLocationGroup(state, group) {
|
||||
state.availableLocations.push(group);
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
addIssueSelected({ commit }, issue) {
|
||||
@@ -235,6 +240,9 @@ const store = createStore({
|
||||
});
|
||||
commit("updateActionsSelected", payload);
|
||||
},
|
||||
addAvailableLocationGroup({ commit }, payload) {
|
||||
commit("addAvailableLocationGroup", payload);
|
||||
},
|
||||
addPersonsInvolved({ commit }, payload) {
|
||||
//console.log('### action addPersonsInvolved', payload.result.type);
|
||||
switch (payload.result.type) {
|
||||
@@ -335,4 +343,6 @@ const store = createStore({
|
||||
},
|
||||
});
|
||||
|
||||
prepareLocations(store);
|
||||
|
||||
export default store;
|
||||
|
@@ -0,0 +1,123 @@
|
||||
import {getLocations, getLocationTypeByDefaultFor, getUserCurrentLocation} from "./api";
|
||||
|
||||
const makeConcernedPersonsLocation = (locationType, store) => {
|
||||
let locations = [];
|
||||
store.getters.suggestedEntities.forEach(
|
||||
(e) => {
|
||||
if (e.type === 'person' && e.current_household_address !== null){
|
||||
locations.push({
|
||||
type: 'location',
|
||||
id: -store.getters.suggestedEntities.indexOf(e)*10,
|
||||
onthefly: true,
|
||||
name: e.text,
|
||||
address: {
|
||||
id: e.current_household_address.address_id,
|
||||
},
|
||||
locationType: locationType
|
||||
});
|
||||
}
|
||||
}
|
||||
)
|
||||
return locations;
|
||||
};
|
||||
const makeConcernedThirdPartiesLocation = (locationType, store) => {
|
||||
let locations = [];
|
||||
store.getters.suggestedEntities.forEach(
|
||||
(e) => {
|
||||
if (e.type === 'thirdparty' && e.address !== null){
|
||||
locations.push({
|
||||
type: 'location',
|
||||
id: -store.getters.suggestedEntities.indexOf(e)*10,
|
||||
onthefly: true,
|
||||
name: e.text,
|
||||
address: { id: e.address.address_id },
|
||||
locationType: locationType
|
||||
});
|
||||
}
|
||||
}
|
||||
)
|
||||
return locations;
|
||||
};
|
||||
const makeAccompanyingPeriodLocation = (locationType, store) => {
|
||||
const accPeriodLocation = store.state.activity.accompanyingPeriod.location;
|
||||
return {
|
||||
type: 'location',
|
||||
id: -1,
|
||||
onthefly: true,
|
||||
name: '__AccompanyingCourseLocation__',
|
||||
address: {
|
||||
id: accPeriodLocation.address_id,
|
||||
text: `${accPeriodLocation.text} - ${accPeriodLocation.postcode.code} ${accPeriodLocation.postcode.name}`
|
||||
},
|
||||
locationType: locationType
|
||||
}
|
||||
};
|
||||
|
||||
export default function prepareLocations(store) {
|
||||
|
||||
// find the locations
|
||||
let allLocations = getLocations().then(
|
||||
(results) => {
|
||||
store.commit('addAvailableLocationGroup', {
|
||||
locationGroup: 'Autres localisations',
|
||||
locations: results
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
let currentLocation = getUserCurrentLocation().then(
|
||||
userCurrentLocation => {
|
||||
if (null !== userCurrentLocation) {
|
||||
store.commit('addAvailableLocationGroup', {
|
||||
locationGroup: 'Ma localisation',
|
||||
locations: [userCurrentLocation]
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
let partiesLocations = [], partyPromise;
|
||||
['person', 'thirdparty'].forEach(kind => {
|
||||
partyPromise = getLocationTypeByDefaultFor(kind).then(
|
||||
(kindLocationType) => {
|
||||
if (kindLocationType) {
|
||||
let concernedKindLocations;
|
||||
if (kind === 'person') {
|
||||
concernedKindLocations = makeConcernedPersonsLocation(kindLocationType, store);
|
||||
// add location for the parcours into suggestions
|
||||
const personLocation = makeAccompanyingPeriodLocation(kindLocationType, store);
|
||||
store.commit('addAvailableLocationGroup', {
|
||||
locationGroup: 'Localisation du parcours',
|
||||
locations: [personLocation]
|
||||
});
|
||||
} else {
|
||||
concernedKindLocations = makeConcernedThirdPartiesLocation(kindLocationType, store);
|
||||
}
|
||||
|
||||
store.commit('addAvailableLocationGroup', {
|
||||
locationGroup: kind === 'person' ? 'Usagers concernés' : 'Tiers concernés',
|
||||
locations: concernedKindLocations,
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
partiesLocations.push(partyPromise);
|
||||
});
|
||||
|
||||
// when all location are loaded
|
||||
Promise.all([allLocations, currentLocation, ...partiesLocations]).then(() => {
|
||||
console.log('current location in activity', store.state.activity.location);
|
||||
console.log('default loation id', window.default_location_id);
|
||||
if (window.default_location_id) {
|
||||
for (let group of store.state.availableLocations) {
|
||||
console.log(group);
|
||||
let location = group.locations.find((l) => l.id === window.default_location_id);
|
||||
console.log(location);
|
||||
if (location !== undefined) {
|
||||
store.dispatch('updateLocation', location);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
@@ -18,7 +18,8 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
// This check prevents access to debug front controllers that are deployed by accident to production servers.
|
||||
// Feel free to remove this, extend it, or make something more sophisticated.
|
||||
if (isset($_SERVER['HTTP_CLIENT_IP'])
|
||||
if (
|
||||
isset($_SERVER['HTTP_CLIENT_IP'])
|
||||
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|
||||
|| !(in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1'], true) || \PHP_SAPI === 'cli-server')
|
||||
) {
|
||||
|
@@ -0,0 +1,151 @@
|
||||
{% set t = activity.type %}
|
||||
<div class="item-bloc activity-item{% if itemBlocClass is defined %} {{ itemBlocClass }}{% endif %}">
|
||||
|
||||
<div class="item-row">
|
||||
<div class="wrap-list">
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
{% if activity.date %}
|
||||
<p class="date-label">
|
||||
{{ activity.date|format_date('short') }}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
<h2 class="badge-title">
|
||||
<span class="title_label"></span>
|
||||
<span class="title_action">
|
||||
{{ activity.type.name | localize_translatable_string }}
|
||||
|
||||
{% if activity.emergency %}
|
||||
<span class="badge bg-danger rounded-pill fs-6 float-end">{{ 'Emergency'|trans|upper }}</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item-row column separator">
|
||||
<div class="wrap-list">
|
||||
{% if activity.location and t.locationVisible %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title"><h3>{{ 'location'|trans }}</h3></div>
|
||||
<div class="wl-col list">
|
||||
<p class="wl-item">
|
||||
{{ activity.location.name }}
|
||||
<span>({{ activity.location.locationType.title|localize_translatable_string }})</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if activity.sentReceived is not empty and t.sentReceivedVisible %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title"><h3>{{ 'Sent received'|trans }}</h3></div>
|
||||
<div class="wl-col list">
|
||||
<p class="wl-item">
|
||||
{{ activity.sentReceived|capitalize|trans }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if activity.user and t.userVisible %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title"><h3>{{ 'Referrer'|trans }}</h3></div>
|
||||
<div class="wl-col list">
|
||||
<p class="wl-item">
|
||||
{{ activity.user|chill_entity_render_string|capitalize }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {
|
||||
'context': context,
|
||||
'render': 'wrap-list',
|
||||
'entity': activity,
|
||||
'badge_person': true
|
||||
} %}
|
||||
|
||||
<div class="wrap-list">
|
||||
{%- if activity.reasons is not empty and t.reasonsVisible -%}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>{{ 'Reasons'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
{% for r in activity.reasons %}
|
||||
<p class="wl-item reasons">
|
||||
{{ r|chill_entity_render_box }}
|
||||
</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{%- if activity.socialIssues is not empty and t.socialIssuesVisible -%}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>{{ 'Social issues'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
{% for r in activity.socialIssues %}
|
||||
<p class="wl-item social-issues">
|
||||
{{ r|chill_entity_render_box }}
|
||||
</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{%- if activity.socialActions is not empty and t.socialActionsVisible -%}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>{{ 'Social actions'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
{% for r in activity.socialActions %}
|
||||
<p class="wl-item social-actions">
|
||||
{{ r|chill_entity_render_box }}
|
||||
</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if activity.comment.comment is not empty and is_granted('CHILL_ACTIVITY_SEE_DETAILS', activity) %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>{{ 'Comment'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
{{ activity.comment|chill_entity_render_box({
|
||||
'disable_markdown': false,
|
||||
'limit_lines': 3,
|
||||
'metadata': false
|
||||
}) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# Only if ACL SEE_DETAILS AND/OR only on template SHOW ??
|
||||
durationTime
|
||||
travelTime
|
||||
comment
|
||||
documents
|
||||
attendee
|
||||
#}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item-row separator">
|
||||
<ul class="record_actions">
|
||||
{{ recordAction }}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
@@ -3,11 +3,12 @@
|
||||
{{ path(pathname, parms) }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro insert_onthefly(type, entity) %}
|
||||
{% macro insert_onthefly(type, entity, parent = null) %}
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
action: 'show', displayBadge: true,
|
||||
targetEntity: { name: type, id: entity.id },
|
||||
buttonText: entity|chill_entity_render_string
|
||||
buttonText: entity|chill_entity_render_string,
|
||||
parent: parent
|
||||
} %}
|
||||
{% endmacro %}
|
||||
|
||||
@@ -59,7 +60,7 @@
|
||||
}]) %}
|
||||
{% endif %}
|
||||
|
||||
{% if (with_display == 'bloc') %}
|
||||
{% if (render == 'bloc') %}
|
||||
<div class="{{ context }} flex-bloc concerned-groups">
|
||||
{% for bloc in blocks %}
|
||||
|
||||
@@ -90,7 +91,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if (with_display == 'row') %}
|
||||
{% if (render == 'row') %}
|
||||
<div class="concerned-groups">
|
||||
{% for bloc in blocks %}
|
||||
<div class="group">
|
||||
@@ -115,7 +116,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if (with_display == 'wrap-list') %}
|
||||
{% if (render == 'wrap-list') %}
|
||||
<div class="concerned-groups wrap-list">
|
||||
{% for bloc in blocks %}
|
||||
<div class="wl-row">
|
||||
|
@@ -1,3 +1,61 @@
|
||||
{% macro recordAction(activity, context = null, person_id = null, accompanying_course_id = null) %}
|
||||
{% if no_action is not defined or no_action == false %}
|
||||
<li>
|
||||
<a class="btn btn-notify" href="{{ chill_path_add_return_path('chill_main_notification_create', {
|
||||
'entityClass': 'Chill\\ActivityBundle\\Entity\\Activity',
|
||||
'entityId': activity.id
|
||||
}) }}">{{ 'notification.Notify'|trans }}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if context == 'person' and activity.accompanyingPeriod is not empty %}
|
||||
{#
|
||||
Disable person_id in following links, for redirect to accompanyingCourse context
|
||||
#}
|
||||
{% set person_id = null %}
|
||||
{% set accompanying_course_id = activity.accompanyingPeriod.id %}
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_activity_activity_list',{
|
||||
'accompanying_period_id': accompanying_course_id
|
||||
}) }}"
|
||||
class="btn btn-primary"
|
||||
title="{{ 'See activity in accompanying course context'|trans }}">
|
||||
<i class="fa fa-random fa-fw"></i>
|
||||
{{ 'Period number %number%'|trans({'%number%': accompanying_course_id}) }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li>
|
||||
<a href="{{ path('chill_activity_activity_show', {'id': activity.id,
|
||||
'person_id': person_id,
|
||||
'accompanying_period_id': accompanying_course_id
|
||||
}) }}"
|
||||
class="btn btn-show"
|
||||
title="{{ 'Show'|trans }}"></a>
|
||||
</li>
|
||||
{% if no_action is not defined or no_action == false %}
|
||||
{% if is_granted('CHILL_ACTIVITY_UPDATE', activity) %}
|
||||
<li>
|
||||
<a href="{{ path('chill_activity_activity_edit', {'id': activity.id,
|
||||
'person_id': person_id,
|
||||
'accompanying_period_id': accompanying_course_id
|
||||
}) }}"
|
||||
class="btn btn-update"
|
||||
title="{{ 'Edit'|trans }}"></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if is_granted('CHILL_ACTIVITY_DELETE', activity) %}
|
||||
<li>
|
||||
<a href="{{ path('chill_activity_activity_delete', {'id': activity.id,
|
||||
'person_id': person_id,
|
||||
'accompanying_period_id': accompanying_course_id
|
||||
}) }}"
|
||||
class="btn btn-delete"
|
||||
title="{{ 'Delete'|trans }}"></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
<div class="context-{{ context }}">
|
||||
|
||||
{% if activities|length == 0 %}
|
||||
@@ -8,202 +66,10 @@
|
||||
{% else %}
|
||||
<div class="flex-table activity-list">
|
||||
{% for activity in activities %}
|
||||
{% set t = activity.type %}
|
||||
<div class="item-bloc">
|
||||
|
||||
<div class="item-row">
|
||||
<div class="wrap-list">
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
{% if activity.date %}
|
||||
<p class="date-label">
|
||||
{{ activity.date|format_date('short') }}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
<h2 class="badge-title">
|
||||
<span class="title_label"></span>
|
||||
<span class="title_action">
|
||||
{{ activity.type.name | localize_translatable_string }}
|
||||
|
||||
{% if activity.emergency %}
|
||||
<span class="badge bg-danger rounded-pill fs-6 float-end">{{ 'Emergency'|trans|upper }}</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item-row column separator">
|
||||
<div class="wrap-list">
|
||||
{% if activity.location and t.locationVisible %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title"><h3>{{ 'location'|trans }}</h3></div>
|
||||
<div class="wl-col list">
|
||||
<p class="wl-item">
|
||||
<span>{{ activity.location.locationType.title|localize_translatable_string }}</span>
|
||||
{{ activity.location.name }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if activity.sentReceived is not empty and t.sentReceivedVisible %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title"><h3>{{ 'Sent received'|trans }}</h3></div>
|
||||
<div class="wl-col list">
|
||||
<p class="wl-item">
|
||||
{{ activity.sentReceived|capitalize|trans }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if activity.user and t.userVisible %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title"><h3>{{ 'Referrer'|trans }}</h3></div>
|
||||
<div class="wl-col list">
|
||||
<p class="wl-item">
|
||||
{{ activity.user.usernameCanonical|chill_entity_render_string|capitalize }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {
|
||||
'context': context,
|
||||
'with_display': 'wrap-list',
|
||||
'entity': activity,
|
||||
'badge_person': true
|
||||
} %}
|
||||
|
||||
<div class="wrap-list">
|
||||
{%- if activity.reasons is not empty and t.reasonsVisible -%}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>{{ 'Reasons'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
{% for r in activity.reasons %}
|
||||
<p class="wl-item reasons">
|
||||
{{ r|chill_entity_render_box }}
|
||||
</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{%- if activity.socialIssues is not empty and t.socialIssuesVisible -%}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>{{ 'Social issues'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
{% for r in activity.socialIssues %}
|
||||
<p class="wl-item social-issues">
|
||||
{{ r|chill_entity_render_box }}
|
||||
</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{%- if activity.socialActions is not empty and t.socialActionsVisible -%}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>{{ 'Social actions'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
{% for r in activity.socialActions %}
|
||||
<p class="wl-item social-actions">
|
||||
{{ r|chill_entity_render_box }}
|
||||
</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# Only if ACL SEE_DETAILS AND/OR only on template SHOW ??
|
||||
durationTime
|
||||
travelTime
|
||||
comment
|
||||
{% if activity.comment.comment is not empty and is_granted('CHILL_ACTIVITY_SEE_DETAILS', activity) %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>{{ 'Comment'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
{{ activity.comment|chill_entity_render_box({
|
||||
'disable_markdown': false,
|
||||
'limit_lines': 3,
|
||||
'metadata': false
|
||||
}) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
documents
|
||||
attendee
|
||||
#}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item-row separator">
|
||||
<ul class="record_actions">
|
||||
{% if context == 'person' and activity.accompanyingPeriod is not empty %}
|
||||
{#
|
||||
Disable person_id in following links, for redirect to accompanyingCourse context
|
||||
#}
|
||||
{% set person_id = null %}
|
||||
{% set accompanying_course_id = activity.accompanyingPeriod.id %}
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_activity_activity_list',{
|
||||
'accompanying_period_id': accompanying_course_id
|
||||
}) }}"
|
||||
class="btn btn-primary"
|
||||
title="{{ 'See activity in accompanying course context'|trans }}">
|
||||
<i class="fa fa-random fa-fw"></i>
|
||||
{{ 'Period number %number%'|trans({'%number%': accompanying_course_id}) }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li>
|
||||
<a href="{{ path('chill_activity_activity_show', {'id': activity.id,
|
||||
'person_id': person_id,
|
||||
'accompanying_period_id': accompanying_course_id
|
||||
}) }}"
|
||||
class="btn btn-show"
|
||||
title="{{ 'Show'|trans }}"></a>
|
||||
</li>
|
||||
{% if no_action is not defined or no_action == false %}
|
||||
{% if is_granted('CHILL_ACTIVITY_UPDATE', activity) %}
|
||||
<li>
|
||||
<a href="{{ path('chill_activity_activity_edit', {'id': activity.id,
|
||||
'person_id': person_id,
|
||||
'accompanying_period_id': accompanying_course_id
|
||||
}) }}"
|
||||
class="btn btn-update"
|
||||
title="{{ 'Edit'|trans }}"></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if is_granted('CHILL_ACTIVITY_DELETE', activity) %}
|
||||
<li>
|
||||
<a href="{{ path('chill_activity_activity_delete', {'id': activity.id,
|
||||
'person_id': person_id,
|
||||
'accompanying_period_id': accompanying_course_id
|
||||
}) }}"
|
||||
class="btn btn-delete"
|
||||
title="{{ 'Delete'|trans }}"></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% include 'ChillActivityBundle:Activity:_list_item.html.twig' with {
|
||||
'context': context,
|
||||
'recordAction': _self.recordAction(activity, context, person_id, accompanying_course_id)
|
||||
} %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@@ -4,6 +4,17 @@
|
||||
|
||||
{% block title %}{{ 'Activity list' |trans }}{% endblock title %}
|
||||
|
||||
|
||||
{% block js %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_script_tags('mod_notification_toggle_read_status') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_link_tags('mod_notification_toggle_read_status') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% set person_id = null %}
|
||||
|
@@ -20,6 +20,16 @@
|
||||
|
||||
{% block title %}{{ 'Activity list' |trans }}{% endblock title %}
|
||||
|
||||
{% block js %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_script_tags('mod_notification_toggle_read_status') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_link_tags('mod_notification_toggle_read_status') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block personcontent %}
|
||||
|
||||
{% set person_id = null %}
|
||||
|
@@ -34,7 +34,7 @@
|
||||
<div class="item-row separator">
|
||||
<dl class="chill_view_data">
|
||||
<dt class="inline">{{ 'Referrer'|trans|capitalize }}</dt>
|
||||
<dd>{{ entity.user }}</dd>
|
||||
<dd>{{ entity.user|chill_entity_render_box }}</dd>
|
||||
|
||||
{%- if entity.scope -%}
|
||||
<dt class="inline">{{ 'Scope'|trans }}</dt>
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {
|
||||
'context': context,
|
||||
'with_display': 'bloc',
|
||||
'render': 'bloc',
|
||||
'badge_person': 'true'
|
||||
} %}
|
||||
|
||||
@@ -103,8 +103,8 @@
|
||||
<dd>
|
||||
{% if entity.location is not null %}
|
||||
<p>
|
||||
<span>{{ entity.location.locationType.title|localize_translatable_string }}</span>
|
||||
{{ entity.location.name }}
|
||||
<span>({{ entity.location.locationType.title|localize_translatable_string }})</span>
|
||||
</p>
|
||||
<div class="ms-3">{{ entity.location.address|chill_entity_render_box }}</div>
|
||||
{% else %}
|
||||
@@ -198,8 +198,8 @@
|
||||
</a>
|
||||
</li>
|
||||
{% if is_granted('CHILL_ACTIVITY_UPDATE', entity) %}
|
||||
<li>
|
||||
<a class="btn btn-update" href="{{ path('chill_activity_activity_edit', { 'id': entity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}">
|
||||
<li>
|
||||
<a class="btn btn-update" href="{{ path('chill_activity_activity_edit', { 'id': entity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}">
|
||||
{{ 'Edit'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
@@ -212,9 +212,3 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
<script>
|
||||
import ShowPane from "../../../../ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane";
|
||||
export default {
|
||||
components: {ShowPane}
|
||||
}
|
||||
</script>
|
||||
|
@@ -4,6 +4,16 @@
|
||||
|
||||
{% block title 'Show the activity'|trans %}
|
||||
|
||||
{% block js %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_script_tags('mod_notification_toggle_read_status') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_link_tags('mod_notification_toggle_read_status') }}
|
||||
{% endblock %}
|
||||
|
||||
{% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %}
|
||||
|
||||
{% block content -%}
|
||||
@@ -11,3 +21,21 @@
|
||||
{% include 'ChillActivityBundle:Activity:show.html.twig' with {'context': 'accompanyingCourse'} %}
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
{% block block_post_menu %}
|
||||
<div class="post-menu pt-4">
|
||||
|
||||
<div class="d-grid gap-2">
|
||||
<a class="btn btn-primary" href="{{ chill_path_add_return_path('chill_main_notification_create', {'entityClass': 'Chill\\ActivityBundle\\Entity\\Activity', 'entityId': entity.id}) }}">
|
||||
<i class="fa fa-paper-plane fa-fw"></i>
|
||||
{{ 'notification.Notify'|trans }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{% set notifications = chill_list_notifications('Chill\\ActivityBundle\\Entity\\Activity', entity.id) %}
|
||||
{% if notifications is not empty %}
|
||||
{{ notifications|raw }}
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@@ -1,2 +1,27 @@
|
||||
{% macro recordAction(activity) %}
|
||||
<li>
|
||||
<a href="{{ path('chill_activity_activity_show', {'id': activity.id }) }}"
|
||||
class="btn btn-show" title="{{ 'Show the activity'|trans }}"></a>
|
||||
</li>
|
||||
{% endmacro %}
|
||||
|
||||
<a href="{{ path('chill_activity_activity_show', {'id': notification.relatedEntityId }) }}">Go to Activity</a>
|
||||
{% if activity is not null %}
|
||||
<div class="flex-table">
|
||||
{% if is_granted('CHILL_ACTIVITY_SEE', activity) %}
|
||||
{% include 'ChillActivityBundle:Activity:_list_item.html.twig' with {
|
||||
'recordAction': _self.recordAction(activity),
|
||||
'context': 'accompanyingCourse',
|
||||
'itemBlocClass': 'bg-chill-llight-gray'
|
||||
} %}
|
||||
{% else %}
|
||||
<div class="alert alert-warning border-warning border-1">
|
||||
{{ 'This is the minimal activity data'|trans ~ ': ' ~ activity.id }}<br>
|
||||
{{ 'you are not allowed to see it details'|trans }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-warning border-warning border-1">
|
||||
{{ 'You get notified of an activity which does not exists any more'|trans }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@@ -4,6 +4,16 @@
|
||||
|
||||
{% block title 'Show the activity'|trans %}
|
||||
|
||||
{% block js %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_script_tags('mod_notification_toggle_read_status') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_link_tags('mod_notification_toggle_read_status') }}
|
||||
{% endblock %}
|
||||
|
||||
{% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %}
|
||||
|
||||
{% block personcontent -%}
|
||||
@@ -11,3 +21,21 @@
|
||||
{% include 'ChillActivityBundle:Activity:show.html.twig' with {'context': 'person'} %}
|
||||
</div>
|
||||
{% endblock personcontent %}
|
||||
|
||||
{% block block_post_menu %}
|
||||
<div class="post-menu pt-4">
|
||||
|
||||
<div class="d-grid gap-2">
|
||||
<a class="btn btn-primary" href="{{ chill_path_add_return_path('chill_main_notification_create', {'entityClass': 'Chill\\ActivityBundle\\Entity\\Activity', 'entityId': entity.id}) }}">
|
||||
<i class="fa fa-paper-plane fa-fw"></i>
|
||||
{{ 'notification.Notify'|trans }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{% set notifications = chill_list_notifications('Chill\\ActivityBundle\\Entity\\Activity', entity.id) %}
|
||||
{% if notifications is not empty %}
|
||||
{{ notifications|raw }}
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@@ -15,6 +15,7 @@ use Chill\MainBundle\Entity\Center;
|
||||
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
|
||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
|
||||
|
||||
use function in_array;
|
||||
|
||||
class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||
@@ -64,8 +65,10 @@ class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierar
|
||||
|
||||
protected function supports($attribute, $subject)
|
||||
{
|
||||
if ($subject instanceof Center
|
||||
&& in_array($attribute, $this->getAttributes(), true)) {
|
||||
if (
|
||||
$subject instanceof Center
|
||||
&& in_array($attribute, $this->getAttributes(), true)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -24,6 +24,7 @@ use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||
use RuntimeException;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
use function in_array;
|
||||
|
||||
class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||
|
@@ -66,7 +66,7 @@ final class ActivityReasonCategoryControllerTest extends WebTestCase
|
||||
$crawler = $client->followRedirect();
|
||||
|
||||
// Check the entity has been delete on the list
|
||||
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
|
||||
$this->assertDoesNotMatchRegularExpression('/Foo/', $client->getResponse()->getContent());
|
||||
}
|
||||
|
||||
*/
|
||||
|
@@ -66,7 +66,7 @@ final class ActivityReasonControllerTest extends WebTestCase
|
||||
$crawler = $client->followRedirect();
|
||||
|
||||
// Check the entity has been delete on the list
|
||||
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
|
||||
$this->assertDoesNotMatchRegularExpression('/Foo/', $client->getResponse()->getContent());
|
||||
}
|
||||
|
||||
*/
|
||||
|
@@ -66,7 +66,7 @@ final class ActivityTypeControllerTest extends WebTestCase
|
||||
$crawler = $client->followRedirect();
|
||||
|
||||
// Check the entity has been delete on the list
|
||||
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
|
||||
$this->assertDoesNotMatchRegularExpression('/Foo/', $client->getResponse()->getContent());
|
||||
}
|
||||
|
||||
*/
|
||||
|
@@ -26,7 +26,7 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
|
||||
*/
|
||||
private $aggregator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
|
@@ -26,7 +26,7 @@ final class ActivityTypeAggregatorTest extends AbstractAggregatorTest
|
||||
*/
|
||||
private $aggregator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
|
@@ -26,7 +26,7 @@ final class ActivityUserAggregatorTest extends AbstractAggregatorTest
|
||||
*/
|
||||
private $aggregator;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
|
@@ -24,7 +24,7 @@ final class CountActivityTest extends AbstractExportTest
|
||||
*/
|
||||
private $export;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
|
@@ -24,7 +24,7 @@ final class ListActivityTest extends AbstractExportTest
|
||||
*/
|
||||
private $export;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
|
@@ -26,7 +26,7 @@ final class StatActivityDurationSumTest extends AbstractExportTest
|
||||
*/
|
||||
private $export;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
|
@@ -25,7 +25,7 @@ final class ActivityReasonFilterTest extends AbstractFilterTest
|
||||
*/
|
||||
private $filter;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
|
@@ -26,7 +26,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest
|
||||
*/
|
||||
private $filter;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
|
@@ -45,7 +45,7 @@ final class ActivityTypeTest extends KernelTestCase
|
||||
*/
|
||||
protected $user;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
|
@@ -29,7 +29,7 @@ final class TranslatableActivityReasonTest extends TypeTestCase
|
||||
*/
|
||||
private static $prophet;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ final class TranslatableActivityTypeTest extends KernelTestCase
|
||||
*/
|
||||
protected $container;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
|
||||
|
@@ -44,7 +44,7 @@ final class ActivityVoterTest extends KernelTestCase
|
||||
*/
|
||||
protected $voter;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
$this->voter = self::$kernel->getContainer()
|
||||
|
@@ -24,6 +24,7 @@ use RuntimeException;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
use function implode;
|
||||
use function in_array;
|
||||
use function strtr;
|
||||
|
@@ -17,6 +17,7 @@ use Symfony\Component\Validator\Constraint;
|
||||
use Symfony\Component\Validator\ConstraintValidator;
|
||||
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
||||
use Symfony\Component\Validator\Exception\UnexpectedValueException;
|
||||
|
||||
use function array_merge;
|
||||
use function count;
|
||||
|
||||
|
@@ -13,6 +13,7 @@ namespace Chill\Migrations\Activity;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
use function count;
|
||||
|
||||
/**
|
||||
|
@@ -224,3 +224,7 @@ Aggregate by activity reason: Aggréger par sujet de l'activité
|
||||
Last activities: Les dernières activités
|
||||
|
||||
See activity in accompanying course context: Voir l'activité dans le contexte du parcours d'accompagnement
|
||||
|
||||
You get notified of an activity which does not exists any more: Cette notification ne correspond pas à une activité valide.
|
||||
you are not allowed to see it details: La notification fait référence à une activité à laquelle vous n'avez pas accès.
|
||||
This is the minimal activity data: Activité n°
|
||||
|
@@ -19,6 +19,7 @@ use DateTimeImmutable;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
|
||||
use function random_int;
|
||||
|
||||
class LoadAsideActivity extends Fixture implements DependentFixtureInterface
|
||||
|
@@ -18,10 +18,12 @@ class LoadAsideActivityCategory extends \Doctrine\Bundle\FixturesBundle\Fixture
|
||||
{
|
||||
public function load(ObjectManager $manager)
|
||||
{
|
||||
foreach ([
|
||||
'Appel téléphonique',
|
||||
'Formation',
|
||||
] as $key => $label) {
|
||||
foreach (
|
||||
[
|
||||
'Appel téléphonique',
|
||||
'Formation',
|
||||
] as $key => $label
|
||||
) {
|
||||
$category = new AsideActivityCategory();
|
||||
$category->setTitle(['fr' => $label]);
|
||||
$manager->persist($category);
|
||||
|
@@ -13,6 +13,7 @@ namespace Chill\AsideActivityBundle\DependencyInjection;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
|
||||
use function is_int;
|
||||
|
||||
class Configuration implements ConfigurationInterface
|
||||
|
@@ -32,6 +32,7 @@ use Symfony\Component\Form\FormEvent;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
|
||||
use function in_array;
|
||||
|
||||
final class AsideActivityFormType extends AbstractType
|
||||
|
@@ -13,6 +13,7 @@ namespace Chill\AsideActivityBundle\Menu;
|
||||
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
use function in_array;
|
||||
|
||||
final class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface
|
||||
|
@@ -26,7 +26,7 @@ final class AsideActivityControllerTest extends WebTestCase
|
||||
{
|
||||
use PrepareClientTrait;
|
||||
|
||||
public function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
self::bootKernel();
|
||||
|
@@ -13,6 +13,7 @@ namespace Chill\AMLI\BudgetBundle\Calculator;
|
||||
|
||||
use Chill\AMLI\BudgetBundle\Entity\AbstractElement;
|
||||
use OutOfBoundsException;
|
||||
|
||||
use function array_key_exists;
|
||||
use function array_keys;
|
||||
use function implode;
|
||||
|
@@ -21,6 +21,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
use function get_class;
|
||||
|
||||
abstract class AbstractElementController extends Controller
|
||||
|
@@ -22,6 +22,7 @@ use Psr\Log\LoggerInterface;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
use function array_merge;
|
||||
use function count;
|
||||
|
||||
|
@@ -21,6 +21,7 @@ use Symfony\Component\Form\Extension\Core\Type\MoneyType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
use function array_flip;
|
||||
use function asort;
|
||||
|
||||
|
@@ -21,6 +21,7 @@ use Symfony\Component\Form\Extension\Core\Type\MoneyType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
use function array_flip;
|
||||
|
||||
class ResourceType extends AbstractType
|
||||
|
@@ -18,6 +18,7 @@ use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
|
||||
use function in_array;
|
||||
|
||||
class BudgetElementVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||
|
@@ -16,6 +16,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
use function count;
|
||||
|
||||
class CalendarRangeAPIController extends ApiController
|
||||
|
@@ -28,6 +28,7 @@ use Symfony\Component\Serializer\Annotation\Groups;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Symfony\Component\Validator\Constraints\Range;
|
||||
use Symfony\Component\Validator\Mapping\ClassMetadata;
|
||||
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
|
@@ -14,6 +14,7 @@ namespace Chill\CalendarBundle\Event;
|
||||
use Chill\ActivityBundle\Entity\Activity;
|
||||
use Doctrine\Persistence\Event\LifecycleEventArgs;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
|
||||
use function array_key_exists;
|
||||
|
||||
class ListenToActivityCreate
|
||||
|
@@ -20,7 +20,6 @@ use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Form\Type\CommentType;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
|
@@ -1,6 +1,10 @@
|
||||
import 'es6-promise/auto';
|
||||
import { createStore } from 'vuex';
|
||||
import { postLocation } from 'ChillActivityAssets/vuejs/Activity/api';
|
||||
import {
|
||||
getLocations, getLocationTypeByDefaultFor,
|
||||
getUserCurrentLocation
|
||||
} from "../../../../../ChillActivityBundle/Resources/public/vuejs/Activity/api";
|
||||
|
||||
const debug = process.env.NODE_ENV !== 'production';
|
||||
|
||||
@@ -82,7 +86,7 @@ const store = createStore({
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
|
||||
|
||||
// ConcernedGroups
|
||||
addPersonsInvolved(state, payload) {
|
||||
//console.log('### mutation addPersonsInvolved', payload.result.type);
|
||||
@@ -94,7 +98,7 @@ const store = createStore({
|
||||
state.activity.thirdParties.push(payload.result);
|
||||
break;
|
||||
case 'user':
|
||||
state.activity.users.push(payload.result);
|
||||
state.activity.users.push(payload.result);
|
||||
break;
|
||||
};
|
||||
},
|
||||
@@ -108,7 +112,7 @@ const store = createStore({
|
||||
state.activity.thirdParties = state.activity.thirdParties.filter(thirdparty => thirdparty !== payload);
|
||||
break;
|
||||
case 'user':
|
||||
state.activity.users = state.activity.users.filter(user => user !== payload);
|
||||
state.activity.users = state.activity.users.filter(user => user !== payload);
|
||||
break;
|
||||
};
|
||||
},
|
||||
@@ -217,9 +221,7 @@ const store = createStore({
|
||||
hiddenLocation.value = value.id;
|
||||
}
|
||||
commit("updateLocation", value);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
@@ -13,6 +13,9 @@
|
||||
:close-on-select="false"
|
||||
:allow-empty="true"
|
||||
:model-value="value"
|
||||
:select-label="$t('multiselect.select_label')"
|
||||
:deselect-label="$t('multiselect.deselect_label')"
|
||||
:selected-label="$t('multiselect.selected_label')"
|
||||
@select="selectUsers"
|
||||
@remove="unSelectUsers"
|
||||
@close="coloriseSelectedValues"
|
||||
|
@@ -1,13 +1,17 @@
|
||||
import { multiSelectMessages } from 'ChillMainAssets/vuejs/_js/i18n'
|
||||
|
||||
const calendarUserSelectorMessages = {
|
||||
fr: {
|
||||
choose_your_calendar_user: "Afficher les plages de disponibilités",
|
||||
select_user: "Sélectionnez des calendriers",
|
||||
show_my_calendar: "Afficher mon calendrier",
|
||||
show_weekends: "Afficher les week-ends"
|
||||
}
|
||||
};
|
||||
fr: {
|
||||
choose_your_calendar_user: "Afficher les plages de disponibilités",
|
||||
select_user: "Sélectionnez des calendriers",
|
||||
show_my_calendar: "Afficher mon calendrier",
|
||||
show_weekends: "Afficher les week-ends"
|
||||
}
|
||||
};
|
||||
|
||||
export {
|
||||
calendarUserSelectorMessages
|
||||
};
|
||||
Object.assign(calendarUserSelectorMessages.fr, multiSelectMessages.fr);
|
||||
|
||||
export {
|
||||
calendarUserSelectorMessages
|
||||
};
|
||||
|
@@ -92,8 +92,11 @@
|
||||
%}
|
||||
<div class="item-row details">
|
||||
<div class="item-col">
|
||||
|
||||
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {'context': accompanyingCourse, 'with_display': 'row', 'entity': calendar } %}
|
||||
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {
|
||||
'context': accompanyingCourse,
|
||||
'render': 'row',
|
||||
'entity': calendar
|
||||
} %}
|
||||
</div>
|
||||
|
||||
{% if calendar.comment.comment is not empty %}
|
||||
@@ -123,4 +126,4 @@
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
@@ -6,7 +6,7 @@
|
||||
</dl>
|
||||
|
||||
<h2 class="chill-red">{{ 'Concerned groups'|trans }}</h2>
|
||||
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {'context': context, 'with_display': 'bloc' } %}
|
||||
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {'context': context, 'render': 'bloc' } %}
|
||||
|
||||
|
||||
<h2 class="chill-red">{{ 'Calendar data'|trans }}</h2>
|
||||
@@ -108,13 +108,13 @@
|
||||
{# TODO
|
||||
{% if is_granted('CHILL_ACTIVITY_DELETE', entity) %}
|
||||
#}
|
||||
|
||||
|
||||
<li>
|
||||
<a href="{{ path('chill_calendar_calendar_delete', { 'id': entity.id, 'accompanying_period_id': accompanying_course_id, 'user_id': user_id } ) }}" class="btn btn-delete">
|
||||
{{ 'Delete'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
{#
|
||||
{% endif %}
|
||||
#}
|
||||
|
@@ -26,7 +26,7 @@ final class CalendarControllerTest extends WebTestCase
|
||||
/**
|
||||
* Setup before each test method (see phpunit doc).
|
||||
*/
|
||||
public function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
self::bootKernel();
|
||||
$this->client = self::createClient([], [
|
||||
|
@@ -25,6 +25,7 @@ use Symfony\Component\Console\Question\Question;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
use Symfony\Component\Yaml\Exception\ParseException;
|
||||
use Symfony\Component\Yaml\Parser;
|
||||
|
||||
use function count;
|
||||
|
||||
/**
|
||||
|
@@ -23,6 +23,7 @@ use Symfony\Bridge\Twig\TwigEngine;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
use function array_key_exists;
|
||||
use function count;
|
||||
use function in_array;
|
||||
|
@@ -135,7 +135,7 @@ class CustomFieldDate extends AbstractCustomField
|
||||
return null;
|
||||
}
|
||||
|
||||
return $date->format('Y-m-d');
|
||||
return $date->format('Y-m-d');
|
||||
|
||||
default:
|
||||
$template = 'ChillCustomFieldsBundle:CustomFieldsRendering:date.'
|
||||
|
@@ -21,6 +21,7 @@ use LogicException;
|
||||
use Symfony\Bridge\Twig\TwigEngine;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
use function get_class;
|
||||
use function gettype;
|
||||
use function is_object;
|
||||
|
@@ -18,7 +18,6 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
|
||||
use Symfony\Component\Validator\Constraints\LessThanOrEqual;
|
||||
|
||||
|
@@ -20,6 +20,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
|
||||
use function array_key_exists;
|
||||
|
||||
class CustomFieldText extends AbstractCustomField
|
||||
@@ -65,8 +66,10 @@ class CustomFieldText extends AbstractCustomField
|
||||
|
||||
$attrArray = [];
|
||||
|
||||
if (array_key_exists(self::MULTIPLE_CF_INLINE, $options)
|
||||
&& $options[self::MULTIPLE_CF_INLINE]) {
|
||||
if (
|
||||
array_key_exists(self::MULTIPLE_CF_INLINE, $options)
|
||||
&& $options[self::MULTIPLE_CF_INLINE]
|
||||
) {
|
||||
$attrArray['class'] = 'multiple-cf-inline';
|
||||
}
|
||||
|
||||
|
@@ -20,6 +20,7 @@ use Symfony\Component\Form\FormEvent;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
use function count;
|
||||
|
||||
class CustomFieldsGroupType extends AbstractType
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user