Compare commits

...

2523 Commits

Author SHA1 Message Date
8423c6c99c fix banners: resolve_center is always an iterable 2021-11-22 10:55:38 +01:00
03feb78037 fix down migration 2021-11-22 10:49:56 +01:00
98760bc5e8 Merge remote-tracking branch 'origin/master' into doc/authorizaton-documentation-update 2021-11-22 10:30:05 +01:00
1194aaecaf Merge branch 'master' into 295_resume_retouches 2021-11-22 10:08:06 +01:00
f69d6edba3 accourse banner carousel: slide2 control on right, + display when ready 2021-11-22 10:05:34 +01:00
009a093b9d Merge branch 'features/docgen-normalization' into 'master'
Bootstrap encoder for documents

See merge request Chill-Projet/chill-bundles!208
2021-11-22 09:05:15 +00:00
d0bf47e0d5 Bootstrap encoder for documents 2021-11-22 09:05:15 +00:00
7758e1358d better 2021-11-22 09:47:02 +01:00
46a4afe1b3 Merge branch 'features/person-search-improve' into 'master'
refactor search for using search by pertinence

See merge request Chill-Projet/chill-bundles!224

# Description of changes

* remplacer le classement par ordre alphabétique par un classement par ordre de pertinence, qui tient compte:
  * de la présence d'une string avec le nom de la ville;
  * de la similarité;
  * du fait que la recherche commence par une partie du mot recherché
* ajouter la recherche par numéro de téléphone directement dans la barre de recherche et dans le formulaire recherche avancée;
* ajouter la recherche par date de naissance directement dans la barre de recherche;
* ajouter la recherche par ville dans la recherche avancée
* ajouter un lien vers le ménage dans les résultats de recherche
* ajouter l'id du parcours dans les résultats de recherche
* ajouter le demandeur dans les résultats de recherche
* ajout d'un bouton "recherche avancée" sur la page d'accueil
* inclure les droits de vendée dans la recherche par l'api

# Issues related

* https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/300
* https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/182
* https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/193
* https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/212
* https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/169
* https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/149
* https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/156

# Tests

* add tests for extracting phonenumber
* add tests for extracting dates
* test for search still exists
2021-11-22 08:28:22 +00:00
9fb29ec110 refactor search for using search by pertinence 2021-11-22 08:28:22 +00:00
f06f9c10ad update changelog 2021-11-22 09:17:11 +01:00
a8dbf8b986 fix view person_current_address: address must exists 2021-11-19 23:33:13 +01:00
2d536b8b53 fix bounds for view current person address 2021-11-19 23:15:41 +01:00
76179d389d carousel: fix error 2021-11-19 19:48:56 +01:00
da686ab3b5 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2021-11-19 18:25:58 +01:00
fec852b044 carousel: fix span household position 2021-11-19 18:25:07 +01:00
039483abf7 Merge branch 'issue304_validationOnOriginAccCourse' into 'master'
accompanying course: add client-side validation if no origin

See merge request Chill-Projet/chill-bundles!225
2021-11-19 17:09:05 +00:00
31ec155070 update changelog 2021-11-19 17:27:53 +01:00
89c2d74c33 Merge branch 'master' into 295_resume_retouches 2021-11-19 17:22:00 +01:00
af339aa7f0 accourse banner: use bootstrap carousel to display vue_accourse social-issues and associated-persons as slides 2021-11-19 17:16:16 +01:00
nobohan
264b902db5 upd CHANGELOG 2021-11-19 14:50:55 +01:00
nobohan
f1113ee448 accompanying course: add client-side validation if no origin 2021-11-19 14:48:31 +01:00
Pol Dellaiera
0a522b465f fix: Update typing information. 2021-11-19 12:32:21 +01:00
Pol Dellaiera
693b59c484 fix: Fix wrong repository. 2021-11-19 12:32:05 +01:00
Pol Dellaiera
5a6a15a351 fix: Add missing repository. 2021-11-19 12:31:48 +01:00
aba47600ff hop 2021-11-18 17:56:46 +01:00
a600196151 vue_accourse referrer: style for suggestions, add and remove items 2021-11-18 16:25:36 +01:00
193d0fb94a vue_activity: style for suggestions, add and remove items 2021-11-18 16:02:40 +01:00
c7ffb7062a improve resume course styles 2021-11-18 16:02:09 +01:00
Pol Dellaiera
d1935f96e7 fix: Add more typing informations. 2021-11-18 15:23:44 +01:00
Pol Dellaiera
17ef963924 fix: Fix wrong entity class and a few other fixes. 2021-11-18 15:15:51 +01:00
Pol Dellaiera
597a12b085 fix: Get rid of obsolete import. 2021-11-18 14:50:16 +01:00
Pol Dellaiera
56b15f26b2 fix: Get rid of a single PHPStan critical issue. 2021-11-18 14:47:58 +01:00
Pol Dellaiera
7a07b8bef7 fix: Autowire and autoconfigure the new service. 2021-11-18 14:45:32 +01:00
Pol Dellaiera
1509fcc2e9 fix: Fix tests. 2021-11-18 14:33:14 +01:00
Pol Dellaiera
7fd45d5735 fix: Remove deprecations. 2021-11-18 14:33:06 +01:00
Pol Dellaiera
ae79ebc299 fix: Strict type RoleScope. 2021-11-18 14:29:11 +01:00
Pol Dellaiera
162db60f59 fix: Fix FamilyMemberController and Repository. 2021-11-18 14:28:51 +01:00
Pol Dellaiera
dfc853a876 fix: Replace tabs with spaces. 2021-11-18 14:16:02 +01:00
Pol Dellaiera
674bf614dd fix: Add a deprecation and the new service that goes with it as replacement. 2021-11-18 14:15:51 +01:00
Pol Dellaiera
370a24d3f5 fix: Fix PHPStan issues. 2021-11-18 12:36:50 +01:00
Pol Dellaiera
1e05bd31d8 fix: Fix bug reported by the tests. 2021-11-18 12:18:16 +01:00
Pol Dellaiera
11ad94ee09 fix: Fix bug reported by the tests. 2021-11-18 12:17:04 +01:00
Pol Dellaiera
c1a4454a08 fix: Fix bug reported by the tests. 2021-11-18 12:10:54 +01:00
Pol Dellaiera
f9d36cc8a9 fix: Fix bug reported by the tests. 2021-11-18 12:03:49 +01:00
Pol Dellaiera
a32692c37a fix: RoleScope might or might not have a Scope. 2021-11-18 11:48:35 +01:00
Pol Dellaiera
6ccc8d4cb8 fix: Let Symfony inject dependencies automatically. 2021-11-18 11:46:30 +01:00
Pol Dellaiera
d9b862925f fix: Let Symfony inject dependencies automatically. 2021-11-18 11:41:41 +01:00
Pol Dellaiera
7dcf0f8dcf fix: Inject newly created repository instead of having to deal with the container definitions. 2021-11-18 11:41:41 +01:00
Pol Dellaiera
97ab71b63d fix: Add missing repositories, fix typing information, autoload Repository directory. 2021-11-18 11:41:40 +01:00
Pol Dellaiera
b722106616 fix: Use TranslatableStringHelperInterface. 2021-11-18 11:41:40 +01:00
Pol Dellaiera
cc9ce4167f fix: Upgrade TranslatableStringHelper service and create its interface. 2021-11-18 11:41:40 +01:00
Pol Dellaiera
9f06bc7126 fix: Autowire and autoconfigure services in chill_main.
This commit does not remove services that are not automatically PSR loaded.
2021-11-18 11:41:40 +01:00
78615519f4 select2 field added to task form 2021-11-18 09:34:52 +01:00
Pol Dellaiera
d1e1f7faa4 Revert "fix: Autowire and autoconfigure services in chill_main."
This reverts commit d7fbbbf92c.
2021-11-18 08:34:17 +01:00
Pol Dellaiera
d7fbbbf92c fix: Autowire and autoconfigure services in chill_main. 2021-11-17 20:31:35 +01:00
Pol Dellaiera
d830b19756 fix: Enforce (and document) the type of property. 2021-11-17 20:31:35 +01:00
2492a9281f improve household button in course participation 2021-11-17 16:06:55 +01:00
0e98010d0e #101 improve translations + hide title 2021-11-17 16:06:42 +01:00
1a04973072 visgraph: refresh after post/patch/delete request, fix missing key in POST body parameter 2021-11-17 12:20:43 +01:00
Pol Dellaiera
4f56bb2464 fix: Creation of entity in createEntity().
Issue introduced in 5432242376.
2021-11-17 11:58:15 +01:00
Pol Dellaiera
afa8d7cb72 fix: Creation of entity in createEntity().
Issue introduced in 5432242376.
2021-11-17 11:46:28 +01:00
5d74b3ab0a fix errors when clearing cache 2021-11-17 10:58:52 +01:00
Pol Dellaiera
7f02130ff2 fix: Return type of getAge().
Issue highlighted by c68bda5c9b.
2021-11-16 20:58:28 +01:00
Pol Dellaiera
5432242376 fix: SA: Fix many critical rules.
SA stands for Static Analysis.
2021-11-16 17:13:39 +01:00
Pol Dellaiera
db2010082a fix: SA: Fix "...Access to an undefined property..." rule.
SA stands for Static Analysis.
2021-11-16 16:37:45 +01:00
Pol Dellaiera
6cfcf91757 fix: Follow up f8aeb08594 and fix parameters type. 2021-11-16 16:28:20 +01:00
Pol Dellaiera
f11df95f59 fix: Follow up 8879734ea2 and fix service definition. 2021-11-16 15:46:33 +01:00
Pol Dellaiera
68a21fcc0a fix: SA: Fix "...Instantiated class not found..." rules.
SA stands for Static Analysis.
2021-11-16 15:34:12 +01:00
Pol Dellaiera
8879734ea2 fix: SA: Fix "...does not call parent constructor... and ...Access to an undefined property..." rules.
SA stands for Static Analysis.
2021-11-16 15:30:53 +01:00
Pol Dellaiera
a17c22c74f fix: SA: Fix "...does not call parent constructor...." rule.
SA stands for Static Analysis.
2021-11-16 15:27:46 +01:00
Pol Dellaiera
75d2d50dd2 fix: SA: Fix "...Variable in isset() is never defined...." rule.
SA stands for Static Analysis.
2021-11-16 15:25:48 +01:00
Pol Dellaiera
c94fb2efbf fix: SA: Fix "...variable always exists and is not falsy...." rule.
SA stands for Static Analysis.
2021-11-16 15:23:56 +01:00
Pol Dellaiera
11651fdb2a fix: SA: Fix "...does not call parent constructor...." rule.
SA stands for Static Analysis.
2021-11-16 15:21:26 +01:00
Pol Dellaiera
d382cf35ba fix: SA: Fix "...Variable in isset() is never defined...." rule.
SA stands for Static Analysis.
2021-11-16 15:18:59 +01:00
Pol Dellaiera
479f0ce9ed fix: SA: Fix "...does not match parent method..." rule.
SA stands for Static Analysis.
2021-11-16 15:17:29 +01:00
Pol Dellaiera
e2a8437807 fix: SA: Fix "...Short ternary operator..." rule.
SA stands for Static Analysis.
2021-11-16 15:14:43 +01:00
Pol Dellaiera
5a85d497ab fix: SA: Fix "...Switch condition type..." rule.
Also fix a critical bug in `ReportList.php`.

SA stands for Static Analysis.
2021-11-16 15:12:31 +01:00
Pol Dellaiera
7462babbeb fix: SA: Fix "...an unused use..." rule.
Also fix a critical bug in `ListPerson.php`.

SA stands for Static Analysis.
2021-11-16 15:06:43 +01:00
Pol Dellaiera
8bebe1f904 fix: SA: Split configurations across multiple files.
SA stands for Static Analysis.
2021-11-16 14:49:42 +01:00
Pol Dellaiera
8ede116cf5 fix: SA: Split critical issues in its own file.
SA stands for Static Analysis.
2021-11-16 14:06:24 +01:00
Pol Dellaiera
c68bda5c9b fix: SA: Fix "...invoked with..." rule.
SA stands for Static Analysis.
2021-11-16 12:16:02 +01:00
Pol Dellaiera
a3eb23478a fix: SA: Fix "Call to sprintf" rule.
SA stands for Static Analysis.
2021-11-16 11:52:52 +01:00
Pol Dellaiera
f8aeb08594 fix: SA: Fix "might not be defined" rule.
SA stands for Static Analysis.
2021-11-16 11:41:12 +01:00
Pol Dellaiera
a7b96f1756 fix: SA: Fix "incorrect case" rule.
SA stands for Static Analysis.
2021-11-16 10:29:41 +01:00
196cddab09 Merge remote-tracking branch 'origin/master' into issue185_ACCent_createdBy_updatedBy 2021-11-15 14:14:12 +01:00
4a15022375 update change log 2021-11-15 13:15:32 +01:00
5fb7a6d0ae take into account form_show_centers parameters into thirdparty form type 2021-11-15 13:15:32 +01:00
77add46a70 take parameter form_show_center into account: not to ask center on person creation 2021-11-15 13:15:32 +01:00
b217fb3c39 create option config for asking (or not) center in form 2021-11-15 13:15:31 +01:00
e2d4d9c831 remove use statement 2021-11-15 13:07:44 +01:00
93e75161fc Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2021-11-15 13:05:59 +01:00
5ee67f74d9 remove toast imports for vue 2021-11-15 13:05:27 +01:00
9b03f8130b Merge remote-tracking branch 'origin/issue289_person_extraPhoneNumbers' 2021-11-15 12:30:52 +01:00
6c51d6de51 remove unnecessary space (minor, [ci-skip]) 2021-11-15 12:28:48 +01:00
0aef40f23f Merge remote-tracking branch 'origin/issue267_filter_household_of_the_person' 2021-11-15 12:24:21 +01:00
a1125cfd3a Merge branch 'fix_add_multiple_pick_address_type_in_collection' into 'master'
fix when adding multiple pick address type form in a collection

See merge request Chill-Projet/chill-bundles!216
2021-11-15 11:23:05 +00:00
9816ac8ad7 Merge branch 'master' into 'issue289_person_extraPhoneNumbers'
# Conflicts:
#   CHANGELOG.md
2021-11-15 11:22:17 +00:00
87c83dd7a0 Merge branch 'features/search-person-acl-ordering' into 'master'
add base authorization to person search + improve search ordering + fix testes

See merge request Chill-Projet/chill-bundles!217
2021-11-15 11:17:03 +00:00
8296d60cb6 add base authorization to person search + improve search ordering 2021-11-15 11:17:03 +00:00
nobohan
bfc25c50b9 upd CHANGELOG 2021-11-15 12:03:31 +01:00
nobohan
3417aa8207 person: do not suggest the current household of the person 2021-11-15 12:00:42 +01:00
4ba93bb709 failed job personControllerUpdateTest fixed 2021-11-15 11:56:29 +01:00
bf0ad88cf0 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2021-11-15 10:22:18 +01:00
b07188eaaf changelog updated 2021-11-15 10:21:57 +01:00
5651efe44d fix phpstan errors 2021-11-13 11:42:26 +01:00
52dc89c06f Merge branch 'master' into household_filiation 2021-11-12 17:20:46 +01:00
fa7409bdf8 visgraph: export canvas as image 2021-11-12 16:58:08 +01:00
nobohan
e413a09a0f upd CHANGELOG 2021-11-12 16:05:47 +01:00
nobohan
a04c499af0 fix when adding multiple pick address type form in a collection 2021-11-12 16:01:03 +01:00
dcf5f1ed66 Merge branch 'issue162_ACCent_display_addresses' into 'master'
Display of incomplete address

See merge request Chill-Projet/chill-bundles!210
2021-11-12 12:15:03 +00:00
6dd74287a8 Merge remote-tracking branch 'origin/master' into issue162_ACCent_display_addresses 2021-11-12 13:14:04 +01:00
2b0093a351 fix typo 2021-11-12 12:08:48 +00:00
e905465e1b Merge branch 'accourse_validation' into 'master'
add validation to accompanying periods

See merge request Chill-Projet/chill-bundles!183
2021-11-12 12:07:31 +00:00
c8135e0741 add validation to accompanying periods 2021-11-12 12:07:31 +00:00
831b4f354c Merge branch 'deleteAccompanyingPeriodWork_234' into 'master'
Delete AccompanyingPeriodWork

See merge request Chill-Projet/chill-bundles!199
2021-11-12 12:06:43 +00:00
7482c709b3 Merge branch 'master' into 'deleteAccompanyingPeriodWork_234'
# Conflicts:
#   CHANGELOG.md
2021-11-12 12:06:34 +00:00
22bdf35eb0 minor fixes 2021-11-12 12:05:16 +00:00
a2e9e4cf6a Merge branch 'userInAddPerson_278' into 'master'
person: user in the modal 'search person'

See merge request Chill-Projet/chill-bundles!198
2021-11-12 11:59:03 +00:00
nobohan
28afe5228a upd CHANGELOG 2021-11-12 12:14:55 +01:00
nobohan
fcbf1bd558 accompanying course work: missing translation in App.vue 2021-11-12 12:10:27 +01:00
nobohan
32c2d96ab6 accompanying course work: add cascade remove on delete Accompanying Period Work 2021-11-12 12:02:45 +01:00
nobohan
eedf5f25bd accompanying course work: translation 2021-11-12 12:00:39 +01:00
nobohan
a7dd15a411 upd CHANGELOG 2021-11-12 11:09:02 +01:00
nobohan
24be9dbe09 person: display other phone numbers in view + translations + add message in case no others phone numbers 2021-11-12 11:05:56 +01:00
39ab7057ce Update CHANGELOG.md 2021-11-12 09:29:37 +00:00
96b44ede3c information about creation and update displayed on person detail page. Vendee person and mineur still to do 2021-11-11 16:56:26 +01:00
5606b714cd changelog updated 2021-11-11 13:38:32 +01:00
f92c500657 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2021-11-11 13:37:11 +01:00
1146bd666f unnecessary whitespace removed from person banner after person-id + double parentheses removed 2021-11-11 13:36:49 +01:00
95610ffd34 visgraph: improve update graph mechanism
adding an updateHack in store, and a watcher in component.
* updateHack increment a value in the lpop,
* the watcher detect when value changes
* and $forceUpdate

improve layer checkbox legend refresh and rebuild
2021-11-10 20:09:18 +01:00
7230fd9c07 minor changes, and cleaning code 2021-11-10 15:13:23 +01:00
7dc9021eca visgraph: no more need for tiny emitter. remove it 2021-11-10 11:35:19 +01:00
a63e1321b0 cleaning 2021-11-09 22:48:29 +01:00
bfca6d2afc cleaning 2021-11-09 20:06:54 +01:00
b392bc9e65 visgraph: post, patch and delete relationship link works! 2021-11-09 20:00:19 +01:00
d6da6a5d9d visgraph: trying to pass value to edit relationship form fields (wip) 2021-11-09 20:00:09 +01:00
e7fcebc99e add some method for resolving scope in twig 2021-11-09 17:04:49 +01:00
7574b5bfac doc for authorization 2021-11-09 17:04:32 +01:00
Pol Dellaiera
5e5dcaefe7 Fix implicit variable creation. 2021-11-09 16:22:16 +01:00
nobohan
e6a9701418 upd CHANGELOG 2021-11-09 16:14:25 +01:00
nobohan
66a2009aea person search: translation User + show User in concernedGroups 2021-11-09 16:07:11 +01:00
Pol Dellaiera
a1b381a3ea Fix bug and remove obsolete issue. 2021-11-09 15:20:25 +01:00
Pol Dellaiera
5615734123 Update baseline - remove obsolete errors. 2021-11-09 15:17:55 +01:00
Pol Dellaiera
2eb30d2ae8 Fix issues reported by PHPStan. 2021-11-09 15:17:24 +01:00
Pol Dellaiera
48ea67968e Update PHPStan configuration.
Update paths - add paths to ignore.
2021-11-09 15:16:06 +01:00
nobohan
c8b0d62d46 person: display user in the modal 'search person' 2021-11-09 14:21:39 +01:00
Pol Dellaiera
9fc397f048 Fix PHPStan un-ignorable issues. 2021-11-09 13:51:25 +01:00
Pol Dellaiera
a19a5803e8 Update baseline - add new errors. 2021-11-09 13:49:08 +01:00
Pol Dellaiera
bf155f6967 Update PHPStan configuration.
Update paths - simplify.
2021-11-09 13:48:15 +01:00
Pol Dellaiera
6a9e133256 Add phpstan/extension-installer. 2021-11-09 13:39:24 +01:00
Pol Dellaiera
fb4b586cf0 Update baseline - add new errors. 2021-11-09 13:37:01 +01:00
Pol Dellaiera
6b60c46ad3 Update baseline - remove ignored errors. 2021-11-09 13:36:09 +01:00
Pol Dellaiera
774b5b69d9 Enable phpstan/phpstan-strict-rules. 2021-11-09 13:35:44 +01:00
2382e7f44b Merge branch 'feat/add-phpstan-configuration-and-baseline' into 'master'
Add PHPStan project with level 1.

This PR: Add basic configuration files with basic baseline.


See merge request Chill-Projet/chill-bundles!191
2021-11-09 11:31:21 +00:00
Pol Dellaiera
e2ab3bfc6e Add PHPStan project with level 1. 2021-11-09 11:31:20 +00:00
16512a1ca1 changelog updated 2021-11-09 11:44:36 +01:00
a373142827 display of incomplete address changed 2021-11-09 11:38:20 +01:00
46e552d034 DELETE endpoint added 2021-11-09 10:58:08 +01:00
b2d6c82cbe update changelog with last release 2021-11-09 09:39:05 +01:00
nobohan
66c5c4c1d6 accompanying period work: translate flash message 2021-11-08 15:52:24 +01:00
9247cd3546 fix saving person 2021-11-08 15:31:19 +01:00
nobohan
70524c506d accompanying period work: add content to the delete page 2021-11-08 15:17:16 +01:00
nobohan
b4d21c23b2 accompanying period work: add logger interface 2021-11-08 14:50:15 +01:00
nobohan
d94c367e3d accompanying period work: can delete the work 2021-11-08 14:47:50 +01:00
nobohan
6afd8ae3cd accompanying period work: add delete twig 2021-11-08 13:52:23 +01:00
nobohan
e195434bf4 accompanyingPeriodWork: add action in controller 2021-11-08 13:52:23 +01:00
nobohan
0299500cad accompanyingPeriodWork: replace 'spinner' by a real spinner 2021-11-08 13:52:23 +01:00
nobohan
952435b36f Activity: correct accompanying_period_id param in twig 2021-11-08 13:52:22 +01:00
ec6828f128 Merge branch 'features/person-normalization-resolver-center-dynamically' into 'master'
Use centerResolverDispatcher to normalize a person's center


# Description of changes

There is a normalizer for a person, which include a property "center":

```json
{

    "type": "person",
    "id": 4362539,
    "text": "Diakite BAH",
    "firstName": "Diakite",
    "lastName": "BAH",
    "center": {
        "id": 475,
        "type": "center",
        "name": "Nord Vendée"
    },
    "phonenumber": "",
    "mobilenumber": "",
    "altNames": [ ],
    "gender": "woman",
    "gender_numeric": 1,
    // ...
}
```

Previously, the center was the center attached to the person in the database.

But since September, version 2.0 allow to resolve the center dynamically, for instance with the usage of address. This resolution is done through `CenterResolverDispatcher`.

This `CenterResolverDispatcher` is now used into person normalization.

As a consequence, the center may now be:

* null;
* a center;
* an array of center;

Thoses case are taken into account into `PersonRenderBox` in Vue.



# Issues related

Any issue related.

# Tests

Any new tests.

See merge request Chill-Projet/chill-bundles!205
2021-11-08 12:22:11 +00:00
7399d0aa9e Use centerResolverDispatcher to normalize a person's center 2021-11-08 12:22:11 +00:00
19b469259d Merge branch 'bugfix/acl-add-roles-misc-places' into 'master'
Add voter to various places

See merge request Chill-Projet/chill-bundles!207
2021-11-08 12:21:15 +00:00
5c037ca18f Merge branch 'master' into 'bugfix/acl-add-roles-misc-places' [ci-skip]
# Conflicts:
#   CHANGELOG.md
2021-11-08 12:20:26 +00:00
nobohan
c979de962e fix conflict in CHANGELOG 2021-11-08 12:41:11 +01:00
nobohan
061197e52e upd CHANGELOG 2021-11-08 12:21:06 +01:00
e786c40679 Merge branch 'issue124_ACCent_ménage_editForm' into 'master'
Household edit: end date field deleted


# Description of changes

End date field removed from household edit form.


# Issues related

* internal: https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/265
* ACCent: https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/124

# Tests

No tests

See merge request Chill-Projet/chill-bundles!202
2021-11-08 11:03:38 +00:00
e4f8ada236 Household edit: end date field deleted 2021-11-08 11:03:37 +00:00
21e419b338 Merge branch 'issue126_household_list' into 'master'
household list of accompanying periods + upgrade DBAL version to 3.1


# Description of changes

* Household: List of accompanying periods shows all periods linked to current household members for which viewing access is granted to current user.
* Upgrade DBAL to 3.1


# Issues related

* inernal: https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/274
* ACCent: https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/126

# Tests

Not yet written

See merge request Chill-Projet/chill-bundles!204
2021-11-08 10:57:14 +00:00
7fabe0214e household list of accompanying periods + upgrade DBAL version to 3.1 2021-11-08 10:57:14 +00:00
nobohan
fa05a6856a person: add civility: entity, migration, form, twig, config 2021-11-08 11:41:45 +01:00
nobohan
1dbf29beea person: avoid js error when personAcceptEmail is null 2021-11-08 11:04:20 +01:00
nobohan
bddcdd7de2 person: add preferrred_choices for countries and languages 2021-11-08 10:42:12 +01:00
2c0198ef78 listen on relationship nodes event (wip) 2021-11-05 20:34:59 +01:00
e55e8e072d visgraph: prepare UI for add relationship link 2021-11-05 19:37:59 +01:00
f92b4b0ea3 visgraph, fix details 2021-11-05 17:50:19 +01:00
b904e33d9b Merge branch 'household_filiation' of gitlab.com:Chill-Projet/chill-bundles into household_filiation 2021-11-05 17:18:55 +01:00
f064e8f307 method added to get current accompanying periods + api adjusted 2021-11-05 17:00:07 +01:00
e911dd30f5 cleaning store 2021-11-05 16:16:24 +01:00
092ea4d57f Merge branch 'bugfix/activity-fix-role-inheritance' into 'master'
Bugfix/activity fix role inheritance


# Description of changes

* fix the inheritance of the role "ACTIVITY_FULL"
* add missing ACL in menu


# Issues related

* https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/163

# Tests

Any new tests

See merge request Chill-Projet/chill-bundles!206
2021-11-05 14:13:00 +00:00
f16f45f3f3 Bugfix/activity fix role inheritance 2021-11-05 14:13:00 +00:00
bfcd420cdf visgraph: improve nodes that are hidden when uncheck layer
- a new getter count links by node. before exclude person, check first if node has others visible links
- links id are rewrote to serve count links getter
- unfold and expand only folded person
2021-11-05 14:41:45 +01:00
9494bdee2a visgraph: improve splitId(node_id,'id') : return always integer
node_id value examples:
* 'accompanying_period_124' --> 124
* '124' --> 124
* 124 --> 124
2021-11-05 14:41:45 +01:00
0f8ca77105 visgraph: refactor store excludedNode action 2021-11-05 14:41:45 +01:00
9a00e13532 visgraph: adding node whitelist 2021-11-05 14:41:45 +01:00
1a00798da0 visgraph: canvas options, maximize position 2021-11-05 14:41:45 +01:00
5e2b70249e cleaning 2021-11-05 14:41:45 +01:00
55c2aed613 visgraph: fix algo problems when expanding graph 2021-11-05 14:41:45 +01:00
19badc0062 visgraph: try to remove folded person nodes when layer is unchecked (wip) 2021-11-05 14:41:35 +01:00
5ce2fe3295 Merge branch 'feature/suivi-157-affiche-alt-names-list-with-periods' into 'master'
Show alt names in person search results


# Description of changes

* Ajoute l'adresse actuelle de la personne dans les résultats de recherche;
* affiche les altNames dansl es réslttats de recherche



# Issues related


* https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/157

# Tests

Some tests, which were related to the old way on person address was computed, where removed.

See merge request Chill-Projet/chill-bundles!195
2021-11-05 12:52:31 +00:00
5111a0ff6a Show alt names in person search results 2021-11-05 12:52:31 +00:00
74df496e38 Merge branch 'issue47_ACCent_householdAddress_ordering' into 'master'
Ordering household addresses


# Description of changes

Ordering by id added so that last created address displays first.


# Issues related

* internal: https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/275
* ACCent: https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/47

# Tests

No tests written.

See merge request Chill-Projet/chill-bundles!203
2021-11-05 12:34:35 +00:00
fd2d74c9f5 Ordering household addresses 2021-11-05 12:34:35 +00:00
b615f0c79f Merge branch 'issue73_ACCent_displayOf_problématiques' into 'master'
Display of social issues with parent issue and with badge


# Description of changes

For social work action: social issues are displayed with their parent issue.
Banner was fixed so that it contains all the context info.


# Issues related

* internal: https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/277
* ACCent: https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/73

# Tests

No tests.

See merge request Chill-Projet/chill-bundles!201
2021-11-05 12:33:10 +00:00
97859e9c1f Display of social issues with parent issue and with badge 2021-11-05 12:33:10 +00:00
6642b87168 Merge branch 'bugfixes/tasks-list' into 'master'
Bugfixes/tasks list


# Description of changes

<!--
  describe here the change of your MR. It can be either a text, or a bullet list
  for changes
-->

* different title for task list and my title
* fixes link to tasks in alert


# Issues related

<!--
  list the issues related to this MR.

  It may be client issues, or dev issues
-->

no issues related

# Tests

The tests for listing task does apply

See merge request Chill-Projet/chill-bundles!200
2021-11-05 12:31:41 +00:00
35d807cab0 Bugfixes/tasks list 2021-11-05 12:31:41 +00:00
e1677cd2b6 Merge branch 'feature/household-accept-members-without-position' into 'master'
An household can have members without position

See merge request Chill-Projet/chill-bundles!189
2021-11-05 09:26:16 +00:00
df0cb8596b update changelog [ci-skip] 2021-11-04 23:43:24 +01:00
250bd29ab3 add voter for documents 2021-11-04 23:40:30 +01:00
nobohan
8de78c7584 person: add prefered_choices for language (WIP) 2021-11-04 16:20:08 +01:00
nobohan
84ab4f8d1f person: add the possibility of form data is null on CommentType 2021-11-04 15:56:15 +01:00
261810374f Merge branch 'issue83_ACCent_addDocument_toAction' into 'master'
cascade persist added to Activity::documents

See merge request Chill-Projet/chill-bundles!197
2021-11-04 11:44:57 +00:00
8f541c8418 Merge branch 'master' into 'issue83_ACCent_addDocument_toAction'
# Conflicts:
#   CHANGELOG.md
2021-11-04 11:40:56 +00:00
b69cee84b6 Update CHANGELOG.md 2021-11-04 09:12:06 +00:00
b7e0753dbf changelog fixed 2021-11-04 10:09:08 +01:00
9c57d21e5a Merge branch 'issue153_ACCent_activity_admin' into 'master'
Issue153_accent_activity_admin

See merge request Chill-Projet/chill-bundles!193
2021-11-04 08:57:13 +00:00
c03b925bd9 Merge branch 'master' into 'issue153_ACCent_activity_admin'
# Conflicts:
#   CHANGELOG.md
#   src/Bundle/ChillCalendarBundle/Menu/UserMenuBuilder.php
2021-11-04 08:52:32 +00:00
6fdbefa4c8 changelog updated and comments removed 2021-11-04 09:50:25 +01:00
13b43ace39 update of changelog.md 2021-11-04 09:45:35 +01:00
5d7f4bde1d minor stuffs 2021-11-03 21:17:25 +01:00
40c5322cba visgraph: an event trigger unfoldPersonsByCourse (store) 2021-11-03 21:15:37 +01:00
8ab0fd59f8 visgraph: add basic graph event mechanism when clicking on nodes 2021-11-03 21:12:42 +01:00
aa9926aa29 translations 2021-11-03 16:56:11 +01:00
adac384279 visgraph: prepare PATCH relationship when submitting (wip) 2021-11-03 16:49:07 +01:00
2099edefc5 visgraph: fix error with GET relations response 2021-11-03 16:45:37 +01:00
12c3bfa578 Merge branch 'improve_localisation_271' 2021-11-03 16:18:53 +01:00
nobohan
52778a7051 upd CHANGELOG 2021-11-03 16:17:33 +01:00
nobohan
a768563cd0 location: display the error message in case of wrong phone number or email 2021-11-03 16:16:51 +01:00
nobohan
4011fc6e77 location: client side validation 2021-11-03 16:16:51 +01:00
nobohan
51938a99db location: allow null value for location in Calendar 2021-11-03 16:16:51 +01:00
nobohan
c1f4e77293 location: allow null value for location in Activity 2021-11-03 16:16:51 +01:00
nobohan
bfb219746a location: client-side form validation 2021-11-03 16:16:51 +01:00
nobohan
4e72bdead5 location: code refactoring: move saveNewLocation + order of fields 2021-11-03 16:16:51 +01:00
nobohan
e52880bb53 location: filter location-type by active and availableForUsers 2021-11-03 16:16:51 +01:00
nobohan
0439e6a821 location: filter location endpoint by NULL names 2021-11-03 16:16:51 +01:00
72337a8fba Merge branch 'issue74_ACCent_rename_evaluations' into 'master'
section title evaluations changed for accompanyingcoursework edit

See merge request Chill-Projet/chill-bundles!196
2021-11-03 15:16:01 +00:00
e2110691ff Merge branch 'household_filiation' of gitlab.com:Chill-Projet/chill-bundles into household_filiation 2021-11-03 16:11:05 +01:00
645603a98f Merge branch 'master' into improve_localisation_271 2021-11-03 16:09:53 +01:00
cab7cc4150 PATCH added to swagger 2021-11-03 16:04:35 +01:00
c6d7de3e58 Merge branch 'bugfix/authorization-helper-fix-constructor' into 'master'
authorization helper: fix consructor

See merge request Chill-Projet/chill-bundles!194
2021-11-03 14:59:08 +00:00
6c52233a5a visgraph: with reversed relationship, reverse arrow and not title 2021-11-03 15:56:25 +01:00
8c5bf6786b increase memory on gitlab-ci operations 2021-11-03 15:46:00 +01:00
58f7715643 visgraph: fix logic error with relationship direction 2021-11-03 15:43:44 +01:00
7c5d0fce51 update changelog 2021-11-03 15:36:06 +01:00
35154f5ae1 fix constructor into acl aware repository 2021-11-03 15:35:38 +01:00
6911ace412 Refactor authorization helper to separate some methods
Methods regarding to role hierarchi are now delegated to a parent role helper.
2021-11-03 15:35:38 +01:00
87e16ec24f authorization helper: fix consructor 2021-11-03 15:35:38 +01:00
765a450bb9 update changelog with issues into vendee changelog 2021-11-03 15:33:31 +01:00
nobohan
93880f7010 upd CHANGELOG 2021-11-03 14:55:33 +01:00
e7900b8b21 visgraph: fix POST response (create link) 2021-11-03 14:54:27 +01:00
nobohan
0231433a6c location: display the error message in case of wrong phone number or email 2021-11-03 14:45:15 +01:00
4d08f3583e Merge branch 'household_filiation' of gitlab.com:Chill-Projet/chill-bundles into household_filiation 2021-11-03 14:29:39 +01:00
b2fe024534 Code that causes error commented: UserMenuBuilder.php 2021-11-03 13:27:32 +00:00
39e0e01eb8 cascade persist added to Activity::documents 2021-11-03 14:15:48 +01:00
nobohan
2aa588037a location: client side validation 2021-11-03 13:51:15 +01:00
nobohan
addb362478 location: allow null value for location in Calendar 2021-11-03 13:43:34 +01:00
nobohan
819fc8af46 location: allow null value for location in Activity 2021-11-03 13:42:35 +01:00
4dbbc40473 Merge branch 'household_filiation' of gitlab.com:Chill-Projet/chill-bundles into household_filiation 2021-11-03 12:52:41 +01:00
577ed7b6be GET relations adapted, POST fixed 2021-11-03 12:52:21 +01:00
2d3549ee28 visgraph: give more space to graph in twig content 2021-11-03 12:39:47 +01:00
6e3cdb6f58 visgraph, disable action callback on nodes 2021-11-03 12:13:06 +01:00
e7ad96aaf7 Add a template for merge request [ci-skip] 2021-11-03 12:02:09 +01:00
nobohan
f4bd55262a location: client-side form validation 2021-11-03 11:59:06 +01:00
eebff23282 section title evaluations changed for accompanyingcoursework edit 2021-11-03 11:49:31 +01:00
2d33ae26d8 Merge branch '106_tasks_to_parcours' 2021-11-03 11:45:40 +01:00
7a384f9657 Separate cache:clear from doctrine:fixtures:load in ci
This is an attempt to fix the bug which replace references by NULL
values
2021-11-03 11:43:57 +01:00
nobohan
c8bc6ac495 location: code refactoring: move saveNewLocation + order of fields 2021-11-03 11:34:52 +01:00
7d91f3bef5 complete relations fixtures 2021-11-03 11:30:36 +01:00
b0471c4851 translation fixes for aside activities 2021-11-03 10:56:28 +01:00
6d248ab47b Activity link added to admin homepage 2021-11-03 10:55:51 +01:00
nobohan
999658e792 location: filter location-type by active and availableForUsers 2021-11-03 10:27:58 +01:00
nobohan
1646740382 location: filter location endpoint by NULL names 2021-11-03 09:59:40 +01:00
71695ed793 updating changelog 2021-11-03 09:31:49 +01:00
6d5f94ab45 Merge branch 'household_filiation' of gitlab.com:Chill-Projet/chill-bundles into household_filiation 2021-11-03 09:28:36 +01:00
9e61c417e5 visgraph: improve relationship form UI, change physics solver, disable node edition 2021-11-03 09:20:27 +01:00
e62d026339 visgraph form: other way to display relation 2021-11-02 18:58:25 +01:00
9cffe5161a visgraph: test form without vis-network 2021-11-02 18:45:15 +01:00
cbb3ad04f0 visgraph: right align text when reverse 2021-11-02 16:39:34 +01:00
6b31bf225a visgraph: fix body in POST relationship query 2021-11-02 16:34:01 +01:00
024531fbe1 visgraph: build modal form to create/edit relationship 2021-11-02 15:39:22 +01:00
bd2ee9ddc1 visgraph: adding endpoint to get list of relations 2021-11-02 10:21:06 +01:00
84dfcb2899 tests for GET and POST: attempt 2021-11-01 16:01:21 +01:00
1d774b19e8 datafixture relationship: attempt 2021-11-01 16:00:48 +01:00
d06a4b1ca9 import multiselect (wip) 2021-11-01 15:37:32 +01:00
9cce62c294 visgraph: pass context to modals 2021-11-01 15:36:57 +01:00
d3a08149f0 visgraph: open vue modal when adding/editing edge 2021-11-01 13:31:58 +01:00
5d995115ba visgraph: only addEdge for person to person 2021-11-01 12:59:02 +01:00
41f815bbb9 tiny-emitter package is used as "centralized event hub" between vis-network and vue3 2021-11-01 11:50:36 +01:00
a0940a0c85 visgraph: init window.eventHub as external emitter called in Vue. This implementation works with vue2, but is deprecated in vue3 !!
see https://vue3-fr.netlify.app/guide/migration/events-api.html#_2-x-syntax
2021-11-01 11:48:26 +01:00
c4ba78d076 minor 2021-11-01 10:50:13 +01:00
869e442c2c visgraph: add hover interaction 2021-11-01 09:49:55 +01:00
94e84fbdf0 Merge branch 'blur_confidential_info' into 'master'
Blur confidential info

See merge request Chill-Projet/chill-bundles!172
2021-10-30 00:22:41 +00:00
20cebfc517 Merge branch '129_ACCent_gender_display' into 'master'
129_accent_gender_display

See merge request Chill-Projet/chill-bundles!187
2021-10-30 00:22:05 +00:00
e9d20a56ff show members without position in list 2021-10-30 02:08:31 +02:00
a57a23dc49 visgraph options settings 2021-10-30 01:51:02 +02:00
576ee49da0 update changelog 2021-10-30 01:08:52 +02:00
8214fec217 Merge remote-tracking branch 'origin/master' into 106_tasks_to_parcours 2021-10-30 01:08:05 +02:00
e0cb5a88bd rewrite task list action 2021-10-30 00:41:28 +02:00
c63b1015e1 add indexes for searching task by end date 2021-10-30 00:40:15 +02:00
851a246257 visgraph: improve label with basic markdown 2021-10-30 00:27:10 +02:00
35a27de216 update jsonb exists method by using question mark escaping 2021-10-30 00:25:25 +02:00
09903c2f52 click node event (wip) 2021-10-29 19:08:52 +02:00
6719548504 Merge branch 'household_filiation' of gitlab.com:Chill-Projet/chill-bundles into household_filiation 2021-10-29 18:14:02 +02:00
8312955391 visgraph: hide somes persons nodes labels (folded) 2021-10-29 17:54:28 +02:00
8eedee5e91 visgraph: default uncheck layers when loading 2021-10-29 16:54:22 +02:00
4dc29435dc changelog entries removed... moved to changelog at root 2021-10-29 16:31:22 +02:00
db15a3d53c adapta list of tasks for a person 2021-10-29 16:26:19 +02:00
b60b1cb668 Merge branch 'household_filiation' of gitlab.com:Chill-Projet/chill-bundles into household_filiation 2021-10-29 15:57:06 +02:00
e6183f6646 migration fixed to insert default true value for isActive 2021-10-29 15:56:57 +02:00
a9d3d2027b minor 2021-10-29 15:32:12 +02:00
80594ed186 Merge branch 'household_filiation' of gitlab.com:Chill-Projet/chill-bundles into household_filiation 2021-10-29 15:05:51 +02:00
1c60a5b51e vue_visgraph: improve graph 2021-10-29 15:05:34 +02:00
039c74a1e4 route annotation removed 2021-10-29 13:20:56 +02:00
059a0b075c review processed 2021-10-29 12:50:01 +02:00
50fbc7fd15 processing of review. still ACL left to do 2021-10-29 11:30:01 +02:00
1155555bb3 backend: adapt deprecated getGenderNumeric 2021-10-29 10:37:51 +02:00
76d6a9b4df vue_visgraph: makeFetch (api), add validation exception 2021-10-29 10:01:14 +02:00
e1d28289f6 Merge branch 'household_filiation' of gitlab.com:Chill-Projet/chill-bundles into household_filiation 2021-10-29 09:39:25 +02:00
3a7af94058 GET and POST both working. 2021-10-29 09:29:27 +02:00
998295dc5f vue_visgraph improve (physics, corrections) 2021-10-28 15:47:40 +02:00
4017f8db48 refactor list by course: use acl aware repository 2021-10-28 14:41:19 +02:00
317ba0a095 vue_visgraph: store missing persons from courses, household and relationship 2021-10-28 12:11:51 +02:00
nobohan
046f65f5ff person: re-add accpet email and add possibility of hidding this field 2021-10-28 09:45:27 +02:00
27db6ddf0c Merge branch 'fix_double_search_button' into 'master'
Fix double search button

See merge request Chill-Projet/chill-bundles!188
2021-10-28 07:03:50 +00:00
nobohan
c90f9ee5bc add mod_input_address_index to collection event: better addition of the event listener to the DOM 2021-10-28 08:07:01 +02:00
nobohan
0bc8986aa7 upd CHANGELOG for fix_double_search_button 2021-10-28 07:42:08 +02:00
nobohan
56019cad99 delete double actions buttons on search person page 2021-10-28 07:40:03 +02:00
4da32dc5ca fix filtering of new tasks 2021-10-28 01:05:36 +02:00
e63d645f8a fix return path in tasks 2021-10-28 00:50:18 +02:00
97dbc4bc16 add more filtering possibilities with order helper 2021-10-28 00:11:05 +02:00
69e3a0a6cd Merge branch 'household_filiation' of gitlab.com:Chill-Projet/chill-bundles into household_filiation 2021-10-27 19:56:28 +02:00
92c1bf15cc vue_visgraph: add relationship links with relations 2021-10-27 19:55:24 +02:00
f834bb3bd6 backend normalizer: add id to relationship endpoint 2021-10-27 19:54:28 +02:00
2cb1ad6afc improve household position fixture 2021-10-27 18:11:14 +02:00
83e8b117db start of Relationship fixture 2021-10-27 18:10:35 +02:00
6752a2f6d3 fixture created for Relation entity 2021-10-27 17:40:15 +02:00
1d1a54f653 vue_visgraph: improve household links (edges) 2021-10-27 17:31:04 +02:00
2bbc6bd158 Merge remote-tracking branch 'origin/improve_location' 2021-10-27 16:50:17 +02:00
aea5e9b1d7 Merge remote-tracking branch 'origin/improve_location' into 106_tasks_to_parcours 2021-10-27 16:49:34 +02:00
8ff581d5fa vue_visgraph: add links array state in store 2021-10-27 16:40:01 +02:00
7ad0e2f2c8 rename fetch api method 2021-10-27 16:39:24 +02:00
a3b203c306 fix backend error with AccompanyingCourse endpoints 2021-10-27 16:39:16 +02:00
4287ca37ae changelog note added 2021-10-27 15:28:54 +02:00
07ed6b0fdf no gender defined -> no icon displayed 2021-10-27 15:26:27 +02:00
c200e9909e i18n minor changes 2021-10-27 15:16:13 +02:00
8e0a22974b Merge remote-tracking branch 'origin/master' into 106_tasks_to_parcours 2021-10-27 13:45:02 +02:00
b4b661882a remove dump 2021-10-27 13:40:55 +02:00
f4fb375fd1 add filtering in task list 2021-10-27 13:32:52 +02:00
691c5ffd21 improve filter order by adding checkboxes 2021-10-27 13:32:33 +02:00
a09c824726 changelogs: info added 2021-10-27 13:09:41 +02:00
59118c8eed Merge branch 'issue88_rename_field' into 'master'
field label for duration of activity

See merge request Chill-Projet/chill-bundles!178
2021-10-27 10:18:00 +00:00
c4c75199d6 Merge branch 'fix_display_dates' into 'master'
Correct formatting of birth- and deathdate

See merge request Chill-Projet/chill-bundles!185
2021-10-27 10:17:16 +00:00
333a4d94b2 layout task list 2021-10-27 11:57:51 +02:00
326fe5f50b vue_visgraph: cleaning + i18n 2021-10-27 11:53:34 +02:00
2a86fd12d7 vue_visgraph: add checkbox legend to enable/disable layers 2021-10-27 11:40:15 +02:00
3f869e9ca5 further implementation in vue elements 2021-10-27 11:14:27 +02:00
5cf94a5ed6 implementation of blur effect for list of thirdparties 2021-10-27 09:41:44 +02:00
ccf6c7ad91 Merge branch 'household_filiation' of gitlab.com:Chill-Projet/chill-bundles into household_filiation 2021-10-27 08:55:51 +02:00
965ea528e3 adaptations for acl with tasks 2021-10-26 18:05:06 +02:00
6921817853 Merge branch 'fix/accompanying_period-work-creation-date' into 'master'
accompanying course work: remove display of creation date

See merge request Chill-Projet/chill-bundles!186
2021-10-26 15:56:53 +00:00
nobohan
532efb1787 accompanying course work: changelog 2021-10-26 17:17:04 +02:00
nobohan
0fa3ff4c16 accompanying course work: handle case end date is null 2021-10-26 17:13:41 +02:00
nobohan
d2eb7b471e accompanying course work: remove display of creation date 2021-10-26 16:24:45 +02:00
a20eeb6a34 vue_visgraph: add a mechanism to force update component
cfr. https://medium.com/emblatech/ways-to-force-vue-to-re-render-a-component-df866fbacf47
2021-10-26 15:18:53 +02:00
9609fcb5d3 visgraph: edit interface fr translations 2021-10-26 14:53:42 +02:00
b6dd5e92fc Merge branch 'household_filiation' of gitlab.com:Chill-Projet/chill-bundles into household_filiation 2021-10-26 14:49:33 +02:00
b7466c7e85 GET for relationship fixed: associated relation displayed 2021-10-26 14:49:12 +02:00
2ef70b301f visgraph: basic styles by groups, initialize legend, etc. 2021-10-26 14:44:49 +02:00
nobohan
816855e6f8 mod input address: add an event listener to add this component for collections 2021-10-26 14:12:53 +02:00
nobohan
f6806f7743 person: new translation for accept SMS 2021-10-26 14:11:10 +02:00
nobohan
69ae252da6 person: delete accept Email 2021-10-26 14:11:10 +02:00
nobohan
b800b62e88 person: capitalise place of birth (frontend + backend) 2021-10-26 14:11:10 +02:00
nobohan
6a1cf4eb92 person: capitalize entry in person form 2021-10-26 14:11:10 +02:00
nobohan
f44566037c person: fix showHide import/export 2021-10-26 14:11:10 +02:00
c1a845e3e1 display of eye-icon fixed 2021-10-26 11:35:26 +02:00
4096e0d4df undefined condition added 2021-10-26 11:05:13 +02:00
00ad7a74d6 correct formatting of birth- and deathdate 2021-10-26 10:59:19 +02:00
136c6f19de vue_visgraph: basically display persons, household, courses and edges between them 2021-10-25 18:47:15 +02:00
18ca01b0dc migration changed, further attempts to fix bug 2021-10-25 17:03:45 +02:00
e7f555077e vis need each edge has an id, and vuex don't like vis create it by itself ! 2021-10-25 16:42:38 +02:00
b7f3700928 loop on household members to add edges to graph 2021-10-25 15:00:01 +02:00
f4b9942f3c Merge branch 'household_filiation' of gitlab.com:Chill-Projet/chill-bundles into household_filiation 2021-10-25 14:59:12 +02:00
97f6110be3 prepare course and relationship dispatch 2021-10-25 14:56:23 +02:00
nobohan
1b7cc2be7a add about improve_location MR in changelog 2021-10-25 11:36:18 +02:00
nobohan
526ec52c8d location admin: translations 2021-10-25 11:22:56 +02:00
nobohan
82a679c233 improve location: admin menu 2021-10-25 11:16:17 +02:00
nobohan
21f463ccb9 improve location: correct migration 2021-10-25 10:50:14 +02:00
nobohan
911e709a74 improve location: customizeQuery 2021-10-25 09:34:05 +02:00
nobohan
c46065d9c5 Merge remote-tracking branch 'origin/improve_location-fix-crud' into improve_location
merge...
2021-10-25 09:30:17 +02:00
nobohan
625c43c0b9 improve location: form config 2021-10-25 09:27:50 +02:00
3196a8f785 Merge branch 'household_filiation' of gitlab.com:Chill-Projet/chill-bundles into household_filiation 2021-10-22 19:21:55 +02:00
05d16ec9ab relation and relationship entities created + endpoints. Still something wrong with link between Relation and Relationship 2021-10-22 19:21:32 +02:00
bae06fcc9c Merge remote-tracking branch 'origin/master' into 106_tasks_to_parcours 2021-10-22 17:58:26 +02:00
2f053d3b5f Merge branch 'features/list-possible-user-referral-period' into 'master'
Features/list possible user referral period

See merge request Chill-Projet/chill-bundles!180
2021-10-22 15:54:06 +00:00
c4da6a436b Merge remote-tracking branch 'origin/master' into 106_tasks_to_parcours 2021-10-22 17:52:57 +02:00
4d55b0582c change visibility of methods in LocationCotnroller 2021-10-22 17:25:54 +02:00
693a2889bc fix query customization in crud controller 2021-10-22 17:24:05 +02:00
nobohan
913eb5f229 admin location: filter items in twig 2021-10-22 14:13:54 +02:00
83d91e61cb vue_visgraph: manage vis objects with window variables to avoid conflict between vis and vue 2021-10-22 12:58:32 +02:00
d009d09215 some adjustments to the application of blur effect...incomplete 2021-10-22 12:35:27 +02:00
nobohan
8c96aae988 location admin: menu for location admin 2021-10-22 12:30:52 +02:00
nobohan
ece7ec032d location admin: correct missing dep 2021-10-22 12:21:23 +02:00
nobohan
154416cddf location admin: add active field on Location and LocationType 2021-10-22 12:14:32 +02:00
6ff80be88d vue_visgraph: add vis manipulation actions and vis styles 2021-10-22 11:59:55 +02:00
5869236af1 merge remote into local branch issue fixed 2021-10-22 11:53:13 +02:00
nobohan
7dc4590580 location admin: show/ hide fields based on location type 2021-10-22 11:27:52 +02:00
nobohan
e24fd8aff0 location admin: improve admin crud for location 2021-10-22 10:01:24 +02:00
nobohan
e9322e61d4 location admin: admin crud for location 2021-10-21 21:39:32 +02:00
c38196006c confidential component created and added to personRenderBox on resourceItem and participationItem as demo. bug: eye icon only appears when clicking on the vue devtools extension in firefox? 2021-10-21 16:52:27 +02:00
a754bc0abe blur added to requestor in twig template 2021-10-21 16:52:27 +02:00
f09329daee blur logic implemented on view.html.twig of Person by means of example 2021-10-21 16:52:27 +02:00
b40ed48776 restructuring files to /module 2021-10-21 16:52:27 +02:00
97cf6e52ac first commit 2021-10-21 16:52:27 +02:00
nobohan
92843677f9 location admin: add admin crud for location type 2021-10-21 16:30:37 +02:00
nobohan
e06a98e70a user menu: remove useless commented lines (user menus are implemented in their own chill bundles 2021-10-21 13:48:42 +02:00
nobohan
821480c06f calendar: add a menu user entry 2021-10-21 13:47:56 +02:00
8735602dd6 Merge branch 'household_filiation' of gitlab.com:Chill-Projet/chill-bundles into household_filiation 2021-10-21 10:31:46 +02:00
d7cf45885e vue_visgraph: vuex get household and update nodes array 2021-10-21 10:29:51 +02:00
nobohan
db67ed3194 rdv->calendar: add location 2021-10-20 22:04:20 +02:00
nobohan
8962c1c05f add fixture for location type 2021-10-20 21:46:16 +02:00
dded4fb804 rename method 2021-10-20 20:50:27 +02:00
02ca9add52 refactor naming ReferralsAvailable => referralSuggestion 2021-10-20 20:49:44 +02:00
3f138dc152 show users as suggestions, not in constrained list 2021-10-20 19:59:08 +02:00
nobohan
d1e2257db6 fix merge request conflict for improve address 2021-10-20 15:52:22 +02:00
0a058bad82 update list of referrers when loading and updating some parts of the course 2021-10-20 15:03:42 +02:00
8d947ea81b viewing permission checked for returned accompanying periods by-person 2021-10-20 13:37:27 +02:00
902c45f0cd endpoint created for acc periods by-person 2021-10-20 13:11:58 +02:00
4f21c7f219 simplifiy filter order 2021-10-20 13:11:02 +02:00
c8762d2bc2 list referral for an accompanying period 2021-10-20 13:10:28 +02:00
94c91d5825 simplifiy filter order 2021-10-20 13:09:38 +02:00
1b0c19a68f prepare vue_visgraph component, with store, dataset and display basic graph 2021-10-20 09:46:26 +02:00
2227d5c66f translation fixed in master vendee branch 2021-10-18 16:56:33 +02:00
47f7837ab2 Merge branch 'issue97_rename_field' into 'master'
utilisateur field label changed

See merge request Chill-Projet/chill-bundles!177
2021-10-18 14:48:48 +00:00
f889d43f6c update changelog 2021-10-18 16:47:16 +02:00
eecb11436e field label for duration of activity 2021-10-18 15:33:26 +02:00
220dafeb99 utilisateur field label changed 2021-10-18 14:50:34 +02:00
8be11314c3 Merge branch 'master' into HEAD 2021-10-18 13:49:00 +02:00
f89e92e88b Merge branch 'features/improve-admin-user-list' 2021-10-18 13:35:32 +02:00
acdb4fdd36 fixes in translation form admin 2021-10-18 13:34:59 +02:00
b73332c4a3 show errors in ChillCollectionType 2021-10-18 13:33:41 +02:00
8fb5a1b5e8 fixes in translation form admin 2021-10-18 13:33:19 +02:00
5d494221d2 confidential component created and added to personRenderBox on resourceItem and participationItem as demo. bug: eye icon only appears when clicking on the vue devtools extension in firefox? 2021-10-18 13:11:14 +02:00
nobohan
fcc8f67094 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2021-10-18 11:24:29 +02:00
nobohan
99b99de9be update CHANGELOG 2021-10-18 11:23:14 +02:00
nobohan
31fd9cee57 update CHANGELOG 2021-10-18 11:21:13 +02:00
809eb9643e Merge branch 'optimize_address' into 'master'
Address: Optimize address

See merge request Chill-Projet/chill-bundles!170
2021-10-18 09:17:05 +00:00
89b0b94d22 Merge branch 'feature/form-move-household-with-checkboxes' into 'master'
rewrite form move household

See merge request Chill-Projet/chill-bundles!159
2021-10-18 09:14:28 +00:00
e6e5bfee4f update changelog [ci-skip] 2021-10-15 17:46:00 +02:00
9cbac89cae handle leaving household 2021-10-15 17:43:28 +02:00
8f361567ff form as carrousel finalized 2021-10-15 16:40:31 +02:00
8c87eaa46f upgrading changelog 2021-10-15 15:46:04 +02:00
6565e3f8e3 fix invisible selected item in multiselect 2021-10-15 15:37:16 +02:00
6876c23adb adapting vue_calendar to use Location 2021-10-15 15:28:33 +02:00
d86307327c fix error in LocationApiController customizeQuery 2021-10-15 14:12:06 +02:00
0e18a3ada9 adding location hidden field in Calendar formType 2021-10-15 13:13:00 +02:00
4677fadf6f adding activity location in show template + translations 2021-10-15 13:11:14 +02:00
3e4cb41f7a vue_activity Location i18n translations 2021-10-15 12:49:15 +02:00
ada9efc75d filter list of locations on backend side (GET location endpoint) 2021-10-15 12:01:57 +02:00
d0dd99db9a fix Location POST endpoint and saveNewLocation event method in vue_activity Location 2021-10-15 11:25:18 +02:00
e6845326d7 vue_activity location: add NewLocation fields, submit activity form with hidden field (+) 2021-10-15 09:09:47 +02:00
61488e9876 WIP test filtering elements on household [household editor] 2021-10-14 16:05:19 +02:00
a4af30e542 update changelog 2021-10-14 16:05:17 +02:00
58a8949cac download household on same address 2021-10-14 16:03:48 +02:00
c179649c56 load suggestion WIP 2021-10-14 16:03:48 +02:00
05b2b2f9b8 Link between address and reference, and api endpoint to find household
by address reference

* add a one-to-many link between address and address reference;
* update AddAddress.vue to add information on picked address reference;
* add an HouseholdACLAwareRepository, with a method to find household by
current address reference
* add an endpoint to retrieve household by address reference
* + tests
2021-10-14 16:03:48 +02:00
6430de94a7 try to fix button in controller issue 2021-10-14 16:03:48 +02:00
62d3bf8742 do not allow to update address from an existing household 2021-10-14 16:03:48 +02:00
0437e00dcd suggest only temporary addresses 2021-10-14 16:03:48 +02:00
dc7bcb5233 update changelog 2021-10-14 16:03:06 +02:00
b3bd4a5b49 Merge branch 'fix-tests/fix-2021-10-14' into 'master'
Fix tests with capitalization

See merge request Chill-Projet/chill-bundles!175
2021-10-14 14:01:18 +00:00
4f940b44ad Fix tests with capitalization 2021-10-14 14:01:18 +00:00
a75f4015c7 Merge branch 'features/thirdparty-improve-acl-collection' into 'master'
3party, suite

See merge request Chill-Projet/chill-bundles!173
2021-10-14 12:06:51 +00:00
eaeb6c18b0 try to fix loading of reports fixtures 2021-10-14 13:57:42 +02:00
9a02665053 some tweaks into PickAddressType 2021-10-14 13:54:19 +02:00
6fccc70e41 add some doc [ci-skip] 2021-10-13 23:02:53 +02:00
13b96637bb Refactor address vue app and create a PickAddressType 2021-10-13 22:58:54 +02:00
4d4662a634 adding endpoint for LocationType. fetch types and add form fields. 2021-10-13 19:31:48 +02:00
b418d13190 make somes changes on model: to manage isVisible field option + others 2021-10-13 15:47:48 +02:00
48f3c440a2 adding an API GET Location endpoint, fetch locations and list them in vue multiselect 2021-10-13 14:22:53 +02:00
342c462ed7 prepare vue Location component 2021-10-13 12:02:45 +02:00
49b1b6f413 vue_activity: add a Location sub-component, teleported in form 2021-10-13 09:56:29 +02:00
7c21818f00 vue_activity: removing v-model in a multiselect (try to fix warning in console) 2021-10-13 09:54:50 +02:00
2d0895b83d calendar: remove useless bootstrap col classes 2021-10-13 09:24:15 +02:00
01ff88074b add parent in thirdpartyrenderbox.vue 2021-10-12 17:50:32 +02:00
e570f5c28e adding Entities Location and LocationType (for activity/calendar) + doctrine migration 2021-10-12 17:38:09 +02:00
b84d0100e0 create style for badge 3party and introduce in ThirdPartyRenderBox.vue 2021-10-12 17:32:17 +02:00
88d073b9a9 handle types and categories in a single select input 2021-10-12 15:52:06 +02:00
nobohan
210c199a35 CHANGELOG: order addresses 2021-10-12 15:10:09 +02:00
nobohan
e4a05a1812 Address: order address in back-end 2021-10-12 15:09:34 +02:00
82ae300bd9 vue accourse banner: change "by" translation 2021-10-12 13:12:45 +02:00
85538f74b7 vue person renderbox, fix title 2021-10-12 13:12:45 +02:00
f1773997ce fix/adapt gender translation 2021-10-12 13:12:30 +02:00
ae7774ac39 init household filiation page with hello world visjs graph 2021-10-12 09:55:47 +02:00
9eec15873e fixtures for civility: add abbreviations 2021-10-12 09:44:51 +02:00
e9192c5011 adaptations for third party search 2021-10-12 09:37:35 +02:00
f4369553e1 fix layout for address 2021-10-12 09:37:35 +02:00
bc608832c2 fill changelog
[ci-skip]
2021-10-12 09:37:35 +02:00
313c17826e translation of company & contact and show parent in list 2021-10-12 09:37:35 +02:00
acbb33918f improve translation 2021-10-12 09:37:35 +02:00
cb29e1e8be Update CONVENTIONS.md [ci-skip] 2021-10-11 18:44:25 +00:00
799ed0de5c Add new file 2021-10-11 18:43:39 +00:00
76f84934d4 update changelog with today release 2021-10-11 17:36:20 +02:00
nobohan
62c0410bf5 address: sort cities by code and then by name + improve city display 2021-10-11 16:16:49 +02:00
nobohan
f7954d5159 address: sort address by street and street number 2021-10-11 16:05:03 +02:00
992b320820 replace continue instruction by equivalent break in switch 2021-10-11 15:01:37 +02:00
47897b5fe3 update changelog [ci-skip] 2021-10-11 14:54:08 +02:00
b5394a3de2 use entity_render_string in titles 2021-10-11 14:53:04 +02:00
2db9a98bfe fix bootstrapping listener for person capitalization name 2021-10-11 14:53:04 +02:00
0c5e5ac672 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2021-10-11 14:42:57 +02:00
ffb99e26fb changelog correction 2021-10-11 14:41:18 +02:00
a27b228a6f Merge branch 'features/thirdparty-improve-acl-collection' 2021-10-11 14:31:47 +02:00
abedf83dbd fix flushing after person creation 2021-10-11 14:31:03 +02:00
80a05f76ba update changelog [ci-skip] 2021-10-11 14:17:35 +02:00
nobohan
30fcdfd1f6 addresses: remove duplicate in postal codes 2021-10-11 14:15:59 +02:00
0dbff5a6a7 rename tests for PickCenterType and desactivate them 2021-10-11 14:08:36 +02:00
d7ae279101 Create thirdparty on the fly with institution / contact 2021-10-11 14:08:36 +02:00
08764aa0b4 improve layout of third parties in AddPerson 2021-10-11 14:08:36 +02:00
c54edd8407 fix civility repository namespace 2021-10-11 14:08:36 +02:00
e465170c7b work on render box and list 2021-10-11 14:08:36 +02:00
72e9346b6b fix loading third party 2021-10-11 14:08:36 +02:00
0633fd812f handle kind as contacts 2021-10-11 14:08:36 +02:00
4d71a1c630 add possibility to generate filter/order elements, with only search box
for now
2021-10-11 14:08:36 +02:00
e286acf9fe fix namespace 2021-10-11 14:08:36 +02:00
7812442c9a page vue des tiers 2021-10-11 14:08:36 +02:00
9a708ca618 fix canonicalization and show only active children in form 2021-10-11 14:08:36 +02:00
58ddbfb67b remove occurences for ThirdPartyCivility 2021-10-11 14:08:36 +02:00
2820ad83de add trigger for canonicalization and anonymouse flag on 3party 2021-10-11 14:08:36 +02:00
ca3ced0308 various improvements on 3party 2021-10-11 14:08:36 +02:00
7ea2c36c5e crudification for thirdparty 2021-10-11 14:08:36 +02:00
a8edef13a3 refactor centerType 2021-10-11 14:08:36 +02:00
05b9476a71 crudification + corrections on thirdparty 2021-10-11 14:08:36 +02:00
cc7e38194f Merge branch 'submit_eventlistener' into 'master'
Submit eventlistener

See merge request Chill-Projet/chill-bundles!171
2021-10-11 07:41:03 +00:00
78b651bdc4 blur added to requestor in twig template 2021-10-08 23:44:06 +02:00
487103375d blur logic implemented on view.html.twig of Person by means of example 2021-10-08 22:21:40 +02:00
bfe5e0f515 Merge branch 'names_to_caps' into 'master'
Names to caps

See merge request Chill-Projet/chill-bundles!167
2021-10-08 16:43:29 +00:00
7ed61398ea Merge branch '207_activity_bugfix' into 'master'
option added to distinguish between edit and new action so that modification...

See merge request Chill-Projet/chill-bundles!168
2021-10-08 16:43:10 +00:00
1eba6a35aa Merge branch 'master' into resume-page 2021-10-08 17:56:27 +02:00
158fbfd241 updating changelog 2021-10-08 17:43:15 +02:00
02268792ba Activity: sharing badge-title include in list and in recent-list 2021-10-08 17:32:26 +02:00
afe076041f rename recent_list to list_recent 2021-10-08 17:23:52 +02:00
800ab896bc Activity, improve badge-title. Fix too long badges line break in a narrow inline wrapper. 2021-10-08 17:15:58 +02:00
nobohan
acbd6e761a address: zoom on postal code on select city 2021-10-08 15:51:51 +02:00
nobohan
cae3defedb address: zoom to postal code 2021-10-08 14:50:09 +02:00
8f889248fb fix some limits with float-button asset 2021-10-08 13:01:44 +02:00
e12e5798ea refactor activity list css styles (wip) 2021-10-08 13:01:34 +02:00
52c1a01980 Refactoring sass chill colors variables and badge mixins 2021-10-08 13:01:10 +02:00
84189faae6 Translation for Last Items 2021-10-08 13:01:10 +02:00
3a07fa4faf resume short list style abstraction for accourse-work and activities (wip) 2021-10-08 13:01:04 +02:00
c87eda32cb Merge branch 'improve_address' into 'master'
Improve address

See merge request Chill-Projet/chill-bundles!169
2021-10-08 10:40:46 +00:00
nobohan
78f66d4f14 Address: Assign origin = 3 for postalCode created by users 2021-10-08 12:36:48 +02:00
nobohan
2d4b6d1dd1 minor correction following MR review + Changelog 2021-10-08 12:14:45 +02:00
1ffff1f72c restructuring files to /module 2021-10-07 17:10:52 +02:00
8fca704f74 adjustment so that altnames are fully capitalized 2021-10-07 17:05:09 +02:00
d524897838 entrypoint added to webpack and js included in create template for person 2021-10-07 16:57:22 +02:00
fb05d892a2 reorganization of files 2021-10-07 16:16:01 +02:00
48e59bac79 changelog updated 2021-10-07 15:50:35 +02:00
1ded5b7c01 first commit 2021-10-07 14:18:25 +02:00
nobohan
665b0f8533 postal code: adapt fixtures 2021-10-07 13:48:05 +02:00
nobohan
748fe28f8d postal code: rename fields to avoid confusion in load fixtures 2021-10-07 13:42:26 +02:00
nobohan
fd73fac1a8 adapt migration 2021-10-07 12:32:26 +02:00
aa852ec924 minor changes review: comments removed, logicexception, more test cases passed 2021-10-07 11:13:38 +02:00
9d6958a835 logic moved to controller instead of form 2021-10-07 10:56:10 +02:00
nobohan
3770318e6a enlarge the loadpostalcode command to more fields 2021-10-06 21:48:56 +02:00
nobohan
24320cb702 address: alter postalcode entity 2021-10-06 17:28:07 +02:00
7dd42c3fa2 accented letters in majascule 2021-10-06 15:52:11 +02:00
b510d6a7f5 option added to distinguish between edit and new action so that modification of activity with uactive type is possible 2021-10-06 14:07:26 +02:00
72d67624a2 minor fixes 2021-10-06 12:49:15 +02:00
Julie Lenaerts
0c4ea81550 eventListener created and tested for firstname, lastname and altnames 2021-10-06 12:16:45 +02:00
Julie Lenaerts
7d8f380050 entity listener added to person to capitalize names 2021-10-05 13:57:04 +02:00
af4cf55046 start of entity listener for person name capitalization 2021-10-04 19:33:12 +02:00
ddbd6a9f23 Merge branch 'improvements_acitivite_annexe' into 'master'
Improvements acitivite annexe

See merge request Chill-Projet/chill-bundles!153
2021-10-04 14:48:37 +00:00
b5eaea0e88 Merge branch 'fixes/aside-activities-before-integration' into 'improvements_acitivite_annexe'
Fixes/aside activities before integration

See merge request Chill-Projet/chill-bundles!165
2021-10-04 14:35:14 +00:00
ed8a569fea remove obsolete test 2021-10-04 16:30:08 +02:00
c41bc7bef9 prevent recursion 2021-10-04 16:16:34 +02:00
27dea97bc6 fixes minor for admin aside activity 2021-10-04 15:55:35 +02:00
27125b838e various minor fixes in aside activities 2021-10-04 15:15:26 +02:00
369a29af48 accompanying course work, specific render for list page or resume page (wip) 2021-10-04 14:22:27 +02:00
4c55631297 Merge conflicts in translations.yaml resolved.
# Conflicts:
#   src/Bundle/ChillAsideActivityBundle/src/translations/messages.fr.yml
#   src/Bundle/ChillMainBundle/translations/messages.fr.yml
2021-10-04 11:22:03 +00:00
cd6dec5082 Display of aside activity title styling changed from badge to normal title display 2021-10-04 12:11:27 +02:00
152a7de1dc section menu entries de-activated for role_admin 2021-10-04 12:09:26 +02:00
da19f68440 Title display of aside activities adjusted to display full title (parent > child > ...) Styling to be discussed 2021-10-04 11:20:07 +02:00
e895125d12 view template replaced by CRUD view template 2021-10-04 10:47:09 +02:00
fe9b76a1fb Merge remote-tracking branch 'origin/master' 2021-10-04 10:17:32 +02:00
baf9251000 update changelog 2021-10-04 10:17:13 +02:00
665b38d166 fix details (translations, etc.) 2021-10-04 09:50:05 +02:00
9450d34af0 Merge branch 'fix/center-type-show-hidden-when-no-center-reachable' into 'master'
[CenterType] switch to hidden type with null value when no center is reachable

See merge request Chill-Projet/chill-bundles!162
2021-10-03 19:23:24 +00:00
42301c9df7 Merge branch 'master' into 'fix/center-type-show-hidden-when-no-center-reachable'
# Conflicts:
#   CHANGELOG.md
2021-10-03 19:19:04 +00:00
eb1a7b2374 Merge branch 'fix/household-summary-show-comment-when-no-address' into 'master'
[household summary] show comment form even if no address are registered

See merge request Chill-Projet/chill-bundles!163
2021-10-03 19:17:44 +00:00
7f661f9022 Merge branch 'master' into 'fix/household-summary-show-comment-when-no-address'
# Conflicts:
#   CHANGELOG.md
2021-10-03 19:17:35 +00:00
178ffdf6bf Merge branch 'feature/add-requestor-in-search-results' into 'master'
Feature/add requestor in search results

See merge request Chill-Projet/chill-bundles!161
2021-10-03 19:16:35 +00:00
5f0238f614 Merge branch 'master' into 'feature/add-requestor-in-search-results'
# Conflicts:
#   CHANGELOG.md
2021-10-03 19:16:17 +00:00
cfaa64884d Merge branch 'fix/accept-sms-not-required' into 'master'
[person form] accept sms is not required

See merge request Chill-Projet/chill-bundles!160
2021-10-03 19:14:34 +00:00
faba2b67eb updating changelog 2021-10-01 21:20:19 +02:00
a981661ea5 resume, list associated_persons : improve design, hover effects 2021-10-01 21:14:27 +02:00
3a3baa79c8 resume: list associated persons sorted by household. add method in entity 2021-10-01 20:48:45 +02:00
e35f002f2b improvements based on draft review of MR 153 2021-10-01 19:05:03 +02:00
fbd17a1de6 OnTheFly: adding displayBadge option to replace button by badge
When using displayBadge=true, you need to pass buttonText=string with badge content.

Limitation: onTheFly cannot use directly PersonRenderBox to display badge,
because it don't have person object in props !
2021-10-01 18:46:25 +02:00
77d86d3836 [household summary] show comment form even if no address are registered 2021-10-01 16:53:27 +02:00
eb11597f9c [CenterType] switch to hidden type with null value when no center is
reachable
2021-10-01 16:38:35 +02:00
daa8b03c8b Merge branch 'onTheFly' into resume_accourse 2021-10-01 14:11:32 +02:00
9ee679a3b3 fix vue syntax error 2021-10-01 14:11:03 +02:00
8791c78426 Merge branch 'onTheFly' into resume_accourse 2021-10-01 14:07:37 +02:00
abd60f7ddf resume: include _insert_vue_onthefly template 2021-10-01 14:06:15 +02:00
75348f6ba7 otf: add data attributes and pass them in vue component 2021-10-01 14:03:58 +02:00
75a06d6896 Merge branch 'onTheFly' into resume_accourse 2021-10-01 13:12:03 +02:00
65782d3a6b fix js syntax 2021-10-01 13:11:34 +02:00
1dc01fa8e2 create OnTheFly rootComponent structure, and twig include template to insert it 2021-10-01 13:08:12 +02:00
db9a203df0 otf: prepare to create vue root component: moving files 2021-10-01 12:18:40 +02:00
2a7e3c0334 resume: display associated persons from accourse 2021-10-01 11:55:32 +02:00
ad72904aa9 resume accourse: simplify alerts with simple link to edit page 2021-10-01 11:41:02 +02:00
0b57b3c74d Merge branch 'master' into onTheFly 2021-10-01 11:38:15 +02:00
8c0abbc5cd updating changelog 2021-10-01 11:37:06 +02:00
461b96ea37 duplicate templates deleted 2021-10-01 11:32:46 +02:00
fc237db98a fix: wrong template rendered for new course task 2021-10-01 11:32:32 +02:00
43daab1f7b transition button added to listitems of course tasks 2021-10-01 11:32:05 +02:00
85e8fe59a4 changes to TaskVoter reinstated, mistake made in conflict resolvement 2021-10-01 11:18:10 +02:00
c42b7c014b udpate changelog [ci-skip] 2021-10-01 11:00:25 +02:00
262fefa92f access granted condition lifted temporarily to show the 'add new task' button on index page for Person 2021-10-01 10:52:05 +02:00
1403ee2ba5 redirect after submit bug fixed for edit and delete when coming from show.html.twig 2021-10-01 10:49:55 +02:00
548247188f temporarily lifted scope validation, currently no scopes in select list to be selected 2021-10-01 10:49:07 +02:00
6a34046e93 comments deleted, notations adjusted, ... 2021-10-01 10:47:32 +02:00
88b8ff86d1 reorganize templates for a better structure 2021-10-01 10:45:04 +02:00
0d5d4b3f05 add accompanying period where the person is requestor + badge in results 2021-10-01 09:50:13 +02:00
a3e43fcaaa [person form] accept sms is not required 2021-09-30 23:27:56 +02:00
4047399b76 otf: comments to remember things to improve 2021-09-30 21:22:28 +02:00
4c9d352c46 otf: post/patch thirdparty ok, with addAddress creation/edition 2021-09-30 21:11:51 +02:00
a316cb9568 otf: manage address in edit/create form (wip) 2021-09-30 15:46:34 +02:00
14539f6f88 Merge branch 'onTheFly' into thirdparty 2021-09-30 15:13:03 +02:00
92e6506ecb tp: adapt controller/entity/formtype to works with new ACL (TO BE CHECKED)
* rename type by types -> getTypes() getter
* adapt controller to fix centers errors
* remove voteOnAttribute return always true in voter
2021-09-30 15:03:47 +02:00
59fed905e9 AddAddress: in onlyButton case, button is not in ul.record_actions 2021-09-30 15:02:48 +02:00
577d665f09 batch replace hideAddress option by onlyButton 2021-09-30 14:36:01 +02:00
cc258ba164 templates added for transition of course task and taskcontroller adapted to show correct template 2021-09-30 14:24:17 +02:00
5d69e48787 more conformity between URL's single-task 2021-09-30 14:22:20 +02:00
decc3c7463 otf: replace button by link in show modale 2021-09-30 13:44:04 +02:00
1eb8d04a32 fix property into json body with endpoint PATCH thirdparty 2021-09-30 13:23:11 +02:00
2f60ab4d17 fix chill_resolve_center in person banner when n centers > 1 2021-09-30 12:35:36 +02:00
3cf9920718 Merge branch 'master' into onTheFly 2021-09-30 12:08:24 +02:00
Pol Dellaiera
f1f13996f9 fix: Fix missing parameter. 2021-09-30 12:07:58 +02:00
29838a4d8e Merge branch 'onTheFly' of gitlab.com:Chill-Projet/chill-bundles into onTheFly 2021-09-30 12:04:59 +02:00
e9b1f442bc api docs adjusted to patch/post address on thirdparty 2021-09-30 12:02:54 +02:00
e2feea15f9 stash commit 2021-09-30 11:57:20 +02:00
14a13c7bd5 CourseLocation: improve warning alerts
manually cherrypick from 5b0b1441d3c7ef0717f21adac8566e1beb1af52c on local branch resume_accourse
2021-09-30 11:55:28 +02:00
5a37bfd1a0 Merge remote-tracking branch 'origin/master' 2021-09-30 11:51:35 +02:00
bd7f2d997e fix link to edit in wopi 2021-09-30 11:51:26 +02:00
309fe40564 Merge branch 'accourse_impr' into onTheFly 2021-09-30 11:43:49 +02:00
Pol Dellaiera
f8f019cfe6 fix: Fix bug in getSize() method. 2021-09-30 11:09:55 +02:00
460f0daf0a Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2021-09-29 23:53:19 +02:00
5de05c0ee9 Merge branch 'master' into accourse_impr 2021-09-29 23:51:56 +02:00
Pol Dellaiera
7f721da08a fix: Remove obsolete code. 2021-09-29 22:38:48 +02:00
Pol Dellaiera
9a34aa59bb fix: Add missing dependency. 2021-09-29 21:50:44 +02:00
Pol Dellaiera
00259dae20 fix: Update ChillDocumentManager::getSize(). 2021-09-29 21:46:47 +02:00
Pol Dellaiera
fb8b8b354f refactor: Update Wopi::checkFileInfo() so it can authenticate users from access token. 2021-09-29 20:25:32 +02:00
d8c34c3089 otf: thirdparty corrections 2021-09-29 19:53:28 +02:00
74b649fb2c no location button for requestor 2021-09-29 19:30:57 +02:00
bac8e8d0b8 cleaning 2021-09-29 19:27:22 +02:00
008a10dab8 otf: patch person and thirdparty from the store, emit parent method saveFormOnTheFly() 2021-09-29 17:47:21 +02:00
a2df3c8144 rdv avant échanges dans le menu 2021-09-29 16:04:05 +02:00
d8444455c0 Merge branch 'feature/form-move-household-with-checkboxes' 2021-09-29 15:43:40 +02:00
c793159593 quick fix stored boject 2021-09-29 15:27:11 +02:00
26140de7de Merge remote-tracking branch 'origin/master' 2021-09-29 15:15:17 +02:00
2c1d3d08c3 temporary stored object fixes 2021-09-29 15:15:10 +02:00
Pol Dellaiera
86c2a5c3e8 fix: Update ChillDocumentManager. Fix statuscode and return types. 2021-09-29 15:07:27 +02:00
9420c34f58 Merge branch 'onTheFly' of gitlab.com:Chill-Projet/chill-bundles into onTheFly 2021-09-29 15:05:12 +02:00
d94fec3352 Merge branch 'onTheFly' of gitlab.com:Chill-Projet/chill-bundles into onTheFly 2021-09-29 15:03:14 +02:00
ba98283348 fix specs.yaml indentation 2021-09-29 15:02:54 +02:00
bfd95bff39 otf: add patch api endpoint for person and thirdparty 2021-09-29 14:57:41 +02:00
Pol Dellaiera
664fcd07ef fix: Update StoredObject uuid property. 2021-09-29 14:52:22 +02:00
a8df0070e8 Merge branch 'onTheFly' of gitlab.com:Chill-Projet/chill-bundles into onTheFly 2021-09-29 14:47:37 +02:00
440e21a83b Merge branch 'onTheFly' of gitlab.com:Chill-Projet/chill-bundles into onTheFly 2021-09-29 14:40:23 +02:00
8c2d211661 Merge remote-tracking branch 'origin/master' 2021-09-29 14:29:27 +02:00
f2ebb1f33c PATCH added for person endpoint 2021-09-29 14:22:55 +02:00
c53636c40b Merge branch 'refactor/sync-wopi' into 'master'
Refactor and synchronize WOPI packages

See merge request Chill-Projet/chill-bundles!157
2021-09-29 12:05:31 +00:00
0ec095b59a allow to remove / update address in household member editor 2021-09-29 13:57:36 +02:00
86c5376cc2 bypass ACL restriction
fix response 500 when otf create new person
2021-09-29 13:35:33 +02:00
0e54b8cdf0 add a changelog 2021-09-29 13:26:54 +02:00
53e82f1b2a store created address into new household 2021-09-29 12:54:53 +02:00
f4999548ac handle suggestion in addAddress component 2021-09-29 12:48:18 +02:00
302f60e722 addAddress: remove commented old method 2021-09-29 12:14:58 +02:00
5b7484b1ce Merge branch 'onTheFly' of gitlab.com:Chill-Projet/chill-bundles into onTheFly 2021-09-29 11:42:40 +02:00
fc1dd499c4 POST, PUT, PATCH working for thirdparty and added to swagger. Assert for 'centers'(temporarily) removed from thirdparty entity 2021-09-29 11:41:08 +02:00
3824a380ff otf: prepare with debug (wip) 2021-09-29 11:37:53 +02:00
315253589e create api endpoint for duplciating address 2021-09-29 11:32:23 +02:00
af24637dc4 update return type for prepare client trait 2021-09-29 11:31:44 +02:00
0fe248320d OnTheFly (otf): fix clickable radio tab on create modal 2021-09-29 11:21:45 +02:00
a26d278510 comment console.log 2021-09-29 11:21:06 +02:00
9641fd3fcc WIP add address to new household 2021-09-28 23:06:59 +02:00
2b3c4b7af9 fix boundary in getCurrentMembers/getNonCurrentMembers 2021-09-28 23:06:40 +02:00
8853359405 remove dump
(cherry picked from commit e2230409b8)
2021-09-28 19:38:02 +00:00
704ec76ca4 rewrite the destination for household / leave household 2021-09-28 21:35:41 +02:00
Pol Dellaiera
6020ee2cb2 chore: Update .editorconfig file. 2021-09-28 20:35:19 +02:00
Pol Dellaiera
ba53ce40fa Add migration file. 2021-09-28 20:32:43 +02:00
Pol Dellaiera
ab845d4569 Synchronize ChillWopiBundle with latest upstream WOPI packages. 2021-09-28 17:50:53 +02:00
Pol Dellaiera
dcb92b1378 Update StoredObject entity. 2021-09-28 17:49:32 +02:00
Pol Dellaiera
59fcd1e96b Update local ChillDocStore composer.json. 2021-09-28 17:40:49 +02:00
Pol Dellaiera
0aec2fc1d1 Update local ChillWopiBundle composer.json. 2021-09-28 17:39:54 +02:00
Pol Dellaiera
e43ae56e73 Update root composer.json. 2021-09-28 17:39:23 +02:00
3040ed9483 tp onthefly: add add-address (wip) 2021-09-28 16:26:59 +02:00
adc94aaeea javascript syntax correction 2021-09-28 16:26:32 +02:00
c5fa1b883c onthefly: adding tp i18n file 2021-09-28 16:25:38 +02:00
644d0420ce creation of endpoints POST, PUT, PATCH, but still errors 2021-09-28 16:23:24 +02:00
e2230409b8 remove dump 2021-09-28 15:59:31 +02:00
472866ce91 fix search by birthdate 2021-09-28 15:54:09 +02:00
d5d12c4a17 fix tests for user controller 2021-09-28 15:54:08 +02:00
e72ba4c940 bypass ACL restriction 2021-09-28 15:34:15 +02:00
nobohan
ca7ba90717 hotfix: repair creation activity (was an error linked to ListenToActivityCreate) 2021-09-28 14:53:00 +02:00
f3ba3aeed9 Merge branch 'master' into thirdparty 2021-09-28 14:47:52 +02:00
cb4059e5c3 comment out use of voter for menu entry, new way of handling rights? 2021-09-28 14:37:27 +02:00
c791c48248 tp: adapt to new ACL interface (wip) 2021-09-28 14:06:52 +02:00
8411c909ff notation modifications 2021-09-28 12:55:46 +02:00
41fc41b1da migration namespace adjusted 2021-09-28 12:55:46 +02:00
cb5b45cbe8 autowire and configure MenuBuilder 2021-09-28 12:55:46 +02:00
4c47a35457 Fix SingleTaskListType
accompanyingCourse also defined as a form option
2021-09-28 12:55:46 +02:00
34dd35f2e2 Changed name of PersonMenuBuilder
More general name since it also contains the AccompanyingPeriod task menu entry now.
2021-09-28 12:55:46 +02:00
6e3ce06fcf new/show/edit/delete/list functionality added for accompanyingperiod task 2021-09-28 12:55:46 +02:00
537518b66f controller and templates adapted to display list of accompanying period tasks + detailpage of task 2021-09-28 12:53:24 +02:00
4ad9714e8b Menu entry added in PersonMenuBuilder of taskbundle. Removed from menubuilder in Personbundle. Rename file, PersonMenuBuilder to MenuBuilder? 2021-09-28 12:53:23 +02:00
5a936cd20b templates + controller further adapted to work with accompanyingCourse. new and show methods don't work yet due to authorization/voter issues
templates adapted for use with accompanyingCourse tasks also
2021-09-28 12:53:23 +02:00
1fb14834b7 tasks added to accompanyingCourse menu 2021-09-28 12:53:23 +02:00
53fc5b8399 adaptation of newTask() method in singleTaskController 2021-09-28 12:49:38 +02:00
8318458805 relation between task and accompanyingcourse created 2021-09-28 12:49:38 +02:00
5da332a06e fix error on previous commit, when creating new accourse 2021-09-27 13:14:42 +02:00
eb89fa2cd4 CourseLocation: replace in accourse vue component the old resume _warning_address.html.twig message 2021-09-27 13:03:17 +02:00
82db55cfec CourseLocation: change add-address key, cleaning add-address options 2021-09-27 11:18:11 +02:00
349a0e69f1 accourse: add warning alert box in each bloc with minimum confirm conditions 2021-09-27 10:56:43 +02:00
4de106ec30 accourse service: improve styles of checkboxes list 2021-09-27 10:21:11 +02:00
9851efa804 fix deathdate not inialized 2021-09-24 16:54:11 +02:00
327fcbef8b Merge branch 'review_documents_accourse' into 'master'
Review documents accourse

See merge request Chill-Projet/chill-bundles!154
2021-09-24 14:52:17 +00:00
d60b6aa3c4 fix phpunit 2021-09-24 16:45:24 +02:00
f0d0f16d3c fix namespace in migration files 2021-09-24 16:36:36 +02:00
832c7bab9f last migration deleted: duplicate 2021-09-24 16:20:58 +02:00
78b56dc32d attempt to fix migrations 2021-09-24 16:04:32 +02:00
6301c4c10b optimisation twig template 2021-09-24 14:42:37 +02:00
b87c995d22 fix UserMenuBuilder so that menu entry is not visible for admin menu 2021-09-24 14:42:07 +02:00
960db6aefc fast aside activity creation implemented 2021-09-24 14:41:37 +02:00
62f8d2c01d fixes quick for accompanying cours edocument voter 2021-09-24 13:51:43 +02:00
388db459bf Merge branch 'admin-for-users' into 'master'
improve admin for users

See merge request Chill-Projet/chill-bundles!150
2021-09-24 10:35:09 +00:00
d1e28b1afc Merge branch '107_documents_parcours' into 'master'
107 ajouter documents aux parcours

See merge request Chill-Projet/chill-bundles!151
2021-09-24 10:33:11 +00:00
d3bf64a00c Merge remote-tracking branch 'origin/master' into HEAD 2021-09-24 12:32:19 +02:00
84223316c4 Merge branch 'master' into improve_address 2021-09-24 11:31:23 +02:00
9f07e6a272 Address: fetch POST valid dates when applying changes from datePane 2021-09-24 11:22:48 +02:00
47d6270b7f Merge commit 'a9ce72034be03f5c84799f5982f97f515900504a' 2021-09-24 10:37:18 +02:00
1d4b1d852f improve layout for admin 2021-09-24 10:35:34 +02:00
430177f0c7 some finalisation for admin user 2021-09-24 10:35:34 +02:00
72b1916da8 continue CRUD user 2021-09-24 10:35:34 +02:00
b5c2dd7bd2 fix-admin and crudify user admin 2021-09-24 10:35:34 +02:00
a9ce72034b Merge branch 'fix-tests/rdv-2' into 'features/rdv'
Fix tests/rdv 2

See merge request Chill-Projet/chill-bundles!147
2021-09-24 08:33:42 +00:00
f93c2d8d32 Merge branch 'fix/use-autoconfigure-and-autowire' into 'master'
Update controller and the way they are autoloaded

See merge request Chill-Projet/chill-bundles!149
2021-09-24 08:33:03 +00:00
463b615595 Aside Activity: improve french translations 2021-09-24 09:13:05 +02:00
95e0198952 Address: twig insert, complete options for use cases 2021-09-23 16:22:10 +02:00
f93c13234a accourse stickyNav: insert a component, replace deprecated anchor name by id 2021-09-23 16:20:33 +02:00
ee3776288b vue_accourse, resources bloc: change for flex-bloc placement 2021-09-23 15:52:44 +02:00
694213e79a household banner: don't limit maximum number of members 2021-09-23 15:45:09 +02:00
a28c996164 stash commit 2 2021-09-23 14:55:54 +02:00
05c5eaa925 stash commit 2021-09-23 14:54:11 +02:00
d4116a4659 Merge branch 'master' into improvements_acitivite_annexe 2021-09-23 14:39:39 +02:00
6b91808987 fix error with doctrine:fixtures:load 2021-09-23 14:08:29 +02:00
d5f1de1fbc Merge branch 'master' into person_renderbox_thirdparty_onthefly 2021-09-23 13:56:28 +02:00
fa9b571d6b Merge branch 'improve_address' into person_renderbox_thirdparty_onthefly 2021-09-23 13:46:54 +02:00
nobohan
d172ae9682 rdv -> activity: add comment 2021-09-23 13:43:12 +02:00
nobohan
1a6c37e5a6 rdv->activity: create event for storing the linked activity to a calendar 2021-09-23 13:43:12 +02:00
nobohan
99f2692684 activity: correction of displaying activity when durationTime or travelTime is null 2021-09-23 13:43:12 +02:00
nobohan
c6bbe46bae rdv: rdv -> activity: fix some bugs (duplicate person var name, case keys are missing) 2021-09-23 13:43:12 +02:00
nobohan
17036e83ba rdv: rdv-> activity: convert some fields 2021-09-23 13:43:12 +02:00
nobohan
e8d8a57b4b rdv: rdv -> activity: pass calendar data to new activity controller 2021-09-23 13:43:12 +02:00
nobohan
3385cb2dda rdv: rename twig view file 2021-09-23 13:43:12 +02:00
nobohan
5b81bffcf6 rdv: twig - headings change 2021-09-23 13:43:12 +02:00
nobohan
27674985bd rdv: add pagination in calendar item list + refactor list views 2021-09-23 13:43:12 +02:00
3c3baed1ce Merge branch 'features/allow-customize-acl' into 'master'
Features/allow customize acl

See merge request Chill-Projet/chill-bundles!140
2021-09-23 11:33:31 +00:00
efd9380d13 Address use next/previous button if datePane and if context new 2021-09-23 12:32:05 +02:00
0808f5a6f3 Address datePane: convert selectedAddress to pass and view it with addressRenderBox 2021-09-23 11:51:40 +02:00
1c568a75ec Address: pass useDatePane option in showPane addressRenderBox, display dates in showPane 2021-09-23 11:07:17 +02:00
e7676c5c2e display address renderbox on datePane (wip) 2021-09-23 10:34:06 +02:00
a8024ba38f Address datePane: validTo date display and format 2021-09-23 10:34:06 +02:00
d994612987 change buttons apparence for datePane back to editPane 2021-09-23 10:34:06 +02:00
3ee0f4bf20 datePane, back to previous editPane 2021-09-23 10:34:06 +02:00
15897b4f33 asideactivity category entity changed to have parent and children properties 2021-09-22 20:35:46 +02:00
ca86eb3c56 disable datePane with courseLocation 2021-09-22 20:34:17 +02:00
14fdeac4fd Merge branch 'improve_address' into person_renderbox_thirdparty_onthefly 2021-09-22 20:32:28 +02:00
98f1f19e9a courseLocation: commit context addressId change when remove PersonLocation (fix bad address in editPane) 2021-09-22 20:27:08 +02:00
4630e2b80c remove unused and comment console log 2021-09-22 20:26:50 +02:00
5d99e261e1 CourseLocation: load initAddressContext() earlier allow AddAddress to getInitialAddress() (fix) 2021-09-22 19:41:17 +02:00
f7ec87e012 Address: hideAddress option mask too loading and alerts 2021-09-22 19:26:33 +02:00
0ed2dc8b13 Address: courseLocation, update addressId when commit context in store 2021-09-22 19:25:37 +02:00
d52ab2188c Address: fix callback function when called by another component (CourseLocation and HouseholdMembersEditor) 2021-09-22 18:48:15 +02:00
4768785bb5 Address: improve forceRedirect condition, if backUrl is null or undefined 2021-09-22 18:43:44 +02:00
47d0043462 disable suggestPane step 2021-09-22 16:28:35 +02:00
aa1f02ebd4 style of aside activity list adapted 2021-09-22 16:23:31 +02:00
1672e873a3 view page created for aside activity 2021-09-22 16:23:11 +02:00
f8d5dcf937 AddAddress: improve loading transition between step0/step1 and step2 2021-09-22 15:16:06 +02:00
544af59009 configuration of duration parametres for aside activity 2021-09-22 15:10:09 +02:00
851fa663ca Merge branch 'improve_address' into person_renderbox_thirdparty_onthefly 2021-09-22 14:07:09 +02:00
019a66c915 tp: Address, twig options: check to remove forceRedirect, and disable backUrl 2021-09-22 14:04:26 +02:00
dfc6ed9bf3 Address: remove forceRedirect option: backUrl option not null is considerated as forceRedirect true 2021-09-22 14:00:40 +02:00
dbb9e6a663 Address: success message exception when redirection 2021-09-22 13:57:33 +02:00
d6f6f49090 address renderbox, improve how display address-more informations 2021-09-22 13:57:29 +02:00
7c2422743e Address: remove unused translations specific to household or person context 2021-09-22 13:55:24 +02:00
e336990b16 comment console.log 2021-09-22 13:55:24 +02:00
dee27ee01f Address: extend hideAddress option for twig cases 2021-09-22 13:55:24 +02:00
f1c29a8bd3 Household summary: improve Address display when there is no address 2021-09-22 13:55:24 +02:00
7df923c669 fix vendor dir in composer.json 2021-09-22 12:28:35 +02:00
b06e726ad1 fix required fields in user controller test 2021-09-22 12:28:14 +02:00
c62254caec add scope selection on accompanying course 2021-09-22 12:23:26 +02:00
c382008b4d fix tests (wip) 2021-09-22 12:23:15 +02:00
f5348daddf Merge branch 'improve_address' into person_renderbox_thirdparty_onthefly 2021-09-22 11:41:41 +02:00
e13b7bf195 fix countrySelection multiselect with fetch async countries
edit context: display country for existing address
new context: repair editPane, load countries

note: adding id for country and postcode in address endpoint json
2021-09-22 11:39:03 +02:00
edc528ff92 Fixed migration 2021-09-22 10:06:58 +02:00
62e70c0c36 Fix layout of flash message in main template 2021-09-21 15:12:25 +02:00
f2e945dc0f UserMenu entry added for aside activities list 2021-09-21 11:52:45 +02:00
d2ce4865c0 display all aside activities created for and created by user with temporary badge 2021-09-21 11:42:18 +02:00
7fe0f08300 tp api endpoints: use default controller (fix) 2021-09-21 10:48:40 +02:00
7d2e82d69b Merge branch 'improve_address' into person_renderbox_thirdparty_onthefly 2021-09-20 20:16:39 +02:00
3f3dd83132 fix error in afterLastPaneAction 2021-09-20 20:15:38 +02:00
f3b755e46e fix warning with getSuccessText 2021-09-20 20:15:38 +02:00
8ba74f8de8 editPane, change button if datePane after 2021-09-20 20:15:38 +02:00
690f649dd1 applyChanges, if DatePane or not 2021-09-20 20:15:38 +02:00
75a240a2d6 parent callback will cast afterLastPaneAction, that manage redirection or context changes 2021-09-20 20:15:38 +02:00
717cd03d95 Address: context id received from twig are integer 2021-09-20 20:15:38 +02:00
1e829707be tp: wip.. write postAddressToThirdparty api for AddAddress callback 2021-09-20 20:13:20 +02:00
e7928c222d creating endpoint for scopes 2021-09-20 14:11:33 +02:00
120f7d8026 upgrade voter and acl for activities and implement autoconfiguration for
ChillProvideRole interface
2021-09-20 13:56:44 +02:00
b6c58a5c31 Continue work on ACL rewritting
* fix center resolver dispatcher
* add scope resolver
* tests for authorization helper
2021-09-20 13:56:44 +02:00
74598ee926 apply new role on accompanying period 2021-09-20 13:56:43 +02:00
cf40f38463 rename voter helepers 2021-09-20 13:56:43 +02:00
ebb2f5d243 Add shortcut person <-> current address, and update api for
re-implements searching

* add geographic function ST_CONTAINS
* add a link between the current valid address and person, optimized on
database side;
* update PersonACLAwareRepository for re-using methods elsewhere.
2021-09-20 13:56:43 +02:00
50b7554aea optimize query for current address + documentation 2021-09-20 13:56:43 +02:00
f63d4fcfba optimize query for person 2021-09-20 13:56:43 +02:00
6bc83edfe9 Refactor PersonSearch and create PersonACLAwareRepository
The search api delegates the query to a person acl aware "repository"
(although this does not implements ObjectRepository interface).
2021-09-20 13:56:43 +02:00
f87f03b5c0 Move CenterResolverInterface auto-configuring to bundledefinition
It seems that the service encountered in bundle loaded before does not
works.
2021-09-20 13:56:43 +02:00
addcf72ae6 improve addresses 2021-09-20 13:56:43 +02:00
b4e78a948b remove NOT NULL for User::usernamecanonical 2021-09-20 13:56:43 +02:00
9b38e486df extends User entity + alter admin (WIP) 2021-09-20 13:56:43 +02:00
960bac8c37 create alias for RoleProvider for allowing autowiring 2021-09-20 13:56:43 +02:00
dc09c9424a refactor ACL for easy voter. Apply on TaskVoter 2021-09-20 13:56:43 +02:00
5b70fb2ee5 adapt UI and controller for Person without centers 2021-09-20 13:56:43 +02:00
2450655452 enable autoloading for form in person bundle 2021-09-20 13:56:43 +02:00
41d76542b4 move validation on person into annotations 2021-09-20 13:56:43 +02:00
7faddbe3fe move birthday validator to namespace person + rewrite tests 2021-09-20 13:56:43 +02:00
eec798cfd3 entity person: create a validator to check a person entity is linked
with a center

This validator take a parameter in configuration
2021-09-20 13:56:43 +02:00
03e8624528 entity person: allow center to be not null 2021-09-20 13:56:43 +02:00
501ffe7829 Merge branch 'improve_address' into person_renderbox_thirdparty_onthefly 2021-09-18 21:48:42 +02:00
a842229d5e improve addAddress 2021-09-18 21:47:04 +02:00
4b87e16f6d Merge branch 'improve_address' into person_renderbox_thirdparty_onthefly 2021-09-18 17:05:13 +02:00
2788170f03 slot buttons up from actionButtons to addAddress 2021-09-18 17:02:45 +02:00
1b4e5c4956 tp: adapt variables for _insert_vue_address 2021-09-18 16:58:49 +02:00
601c16ac27 first commit: rendez-vous menu entry deleted from task usermenubuilder. Start sous-types 2021-09-17 17:00:23 +02:00
bde9e44f87 Merge branch 'improve_address' into person_renderbox_thirdparty_onthefly 2021-09-17 15:55:57 +02:00
4855ec2065 AddAddress: adding a forceRedirect option 2021-09-17 15:55:10 +02:00
c440d8a2bd tp: adapt variables for include _insert_vue_address 2021-09-17 15:32:36 +02:00
7515415888 autowire and configure MenuBuilder 2021-09-17 15:18:48 +02:00
27a52ce166 Fix SingleTaskListType
accompanyingCourse also defined as a form option
2021-09-17 14:53:15 +02:00
17b6f287dc Changed name of PersonMenuBuilder
More general name since it also contains the AccompanyingPeriod task menu entry now.
2021-09-17 14:49:43 +02:00
01ae50aca7 new/show/edit/delete/list functionality added for accompanyingperiod task 2021-09-17 14:48:29 +02:00
210d819125 tp: adapt variables for include _insert_vue_address 2021-09-17 13:26:57 +02:00
8204107ceb Merge branch 'improve_address' into person_renderbox_thirdparty_onthefly 2021-09-17 13:26:28 +02:00
3f3b7af42b AddAddress: adjust Open and Close methods for each step 2021-09-17 13:25:18 +02:00
331dd286e7 AddAddress: adding a new stickyActions option 2021-09-17 13:25:18 +02:00
f048395a89 AddAddress: reorganize 4 steps Pane: show, suggest, edit, and date 2021-09-17 13:25:18 +02:00
6a60758c0d AddAddress: openPanesInModal, uniq option to enable/disable all step123 in Modal 2021-09-17 13:25:18 +02:00
782f0bc332 twig _insert_vue_address, rename mode create 2021-09-17 13:25:18 +02:00
4bafa83b65 Address: rename [Show|Edit]AddressPane files 2021-09-17 13:25:18 +02:00
6e42b08627 Address: remove unused file 2021-09-17 13:25:18 +02:00
3c5f0ce15e Merge branch 'improve_address' into person_renderbox_thirdparty_onthefly 2021-09-16 22:25:55 +02:00
7ab57eba9a AddAddress: adding useDate.validFrom/validTo options 2021-09-16 22:21:47 +02:00
3279db85de Merge branch 'improve_address' into person_renderbox_thirdparty_onthefly 2021-09-16 21:26:10 +02:00
6ab1391bd8 addAddress: allow other rootcomponent to not precise bindmodal options 2021-09-16 21:21:40 +02:00
ce40814aa9 Merge branch 'improve_address' into person_renderbox_thirdparty_onthefly 2021-09-16 21:17:29 +02:00
c58d1eccc5 AddAddress: rename callback method 2021-09-16 20:49:46 +02:00
f66df3b77c fix include parameters missing comma 2021-09-16 20:36:11 +02:00
2aa0bbf371 tp: fix bindModalStep variable rename with _insert_vue_address 2021-09-16 20:34:10 +02:00
0bb0b24c21 Merge branch 'improve_address' into person_renderbox_thirdparty_onthefly 2021-09-16 19:58:03 +02:00
aae2ee32f6 add-address sub-component key 2021-09-16 19:56:15 +02:00
8dbdc28df1 vue_accourse: AddAddress final submit, managed by callback and not an event 2021-09-16 19:56:15 +02:00
9ff58fe0c3 Address: replace variable entity.type by entity.name 2021-09-16 19:56:15 +02:00
da32afeb3f addAddress: improve boolean variables 2021-09-16 19:56:15 +02:00
a5ceb551eb twig pass arguments to vue_address with dataset attributes 2021-09-16 19:56:15 +02:00
17a3f45247 AddAddress final submit, managed by callback and not an event 2021-09-16 19:56:15 +02:00
a156bd0863 controller and templates adapted to display list of accompanying period tasks + detailpage of task 2021-09-16 15:55:09 +02:00
9ef91eabfb table style adjusted 2021-09-16 09:42:46 +02:00
310e9f5a82 tp: adapt _insert_vue_address include parameters 2021-09-15 18:41:14 +02:00
9725970c56 tp: adapt _insert_vue_address include parameters 2021-09-15 18:31:58 +02:00
546a2e4fa1 Merge branch 'improve_address' into person_renderbox_thirdparty_onthefly 2021-09-15 18:20:18 +02:00
c2f75654dd move _insert_vue_address include template in main, make it more generic
because it is used with person and household,
but prepare to extend for thirdparty
2021-09-15 18:17:06 +02:00
683eac91d8 thirdparty, manage case with only one type
in that case, type field is hidden, uniq type is automatically written in table
2021-09-15 16:25:55 +02:00
6e31e01e51 tp: rename field translation 2021-09-15 16:25:26 +02:00
e94790b8ab tp form: call vue_address to manage address, wip
show some limits with AddAddress:
* bug with option buttonText overriding default
* need to improve step1
2021-09-15 12:59:16 +02:00
92fae5cba2 tp list: table chill appearance, small action buttons 2021-09-15 12:54:46 +02:00
df28494f16 Merge branch 'household_integration' into person_renderbox_thirdparty_onthefly 2021-09-15 12:19:18 +02:00
4046a7ca9b before resume dashboards: disable accompanyingCourse resume persons, requestor, and resources 2021-09-15 12:14:03 +02:00
910016f722 tp: prepare address to be managed by vue (adapt formType) + add aliases methods isChild and isParent 2021-09-15 11:50:03 +02:00
a4f446c6b9 fix flashbag double col-8 2021-09-15 11:42:02 +02:00
b1dbd8b011 Menu entry added in PersonMenuBuilder of taskbundle. Removed from menubuilder in Personbundle. Rename file, PersonMenuBuilder to MenuBuilder? 2021-09-15 11:13:09 +02:00
d7a4e6c037 Banner context fixed parent() passed to template 2021-09-15 10:42:56 +02:00
e03f41ffbc user access rights put back in to place 2021-09-14 15:56:56 +02:00
2e5c2de363 Documents can be added/viewed/edited for an accompanyingCourse + menu entry added 2021-09-14 15:44:06 +02:00
Pol Dellaiera
951d686366 refactor: Update WOPI related stuff based on upstream changes. 2021-09-14 15:08:00 +02:00
Pol Dellaiera
fe533bc716 chore: Normalize composer.json file. 2021-09-14 15:07:23 +02:00
Pol Dellaiera
6c47ce53e7 chore: Remove duplicated entry from composer.json. 2021-09-14 15:06:22 +02:00
4448547fcd Merge branch 'master' into person_renderbox_thirdparty_onthefly 2021-09-14 14:11:33 +02:00
b80d109d8e fix vue_calendar encore_entry_link_tags 2021-09-14 11:51:36 +02:00
dd0e695ac2 Merge branch 'household_integration' 2021-09-14 11:30:46 +02:00
6a21bcc520 Merge branch 'rdv' 2021-09-14 11:30:05 +02:00
f7cb93fdac Update controller and the way they are autoloaded 2021-09-14 10:30:52 +02:00
7dc85b8474 vue_household_members_editor: address suggestions in bootstrap accordion style
+ store manage show/hide suggestions toggle (like householdSuggestions)
2021-09-13 19:15:04 +02:00
ee01020ae6 fix multiselect calendarUserSelector badge appearance 2021-09-13 16:38:43 +02:00
dcbac34b96 Merge branch 'aside-activity-merging' into 'master'
Various improvements for aside activity

See merge request Chill-Projet/chill-bundles!148
2021-09-13 14:17:06 +00:00
6fe78b7177 fix data provider 2021-09-13 16:12:25 +02:00
6fa0d229af enable test suite for aside activity 2021-09-13 15:25:10 +02:00
e4cfb4804b various improvements aside acdtivity 2021-09-13 15:20:01 +02:00
6c61b2da30 translations 2021-09-13 15:06:20 +02:00
dc2f094ca2 vue_household_members_editor: suggestions in bootstrap accordion style 2021-09-13 15:04:12 +02:00
4525f01d5f fix loading of paginator factory in CRUDCONtroller 2021-09-13 14:44:30 +02:00
3fe7e131a2 tests written and working 2021-09-13 13:55:17 +02:00
db92531257 dataFixtures fixed and executed + start of test script 2021-09-13 13:55:17 +02:00
5512e25cdf menu entries for admin section of aside activity categories changed but not yet complete 2021-09-13 13:55:17 +02:00
a0df8d8c61 create aside activity added to sections menu 2021-09-13 13:55:17 +02:00
a6826623bc query_builder added to form : only active users displayed in select list 2021-09-13 13:52:18 +02:00
267c3bae6e attempt to add aside activity to sections menu: not working yet 2021-09-13 13:52:17 +02:00
a131510ea8 dataFixtures made but not tested 2021-09-13 13:52:17 +02:00
eca00d155f aside activities query added to filter by current user 2021-09-13 13:52:14 +02:00
6680ba19ce final class changed for entity asideActivity + css fixed for record_action buttons 2021-09-13 13:50:49 +02:00
nobohan
813da1f9e0 rdv: reset calendar after all promises are done 2021-09-13 13:43:39 +02:00
337a6eb974 vue_household_members_editor: toggle suggestion button out of conditionnal record_actions 2021-09-13 13:29:37 +02:00
ed31dc3157 enable test for calendar 2021-09-13 13:13:17 +02:00
98729af065 vue_household_members_editor: fix store error with dispatch 2021-09-13 12:46:26 +02:00
75aa600a20 fix composer.json and upgrade base app 2021-09-13 12:41:55 +02:00
caca9ad71f Merge branch 'master' into person_renderbox_thirdparty_onthefly 2021-09-13 12:18:01 +02:00
5a4cb31ea5 Merge branch 'household_integration' into 'master'
household members integration

See merge request Chill-Projet/chill-bundles!143
2021-09-13 10:03:36 +00:00
nobohan
c82efc4fd5 rdv MR review: change name of routes + others modifications 2021-09-13 11:58:48 +02:00
6ab0007f02 fix: person-render-box need props options 2021-09-13 11:10:02 +02:00
672133fb5e repair banner in vue_household_members_editor component 2021-09-13 10:48:38 +02:00
nobohan
503c97d8c6 rdv: remove duplicate comment in rdv list 2021-09-13 10:01:52 +02:00
nobohan
5dc430ed31 rdv: various UI improvements on my calendar 2021-09-10 22:00:24 +02:00
nobohan
855686c0ba rdv: add content of calendar item in a modal 2021-09-10 17:31:19 +02:00
da9d81dc05 vue_accourse: GET form submit for no_household persons 2021-09-10 17:18:43 +02:00
fa938471aa vue_accourse: move no-household warning above table 2021-09-10 16:39:59 +02:00
c89e2662b1 household resume page, improve ux 2021-09-10 15:36:30 +02:00
b28b4e5fba templates + controller further adapted to work with accompanyingCourse. new and show methods don't work yet due to authorization/voter issues
templates adapted for use with accompanyingCourse tasks also
2021-09-10 15:19:59 +02:00
ead96f3836 tasks added to accompanyingCourse menu 2021-09-10 14:57:41 +02:00
nobohan
f6f24d0beb rdv: style my calendar 2021-09-10 14:11:48 +02:00
nobohan
29c148f924 rdv: can remove from delete calendar ranges 2021-09-10 14:11:48 +02:00
nobohan
0ab53f4659 rdv: add header 2021-09-10 14:11:48 +02:00
nobohan
c42ec1d493 rdv: plages de disponibilites: remove new events before it was saved 2021-09-10 14:11:48 +02:00
nobohan
82e76d7d5a rdv: plages de disponibilités: various UX/UI improvements 2021-09-10 14:11:47 +02:00
nobohan
0a274eb2a4 Enable DELETE in the ApiController 2021-09-10 14:11:47 +02:00
nobohan
6bfc180951 rdv: plages de disponibilites: copy the next day + refresh after save 2021-09-10 14:11:46 +02:00
nobohan
e1ccc8aba5 rdv: edition plage de disponibilités: copy events to next day (WIP) 2021-09-10 14:11:46 +02:00
nobohan
25b85fcc68 rdv: edit calendar ranges: add delete + doc swagger 2021-09-10 14:11:46 +02:00
nobohan
bcb36ddc11 rdv: edit calendar range: fix display of new calendar ranges 2021-09-10 14:11:45 +02:00
nobohan
6d607e3939 rdv: edit calendar ranges: create and update calendar ranges 2021-09-10 14:11:45 +02:00
nobohan
0fe6d7d00b rdv: add calendar range events in myCalendar 2021-09-10 14:11:44 +02:00
nobohan
329d3cc3d8 rdv: add API entry point for POSTing calendar range 2021-09-10 14:11:44 +02:00
nobohan
ee4d23ff82 rdv: init vue component for calendar range editing + refactor vue calendar code 2021-09-10 14:11:44 +02:00
nobohan
54ea954a5a rdv: init unit tests 2021-09-10 14:11:43 +02:00
nobohan
864f84fede rdv: change entrypoint for calendar css + correct calendar controls as a function of context 2021-09-10 14:11:43 +02:00
nobohan
68538f0e85 rdv: add user menu entry for my calendar list 2021-09-10 14:11:42 +02:00
nobohan
74957154b1 rdv: pages by User 2021-09-10 14:11:40 +02:00
ff7cb6ca79 adding unlink chill button 2021-09-10 11:40:59 +02:00
753e6c1105 adding a dev page with sass assets album 2021-09-10 11:34:08 +02:00
27077c9d96 adaptation of newTask() method in singleTaskController 2021-09-09 18:21:41 +02:00
88c192c22e change namespace migration 2021-09-09 17:44:37 +02:00
8a38712525 relation between task and accompanyingcourse created 2021-09-09 17:43:35 +02:00
05aaa32881 track all files added in other bundles 2021-09-09 16:46:26 +02:00
5211fb2fe9 Documents added to accompanying course menu 2021-09-09 16:42:53 +02:00
3a6a0da1dd accourse associated_persons: display alert warning if persons without household 2021-09-06 19:41:09 +02:00
e99a371f3a vue personRenderBox: adding an option to display householdLink 2021-09-06 19:39:52 +02:00
dba3ede9e1 when a person has a household without address: display no_data message, even if option addNoData is false 2021-09-06 18:46:37 +02:00
a94a757ae6 accourse: don't display old participations (fix counter) 2021-09-06 16:50:10 +02:00
cf78c59e76 vue personRenderBox when no returnPath 2021-09-06 16:37:30 +02:00
6e57d16ebf fix conflict with fa-ul and floatbutton (different with top or bottom) 2021-09-06 16:36:27 +02:00
f4ce634061 not used, see Entity/AddressRenderBox.vue in MainAssets 2021-09-06 16:18:08 +02:00
f9402ec981 adding confirmation modal when person leave accourse 2021-09-06 16:04:38 +02:00
98b0b3beeb applying floatbutton logic on person/thirdparty vue renderbox 2021-09-06 15:49:15 +02:00
1a95b44577 accourse: don't display old participations
(they will be still visible in history)
2021-09-06 15:12:53 +02:00
93c08f7e18 vue_accourse: adding current_household link on associated_persons 2021-09-06 15:05:08 +02:00
1262d8cc16 Merge branch 'improve_address' into household_integration 2021-09-06 12:52:25 +02:00
e5690b7575 Merge branch 'master' into household_integration 2021-09-06 12:32:09 +02:00
406426111a Merge branch 'post-prototypage' into 'master'
Post prototypage: vue household integration

See merge request Chill-Projet/chill-bundles!141
2021-09-06 08:00:29 +00:00
374ac652d4 AddAddress: submitNewAddress return callback payload, and parent patch date then postTo (TO BE MORE TESTED)
improve pattern for better reusability of AddAddress component
2021-09-04 14:26:03 +02:00
2208518ca0 AddAddress: add new address or update existing address: split fetch cascade and factorize reused functions 2021-09-04 12:47:47 +02:00
d51752fa41 Address, city/address selector: update writeNew flag when choose existing or create new 2021-09-04 12:40:42 +02:00
3ccc82147b Merge branch 'fix_address' into person_renderbox_thirdparty_onthefly 2021-09-03 18:57:33 +02:00
81f97980fc household members: fold/unfold accordion 2021-09-03 18:53:35 +02:00
8b945dc38b test a new chill help tooltip 2021-09-03 18:30:43 +02:00
b11592fb6d templates added and adapted, still problems with scope 2021-09-03 16:05:55 +02:00
d575b48e76 household banner: <a> tag inside <span> if we want flex order 2021-09-03 15:31:00 +02:00
3fefaf1e4d household summary: put member box in a reused include template 2021-09-03 13:59:31 +02:00
9b8b60ed75 twig person/thirdparty renderbox: add a customArea option
with 2 areas to begin:
* before the label
* after the label
2021-09-03 13:07:47 +02:00
f2f39d0922 household: improve ux in form to edit a member 2021-09-03 13:02:35 +02:00
eb067fe59b integration, test css class floatbutton 2021-09-03 13:01:24 +02:00
aad0d295ef services added to config files 2021-09-03 12:29:51 +02:00
46560da67d start of controller and formtype: adaptation from DocumentPersonController 2021-09-03 12:20:34 +02:00
3bb0e470bc entity recreated + repository + migration done 2021-09-03 11:26:04 +02:00
81b7e769e1 lightly increase heading 3-6 weight 2021-09-03 11:21:39 +02:00
7c37a5f583 a bunch of files that were deleted after doing composer.phar update 2021-09-03 11:04:34 +02:00
c51b129a5e AccompanyingCourseDocument created 2021-09-03 11:02:56 +02:00
21630a37af household banner: badge-member and holder mark in person theme 2021-09-03 10:59:44 +02:00
f2248a1e9c translation, wip 2021-09-03 09:59:54 +02:00
d8b2d3cd90 rename address-render-box component
(cfr b9602aa72 - file had been moved and renamed,
now we just rename component name into import and template
)
2021-09-02 22:28:32 +02:00
b14b27c110 Merge branch 'fix_address' into post-prototypage 2021-09-02 21:07:39 +02:00
f6e65dddbe vue Address: listen to citySelector to automatically fill city name and postcode fields 2021-09-02 21:06:11 +02:00
b940348452 Merge branch 'fix_address' into post-prototypage 2021-09-02 19:28:52 +02:00
90faa27461 vue Address: listen to adresssSelector to automatically fill street/number fields 2021-09-02 19:15:40 +02:00
a4118b1235 Merge branch 'person_renderbox_thirdparty_onthefly' into post-prototypage 2021-09-02 12:25:33 +02:00
903d57ea9d person_renderbox fix if there is no birthdate 2021-09-01 17:36:17 +02:00
820def6294 make onTheFly with API call 2021-09-01 17:35:11 +02:00
19a4542e2b creation of API endpoint thirdparty 2021-09-01 17:34:30 +02:00
9961c38b3c thirdparty onthefly, still with hardcoded data 2021-09-01 14:36:18 +02:00
f41997e6da creation api endpoint. Route found, but ajax call still needs to be tested 2021-09-01 14:33:31 +02:00
3927fd738c new choose button, improve household renderbox 2021-08-31 16:02:18 +02:00
b69fdd459a fix vue renderbox component name 2021-08-31 15:26:00 +02:00
1a2cb22b5b household, wip 2021-08-31 12:41:19 +02:00
3fa4f1b28b address multiline as option in householdrenderbox 2021-08-31 11:06:44 +02:00
c0d2454473 household render box flex table 2021-08-27 18:03:21 +02:00
2cffd61b86 Merge branch 'post-prototypage' of gitlab.com:Chill-Projet/chill-bundles into post-prototypage 2021-08-27 17:49:52 +02:00
b9602aa720 rename/move vue AddressRenderBox 2021-08-27 17:31:44 +02:00
219a41e034 rename/move vue AddressRenderBox 2021-08-27 16:12:26 +02:00
983bca97ac fix vue Address duplicate details 2021-08-27 15:55:39 +02:00
c1d19640a9 fix content position for household-members 2021-08-27 15:55:39 +02:00
5fd7d869bf Entity/PersonRenderBox.vue with render=badge 2021-08-27 15:55:39 +02:00
4f6011348d merge 2 subcomponent to use only Entity/PersonRenderBox.vue 2021-08-27 15:55:39 +02:00
d4430246f7 hop 2021-08-27 15:54:59 +02:00
8182e35c9c renderbox options changed to not display age for thirdparties, but yes in person modal 2021-08-27 15:13:21 +02:00
c258179017 move and rename vue HouseholdRenderBox 2021-08-27 11:02:35 +02:00
2333b5c6b4 rename some translations 2021-08-27 09:55:13 +02:00
a302f0fdbf invert firstname lastname when creating new person (TO BE CONFIRMED) 2021-08-27 09:35:28 +02:00
52a0c0e95b create new person: add an action and put action buttons in a dropdown 2021-08-27 09:30:15 +02:00
c5f40c53ea further adaptations to display deathdate. deathdate added to what API returns 2021-08-26 16:42:33 +02:00
5194cad354 Adaptations for display of age and deathdate (different scenarios not all finished) 2021-08-26 14:53:04 +02:00
34df295801 replace store by data() for OnTheFly creation in AddPersons component 2021-08-26 00:17:38 +02:00
ccb302ad28 move postPerson fetch method out of OnTheFly component for addPersons create person case
OnTheFly don't use store anymore, but addPerson still use it
2021-08-25 23:45:52 +02:00
a0fd3cd481 move postPerson fetch method from children to onthefly first level (to squash) 2021-08-25 22:47:00 +02:00
25f43bc758 move postPerson fetch method from grant-children to children (to squash) 2021-08-25 21:25:39 +02:00
e369e43b00 onthefly create new person: adding result in suggested/selected list 2021-08-25 18:46:06 +02:00
88362bd284 start of updating personrenderbox to display age. only one scenario done 2021-08-25 17:46:51 +02:00
5884fbaffc use operator in person search api 2021-08-24 00:02:37 +02:00
ddd1eb5d10 [person box] respect "demi-quadratin" in birthdate-deathdate separation 2021-08-24 00:01:56 +02:00
7d6def733c [person bloc] handle null values in date + improve layout on dead person
and age
2021-08-23 19:20:41 +02:00
bfed062910 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2021-08-23 19:02:55 +02:00
d3e52e81f1 Merge branch 'fix/person-creation' 2021-08-23 18:43:31 +02:00
647bdb2749 fix tests 2021-08-23 18:19:47 +02:00
8fb4a7110e fix double person creation + button for creating accompanying course on creation + simplification person create
The controller now register data from a previous post on the form, and
register it in the session.

The next post compare the data with previous one and, if yes, show a
review page if there are "alternate persons.
2021-08-23 17:55:56 +02:00
cd6aeefb07 ac menu: rename some items
https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/32
2021-08-23 15:55:24 +02:00
668b3e182e fix title of page translations and coherency 2021-08-22 22:24:46 +02:00
a0b914380b make badge-thirdparty as badge person, with just different color 2021-08-22 20:55:11 +02:00
bbc3399e19 ac list: pill badge for flags 2021-08-22 20:45:23 +02:00
52fa4b5549 ac work list: add an option to mask button text 2021-08-22 20:34:51 +02:00
3894c7a56d ac work: better color 2021-08-22 20:20:27 +02:00
4933edaa94 share accompanying_course_work-list on resume page 2021-08-22 20:13:42 +02:00
9fd455b622 adding sticky-form-buttons to activity list 2021-08-22 17:06:36 +02:00
3451bcaab1 réglages 2021-08-22 16:49:16 +02:00
d1344d6d54 activity list: an option disable edit and delete button (for resume page) 2021-08-22 15:17:17 +02:00
73a1d42ee7 fix conflict with AccompanyingPeriod list button 2021-08-22 14:55:30 +02:00
3ceb3d4b2b Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2021-08-22 14:46:20 +02:00
10b1edda11 improve concernedGroups in Activity list
TODO refund concernedGroups for better flexibility
2021-08-22 14:43:04 +02:00
a0f0e4e9ad disable 'Add an accompanying period in the past' in dropdown 2021-08-22 13:13:15 +02:00
b79c1f02da Accourse Work list: improve design 2021-08-22 13:05:45 +02:00
c798b1290c [course list in person file] remove action on course list 2021-08-22 11:56:51 +02:00
af0905c6e0 [person details page] remove addresses
L'adresse est indiquée dans le bandeau.

Les adresses de résidence sont gérées dans une entrée de menu spécifique
2021-08-22 11:47:52 +02:00
bd528c9025 [person list with period] add current showed person to new accompanying period 2021-08-22 11:41:52 +02:00
4fed96f988 Merge branch 'features/suggest-acc-course-persons-in-activity' 2021-08-22 11:28:57 +02:00
3bffde6123 fix global responsive_debug if env != dev 2021-08-22 10:34:35 +02:00
9fa82fc44c Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2021-08-22 10:33:04 +02:00
4001bb0996 Merge branch 'features/remove-parent-social-issues' into 'master'
Features/remove parent social issues

See merge request Chill-Projet/chill-bundles!137
2021-08-21 22:55:12 +00:00
d6135641c5 add a list of suggested persons on activity 2021-08-22 00:50:37 +02:00
075f22e79c configure SocialIssue consistency on Activity and AccompanyingPeriod 2021-08-22 00:02:22 +02:00
09e5cc1545 create api for social issue consistency 2021-08-22 00:02:22 +02:00
37b73931c4 ac work, design 2021-08-21 20:29:42 +02:00
4ad6786bf2 AccourseWork list : design title 2021-08-21 19:45:33 +02:00
d11c493e2d detail on resume accourse page 2021-08-21 17:41:08 +02:00
9795704532 adding global responsive_debug (false) in env=dev 2021-08-21 16:20:34 +02:00
883cb858a9 use chill_entity_render_box/string and design a badge-person 2021-08-21 15:10:25 +02:00
b301c1d405 flex-table accompanyingcourse-list used in two contexts + wraplist title style 2021-08-21 14:54:04 +02:00
6959de4e39 reorganise styles sheets in person/chill/scss 2021-08-21 12:59:46 +02:00
9c25132216 socialissues badge style in multiselect 2021-08-21 12:38:26 +02:00
87a917d11c accompanyingPeriod button 2021-08-21 10:32:11 +02:00
026562c32f remove unused styles 2021-08-21 10:04:20 +02:00
b37de4cd4f activity list: badges for issues, actions and reasons 2021-08-20 23:59:37 +02:00
14cbb1dd28 AccompanyingCourse: improve design of CourseLocation block 2021-08-20 23:04:51 +02:00
4d65c54996 [design proposal] adding a mixin to style social issue badge 2021-08-20 20:40:05 +02:00
2a3f869882 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2021-08-20 18:46:43 +02:00
d198c33f9c Merge branch 'improve_ux' into master 2021-08-20 18:43:35 +02:00
949a453b48 remove commented code + fix style 2021-08-20 18:41:57 +02:00
4f1a9c205f Merge branch 'ameliorations_composants_vue' into 'improve_ux'
Ameliorations composants vue

See merge request Chill-Projet/chill-bundles!134
2021-08-20 16:09:22 +00:00
638af4728f Merge remote-tracking branch 'origin/features/rdv' 2021-08-20 18:01:44 +02:00
742445e7b3 allow to close editor 2021-08-20 17:57:30 +02:00
4ee67869bd style fixes requestor + multiline option for thirdpartyrenderbox 2021-08-20 17:53:48 +02:00
nobohan
223efba655 rdv:add swagger config file for calendar bundle 2021-08-20 17:46:32 +02:00
nobohan
fec8fa50ed issue 190: fix flat and buildingName inversion in address normalizer 2021-08-20 17:15:08 +02:00
8bcd69c5ec requestor styling fixed + button added. problem with removing requestor though... 2021-08-20 16:55:41 +02:00
badf632a8a #134 fixes address multiline 2021-08-20 16:55:04 +02:00
7363092d51 #134 fixes show button for thirdparty 2021-08-20 16:52:35 +02:00
d2b0b9d7da reorganise flex-table assets, improve search results, and accompanyingPeriods list 2021-08-20 16:38:07 +02:00
nobohan
de8478f3e5 rdv: various UI improvements to the calendar 2021-08-20 16:14:51 +02:00
bf0a24b38e various fixes accompanying period 2021-08-20 15:07:36 +02:00
Marc Ducobu
026ac91e69 Injection firstPerson in doc 2021-08-20 15:01:59 +02:00
nobohan
6a6b1760f5 rdv: style properly the events when clicking 2021-08-20 14:56:18 +02:00
698514ef12 #192 custom-zone added + no_data message 2021-08-20 14:47:33 +02:00
38dcca7397 AccompanyingPeriod list: adding new wrapheader asset and improve wraplist structure
wrapheader manage header of flex-table first row. the 2 cascades are independant.
2021-08-20 13:35:15 +02:00
176b68417a Merge remote-tracking branch 'origin/master' 2021-08-20 13:01:03 +02:00
1d2299e143 Merge branch 'integrate_wopi_bundle' into 'master'
Integration of wopi bundle with controller

See merge request Chill-Projet/chill-bundles!133
2021-08-20 10:49:43 +00:00
20ef04683d Merge remote-tracking branch 'origin/features/rdv' 2021-08-20 12:48:37 +02:00
b9674d7d28 Merge branch 'master' into integrate_wopi_bundle 2021-08-20 12:45:11 +02:00
ffec80c5fd Merge remote-tracking branch 'origin/master' 2021-08-20 12:44:57 +02:00
7f28effc1e Associate generate document with evaluation and update UX to go back to
documents
2021-08-20 12:44:15 +02:00
28f69d8dec chill person assets: we need to use mixins and variables into sass sheets imported 2021-08-20 12:31:16 +02:00
55c34c2583 #134 fix dynamic URL to go to person or thirdparty file 2021-08-20 11:06:11 +02:00
80672a038c Merge remote-tracking branch 'origin/master' into integrate_wopi_bundle 2021-08-20 11:05:42 +02:00
3e27589cca #134 hLevel fixed 2021-08-20 10:37:46 +02:00
Marc Ducobu
9fc7ed0fb6 Merge branch 'docgen3' into 'master'
Docgen3

See merge request Chill-Projet/chill-bundles!135
2021-08-20 07:53:05 +00:00
Marc Ducobu
975f27f780 Good parameters for FOMULAIRE_AEB 2021-08-20 09:51:37 +02:00
Marc Ducobu
043e865eb0 Add column for DocGeneratorTemplate.index 2021-08-20 09:49:46 +02:00
Marc Ducobu
0479ddb42b Data injection in to file on openstack 2021-08-20 09:49:46 +02:00
f2b5cd7636 Accourse: toggle flags bg-danger in banner + misc 2021-08-20 01:35:01 +02:00
d100de4fcd In AccompanyingPeriod list, only show existing informations
That rule must be the same for each list,
we show empty datas messages in the complete show view
2021-08-20 00:46:28 +02:00
e711ac1feb Merge branch 'ameliorations_composants_vue' into improve_ux 2021-08-20 00:40:42 +02:00
5b8439e13c adding a new 'wraplist' sass element in flex-table collection: applied with AccompanyingPeriod lists 2021-08-20 00:38:40 +02:00
06abefd576 add redirection to wopi after doc generation 2021-08-19 23:30:45 +02:00
nobohan
3799627bf1 rdv: twig layout and field formatting 2021-08-19 21:50:52 +02:00
8295788d7f Merge branch 'feature/add-ChillWopiBundle' 2021-08-19 21:34:01 +02:00
52469d995a onTheFly modal, edit button changed to show person file 2021-08-19 21:07:37 +02:00
b4234ddc58 class made dynamic with correct hLevel option 2021-08-19 21:06:30 +02:00
71e6b356c3 Merge branch 'features/localize-accompanying-course-2' into 'master'
Improve UX for handling location in accompanying course

See merge request Chill-Projet/chill-bundles!125
2021-08-19 19:03:41 +00:00
bbcf9cc4ca handle creation of address 2021-08-19 20:59:17 +02:00
07030922e8 [household member editor] integrate with adresses and course
* redirection to a returnPath given into query search
* button for creating address
2021-08-19 20:00:20 +02:00
c16c517e97 [acc course location] allow to locate course from the index page 2021-08-19 20:00:20 +02:00
a0afaa568d [AccompanyingCourse location] Indicate course location on course index
page
2021-08-19 20:00:20 +02:00
75d3dfb830 Merge branch 'feature/link-evaluations-to-docgen' into 'master'
Feature/link evaluations to docgen

See merge request Chill-Projet/chill-bundles!130
2021-08-19 17:58:56 +00:00
a797143511 create document from evaluation 2021-08-19 19:47:27 +02:00
bb471fd4af AccompanyingCourse: fix errors with renderbox into Resources 2021-08-19 19:41:16 +02:00
fdd08905a8 init new twig block_post_menu 2021-08-19 19:40:32 +02:00
nobohan
4ae9b29924 rdv: correct redirections 2021-08-19 19:01:01 +02:00
Marc Ducobu
364346d0aa Merge branch 'docgen3' into 'master'
Docgen3

See merge request Chill-Projet/chill-bundles!132
2021-08-19 16:53:28 +00:00
nobohan
1a025ead1b rdv: twig layout + teleport calendar controls 2021-08-19 18:45:59 +02:00
Marc Ducobu
73c90f8c6a Debug docgen admin view error name 2021-08-19 18:42:07 +02:00
Marc Ducobu
772388298d Debug docgen view repository error name 2021-08-19 18:42:07 +02:00
Marc Ducobu
4184a74e7e Styling refactoring 2021-08-19 18:42:07 +02:00
Marc Ducobu
237476dc28 Save generated doc in openstack 2021-08-19 18:42:07 +02:00
Marc Ducobu
e6f5ef91ec Generation du doc àpd du template 2021-08-19 18:42:07 +02:00
755812ae3c fix buttonLocation deleted from last merge 2021-08-19 17:16:52 +02:00
Pol Dellaiera
c9cc0dd2a9 Update status code. 2021-08-19 17:03:22 +02:00
Pol Dellaiera
10c9526b49 Fix property name. 2021-08-19 16:58:41 +02:00
3602b0d097 requestor import fix alias 2021-08-19 16:50:08 +02:00
Pol Dellaiera
53cad32910 Update checkFileInfo 2021-08-19 16:49:55 +02:00
Pol Dellaiera
2a40645604 Pass the filename, not the id. 2021-08-19 16:33:04 +02:00
Pol Dellaiera
da505ed106 Add missing favicon url 2021-08-19 16:30:12 +02:00
Pol Dellaiera
fe4b9647b9 fix path to twig template. 2021-08-19 16:29:14 +02:00
Pol Dellaiera
1d7ef9300c Add missing router service. 2021-08-19 16:28:36 +02:00
Pol Dellaiera
bb9e175849 Add missing psr17 service. 2021-08-19 16:27:41 +02:00
Pol Dellaiera
5a3fd2712c refactor: Add test controller. 2021-08-19 16:25:53 +02:00
5dc92ed5bd Merge branch 'ameliorations_composants_vue' of gitlab.com:Chill-Projet/chill-bundles into ameliorations_composants_vue 2021-08-19 16:21:11 +02:00
nobohan
7e64ec0a45 rdv: fix conflict when merging features/rdv 2021-08-19 16:19:36 +02:00
Pol Dellaiera
0a183c8cfc Revert "fix: Fix services definitions."
This reverts commit 3599508a3b.
2021-08-19 16:11:33 +02:00
Pol Dellaiera
60328032d8 Revert "Remove obsolete controller."
This reverts commit 494573e5b4.
2021-08-19 16:11:32 +02:00
nobohan
cf4f25aaff rdv: update fixtures 2021-08-19 16:07:44 +02:00
Pol Dellaiera
71900010f6 fix: Fix property name. 2021-08-19 16:06:05 +02:00
Pol Dellaiera
3599508a3b fix: Fix services definitions. 2021-08-19 16:04:43 +02:00
Pol Dellaiera
b1c15ec8ce fix: Update checkFileInfo, getFile and putFile. Remove obsolete code in unsupported methods. 2021-08-19 16:03:19 +02:00
d61dbaed91 move vue thirdparty components in ChillThirdPartyBundle assets 2021-08-19 16:01:23 +02:00
nobohan
6a609eb1ab rdv: fix regression with multiple groups for property on calendar 2021-08-19 16:00:37 +02:00
9ac72a21d1 adding alias ChillThirdPartyAssets 2021-08-19 15:45:29 +02:00
fd8f4a98c0 vue Address: fix ShowAddress multiline option 2021-08-19 15:41:54 +02:00
Marc Ducobu
96ade5bd36 Merge branch 'fix-crud' into 'master'
fix crud paginator pbm

See merge request Chill-Projet/chill-bundles!131
2021-08-19 13:33:54 +00:00
Marc Ducobu
6383c1ca7b fix crud paginator pbm 2021-08-19 15:32:58 +02:00
Marc Ducobu
8be99bfe50 Merge branch 'docgen2' into 'master'
Api point for docgen templates

See merge request Chill-Projet/chill-bundles!129
2021-08-19 13:27:25 +00:00
13ff55c967 Desactivate tests which randomly fails with new fixtures 2021-08-19 15:25:11 +02:00
8c0d8692b0 Merge branch 'features/work-evaluation-save' into 'master'
[Social Work] Save evaluations

See merge request Chill-Projet/chill-bundles!126
2021-08-19 13:22:42 +00:00
nobohan
65bce1aacb rdv: available calendar ranges 2021-08-19 15:19:25 +02:00
2394895ccb Merge branch 'ameliorations_composants_vue' of gitlab.com:Chill-Projet/chill-bundles into ameliorations_composants_vue 2021-08-19 15:07:43 +02:00
60f7bdc926 serialization forr evaluations 2021-08-19 15:03:56 +02:00
6ca35d5a18 requestor adapted to use PersonRenderBox or ThirdPartyRenderBox 2021-08-19 14:47:41 +02:00
6253927e2e Merge branch 'ameliorations_composants_vue' into improve_ux 2021-08-19 14:31:20 +02:00
Pol Dellaiera
4f39676e97 Remove obsolete OpenStack and Configuration stuff. 2021-08-19 14:24:40 +02:00
Pol Dellaiera
84a460c4e7 Remove obsolete file. 2021-08-19 14:18:24 +02:00
Pol Dellaiera
494573e5b4 Remove obsolete controller. 2021-08-19 14:18:24 +02:00
Pol Dellaiera
c16fc77d01 fix: Fix service naming, remove the suffix. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
282539ae6b fix: Add wiring for UserProviderInterface. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
50f1d3cd10 fix: Add UserProviderInterface dependency. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
4e04714a42 fix: Add wiring for UserProviderInterface. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
8992b99d56 fix: Add user data. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
62536ab2ff fix: Format date properly. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
b189726380 fix: Fix mimeType detection/discovery. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
a63c26482e fix: Fix mimeType detection/discovery. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
c208797daf fix: Update StoredObject entity. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
0366d0cb17 fix: Add exceptions. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
2b7fa630fc refactor: Add nyholm/psr7. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
a41b959fbd refactor: Fix TempUrlGeneratorInterface wiring. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
e4d9129af2 refactor: Add TempUrlGeneratorInterface wiring. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
72fc6e05cc refactor: Add WopiInterface wiring. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
47a2af6f19 Update composer.json. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
1bd01aefae refactor: Update ChillWopiBundle - Work in progress. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
c6b6fa5bf6 refactor: Update ChillDocStoreBundle - Add StoredObject repository. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
36d582c8ab Update configuration. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
df544bdfa4 update 2021-08-19 14:17:54 +02:00
Pol Dellaiera
12e17fac82 debug 2021-08-19 14:17:54 +02:00
Pol Dellaiera
b2d84a7677 Update. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
ebb679dbbb Update services.php. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
61bb595bba Update Test controller. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
c7aafc6730 Update services.php 2021-08-19 14:17:54 +02:00
Pol Dellaiera
24b675ce97 Fix path to services.php. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
3c888238c5 Fix services file. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
1bd00535ce Update services for controllers. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
d616e00660 Add test routes and controller. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
5d5ad9e4f7 Fix OpenStack service. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
28af73db19 Fix typo. 2021-08-19 14:17:53 +02:00
0f87d77896 Merge branch 102_activites_annexes into 'improve_ux' 2021-08-19 14:08:23 +02:00
8b50e5bd62 comment TODO 2021-08-19 12:41:38 +02:00
f490fdd37c batch remove 'Bravo' 2021-08-19 12:41:38 +02:00
7ffdf4cb1f render_box person and thirdparty: fix bug customOptions with 'replace' 2021-08-19 12:41:38 +02:00
801e897a38 Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles 2021-08-19 12:40:05 +02:00
21db8674e7 thirdparty: replace macro address by render_box 2021-08-19 12:38:07 +02:00
de7322464b deathdate fix in personrenderbox, in case there is a deathdate 2021-08-19 12:32:26 +02:00
90cfcd0569 ThirdPartyRenderBox created and old view replaced 2021-08-19 12:31:38 +02:00
4a0ffd2cba flex-table taken out of for-loop 2021-08-19 12:29:08 +02:00
3e9d96368d style added to create space between streetname and city + margin of flex-table fixed 2021-08-19 12:26:00 +02:00
227d627ad5 Merge branch 110_extend_thirdparty into 'master' 2021-08-19 12:19:00 +02:00
c7a2bbfc1d remove dump debug 2021-08-19 12:17:16 +02:00
Marc Ducobu
d8ca9cf082 Api point for docgen templates 2021-08-19 11:15:20 +02:00
nobohan
0457ee2b8d rdv: add my calendar + checkbox 2021-08-19 10:52:47 +02:00
bab06796f1 improve editing of evaluation
- an evaluation type can be repeated multiple times on the same action;
- in vue, evaluation are listed by key, not id,
- adding an evaluation make appears directly in "edit" mode;
- ...
2021-08-19 10:14:10 +02:00
nobohan
7c4f976230 rdv: add user calendar endpoint + add this calendar in the calendar 2021-08-18 23:16:52 +02:00
1aa77bd1c4 AccompanyingCourse: uniformity of styles 2021-08-18 22:36:02 +02:00
39e8af48b4 #198 issue fixes: mostly template fixes and translations 2021-08-18 22:31:43 +02:00
9447516694 fix bug in saving evaluation dates 2021-08-18 22:30:32 +02:00
9a1f56a820 [Aside activity] Temporarily remove the link to aside activities 2021-08-18 21:23:04 +02:00
nobohan
dbf72774c2 rdv: add main user in fullcalendar form 2021-08-18 21:09:08 +02:00
nobohan
a70d5cc263 rdv: fullcalendar: save calendarRange id as an extended prop in the calendar entity 2021-08-18 21:09:08 +02:00
nobohan
07eb5c797a rdv: fullcalendar: manage event clicking 2021-08-18 21:09:08 +02:00
nobohan
a54434a677 rdv: add fr locale to fullcalendar + colorise users calendars 2021-08-18 21:09:08 +02:00
nobohan
ca9738b55a rdv: fullcalendar: add current user by default 2021-08-18 21:09:08 +02:00
nobohan
b40c25595a rdv: fullcalendar: select and unselect user calendars 2021-08-18 21:09:08 +02:00
nobohan
e6deb6bc7a rdv: fullcalendar: update events source dynamically 2021-08-18 21:09:08 +02:00
nobohan
e499ebdf8b rdv: add dynamic event sources in fullcalendar (WIP) 2021-08-18 21:09:08 +02:00
nobohan
07f086dd61 rdv: fix calendar users loading for multiselect 2021-08-18 21:09:08 +02:00
nobohan
f2d79919f0 rdv: add calendar user selector widget 2021-08-18 21:09:08 +02:00
nobohan
02a9e21f62 rdv: set the calendar ranges as an API point + fetch them into the calendar view 2021-08-18 21:09:08 +02:00
nobohan
323434f34e rdv: add fixture for calendar range 2021-08-18 21:09:08 +02:00
nobohan
afad23eb0f rdv: fix timezone issue for editing events 2021-08-18 21:09:08 +02:00
nobohan
981c819f56 rdv: add current event date when edit 2021-08-18 21:09:07 +02:00
nobohan
9907b59379 rdv: renaming of variable + enable to display selected event 2021-08-18 21:09:07 +02:00
nobohan
dc3c8a4032 rdv: translations + layout (twig) 2021-08-18 21:09:07 +02:00
nobohan
95b50f2b99 rdv: add calendar list in menu 2021-08-18 21:09:07 +02:00
nobohan
b106a03534 rdv: hook i18n translations into the App.vue 2021-08-18 21:09:07 +02:00
nobohan
b7c5a459f7 rdv: change type of date to datetime in calendarRange 2021-08-18 21:09:07 +02:00
nobohan
4a6914be22 rdv: use datetime instead of date fields 2021-08-18 21:09:07 +02:00
nobohan
5181098339 rdv: connect fullcalendar vue component to startDate and endDate fields 2021-08-18 21:09:07 +02:00
nobohan
cc3e7f54a7 rdv: minor corrections following MR review 2021-08-18 21:09:07 +02:00
df7e76a2e7 rdv: MR comment 2021-08-18 21:09:07 +02:00
ccd5ac74fd rdv: MR comment 2021-08-18 21:09:07 +02:00
29c2ed3ce8 rdv: MR comment 2021-08-18 21:09:07 +02:00
4c17ce7926 rdv: MR comment 2021-08-18 21:09:07 +02:00
d49fd9738b rdv: MR comment 2021-08-18 21:09:07 +02:00
892e43d195 rdv: MR comment 2021-08-18 21:09:07 +02:00
nobohan
fe3cbdadab rdv: fullcalendar: add 3 buttons 'month - week - day' 2021-08-18 21:09:07 +02:00
nobohan
c54290a265 rdv: adapt calendar entities: drop useless field and change field type 2021-08-18 21:09:07 +02:00
nobohan
de6df983a0 rdv: add translations 2021-08-18 21:09:07 +02:00
nobohan
0585455bbe rdv: fullcalendar vue: use store and add an event on date select 2021-08-18 21:09:07 +02:00
nobohan
f508971b6a rdv: add fullcalendar.js as a vuejs component (POC) 2021-08-18 21:09:07 +02:00
nobohan
5c8b247f40 rdv: correct edit page 2021-08-18 21:09:07 +02:00
nobohan
9c7c890943 rdv: delete a rdv 2021-08-18 21:09:07 +02:00
nobohan
7e02b284ca rdv: others pages: edit, list 2021-08-18 21:09:07 +02:00
nobohan
d4ec5d137e rdv: add validation 2021-08-18 21:09:07 +02:00
nobohan
d542f582e6 rdv: allow null concerned persons in form 2021-08-18 21:09:07 +02:00
nobohan
3c37802821 rdv: add show calendar 2021-08-18 21:09:07 +02:00
nobohan
227be0b482 rdv: add default status on rdv when creating a new rdv 2021-08-18 21:09:07 +02:00
nobohan
4b8736ae57 rdv: fix adding thirdparty when creating a rdv 2021-08-18 21:09:07 +02:00
nobohan
206347de91 rdv: add entity to serialize (WIP) 2021-08-18 21:09:07 +02:00
nobohan
516c286519 rdv: can add thirdparty to a rdv 2021-08-18 21:09:07 +02:00
nobohan
adc462b735 rdv: simplify the vuejs component (removed not used parts) 2021-08-18 21:09:07 +02:00
nobohan
43d6dc835f rdv: add thirdParty in concerned persons (WIP) 2021-08-18 21:09:07 +02:00
nobohan
1557b8f80a rdv: add the concernedGroup vuejs component in add a new rdv 2021-08-18 21:09:07 +02:00
nobohan
20d113b1db rdv: some fixes for the new rdv 2021-08-18 21:09:06 +02:00
nobohan
114df16e0f rdv: add new rdv form 2021-08-18 21:09:06 +02:00
nobohan
b01eba2533 rdv: add route, twig for listing and creating calendar items 2021-08-18 21:09:06 +02:00
nobohan
75caf3fa14 rdv: adapt entities + add fixtures 2021-08-18 21:09:06 +02:00
nobohan
fdccdfe7b1 rdv: add first migration 2021-08-18 21:09:06 +02:00
nobohan
38ec2b5de9 rdv: correct entities with FQCN 2021-08-18 21:09:06 +02:00
nobohan
3010df2016 calendar: add entities 2021-08-18 21:09:06 +02:00
nobohan
3e7a9522b6 init Calendar bundle 2021-08-18 21:09:06 +02:00
d652771af0 CourseLocation: fix errors 2021-08-18 20:10:43 +02:00
9d655d92f2 CourseLocation: add message if no address 2021-08-18 17:45:37 +02:00
9e51717984 Merge branch accourse_confirmation into 'master' 2021-08-18 17:23:27 +02:00
a6b360c193 setup of ThirdPartyRenderBox 2021-08-18 17:20:57 +02:00
42b9e25403 some todo's added in comment + most href's made dynamic 2021-08-18 17:20:17 +02:00
403922c631 AccompanyingCourse, change blocs order (location in second position) 2021-08-18 17:10:37 +02:00
53fe90adc3 AccompanyingCourse: check if conditions of confirmation are met, or display alert 2021-08-18 16:54:22 +02:00
41fe95c80f fix display styles bugs 2021-08-18 16:54:22 +02:00
28435940f1 AccompanyingCourse api errorMsg 2021-08-18 16:53:06 +02:00
34e1a9b748 address added to personrenderbox w/ ShowAddress. Adapted to include a multiline option 2021-08-18 16:22:38 +02:00
097ad3a364 fix return type of class 2021-08-18 09:56:48 +02:00
816d860f4a Merge branch 'fixtures/fix-loading-people' into 'master'
Fixtures/fix loading people

See merge request Chill-Projet/chill-bundles!124
2021-08-17 20:01:29 +00:00
c7cc2c7596 Fixtures/fix loading people 2021-08-17 20:01:29 +00:00
6ad8a73fc0 Merge branch 'master' into 110_extend_thirdparty 2021-08-17 20:47:58 +02:00
4cf676858e Merge branch add-location-period into 'master' 2021-08-17 18:37:07 +02:00
b87046dcd6 comment all console.log in AccompanyingCourse component 2021-08-17 18:32:43 +02:00
76eea2a4eb fix title that doesn't match to the page 2021-08-17 17:47:16 +02:00
7ba3e0287a Address: adding hideDateFrom option to hide field DateFrom on step1 2021-08-17 17:24:27 +02:00
54ac122863 Merge branch 'features/add-search-api-for-users' into 'master'
extend search api to users

See merge request Chill-Projet/chill-bundles!121
2021-08-17 15:20:30 +00:00
eac4c48d8f deathdate added if not null 2021-08-17 16:30:26 +02:00
160383e3a3 AccompanyingCourse: precise address person locator + minors stuffs 2021-08-17 16:23:16 +02:00
7af85bc401 AddressRenderBox created and added to PersonRenderBox, still some styling issue with address. Render options not done yet 2021-08-17 16:14:08 +02:00
cdc6cf211a AddAddress option buttonType: component manage button in edit or create context 2021-08-17 15:41:03 +02:00
Marc Ducobu
f12dc97d57 Merge branch 'fix-bug-empty-cb' into 'master'
Fix error when options['customButtons'] is empty

See merge request Chill-Projet/chill-bundles!123
2021-08-17 13:26:13 +00:00
Marc Ducobu
a58bdb466c Fix error when options['customButtons'] is empty 2021-08-17 15:23:57 +02:00
1a6c0529cc date formatting using dateToISO function, still fix with translations. + record-actions inserted via <slot> 2021-08-17 14:05:48 +02:00
Marc Ducobu
23366d5582 Merge branch 'docgen-fix' into 'master'
Fix error about not opened bracket

See merge request Chill-Projet/chill-bundles!122
2021-08-17 12:04:55 +00:00
Marc Ducobu
f58be46466 Fix error about not opened bracket 2021-08-17 14:03:18 +02:00
65e72b05c5 Merge branch 'master' into 102_activites_annexes 2021-08-17 13:16:01 +02:00
Marc Ducobu
069b3d1839 Merge branch 'docgen' into 'master'
Debut bundle DocGen

See merge request Chill-Projet/chill-bundles!119
2021-08-17 09:44:14 +00:00
Marc Ducobu
cbdf976885 Adding context 2021-08-17 11:42:30 +02:00
Marc Ducobu
8df4c93c97 Datafixtures for Doc Gen 2021-08-17 11:42:30 +02:00
Marc Ducobu
5ce6d37a69 Controller to generate a doc 2021-08-17 11:42:30 +02:00
Marc Ducobu
7dc501cbda Creation of DocGenTemplate entity 2021-08-17 11:42:30 +02:00
Marc Ducobu
8207db4b45 First Version DocGenerator 2021-08-17 11:42:30 +02:00
f5c5038fda v-for loop on add-evaluation subcomponent 2021-08-17 11:42:30 +02:00
436d583f65 getter/setter for form input date 2021-08-17 11:42:30 +02:00
533865c41a show evaluation details 2021-08-17 11:42:30 +02:00
14c0c9763f fix styles flashbag and action-row 2021-08-17 11:42:30 +02:00
a54e70f9e0 set small fields in form evaluation 2021-08-17 11:42:30 +02:00
63b820784f save/hide form evaluation 2021-08-17 11:42:30 +02:00
71b54622e2 simplify styles cascade 2021-08-17 11:42:30 +02:00
190549180b add FormEvaluation subcomponent 2021-08-17 11:42:30 +02:00
375326fc32 add/remove evaluation from evaluation list 2021-08-17 11:42:30 +02:00
a1435314a0 comment all console.log 2021-08-17 11:42:30 +02:00
8d98a144fd automatic rearrange code (indentation: 3) 2021-08-17 11:42:30 +02:00
d0fa28db2a display evaluations for action 2021-08-17 11:42:30 +02:00
9ac14ff5e3 prepare subcomponents for evaluation, share addResult styles 2021-08-17 11:42:30 +02:00
d67483fd9a add options on button for AddPersons component: size, type and display
* size: add bootstrap class : btn-sm, btn-lg..
* type: override chill button class : btn-update, btn-chill-beige
* display: override default : true
2021-08-17 11:42:30 +02:00
3156706c2b vue accompanyingcourse_work: prepare evaluations, + translations chains + styles border 2021-08-17 11:42:30 +02:00
44e85361e6 add endpoint for listing evaluation 2021-08-17 11:42:30 +02:00
320f16a121 [accompanyingPeriodWorkEvaluation] store comment in db 2021-08-17 11:42:30 +02:00
5635d19252 [accompanyingPeriodWork] add evaluation to normalizer 2021-08-17 11:42:30 +02:00
6544566c34 fix test PersonSearch by adding html node filtering 2021-08-17 11:42:30 +02:00
9f7c0dcd09 adding addresses to accompanying period 2021-08-17 11:42:30 +02:00
0e2e7155fb Load social work, and fix some repositories 2021-08-17 11:42:30 +02:00
8a962a4f1c refactor loading for social issues using real data 2021-08-17 11:42:30 +02:00
2f699d32b0 create entity and schema 2021-08-17 11:42:30 +02:00
72a1ac02eb add address suggestion by household 2021-08-17 11:42:30 +02:00
c420d2bfd7 Add address suggestion for a person 2021-08-17 11:42:30 +02:00
8d2b1fbe13 add test for accompanying period location validity 2021-08-17 11:42:30 +02:00
a3a5d5cfd0 [AccompanyingPeriod] create constraints for location 2021-08-17 11:42:30 +02:00
3302d69373 [AccompanyingPeriod] add flashbag message when located temporarily 2021-08-17 11:42:30 +02:00
f188cc2d27 [AccompanyingPeriod] add location to serialization 2021-08-17 11:34:39 +02:00
8f9c8bc1a6 update schema to store location on accompanying period 2021-08-17 11:34:39 +02:00
43f9e50100 Merge branch 'features/add-location-period' of gitlab.com:Chill-Projet/chill-bundles into add-location-period 2021-08-17 09:36:50 +02:00
aa0ff37479 Address: fix option regression 2021-08-17 09:04:58 +02:00
20cdec20d2 accompanyingCourse: ckeditor for comment bloc + sass color variables in app.vue 2021-08-16 20:25:09 +02:00
0abb4983f7 open confirmation modal when assigning person Location 2021-08-16 19:42:55 +02:00
5a716a3523 [Household members editor] add address suggestion on menage creation 2021-08-16 19:07:03 +02:00
29b5e700f6 rename key in payload 2021-08-16 18:38:08 +02:00
e8e2607076 rename method to avoid confusion 2021-08-16 16:27:15 +02:00
107699ec31 patch Address to accompanyingPeriod: build payload for differents cases
use uniq patch api endpoint, build payload body in action,
call updateAddress action when submitting, assigning or removing.
2021-08-16 16:26:45 +02:00
25465b1121 [AccompanyingCourse] re-introduce flashbag on temporarily locations
See 4e8dd3b189
2021-08-16 15:42:36 +02:00
Marc Ducobu
8834f200df Removing un-used code 2021-08-16 15:42:36 +02:00
Marc Ducobu
cc84c067c5 Other social entities became editable via admin 2021-08-16 15:42:36 +02:00
Marc Ducobu
d8ee42b0a5 SocialIssues became editable via admin 2021-08-16 15:42:36 +02:00
Marc Ducobu
a948d9e2da Add license text 2021-08-16 15:42:36 +02:00
Marc Ducobu
c9a5d0548c Removing spaces at the end of line 2021-08-16 15:42:36 +02:00
Marc Ducobu
c37ba5db6a Removing spaces at the end of line 2021-08-16 15:42:36 +02:00
54c4524b27 extend search api to users 2021-08-16 14:39:18 +02:00
966292cdd5 pass props to ButtonLocation 2021-08-16 12:18:08 +02:00
9d1166d8fc add removeAddress button; buttonType different with edit context 2021-08-16 10:56:24 +02:00
1b3904f8e3 rename variable displayText 2021-08-16 10:19:53 +02:00
77fe497994 altNames displayed dynamically 2021-08-14 12:01:44 +02:00
b89a66b20c dynamic properties displayed 2021-08-13 18:31:15 +02:00
2d2bb117ca condition on persons to see button location 2021-08-13 17:54:58 +02:00
17dd52c3dc import ShowAddress in CourseLocation, with alert if temporary address 2021-08-13 17:20:58 +02:00
d6e41e5ac7 Merge branch 'address_refactoring' into add-location-period 2021-08-13 16:59:37 +02:00
b0187d0594 add file ShowAdressPane that contains ShowAddress, because ShowAddress must be called in several files 2021-08-13 16:58:48 +02:00
ea691d9b32 Merge branch 'address_refactoring' into add-location-period 2021-08-13 16:13:09 +02:00
1d2cbc4f62 minor details 2021-08-13 16:11:49 +02:00
5e0c930087 CourseLocation: action and mutation for updateLocation, hide button if personLocation 2021-08-13 16:08:42 +02:00
f535e794a7 Merge branch 'address_refactoring' into add-location-period 2021-08-13 16:04:15 +02:00
2f28e02f65 prepare vue Address to be used too in accompanyingCourse context
i18n is managed by root component:
* ok for person and household implementation (=> they use Address root component)
* but must be imported in vue i18n file if called from another component

submitAddress is emit to parent, it allow to control final action:
* casting final submitNewAddress with POST requests (for person or household entity);
* or dispatching changes from store, casting only payload to be used.

remove and simplify some options: backurl is always used with person/household,
and never if called from another vue component.
2021-08-13 16:01:15 +02:00
438134690f styling fixed with proper class cascade 2021-08-13 14:57:56 +02:00
166144e57e first conditionalities added analog to twig template 2021-08-13 13:15:08 +02:00
1600d3d271 Merge branch 'address_refactoring' into add-location-period 2021-08-13 10:26:12 +02:00
4b69f97e2f vue AddAddress: merge api files in the person bundle 2021-08-13 10:23:46 +02:00
64433b420d CourseLocation: view current location 2021-08-12 17:05:43 +02:00
8f9d4a1765 Merge branch 'address_refactoring' into add-location-period 2021-08-12 16:46:25 +02:00
c302452e01 improve Address reusability: move i18n translations out of root component 2021-08-12 16:45:41 +02:00
6bb5440220 injecting person data into renderbox, no styling yet 2021-08-12 16:23:58 +02:00
c48586cd0e renaming of PersonItem into ParticipationItem 2021-08-12 15:55:35 +02:00
205c48f58a courseLocation: init Address context in the store 2021-08-12 15:55:10 +02:00
368bbcf9b2 Merge branch 'address_refactoring' into ggg 2021-08-12 15:53:42 +02:00
76a4b24aa1 improve vue Address options (to be checked in all context) 2021-08-12 15:50:27 +02:00
21fd69488f start of PersonRenderBox in vue 2021-08-12 15:21:33 +02:00
f6376118a0 commented out unneccesary lines for migration 2021-08-12 11:54:50 +02:00
a6001c195a templates added and adapted for delete, list en view of aside activity 2021-08-12 11:53:04 +02:00
8829d234ec adapt to show date of death. it adapts but does not show actual date of death yet 2021-08-12 11:50:11 +02:00
6ee0acfa0f vue_accourse: adapt stickynav numerotation with 2 new blocs
+ let IDE make corrections in theses files
2021-08-12 11:37:25 +02:00
7d97889cbf templates changed to use the standard CRUD templates + delete template added 2021-08-10 15:45:00 +02:00
Pol Dellaiera
364aff36a4 Add initial set of files. 2021-08-10 15:13:46 +02:00
Pol Dellaiera
3f1b5b2319 Add ChillWopiBundle. 2021-08-10 15:13:34 +02:00
fc6a9ad64f migration files moved into bundle 2021-08-10 14:23:07 +02:00
4c7129a3b2 aside activities added to user menu 2021-08-10 14:19:01 +02:00
bbb69bcfe0 list template adapted to display aside activities ordered by date (DESC) 2021-08-10 14:18:37 +02:00
a1ed0d3ce4 list.html.twig template added and adapted to display list of aside activities, still need to adapt to show only activities of logged in user 2021-08-10 11:32:27 +02:00
fb43980a2a everything changed to datetime 2021-08-10 10:56:45 +02:00
da98b42c8c Merge branch 'address_refactoring' into add-location-period 2021-08-08 22:34:51 +02:00
840ffe42a6 fix patchAddress with date validFrom 2021-08-08 22:27:39 +02:00
1f8c343a89 submitAddress doesn't take arguments 2021-08-08 22:01:27 +02:00
f6a02e157d manage validFrom date, wip (patchAddress return 500) 2021-08-08 22:01:27 +02:00
21957846b0 fix more precise condition 2021-08-08 12:30:31 +02:00
1c7e1b55f8 standard successText seems better 2021-08-08 12:30:31 +02:00
ea391d18e9 fix display alerts above 2021-08-08 12:30:31 +02:00
72cd9f452e fix 500: in edit context, we don't need to postAddressTo a second time ! 2021-08-08 12:30:31 +02:00
44313b507a twig include allow to pass mode:edit option when it's not detected 2021-08-08 11:14:31 +02:00
46bd70881e Address i18n: manage specific translations 2021-08-08 10:34:02 +02:00
fbf343dd19 keep this unused subcomponent file, wrote for Address with household 2021-08-08 09:59:31 +02:00
028af50dbc Vue HouseHoldAddress is now unused and can be dropped 2021-08-08 09:50:35 +02:00
0075fed9a5 submit methods: first promise is shared for person or household context 2021-08-08 09:48:42 +02:00
62dc94bb14 Twig: test address_id in url and substring 'edit' in route 2021-08-08 08:35:52 +02:00
c075ff199d fix and rename variables + remove comments 2021-08-07 19:21:34 +02:00
e178183cef corrections + details 2021-08-07 18:50:10 +02:00
63fbf4b249 make Address works with household context 2021-08-07 17:29:45 +02:00
9f77b84e48 prepare to merge HouseholdAddress in Address: split api.js files 2021-08-07 15:47:38 +02:00
fae196d3eb prepare AccompanyingCourse Location sub-component to use Address 2021-08-07 15:40:26 +02:00
ca4d542604 Merge branch 'address_refactoring' into add-location-period 2021-08-07 12:01:14 +02:00
75be8aa557 enable vue CourseLocation and mark place where it must connect to Address component 2021-08-07 12:00:08 +02:00
9e94cea9d5 mark potential place where template must include vue_address component 2021-08-07 11:51:15 +02:00
6d58bf152b Merge branch 'address_refactoring' into add-location-period 2021-08-06 21:50:04 +02:00
47d704b521 passing option backUrl from include template twig 2021-08-06 21:46:10 +02:00
cdbd97e595 passing option binModalStep from twig include template 2021-08-06 21:32:10 +02:00
24714227b8 transmit all options from a twig include template 2021-08-06 21:20:59 +02:00
da09e10fb1 adding options in root component to see result or redirect (not working) 2021-08-06 17:36:19 +02:00
b74f9cf5dc getting all the asideActivity form to work with all fields. Still bug with DateTimeImmutable value somehwere 2021-08-06 17:35:46 +02:00
b62597426c classes for address-valid 2021-08-06 16:41:29 +02:00
6c0ab6f25e when creating new address, start first with edit panel 2021-08-06 16:41:29 +02:00
9f3ceb94f0 adding options to custom button, and improve stepWithModal options 2021-08-06 16:39:21 +02:00
Marc Ducobu
6b4e27a531 Merge branch 'issue_43_admin_for_prob_soc' into 'master'
WIP : Issue 43 admin for prob soc

See merge request Chill-Projet/chill-bundles!56
2021-08-06 13:36:31 +00:00
Marc Ducobu
3be024bf6b Removing un-used code 2021-08-06 15:21:35 +02:00
Marc Ducobu
88847cb19c Other social entities became editable via admin 2021-08-06 15:21:35 +02:00
Marc Ducobu
ad5eed4c26 SocialIssues became editable via admin 2021-08-06 15:21:35 +02:00
Marc Ducobu
25eee88693 Add license text 2021-08-06 15:21:34 +02:00
Marc Ducobu
c32ca59c76 Removing spaces at the end of line 2021-08-06 15:21:20 +02:00
Marc Ducobu
94b0432bb9 Removing spaces at the end of line 2021-08-06 15:21:20 +02:00
9ee140a7d8 loading of asideactivityform service moved to form.yaml 2021-08-06 11:52:01 +02:00
5d598bf46b translations adjusted 2021-08-06 11:42:52 +02:00
8649d49d98 date field added and activity type field. Form listed as service in services.yaml
asideactivity form added as service to inject necessary arguments
2021-08-06 11:40:57 +02:00
d67b99b269 class changed into final class 2021-08-06 11:26:37 +02:00
01cc230136 Submitting address, and validFrom field 2021-08-05 22:04:41 +02:00
ac999a4f17 Merge branch 'master' into add-location-period 2021-08-05 15:34:28 +02:00
794c7d0c4a Merge branch 'master' into bootstrap5 2021-08-05 15:13:55 +02:00
07ffc86ced Merge branch '167-social-issue-recursive-list' into 'master'
[API] Social Issue recursive sort

See merge request Chill-Projet/chill-bundles!99
2021-08-05 09:49:13 +00:00
718933af75 Merge branch 'address_refactoring' into add-location-period 2021-08-04 23:38:04 +02:00
884de5c19e address refactoring: resolve lack of flexibility for many implementations (modal/not, overriding, options, etc. )
address creation/edition is unchanged
many variables are renamed to improve logic and readability
2021-08-04 23:24:52 +02:00
d948ba0cd5 form.yaml created in attempt to fix translatableasideactivitycategory form type 2021-08-04 17:46:20 +02:00
0072f4c676 start of two new fields to select category and duration, but not working... problem with construct method in form 2021-08-04 16:34:13 +02:00
72b43e9a99 form type created to handle selection of asideactivity categories, not yet operational 2021-08-04 16:32:06 +02:00
7a56ff7d29 translations yaml file created 2021-08-04 16:30:27 +02:00
51f4d2ab0e changed TextType to TranslatableStringFormType 2021-08-04 15:21:08 +02:00
4716ab3e3c twig template adapted to use with asideActivityCategory 2021-08-04 15:20:21 +02:00
3d630eeedf PaginatorFactory error fixed provisionary. This should probably be done with dependency injection throughout the whole file though, to be checked 2021-08-04 15:19:43 +02:00
61d8e06975 typehints fixed 2021-08-04 15:13:45 +02:00
eec913375e obsolete annotation deleted @packages 2021-08-04 15:12:44 +02:00
7f3b266209 new migration 2021-08-04 10:34:39 +02:00
85b7e4add8 use statement added 2021-08-03 16:50:07 +02:00
fadf2d62b0 use statements added and typehint updatedAt fixed 2021-08-03 16:49:51 +02:00
3e498c34e5 aside activity category commented out of form 2021-08-03 16:49:02 +02:00
81de17594d Merge branch 'master' into 102_activites_annexes 2021-08-03 15:56:56 +02:00
e42a5217be createdBy field deleted from form 2021-08-03 14:53:39 +02:00
a0154331de Apply 1 suggestion(s) to 1 file(s) 2021-08-03 12:51:40 +00:00
3d2cc340a6 merge with modif in gitlab 2021-08-03 14:48:15 +02:00
82841f47c8 aside activity changed into final class and implements trackUpdateInterface, TrackCreationInterface 2021-08-03 14:46:10 +02:00
b571620e6c aside activity category changed into final class 2021-08-03 14:45:21 +02:00
357b87dadb crud config added for aside activity 2021-08-03 14:43:23 +02:00
a5948259d9 templates added for aside activities 2021-08-03 14:41:01 +02:00
0bc894836f Apply 1 suggestion(s) to 1 file(s) 2021-08-03 12:39:50 +00:00
23bc71a38c Apply 1 suggestion(s) to 1 file(s) 2021-08-03 09:26:03 +00:00
3082634323 Merge branch '102_activites_annexes' of gitlab.com:Chill-Projet/chill-bundles into 102_activites_annexes 2021-08-03 11:22:02 +02:00
4cd2dc63c5 asideActivities property removed + corresponding methods 2021-08-03 11:21:20 +02:00
ff58816ee0 changed duration type into integer 2021-08-03 11:20:43 +02:00
7b8a067002 Apply 1 suggestion(s) to 1 file(s) 2021-08-03 09:15:15 +00:00
c13f63b3ba Apply 1 suggestion(s) to 1 file(s) 2021-08-03 09:15:04 +00:00
94d743c5b6 Apply 1 suggestion(s) to 1 file(s) 2021-08-03 09:14:50 +00:00
2290da6f3b Apply 1 suggestion(s) to 1 file(s) 2021-08-03 09:14:21 +00:00
f9195aa881 Apply 1 suggestion(s) to 1 file(s) 2021-08-03 09:13:02 +00:00
84dc5bd881 Merge branch '102_activites_annexes' of gitlab.com:Chill-Projet/chill-bundles into 102_activites_annexes 2021-08-03 11:00:16 +02:00
1edcb399c4 Apply 1 suggestion(s) to 1 file(s) 2021-08-03 08:54:55 +00:00
9ac31d2d8b Apply 1 suggestion(s) to 1 file(s) 2021-08-03 08:54:36 +00:00
ccf5b90951 filename changed to fix error 2021-08-03 10:40:29 +02:00
ee8e9f1ebc commented out lines deleted from migration 2021-08-03 10:39:27 +02:00
4fa1820d8d bootstrap classes added 2021-08-03 10:37:42 +02:00
e72a8fe5a0 bootstrap class added 2021-08-03 10:20:35 +02:00
Pol Dellaiera
9b756ffb2f Fix parameter type. 2021-08-03 09:24:53 +02:00
7ee91afae2 template extends person layout, fix syntax 2021-08-03 00:46:56 +02:00
7665181d44 Merge branch 'bootstrap5' into add-location-period 2021-08-02 16:20:58 +02:00
a8047fd89b make changes to avoid git conflict when we will merge bootstrap5 branch 2021-08-02 15:41:37 +02:00
61f6e95281 courselocation in pause. we have to make changes in AddAddress component. 2021-08-02 15:08:34 +02:00
ad55cc0477 automatic IDE clean code 2021-08-02 13:44:13 +02:00
714d8b841c vue_accourse: initialize new submodule courseLocation 2021-08-02 13:43:28 +02:00
e2e38a9ce8 vue_accourse: replace some buttons by small buttons 2021-08-02 13:31:41 +02:00
d916b575da AddAddress modal: make title dynamically passed by parent 2021-08-02 13:26:23 +02:00
982c704f6c improve activity list 2021-08-01 20:41:55 +02:00
9f5086e9c1 small buttons in lists, coherence of messages 2021-08-01 19:42:21 +02:00
ee819e7767 improve flex-table logic, with accompanying period list template 2021-08-01 18:38:31 +02:00
d34a00b2c0 missing stick-form-button 2021-08-01 16:20:09 +02:00
a096266ca5 household: if no addresses, misc stuffs 2021-08-01 16:18:37 +02:00
96e979f92d replace colors by variables in chillperson.scss 2021-08-01 16:09:43 +02:00
48873d15c9 ajust list_with_period search with person render_box (and add new options to it) 2021-08-01 15:24:48 +02:00
4be4cd7279 remove Altnames in accompanyingCourse resume 2021-08-01 13:50:59 +02:00
c4a8b85be5 template accompanying period list: buttons, flex-table (wip) 2021-08-01 13:47:08 +02:00
4c47105de1 flex-table column width auto; overwrite for specific use 2021-08-01 13:43:09 +02:00
1c404e5cb3 lib/entity/comment_embeddable styles have been moved 2021-08-01 13:23:06 +02:00
6dae4785e6 missing comment fields on person details page 2021-08-01 12:08:04 +02:00
360322bdbf missing comment fields on person details page 2021-07-31 14:49:01 +02:00
8c06014ea5 render_box comment embeddable, misc 2021-07-31 14:48:03 +02:00
98dd31dffc render_box person: possible to force disable AltNames; add space between span 2021-07-31 14:45:34 +02:00
1325355ca7 revert flashbag wrapper class 2021-07-31 13:14:31 +02:00
9764ee1794 styles, replace colors by variables, minor changes with colors 2021-07-31 11:00:37 +02:00
a48d7f5e94 move styles from bootstrap custom to chill entrypoint. split chillmain with imports sheets. clean styles 2021-07-31 10:34:20 +02:00
4eef8492b1 Merge branch 'master' into 110_extend_thirdparty 2021-07-30 22:56:41 +02:00
949366cf7b fix test failures 2021-07-30 22:32:29 +02:00
65fe9ab784 Merge branch 'master' into bootstrap5 2021-07-30 20:31:46 +02:00
532d4aa164 rename classes and add tags in vue Address component 2021-07-30 20:10:31 +02:00
02bea40cc4 fix class called 2x in vue component 2021-07-30 20:03:23 +02:00
51216b90c5 banner accompanyingcourse, new responsive design 2021-07-30 19:56:41 +02:00
f9735823c7 minor class renaming 2021-07-30 18:39:57 +02:00
b683e60cf7 address history: improve template, insert buttons with validFrom/validTo difference 2021-07-30 17:34:03 +02:00
e8e4dbef1f banner household, new responsive design 2021-07-30 15:39:22 +02:00
7e4afc826b banner person: new responsive design, with custom area 2021-07-30 15:06:47 +02:00
31c5c8b52a render_box address: new options and render modes 2021-07-30 14:17:16 +02:00
f734210db5 fix error after merge 2021-07-30 13:40:52 +02:00
014fe19b45 Merge branch '153-feat-new-importer-for-socialwork' 2021-07-30 13:24:26 +02:00
08cd6c81f2 render_box: adding addAge option 2021-07-30 11:13:54 +02:00
175d6892ec render_box, altnames style
(keep id-number for accompanying context)
2021-07-30 11:12:44 +02:00
4cac5f9a4a render_box: adding option addId + styles more generic, less specific 2021-07-30 10:46:16 +02:00
6dac130844 render box address, remove macro address, refactoring (wip) 2021-07-29 17:25:03 +02:00
886924a7e5 add address suggestion by household 2021-07-29 16:01:17 +02:00
55ac730c18 notification pill appearance 2021-07-29 15:23:28 +02:00
87a7e0de00 household alert dropdown style 2021-07-29 14:35:14 +02:00
39f6f14467 render box, custom buttons before, after or remplacing default 2021-07-29 14:34:53 +02:00
5ef5b65d90 Add address suggestion for a person 2021-07-29 12:24:22 +02:00
ad3fe7cf91 render box, mechanism to pass custom buttons 2021-07-29 11:34:13 +02:00
4e9916534f every chill sass sheets need to load bootstrap configuration files
but we don't want to load all bootstrap in chill entrypoint !
2021-07-29 10:48:27 +02:00
3637ae6aee renderbox person and thirdparty on resume accompanyingcourse, flex-bloc and flex-table 2021-07-28 23:41:10 +02:00
2893b9c726 re-indent file 2021-07-28 16:48:50 +02:00
42784cf584 split sass sheets, move style cascades 2021-07-28 16:34:18 +02:00
3169da20ad add test for accompanying period location validity 2021-07-28 16:16:57 +02:00
81752befcf render_box with 'bloc'
use bootstrap responsive breakpoints for columns,
mixed with flex-bloc cascade for growing and vertical align blocs.
2021-07-28 16:05:10 +02:00
3c7b67604c [AccompanyingPeriod] create constraints for location 2021-07-28 14:46:03 +02:00
4e8dd3b189 [AccompanyingPeriod] add flashbag message when located temporarily 2021-07-28 13:27:05 +02:00
50e9a06e49 adding a responsive breakpoints debug flag 2021-07-28 12:59:03 +02:00
57a8b49f49 entity render: options, html classes, corrections
note: span.chill-entity tag is replaced by section.chill-entity tag.
because some cases are not valid html :
* span.chill-entity > div
* span.badge > div.chill-entity
2021-07-28 12:01:56 +02:00
df3d32c653 wip render box person thirdparty display bloc 2021-07-27 23:15:52 +02:00
4cca148f69 [AccompanyingPeriod] add location to serialization 2021-07-27 21:25:38 +02:00
34f22d237e update schema to store location on accompanying period 2021-07-27 18:31:31 +02:00
Pol Dellaiera
d0b51f3573 Add minor typing. 2021-07-27 17:41:16 +02:00
Pol Dellaiera
53d3a0921b Fix minor bug. 2021-07-27 17:41:16 +02:00
Pol Dellaiera
cc824faf54 Improve performance. 2021-07-27 17:41:15 +02:00
Pol Dellaiera
b33cb4946c Improve/optimize list generation. 2021-07-27 17:41:15 +02:00
Pol Dellaiera
ef6c5870b5 Prevent multiples sub-queries. 2021-07-27 17:41:15 +02:00
Pol Dellaiera
e1f8aa5a5e Use custom Doctrine hydrator. 2021-07-27 17:41:15 +02:00
Pol Dellaiera
d208a79764 Add Doctrine extension. 2021-07-27 17:41:15 +02:00
Pol Dellaiera
b41b1346e5 Remove typing.
Request from https://gitlab.com/Chill-Projet/chill-bundles/-/merge_requests/99
2021-07-27 17:41:15 +02:00
Pol Dellaiera
d50d3e0e4b Revert "Add a bit more typing to help future development and customizations."
This reverts commit 32ce244de551c437d8eef08edeb1fd1906036827.
2021-07-27 17:41:15 +02:00
Pol Dellaiera
401659748c Default entities order: title ASC 2021-07-27 17:41:15 +02:00
Pol Dellaiera
c25c302466 Sort entities recursively. 2021-07-27 17:41:15 +02:00
Pol Dellaiera
c37b98cecd Add a bit more typing to help future development and customizations. 2021-07-27 17:41:15 +02:00
Marc Ducobu
979ea5841d Merge branch 'fix-crud' into 'master'
Replace chill_main.paginator_factory by PaginatorFactory::class

See merge request Chill-Projet/chill-bundles!114
2021-07-27 14:00:30 +00:00
Marc Ducobu
9e9a459a20 Replace chill_main.paginator_factory by PaginatorFactory::class 2021-07-27 15:59:03 +02:00
89dfea74b3 not used vue_accourse_work_list entrypoint (since 8384508c1a) 2021-07-27 15:26:47 +02:00
4b3f4edcc1 oups 2021-07-26 18:08:33 +02:00
376d8df55e fix bug with bootstrap form theme textarea (horizontal layout mode)
cfr issue https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/182
+ make chill fields theme more responsive
2021-07-26 17:56:44 +02:00
5d1d6c83a9 Merge branch 'bootstrap5' into 110_extend_thirdparty 2021-07-23 17:09:45 +02:00
a6266c5317 reorganize assets in others bundles 2021-07-23 17:06:37 +02:00
b0ef9b6612 complete previous commit (+dirty auto corrections from IDE) 2021-07-23 15:38:50 +02:00
8384508c1a reorganize assets: move files and adapt links, remove unused
* chill: chill theme entrypoint
* lib: local libs, called in several place but don't have entrypoint
* module: local libs with specific entrypoints
* page: pages with specific entrypoints
* vuejs: vue components with specific entrypoints

remove local libs jquery and select2, they already exists in node_modules
remove duplicate fonts
2021-07-23 14:58:37 +02:00
d20a3cf9d4 add suffix to assets entrypoints + replace link/script html tags by encore_entry twig tag 2021-07-23 12:27:30 +02:00
e0dbe9cf9d layout content position for fullwidth pages 2021-07-23 11:39:19 +02:00
Marc Ducobu
5c2c509805 Merge branch 'fix-tests-marc' into 'master'
Fix tests marc

See merge request Chill-Projet/chill-bundles!112
2021-07-23 09:25:42 +00:00
Marc Ducobu
9d478c0f01 Removing var_dump 2021-07-23 10:18:41 +02:00
Marc Ducobu
4646795c2c Automatic styling correction 2021-07-23 10:18:04 +02:00
d8d66aeeb6 remove old template members.html.twig
0add757230 (note_633038526)
2021-07-23 09:16:30 +02:00
7ac61002b0 layout content position for fullwidth pages 2021-07-22 22:19:27 +02:00
c9562ebdf7 improve layout classes 2021-07-22 22:09:31 +02:00
Marc Ducobu
18369a6c0a Merge branch 'notifications3' into 'master'
Notifications3

See merge request Chill-Projet/chill-bundles!89
2021-07-22 17:44:37 +00:00
Marc Ducobu
0fd9485de5 Avoid creation of services/notification.yaml 2021-07-22 18:15:57 +02:00
c8f139528a Merge branch 'behaviour/do-not-create-accompanying-course-on-person-creation' into 'master'
Remove creation of AccompanyingPeriod on person creation

See merge request Chill-Projet/chill-bundles!100
2021-07-22 15:36:37 +00:00
8030792eb6 Remove creation of AccompanyingPeriod on person creation 2021-07-22 15:36:36 +00:00
Marc Ducobu
50a4df3d0f Notification with paginitation 2021-07-22 17:32:20 +02:00
Marc Ducobu
0907ae1602 Rmq Julien & Pol 2021-07-22 17:32:20 +02:00
Marc Ducobu
673a4761e9 Adding feature for AccompanyingPeriodNotif 2021-07-22 17:32:20 +02:00
Marc Ducobu
282db51f06 Display notification using services (draft) 2021-07-22 17:32:20 +02:00
Marc Ducobu
bdf691a063 Add findAllForAttendee method in NotificationRepository 2021-07-22 17:32:20 +02:00
Marc Ducobu
18ab10dd45 Add center a_social to an activityNotif feature 2021-07-22 17:32:20 +02:00
0cd9dc6028 batch remove col-md-10 col-xxl, and add it in layout (level up) 2021-07-22 17:29:40 +02:00
65198937c0 Merge branch 'tests/fix-tests-after-bootstrap' into 'master'
Fix tests after introduction of bootstrap

See merge request Chill-Projet/chill-bundles!111
2021-07-22 15:20:45 +00:00
2699d48533 Fix tests after introduction of bootstrap 2021-07-22 15:20:45 +00:00
a559589883 add isLeaf condition on ThirdParty form Type 2021-07-22 16:34:07 +02:00
d81f5bafe3 adding content classes + divers 2021-07-22 13:19:25 +02:00
c6a3f59d87 household members editor: make buttons visibles 2021-07-22 12:19:35 +02:00
ff671ded9c move alert-with-actions sass, remove unused alert-first-child 2021-07-22 11:37:05 +02:00
678c7d18b4 fix data-toggle collapse mechanism
+ cleaning links in theses files
2021-07-22 11:34:37 +02:00
f73f515fb3 fix sass variable 2021-07-22 10:25:17 +02:00
afd4ac27ea search page, content position 2021-07-22 09:59:13 +02:00
ea734e2a9e fix menu context class 2021-07-20 15:46:20 +02:00
587da94645 adapt Thirdparty form and templates 2021-07-20 15:34:28 +02:00
3f9e215ea5 adding fixtures for new thirdparty fields (choice lists) 2021-07-19 17:18:36 +02:00
732390f704 add new fields in thirdparty entity 2021-07-19 16:11:25 +02:00
25b00296ca adapt thirdparty templates 2021-07-16 17:01:32 +02:00
1e626d573f Merge branch 'bootstrap5' into 110_extend_thirdparty 2021-07-16 13:29:01 +02:00
3ee676600e adding twig extensions to select how many items per page
* twig anchor: {{ chill_items_per_page(pagination) }}
* select field changed with javascript event listener
2021-07-16 13:23:10 +02:00
d2c631ae20 prepare thirdparty index template 2021-07-16 11:07:52 +02:00
8462538123 adapt pagination to bootstrap, add a short pagination variant 2021-07-16 09:51:15 +02:00
645252fd85 start CRUD controllers asideActivityBundle 2021-07-15 16:15:46 +02:00
08e396195c Merge branch 'vue_generale' into bootstrap5_replacing_scratch 2021-07-15 15:27:04 +02:00
ab0863a275 new setting margins and breakpoints for person banner 2021-07-15 15:21:33 +02:00
82c79a17dd many corrections in twig templates 2021-07-14 21:01:46 +02:00
d35553a1e2 content bloc: fix margins and breakpoints 2021-07-14 18:16:33 +02:00
030e71d276 activity, content position 2021-07-14 15:51:07 +02:00
4fc3d813c4 bootstrap adapt for activity vue socialIssues component 2021-07-14 15:24:17 +02:00
5f012165d1 fix spinner in addAddresss 2021-07-14 15:23:42 +02:00
61bd5d8ae8 fix spinner in addAddresss 2021-07-14 15:21:38 +02:00
07c464c112 rename vue subfolder _components in components 2021-07-14 14:50:39 +02:00
70a4c34865 move vue AddAddress inside Address component 2021-07-14 14:46:44 +02:00
5a47ebed42 Merge branch 'fix_addresses_issues' into bootstrap5_replacing_scratch 2021-07-14 14:01:08 +02:00
80eb5519bc adapt AddAddress modal to bootstrap: position, responsive, form 2021-07-14 13:36:49 +02:00
50f3ec9064 adapt vue modals styles to bootstrap 2021-07-13 15:35:48 +02:00
bdf0ec63d2 person templates responsive breakpoints in content 2021-07-13 14:07:23 +02:00
15f439b43d divers styles: colors var, table thead,... 2021-07-13 14:07:23 +02:00
30af99f4f0 fix chill theme colors behaviours: chill classes, special buttons variants 2021-07-13 14:07:23 +02:00
c413166866 batch replace .bt- in task scss 2021-07-13 14:07:23 +02:00
3c4c5e29a3 remove ChillMainSass webpack alias (scratch reference) 2021-07-13 14:07:23 +02:00
0224224744 bootstrap tables in vue_accourse 2021-07-13 14:07:23 +02:00
a9a59895b4 rename vue_ entrypoints in webpack 2021-07-13 14:07:23 +02:00
8a859f7885 add margin-top in content (uniformize contexts) 2021-07-13 14:07:23 +02:00
2244c58ec2 better logic: move person layout template in views/Person folder
like others contexts :
* accompanyingCourse
* household
2021-07-13 14:05:36 +02:00
c1ede921ff better twig extends path syntax 2021-07-12 10:32:48 +02:00
17ff80c39c accompanyingCourse, household and person use uniq menu template 2021-07-12 10:23:23 +02:00
f4f747d8d1 put person banner in included file 2021-07-12 10:21:08 +02:00
a740ad29ea replace sc-button + bt- in js and php files 2021-07-08 15:56:00 +02:00
ccee105efb batch replace grid- (scratch) by col- (bootstrap)
hand replace
* push- by offset-
* no-gutter by g-0

add breakpoints md- and sm-
2021-07-08 15:44:32 +02:00
b10012f4da minor swing 2021-07-08 15:03:59 +02:00
4937fd00fc fix form label display inline (with bootstrap5 theme) 2021-07-08 15:03:00 +02:00
0b329a9c9b modify lightly bootstrap5 form theme 2021-07-08 14:52:46 +02:00
4cfc43aaa6 rename collection html classes 2021-07-08 14:49:53 +02:00
1c45770929 wip 2021-07-08 12:27:50 +02:00
198c815052 add classes to person_addresses template 2021-07-08 12:00:59 +02:00
a995adcf0d remove debug discret class 2021-07-08 12:00:07 +02:00
bccda15307 cleaning record_actions scss 2021-07-08 11:59:27 +02:00
75c3df50e0 disable scratch webpack compilation 2021-07-08 11:58:22 +02:00
ce8207ea65 adapt person details page with bootstrap grid 2021-07-08 11:38:19 +02:00
0f6ad3670a add flashbag twig display condition + improve class consistency (main_search) 2021-07-08 11:12:31 +02:00
02a752f20b repair commit "load banner accompanying course everywhere" 2021-07-08 10:20:17 +02:00
1bbce2bb81 person details page: one edit button at bottom of page, fix regression 2021-07-07 19:38:29 +02:00
ca43933163 Merge branch 'fix-vue-warnings' into bootstrap5_replacing_scratch 2021-07-07 19:27:40 +02:00
1392365257 fix most of vue warnings for accompanyingCourse component 2021-07-07 19:27:22 +02:00
3653d7e0b8 fix missing dom selector in stickynav vue 2021-07-07 18:58:11 +02:00
3970bb2644 badge settings in banners 2021-07-07 18:31:05 +02:00
ea2d6eac7b AsideActivityType entity changed to AsideActivityCategory + building forms for both entities 2021-07-07 16:24:41 +02:00
9a1272d350 enabling symfony twig form_theme for bootstrap5
bootstrap5 templates are not supported in symfony 4
see twig.yaml comment and configuration while waiting to upgrade !!
2021-07-07 12:32:40 +02:00
e7c76734a6 start form 2021-07-06 15:56:55 +02:00
8389afb4a8 first migration: creation entities AsideActivity(Type) 2021-07-06 15:56:21 +02:00
36419cf5f0 fix button colors 2021-07-06 14:17:39 +02:00
fc074c2f1a changes to composer.json 2021-07-06 14:11:06 +02:00
eff1d6e797 start of AsideActivity entities 2021-07-06 14:10:36 +02:00
10de2d7966 start of AsideActivity entities 2021-07-06 14:08:44 +02:00
c96f407e6a Merge branch 'bootstrap5_replacing_scratch_mat' into bootstrap5_replacing_scratch 2021-07-06 13:50:17 +02:00
690688f5e1 fix buttons classes 2021-07-06 13:49:12 +02:00
4668f657ab button correction if only icon, not text 2021-07-06 13:34:47 +02:00
49253abfb8 custom _record_actions styles 2021-07-06 12:21:52 +02:00
c2122d62c6 button cancel, set icon with before 2021-07-06 12:10:37 +02:00
ca17ca4984 adding forkawesome ::before content unicode 2021-07-06 11:06:32 +02:00
a5d749b882 batch replace sc-button by btn btn-... 2021-07-05 21:55:24 +02:00
53c021b06e Merge branch 'quickfix' into bootstrap5_replacing_scratch_mat 2021-07-05 21:25:33 +02:00
b6e8c64211 fix bootstrap5 + vue modal content scrollable overflow 2021-07-05 21:23:55 +02:00
342fd3e297 batch rename sc-button cancel 2021-07-05 21:22:05 +02:00
05a1f7d041 batch rename class sc-button (scratch) by btn (bootstrap) 2021-07-05 19:02:09 +02:00
2e2eeae4f2 chill colors and buttons with bootstrap5 2021-07-05 18:53:03 +02:00
c27268443c start creation AsideActivity bundle 2021-07-05 17:40:21 +02:00
nobohan
842dfcc69f address: edit household addresses 2021-07-05 17:23:37 +02:00
nobohan
67c31e781d address: back to the page when the address is filled 2021-07-05 15:07:21 +02:00
f32ffc572d badge-pill classes changed to rounded-pill 2021-07-05 12:37:16 +02:00
a44b26da6c badge classes updated from badge-... to bg-... 2021-07-05 12:29:52 +02:00
d016f9be86 fix bootstrap5 + vue modal content scrollable overflow 2021-07-04 14:26:00 +02:00
c36aa22ab2 arrange collapsed header menu 2021-07-03 20:57:28 +02:00
e77c886e3f banner and vertical-menu integration 2021-07-03 17:56:07 +02:00
4ca1618480 bt5, main layout, responsive header 2021-07-03 14:03:30 +02:00
8e8cdfce0a bootstrap5, main layout settings 2021-07-02 18:42:26 +02:00
3694eb5bf2 fix bootstrap import duplicate 2021-07-01 18:49:15 +02:00
e44342ab87 bootstrap5: report variables v4+chill changes in variables v5
--- indigo, purple, teal, cyan
+++ green-dark, beige
2021-07-01 18:25:38 +02:00
a236873919 bootstrap5: swap variables v4+chill 2021-07-01 18:25:38 +02:00
a13766e7d7 wip.. 2021-07-01 18:25:38 +02:00
bc240a6754 bootstrap style in form fields, bootstrap integration for select2 2021-07-01 18:25:35 +02:00
50727fc4b0 bootstrap styles in forms fields 2021-07-01 18:24:48 +02:00
b327a3fbfa fix homepage content cols 2021-07-01 18:24:48 +02:00
2916babe1c bootstrap content with vertical right person menu 2021-07-01 18:24:46 +02:00
fe2f107ddc bootstrap content with vertical right person menu 2021-07-01 18:20:11 +02:00
3da8f89d3c bootstrap footer and homepage 2021-07-01 18:08:00 +02:00
19326ee750 wip.. navbar bootstrap 2021-07-01 18:07:57 +02:00
e0ae5d56f0 import chill colors in bootstrap custom theme 2021-07-01 18:05:25 +02:00
0878767c17 replace class container by container-fluid (full width in bootstrap) 2021-07-01 18:05:25 +02:00
f0232228a3 improve details row for household banner 2021-07-01 17:47:17 +02:00
fc63955205 improve banners render : context person, with common improvements on accompanyingcourse and household context 2021-07-01 16:13:07 +02:00
a78de0f96c improve accompanyingcourse work timeline design 2021-07-01 10:41:13 +02:00
270c0accc5 Merge branch 'parcours/origin-de-la-demande' into 'master'
parcours - origin de la demande

See merge request Chill-Projet/chill-bundles!107
2021-07-01 08:37:46 +00:00
fd94f27eee hide console log, remove unused api endpoint method 2021-07-01 10:30:39 +02:00
f7e3be38a7 Merge branch '51-referent-parcours' into 'master'
parcours référent

See merge request Chill-Projet/chill-bundles!106
2021-07-01 07:48:08 +00:00
5861a86289 cleaning dirty git trace 2021-06-30 19:22:26 +02:00
68c0f9b7d7 accompanyingcourse: lesser space between form fieldsets 2021-06-30 19:02:25 +02:00
52288f7260 fix typo + change component position 2021-06-30 18:44:38 +02:00
nobohan
0b5daa6c33 quick fix: address: add backurl after posting the address 2021-06-30 18:26:44 +02:00
2fe1605385 vue accompanyingCourse, adding an origin sub-component 2021-06-30 17:07:48 +02:00
d8256b0ac5 swagger person: adding origin routes 2021-06-30 14:59:27 +02:00
b5760e82ea swagger person: just sorting yaml tree items 2021-06-30 14:58:24 +02:00
d3ac8d8ceb vue accompanyingcourse: ending referrer subcomponent 2021-06-30 11:59:54 +02:00
196f709065 activity, revert detail, cfr. https://gitlab.com/Chill-Projet/chill-bundles/-/merge_requests/94#note_614231268 2021-06-30 10:18:57 +02:00
6a8c96cdae referrer get users: preparation 2021-06-30 09:52:15 +02:00
3e83891744 prepare new originDemand sub-component 2021-06-30 09:52:15 +02:00
662e5f967c Merge branch 'frontend/address-to-add-persons-widget' into 'master'
Add address to widget add persons

See merge request Chill-Projet/chill-bundles!105
2021-06-30 07:12:42 +00:00
802125edc6 Add address to widget add persons 2021-06-30 07:50:43 +02:00
028c3e0c31 widget addPersons: fix persons without birthdate 2021-06-29 22:40:23 +02:00
e4adafafc8 remove household search 2021-06-29 22:38:01 +02:00
54316d148c Merge branch 'features/improve-activity' into 'master'
Features/improve activity

See merge request Chill-Projet/chill-bundles!103
2021-06-29 19:18:51 +00:00
3c5a2a65df Merge branch 'features/improve-accompanying-course-summary' into 'master'
Improve accompanying course summary page

See merge request Chill-Projet/chill-bundles!102
2021-06-29 19:16:18 +00:00
741ef7b40d Merge branch 'features/add-suggestion-household-member-editor' into 'master'
Add suggestion household member editor

See merge request Chill-Projet/chill-bundles!97
2021-06-29 19:13:38 +00:00
e7384343b2 Merge remote-tracking branch 'origin/master' into features/improve-accompanying-course-summary 2021-06-29 21:12:21 +02:00
1e2a920200 clean menu builder for activity 2021-06-29 21:03:38 +02:00
b5a78fa341 Merge remote-tracking branch 'origin/master' into features/improve-activity 2021-06-29 20:52:06 +02:00
d9c1f52894 improve activity 2021-06-29 20:51:08 +02:00
nobohan
f05f7415bd household: add household accompanying periods 2021-06-29 19:41:00 +02:00
nobohan
5553c7314c household address: fix conflict on branch merge 2021-06-29 17:47:40 +02:00
7dc70baf57 permet de surcharger le label 'commentaire' des actviités 2021-06-29 17:39:19 +02:00
nobohan
34af401a98 accompanying period: add items in the summary page 2021-06-29 17:37:58 +02:00
5bae8dc5bf Import also scripts tags & css for launching banner 2021-06-29 17:13:57 +02:00
6e277e99ae fix in accompanying period list: thirdparty as requestor + link 2021-06-29 17:09:55 +02:00
2688c0f0ce fix missing div in accompanying course work list 2021-06-29 17:09:38 +02:00
nobohan
0135f5184e accompanying period: wording + minor changes in twig 2021-06-29 17:09:24 +02:00
fd698419e8 Merge branch 'fix-prototypage-details' into 'master'
Fix prototypage details

See merge request Chill-Projet/chill-bundles!94
2021-06-29 15:06:20 +00:00
4a864a0b14 Merge remote-tracking branch 'origin/master' into features/improve-accompanying-course-summary 2021-06-29 16:59:05 +02:00
55dc0d3f9f Ajout informations manquantes dans la page "summary" des
AccompanyingCourse
2021-06-29 16:57:28 +02:00
85835c8b0d Merge branch 'features/api-search' into 'master'
Features/api search

See merge request Chill-Projet/chill-bundles!98
2021-06-29 14:50:28 +00:00
nobohan
ab1edee9fb person menu: add style for submenus 2021-06-29 16:22:58 +02:00
6154e0912b fix in accompanying period list: thirdparty as requestor + link 2021-06-29 16:14:50 +02:00
0388428c6f fix missing div in accompanying course work list 2021-06-29 16:14:30 +02:00
7ac55275c2 Merge remote-tracking branch 'origin/fix_issues_juminet' into features/improve-accompanying-course-summary 2021-06-29 16:06:57 +02:00
1119e20a49 Add minor fixes to summary page:
* add messages when no resources
* add address to person
* replace household link label with household number
2021-06-29 16:03:59 +02:00
ea2870eef8 Merge branch 'features/create-user-endpoint' into 'master'
Feature: create user endpoint

See merge request Chill-Projet/chill-bundles!96
2021-06-29 14:02:16 +00:00
nobohan
93a44d8303 address: automatic return when saving address 2021-06-29 15:06:35 +02:00
nobohan
8109415e05 address: wording button 2021-06-29 14:39:43 +02:00
nobohan
514fe6163a address: format address as the French format 2021-06-29 14:33:51 +02:00
9d9be7f831 vue activity: fix backend when hidden return empty string 2021-06-29 14:31:56 +02:00
nobohan
4cf3cc8353 address: add focus on selectAddress field 2021-06-29 14:25:26 +02:00
2a974e1269 fix socialActions selected visibility if all issues unchecked + cleaning 2021-06-29 12:23:11 +02:00
beca41774e vue activity: fix duplicates and add condition in initial loading 2021-06-29 11:49:23 +02:00
dd991e3572 add test 2021-06-28 23:02:15 +02:00
0640631821 implementation on 3party + quote keys in SearchApiQuery 2021-06-28 22:44:42 +02:00
e845d9ba90 replace search api by a first workin implementation 2021-06-28 22:01:33 +02:00
nobohan
6f8231f6f6 accompanying course: clean controller 2021-06-28 22:01:05 +02:00
nobohan
048161e300 accompanying course summary (WIP) 2021-06-28 22:00:07 +02:00
b705c5910f dispatch action change value of hidden fields, persisted when submited 2021-06-28 20:46:30 +02:00
6f1209eaf5 rename methods, improve logic 2021-06-28 20:20:54 +02:00
020759180b prepare dispatch 2021-06-28 20:07:53 +02:00
3748b4fbf4 vue activity: manage datas in store, not with data() 2021-06-28 19:05:26 +02:00
nobohan
4f49292178 address: fix saving of isNoAddress 2021-06-28 17:18:57 +02:00
6eaffcae49 fix redirection after changing household member 2021-06-28 16:22:17 +02:00
nobohan
f92d710a26 accompanying course summary: add social actions 2021-06-28 16:16:55 +02:00
nobohan
bc6ba88acd menu: fix code indentation 2021-06-28 16:04:24 +02:00
61c2934d64 activity: get social Actions, improve reactivity 2021-06-28 15:31:41 +02:00
28b4d9562c add socialAction checkbox list 2021-06-28 15:21:41 +02:00
e06aded1ec remove from multiselect when adding social issues + disable accompanyingcourse issues loading 2021-06-28 15:21:32 +02:00
3a81124e04 activity vue: list socialIssues checkbox from accompanyingCourse 2021-06-28 15:21:17 +02:00
nobohan
b72d45d9db accompanying period: hide activity entries from the menu if accompanyin period is DRAFT 2021-06-28 13:50:31 +02:00
2a1f5cbad1 add test for suggestion household by accompanying period 2021-06-28 13:18:00 +02:00
e8566fd006 change label 2021-06-28 12:36:19 +02:00
cd6b5c9a39 Add context for household member editor form:
* add context for accompanying period, if indicated in a query
parameter;
* expand automatically household suggestion, if indicated in a query
parameter
2021-06-28 11:23:30 +02:00
9aa3974071 show household suggestion in household members editor 2021-06-28 00:35:40 +02:00
a8bf478ee8 add endpoint for getting suggestion on household by accompanying period 2021-06-27 11:10:17 +02:00
a35f3363b2 Merge branch 'features/edit-accompanying-period-social-work' into 'master'
Features/edit accompanying period social work

See merge request Chill-Projet/chill-bundles!91
2021-06-26 13:15:34 +00:00
0b117e5158 Merge remote-tracking branch 'origin/features/edit-accompanying-period-social-work' into _vue_echanges 2021-06-26 12:14:32 +02:00
7cae9e1769 wip 2021-06-26 12:09:18 +02:00
a43e6c12a0 add tests for UserApiController 2021-06-26 11:08:26 +02:00
abe012de60 add endpoint whoami 2021-06-26 11:08:10 +02:00
aaa9a1ec7b create user _index and _entity endpoint 2021-06-26 11:07:03 +02:00
25f2d17097 documentation for api social actions 2021-06-25 21:34:36 +02:00
4fd43310c0 Merge remote-tracking branch 'origin/master' into features/edit-accompanying-period-social-work 2021-06-25 21:26:21 +02:00
c85ca894b8 layout for list accompanying work 2021-06-25 21:25:27 +02:00
fe22e6c7dc activity: create new vue subcomponent socialIssuesAcc 2021-06-25 15:44:20 +02:00
cb67605bd2 list accompanying course work 2021-06-25 14:59:10 +02:00
d26e08324c load banner accompanying course everywhere 2021-06-25 14:09:47 +02:00
e55a2691b7 move vue activity component app in subcomponent concernedGroups 2021-06-25 14:09:32 +02:00
nobohan
aa5c7f333e fix conflict + error on CommentType 2021-06-25 13:57:49 +02:00
0afe277b04 form acc work edit: save action 2021-06-25 00:06:26 +02:00
981b9299ad layout form 2021-06-24 16:21:52 +02:00
nobohan
36eb247995 address: add maxlength, upd default map center and add loader messages in addresses form 2021-06-24 16:02:57 +02:00
Pol Dellaiera
d71c3f310e (to rebase/fixup later) Fix documentation. 2021-06-24 16:01:41 +02:00
Pol Dellaiera
4a2ada784a (to rebase/fixup later) Let Goal be associated to a Result. 2021-06-24 15:57:03 +02:00
Pol Dellaiera
3b5ef53b9b (to rebase/fixup later) Let Result be associated to a SocialAction. 2021-06-24 15:46:04 +02:00
2cda6ceebf improve history details 2021-06-24 15:43:02 +02:00
Pol Dellaiera
18d0ad67d6 (to rebase/fixup later) Update command based on feedback. 2021-06-24 15:25:27 +02:00
Pol Dellaiera
ea1c12da64 (to rebase/fixup later) Fields must be nullable for import to success. 2021-06-24 15:24:58 +02:00
1ceabec400 redesign timeline with css gridlayout 2021-06-24 15:17:34 +02:00
nobohan
91c5cd74f7 household address: remove group write on member collection 2021-06-24 14:01:15 +02:00
nobohan
b7f2e189dc small fix: use class name instead of string 2021-06-24 14:01:15 +02:00
nobohan
ab8deb036b accompanyingCourse: add activities in the accompanying course summary 2021-06-24 14:01:15 +02:00
nobohan
ac47a75a75 fix bug issue 163 Address JSON string not valid 2021-06-24 14:01:15 +02:00
nobohan
4e6454d7de translation Activity Envoyer/recevoir 2021-06-24 14:01:15 +02:00
92a95d4186 finish form behaviour 2021-06-24 12:44:24 +02:00
Pol Dellaiera
141aabcddc feat: Add new command. 2021-06-24 11:37:00 +02:00
nobohan
c23ada3533 person: add show/hide on marital status date 2021-06-24 08:25:55 +02:00
Pol Dellaiera
6e37e7feac Let repositories implements ObjectRepository. 2021-06-23 23:13:16 +02:00
Pol Dellaiera
df1f44d814 Let SocialAction::defaultNotificationDelay be nullable. 2021-06-23 23:11:53 +02:00
Pol Dellaiera
dc26ca7e77 Add missing getId() method. 2021-06-23 23:11:53 +02:00
Pol Dellaiera
2667867bd0 Update composer - Bump league/php. 2021-06-23 23:11:53 +02:00
Pol Dellaiera
5ddc0e7a53 Simplify loading of Symfony commands. 2021-06-23 23:11:53 +02:00
b72b1bd4c7 Merge remote-tracking branch 'origin/master' into features/edit-accompanying-period-social-work 2021-06-23 22:48:09 +02:00
ca9ae3874c Merge branch 'fix/api-crud-improve-loading-for-existing-controller' into 'master'
Fix/api crud improve loading for existing controller

See merge request Chill-Projet/chill-bundles!92
2021-06-23 20:44:25 +00:00
7fb4616aa6 Merge branch 'features/create-social-action' into 'master'
Create social work

See merge request Chill-Projet/chill-bundles!90
2021-06-23 20:43:32 +00:00
ac4cf43753 add goals to work, and add results for each goal 2021-06-23 22:40:11 +02:00
5a4a0a3617 add results for actions in course edit form 2021-06-23 21:26:36 +02:00
2cc1274ee0 fix js alert with dom event listener 2021-06-23 18:04:06 +02:00
154fa4719d add involved persons to accompanying period work 2021-06-23 17:46:51 +02:00
193e7b4c7e cleaning 2021-06-23 13:20:50 +02:00
80c2bd285f vue component html anchor place 2021-06-23 11:50:09 +02:00
133c0ac1ac TOFIX temporary disable js alert that return an error:
## in JS console:

Uncaught ReferenceError: chill is not defined
    <anonymous> http://localhost:8001/fr/activity/1808/edit?person_id=1453:317
2021-06-23 11:25:54 +02:00
c8d5c2c67b resume interlocutors 3 columns 2021-06-23 09:31:26 +02:00
0754d20622 fix form create + WIP form edit for Accompanying Period Work 2021-06-22 22:59:34 +02:00
99d6e030ca ergonomic buttons details 2021-06-22 16:15:05 +02:00
5d38d193e2 add type of activity in title 2021-06-22 16:14:29 +02:00
86f7b116a9 adapt buttons when choosing type of ativity 2021-06-22 16:12:30 +02:00
bcab5a1211 remove old webpack entrypoint definitions 2021-06-22 16:11:24 +02:00
65a6607112 fix translations 2021-06-22 16:10:17 +02:00
1cd376bf86 Merge remote-tracking branch 'origin/master' into features/edit-accompanying-period-social-work 2021-06-22 16:09:58 +02:00
84f6f9b44d fix bug with new activity in context person 2021-06-22 16:09:20 +02:00
b53f6af8d8 add api for getting goal and results by social action and goal 2021-06-22 16:08:53 +02:00
34d6452286 fix: household api 2021-06-22 15:31:56 +02:00
c04ccef4cd improve loading for existing crud cotnroller 2021-06-22 14:40:56 +02:00
nobohan
d8afbc4a40 fix bug on PostalCodeChoiceLoader (not understood) 2021-06-22 11:56:25 +02:00
95edbc673c improve loading for crud controller 2021-06-22 10:08:19 +02:00
07ffdfab86 household banner context colors 2021-06-21 15:58:27 +02:00
50be29308d Merge remote-tracking branch 'origin/master' into features/create-social-action 2021-06-21 14:38:09 +02:00
d1e0d997ac Merge branch 'features/household-edit-members-forms-improve-household' into 'master'
Corrections ménage

See merge request Chill-Projet/chill-bundles!88
2021-06-21 12:25:22 +00:00
nobohan
504b2efacf person: fix death date type as date immutable 2021-06-21 13:58:14 +02:00
4c3c67344a fix merge old css styles 2021-06-21 13:43:15 +02:00
40fcb09082 layout for form 2021-06-21 13:38:43 +02:00
aa4a9e874a add a spinner 2021-06-19 11:15:27 +02:00
3abfdbf6fd first impl for create form 2021-06-18 19:41:58 +02:00
07cc394abd [bugfix] fix font in element ::before
See https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/162

[ci skip]
2021-06-18 14:24:53 +02:00
99337c4aa6 add form edit metadata in summary page 2021-06-18 14:11:02 +02:00
04ccca092b remove links to route 'household members' 2021-06-18 13:53:19 +02:00
nobohan
b3792f6714 person: update person view/show twig 2021-06-18 13:46:46 +02:00
e1f01a47f8 Merge remote-tracking branch 'origin/master' into features/household-edit-members-forms-improve-household 2021-06-18 13:42:37 +02:00
dc79e1a02d remove test for members page 2021-06-18 13:31:19 +02:00
7a6117a264 fix test which randomly failed 2021-06-18 13:30:31 +02:00
nobohan
1a204312f3 person: re-enable the creation of a person 2021-06-18 13:12:27 +02:00
1b1a25edc4 Merge branch 'features/sql-vue-from-household-address-to-person' into 'master'
Features/sql vue from household address to person

See merge request Chill-Projet/chill-bundles!86
2021-06-18 11:01:40 +00:00
5ab7f7a37b Merge remote-tracking branch 'origin/master' into features/sql-vue-from-household-address-to-person 2021-06-18 12:08:13 +02:00
b174397823 Merge branch 'features/household-validation' into 'master'
Validation for household and household members & list for household for a person

See merge request Chill-Projet/chill-bundles!79
2021-06-18 10:07:10 +00:00
9d35e4efbb Merge remote-tracking branch 'origin/master' into features/household-validation 2021-06-18 12:02:34 +02:00
0e9933ca41 improve banner 2021-06-18 11:57:27 +02:00
nobohan
3d14f00cac person: add show hide on some fields + remove unknown genderType 2021-06-18 11:28:02 +02:00
0add757230 remove members page, move to summary 2021-06-18 11:27:25 +02:00
2bf65dfadb Merge branch 'fix-test-accompanying-period' into 'master'
fix data provider which randomly generate invalid data in test

See merge request Chill-Projet/chill-bundles!87
2021-06-18 09:19:29 +00:00
a7ecd08d78 fix data provider which randomly generate invalid data in test 2021-06-18 09:19:28 +00:00
nobohan
bccaf5ad6e person: add createdBY, updatedBy fields on Person + migration 2021-06-18 10:15:30 +02:00
585a19e803 Apply 7 suggestion(s) to 1 file(s) 2021-06-18 07:17:32 +00:00
b801b75eb9 Merge remote-tracking branch 'origin/master' into features/sql-vue-from-household-address-to-person 2021-06-17 23:16:57 +02:00
f1120af59e add 'holder' in list of persons 2021-06-17 23:10:18 +02:00
9d58356b90 remove drag-and-drop behaviour 2021-06-17 22:54:46 +02:00
a7131653c9 finish merge (oups) + layout of household in members editor app 2021-06-17 22:47:33 +02:00
9f3cd943cb Merge branch 'features/household-validation' into features/household-edit-members-forms-improve-household 2021-06-17 22:46:47 +02:00
nobohan
970635dfad Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles
merge...
2021-06-17 17:03:42 +02:00
nobohan
c8297b2230 fix conflict when merging _77_address_household into master 2021-06-17 16:59:55 +02:00
994cce41e5 Merge branch 'master' into features/household-edit-members-forms-improve-household 2021-06-17 15:41:00 +02:00
86e41fb877 Merge remote-tracking branch 'origin/_77_address_household' into features/household-edit-members-forms-improve-household 2021-06-17 15:05:46 +02:00
f8b97b96f4 do not use arrayAccess for Collection in validator 2021-06-17 14:57:16 +02:00
27907e7558 fix modification of key members in household normalization 2021-06-17 14:02:29 +02:00
Marc Ducobu
38712de462 Merge branch 'notifications_fixtures' into 'master'
LoadNotifications using DependentFixtureInterface

See merge request Chill-Projet/chill-bundles!83
2021-06-17 11:38:47 +00:00
fd7c7388d9 fix prepending configuration of doctrine 2021-06-17 13:31:04 +02:00
ef55d2cf7f create view for current address and apply on Person/Household normalizer 2021-06-17 13:21:55 +02:00
nobohan
8406c30c8e person: Person FormType + edit twig 2021-06-17 12:27:47 +02:00
nobohan
901ae47ce6 person: correct migration + entity 2021-06-17 11:12:40 +02:00
nobohan
951160982d person: add more fields on Person + migration 2021-06-17 10:43:57 +02:00
nobohan
e2633a2a79 addresses: filter out postal code introduced by user 2021-06-16 16:20:37 +02:00
Marc Ducobu
1cfc29caf7 LoadNotifications using DependentFixtureInterface 2021-06-16 15:32:59 +02:00
nobohan
5b72eeb147 addresses: edit address for household (WIP) 2021-06-16 15:05:32 +02:00
Marc Ducobu
1b9d8fab61 Merge branch 'notifications' into 'master'
Notifications

See merge request Chill-Projet/chill-bundles!81
2021-06-16 12:58:57 +00:00
Marc Ducobu
801af209a1 Revert "NotificationRepo as a service"
This reverts commit 84913553e8.
2021-06-16 14:54:33 +02:00
nobohan
06daf35e96 addresses: edit address for person 2021-06-16 14:39:02 +02:00
38bff2e42f add address to household in fixtures 2021-06-16 08:35:47 +02:00
e68a5405a1 Merge branch 'master' into features/sql-vue-from-household-address-to-person 2021-06-15 22:53:21 +02:00
8bd20c9c78 [WIP] add fixtures for household address 2021-06-15 22:52:48 +02:00
54997e5893 add test for household membership sequential validator 2021-06-15 21:31:02 +02:00
nobohan
35d35c9f40 addresses: edit address (WIP) 2021-06-15 21:03:50 +02:00
Marc Ducobu
49d022ef55 NotificationRepository as a service 2021-06-15 18:57:56 +02:00
78ca61c82e fix showing person without birthdate 2021-06-15 17:22:03 +02:00
b68de1f2e9 fix parameters in list 2021-06-15 17:16:35 +02:00
68ecff253a fix validation when leaving any household 2021-06-15 17:15:45 +02:00
Marc Ducobu
db545f9fe6 Adding typehinting for Entity/Notif 2021-06-15 17:14:11 +02:00
Marc Ducobu
86d764c097 Using JSONB for storage in db for attendees in Notifications 2021-06-15 17:14:11 +02:00
Marc Ducobu
cf8b9ec172 Migration for notifications 2021-06-15 17:14:11 +02:00
Marc Ducobu
23528e7a5c Adding some features to load for notifications) 2021-06-15 17:14:11 +02:00
Marc Ducobu
a258905c59 Add unique constraint (class, id) to notifications 2021-06-15 17:14:11 +02:00
Marc Ducobu
84913553e8 NotificationRepo as a service 2021-06-15 17:14:11 +02:00
Marc Ducobu
916209e402 Fix remarks MR - notif 2021-06-15 17:12:40 +02:00
Marc Ducobu
3ec212df93 Creation of Notification Entity 2021-06-15 17:12:40 +02:00
e95d8fbc7a Historique ménage pour une personne 2021-06-15 17:03:38 +02:00
Pol Dellaiera
ce88fe158f Merge branch 'chill-main-update-repositores-and-entities' into 'master'
Chill main update repositores and entities

See merge request Chill-Projet/chill-bundles!82
2021-06-15 14:24:04 +00:00
efdfd10e49 replace comment by commentEmbeddable 2021-06-15 10:17:53 +02:00
nobohan
000ae6c2cb address: style (css) 2021-06-15 08:04:38 +02:00
nobohan
7c26f0a56c address: add a new address to a person 2021-06-15 07:49:35 +02:00
f827e50431 ajout métadonnées membres 2021-06-14 22:30:52 +02:00
41617295c1 fix validation groups and sequential validator msg 2021-06-14 16:39:27 +02:00
b2c1d75fc5 fix parameters in test MaxHolder 2021-06-14 12:58:23 +02:00
17c3ecbabe validation on simultaneous household membership for a person 2021-06-14 12:56:01 +02:00
de024b405f Merge branch 'features/household-editor' into 'master'
[UI] Add page to move members of household

See merge request Chill-Projet/chill-bundles!73
2021-06-14 09:38:17 +00:00
51399b21b9 fix class for Person component 2021-06-14 11:37:20 +02:00
c40019da8f add alert for not-in-household and actions in page
accompanyingCourse/summary

* alert for people not in household for each accompanying course;
* style for action in alert
* form to members editor
2021-06-14 11:34:05 +02:00
1df759e970 fix JS error "chill is not defined"
This happens since js is loaded using "defer" tag
2021-06-14 10:19:18 +02:00
Pol Dellaiera
92b4adc113 Fix DI on other services depending on updated repositories. 2021-06-11 21:56:17 +02:00
807d3674fc implements max holder and validation on UI 2021-06-11 17:58:09 +02:00
af740fd87d Merge branch 'features/household-editor' into features/household-validation 2021-06-11 17:08:38 +02:00
45dc8ed661 apply maxHolder constraint on houehold 2021-06-11 17:08:35 +02:00
ecc8b929ca create max holder validator 2021-06-11 17:03:48 +02:00
nobohan
c378f59f5a addresses: person address history 2021-06-11 16:20:40 +02:00
4fd6d38187 create Util for computing intersection 2021-06-11 15:53:32 +02:00
nobohan
f3a7556bca household address: update twig for household address 2021-06-11 15:44:49 +02:00
nobohan
14db7265fe addresses: fix POST if isNoAddress 2021-06-11 15:06:56 +02:00
nobohan
f22461af1b address: better default zoom when choosing an address 2021-06-11 14:42:08 +02:00
nobohan
1b709d39a4 addresses: enable POSTing Postal Code entities (back + front) 2021-06-11 14:33:22 +02:00
Pol Dellaiera
81e8a4562b Remove obsolete repositories.yaml file. 2021-06-11 12:43:54 +02:00
Pol Dellaiera
1e72247546 Update existing repositories and their corresponding entities. 2021-06-11 12:43:44 +02:00
Pol Dellaiera
670ba1713a Add missing repositories and update corresponding entities. 2021-06-11 12:43:38 +02:00
nobohan
5daf5cbe84 address: write new address (separate street and streetNumber) 2021-06-11 11:12:44 +02:00
nobohan
331cdf13ca household address: add validation on household->getAddresses 2021-06-11 09:34:27 +02:00
f25365f651 Add LICENSE 2021-06-11 07:31:28 +00:00
cbadcb4980 Merge remote-tracking branch 'origin/master' into features/household-validation 2021-06-11 09:05:48 +02:00
b2ce5fca38 household editor: allow to move without any household 2021-06-10 16:17:59 +02:00
38c06977ca add link to household or household editor 2021-06-10 15:18:41 +02:00
nobohan
1551ea796d household address: UI of the adress move form 2021-06-10 14:34:14 +02:00
3e39dd9a1e remove route for testing move 2021-06-10 13:02:35 +02:00
89734c680c backend: allow to remove people from household, or move to a new household 2021-06-10 13:01:42 +02:00
nobohan
4c025184b4 household address: check if address are sequential (WIP) 2021-06-10 12:40:01 +02:00
6fed008ff2 fix creation of new household during move 2021-06-10 11:48:06 +02:00
057bdf6a6a add missing message 2021-06-10 11:47:52 +02:00
nobohan
6f2c219e3b household address: add validTo computation in Address 2021-06-10 11:43:13 +02:00
nobohan
550aaacaab household address: fix POST api chaining 2021-06-10 11:42:39 +02:00
f9758eff5b fix use of context into householdMember::move 2021-06-10 11:16:37 +02:00
abc79249a2 Merge remote-tracking branch 'origin/master' into features/household-editor 2021-06-10 11:01:59 +02:00
f7bb9ac327 Merge branch 'features/household-members-list' into 'master'
Features/household members list

See merge request Chill-Projet/chill-bundles!76
2021-06-10 08:59:51 +00:00
3c727d1c65 fix format for date, after use of html5 date widget 2021-06-10 10:52:37 +02:00
ac211337d6 fix denomination: bold only in list 2021-06-10 10:31:59 +02:00
30668ca67f Merge remote-tracking branch 'origin/master' into features/household-members-list 2021-06-10 10:29:57 +02:00
5da0be24ff change icon for household 2021-06-10 10:20:18 +02:00
nobohan
dd78e9759c household address: show js error messages 2021-06-10 10:11:00 +02:00
nobohan
1b36d9b1ab household address: chain API call 2021-06-10 10:06:23 +02:00
7fddf1d5e0 fix indentation 2021-06-09 22:18:47 +02:00
315fc7f63a set default for Position attributes 2021-06-09 22:12:55 +02:00
3c889db41a style editor when no household nor persons to move 2021-06-09 22:08:10 +02:00
71f794c4d9 add ckeditor for comment 2021-06-09 17:31:55 +02:00
e135b98072 Merge remote-tracking branch 'origin/master' into features/household-editor 2021-06-09 16:27:03 +02:00
e14205ae1d first layout for form edit 2021-06-09 16:13:39 +02:00
nobohan
e14a125bf3 household address: format js date for POSTing 2021-06-09 12:24:15 +02:00
8a5650a705 Merge branch 'features/activity-form' into 'master'
Activity

See merge request Chill-Projet/chill-bundles!58
2021-06-09 06:23:55 +00:00
18217f53e8 Merge branch 'features/household-members-list' into features/household-editor 2021-06-08 22:16:43 +02:00
79ec182ca3 Merge branch 'features/date-type-use-html5' into features/activity-form 2021-06-08 22:01:19 +02:00
1433af8e95 fix format for birthdate in test 2021-06-08 21:57:06 +02:00
e91596ae12 fix callback for comparing birthdate in test 2021-06-08 19:44:31 +00:00
nobohan
9375c2cf86 household address: patch address + add validFrom input 2021-06-08 21:14:09 +02:00
nobohan
db77224b9f address: add swagger documentation 2021-06-08 20:36:20 +02:00
1c42bf6400 Merge branch 'features/date-type-use-html5' into features/activity-form 2021-06-08 19:45:58 +02:00
c9da72fa0d fix test: use format for html5 date 2021-06-08 19:44:55 +02:00
3b3855089c fix social action render 2021-06-08 19:42:29 +02:00
265ace0b4c update dep to app 2021-06-08 19:27:46 +02:00
0e1bbbfee9 Merge remote-tracking branch 'origin/master' into features/household-validation 2021-06-08 19:19:30 +02:00
ebf896ac74 use encore functions to load assets 2021-06-08 19:17:07 +02:00
31befaa339 remove dump 2021-06-08 18:19:24 +02:00
780c14cfbe Merge branch 'features/date-type-use-html5' into features/activity-form 2021-06-08 18:08:23 +02:00
8183c028f8 remove ref to pikaday 2021-06-08 18:07:59 +02:00
97bba861c9 Merge branch 'features/date-type-use-html5' into features/activity-form 2021-06-08 18:03:34 +02:00
8d7d170f11 Use Html5 datetype and remove pikaday and moment.js 2021-06-08 17:58:23 +02:00
c126f680ae Merge remote-tracking branch 'origin/master' into features/activity-form 2021-06-08 17:24:47 +02:00
nobohan
6a42edd460 household address: remove address selection 2021-06-08 17:06:03 +02:00
0aa909f060 fix misc in activity (WIP) 2021-06-08 16:55:29 +02:00
f27957e91b improve banner 2021-06-08 12:36:27 +02:00
ed891b224f allow to distinguish stle for list-with-periods and list household
members in css
2021-06-08 12:36:01 +02:00
nobohan
76d945f2a7 household address: address history : add button 2021-06-08 11:51:30 +02:00
nobohan
7d13bc7cfe household address: address history (twig + css) 2021-06-08 11:35:33 +02:00
nobohan
66b54bad31 household address: add swagger documentation 2021-06-08 08:55:41 +02:00
nobohan
9d32ccbcad address: swagger config for documenting API points 2021-06-08 08:30:54 +02:00
4dc82bc207 add test for Member edition + fix path 2021-06-07 21:52:17 +02:00
2384281532 update test app to new version 2021-06-07 21:23:28 +02:00
7c94824c20 Merge branch 'features/household-members-list' into features/household-editor 2021-06-07 17:36:25 +02:00
a922e397f8 Merge remote-tracking branch 'origin/master' into features/household-editor 2021-06-07 17:32:29 +02:00
be13f8f65b fullfill summary page 2021-06-07 17:27:10 +02:00
12f83abccc add encore to composer.json 2021-06-07 17:26:38 +02:00
nobohan
63c3b5a970 address: add swagger doc on API point for address 2021-06-07 17:24:31 +02:00
1967d6ea4c Merge branch 'features/household-context' into 'master'
Create an household context

See merge request Chill-Projet/chill-bundles!74
2021-06-07 15:04:44 +00:00
5cb076495a finalize members lists 2021-06-07 17:03:45 +02:00
nobohan
03a7ec389b household address: fix POST household address 2021-06-07 16:54:16 +02:00
604e78f35e restore list with period 2021-06-07 15:31:30 +02:00
nobohan
f39fe05dd5 household address: rely on ROLE_USER for household address api point role 2021-06-07 15:26:24 +02:00
eeffa3191e page list members of an household: born date + collpse old members 2021-06-07 15:14:42 +02:00
nobohan
6c126b0581 household address: api POST on address for household (WIP) 2021-06-07 15:13:45 +02:00
84d5fb936e use encore entry tags to load css and js in layout 2021-06-07 14:48:36 +02:00
nobohan
5ee824d1c2 household address: define a custom household-address API point (WIP) 2021-06-07 14:47:22 +02:00
7933aaed1c use MessageFormatter for formatting message with gender 2021-06-07 14:25:15 +02:00
nobohan
6d20476b81 household address: household address history (WIP) 2021-06-07 14:24:03 +02:00
nobohan
2b5ed5e5a3 household address: choose among available address 2021-06-07 12:18:03 +02:00
0fe70d00ec Merge branch 'remove-uneeded-service-definition' into 'master'
[simplification] Remove custom service definitions.

See merge request Chill-Projet/chill-bundles!72
2021-06-07 08:29:55 +00:00
e5905902cc add confirm button for move 2021-06-04 21:24:11 +02:00
48e5809008 add utility for date 2021-06-04 21:23:51 +02:00
a947634f30 remove dump 2021-06-04 19:52:03 +02:00
3e3c9dc894 Merge branch 'features/activity-form' of gitlab.com:Chill-Projet/chill-bundles into features/activity-form 2021-06-04 19:50:50 +02:00
574b5dcbd0 simplify concernedGroups template for bloc/row include 2021-06-04 19:50:00 +02:00
c1ba892811 list activity flex-table design 2021-06-04 18:59:34 +02:00
nobohan
6f68349f57 household address: post address to household (WIP) 2021-06-04 17:45:29 +02:00
nobohan
d513be2fce household address: post address to household (WIP) 2021-06-04 16:23:13 +02:00
Pol Dellaiera
7a33c37b51 Fix path. 2021-06-04 15:52:13 +02:00
Pol Dellaiera
a6c4b4eb55 Remove custom service definitions. 2021-06-04 15:52:12 +02:00
Marc Ducobu
160c7f2c31 Adding fr translation for social issues 2021-06-04 15:47:52 +02:00
nobohan
aff140230c household address: add a button for posting to household 2021-06-04 15:38:28 +02:00
Marc Ducobu
31468aeae0 Using select2 for reason field inside activity form 2021-06-04 15:15:28 +02:00
3e57ff3ffa Merge remote-tracking branch 'origin/master' into features/household-context 2021-06-04 15:11:36 +02:00
6cbbce03c4 Merge branch 'features/household' into 'master'
Manage household

See merge request Chill-Projet/chill-bundles!70
2021-06-04 13:10:42 +00:00
Marc Ducobu
e52c94aabd Use SocialIssueRenderer->renderString for displaying socialIssues 2021-06-04 15:04:36 +02:00
ef98111a2f Merge remote-tracking branch 'origin/master' into features/household 2021-06-04 15:03:00 +02:00
55fa16ce56 fix missing postgresql extension: correct class name 2021-06-04 14:54:14 +02:00
nobohan
7e1b7b7e9f household address: init vue component for household address 2021-06-04 14:50:51 +02:00
Marc Ducobu
39dca2a9ca Form for socialIssues & Actions using expanded 2021-06-04 14:48:07 +02:00
80ccb76794 Merge branch 'master' into 38_modal_on-the-fly 2021-06-04 14:18:54 +02:00
nobohan
878ee5d9c7 household address: correct household api entry point 2021-06-04 12:34:44 +02:00
Marc Ducobu
541fe8f1ad Removing extra line 2021-06-04 12:22:17 +02:00
Marc Ducobu
bb71b9f908 Descendants for socialActions & Issues 2021-06-04 12:22:17 +02:00
nobohan
7b67ef5db2 household address: add household api entry point 2021-06-04 12:13:15 +02:00
330234981c Merge remote-tracking branch 'origin/features/activity-form--marc' into features/activity-form 2021-06-04 11:58:33 +02:00
a323e84357 concerned parties in vue component: display 3 or 4 bloc according to context 2021-06-04 11:53:50 +02:00
c33f577f5a activity show: concerned parties are clickable links 2021-06-04 10:52:07 +02:00
nobohan
0ce814cf52 hotfix: delete duplicate key in ChillPersonBundle messages translation 2021-06-04 09:34:36 +02:00
nobohan
d806a074a7 Merge branch 'master' into _77_address_household
merge master
2021-06-04 09:09:59 +02:00
nobohan
14a9d9c739 address-household: address move (WIP) 2021-06-04 08:48:08 +02:00
502a629dc8 add date for movement editor 2021-06-03 22:09:52 +02:00
4ace2fef99 concerned parties, split in activity model persons associated or not 2021-06-03 20:20:56 +02:00
Marc Ducobu
4a1ebc1c4c Removing dump 2021-06-03 20:18:47 +02:00
Marc Ducobu
4553051271 Review load fixtures for activityType & categories 2021-06-03 20:15:40 +02:00
Marc Ducobu
743d6cd0bf Method setX with return this (and not void) 2021-06-03 20:15:40 +02:00
Marc Ducobu
0f635ca51a SocialAction & Issues in Activity form 2021-06-03 20:15:40 +02:00
987815471c add concerned parties in show activity page (2 contexts) 2021-06-03 19:13:58 +02:00
d9a3e117b2 WIP continue editor 2021-06-03 18:11:05 +02:00
nobohan
f6d4d32ce4 fix conflict when merging 2021-06-03 15:11:09 +02:00
937be1af3a fix html5 birthdate field on modal form OnTheFly 2021-06-03 14:34:52 +02:00
32b3d74a1b fix activity entity addPersons if person is null 2021-06-03 13:48:03 +02:00
nobohan
43fb020272 address: remove serializer config (it is autowired) 2021-06-03 13:01:24 +02:00
nobohan
f26fafb2f2 address: remove comment 2021-06-03 10:35:27 +02:00
nobohan
e1e3051d00 address: correct customizeQuery 2021-06-03 10:33:09 +02:00
nobohan
a659263af6 addresses: translations 2021-06-03 10:27:17 +02:00
nobohan
9333b6d2df address: correct customizeQuery 2021-06-03 10:22:20 +02:00
4d0cfbb396 OnTheFly modal, Person Sub-component: create/edit form, show 2021-06-02 22:29:09 +02:00
e9caa7b4b8 add groups on household serialization 2021-06-02 21:44:49 +02:00
261acdfd24 Merge branch 'features/household' into features/household-context 2021-06-02 16:48:54 +02:00
17481798fb fix duplicate in messages.fr.yml 2021-06-02 16:38:59 +02:00
edb8aa1dfe Merge branch 'master' into features/household 2021-06-02 16:28:24 +02:00
93a67c9ab9 Merge branch 'fix-person-tests'
Conflicts:
	src/Bundle/ChillPersonBundle/translations/messages.fr.yml
2021-06-02 16:25:37 +02:00
980a305456 Merge branch 'dune-risky'
Conflicts:
	src/Bundle/ChillActivityBundle/config/services.yaml
	src/Bundle/ChillPersonBundle/translations/messages.fr.yml
2021-06-02 16:23:45 +02:00
0158c6f2ed add tests for household 2021-06-02 16:21:01 +02:00
ff5b0bc258 add list for addresses 2021-06-02 16:20:46 +02:00
a133f56dce add routes for household addresses, members, and addresses_moves 2021-06-02 15:45:39 +02:00
Marc Ducobu
c4e226d0bd Ajout de SocialIsssue & SocialAction to ActivityType 2021-06-02 12:47:43 +02:00
fa556bbba1 basic context for household 2021-06-02 11:44:36 +02:00
e8f3c499ee Merge branch 'dune-risky' into fix-person-tests 2021-06-02 00:47:14 +02:00
cfd9f1bab1 replace call to entity by class FQDN 2021-06-02 00:46:55 +02:00
c6949490a4 first impl for household editor 2021-06-02 00:32:55 +02:00
nobohan
8011293b28 address form: add the possibility to create a new address 2021-06-01 21:55:34 +02:00
Marc Ducobu
7992f09aea Ajout SocialAction & SocialIssues to Activity 2021-06-01 17:18:00 +02:00
abede56d68 activity vue corrections 2021-06-01 16:18:01 +02:00
9ab032c943 resolve data Transformer in ActivityType (persons/thirdparties/users) 2021-06-01 15:13:21 +02:00
4562ed46db OnTheFly modal: adapt footer button for show/edit cases (bug minor)
[BUG] to reproduce:
* clic first on show item button
* in modal clic edit button
* close modal
* clic again on show item button
2021-06-01 10:48:34 +02:00
cd52f7e6e8 Merge branch 'fix-person-tests' into features/household 2021-05-31 21:40:24 +02:00
126ffc55bf Merge branch 'fix-getParticipationsContainsPerson' into 'master'
Fix `::getParticipationsContainsPerson`.

See merge request Chill-Projet/chill-bundles!50
2021-05-31 19:35:33 +00:00
f49c54d51f fix redirection after creating accompanying course in test 2021-05-31 21:31:02 +02:00
1410213258 Merge remote-tracking branch 'origin/master' into fix-person-tests 2021-05-31 21:17:56 +02:00
35e0b98687 temporarily remove test for person duplicate 2021-05-31 21:16:31 +02:00
8f1091b8a3 Merge branch '50-ajout-problematique-sociale-modele' into 'master'
Add many2many relation between socialIssue and accompanying period + api endpoint

See merge request Chill-Projet/chill-bundles!53
2021-05-31 19:11:15 +00:00
c269bfe278 fix type-hinting for person repository 2021-05-31 21:09:14 +02:00
041b1dfc51 Controller action to move members of an household 2021-05-31 20:42:07 +02:00
718d6c2375 add basic on-the-fly sub-components, to show/edit/create person/thirdparty 2021-05-31 19:25:37 +02:00
158b572879 replace all links and buttons involved by OnTheFly component 2021-05-31 15:52:26 +02:00
68059a9938 add new OnTheFly vue sub-component 2021-05-31 12:59:11 +02:00
543f6b20dd firstname and lastname in same column 2021-05-31 11:39:15 +02:00
e95d756e71 fix socialIssues multiselect with searchable=true option 2021-05-31 09:59:44 +02:00
992734bb72 fix banner toggleFlags regular/occasionnal 'on' style -> stronger 2021-05-31 09:54:28 +02:00
741ed84918 formType transform string id in entities, wip 2021-05-28 22:59:56 +02:00
5822736f19 store action add/remove id values in hidden input fields 2021-05-28 22:29:34 +02:00
66776eed01 activity component split added persons between 'Usagers du parcours' and 'Tiers non pros.' 2021-05-28 19:27:27 +02:00
ace3b1969e Rename membership edition and add more fixtures 2021-05-28 18:26:22 +02:00
edc86af659 add tests for moving houshold 2021-05-28 18:01:20 +02:00
e123ee5d03 activity vue component add and remove persons (in store) 2021-05-28 17:30:11 +02:00
87ba68971c first impl of person Mover + add fixtures 2021-05-28 16:41:37 +02:00
94bcbac06a add extension btree_gist to postgres 2021-05-28 13:55:06 +02:00
74520330b1 add position for household and prefix tables names 2021-05-28 13:25:41 +02:00
666c1e7ae7 replace border by box-shadox in flex-bloc and flex-table
We use box-shadow instead of border
to avoid to manage border double-width
when blocs are resized for small screen !

Then we can simulate border-collapse: collapse (table)
2021-05-28 12:46:04 +02:00
nobohan
935006eae3 addresses form: add default country value 2021-05-28 12:31:08 +02:00
622c254cc4 Activity: vue DisplayPerson component logic 2021-05-28 12:14:46 +02:00
a19fd51600 serialize new activity when id's not yet defined 2021-05-28 12:13:28 +02:00
nobohan
165012b302 address: POST an address 2021-05-28 10:14:54 +02:00
nobohan
057db09847 addresses: improve address multiselect 2021-05-28 09:06:07 +02:00
56242f9b5a adapt requestor to flex-table 2021-05-27 22:55:07 +02:00
549f3a4c78 AddPersons in activity
* modal button dont submit all form
* addNewPersons action mutation loop ready
2021-05-27 22:53:35 +02:00
9ec2a62fb6 controller return json to vue via twig, corrections 2021-05-27 18:41:22 +02:00
65ac9a47b4 add addPersons subcomponent 2021-05-27 17:53:14 +02:00
b1d7e543fc controller return json to vue via twig; init vue App 2021-05-27 17:36:33 +02:00
b89cffce68 add serializer to activityController 2021-05-27 16:13:22 +02:00
nobohan
063076d0cb address: use multiselect for city and address selection 2021-05-27 15:15:20 +02:00
nobohan
bcf2b9d834 address: use multiselect for country selection 2021-05-27 14:49:41 +02:00
968e6914b2 add new webpack vue entrypoint for activity
+ rename existing activity.scss
+ rename webpack vue accompanyingCourse entrypoint
2021-05-27 13:29:01 +02:00
52ee8c5a9a activity: change fields order in form 2021-05-27 13:27:40 +02:00
nobohan
64d28106c8 address: POST a new address: treat the postcode 2021-05-27 12:34:45 +02:00
0a5d20b16f Merge branch 'master' into features/activity-form 2021-05-27 11:43:37 +02:00
85dda8b680 hide flex-table test on page AccompanyingCourse history 2021-05-27 11:34:49 +02:00
2c49afe549 Merge branch 'master' into features/activity-form 2021-05-27 10:44:21 +02:00
2e1201418a Merge branch 'fix-activity-menubuilder-definition' into 'master'
fix activityBundle menuBuilder definition

See merge request Chill-Projet/chill-bundles!69
2021-05-27 08:40:29 +00:00
a9fb916843 fix activityBundle menuBuilder definition 2021-05-27 10:37:24 +02:00
6631e853b4 Merge branch 'master' into features/activity-form 2021-05-27 10:08:40 +02:00
e26e3ac67b Merge branch '59_parcours_resu_2' 2021-05-27 09:28:23 +02:00
562c72f7bb missing comma 2021-05-27 00:06:00 +02:00
6602e1b286 fix wording in timeline accompanying period test 2021-05-27 00:03:22 +02:00
b69aaeafd9 fix tests for search 2021-05-26 23:54:00 +02:00
aa473b5f70 fix errors on tests in person bundle 2021-05-26 23:25:36 +02:00
124e36b9d4 fix declaration of entity rendering 2021-05-26 22:58:28 +02:00
b88765c344 fix tests 2021-05-26 22:57:00 +02:00
f3427d6754 fix declaration of entity rendering 2021-05-26 22:56:35 +02:00
df00ac66f5 Merge remote-tracking branch 'origin/master' into fix-person-tests 2021-05-26 22:44:45 +02:00
2b12e61fbd Merge remote-tracking branch 'origin/fix-getParticipationsContainsPerson' into fix-person-tests 2021-05-26 22:38:25 +02:00
151e8deaeb fix some tests for person bundle 2021-05-26 22:37:37 +02:00
acbe93f9cf Merge remote-tracking branch 'origin/dune-risky' into fix-person-tests 2021-05-26 21:57:09 +02:00
358410cde1 Remove dead code 2021-05-26 19:44:58 +00:00
06c74ed5ed add menu into section 2021-05-26 21:14:42 +02:00
25c986cc61 fix rendering for timeline entries in center context 2021-05-26 18:10:51 +02:00
cad8174333 apply timelineSingleQuery on events 2021-05-26 18:05:02 +02:00
6c8f1f77ff improve flex-table and flex-box 2021-05-26 18:03:54 +02:00
75c586fbf8 fix documentation for timeline 2021-05-26 17:58:58 +02:00
2cb9dfc250 add tasks to global timeline 2021-05-26 17:50:54 +02:00
3b2d4142c1 Merge branch 'master' into 'gitlab-ci-fix-initialization'
# Conflicts:
#   phpunit.xml.dist
2021-05-26 14:33:58 +00:00
9a6bab7ba2 Update phpunit.xml.dist 2021-05-26 14:27:31 +00:00
c2bbee299c remove tests for person bundle 2021-05-26 13:56:42 +00:00
f4db9be557 remove tests for person, which are not fixed 2021-05-26 13:43:41 +00:00
5449efdd97 Increase memory for running phpunit 2021-05-26 13:35:38 +00:00
7896d288e7 Increase memory_limit for some operations 2021-05-26 13:31:25 +00:00
b98d6fa505 launch a bash command for debugging 2021-05-26 13:25:29 +00:00
e4d1b951a3 Merge branch 'fix-missing-dependency' into 'master'
Fix repositories - add typing - add missing methods - remove obsolete phpdoc

See merge request Chill-Projet/chill-bundles!60
2021-05-26 13:22:25 +00:00
ae8e5bc2e3 Merge branch 'master' into 'fix-accompanying-period-opening'
# Conflicts:
#   src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php
2021-05-26 13:11:23 +00:00
9b66f7a83f Merge branch 'fix_load_fixtures' into 'master'
Fix load fixtures

See merge request Chill-Projet/chill-bundles!66
2021-05-26 11:04:43 +00:00
Pol Dellaiera
13d5b7078e Prevent infinite loop and memory leak. 2021-05-26 10:44:35 +02:00
37996651c4 Search list with periods, html/scss refactoring 2021-05-26 00:09:25 +02:00
Marc Ducobu
679665d9db Handle parent deletion in associated tables (ThirdPartyBundle) 2021-05-25 23:47:15 +02:00
Marc Ducobu
1d4edd5b7b Handle parent deletion in associated tables (PersonBundle) 2021-05-25 23:46:05 +02:00
Marc Ducobu
f1c77277f3 Handle parent deletion in associated tables (MainBundle) 2021-05-25 23:45:08 +02:00
6264171c0c Merge branch 'period-in-list-result' into 59_parcours_resu_2 2021-05-25 22:00:58 +02:00
902d8b52d3 Merge branch 'master' into 59_parcours_resu_2 2021-05-25 21:51:06 +02:00
caeb75ce13 vue requestor component, flex-table design 2021-05-25 21:44:15 +02:00
2f27674e05 flex table (row) design 2021-05-25 20:40:05 +02:00
ce9070e641 redirect to resume page after confirm action 2021-05-25 19:09:50 +02:00
5350a09951 apply timeline for report 2021-05-25 19:07:09 +02:00
31252461c9 load vue banner component for each page of AccompanyingCourse context
* vue css and js loaded from layout.html.twig
* rename 'show' template to 'edit' template
* overwrite js block for 'edit' template (load all component, not only banner)
2021-05-25 19:05:51 +02:00
73790db700 Merge branch 'add-doctrine-dbal-configuration-in-the-bundle' into 'master'
Add Doctrine DBAL postgis configuration in the bundle.

See merge request Chill-Projet/chill-bundles!65
2021-05-25 16:52:23 +00:00
nobohan
72795be040 post new address - WIP 2021-05-25 17:54:21 +02:00
fc2a2da75f page blocs design 2021-05-25 15:36:07 +02:00
nobohan
e88e9b1a6f addresses: add groups annotation to Country, postal code & address reference 2021-05-25 15:07:32 +02:00
nobohan
f7dea7f041 address selection: fix leaflet icon anchor + css for the form 2021-05-25 15:07:32 +02:00
nobohan
57a35f88be addresses reference: remove the load Adressess references command (has moved to the Vendee app) 2021-05-25 15:05:52 +02:00
nobohan
1b1eb45d15 address: improve load addresse reference command" 2021-05-25 15:05:52 +02:00
nobohan
65859f62f3 address selection: filter addresses based on cities 2021-05-25 15:05:52 +02:00
nobohan
4cc308c936 address selection: filter cities based on country 2021-05-25 15:05:52 +02:00
nobohan
2f28cb16ef addresses: import address reference: add pagination and error handling 2021-05-25 15:05:52 +02:00
nobohan
73ee77b8b2 addresses: import reference address from WFS using httpClientInterface 2021-05-25 15:05:52 +02:00
nobohan
830cda64e0 addresses: add symfony http-client as a dependency 2021-05-25 15:05:52 +02:00
nobohan
3bc510d116 addresses: add pagination in WFS request (WIP) 2021-05-25 15:05:52 +02:00
nobohan
5f8a506c84 addresses: add postcode in address reference load command 2021-05-25 15:05:52 +02:00
nobohan
bbb9dc2561 address reference: command for loading addresse reference (WIP) 2021-05-25 15:05:52 +02:00
nobohan
b51575fc49 address selection: order preferred countries 2021-05-25 15:05:51 +02:00
nobohan
fee37b5af3 address selection: use API points for Country and PostalCode + remove obsolet Address Controller 2021-05-25 15:05:51 +02:00
nobohan
0afcf3d79e address selection: move marker on the leaflet map on update map 2021-05-25 15:05:51 +02:00
juminet
743b456030 Merge branch 'add-api-for-person' into 'master'
Add api for person

See merge request Chill-Projet/chill-bundles!61
2021-05-25 12:59:59 +00:00
0dbd42ba5b Merge branch '139_demandeur' into 'master'
139 suite et fin

See merge request Chill-Projet/chill-bundles!62
2021-05-25 12:39:00 +00:00
7efbf2fce8 59 résumé, flex person position 2021-05-25 10:49:11 +02:00
9b1a66c992 fix query in timeline in activity and person bundle 2021-05-25 09:48:19 +02:00
Pol Dellaiera
cb897cfef1 Move Doctrine DBAL configuration in the appropriate and already existing code section. 2021-05-25 08:05:18 +02:00
Pol Dellaiera
bafbc2dd74 Add Doctrine DBAL postgis configuration in the bundle.
This can now be removed totally from the user application.
2021-05-25 07:57:12 +02:00
74541f360b fix activity timeline using TimelineSingleQuery 2021-05-24 20:26:33 +02:00
20a14c9ff4 cleaning chillmain.scss 2021-05-24 13:19:37 +02:00
cdade50d76 display person and thirdparty informations in accompanyingCourse index template (twig) 2021-05-24 11:23:03 +02:00
d4f96ee25f add 'with_icon' option in twig address macro 2021-05-24 11:22:27 +02:00
ca33580831 improve how refresh height sum and anchors position 2021-05-23 14:41:53 +02:00
64e37c5235 corrections 2021-05-23 14:03:43 +02:00
bf576e171c corrections 2021-05-23 12:35:47 +02:00
3f2fe6a138 Merge branch '_sticky_nav' into 139_demandeur 2021-05-23 11:51:38 +02:00
f18ccce814 comment console.log 2021-05-23 11:51:02 +02:00
2386a35eb7 fix bottom page exception + listen size changes too in main container 2021-05-23 11:47:01 +02:00
1fbda740a7 stickNav map elements switch active when scrolling 2021-05-23 11:13:21 +02:00
d35e1fe21e stickyNav item in a subcomponent 2021-05-23 10:16:18 +02:00
771b9eb616 anchors wip 2021-05-23 00:49:02 +02:00
4261ddcde4 cleaning 2021-05-23 00:10:26 +02:00
6ee03b7ebb top computed 2021-05-23 00:07:43 +02:00
1217578202 fix absolute / fixed navbar position 2021-05-22 23:42:25 +02:00
c7b6788288 Merge branch '139_demandeur' into _sticky_nav 2021-05-22 09:58:55 +02:00
02f1d2ff8a rename subcomponent 2021-05-22 09:56:09 +02:00
bb677152c9 sticky nav better position 2021-05-21 23:45:48 +02:00
ad6519fb87 minimalist squares navmap 2021-05-21 22:59:51 +02:00
d08f2e0e11 referrer component 2021-05-21 22:59:06 +02:00
73aeca0916 allow to import existing person from normalizer 2021-05-21 20:24:24 +02:00
080a54231f Merge remote-tracking branch 'origin/master' into add-api-for-person 2021-05-21 20:19:38 +02:00
b403569b16 improve and clean socialIssues 2021-05-21 19:47:39 +02:00
3abfb02962 Merge branch '_multiselect_store' into 139_demandeur 2021-05-21 19:23:45 +02:00
11a6d08023 add reactives social issues in banner 2021-05-21 19:16:09 +02:00
69ecc42055 enable fetch post/delete socialIssues 2021-05-21 19:06:16 +02:00
5f74c5297a move subcomponents in subfolder 2021-05-21 19:03:42 +02:00
34fcefa1bd temporary fix to allow creation on persons without centers 2021-05-21 18:31:20 +02:00
c9e6935f15 fix requirements on POST route 2021-05-21 18:30:52 +02:00
21cc0007fb transformValue to payload, body and method 2021-05-21 18:24:32 +02:00
ebe3bc5f7b add route for creating a person, and post api 2021-05-21 18:05:03 +02:00
132f11298e now i have to find id+method from payload 2021-05-21 17:05:14 +02:00
21f75c8a63 dont use mapActions 2021-05-21 16:54:25 +02:00
c1e1f65715 action resolve commit payload, but fetch body+method 2021-05-21 16:44:59 +02:00
Pol Dellaiera
5cc5e6a1f7 Fix missing dependency. 2021-05-21 16:35:26 +02:00
Pol Dellaiera
1f4735caac Fix missing ::find method. 2021-05-21 16:35:13 +02:00
Pol Dellaiera
d672a29dda Remove obsolete documentation, fix typing here and there. 2021-05-21 16:34:42 +02:00
68ebd60bc8 options managed by data, not store 2021-05-21 16:22:33 +02:00
4d12796289 get options and display selected 2021-05-21 16:08:26 +02:00
857298b8b8 add api Method GET on person 2021-05-21 16:04:18 +02:00
220f1ea0eb Merge branch '139_demandeur' into 'master'
139 Demandeur

See merge request Chill-Projet/chill-bundles!43
2021-05-21 12:53:03 +00:00
a88acd34fd design and translations 2021-05-21 11:41:36 +02:00
8ae113c872 person search rendering more reponsive 2021-05-20 19:20:06 +02:00
098a2ea620 improve AccompanyingCourse ux design 2021-05-20 18:42:40 +02:00
6a62b46dec first impl 2021-05-20 17:41:37 +02:00
Jean-Francois Monfort
2bae684df9 Add list of activities in AccompanyingCourse Menu 2021-05-20 17:08:47 +02:00
8bd75429c1 improve AccompanyingCourse ux design 2021-05-20 16:45:47 +02:00
Jean-Francois Monfort
8fe00b4c2b Add / Edit / Delete activity from Accompanying Course 2021-05-20 15:56:34 +02:00
199e5a73d8 confirm modal "are you sure ?" 2021-05-20 15:43:10 +02:00
54d03275cf place html anchors: top, bottom of page + for each form section 2021-05-20 14:35:32 +02:00
8683f8faf3 titles: size and interaction 2021-05-20 13:24:53 +02:00
821b67723c Banner vue component fully manage AccompanyingCourse banner 2021-05-20 12:59:58 +02:00
ae1146c79c Confirm post request, change state step and hide components 2021-05-20 11:45:29 +02:00
050c325195 renaming AccompanyingCourse component in 'Banner' 2021-05-20 11:07:00 +02:00
5e0d869d9b Merge branch '139_demandeur' of gitlab.com:Chill-Projet/chill-bundles into 139_demandeur 2021-05-20 09:53:33 +02:00
Jean-Francois Monfort
c59cf3f0df Merge remote-tracking branch 'origin/139_demandeur' into features/activity-form 2021-05-20 08:57:32 +02:00
Jean-Francois Monfort
890b8db5dd Merge branch 'master' into features/activity-form 2021-05-20 08:20:10 +02:00
32b8de8997 implements trackable on accompanying period 2021-05-19 23:08:13 +02:00
9f1f7ad3f7 skeleton for page "index accompanying course" 2021-05-19 22:36:47 +02:00
9da4c1ebeb get SocialIssues List in multiselect 2021-05-19 22:20:16 +02:00
9b7a52064a page 'create a course' for draft accompanying course 2021-05-19 22:15:04 +02:00
faad3f5f47 add menu for creating an accompanying period 2021-05-19 21:48:40 +02:00
Pol Dellaiera
7595d70ada Fix ::getPersons.
1. Add more typing informations.
2021-05-19 19:10:03 +02:00
Pol Dellaiera
484259c8ab Fix ::canBeReOpened.
1. Fix call to `::getOpenParticipationContainsPerson` instead of `::getParticipationsContainsPerson`.
2. Use early returns to reduce cyclomatic complexity.
3. Avoid storing variable that are used only once.
2021-05-19 19:10:03 +02:00
Pol Dellaiera
a6e0b16032 Fix ::getOpenParticipationContainsPerson
1. The filter predicate must return a boolean
2. The $person variable is not needed
2021-05-19 19:10:03 +02:00
Pol Dellaiera
9d34968b88 Fix ::getParticipationsContainsPerson.
1. `::getParticipations()` does not accept any argument.
2. The filter predicate must return a boolean.
2021-05-19 19:10:03 +02:00
f548121312 wip 2021-05-19 18:29:24 +02:00
1ecb1abc80 Merge branch '139_demandeur' of gitlab.com:Chill-Projet/chill-bundles into 139_demandeur 2021-05-19 16:22:28 +02:00
28a45992c6 first vue multiselect implementation 2021-05-19 16:18:56 +02:00
c39097f164 removeComment button replaced by link
that allows to keep it both inside <form> and in <ul class="record_actions">
2021-05-19 16:18:56 +02:00
30b127bc88 vue-component dev style more discrete, + disable flashbag for comment 2021-05-19 16:17:57 +02:00
25d7fc36a4 action to create an accompanyinig period 2021-05-19 16:14:36 +02:00
03bd1674e1 fix resource repository 2021-05-19 16:13:19 +02:00
b018a50a7e encore_entry_link_tags allows to use <style scoped> in vue files 2021-05-19 16:07:37 +02:00
4440cf8a24 add missing declaration property 2021-05-19 16:00:06 +02:00
6bd7a0105d Merge branch 'quick-fix-crud' into 'master'
Crud : fix sprintf pbm

See merge request Chill-Projet/chill-bundles!55
2021-05-19 13:15:35 +00:00
Marc Ducobu
51c2408878 Crud : fix sprintf pbm 2021-05-19 15:00:13 +02:00
242c77a30c partially revert 75ba07f18 (17/05) 2021-05-19 13:40:51 +02:00
22aa4afc02 action: confirm accompanying period + create workflow 2021-05-19 13:20:59 +02:00
04e9e30972 quick fix for banner 2021-05-19 11:44:09 +02:00
d536da3581 initialcomment: conditionnal delete button 2021-05-19 10:37:29 +02:00
27f49b2aa3 fix initialComment with patch endpoint 2021-05-19 10:34:17 +02:00
912a8d53af Merge branch 'fix_issue_43_add_entities' into 'master'
LoadFixtures, replacing Array() by []

See merge request Chill-Projet/chill-bundles!54
2021-05-18 18:13:41 +00:00
9ef397e935 fix docblock 2021-05-18 20:12:03 +02:00
eca8172c6d doc for multi-types denormalizer 2021-05-18 20:11:49 +02:00
f3802e36b3 documentation for api 2021-05-18 19:58:29 +02:00
2f9c7c38b5 fix read group on scope 2021-05-18 19:58:16 +02:00
Marc Ducobu
d73fd697dd Array() -> [] 2021-05-18 19:21:52 +02:00
f35889339d remove comment in constructor 2021-05-18 19:20:50 +02:00
8e95166c24 fix replacing an initial comment in accompanying period 2021-05-18 19:19:22 +02:00
30c53b17f7 documentation for get/index social issues api endpoint 2021-05-18 19:13:30 +02:00
2610730219 add initial comment to accompanying period 2021-05-18 19:04:09 +02:00
5dd99d201b Merge remote-tracking branch 'origin/master' into 50-ajout-problematique-sociale-modele 2021-05-18 17:30:28 +02:00
d327dae9fa Merge remote-tracking branch 'origin/139_demandeur' into 139_demandeur 2021-05-18 17:24:28 +02:00
2bdbb20154 Merge remote-tracking branch 'origin/master' into 139_demandeur 2021-05-18 17:24:09 +02:00
14bd211a5f add api endpoint for adding/remove social issue on accompanying period 2021-05-18 17:18:35 +02:00
35627203e6 remove props for ToggleFlags component 2021-05-18 16:23:40 +02:00
f978636d57 add intensity in teleported toggleFlags 2021-05-18 16:14:10 +02:00
e095cac7e0 Merge branch '50-ajout-problematique-sociale-modele' into 139_demandeur 2021-05-18 16:11:18 +02:00
c5b0d6e2bd Merge branch '20-use-fqdn-in-person-creation-form' into 'master'
Use FQDN in PersonCreation form

See merge request Chill-Projet/chill-bundles!52
2021-05-18 14:06:57 +00:00
Pol Dellaiera
905cb66011 Merge branch 'fix-services-repository-loading' into 'master'
Update repositories service discovery.

See merge request Chill-Projet/chill-bundles!34
2021-05-18 12:13:34 +00:00
eaac97221f add many2many relation between socialIssue and accompanying period + api endpoint 2021-05-18 13:48:11 +02:00
Pol Dellaiera
893c38fba4 Fix collateral things. 2021-05-18 12:02:00 +02:00
Pol Dellaiera
f867f4985d Add a note about the custom service definition for the repository. 2021-05-18 12:02:00 +02:00
Pol Dellaiera
aebeefcf80 Use repositories as services. 2021-05-18 12:02:00 +02:00
Pol Dellaiera
3fc6c0c479 refactor: Update entities. 2021-05-18 12:02:00 +02:00
Pol Dellaiera
ce854cb58f refactor: Upgrade repositories. 2021-05-18 12:02:00 +02:00
Pol Dellaiera
ed4f1344c2 Service autodiscovery, autowire and autoconfigure. 2021-05-18 12:02:00 +02:00
Marc Ducobu
86dbe527d8 Adding missing arguments for services 2021-05-18 12:02:00 +02:00
Pol Dellaiera
69a56fb433 Update repositories service discovery. 2021-05-18 12:02:00 +02:00
Pol Dellaiera
a7fad0ca1b tests: Update relevant tests but it seems that it is currently broken. 2021-05-18 12:00:58 +02:00
Pol Dellaiera
9b8c34a9be Symfony form: use FQDN instead of custom constant. 2021-05-18 12:00:58 +02:00
5acc78507e building Confirm component 2021-05-18 10:59:06 +02:00
1722cf721e init SocialIssue, Referrer and Confirm components 2021-05-18 09:57:10 +02:00
75ba07f181 course banner: opening date by user 2021-05-17 22:50:28 +02:00
5b635fbe58 fix input value for radio selection in AddPersons modal
selected value is different for radio or checkbox
for radio value is an object, for checkbox vaue is an array of objects
2021-05-17 22:19:23 +02:00
e0dc0a8fdb add Comment component, make POST comment request 2021-05-17 16:10:36 +02:00
2aa13dceff catchError mutation 2021-05-17 15:56:14 +02:00
ea477a9842 add accompanying period opening/closing to global timeline 2021-05-17 13:24:50 +02:00
73653744d7 Prepare for deprecation of class Role, and add method to filter centers 2021-05-17 13:23:58 +02:00
55264da092 prepare postComment fetch request 2021-05-17 12:05:46 +02:00
38f5854c6d AddPersons, move/rename files 2021-05-17 12:04:22 +02:00
3c6d3f30d2 teleport toggle flags in header 2021-05-17 11:25:20 +02:00
a6d6a962cd Merge branch 'issue_43_add_entities' into 'master'
Add fixtures for social work

See merge request Chill-Projet/chill-bundles!46
2021-05-17 08:24:36 +00:00
6256d6a19e Apply 1 suggestion(s) to 1 file(s) 2021-05-17 08:23:21 +00:00
8841af8d2b remove references to no-static container 2021-05-17 10:07:23 +02:00
0a9b8ba0b0 remove test that concerns old code 2021-05-17 10:05:03 +02:00
9710f8be63 display resources table row 2021-05-14 21:25:30 +02:00
d872bf65dd reactive toggle flags emergency and confidential 2021-05-14 20:42:22 +02:00
c3ef8d112c first impl for global timeline: apply on activities 2021-05-14 16:25:56 +02:00
f2a4347de7 Merge branch 'master' into fix-person-tests 2021-05-14 10:24:35 +02:00
51a4880fdb Merge branch 'fix-gitlab-ci-with-postgis' into 'master'
Update .gitlab-ci.yml - change db image

See merge request Chill-Projet/chill-bundles!51
2021-05-14 08:24:10 +00:00
a4d22b0fcb Update .gitlab-ci.yml - change db image 2021-05-14 08:16:28 +00:00
8d051800a4 Merge branch 'fix-accompagnyingperiod' into 'master'
Make sure the called method has the proper name.

See merge request Chill-Projet/chill-bundles!48
2021-05-14 07:58:33 +00:00
Pol Dellaiera
c0b59162a1 Rename ::participationsContainsPerson($person); in ::getParticipationsContainsPerson($person);. 2021-05-14 08:32:22 +02:00
0e53a081c7 Merge branch 'fix-person-tests' into 139_demandeur 2021-05-13 21:44:22 +02:00
d76f6d716f exclude tests which concerns exports for persons 2021-05-13 21:44:09 +02:00
f1d5d9840e add route for scope on participation 2021-05-13 17:44:54 +02:00
f3eb418409 test sur création et retrait commentaire 2021-05-13 17:31:46 +02:00
3e85529468 add route for comment + track update/creation of entities 2021-05-13 17:25:24 +02:00
05798688d0 refactore method addRemoveSomething, and add test for resources 2021-05-13 16:29:05 +02:00
01f35eed04 rename all interlocutor in resource 2021-05-13 11:09:07 +02:00
aef97cca32 fetch post resource 2021-05-13 10:59:24 +02:00
87e2ac9386 handling multi types and acc-period/repositories endpoint 2021-05-13 00:54:44 +02:00
4a04628d5b adapt payload body to entity convention with type + id 2021-05-12 18:50:18 +02:00
0af78f814c Merge branch '139_demandeur' of gitlab.com:Chill-Projet/chill-bundles into 139_demandeur 2021-05-12 18:34:03 +02:00
929d40ff6e add particiaption to openapi 2021-05-12 18:32:15 +02:00
68f6642ff2 Merge branch '139_demandeur' of gitlab.com:Chill-Projet/chill-bundles into 139_demandeur 2021-05-12 17:52:49 +02:00
91e4d585ff add a discrimnator type on onbjects 2021-05-12 17:51:37 +02:00
eac42581a6 interlocutors: actions, mutations, fetch request (wip) 2021-05-12 17:40:23 +02:00
Marc Ducobu
4e50d0ace9 Merge branch 'fix-style-stuff2' into 'master'
Fix style stuff2

See merge request Chill-Projet/chill-bundles!47
2021-05-12 14:06:46 +00:00
Marc Ducobu
0b54adeb59 Removing spaces at the end of line 2021-05-12 16:04:42 +02:00
Marc Ducobu
5d23de4862 Removing spaces at the end of line 2021-05-12 16:04:27 +02:00
Marc Ducobu
eda454cb9d Add fixtures for social work 2021-05-12 15:40:40 +02:00
6da8f1c107 when passed option uniq, suggestions are with radio button, not checkbox 2021-05-12 15:26:46 +02:00
4fb487dcef requestor logic, is_anonymous patch request 2021-05-12 14:49:26 +02:00
0d6a339b53 Merge branch '_23_addresses_form_2' into 139_demandeur 2021-05-12 10:45:47 +02:00
c6525be444 get countries when opening modal + fix select placeholders 2021-05-12 10:43:12 +02:00
cb846891d6 add store postAddress fetch request 2021-05-12 09:54:37 +02:00
2aed37757e Merge branch '_23_addresses_form_2' of gitlab.com:Chill-Projet/chill-bundles into _23_addresses_form_2 2021-05-11 23:53:50 +02:00
444159b52a cleaning AddAdress refactor 2021-05-11 23:52:56 +02:00
7aed8e83ea refactoring AddAddress component 2021-05-11 23:41:32 +02:00
f7a807473d send 400 bad request on invalid json 2021-05-11 21:30:24 +02:00
f8e91c325d oups, forget a flush :) 2021-05-11 21:20:30 +02:00
a448405ce5 Add a denormalizer for fetching entities by id 2021-05-11 20:37:56 +02:00
a4989f99d6 Use annoations for serialization 2021-05-11 19:49:41 +02:00
3f64db3b3a remove 'u' from date normalizer 2021-05-11 19:11:22 +02:00
nobohan
7ee5ca0753 address selection: add API points for PostalCode and Country 2021-05-11 16:03:11 +02:00
41254db72f Merge branch '139_demandeur' into _23_addresses_form_2 2021-05-11 15:51:06 +02:00
nobohan
15e301b889 address selection: add more fields 2021-05-11 15:32:02 +02:00
061a7dd537 patch request for accompanying period 2021-05-11 15:05:26 +02:00
nobohan
c3926991ac address selection: fix leaflet icon url + others fix (WIP) 2021-05-11 14:56:56 +02:00
nobohan
ea0b2407df address selection: add leaflet css + add fields for the address extra information (WIP)' 2021-05-11 13:50:11 +02:00
569679238c add InterlocutorItem subcomponent 2021-05-11 13:49:43 +02:00
ed17f78da5 requestor, add checkbox isAnonymous 2021-05-11 13:48:40 +02:00
dfd9230541 Merge branch '139_demandeur' of gitlab.com:Chill-Projet/chill-bundles into 139_demandeur 2021-05-11 12:52:03 +02:00
65b751642f documentation for api 2021-05-11 10:33:52 +02:00
d6fd827f8b interlocutors wip 2021-05-10 22:02:21 +02:00
162b0099b2 addpersons modal title from outside component 2021-05-10 21:42:02 +02:00
e0b689174a oups 2021-05-10 19:19:11 +02:00
edf4430fb1 Merge branch '139_demandeur' of gitlab.com:Chill-Projet/chill-bundles into 139_demandeur 2021-05-10 19:15:03 +02:00
040884a039 when option uniq is true, display message if you select multiple suggestions 2021-05-10 19:13:50 +02:00
f7c08f02c2 add and remove requestor functions 2021-05-10 18:46:21 +02:00
nobohan
2fe38945d2 Address selection: add a leaflet map 2021-05-10 17:31:22 +02:00
cece152c0b fix test for api requestors 2021-05-10 17:04:34 +02:00
4e31b3e424 Merge branch '139_demandeur' of gitlab.com:Chill-Projet/chill-bundles into 139_demandeur 2021-05-10 16:36:32 +02:00
109bf5ec5d suggestions, flex position for little screens + thirdparty links 2021-05-10 16:33:41 +02:00
4f3f16d9b0 Set requestor for accompanying period 2021-05-10 15:59:58 +02:00
nobohan
fe5745831c Address selection: add selectCountry and selectCity components 2021-05-10 15:21:38 +02:00
3447117742 fix postParticipation with new search endpoint structure 2021-05-10 14:17:48 +02:00
143f8f43fa pass options in search endpoint 2021-05-10 14:02:25 +02:00
36326a2a70 improve suggestions display, with more details, and different according to the entity 2021-05-10 13:27:41 +02:00
52637c2919 rewrite method add participation for new period's methods 2021-05-10 13:24:57 +02:00
f3a8552829 rewrite methods for participation 2021-05-10 13:21:28 +02:00
bfdfd19711 add uniq key property, allow multiple entity in suggestions 2021-05-10 13:11:58 +02:00
nobohan
efb9bc938a Address selection: add store + addressSuggestion 2021-05-10 12:12:04 +02:00
dcd1856ebb adapt api endpoint, resolve id parameter passed in api functions 2021-05-10 10:47:21 +02:00
43f3270171 add requestor, wip 2021-05-09 09:24:02 +02:00
b7fcac8f39 Merge branch 'selectAll' into addPersons_nostore 2021-05-09 09:16:12 +02:00
e521d06702 addpersons better ux with reset and selectall features 2021-05-09 09:11:49 +02:00
a260274549 addpersons better ux with reset features 2021-05-09 00:39:18 +02:00
b37a7d2690 requestor call AddPersons modal, and pass options until api (wip) 2021-05-08 21:14:46 +02:00
242c2b31a3 remove store AddPersons module 2021-05-08 20:59:47 +02:00
57c420e9dd no store for AddPersons, move store in data component
note: this allow to use same addPersons component
to add participations, requestor, or interlocutors.
each addPersons component has his own data()
2021-05-08 20:58:46 +02:00
ac67f56b09 bind options and key inside AddPersons component (wip) 2021-05-08 15:34:15 +02:00
b24eb93c57 addNewPersons() method is called out of addPerson component
note: this allow to use same addPersons component
to add participations, requestor, or interlocutors
2021-05-08 12:12:58 +02:00
0f59be04a7 accompanyingCourse steps, flags, .. translations and pills appearence 2021-05-08 11:42:42 +02:00
54eb15ea35 disable close participation button when is closed 2021-05-08 11:20:53 +02:00
a85f170e2d fix delete route change + fix closeParticipation row position 2021-05-08 10:56:43 +02:00
226f71ab2b requestor, just display datas 2021-05-07 21:37:14 +02:00
a887326611 Merge remote-tracking branch 'origin/136-add-search-endpoint' into 139_demandeur 2021-05-07 19:27:19 +02:00
8ed2e7585d fix random thid party 2021-05-07 19:22:47 +02:00
7a1ad24f0e add endoint /api/1.0/search.json?q=xxx with fake data
See https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/136
2021-05-07 19:11:10 +02:00
nobohan
b934c2eeaf add POC of a vuejs component (opens a modal) for address selection 2021-05-07 17:38:15 +02:00
de0e3f7dfd move test in a test component, clean requestor component 2021-05-07 16:53:29 +02:00
44c9a65505 cleaning console log 2021-05-07 16:22:02 +02:00
038d7ad2e1 load third party fixtures 2021-05-07 16:07:53 +02:00
nobohan
c1b727b1c8 Add API endpoints for Address and AddressReference (again) 2021-05-07 16:02:39 +02:00
a63c38b6aa Merge branch '37_modal_add-persons' 2021-05-07 15:46:38 +02:00
8915c42008 endpoint DELETE participation works ! 2021-05-07 15:44:08 +02:00
503293a359 Merge branch 'master' into '37_modal_add-persons'
# Conflicts:
#   src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
#   src/Bundle/ChillPersonBundle/chill.webpack.config.js
2021-05-07 13:35:48 +00:00
7bdf71315a move Modal component in ChillMainAssets 2021-05-07 15:28:50 +02:00
6f5d457122 renaming store state dict name 2021-05-07 15:16:27 +02:00
b4274264a7 create addPersons store module, move state/getters/mutations/actions in module 2021-05-07 15:04:36 +02:00
8002725c87 fix doc for api 2021-05-07 12:42:49 +02:00
2c9edf3741 Set Collection normalization to fit into specs from https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/136 2021-05-07 12:13:24 +02:00
3f562449e1 Merge branch 'issue23_addresses' into 'master'
Issue23 addresses

See merge request Chill-Projet/chill-bundles!12
2021-05-07 09:27:56 +00:00
1cce39bcb5 Merge branch 'bootstrap-api' into 'master'
Bootstrap api

See merge request Chill-Projet/chill-bundles!35
2021-05-07 09:14:11 +00:00
c93d5ceb16 remove references to ->getContainer in favor of static:: 2021-05-07 10:56:49 +02:00
ad690db886 display reset link + minor changes 2021-05-07 10:36:50 +02:00
nobohan
1b8462b40d update validto field in chill_main_address for legacy 2021-05-07 10:27:11 +02:00
Pol Dellaiera
8c98f2cf6e Update .gitignore file. 2021-05-07 09:04:29 +02:00
f3260f57a4 fix display elements order
selectAndSuggested method in store getter, is callable in all components,
and make union of two arrays: suggested and selected

* we need to have selected in last position (required for isChecked method to work well)
* but we want to display selected in first position (for better ux)

then, we use double inversion to obtain good behaviour
2021-05-06 19:23:28 +02:00
b4ad0128e4 manage selected and suggested arrays: fix duplicate 2021-05-06 19:15:25 +02:00
Jean-Francois Monfort
1f838d9c5a Fix Activity fixtures 2021-05-06 16:23:34 +02:00
33457d3cbc Merge branch 'fix-accompanying-period-opening' into bootstrap-api 2021-05-06 16:02:13 +02:00
6df8e6dec8 add person suite to phpunit 2021-05-06 15:55:02 +02:00
f9b8f13dd6 Merge branch 'fix-accompanying-period-opening' into fix-person-tests 2021-05-06 15:50:34 +02:00
e919b4322e fix accompanying period/remove person 2021-05-06 15:49:38 +02:00
Jean-Francois Monfort
c6cd785262 add Translations 2021-05-06 15:09:38 +02:00
Jean-Francois Monfort
e453e24203 Merge branch 'master' into features/activity-form 2021-05-06 14:01:03 +02:00
Jean-Francois Monfort
115a14fcba Merge branch 'master' into features/activity-form 2021-05-06 13:52:03 +02:00
Jean-Francois Monfort
fc172fdb1f Add documents to Activity Form 2021-05-06 13:40:25 +02:00
b6131379f9 Merge remote-tracking branch 'origin/master' into bootstrap-api 2021-05-06 13:20:12 +02:00
e1fcc41ace avoiding duplicates between selected and suggested (wip)
see comments in store/index.js
2021-05-06 13:16:26 +02:00
f2a04cebe6 configure origin route into chillMainExtension 2021-05-06 13:12:18 +02:00
c693002ddb documentation for api - prepend config 2021-05-06 13:11:59 +02:00
ee77c8540a fix typos 2021-05-06 13:00:59 +02:00
a536d2780e fix state mutation for closeParticipation 2021-05-06 12:57:53 +02:00
f880598052 documentation for api 2021-05-06 12:56:19 +02:00
e7985ea52f customize controller for origin 2021-05-06 12:55:40 +02:00
f56dc65021 fix argument order 2021-05-06 12:55:12 +02:00
nobohan
4770758aee add migrations for addresse on household + add linkedtothirdparty on address 2021-05-06 12:36:58 +02:00
90fe484d81 fix api for rendering a single item 2021-05-06 12:18:47 +02:00
2b8bbe019d first impl for index action 2021-05-06 12:08:45 +02:00
Jean-Francois Monfort
1f1b9c594f add ordoring field & Display Activity type by Category 2021-05-06 11:53:07 +02:00
9e1c151402 réinitialize suggested, avoiding double with selected (wip) 2021-05-06 10:57:04 +02:00
088e522292 Merge branch 'master' into _31_interface_creation_parcours 2021-05-06 10:55:22 +02:00
Jean-Francois Monfort
f836114d84 Fix travelTime field 2021-05-06 10:51:17 +02:00
b8e6e98a74 fix payload error with add participation 2021-05-06 10:44:15 +02:00
Jean-Francois Monfort
4fd13440c6 Modernize ActivityController 2021-05-06 10:03:49 +02:00
Jean-Francois Monfort
4d8afd53ad Form & save into DB 2021-05-06 09:36:03 +02:00
07e0692783 bootstrap api and apply on accompanying period 2021-05-06 00:14:36 +02:00
e78d53064b closeParticipation fetch DELETE request 2021-05-05 21:48:00 +02:00
e6fcb5ff22 Merge branch '_test_closePerson' into _31_interface_creation_parcours 2021-05-05 20:47:39 +02:00
f02e33fda7 first impl for api 2021-05-05 20:33:34 +02:00
1bbec9efae improve addpersons store cycle: init query, selections and suggestions 2021-05-05 19:25:28 +02:00
3b53c4451c fix modal ux counter position 2021-05-05 18:45:51 +02:00
30f490959b for each selected, loop for post participation, then get response and commit state 2021-05-05 18:44:26 +02:00
nobohan
0a894b0db1 add new fields on Address and Household 2021-05-05 18:24:58 +02:00
c20e9507d5 prepare close participation button (wip) 2021-05-05 15:03:58 +02:00
f89c690f1b add scratch fontawesome 'remove' button 2021-05-05 13:36:45 +02:00
nobohan
f61af9d02a add household and householdmembers entities + migration 2021-05-05 11:44:55 +02:00
120e7cade5 simplify store suggested array 2021-05-05 11:11:13 +02:00
ac550e05e8 improve addPersons modal ux 2021-05-05 09:29:57 +02:00
nobohan
86c177bbbb remove vuejs address component 2021-05-04 17:26:47 +02:00
cc8de353d4 moving selected counter + cleaning code 2021-05-04 10:48:58 +02:00
4495a5d33b Union suggested and selected results 2021-05-03 23:15:38 +02:00
9dffe30aad Merge branch '_31_interface_creation_parcours' of gitlab.com:Chill-Projet/chill-bundles into _31_interface_creation_parcours 2021-05-03 22:53:47 +02:00
d393e74896 save checkboxes state in store 2021-05-03 22:44:28 +02:00
daf083dc88 save checkboxes state in store 2021-05-03 21:02:15 +02:00
nobohan
ce859697b5 Use json endpoint for showing address with Vuejs Components (WIP) 2021-05-03 17:16:45 +02:00
nobohan
1587c762f8 better fixture for AddressReference 2021-05-03 14:34:23 +02:00
nobohan
17c01d9b46 fix fixture for address reference 2021-05-03 12:18:21 +02:00
a1bb9ea352 modal addPerson design, search field: focus and position fixed 2021-05-03 11:52:06 +02:00
nobohan
a1895ec65f fixture for addressReference - WIP 2021-05-03 11:18:31 +02:00
nobohan
c5faa0b99d update the address fixture by adding some points 2021-05-03 09:28:05 +02:00
nobohan
e9d142f3e8 define legacy functions for Address 2021-05-03 09:28:05 +02:00
nobohan
91860afd80 check if point value is null for 2 methods in PointType 2021-05-03 09:28:05 +02:00
nobohan
bec0700d39 Point model: better handling of exception 2021-05-03 09:28:05 +02:00
nobohan
05d3d7f5c7 update twig template and AddressType following the changes in Address entity 2021-05-03 09:28:05 +02:00
nobohan
ebff36d257 add unit test for class Point 2021-05-03 09:28:05 +02:00
nobohan
a709b3afb6 add addressReference in Chill Main + migration 2021-05-03 09:28:05 +02:00
nobohan
69a3c6a9b2 refine the migration comment 2021-05-03 09:28:05 +02:00
juminet
8c33d876e8 code formatting in PointType 2021-05-03 09:28:05 +02:00
nobohan
1ec2fbcc16 translated exception messages in English 2021-05-03 09:28:05 +02:00
juminet
bc4e29141b syntax (null -> NULL and == -> ===) 2021-05-03 09:28:05 +02:00
nobohan
e90ea31683 add type hinting in Point and PointException 2021-05-03 09:28:05 +02:00
juminet
7c99f0b3e0 array synatx: array() -> [] 2021-05-03 09:28:05 +02:00
nobohan
c089960707 add type hinting in Point and PointException 2021-05-03 09:28:05 +02:00
nobohan
0b2f29f1e8 add migration for address 2021-05-03 09:28:05 +02:00
nobohan
9a4f50472a add point type + Address: add Point field : fix dependency injection of the Point type 2021-05-03 09:28:05 +02:00
nobohan
7d1a1c4004 #32 add point type + Address: add Point field + add null on nullable fields 2021-05-03 09:28:05 +02:00
nobohan
ebd58d4229 add more fields to Address entity + rename streetAddress1 and streetAddress2 2021-05-03 09:25:41 +02:00
nobohan
dd48795f64 #23 enable postgis in a chil main migration 2021-05-03 09:25:41 +02:00
3d45b6687f adding addPersons component with modal, search field and basic suggestions 2021-04-30 23:18:57 +02:00
35e6d36ce0 fetch postParticipation request, catch fetch error, store mutation+action 2021-04-30 16:33:49 +02:00
4900c81c11 improve inheritance with translations i18n.js files
vue-i18n --> chill main i18n ---( )---> app index
chill bundle i18n --> app i18n --^
2021-04-30 16:32:06 +02:00
ec68e6f761 make inheritance for vue translations i18n.js files
By importing only the app i18n file,
we benefit from the whole inherited chain:

app i18n < chill bundle i18n < chill main bundle i18n
2021-04-29 18:32:22 +02:00
Jean-Francois Monfort
82d8556f24 Activity Form : display field according to the parameters 2021-04-29 16:35:39 +02:00
25bd170f6b improve modal system, test when a modal call next modal 2021-04-29 15:49:25 +02:00
6939b4a313 Merge branch 'master' into _31_interface_creation_parcours 2021-04-29 14:19:02 +02:00
d18922ed98 permit multiple modals in same component 2021-04-29 14:04:40 +02:00
e8bf242c42 Merge branch '_31_interface_creation_parcours' of gitlab.com:Chill-Projet/chill-bundles into _31_interface_creation_parcours 2021-04-29 12:44:29 +02:00
2050460bb3 add modal system, added/removed managed by vue, appearence managed by bootstrap
Modal component is an hybrid solution between :
- Vue3 modal implementation
  => with 'v-if:showModal' directive:parameter, html scope is added/removed not just shown/hidden
  => with slot we can pass content from parent component
  => some classes are passed from parent component
- Bootstrap 4.4 _modal.scss module
  => using bootstrap css classes, the modal have a responsive behaviour,
  => modal design can be configured using css classes (size, scroll)

See
* https://v3.vuejs.org/examples/modal.html#modal-component
* https://github.com/bootstrap-vue/bootstrap-vue/issues/5196
2021-04-29 12:40:28 +02:00
nobohan
4add30e895 add fixture for parcours: replace createQuery by createQueryBuilder 2021-04-29 12:23:41 +02:00
e1dbfdafd7 test modals with vue and modals with bootstrap 2021-04-28 22:01:05 +02:00
75becb2294 Merge branch '_31_interface_creation_parcours' of gitlab.com:Chill-Projet/chill-bundles into _31_interface_creation_parcours 2021-04-28 21:58:52 +02:00
94e494361f adding show/edit links (prepare modal) + save button 2021-04-28 18:00:46 +02:00
nobohan
d27bdf68fb Merge branch '_31_interface_creation_parcours' of https://gitlab.com/Chill-Projet/chill-bundles into _31_interface_creation_parcours
merge..
2021-04-28 12:24:29 +02:00
nobohan
82b82920e1 add 2 fixtures for parcours 2021-04-28 12:24:25 +02:00
4bb3eadf91 renaming vuejs root dir 2021-04-28 11:41:15 +02:00
3a0c25c871 fix addPerson feature with vue3+store+i18n 2021-04-28 10:10:16 +02:00
083338da8d Merge branch 'master' into _31_interface_creation_parcours 2021-04-28 08:54:20 +02:00
37e5c9ceaa Merge branch '_31_interface_creation_parcours' of gitlab.com:Chill-Projet/chill-bundles into _31_interface_creation_parcours 2021-04-28 08:49:32 +02:00
4cf77a9b0e adapt multi components to new store and new api endpoints
* base of i18n (yarn add new deps)
2021-04-27 22:03:39 +02:00
nobohan
c2a4a95eba add a fixture for accompanying period - wip 2021-04-27 18:52:37 +02:00
01f9d03b14 init vuex store 2021-04-27 15:11:13 +02:00
Jean-Francois Monfort
45671bda52 Merge branch 'features/activity-model' into features/activity-form 2021-04-22 16:26:59 +02:00
Jean-Francois Monfort
934eef4db4 Merge branch 'master' into features/activity-model 2021-04-22 16:13:05 +02:00
Jean-Francois Monfort
31e8dea965 Add missing fields & migrations 2021-04-22 15:33:13 +02:00
Jean-Francois Monfort
05ebdefd47 Add missing fields & migrations 2021-04-22 14:47:00 +02:00
Jean-Francois Monfort
c233c481b6 WIP Activity Model 2021-04-15 17:33:41 +02:00
Jean-Francois Monfort
68d9778c00 Merge branch 'features/activity-type' into features/activity-form 2021-04-15 14:46:08 +02:00
Jean-Francois Monfort
8acd852070 Fix uls 2021-04-15 14:45:52 +02:00
Jean-Francois Monfort
a9420f0339 Merge branch 'features/activity-type' into features/activity-form 2021-04-15 14:10:46 +02:00
Jean-Francois Monfort
207e5bf01d Merge branch 'master' into features/activity-type 2021-04-15 14:06:58 +02:00
Jean-Francois Monfort
cb5cf5763e ActivityType : rename some fields 2021-04-15 13:56:39 +02:00
Jean-Francois Monfort
ff450215c6 Add first step to select Activity Type 2021-04-15 13:08:30 +02:00
Jean-Francois Monfort
dad8fd5378 ActivityType add new fields : add translations 2021-04-08 16:19:54 +02:00
Jean-Francois Monfort
37b395ee52 ActivityType add new fields 2021-04-08 16:10:04 +02:00
Jean-Francois Monfort
580dc71218 ActivityType replace Admin Conroller with Crud system 2021-04-01 16:22:33 +02:00
Jean-Francois Monfort
24a7d7b34b new entity ActivityTypeCategory + CRUD 2021-04-01 15:44:05 +02:00
1731 changed files with 87877 additions and 36063 deletions

View File

@@ -7,6 +7,7 @@ charset = utf-8
end_of_line = LF
insert_final_newline = true
trim_trailing_whitespace = true
indent_size = 4
[*.{php,html,twig}]
indent_style = space

3
.gitignore vendored
View File

@@ -1,8 +1,8 @@
.composer/*
composer.phar
composer.lock
docs/build/
.php_cs.cache
###> symfony/framework-bundle ###
/.env.local
@@ -19,3 +19,4 @@ docs/build/
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###

View File

@@ -5,20 +5,25 @@ image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
cache:
paths:
- tests/app/vendor/
- .composer
before_script:
# add extensions to postgres
- PGPASSWORD=$POSTGRES_PASSWORD psql -U $POSTGRES_USER -h db -c "CREATE EXTENSION IF NOT EXISTS unaccent; CREATE EXTENSION IF NOT EXISTS pg_trgm;"
# Install and run Composer
- mkdir -p $COMPOSER_HOME
- curl -sS https://getcomposer.org/installer | php
- php composer.phar install
- php -d memory_limit=2G composer.phar install
- php tests/app/bin/console doctrine:migrations:migrate -n
- php tests/app/bin/console doctrine:fixtures:load -n
- 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
- echo "before_script finished"
# Bring in any services we need http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service
# See http://docs.gitlab.com/ee/ci/services/README.html for examples.
services:
- name: postgres:12
- name: postgis/postgis:12-3.1-alpine
alias: db
- name: redis
alias: redis
@@ -33,9 +38,13 @@ variables:
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_URL: redis://redis:6379
# change vendor dir to make the app install into tests/apps
COMPOSER_VENDOR_DIR: tests/app/vendor
# cache some composer data
COMPOSER_HOME: .composer
# Run our tests
test:
script:
- bin/phpunit --colors=never
- php -d memory_limit=3G bin/phpunit --colors=never

View File

@@ -0,0 +1,24 @@
# Description of changes
<!--
describe here the change of your MR. It can be either a text, or a bullet list
for changes
-->
# Issues related
<!--
list the issues related to this MR.
It may be client issues, or dev issues
-->
* ...
* ...
# Tests
<!-- Describe tests if any, or why no tests -->

181
CHANGELOG.md Normal file
View File

@@ -0,0 +1,181 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to
* [Semantic Versioning](https://semver.org/spec/v2.0.0.html) for stable releases;
* date versioning for test releases
## Unreleased
<!-- write down unreleased development here -->
* [task] Select2 field in task form to allow search for a user (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/167)
* remove "search by phone configuration option": search by phone is now executed by default
* remplacer le classement par ordre alphabétique par un classement par ordre de pertinence, qui tient compte:
* de la présence d'une string avec le nom de la ville;
* de la similarité;
* du fait que la recherche commence par une partie du mot recherché
* ajouter la recherche par numéro de téléphone directement dans la barre de recherche et dans le formulaire recherche avancée;
* ajouter la recherche par date de naissance directement dans la barre de recherche;
* ajouter la recherche par ville dans la recherche avancée
* ajouter un lien vers le ménage dans les résultats de recherche
* ajouter l'id du parcours dans les résultats de recherche
* ajouter le demandeur dans les résultats de recherche
* ajout d'un bouton "recherche avancée" sur la page d'accueil
* [person] create an accompanying course: add client-side validation if no origin (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/210)
* [person] fix bounds for computing current person address: the new address appears immediatly
* [docgen] create a normalizer and serializer for normalization on doc format
## Test releases
### Test release 2021-11-15
* [main] fix adding multiple AddresseDeRelais (combine PickAddressType with ChillCollection)
* [person]: do not suggest the current household of the person (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/51)
* [person]: display other phone numbers in view + add message in case no others phone numbers (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/184)
* unnecessary whitespace removed from person banner after person-id + double parentheses removed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/290)
* [person]: delete accompanying period work, including related objects (cascade) (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/36)
* [address]: Display of incomplete address adjusted.
* [household]: improve relationship graph
* add form to create/edit/delete relationship link,
* improve graph refresh mechanism
* add feature to export canvas as image (png)
* [person suggest] In widget "add person", improve the pertinence of persons when one of the names starts with the pattern;
* [person] do not ask for center any more on person creation
* [3party] do not ask for center any more on 3party creation
### Test release 2021-11-08
* [person]: Display the name of a user when searching after a User (TMS)
* [person]: Add civility to the person
* [person]: Various improvements on the edit person form
* [person]: Set available_languages and available_countries as parameters for use in the edit person form
* [activity] Bugfix: documents can now be added to an activity.
* [tasks] improve tasks with filter order
* [tasks] refactor singleControllerTasks: limit the number of conditions from the context
* [validations] validation of accompanying period added: no duplicate participations or resources (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/60).
* [renderbox] If gender of person is not defined, no icon is displayed instead of neuter-icon (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/129).
* [confidential information] module added to blur confidential information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/248).
* refactor `AuthorizationHelper` and `UserACLAwareRepository` to fix constructor, and separate logic for parent role helper into `ParentRoleHelper`
* [main]: filter location and locationType in backend: exclude NULL names, only active and availableToUsers
* [activity]: perform client-side validation & show/hide fields in the "new location" modal
* [person]: normalize person with CenterResolverDispatcher and handle case where center is null or multiple in PersonRenderBox
* [docstore] voter for PersonDocument and AccompanyingCourseDocument on the 2.0 way (using VoterHelperFactory)
* [docstore] add authorization check inside controller and menu
* [activity]: fix inheritance for role `ACTIVITY FULL` and add missing acl in menu
* [person] show current address in search results
* [person] show alt names in search results
* [admin]: links to activity admin section added again.
* [household]: endDate field deleted from household edit form.
* [household]: View accompanying periods of current and old household members.
* [tasks]: different layout for task list / my tasks, and fix link to tasks in alert or in warning
* [admin]: links to activity admin section added again.
* [household]: household addresses ordered by ValidFrom date and by id to show the last created address on top.
* [socialWorkAction]: display of social issue and parent issues + banner context added.
* [DBAL dependencies] Upgrade to DBAL 3.1
### Test release 2021-10-27
* [person]: delete double actions buttons on search person page
* [person]: accompanying course work: remove creation date display the list of work + handle case when end date is null
* [main]: Add new pages with a menu for managing location and location type in the admin
* [main]: Add some fixtures for location type
* [calendar]: Pass the location when transforming a calendar item (rdv) into an activity
* [calendar]: Add a user menu for "my calendar"
### Test release 2021-10-18
* [3party]: french translation of contact and company
* [3party]: show parent in list
* [3party]: change color for badge "child"
* [3party]: fix address creation
* [household members editor] finalisation of editor
* [AccompanyingCourse banner]: replace translation referrer (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/70)
* [Location]: add location system in activity and RV (calendar). User can choose in location list or create a new location.
* [household]: add relationship page with dynamic data visualisation graph
## Test releases
### Test release 2021-10-11
* Address: zoom on postal code geometry + fix origin of manually entered postal code
* in the Address vue component, order the postal code and street address by alphabetic and numeric order
* add 3 new fields to PostalCode and adapt postal code command and fixtures
* [Aside activity] Fixes for aside activity
* categories with child
* fast creation buttons
* add ordering for types
* [AccompanyingCourse Resume page] badge-title for AccompanyingCourseWork and for Activities;
* Improve badges behaviour with small screens;
* [ThirdParty]:
* third party list
* create a kind contact/institution when create a new thirdparty, and set contact embedded as kind=child;
* filter thirdparties in list
* [FilterOrder]: add development kit for generating filter and ordering in list
* [Capitalization of names] person names are capitalized on creation, on prePersist event
* [On-The-Fly] modale works for showing, editing and creating person or thirdparty ;
* [AccompanyingCourse Resume page] associated persons list, can see household when hover, and with show on-the-fly modale when clicking person ;
### test release 2021-10-04
* [Household editor][UI] Update how household suggestion and addresses are picked;
See https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/80
* [AddAddress] Handle address suggestion;
* [CenterType][Create a person] when overriding the ACL rules, allow to show a PickCenterType
when no centers are reachable by the default ACL.
* [Household] Show comment event if no address are associated with the household;
* [Person results] Add requestor into search results:
* a badge "requestor" is shown into search results;
* periods where the person is only requestor (without participating) are also shown;
Issues:
* https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/13
* https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/199
* [Person form] "accept sms" not required:
https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/37
https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/221
* [Household editor] suggest only temporarily addresses;
See https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/82
* On-The-Fly modale works for showing, editing and creating person and thirdparty ;
* AccompanyingCourse Resume page: list associated persons by household, see household when hover, and show on-the-fly modale when clicking on person ;
* [AddAddress] Handle address suggestion;
* [AddAddress][Entity address]: add a link between address and address reference;
* [Household editor] suggest household by comparing the temporary addresses from courses;
See https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/81
* On-The-Fly modale works for showing, editing and creating person and thirdparty
## Test released
<!--
Coming soon...
DO NOT ADD unreleased items here. Add them under "Unreleased" title
### Test release yyyy-mm-dd
-->
## Stable releases
No stable releases for v2+

383
CONVENTIONS.md Normal file
View File

@@ -0,0 +1,383 @@
# Conventions Chill
en cours de rédaction
## Assets: nommage des entrypoints
Trois types d'entrypoint:
* application vue (souvent spécifique à une page) -> préfixé par `vue_`;
* code js/css qui est réutilisé à plusieurs endroits:
* ckeditor
* async_upload (utilisé pour un formulaire)
* bootstrap
* chill.js
* ...
=> on préfixe `mod_`
* code css ou js pour une seule page
* ré-utilise parfois des "foncitionnalités": ShowHide, ...
=> on préfixe `page_`
Arborescence:
```
# Sous Resources/public
- chill/ => theme (chill)
- chillmain.scss -> push dans l'entrypoint chill
- lib/ => ne vont jamais dans un entrypoint, mais sont ré-utilisés par d'autres
- ShowHide
- Collection
- Select2
- module/ => termine dans des entrypoints ré-utilisables (mod_)
- bootstrap
- custom.scss
- custom/
- variables.scss
- ..
- forkawesome
- AsyncUpload
- vue/ => uniquement application vue (vue_)
- _components
- app
- page/ => uniquement pour une seule page (page_)
- login
- person
- personvendee
- household_edit_metadata
- index.js
```
## Organisation des feuilles de styles
Comment s'échaffaudent les styles dans Chill ?
1. l'entrypoint **mod_bootstrap** (module bootstrap) est le premier niveau. Toutes les parties(modules) de bootstrap sont convoquées dans le fichier ```bootstrap.js``` situé dans ```ChillMainBundle/Resources/public/module/bootstrap```.
* Au début, ce fichier importe le fichier ```variables.scss``` qui détermine la plupart des réglages bootstrap tels qu'on les a personnalisés. Ce fichier surcharge l'original, et de nombreuses variables y sont adaptées pour Chill.
* On veillera à ce qu'on puisse toujours comparer ce fichier à l'original de bootstrap. En cas de mise à jour de bootstrap, il faudra générer un diff, et adapter ce diff sur le fichier variable de la nouvelle version.
* A la fin on importe le fichier ```custom.scss```, qui comprends des adaptations de bootstrap pour le préparer à notre thème Chill.
* ce ```custom.scss``` peut être splitté en plus petits fichiers avec des ```@import 'custom/...'```
* L'idée est que cette première couche bootstrap règle un partie importante des styles de l'application, en particulier ce qui touche aux position du layout, aux points de bascules responsive, aux marges et écarts appliqués par défauts aux éléments qu'on manipule.
2. l'entrypoint **chill** est le second niveau. Il contient le thème Chill qui est reconnaissable à l'application.
* Chaque bundle a un dossier ```Resources/public/chill``` dans lequel on peut trouver une feuille sass principale, qui est éventuellement splittée avec des ```@imports```. Toutes ces feuilles sont compilées dans un unique entrypoint Chill, c'est le thème de l'application. Celui-ci surcharge bootstrap.
* La feuille chillmain.scss devrait contenir les cascades de styles les plus générales, celles qui sont appliquées à de nombreux endroits de l'application.
* La feuille chillperson.scss va aussi retrouver des styles propres aux différents contextes des personnes: person, household et accompanyingcourse.
* Certains bundles plus secondaires ne contiennent que des styles spécifiques à leur fonctionnement.
3. les entrypoints **vue_** sont utilisés pour des composants vue. Les fichiers vue peuvent contenir un bloc de styles scss. Ce sont des styles qui ne concernent que le composant et son héritage, le tag ```scoped``` précise justement sa portée (voir la doc).
4. les entrypoints **page_** sont utilisés pour ajouter des assets spécifiques à certaines pages, le plus souvent des scripts et des styles.
## Taguer du code html et construire la cascade de styles
L'exemple suivant montre comment taguer sans excès un élément de code. On remarque que:
* il n'est pas nécessaire de taguer toutes les classes intérieures,
* il ne faut pas répéter la classe parent dans toutes les classes enfants. La cascade sass va permettre de saisir le html avec souplesse sans alourdir la structure des balises.
* souvent la première classe sera déclinée par plusieurs classes qui commencent de la même manière: ```bloc-dark``` ajoute juste la version sombre de ```bloc```, on ne met pas ```bloc dark```, car on ne souhaite pas que la classe ```dark``` de ```bloc``` interagisse avec la même classe ```dark``` de ```table```. On aura donc un élément ```bloc bloc-dark``` et un élément ```table table-dark```.
```html
<div class="bloc bloc-dark mon-bloc">
<h3>mon titre</h3>
<ul class="record_actions">
<li>
<a class="btn btn-edit"></a>
</li>
<li></li>
<li></li>
</ul>
</div>
```
Finalement, il importe ici de définir ce qu'est un bloc, ce qu'est une zone d'actions et ce qu'est un bouton. Ces 3 éléments existent de manière autonome, ce sont les seuls qu'on tagge.
Par exemple pour mettre un style au titre on précise juste h3 dans la cascade bloc.
```sass
div.bloc {
// un bloc générique, utilisé à plusieurs endroits
&.bloc-dark {
// la version sombre du bloc
}
h3 {}
ul {
// une liste standard dans bloc
li {
// des items de liste standard dans bloc
}
}
}
div.mon-bloc {
// des exceptions spécifiques à mon-bloc,
// qui sont des adaptations de bloc
}
ul.record_actions {
// va uniformiser tous les record_actions de l'application
li {
//...
}
}
.btn {
// les boutons de bootstrap
.btn-edit {
// chill étends les boutons bootstrap pour ses propres besoins
}
}
</style>
```
## Render box
## URL
### Nommage des routes
:::warning
Ces règles n'ont pas toujours été utilisées par le passé. Elles sont souhaitées pour le futur.
:::
Les routes sont nommées de cette manière:
`chill_bundle_entite_action`
1. d'abord chill_ (pour tous les modules chill)
2. ensuite une string qui est identique, par bundle
3. si le point est un point d'api (json), alors ajouter la string `api`
4. ensuite une string qui indique sur quelle entité porte la route, voire également les sous-entités
5. ensuite une action (`list`, `view`, `edit`, `new`, ...)
Le fait d'indiquer `api` en 3 permet de distinguer les routes d'api qui sont générées par la configuration (qui sont toutes préfixées par `chill_api`, de celles générées manuellement. (Exemple: `chill_api_household__index`, et `chill_person_api_household_members_move`)
Si les points 4 et 5 sont inexistants, alors ils sont remplacés par d'autres éléments de manière à garantir l'unicité de la route, et sa bonne compréhension.
### URL
Les URL respectent également une convention:
#### Pour les pages html
:::warning
Ces règles n'ont pas toujours été utilisées par le passé. Elles sont souhaitées pour le futur.
:::
Syntaxe:
```
/{_locale}/bundle/entity/{id}/action
/{_locale}/bundle/entity/sub-entity/{id}/action
```
Les éléments suivants devraient se trouver dans la liste:
1. la locale;
2. un identifiant du bundle
3. l'entité auquel il se rapporte
4. les éventuelles sous-entités auxquelles l'url se rapport
5. l'action
Ces éléments peuvent être entrecoupés de l'identifiant d'une entité. Dans ce cas, cet identifiant se place juste après l'entité auquel il se rapporte.
Exemple:
```
# liste des échanges pour une personne
/fr/activity/person/25/activity/list
# nouvelle activité
/fr/activity/activity/new?person_id=25
```
#### Pour les API
:::info
Les routes générées automatiquement sont préfixées par chill_api
:::
Syntaxe:
```
/api/1.0/bundle/entity/{id}/action
/api/1.0/bundle/entity/sub-entity/{id}/action
```
Les éléments suivants devraient se trouver dans la liste:
1. la string `/api/` et puis la version (1.0)
2. un identifiant du bundle
3. l'entité auquel il se rapporte
4. les éventuelles sous-entités auxquelles l'url se rapport
5. l'action
Ces éléments peuvent être entrecoupés de l'identifiant d'une entité. Dans ce cas, cet identifiant se place juste après l'entité auquel il se rapporte.
## Règles UI chill
### Titre des pages
#### Chaque page contient un titre
Chaque page contient un titre dans la balise head. Ce titre est normalement identique à celui de l'entête de la page.
Astuce: il est possible d'utiliser la fonction `block` de twig pour cela:
```htmlmixed=
{% block title "Titre de la page" %}
{% block content %}
<h1>
{{ block('title')}}
</h1>
{% endblock %}
```
### Utilisation des `entity_render`
#### En twig
Les templates twig doivent toujours utiliser la fonction chill_entity_render_box pour effectuer le rendu des éléments suivants:
* User
* Person
* SocialIssue
* SocialAction
* Address
* ThirdParty
* ...
Exemple:
```
address|chill_entity_render_box
```
Justification:
* des éléments sont parfois personnalisés par installation (par exemple, le nom de chaque utilisateur sera suivi par le nom du service)
* pour rationaliser et rendre semblable les affichages
* pour simplifier le code twig
A prevoir:
* toujours trois positions:
* inline
* block
* item (dans un tableau, une ligne)
> block et item sont en fait la même option passée au render_box: render: bloc. Il y a aussi raw pour le inline, et label pour une titraille configurable avec des options.
> quand on passe loption render: bloc, on peut placer le render_box dans une boucle for plus large qui fonctionne avec la classe flex-table ou la classe flex-bloc, ce qui donnera un affichage en rangée (table) ou en blocs. [name=Mathieu]
#### En vue
Il existe systématiquement une "box" équivalente en vue.
#### Lien vers des sections
A chaque fois qu'on indique le nom d'une personne, un parcours, un ménage, il y a toujours:
* un lien pour accéder à son dossier (pour autant que l'utilisateur ait les droits d'accès);
* à moins qu'il ne soit indiqué dans une phrase, l'icône de son dossier avant ou après (donc un bonhomme pour la personne, une maison pour le ménage, un fa-random pour les parcours);
Ces éléments sont toujours proposé par des `render_box` par défaut. Des options permettent de les désactiver dans des cas particuliers
> à discuter, quelques réflexion:
> quelle est la logique qui domine pour les boutons ? on a symbolisé les 4 actions du crud par des couleurs: bleu(show) orange(edit) vert(create) et rouge(delete).
> Est-ce que c'est ça qui prime, et comment ça s'articule avec la logique des pictos ?
> Par exemple, il pourrait être logique d'utiliser l'oeil bleu pour voir l'objet, qu'il s'agisse d'une personne ou d'un parcours, ce serait plutôt le contexte, et l'infobulle (title) qui préciserait le contexte.
> Je pense que les pictos de boutons doivent faire référence à l'action, mais pas à l'objet. Autrement dit je n'utiliserais jamais l'icone du ménage ou du parcours dans les boutons.
> Pour représenter les ménages et les parcours, je pense qu'il faudrait trouver autre chose que forkawesome. Si c'est des pictos, trouver un motif différents et de tailles différente. Réfléchir à un couplage picto-couleur-forme différent, qui exprime le contexte et qui se distingue bien des boutons.
> Idem pour les badges, il faut une palette de badge qui couvre tous les besoins: socialIssue, socialActions, socialReason, members, etc. [name=Mathieu]
### Formulaires
#### Vocabulaire:
Utiliser toujours:
* `Créer` dans un `bt bt-create` pour les **liens** vers le formulairep pour créer une entité (pour parvenir au formulaire);
* `Enregistrer` dans un `bt bt-save` pour les boutons "Enregistrer" (dans un formulaire édition **ou** création);
* `Enregistrer et nouveau`
* `Enregistrer et voir`
* `Modifier` dans un `bt bt-edit` pour les **liens** vers le formulaire d'édition
* `Dupliquer` (préciser là où on peut le voir)
* `Annuler` pour quitter une page d'édition avec un lien vers la liste, ou le `returnPath`
#### Retour après un enregistrement
Après avoir cliqué sur "Créer" ou "Sauver", la page devrait revenir:
* vers le returnPath, s'il existe;
* sinon, vers la page "vue".
### Bandeaux contenant les boutons d'actions
Les boutons sont toujours dans un bandeau "sticky-form" dans le bas du formulaire ou de la page de liste.
Si pertinent:
* Le bandeau contient un bouton "Annuler" qui retourne à la page précédente. Il est obligatoire pour les formulaires, optionnel pour les listes ou les pages "résumés"
* Ce bouton "annuler" est toujours à gauche
```
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ chill_entity_return_path('route_name' { 'route': 'option' } )}}">{{ return_path_label }}</a>
</li>
<li>
<!-- action 1 -->
</li>
</ul>
```
### Messages flash
#### A la création d'une entité
A chaque fois qu'un élément est créé par un formulaire, un message flash doit apparaitre. Il indique:
> "L'élément a été créé"
Le nom de l'élément peut être remplacé par quelque chose de plus pertinent:
> * L'activité a été créée
> * Le rendez-vous a été créé
> * ...
#### A l'enregistrement d'une entité
A chaque fois qu'un élément est enregistré, un message flash doit apparaitre:
> * Les données ont été modifiées
>
#### Erreur sur un formulaire (erreur de validation)
En tête d'un formulaire, un message flash doit indiquer que des validations n'ont pas réussi:
> Ce formulaire contient des erreurs
Les erreurs doivent apparaitre attachée au champ qui les concerne. Toutefois, il est acceptable d'afficher les erreurs à la racine du formulaire s'il était complexe, techniquement, d'attacher les erreurs.
### Liens de retour
A chaque fois qu'un lien est indiqué, vérifier si on ne doit pas utiliser la fonction `chill_return_path`, `chill_forward_return_path` ou `chill_return_path_or`.
* depuis la page liste, vers l'ouverture d'un élément, ou le bouton création => utiliser `chill_path_add_return_path`
* dans ces pages d'éditions,
* utiliser `chill_return_path_or` dans le bouton "Cancel";
* pour les boutons "enregistrer et voir" et "Enregistrer et fermer" => ?

661
LICENSE Normal file
View File

@@ -0,0 +1,661 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
chill-bundles
Copyright (C) 2021 Chill Project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

View File

@@ -1,9 +1,75 @@
{
"name": "chill-project/chill-bundles",
"license": "AGPL-3.0-only",
"type": "library",
"description": "Most used bundles for chill-project",
"keywords": ["chill", "social worker"],
"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",
"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",
"phpoffice/phpspreadsheet": "^1.16",
"ramsey/uuid-doctrine": "^1.7",
"sensio/framework-extra-bundle": "^5.5",
"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/monolog-bundle": "^3.5",
"symfony/security-bundle": "4.*",
"symfony/serializer": "^5.2",
"symfony/swiftmailer-bundle": "^3.5",
"symfony/templating": "4.*",
"symfony/translation": "4.*",
"symfony/twig-bundle": "^4.4",
"symfony/validator": "4.*",
"symfony/webpack-encore-bundle": "^1.11",
"symfony/workflow": "4.*",
"symfony/yaml": "4.*",
"twig/extra-bundle": "^2.12 || ^3.0",
"twig/intl-extra": "^3.0",
"twig/markdown-extra": "^3.3",
"twig/twig": "^2.12 || ^3.0"
},
"conflict": {
"symfony/symfony": "*"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.3",
"fakerphp/faker": "^1.13",
"nelmio/alice": "^3.8",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpunit/phpunit": "^7.0",
"symfony/debug-bundle": "^5.1",
"symfony/dotenv": "^5.1",
"symfony/maker-bundle": "^1.20",
"symfony/phpunit-bridge": "^5.2",
"symfony/stopwatch": "^5.1",
"symfony/var-dumper": "4.*",
"symfony/web-profiler-bundle": "^5.0"
},
"config": {
"bin-dir": "bin",
"vendor-dir": "tests/app/vendor"
},
"autoload": {
"psr-4": {
"Chill\\ActivityBundle\\": "src/Bundle/ChillActivityBundle",
@@ -16,73 +82,25 @@
"Chill\\PersonBundle\\": "src/Bundle/ChillPersonBundle",
"Chill\\ReportBundle\\": "src/Bundle/ChillReportBundle",
"Chill\\TaskBundle\\": "src/Bundle/ChillTaskBundle",
"Chill\\ThirdPartyBundle\\": "src/Bundle/ChillThirdPartyBundle"
"Chill\\ThirdPartyBundle\\": "src/Bundle/ChillThirdPartyBundle",
"Chill\\AsideActivityBundle\\": "src/Bundle/ChillAsideActivityBundle/src",
"Chill\\DocGeneratorBundle\\": "src/Bundle/ChillDocGeneratorBundle",
"Chill\\CalendarBundle\\": "src/Bundle/ChillCalendarBundle",
"Chill\\WopiBundle\\": "src/Bundle/ChillWopiBundle/src"
}
},
"autoload-dev": {
"psr-4": {
"App\\": "tests/app/src/"
"App\\": "tests/app/src/",
"Chill\\DocGeneratorBundle\\Tests\\": "src/Bundle/ChillDocGeneratorBundle/tests"
}
},
"require": {
"champs-libres/async-uploader-bundle": "dev-sf4",
"graylog2/gelf-php": "^1.5",
"symfony/form": "4.*",
"symfony/twig-bundle": "^4.4",
"twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0",
"composer/package-versions-deprecated": "^1.10",
"doctrine/doctrine-bundle": "^2.1",
"doctrine/doctrine-migrations-bundle": "^3.0",
"doctrine/orm": "^2.7",
"symfony/asset": "4.*",
"symfony/monolog-bundle": "^3.5",
"symfony/security-bundle": "4.*",
"symfony/translation": "4.*",
"symfony/validator": "4.*",
"sensio/framework-extra-bundle": "^5.5",
"symfony/yaml": "4.*",
"symfony/webpack-encore-bundle": "^1.11",
"knplabs/knp-menu": "^3.1",
"knplabs/knp-menu-bundle": "^3.0",
"symfony/templating": "4.*",
"twig/intl-extra": "^3.0",
"symfony/workflow": "4.*",
"symfony/expression-language": "4.*",
"knplabs/knp-time-bundle": "^1.12",
"symfony/intl": "4.*",
"symfony/swiftmailer-bundle": "^3.5",
"league/csv": "^9.6",
"phpoffice/phpspreadsheet": "^1.16",
"symfony/browser-kit": "^5.2",
"symfony/css-selector": "^5.2",
"twig/markdown-extra": "^3.3",
"erusev/parsedown": "^1.7",
"symfony/serializer": "^5.2"
},
"conflict": {
"symfony/symfony": "*"
},
"require-dev": {
"fakerphp/faker": "^1.13",
"phpunit/phpunit": "^7.0",
"symfony/dotenv": "^5.1",
"symfony/maker-bundle": "^1.20",
"doctrine/doctrine-fixtures-bundle": "^3.3",
"symfony/stopwatch": "^5.1",
"symfony/web-profiler-bundle": "^5.0",
"symfony/var-dumper": "4.*",
"symfony/debug-bundle": "^5.1",
"symfony/phpunit-bridge": "^5.2"
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
}
},
"config": {
"vendor-dir": "tests/app/vendor",
"bin-dir": "bin"
}
}

View File

@@ -23,15 +23,196 @@ Every time an entity is created, viewed or updated, the software check if the us
The user must be granted access to the action on this particular entity, with this scope and center.
TL;DR
=====
Resolve scope and center
------------------------
In a service, resolve the center and scope of an entity
.. code-block:: php
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher;
use Chill\MainBundle\Security\Resolver\ScopeResolverDispatcher;
class MyService {
private ScopeResolverDispatcher $scopeResolverDispatcher;
private CenterResolverDispatcher $centerResolverDispatcher;
public function myFunction($entity) {
/** @var null|Center[]|Center $center */
$center = $this->centerResolverDispatcher->resolveCenter($entity);
// $center may be null, an array of center, or an instance of Center
if ($this->scopeResolverDispatcher->isConcerned($entity) {
/** @var null|Scope[]|Scope */
$scope = $this-scopeResolverDispatcher->resolveScope($entity);
// $scope may be null, an array of Scope, or an instance of Scope
}
}
}
In twig template, resolve the center:
.. code-block:: twig
{# resolve a center #}
{% if person|chill_resolve_center is not null%}
{% if person|chill_resolve_center is iterable %}
{% set centers = person|chill_resolve_center %}
{% else %}
{% set centers = [ person|chill_resolve_center ] %}
{% endif %}
<span class="open_sansbold">
{{ 'Center'|trans|upper}} :
</span>
{% for c in centers %}
{{ c.name|upper }}
{% if not loop.last %}, {% endif %}
{% endfor %}
{%- endif -%}
In twig template, resolve the scope:
.. code-block:: twig
{% if entity|chill_is_scope_concerned %}
{% if entity|chill_resolve_scope is iterable %}
{% set scopes = entity|chill_resolve_scope %}
{% else %}
{% set scopes = [ entity|chill_resolve_scope ] %}
{% endif %}
<span>Scopes&nbsp;:</span>
{% for s in scopes %}
{{ c.name|localize_translatable_string }}
{% if not loop.last %}, {% endif %}
{% endfor %}
{%- endif -%}
Build a ``Voter``
-----------------
.. code-block:: php
<?php
namespace Chill\DocStoreBundle\Security\Authorization;
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
use Chill\MainBundle\Security\Authorization\VoterHelperFactoryInterface;
use Chill\MainBundle\Security\Authorization\VoterHelperInterface;
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
use Chill\DocStoreBundle\Entity\PersonDocument;
use Chill\PersonBundle\Entity\Person;
use Chill\MainBundle\Entity\User;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Security\Core\Security;
class PersonDocumentVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
{
// roles should be stored into constants:
const CREATE = 'CHILL_PERSON_DOCUMENT_CREATE';
const SEE = 'CHILL_PERSON_DOCUMENT_SEE';
const SEE_DETAILS = 'CHILL_PERSON_DOCUMENT_SEE_DETAILS';
const UPDATE = 'CHILL_PERSON_DOCUMENT_UPDATE';
const DELETE = 'CHILL_PERSON_DOCUMENT_DELETE';
protected Security $security;
protected VoterHelperInterface $voterHelper;
public function __construct(
Security $security,
VoterHelperFactoryInterface $voterHelperFactory
) {
$this->security = $security;
// we build here a voter helper. This will ease the operations below.
// when the authorization model is changed, it will be easy to make a different implementation
// of the helper, instead of writing all Voters
$this->voterHelper = $voterHelperFactory
// create a builder with some context
->generate(self::class)
// add the support of given roles for given class:
->addCheckFor(Person::class, [self::SEE, self::CREATE])
->addCheckFor(PersonDocument::class, $this->getRoles())
->build();
}
protected function supports($attribute, $subject)
{
return $this->voterHelper->supports($attribute, $subject);
}
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
{
// basic check
if (!$token->getUser() instanceof User) {
return false;
}
// we first check the acl for associated elements.
// here, we must be able to see the person associated to the document:
if ($subject instanceof PersonDocument
&& !$this->security->isGranted(PersonVoter::SEE, $subject->getPerson())) {
// not possible to see the associated person ? Then, not possible to see the document!
return false;
}
// the voter helper will implements the logic:
return $this->voterHelper->voteOnAttribute($attribute, $subject, $token);
}
// all the method below are used to register roles into the admin part
public function getRoles()
{
return [
self::CREATE,
self::SEE,
self::SEE_DETAILS,
self::UPDATE,
self::DELETE
];
}
public function getRolesWithoutScope()
{
return array();
}
public function getRolesWithHierarchy()
{
return ['PersonDocument' => $this->getRoles() ];
}
}
From an user point of view
--------------------------
==========================
The software is design to allow fine tuned access rights for complicated installation and team structure. The administrators may also decide that every user has the right to see all resources, where team have a more simple structure.
Here is an overview of the model.
Chill can be multi-center
^^^^^^^^^^^^^^^^^^^^^^^^^
-------------------------
Chill is designed to be installed once for social center who work with multiple teams separated, or for social services's federation who would like to share the same installation of the software for all their members.
@@ -42,7 +223,7 @@ Otherwise, it is not required to create multiple center: Chill can also work for
Obviously, users working in the different centers are not allowed to see the entities (_persons_, _reports_, _activities_) of other centers. But users may be attached to multiple centers: consequently they will be able to see the entities of the multiple centers they are attached to.
Inside center, scope divide team
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--------------------------------
Users are attached to one or more center and, inside to those center, there may exists differents scopes. The aim of those _scopes_ is to divide the whole team of social worker amongst different departement, for instance: the social team, the psychologist team, the nurse team, the administrative team, ... Each team is granted of different rights amongst scope. For instance, the social team may not see the _activities_ of the psychologist team. The administrative team may see the date & time's activities, but is not allowed to see the detail of those entities (the personal notes, ...).
@@ -52,8 +233,38 @@ As entities have only one scopes, if some entities must be shared across two dif
Example: if some activities must be seen and updated between nurses and psychologists, the administrator will create a scope "nurse and psy" and add the ability for both team "nurse" and "psychologist" to "create", "see", and "update" the activities belonging to scope "nurse and psy".
Where does the ``scope`` and ``center`` comes from ?
====================================================
Most often, scope and center comes from user's input:
* when person is created, Chill asks the associated center to the user. Then, every entity associated to the user (Activity, ...) is associated to this center;
* when an entity is created, Chill asks the associated scope.
The UI check the model before adding those input into form. If the user hae access to only one center or scope, this scope or center is filled automatically, and the UI does not ask the user. Most of the times, the user does not see "Pick a scope" and "Pick a center" inputs.
Scope and Center are associated to entities through ``ManyToOne`` properties, which are then mapped to ``FOREIGN KEY`` in tables, ...
But sometimes, this implementation does not fits the needs:
* persons are associated to center *geographically*: the address of each person contains lat/lon coordinates, and the center is resolved from this coordinated;
* some would like to associated persons to multiple center, or one center;
* entities are associated to scope through the job reached by "creator" (an user);
* some would like not to use scope at all;
*
For this reasons, associated center and scopes must be resolved programmatically. The default implementation rely on the model association, as described above. But it becomes possible to change the behaviour on different implementations.
Is my entity "concerned" by scopes ?
------------------------------------
Some entities are concerned by scope, some not.
This is also programmatically resolved.
The concepts translated into code
-----------------------------------
===================================
.. figure:: /_static/access_control_model.png
@@ -81,7 +292,7 @@ At each step of his lifetime (creation, view of the entity and eventually of his
All those action are executed through symfony voters and helpers.
How to check authorization ?
----------------------------
============================
Just use the symfony way-of-doing, but do not forget to associate the entity you want to check access. For instance, in controller :
@@ -100,34 +311,23 @@ Just use the symfony way-of-doing, but do not forget to associate the entity you
And in template :
.. code-block:: html+jinja
.. code-block:: twig
{{ if is_granted('CHILL_ENTITY_SEE', entity) %}print something{% endif %}
Retrieving reachable scopes and centers
----------------------------------------
Retrieving reachable scopes and centers for a user
--------------------------------------------------
The class :class:`Chill\\MainBundle\\Security\\Authorization\\AuthorizationHelper` helps you to get centers and scope reachable by a user.
The class :class:`Chill\\MainBundle\\Security\\Authorization\\AuthorizationHelperInterface` helps you to get centers and scope reachable by a user.
Those methods are intentionnaly build to give information about user rights:
- getReachableCenters: to get reachable centers for a user
- getReachableScopes : to get reachable scopes for a user
.. note::
The service is reachable through the Depedency injection with the key `chill.main.security.authorization.helper`. Example :
.. code-block:: php
$helper = $container->get('chill.main.security.authorization.helper');
.. todo::
Waiting for a link between our api and this doc, we invite you to read the method signatures `here <https://github.com/Chill-project/Main/blob/add_acl/Security/Authorization/AuthorizationHelper.php>`_
Adding your own roles
=====================
---------------------
Extending Chill will requires you to define your own roles and rules for your entities. You will have to define your own voter to do so.
@@ -152,7 +352,7 @@ To create your own roles, you should:
Declare your role
------------------
^^^^^^^^^^^^^^^^^^
To declare new role, implement the class :class:`Chill\\MainBundle\\Security\\ProvideRoleInterface`.
@@ -212,69 +412,8 @@ Example of an implementation of :class:`Chill\\MainBundle\\Security\\ProvideRole
}
Implement your voter
--------------------
Inside this class, you might use the :class:`Chill\\MainBundle\\Security\\Authorization\\AuthorizationHelper` to check permission (do not re-invent the wheel). This is a real-world example:
.. code-block:: php
namespace Chill\ReportBundle\Security\Authorization;
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
class ReportVoter extends AbstractChillVoter
{
const CREATE = 'CHILL_REPORT_CREATE';
const SEE = 'CHILL_REPORT_SEE';
const UPDATE = 'CHILL_REPORT_UPDATE';
/**
*
* @var AuthorizationHelper
*/
protected $helper;
public function __construct(AuthorizationHelper $helper)
{
$this->helper = $helper;
}
protected function getSupportedAttributes()
{
return array(self::CREATE, self::SEE, self::UPDATE);
}
protected function getSupportedClasses()
{
return array('Chill\ReportBundle\Entity\Report');
}
protected function isGranted($attribute, $report, $user = null)
{
if (! $user instanceof \Chill\MainBundle\Entity\User){
return false;
}
return $this->helper->userHasAccess($user, $report, $attribute);
}
}
Then, you will have to declare the service and tag it as a voter :
.. code-block:: yaml
services:
chill.report.security.authorization.report_voter:
class: Chill\ReportBundle\Security\Authorization\ReportVoter
arguments:
- "@chill.main.security.authorization.helper"
tags:
- { name: security.voter }
Adding role hierarchy
---------------------
^^^^^^^^^^^^^^^^^^^^^
You should prepend Symfony's security component directly from your code.
@@ -312,3 +451,484 @@ You should prepend Symfony's security component directly from your code.
}
Implement your voter
^^^^^^^^^^^^^^^^^^^^
Most of the time, Voter will check that:
1. The given role is reachable (= ``$attribute``)
2. for the given center,
3. and, if any, for the given role
4. if the entity is associated to another entity, this entity should be, at least, viewable by the user.
Thats what we call the "autorization logic". But this logic may be replace by a new one, and developers should take care of it.
Then voter implementation should take care of:
* check the access to associated entities. For instance, if an ``Activity`` is associated to a ``Person``, the voter should first check that the user can show the associated ``Person``;
* as far as possible, delegates the check for associated center, scopes, and check for authorization using the authorization logic. VoterHelper will ease the most common operation of this logic.
This is an example of implementation:
.. code-block:: php
<?php
namespace Chill\DocStoreBundle\Security\Authorization;
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
use Chill\MainBundle\Security\Authorization\VoterHelperFactoryInterface;
use Chill\MainBundle\Security\Authorization\VoterHelperInterface;
use Chill\DocStoreBundle\Entity\PersonDocument;
use Chill\PersonBundle\Entity\Person;
use Chill\MainBundle\Entity\User;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Security;
class PersonDocumentVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
{
protected Security $security;
protected VoterHelperInterface $voterHelper;
public function __construct(
Security $security,
VoterHelperFactoryInterface $voterHelperFactory
) {
$this->security = $security;
// we build here a voter helper. This will ease the operations below.
// when the authorization model is changed, it will be easy to make a different implementation
// of the helper, instead of writing all Voters
$this->voterHelper = $voterHelperFactory
// create a builder with some context
->generate(self::class)
// add the support of given roles for given class:
->addCheckFor(Person::class, [self::SEE, self::CREATE])
->addCheckFor(PersonDocument::class, $this->getRoles())
->build();
}
protected function supports($attribute, $subject)
{
return $this->voterHelper->supports($attribute, $subject);
}
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
{
// basic check
if (!$token->getUser() instanceof User) {
return false;
}
// we first check the acl for associated elements.
// here, we must be able to see the person associated to the document:
if ($subject instanceof PersonDocument
&& !$this->security->isGranted(PersonVoter::SEE, $subject->getPerson())) {
// not possible to see the associated person ? Then, not possible to see the document!
return false;
}
// the voter helper will implements the logic of checking:
// 1. that the center is reachable
// 2. for this given entity
// 3. for this given scope
// 4. and for the given role
return $this->voterHelper->voteOnAttribute($attribute, $subject, $token);
}
public function getRoles()
{
// ...
}
public function getRolesWithoutScope()
{
// ...
}
public function getRolesWithHierarchy()
{
// ...
}
}
Then, you will have to declare the service and tag it as a voter :
.. code-block:: yaml
services:
chill.report.security.authorization.report_voter:
class: Chill\ReportBundle\Security\Authorization\ReportVoter
arguments:
- "@chill.main.security.authorization.helper"
tags:
- { name: security.voter }
How to resolve scope and center programmatically ?
==================================================
In a service, resolve the center and scope of an entity
.. code-block:: php
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher;
use Chill\MainBundle\Security\Resolver\ScopeResolverDispatcher;
class MyService {
private ScopeResolverDispatcher $scopeResolverDispatcher;
private CenterResolverDispatcher $centerResolverDispatcher;
public function myFunction($entity) {
/** @var null|Center[]|Center $center */
$center = $this->centerResolverDispatcher->resolveCenter($entity);
// $center may be null, an array of center, or an instance of Center
if ($this->scopeResolverDispatcher->isConcerned($entity) {
/** @var null|Scope[]|Scope */
$scope = $this-scopeResolverDispatcher->resolveScope($entity);
// $scope may be null, an array of Scope, or an instance of Scope
}
}
}
In twig template, resolve the center:
.. code-block:: twig
{# resolve a center #}
{% if person|chill_resolve_center is not null%}
{% if person|chill_resolve_center is iterable %}
{% set centers = person|chill_resolve_center %}
{% else %}
{% set centers = [ person|chill_resolve_center ] %}
{% endif %}
<span class="open_sansbold">
{{ 'Center'|trans|upper}} :
</span>
{% for c in centers %}
{{ c.name|upper }}
{% if not loop.last %}, {% endif %}
{% endfor %}
{%- endif -%}
In twig template, resolve the scope:
.. code-block:: twig
{% if entity|chill_is_scope_concerned %}
{% if entity|chill_resolve_scope is iterable %}
{% set scopes = entity|chill_resolve_scope %}
{% else %}
{% set scopes = [ entity|chill_resolve_scope ] %}
{% endif %}
<span>Scopes&nbsp;:</span>
{% for s in scopes %}
{{ c.name|localize_translatable_string }}
{% if not loop.last %}, {% endif %}
{% endfor %}
{%- endif -%}
What is the default implementation of Scope and Center resolver ?
-----------------------------------------------------------------
By default, the implementation rely on association into entities.
* implements ``Chill\MainBundle\Entity\HasCenterInterface`` on entities which have one or any center;
* implements ``Chill\MainBundle\Entity\HasCentersInterface`` on entities which have one, multiple or any centers;
* implements ``Chill\MainBundle\Entity\HasScopeInterface`` on entities which have one or any scope;
* implements ``Chill\MainBundle\Entity\HasScopesInterface`` on entities which have one or any scopes;
Then, the default implementation will resolve the center and scope based on the implementation in your model.
How to change the default behaviour ?
-------------------------------------
Implements those interface into services:
* ``Chill\MainBundle\Security\Resolver\CenterResolverInterface``;
* ``Chill\MainBundle\Security\Resolver\ScopeResolverInterface``;
Authorization into lists and index pages
========================================
Due to the fact that authorization model may be overriden, "list" and "index" pages should not rely on center and scope from controller. This must be delegated to dedicated service, which will be aware of the authorization model. We call them ``ACLAwareRepository``. This service must implements an interface, in order to allow to change the implementation.
The controller **must not** performs any DQL or SQL query.
Example in a controller:
.. code-block:: php
namespace Chill\TaskBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Chill\TaskBundle\Repository\SingleTaskAclAwareRepositoryInterface;
final class SingleTaskController extends AbstractController
{
private SingleTaskAclAwareRepositoryInterface $singleTaskAclAwareRepository;
/**
*
* @Route(
* "/{_locale}/task/single-task/list",
* name="chill_task_singletask_list"
* )
*/
public function listAction(
Request $request
) {
$this->denyAccessUnlessGranted(TaskVoter::SHOW, null);
$nb = $this->singleTaskAclAwareRepository->countByAllViewable(
'', // search pattern
[] // search flags
);
$paginator = $this->paginatorFactory->create($nb);
if (0 < $nb) {
$tasks = $this->singleTaskAclAwareRepository->findByAllViewable(
'', // search pattern
[] // search flags
$paginator->getCurrentPageFirstItemNumber(),
$paginator->getItemsPerPage(),
// ordering:
[
'startDate' => 'DESC',
'endDate' => 'DESC',
]
);
} else {
$tasks = [];
}
return $this->render('@ChillTask/SingleTask/List/index.html.twig', [
'tasks' => $tasks,
'paginator' => $paginator,
'filter_order' => $filterOrder
]);
}
}
Writing ``ACLAwareRepository``
------------------------------
The ACLAwareRepository should rely on interfaces
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
As described above, the ACLAwareRepository will perform the query for listing entities, and take care of authorization.
Those "ACLAwareRepositories" must be described into ``interfaces``.
The service must rely on this interface, and not on the default implementation.
Example: at first, we design an interface for listing ``SingleTask`` entities:
.. code-block:: php
<?php
namespace Chill\TaskBundle\Repository;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
interface SingleTaskAclAwareRepositoryInterface
{
/**
* @return SingleTask[]|array
*/
public function findByCurrentUsersTasks(?string $pattern = null, ?array $flags = [], ?int $start = 0, ?int $limit = 50, ?array $orderBy = []): array;
public function countByCurrentUsersTasks(?string $pattern = null, ?array $flags = []): int;
public function countByAllViewable(
?string $pattern = null,
?array $flags = []
): int;
/**
* @return SingleTask[]|array
*/
public function findByAllViewable(
?string $pattern = null,
?array $flags = [],
?int $start = 0,
?int $limit = 50,
?array $orderBy = []
): array;
}
Implements this interface and register the interface as an alias for the implementation.
.. code-block:: yaml
services:
Chill\TaskBundle\Repository\SingleTaskAclAwareRepository:
autowire: true
autoconfigure: true
Chill\TaskBundle\Repository\SingleTaskAclAwareRepositoryInterface: '@Chill\TaskBundle\Repository\SingleTaskAclAwareRepository'
Write the basic implementation for re-use: separate authorization logic and search logic
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The logic of such repository may be separated into two logic:
* the authorization logic (show only entities that the user is allowed to see);
* the search logic (filter entities on some criterias).
This logic should be separated into your implementation.
Considering this simple interface:
.. code-block:: php
interface MyEntityACLAwareRepositoryInterface {
public function countByAuthorized(array $criterias): int;
public function findByAuthorized(array $criteria, int $start, int $limit, array $orderBy): array;
}
The base implementation should separate the logic to allow an easy reuse. Here, the method ``buildQuery`` build a basic query without authorization logic, which can be re-used. The authorization logic is dedicated to a private method. For ease of user, the logic of adding ordering criterias and pagination parameters (``$start`` and ``$limit``) are also delegated to a public method.
.. code-block:: php
namespace Chill\MyBundle\Repository;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\QueryBuilder;
final class MyEntityACLAwareRepository implements MyEntityACLAwareRepositoryInterface {
private EntityManagerInterface $em;
// constructor omitted
public function countByAuthorized(array $criterias): int
{
$qb = $this->buildQuery($criterias);
return $this->addAuthorizations($qb)->select("COUNT(e)")->getQuery()->getResult()->getSingleScalarResult();
}
public function findByAuthorized(array $criteria, int $start, int $limit, array $orderBy): array
{
$qb = $this->buildQuery($criterias);
return $this->getResult($this->addAuthorizations($qb), $start, $limit, $orderBy);
}
public function getResult(QueryBuilder $qb, int $start, int $limit, array $orderBy): array
{
$qb
->setFirstResult($start)
->setMaxResults($limit)
;
// add order by logic
return $qb->getQuery()->getResult();
}
public function buildQuery(array $criterias): QueryBuilder
{
$qb = $this->em->createQueryBuilder();
// implement you logic with search criteria here
return $qb;
}
private function addAuthorizations(QueryBuilder $qb): QueryBuilder
{
// add authorization logic here
return $qb;
}
}
Once this logic is executed, it becomes easy to make a new implementation of the repository:
.. code-block:: php
namespace Chill\MyOtherBundle\Repository;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\QueryBuilder;
use Chill\MyBundle\Repository\MyEntityACLAwareRepository
final class AnotherEntityACLAwareRepository implements MyEntityACLAwareRepositoryInterface {
private EntityManagerInterface $em;
private \Chill\MyBundle\Repository\MyEntityACLAwareRepository $initial;
public function __construct(
EntityManagerInterface $em,
\Chill\MyBundle\Repository\MyEntityACLAwareRepository $initial
) {
$this->em = $em;
$this->initial = $initial;
}
public function countByAuthorized(array $criterias): int
{
$qb = $this->initial->buildQuery($criterias);
return $this->addAuthorizations($qb)->select("COUNT(e)")->getQuery()->getResult()->getSingleScalarResult();
}
public function findByAuthorized(array $criteria, int $start, int $limit, array $orderBy): array
{
$qb = $this->initial->buildQuery($criterias);
return $this->initial->getResult($this->addAuthorizations($qb), $start, $limit, $orderBy);
}
private function addAuthorizations(QueryBuilder $qb): QueryBuilder
{
// add a different authorization logic here
return $qb;
}
}
Then, register this service and decorates the old one:
.. code-block:: yaml
services:
Chill\MyOtherBundle\Repository\AnotherEntityACLAwareRepository:
autowire: true
autoconfigure: true
decorates: Chill\MyBundle\Repository\MyEntityACLAwareRepositoryInterface:

View File

@@ -0,0 +1,747 @@
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
.. _api:
API
###
Chill provides a basic framework to build REST api.
Basic configuration
*******************
Configure a route
=================
Follow those steps to build a REST api:
1. Create your model;
2. Configure the API;
You can also:
* hook into the controller to customize some steps;
* add more route and steps
.. note::
Useful links:
* `How to use annotation to configure serialization <https://symfony.com/doc/current/serializer.html>`_
* `How to create your custom normalizer <https://symfony.com/doc/current/serializer/custom_normalizer.html>`_
Auto-loading the routes
=======================
Ensure that those lines are present in your file `app/config/routing.yml`:
.. code-block:: yaml
chill_cruds:
resource: 'chill_main_crud_route_loader:load'
type: service
Create your model
=================
Create your model on the usual way:
.. code-block:: php
namespace Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\AccompanyingPeriod\OriginRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=OriginRepository::class)
* @ORM\Table(name="chill_person_accompanying_period_origin")
*/
class Origin
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="json")
*/
private $label;
/**
* @ORM\Column(type="date_immutable", nullable=true)
*/
private $noActiveAfter;
// .. getters and setters
}
Configure api
=============
Configure the api using Yaml (see the full configuration: :ref:`api_full_configuration`):
.. code-block:: yaml
# config/packages/chill_main.yaml
chill_main:
apis:
accompanying_period_origin:
base_path: '/api/1.0/person/accompanying-period/origin'
class: 'Chill\PersonBundle\Entity\AccompanyingPeriod\Origin'
name: accompanying_period_origin
base_role: 'ROLE_USER'
actions:
_index:
methods:
GET: true
HEAD: true
_entity:
methods:
GET: true
HEAD: true
.. note::
If you are working on a shared bundle (aka "The chill bundles"), you should define your configuration inside the class :code:`ChillXXXXBundleExtension`, using the "prependConfig" feature:
.. code-block:: php
namespace Chill\PersonBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\HttpFoundation\Request;
/**
* Class ChillPersonExtension
* Loads and manages your bundle configuration
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
* @package Chill\PersonBundle\DependencyInjection
*/
class ChillPersonExtension extends Extension implements PrependExtensionInterface
{
public function prepend(ContainerBuilder $container)
{
$this->prependCruds($container);
}
/**
* @param ContainerBuilder $container
*/
protected function prependCruds(ContainerBuilder $container)
{
$container->prependExtensionConfig('chill_main', [
'apis' => [
[
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Origin::class,
'name' => 'accompanying_period_origin',
'base_path' => '/api/1.0/person/accompanying-period/origin',
'controller' => \Chill\PersonBundle\Controller\OpeningApiController::class,
'base_role' => 'ROLE_USER',
'actions' => [
'_index' => [
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true
],
],
'_entity' => [
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true
]
],
]
]
]
]);
}
}
The :code:`_index` and :code:`_entity` action
*********************************************
The :code:`_index` and :code:`_entity` action are default actions:
* they will call a specific method in the default controller;
* they will generate defined routes:
Index:
Name: :code:`chill_api_single_accompanying_period_origin__index`
Path: :code:`/api/1.0/person/accompanying-period/origin.{_format}`
Entity:
Name: :code:`chill_api_single_accompanying_period_origin__entity`
Path: :code:`/api/1.0/person/accompanying-period/origin/{id}.{_format}`
Role
****
By default, the key `base_role` is used to check ACL. Take care of creating the :code:`Voter` required to take that into account.
For index action, the role will be called with :code:`NULL` as :code:`$subject`. The retrieved entity will be the subject for single queries.
You can also define a role for each method. In this case, this role is used for the given method, and, if any, the base role is taken into account.
.. code-block:: yaml
# config/packages/chill_main.yaml
chill_main:
apis:
accompanying_period_origin:
base_path: '/api/1.0/person/bla/bla'
class: 'Chill\PersonBundle\Entity\Blah'
name: bla
actions:
_entity:
methods:
GET: true
HEAD: true
roles:
GET: MY_ROLE_SEE
HEAD: MY ROLE_SEE
Customize the controller
************************
You can customize the controller by hooking into the default actions. Take care of extending :code:`Chill\MainBundle\CRUD\Controller\ApiController`.
.. code-block:: php
namespace Chill\PersonBundle\Controller;
use Chill\MainBundle\CRUD\Controller\ApiController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class OpeningApiController extends ApiController
{
protected function customizeQuery(string $action, Request $request, $qb): void
{
$qb->where($qb->expr()->gt('e.noActiveAfter', ':now'))
->orWhere($qb->expr()->isNull('e.noActiveAfter'));
$qb->setParameter('now', new \DateTime('now'));
}
}
And set your controller in configuration:
.. code-block:: yaml
chill_main:
apis:
accompanying_period_origin:
base_path: '/api/1.0/person/accompanying-period/origin'
class: 'Chill\PersonBundle\Entity\AccompanyingPeriod\Origin'
name: accompanying_period_origin
# add a controller
controller: 'Chill\PersonBundle\Controller\OpeningApiController'
base_role: 'ROLE_USER'
actions:
_index:
methods:
GET: true
HEAD: true
_entity:
methods:
GET: true
HEAD: true
Create your own actions
***********************
You can add your own actions:
.. code-block:: yaml
chill_main:
apis:
-
class: Chill\PersonBundle\Entity\AccompanyingPeriod
name: accompanying_course
base_path: /api/1.0/person/accompanying-course
controller: Chill\PersonBundle\Controller\AccompanyingCourseApiController
actions:
# add a custom participation:
participation:
methods:
POST: true
DELETE: true
GET: false
HEAD: false
PUT: false
roles:
POST: CHILL_PERSON_ACCOMPANYING_PERIOD_SEE
DELETE: CHILL_PERSON_ACCOMPANYING_PERIOD_SEE
GET: null
HEAD: null
PUT: null
single-collection: single
The key :code:`single-collection` with value :code:`single` will add a :code:`/{id}/ + "action name"` (in this example, :code:`/{id}/participation`) into the path, after the base path. If the value is :code:`collection`, no id will be set, but the action name will be append to the path.
Then, create the corresponding action into your controller:
.. code-block:: php
namespace Chill\PersonBundle\Controller;
use Chill\MainBundle\CRUD\Controller\ApiController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Symfony\Component\HttpFoundation\Exception\BadRequestException;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Chill\PersonBundle\Privacy\AccompanyingPeriodPrivacyEvent;
use Chill\PersonBundle\Entity\Person;
class AccompanyingCourseApiController extends ApiController
{
protected EventDispatcherInterface $eventDispatcher;
protected ValidatorInterface $validator;
public function __construct(EventDispatcherInterface $eventDispatcher, $validator)
{
$this->eventDispatcher = $eventDispatcher;
$this->validator = $validator;
}
public function participationApi($id, Request $request, $_format)
{
/** @var AccompanyingPeriod $accompanyingPeriod */
$accompanyingPeriod = $this->getEntity('participation', $id, $request);
$person = $this->getSerializer()
->deserialize($request->getContent(), Person::class, $_format, []);
if (NULL === $person) {
throw new BadRequestException('person id not found');
}
$this->onPostCheckACL('participation', $request, $accompanyingPeriod, $_format);
switch ($request->getMethod()) {
case Request::METHOD_POST:
$participation = $accompanyingPeriod->addPerson($person);
break;
case Request::METHOD_DELETE:
$participation = $accompanyingPeriod->removePerson($person);
break;
default:
throw new BadRequestException("This method is not supported");
}
$errors = $this->validator->validate($accompanyingPeriod);
if ($errors->count() > 0) {
// only format accepted
return $this->json($errors);
}
$this->getDoctrine()->getManager()->flush();
return $this->json($participation);
}
}
Managing association
********************
ManyToOne association
=====================
In ManyToOne association, you can add associated entities using the :code:`PATCH` request. By default, the serializer deserialize entities only with their id and discriminator type, if any.
Example:
.. code-block:: bash
curl -X 'PATCH' \
'http://localhost:8001/api/1.0/person/accompanying-course/2668.json' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
# see the data sent to the server: \
-d '{
"type": "accompanying_period",
"id": 2668,
"origin": { "id": 11 }
}'
ManyToMany associations
=======================
In OneToMany association, you can easily create route for adding and removing entities, using :code:`POST` and :code:`DELETE` requests.
Prepare your entity, creating the methods :code:`addYourEntity` and :code:`removeYourEntity`:
.. code-block:: php
namespace Chill\PersonBundle\Entity;
use Chill\MainBundle\Entity\Scope;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
/**
* AccompanyingPeriod Class
*
* @ORM\Entity
* @ORM\Table(name="chill_person_accompanying_period")
* @DiscriminatorMap(typeProperty="type", mapping={
* "accompanying_period"=AccompanyingPeriod::class
* })
*/
class AccompanyingPeriod
{
/**
* @var Collection
* @ORM\ManyToMany(
* targetEntity=Scope::class,
* cascade={}
* )
* @Groups({"read"})
*/
private $scopes;
public function addScope(Scope $scope): self
{
$this->scopes[] = $scope;
return $this;
}
public function removeScope(Scope $scope): void
{
$this->scopes->removeElement($scope);
}
Create your route into the configuration:
.. code-block:: yaml
chill_main:
apis:
-
class: Chill\PersonBundle\Entity\AccompanyingPeriod
name: accompanying_course
base_path: /api/1.0/person/accompanying-course
controller: Chill\PersonBundle\Controller\AccompanyingCourseApiController
actions:
scope:
methods:
POST: true
DELETE: true
GET: false
HEAD: false
PUT: false
PATCH: false
roles:
POST: CHILL_PERSON_ACCOMPANYING_PERIOD_SEE
DELETE: CHILL_PERSON_ACCOMPANYING_PERIOD_SEE
GET: null
HEAD: null
PUT: null
PATCH: null
controller_action: null
path: null
single-collection: single
This will create a new route, which will accept two methods: DELETE and POST:
.. code-block:: raw
+--------------+---------------------------------------------------------------------------------------+
| Property | Value |
+--------------+---------------------------------------------------------------------------------------+
| Route Name | chill_api_single_accompanying_course_scope |
| Path | /api/1.0/person/accompanying-course/{id}/scope.{_format} |
| Path Regex | {^/api/1\.0/person/accompanying\-course/(?P<id>[^/]++)/scope\.(?P<_format>[^/]++)$}sD |
| Host | ANY |
| Host Regex | |
| Scheme | ANY |
| Method | POST|DELETE |
| Requirements | {id}: \d+ |
| Class | Symfony\Component\Routing\Route |
| Defaults | _controller: csapi_accompanying_course_controller:scopeApi |
| Options | compiler_class: Symfony\Component\Routing\RouteCompiler |
+--------------+---------------------------------------------------------------------------------------+
Then, create the controller action. Call the method:
.. code-block:: php
namespace Chill\PersonBundle\Controller;
use Chill\MainBundle\CRUD\Controller\ApiController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Chill\MainBundle\Entity\Scope;
class MyController extends ApiController
{
public function scopeApi($id, Request $request, string $_format): Response
{
return $this->addRemoveSomething('scope', $id, $request, $_format, 'scope', Scope::class, [ 'groups' => [ 'read' ] ]);
}
}
This will allow to add a scope by his id, and delete them.
Curl requests:
.. code-block:: bash
# add a scope with id 5
curl -X 'POST' \
'http://localhost:8001/api/1.0/person/accompanying-course/2868/scope.json' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"type": "scope",
"id": 5
}'
# remove a scope with id 5
curl -X 'DELETE' \
'http://localhost:8001/api/1.0/person/accompanying-course/2868/scope.json' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"id": 5,
"type": "scope"
}'
Deserializing an association where multiple types are allowed
=============================================================
Sometimes, multiples types are allowed as association to one entity:
.. code-block:: php
namespace Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
use Chill\ThirdPartyBundle\Entity\ThirdParty;
use Doctrine\ORM\Mapping as ORM;
class Resource
{
/**
* @ORM\ManyToOne(targetEntity=ThirdParty::class)
* @ORM\JoinColumn(nullable=true)
*/
private $thirdParty;
/**
* @ORM\ManyToOne(targetEntity=Person::class)
* @ORM\JoinColumn(nullable=true)
*/
private $person;
/**
*
* @param $resource Person|ThirdParty
*/
public function setResource($resource): self
{
// ...
}
/**
* @return ThirdParty|Person
* @Groups({"read", "write"})
*/
public function getResource()
{
return $this->person ?? $this->thirdParty;
}
}
This is not well taken into account by the Symfony serializer natively.
You must, then, create your own CustomNormalizer. You can help yourself using this:
.. code-block:: php
namespace Chill\PersonBundle\Serializer\Normalizer;
use Chill\PersonBundle\Entity\Person;
use Chill\ThirdPartyBundle\Entity\ThirdParty;
use Chill\PersonBundle\Entity\AccompanyingPeriod\Resource;
use Chill\PersonBundle\Repository\AccompanyingPeriod\ResourceRepository;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait;
use Symfony\Component\Serializer\Normalizer\ObjectToPopulateTrait;
use Symfony\Component\Serializer\Exception;
use Chill\MainBundle\Serializer\Normalizer\DiscriminatedObjectDenormalizer;
class AccompanyingPeriodResourceNormalizer implements DenormalizerInterface, DenormalizerAwareInterface
{
use DenormalizerAwareTrait;
use ObjectToPopulateTrait;
public function __construct(ResourceRepository $repository)
{
$this->repository = $repository;
}
public function denormalize($data, string $type, string $format = null, array $context = [])
{
// .. snipped for brevity
if ($resource === NULL) {
$resource = new Resource();
}
if (\array_key_exists('resource', $data)) {
$res = $this->denormalizer->denormalize(
$data['resource'],
// call for a "multiple type"
DiscriminatedObjectDenormalizer::TYPE,
$format,
// into the context, we add the list of allowed types:
[
DiscriminatedObjectDenormalizer::ALLOWED_TYPES =>
[
Person::class, ThirdParty::class
]
]
);
$resource->setResource($res);
}
return $resource;
}
public function supportsDenormalization($data, string $type, string $format = null)
{
return $type === Resource::class;
}
}
Serialization for collection
****************************
A specific model has been defined for returning collection:
.. code-block:: json
{
"count": 49,
"results": [
],
"pagination": {
"more": true,
"next": "/api/1.0/search.json&q=xxxx......&page=2",
"previous": null,
"first": 0,
"items_per_page": 1
}
}
Where this is relevant, this model should be re-used in custom controller actions.
In custom actions, this can be achieved quickly by assembling results into a :code:`Chill\MainBundle\Serializer\Model\Collection`. The pagination information is given by using :code:`Paginator` (see :ref:`Pagination <pagination-ref>`).
.. code-block:: php
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Chill\MainBundle\Pagination\PaginatorInterface;
class MyController extends AbstractController
{
protected function serializeCollection(PaginatorInterface $paginator, $entities): Response
{
$model = new Collection($entities, $paginator);
return $this->json($model, Response::HTTP_OK, [], $context);
}
}
.. _api_full_configuration:
Full configuration example
**************************
.. code-block:: yaml
apis:
-
class: Chill\PersonBundle\Entity\AccompanyingPeriod
name: accompanying_course
base_path: /api/1.0/person/accompanying-course
controller: Chill\PersonBundle\Controller\AccompanyingCourseApiController
actions:
_entity:
roles:
GET: CHILL_PERSON_ACCOMPANYING_PERIOD_SEE
HEAD: null
POST: null
DELETE: null
PUT: null
controller_action: null
path: null
single-collection: single
methods:
GET: true
HEAD: true
POST: false
DELETE: false
PUT: false
participation:
methods:
POST: true
DELETE: true
GET: false
HEAD: false
PUT: false
roles:
POST: CHILL_PERSON_ACCOMPANYING_PERIOD_SEE
DELETE: CHILL_PERSON_ACCOMPANYING_PERIOD_SEE
GET: null
HEAD: null
PUT: null
controller_action: null
# the requirements for the route. Will be set to `[ 'id' => '\d+' ]` if left empty.
requirements: []
path: null
single-collection: single
base_role: null

View File

@@ -16,6 +16,7 @@ As Chill rely on the `symfony <http://symfony.com>`_ framework, reading the fram
Instructions to create a new bundle <create-a-new-bundle.rst>
CRUD (Create - Update - Delete) for one entity <crud.rst>
Helpers for building a REST API <api.rst>
Routing <routing.rst>
Menus <menus.rst>
Forms <forms.rst>

View File

@@ -7,6 +7,8 @@
Free Documentation License".
.. _pagination-ref:
Pagination
##########
@@ -15,7 +17,7 @@ The Bundle :code:`Chill\MainBundle` provides a **Pagination** api which allow yo
A simple example
****************
In the controller, get the :class:`Chill\Main\Pagination\PaginatorFactory` from the `Container` and use this :code:`PaginatorFactory` to create a :code:`Paginator` instance.
In the controller, get the :code:`Chill\Main\Pagination\PaginatorFactory` from the `Container` and use this :code:`PaginatorFactory` to create a :code:`Paginator` instance.
.. literalinclude:: pagination/example.php
@@ -26,7 +28,7 @@ Then, render the pagination using the dedicated twig function.
.. code-block:: html+twig
{% extends "ChillPersonBundle::layout.html.twig" %}
{% extends "@ChillPerson/Person/layout.html.twig" %}
{% block title 'Item list'|trans %}

View File

@@ -97,7 +97,7 @@ The has the following signature :
*
* @param string $context
* @param mixed[] $args the argument to the context.
* @return string[]
* @return TimelineSingleQuery
* @throw \LogicException if the context is not supported
*/
public function fetchQuery($context, array $args);
@@ -163,18 +163,16 @@ The has the following signature :
The `fetchQuery` function
^^^^^^^^^^^^^^^^^^^^^^^^^
The fetchQuery function help to build the UNION query to gather events. This function should return an associative array MUST have the following key :
The fetchQuery function help to build the UNION query to gather events. This function should return an instance of :code:`TimelineSingleQuery`. For you convenience, this object may be build using an associative array with the following keys:
* `id` : the name of the id column
* `type`: a string to indicate the type
* `date`: the name of the datetime column, used to order entities by date
* `FROM` (in capital) : the FROM clause. May contains JOIN instructions
* `FROM`: the FROM clause. May contains JOIN instructions
* `WHERE`: the WHERE clause;
* `parameters`: the parameters to pass to the query
Those key are optional:
* `WHERE` (in capital) : the WHERE clause.
Where relevant, the data must be quoted to avoid SQL injection.
The parameters should be replaced into the query by :code:`?`. They will be replaced into the query using prepared statements.
`$context` and `$args` are defined by the bundle which will call the timeline rendering. You may use them to build a different query depending on this context.
@@ -186,6 +184,15 @@ For instance, if the context is `'person'`, the args will be this array :
'person' => $person //a \Chill\PersonBundle\Entity\Person entity
);
For the context :code:`center`, the args will be:
.. code-block:: php
array(
'centers' => [ ] // an array of \Chill\MainBundle\Entity\Center entities
);
You should find in the bundle documentation which contexts are arguments the bundle defines.
.. note::
@@ -199,13 +206,12 @@ Example of an implementation :
namespace Chill\ReportBundle\Timeline;
use Chill\MainBundle\Timeline\TimelineProviderInterface;
use Chill\MainBundle\Timeline\TimelineSingleQuery;
use Doctrine\ORM\EntityManager;
/**
* Provide report for inclusion in timeline
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
* @author Champs Libres <info@champs-libres.coop>
*/
class TimelineReportProvider implements TimelineProviderInterface
{
@@ -227,16 +233,17 @@ Example of an implementation :
$metadata = $this->em->getClassMetadata('ChillReportBundle:Report');
return array(
return TimelineSingleQuery::fromArray([
'id' => $metadata->getColumnName('id'),
'type' => 'report',
'date' => $metadata->getColumnName('date'),
'FROM' => $metadata->getTableName(),
'WHERE' => sprintf('%s = %d',
'WHERE' => sprintf('%s = ?',
$metadata
->getAssociationMapping('person')['joinColumns'][0]['name'],
$args['person']->getId())
);
->getAssociationMapping('person')['joinColumns'][0]['name'])
)
'parameters' => [ $args['person']->getId() ]
]);
}
//....

View File

@@ -149,7 +149,7 @@ It proposes a new block :
* where to display the admin content
ChillPersonBundle::layout.html.twig
@ChillPersonBundle/Person/layout.html.twig
-----------------------------------
This layout extend `ChillMainBundle::layoutWithVerticalMenu.html.twig` add the person details in the block `top_banner`, set the menu `person` as the vertical menu.

View File

@@ -82,7 +82,7 @@ Chill will be available at ``http://localhost:8001.`` Currently, there isn't any
.. code-block:: bash
docker-compose exec --user $(id -u) php bin/console doctrine:fixtures:load
docker-compose exec --user $(id -u) php bin/console doctrine:fixtures:load --purge-with-truncate
There are several users available:

3
package.json.txt Normal file
View File

@@ -0,0 +1,3 @@
add npm/yarn dependency in package.json :
"select2-bootstrap-theme": "0.1.0-beta.10",

111
phpstan-baseline.neon Normal file
View File

@@ -0,0 +1,111 @@
parameters:
ignoreErrors:
-
message: "#^Variable property access on \\$this\\(Chill\\\\ActivityBundle\\\\Entity\\\\ActivityType\\)\\.$#"
count: 3
path: src/Bundle/ChillActivityBundle/Entity/ActivityType.php
-
message: "#^Foreach overwrites \\$key with its key variable\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php
-
message: "#^Instantiated class PhpOffice\\\\PhpWord\\\\TemplateProcessor not found\\.$#"
count: 1
path: src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorController.php
-
message: "#^Instantiated class PhpOffice\\\\PhpWord\\\\TemplateProcessor not found\\.$#"
count: 1
path: src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php
-
message: "#^Variable \\$participation might not be defined\\.$#"
count: 3
path: src/Bundle/ChillEventBundle/Controller/ParticipationController.php
-
message: "#^Foreach overwrites \\$value with its value variable\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php
-
message: "#^Variable method call on object\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php
-
message: "#^Cannot unset offset '_token' on array\\{formatter\\: mixed, export\\: mixed, centers\\: mixed, alias\\: string\\}\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Controller/ExportController.php
-
message: "#^Foreach overwrites \\$line with its value variable\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php
-
message: "#^Foreach overwrites \\$key with its key variable\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php
-
message: "#^Foreach overwrites \\$key with its value variable\\.$#"
count: 3
path: src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php
-
message: "#^Foreach overwrites \\$value with its value variable\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php
-
message: "#^Variable \\$message on left side of \\?\\? always exists and is not nullable\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Templating/ChillTwigHelper.php
-
message: "#^Variable \\$sqls on left side of \\?\\? always exists and is not nullable\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php
-
message: "#^Class Chill\\\\PersonBundle\\\\Entity\\\\Person constructor invoked with 1 parameter, 0 required\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
-
message: "#^Variable \\$street1Value might not be defined\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
-
message: "#^Variable method call on mixed\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php
-
message: "#^Foreach overwrites \\$value with its value variable\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php
-
message: "#^Foreach overwrites \\$action with its value variable\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php
-
message: "#^Foreach overwrites \\$action with its value variable\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php
-
message: "#^Foreach overwrites \\$action with its value variable\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php
-
message: "#^Foreach overwrites \\$value with its value variable\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/Form/ChoiceLoader/ThirdPartyChoiceLoader.php

131
phpstan-critical.neon Normal file
View File

@@ -0,0 +1,131 @@
parameters:
ignoreErrors:
-
message: "#^Implicit array creation is not allowed \\- variable \\$centers might not exist\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
-
message: "#^Access to an undefined property Chill\\\\PersonBundle\\\\Entity\\\\Person\\:\\:\\$currentHouseholdParticipationAt\\.$#"
count: 3
path: src/Bundle/ChillPersonBundle/Entity/Person.php
-
message: "#^Access to an undefined property Chill\\\\PersonBundle\\\\Entity\\\\Household\\\\PersonHouseholdAddress\\:\\:\\$relation\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Entity/Household/PersonHouseholdAddress.php
-
message: "#^Access to an undefined property Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\:\\:\\$work\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
-
message: "#^Undefined variable\\: \\$person$#"
count: 1
path: src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php
-
message: "#^Access to an undefined property Chill\\\\PersonBundle\\\\Household\\\\MembersEditorFactory\\:\\:\\$validator\\.$#"
count: 2
path: src/Bundle/ChillPersonBundle/Household/MembersEditorFactory.php
-
message: "#^Parameter \\$action of method Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkRepository\\:\\:buildQueryBySocialActionWithDescendants\\(\\) has invalid type Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriod\\\\SocialAction\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php
-
message: "#^Parameter \\$action of method Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkRepository\\:\\:countBySocialActionWithDescendants\\(\\) has invalid type Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriod\\\\SocialAction\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php
-
message: "#^Undefined variable\\: \\$action$#"
count: 1
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php
-
message: "#^Undefined variable\\: \\$limit$#"
count: 1
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php
-
message: "#^Undefined variable\\: \\$offset$#"
count: 1
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php
-
message: "#^Undefined variable\\: \\$orderBy$#"
count: 1
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php
-
message: "#^Variable variables are not allowed\\.$#"
count: 4
path: src/Bundle/ChillPersonBundle/Search/PersonSearch.php
-
message: "#^Function Chill\\\\PersonBundle\\\\Serializer\\\\Normalizer\\\\·\\\\is_array not found\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php
-
message: "#^Undefined variable\\: \\$value$#"
count: 1
path: src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidityValidator.php
-
message: "#^Undefined variable\\: \\$choiceSlug$#"
count: 1
path: src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php
-
message: "#^Undefined variable\\: \\$choiceSlug$#"
count: 1
path: src/Bundle/ChillReportBundle/Export/Export/ReportList.php
-
message: "#^Undefined variable\\: \\$type$#"
count: 1
path: src/Bundle/ChillTaskBundle/Controller/TaskController.php
-
message: "#^Call to an undefined method Chill\\\\MainBundle\\\\CRUD\\\\Controller\\\\AbstractCRUDController\\:\\:getRoleFor\\(\\)\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php
-
message: "#^Call to an undefined method Chill\\\\MainBundle\\\\Controller\\\\UserController\\:\\:createEditForm\\(\\)\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Controller/UserController.php
-
message: "#^Undefined variable\\: \\$current$#"
count: 1
path: src/Bundle/ChillMainBundle/Pagination/PageGenerator.php
-
message: "#^Call to an undefined method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AbstractChillVoter\\:\\:getSupportedAttributes\\(\\)\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php
-
message: "#^Call to an undefined method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AbstractChillVoter\\:\\:getSupportedClasses\\(\\)\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php
-
message: "#^Call to an undefined method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AbstractChillVoter\\:\\:isGranted\\(\\)\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php
-
message: "#^Access to an undefined property Chill\\\\PersonBundle\\\\Controller\\\\PersonController\\:\\:\\$security\\.$#"
count: 3
path: src/Bundle/ChillPersonBundle/Controller/PersonController.php
-
message: "#^Call to an undefined method Chill\\\\ThirdPartyBundle\\\\Form\\\\Type\\\\PickThirdPartyTypeCategoryType\\:\\:transform\\(\\)\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php

852
phpstan-types.neon Normal file
View File

@@ -0,0 +1,852 @@
parameters:
ignoreErrors:
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Entity/Activity.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Entity/ActivityReason.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Export/Export/ListActivity.php
-
message: "#^Method Chill\\\\ActivityBundle\\\\Export\\\\Export\\\\StatActivityDuration\\:\\:getDescription\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Export/Export/StatActivityDuration.php
-
message: "#^Method Chill\\\\ActivityBundle\\\\Export\\\\Export\\\\StatActivityDuration\\:\\:getTitle\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Export/Export/StatActivityDuration.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Form/ActivityType.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Form/ActivityType.php
-
message: "#^Only booleans are allowed in &&, mixed given on the right side\\.$#"
count: 3
path: src/Bundle/ChillActivityBundle/Form/ActivityType.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 2
path: src/Bundle/ChillActivityBundle/Form/ActivityType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillActivityBundle/Security/Authorization/ActivityStatsVoter.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillAsideActivityBundle/src/Menu/AdminMenuBuilder.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 3
path: src/Bundle/ChillBudgetBundle/Form/ChargeType.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 2
path: src/Bundle/ChillBudgetBundle/Form/ResourceType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillCalendarBundle/Entity/Calendar.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/AbstractCustomField.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 3
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 4
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php
-
message: "#^Method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldChoice\\:\\:buildForm\\(\\) should return Symfony\\\\Component\\\\Form\\\\FormTypeInterface but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php
-
message: "#^Method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldDate\\:\\:buildForm\\(\\) should return Symfony\\\\Component\\\\Form\\\\FormTypeInterface but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php
-
message: "#^Method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldLongChoice\\:\\:buildForm\\(\\) should return Symfony\\\\Component\\\\Form\\\\FormTypeInterface but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php
-
message: "#^Method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldNumber\\:\\:buildForm\\(\\) should return Symfony\\\\Component\\\\Form\\\\FormTypeInterface but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php
-
message: "#^Method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldText\\:\\:buildForm\\(\\) should return Symfony\\\\Component\\\\Form\\\\FormTypeInterface but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php
-
message: "#^Method Chill\\\\CustomFieldsBundle\\\\CustomFields\\\\CustomFieldTitle\\:\\:buildForm\\(\\) should return Symfony\\\\Component\\\\Form\\\\FormTypeInterface but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php
-
message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#"
count: 1
path: src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldType.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillDocStoreBundle/Entity/DocumentCategory.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Entity/Participation.php
-
message: "#^Method Chill\\\\EventBundle\\\\Entity\\\\Participation\\:\\:offsetGet\\(\\) should return mixed but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Entity/Participation.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php
-
message: "#^Parameter \\$resolver of method Chill\\\\EventBundle\\\\Form\\\\EventTypeType\\:\\:setDefaultOptions\\(\\) has invalid type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Form/EventTypeType.php
-
message: "#^Parameter \\$resolver of method Chill\\\\EventBundle\\\\Form\\\\RoleType\\:\\:setDefaultOptions\\(\\) has invalid type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Form/RoleType.php
-
message: "#^Parameter \\$resolver of method Chill\\\\EventBundle\\\\Form\\\\StatusType\\:\\:setDefaultOptions\\(\\) has invalid type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Form/StatusType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Form/Type/PickEventType.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2
path: src/Bundle/ChillEventBundle/Search/EventSearch.php
-
message: "#^Method Chill\\\\EventBundle\\\\Search\\\\EventSearch\\:\\:renderResult\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillEventBundle/Search/EventSearch.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillEventBundle/Security/Authorization/EventVoter.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillEventBundle/Security/Authorization/ParticipationVoter.php
-
message: "#^Casting to string something that's already string\\.$#"
count: 5
path: src/Bundle/ChillFamilyMembersBundle/Entity/AbstractFamilyMember.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 2
path: src/Bundle/ChillFamilyMembersBundle/Form/FamilyMemberType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillFamilyMembersBundle/Security/Voter/FamilyMemberVoter.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php
-
message: "#^Parameter \\$scope of method Chill\\\\MainBundle\\\\CRUD\\\\Controller\\\\CRUDController\\:\\:getReachableCenters\\(\\) has invalid type Chill\\\\MainBundle\\\\CRUD\\\\Controller\\\\Scope\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Resolver/Resolver.php
-
message: "#^Method Chill\\\\MainBundle\\\\CRUD\\\\Resolver\\\\Resolver\\:\\:getConfigValue\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Resolver/Resolver.php
-
message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php
-
message: "#^Method Chill\\\\MainBundle\\\\Command\\\\ChillImportUsersCommand\\:\\:execute\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php
-
message: "#^Method Chill\\\\MainBundle\\\\Command\\\\ChillUserSendRenewPasswordCodeCommand\\:\\:execute\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php
-
message: "#^Method Chill\\\\MainBundle\\\\Command\\\\LoadAndUpdateLanguagesCommand\\:\\:execute\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php
-
message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php
-
message: "#^Method Chill\\\\MainBundle\\\\Command\\\\LoadCountriesCommand\\:\\:execute\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php
-
message: "#^Method Chill\\\\MainBundle\\\\Command\\\\LoadPostalCodesCommand\\:\\:execute\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php
-
message: "#^Method Chill\\\\MainBundle\\\\Command\\\\SetPasswordCommand\\:\\:execute\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Controller/PasswordController.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Controller/PostalCodeController.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php
-
message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#"
count: 5
path: src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ExportsCompilerPass.php
-
message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/SearchableServicesCompilerPass.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php
-
message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/DependencyInjection/Widget/AbstractWidgetsCompilerPass.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/DependencyInjection/Widget/AbstractWidgetsCompilerPass.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/DependencyInjection/Widget/AbstractWidgetsCompilerPass.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Entity/Address.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Entity/Embeddable/CommentEmbeddable.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Entity/User.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Entity/User.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 6
path: src/Bundle/ChillMainBundle/Export/ExportManager.php
-
message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Form/DataMapper/AddressDataMapper.php
-
message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Form/Type/AddressType.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Form/Type/AddressType.php
-
message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Form/Type/ChillTextareaType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 3
path: src/Bundle/ChillMainBundle/Form/Type/DataTransformer/DateIntervalTransformer.php
-
message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Form/Type/TranslatableStringFormType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Search/Entity/SearchUserApiProvider.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelper.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Security/ParentRoleHelper.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverVoter.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
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
path: src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php
-
message: "#^Method Chill\\\\MainBundle\\\\Timeline\\\\TimelineBuilder\\:\\:getTemplateData\\(\\) should return array but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillMainBundle/Validation/Validator/ValidPhonenumber.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/CRUD/Controller/OneToOneEntityPersonCRUDController.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php
-
message: "#^Method Chill\\\\PersonBundle\\\\Command\\\\ChillPersonMoveCommand\\:\\:execute\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php
-
message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#"
count: 3
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 3
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 6
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Controller/PersonController.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/DependencyInjection/CompilerPass/AccompanyingPeriodTimelineCompilerPass.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Entity/Person.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2
path: src/Bundle/ChillPersonBundle/Entity/PersonPhone.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillPersonBundle/Export/AbstractAccompanyingPeriodExportElement.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Export/Aggregator/CountryOfBirthAggregator.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Export/Aggregator/NationalityAggregator.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 3
path: src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2
path: src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Export/Filter/GenderFilter.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Form/DataMapper/PersonAltNameDataMapper.php
-
message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Form/Type/PersonAltNameType.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Household/MembersEditor.php
-
message: "#^Method Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkRepository\\:\\:buildQueryBySocialActionWithDescendants\\(\\) has invalid return type Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriod\\\\QueryBuilder\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Bundle/ChillPersonBundle/Repository/PersonRepository.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 3
path: src/Bundle/ChillPersonBundle/Search/PersonSearch.php
-
message: "#^Method Chill\\\\PersonBundle\\\\Search\\\\PersonSearch\\:\\:renderResult\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Search/PersonSearch.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Search/SearchPersonApiProvider.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2
path: src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php
-
message: "#^Method Chill\\\\ReportBundle\\\\DataFixtures\\\\ORM\\\\LoadReports\\:\\:getRandomChoice\\(\\) should return array\\<string\\>\\|string but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 4
path: src/Bundle/ChillReportBundle/Export/Export/ReportList.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2
path: src/Bundle/ChillReportBundle/Export/Export/ReportList.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillReportBundle/Security/Authorization/ReportVoter.php
-
message: "#^Method Chill\\\\ReportBundle\\\\Security\\\\Authorization\\\\ReportVoter\\:\\:supports\\(\\) should return bool but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillReportBundle/Security/Authorization/ReportVoter.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 4
path: src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php
-
message: "#^Casting to string something that's already string\\.$#"
count: 3
path: src/Bundle/ChillTaskBundle/Entity/AbstractTask.php
-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 2
path: src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 5
path: src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php
-
message: "#^Method Chill\\\\TaskBundle\\\\Timeline\\\\SingleTaskTaskLifeCycleEventTimelineProvider\\:\\:getTransitionByName\\(\\) should return Symfony\\\\Component\\\\Workflow\\\\Transition but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php
-
message: "#^Method Chill\\\\TaskBundle\\\\Timeline\\\\TaskLifeCycleEventTimelineProvider\\:\\:getTransitionByName\\(\\) should return Symfony\\\\Component\\\\Workflow\\\\Transition but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/DependencyInjection/CompilerPass/ThirdPartyTypeCompilerPass.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 4
path: src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/Form/ChoiceLoader/ThirdPartyChoiceLoader.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/Form/ChoiceLoader/ThirdPartyChoiceLoader.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php
-
message: "#^Method Chill\\\\ThirdPartyBundle\\\\Search\\\\ThirdPartySearch\\:\\:renderResult\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/Search/ThirdPartySearch.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/Security/Voter/ThirdPartyVoter.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 1
path: src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php

24
phpstan.neon.dist Normal file
View File

@@ -0,0 +1,24 @@
parameters:
level: 1
paths:
- src/
excludePaths:
- src/Bundle/*/Tests/*
- src/Bundle/*/tests/*
- src/Bundle/*/Test/*
- src/Bundle/*/config/*
- src/Bundle/*/migrations/*
- src/Bundle/*/translations/*
- src/Bundle/*/Resources/*
- src/Bundle/*/src/Tests/*
- src/Bundle/*/src/Test/*
- src/Bundle/*/src/config/*
- src/Bundle/*/src/migrations/*
- src/Bundle/*/src/translations/*
- src/Bundle/*/src/Resources/*
includes:
- phpstan-types.neon
- phpstan-critical.neon
- phpstan-baseline.neon

View File

@@ -10,7 +10,7 @@
<php>
<ini name="error_reporting" value="-1" />
<server name="APP_ENV" value="test" force="true" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak" />
<server name="SHELL_VERBOSITY" value="-1" />
</php>
@@ -18,12 +18,29 @@
<testsuite name="MainBundle">
<directory suffix="Test.php">src/Bundle/ChillMainBundle/Tests/</directory>
</testsuite>
<!--
<testsuite name="PersonBundle">
<directory suffix="Test.php">src/Bundle/ChillPersonBundle/Tests/</directory>
<!-- test for export will be runned later -->
<exclude>src/Bundle/ChillPersonBundle/Tests/Export/*</exclude>
<!-- we are rewriting accompanying periods... Work in progress -->
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php</exclude>
<!-- we are rewriting address, Work in progress -->
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php</exclude>
<!-- find a solution to create multiple configs -->
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php</exclude>
<!-- temporarily removed, the time to find a fix -->
<exclude>src/Bundle/ChillPersonBundle/Tests/Controller/PersonDuplicateControllerViewTest.php</exclude>
</testsuite>
-->
</testsuites>
<testsuite name="AsideActivityBundle">
<directory suffix="Test.php">src/Bundle/ChillAsideActivityBundle/src/Tests/</directory>
</testsuite>
<testsuite name="CalendarBundle">
<directory suffix="Test.php">src/Bundle/ChillCalendarBundle/Tests/</directory>
</testsuite>
<testsuite name="DocGeneratorBundle">
<directory suffix="Test.php">src/Bundle/ChillDocGeneratorBundle/tests/</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />

View File

@@ -27,3 +27,4 @@ Version 1.5.5
=============
- [activity] replace dropdown for selecting reasons and use chillEntity for reason rendering
- fix bug: error when trying to edit activity of which the type has been deactivated

View File

@@ -1,458 +1,565 @@
<?php
/*
* Chill is a software for social workers
*
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Controller;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Chill\ActivityBundle\Entity\ActivityReason;
use Chill\ActivityBundle\Repository\ActivityACLAwareRepositoryInterface;
use Chill\ActivityBundle\Repository\ActivityRepository;
use Chill\ActivityBundle\Repository\ActivityTypeCategoryRepository;
use Chill\ActivityBundle\Repository\ActivityTypeRepository;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
use Chill\MainBundle\Repository\LocationRepository;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Privacy\PrivacyEvent;
use Chill\PersonBundle\Repository\AccompanyingPeriodRepository;
use Chill\PersonBundle\Repository\PersonRepository;
use Chill\ThirdPartyBundle\Repository\ThirdPartyRepository;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Role\Role;
use Chill\ActivityBundle\Entity\Activity;
use Chill\PersonBundle\Entity\Person;
use Chill\ActivityBundle\Form\ActivityType;
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
use Symfony\Component\Serializer\SerializerInterface;
/**
* Class ActivityController
*
* @package Chill\ActivityBundle\Controller
*/
class ActivityController extends AbstractController
final class ActivityController extends AbstractController
{
private EventDispatcherInterface $eventDispatcher;
/**
* @var EventDispatcherInterface
*/
protected $eventDispatcher;
private LoggerInterface $logger;
/**
* @var AuthorizationHelper
*/
protected $authorizationHelper;
private SerializerInterface $serializer;
/**
* @var LoggerInterface
*/
protected $logger;
private ActivityACLAwareRepositoryInterface $activityACLAwareRepository;
private ActivityTypeRepository $activityTypeRepository;
private ThirdPartyRepository $thirdPartyRepository;
private PersonRepository $personRepository;
private LocationRepository $locationRepository;
private EntityManagerInterface $entityManager;
private ActivityRepository $activityRepository;
private AccompanyingPeriodRepository $accompanyingPeriodRepository;
private ActivityTypeCategoryRepository $activityTypeCategoryRepository;
/**
* ActivityController constructor.
*
* @param EventDispatcherInterface $eventDispatcher
* @param AuthorizationHelper $authorizationHelper
*/
public function __construct(
ActivityACLAwareRepositoryInterface $activityACLAwareRepository,
ActivityTypeRepository $activityTypeRepository,
ActivityTypeCategoryRepository $activityTypeCategoryRepository,
PersonRepository $personRepository,
ThirdPartyRepository $thirdPartyRepository,
LocationRepository $locationRepository,
ActivityRepository $activityRepository,
AccompanyingPeriodRepository $accompanyingPeriodRepository,
EntityManagerInterface $entityManager,
EventDispatcherInterface $eventDispatcher,
AuthorizationHelper $authorizationHelper,
LoggerInterface $logger
LoggerInterface $logger,
SerializerInterface $serializer
) {
$this->activityACLAwareRepository = $activityACLAwareRepository;
$this->activityTypeRepository = $activityTypeRepository;
$this->activityTypeCategoryRepository = $activityTypeCategoryRepository;
$this->personRepository = $personRepository;
$this->thirdPartyRepository = $thirdPartyRepository;
$this->locationRepository = $locationRepository;
$this->activityRepository = $activityRepository;
$this->accompanyingPeriodRepository = $accompanyingPeriodRepository;
$this->entityManager = $entityManager;
$this->eventDispatcher = $eventDispatcher;
$this->authorizationHelper = $authorizationHelper;
$this->logger = $logger;
$this->serializer = $serializer;
}
/**
* Lists all Activity entities.
*
*/
public function listAction($person_id, Request $request)
public function listAction(Request $request): Response
{
$em = $this->getDoctrine()->getManager();
$person = $em->getRepository('ChillPersonBundle:Person')->find($person_id);
$view = null;
$activities = [];
// TODO: add pagination
if ($person === NULL) {
throw $this->createNotFoundException('Person not found');
[$person, $accompanyingPeriod] = $this->getEntity($request);
if ($person instanceof Person) {
$this->denyAccessUnlessGranted(ActivityVoter::SEE, $person);
$activities = $this->activityACLAwareRepository
->findByPerson($person, ActivityVoter::SEE, 0, null);
$event = new PrivacyEvent($person, [
'element_class' => Activity::class,
'action' => 'list'
]);
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
$view = 'ChillActivityBundle:Activity:listPerson.html.twig';
} elseif ($accompanyingPeriod instanceof AccompanyingPeriod) {
$this->denyAccessUnlessGranted(ActivityVoter::SEE, $accompanyingPeriod);
$activities = $this->activityACLAwareRepository
->findByAccompanyingPeriod($accompanyingPeriod, ActivityVoter::SEE);
$view = 'ChillActivityBundle:Activity:listAccompanyingCourse.html.twig';
}
$this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
$reachableScopes = $this->authorizationHelper
->getReachableScopes($this->getUser(), new Role('CHILL_ACTIVITY_SEE'),
$person->getCenter());
$activities = $em->getRepository('ChillActivityBundle:Activity')
->findBy(
array('person' => $person, 'scope' => $reachableScopes),
array('date' => 'DESC')
);
$event = new PrivacyEvent($person, array(
'element_class' => Activity::class,
'action' => 'list'
));
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
return $this->render('ChillActivityBundle:Activity:list.html.twig', array(
'activities' => $activities,
'person' => $person
));
return $this->render(
$view,
[
'activities' => $activities,
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
]
);
}
/**
* Creates a new Activity entity.
*
*/
public function createAction($person_id, Request $request)
{
$em = $this->getDoctrine()->getManager();
$person = $em->getRepository('ChillPersonBundle:Person')->find($person_id);
if ($person === NULL) {
throw $this->createNotFoundException('person not found');
public function selectTypeAction(Request $request): Response
{
$view = null;
[$person, $accompanyingPeriod] = $this->getEntity($request);
if ($accompanyingPeriod instanceof AccompanyingPeriod) {
$view = 'ChillActivityBundle:Activity:selectTypeAccompanyingCourse.html.twig';
} elseif ($person instanceof Person) {
$view = 'ChillActivityBundle:Activity:selectTypePerson.html.twig';
}
$this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
$data = [];
$entity = new Activity();
$entity->setPerson($person);
$form = $this->createCreateForm($entity, $person);
$form->handleRequest($request);
$activityTypeCategories = $this
->activityTypeCategoryRepository
->findBy(['active' => true], ['ordering' => 'ASC']);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$this->denyAccessUnlessGranted('CHILL_ACTIVITY_CREATE', $entity,
'creation of this activity not allowed');
$em->persist($entity);
$em->flush();
$this->get('session')
->getFlashBag()
->add('success',
$this->get('translator')
->trans('Success : activity created!')
foreach ($activityTypeCategories as $activityTypeCategory) {
$activityTypes = $this
->activityTypeRepository
->findBy(
['active' => true, 'category' => $activityTypeCategory],
['ordering' => 'ASC']
);
return $this->redirect(
$this->generateUrl('chill_activity_activity_show',
array('id' => $entity->getId(), 'person_id' => $person_id)));
$data[] = [
'activityTypeCategory' => $activityTypeCategory,
'activityTypes' => $activityTypes,
];
}
$this->get('session')
->getFlashBag()->add('danger',
$this->get('translator')
->trans('The form is not valid. The activity has not been created !')
);
return $this->render('ChillActivityBundle:Activity:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
'person' => $person
));
}
/**
* Creates a form to create a Activity entity.
*
* @param Activity $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createCreateForm(Activity $entity)
{
$form = $this->createForm(ActivityType::class, $entity,
array(
'action' => $this->generateUrl('chill_activity_activity_create', [
'person_id' => $entity->getPerson()->getId(),
]),
'method' => 'POST',
'center' => $entity->getCenter(),
'role' => new Role('CHILL_ACTIVITY_CREATE')
)
);
return $form;
}
/**
* Displays a form to create a new Activity entity.
*
*/
public function newAction($person_id)
{
$em = $this->getDoctrine()->getManager();
$person = $em->getRepository('ChillPersonBundle:Person')->find($person_id);
if ($person === NULL){
throw $this->createNotFoundException('Person not found');
if ($view === null) {
throw $this->createNotFoundException('Template not found');
}
$this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
return $this->render($view, [
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
'data' => $data,
'activityData' => $request->query->get('activityData', []),
]);
}
public function newAction(Request $request): Response
{
$view = null;
[$person, $accompanyingPeriod] = $this->getEntity($request);
if ($accompanyingPeriod instanceof AccompanyingPeriod) {
$view = 'ChillActivityBundle:Activity:newAccompanyingCourse.html.twig';
} elseif ($person instanceof Person) {
$view = 'ChillActivityBundle:Activity:newPerson.html.twig';
}
$activityType_id = $request->get('activityType_id', 0);
$activityType = $this->activityTypeRepository->find($activityType_id);
if (isset($activityType) && !$activityType->isActive()) {
throw new \InvalidArgumentException('Activity type must be active');
}
$activityData = null;
if ($request->query->has('activityData')) {
$activityData = $request->query->get('activityData');
}
if (!$activityType instanceof \Chill\ActivityBundle\Entity\ActivityType ||
!$activityType->isActive()) {
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
if (null !== $activityData) {
$params['activityData'] = $activityData;
}
return $this->redirectToRoute('chill_activity_activity_select_type', $params);
}
$entity = new Activity();
$entity->setUser($this->get('security.token_storage')->getToken()->getUser());
$entity->setPerson($person);
$entity->setDate(new \DateTime('now'));
$entity->setUser($this->getUser());
$this->denyAccessUnlessGranted('CHILL_ACTIVITY_CREATE', $entity);
$form = $this->createCreateForm($entity, $person);
return $this->render('ChillActivityBundle:Activity:new.html.twig', array(
'person' => $person,
'entity' => $entity,
'form' => $form->createView(),
));
}
/**
* Finds and displays a Activity entity.
*
*/
public function showAction($person_id, $id)
{
$em = $this->getDoctrine()->getManager();
$person = $em->getRepository('ChillPersonBundle:Person')->find($person_id);
if (!$person) {
throw $this->createNotFoundException('person not found');
if ($person instanceof Person) {
$entity->setPerson($person);
}
$this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
if ($accompanyingPeriod instanceof AccompanyingPeriod) {
$entity->setAccompanyingPeriod($accompanyingPeriod);
}
$entity = $em->getRepository('ChillActivityBundle:Activity')->find($id);
$entity->setType($activityType);
$entity->setDate(new \DateTime('now'));
if (!$entity) {
if ($request->query->has('activityData')) {
$activityData = $request->query->get('activityData');
if (array_key_exists('durationTime', $activityData)) {
$durationTimeInMinutes = $activityData['durationTime'];
$hours = floor($durationTimeInMinutes / 60);
$minutes = $durationTimeInMinutes % 60;
$duration = \DateTime::createFromFormat("H:i", $hours.':'.$minutes);
if ($duration) {
$entity->setDurationTime($duration);
}
}
if (array_key_exists('date', $activityData)) {
$date = \DateTime::createFromFormat('Y-m-d', $activityData['date']);
if ($date) {
$entity->setDate($date);
}
}
if (array_key_exists('personsId', $activityData)) {
foreach($activityData['personsId'] as $personId){
$concernedPerson = $this->personRepository->find($personId);
$entity->addPerson($concernedPerson);
}
}
if (array_key_exists('professionalsId', $activityData)) {
foreach($activityData['professionalsId'] as $professionalsId){
$professional = $this->thirdPartyRepository->find($professionalsId);
$entity->addThirdParty($professional);
}
}
if (array_key_exists('location', $activityData)) {
$location = $this->locationRepository->find($activityData['location']);
$entity->setLocation($location);
}
if (array_key_exists('comment', $activityData)) {
$comment = new CommentEmbeddable();
$comment->setComment($activityData['comment']);
$comment->setUserId($this->getUser()->getid());
$comment->setDate(new \DateTime('now'));
$entity->setComment($comment);
}
}
// TODO revoir le Voter de Activity pour tenir compte qu'une activité peut appartenir a une période
// $this->denyAccessUnlessGranted('CHILL_ACTIVITY_CREATE', $entity);
$form = $this->createForm(ActivityType::class, $entity, [
'center' => $entity->getCenter(),
'role' => new Role('CHILL_ACTIVITY_CREATE'),
'activityType' => $entity->getType(),
'accompanyingPeriod' => $accompanyingPeriod,
])->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$this->entityManager->persist($entity);
$this->entityManager->flush();
$this->addFlash('success', $this->get('translator')->trans('Success : activity created!'));
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
$params['id'] = $entity->getId();
return $this->redirectToRoute('chill_activity_activity_show', $params);
}
if ($view === null) {
throw $this->createNotFoundException('Template not found');
}
$activity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']);
return $this->render($view, [
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
'entity' => $entity,
'form' => $form->createView(),
'activity_json' => $activity_array
]);
}
public function showAction(Request $request, $id): Response
{
$view = null;
[$person, $accompanyingPeriod] = $this->getEntity($request);
if ($accompanyingPeriod instanceof AccompanyingPeriod) {
$view = 'ChillActivityBundle:Activity:showAccompanyingCourse.html.twig';
} elseif ($person instanceof Person) {
$view = 'ChillActivityBundle:Activity:showPerson.html.twig';
}
$entity = $this->activityRepository->find($id);
if (null === $entity) {
throw $this->createNotFoundException('Unable to find Activity entity.');
}
$this->denyAccessUnlessGranted('CHILL_ACTIVITY_SEE', $entity);
if (null !== $accompanyingPeriod) {
// @TODO: Properties created dynamically.
$entity->personsAssociated = $entity->getPersonsAssociated();
$entity->personsNotAssociated = $entity->getPersonsNotAssociated();
}
$deleteForm = $this->createDeleteForm($id, $person);
// TODO revoir le Voter de Activity pour tenir compte qu'une activité peut appartenir a une période
// $this->denyAccessUnlessGranted('CHILL_ACTIVITY_SEE', $entity);
$deleteForm = $this->createDeleteForm($entity->getId(), $person, $accompanyingPeriod);
// TODO
/*
$event = new PrivacyEvent($person, array(
'element_class' => Activity::class,
'element_id' => $entity->getId(),
'action' => 'show'
));
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
*/
return $this->render('ChillActivityBundle:Activity:show.html.twig', array(
if ($view === null) {
throw $this->createNotFoundException('Template not found');
}
return $this->render($view, [
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
'entity' => $entity,
'delete_form' => $deleteForm->createView(),
));
]);
}
/**
* Displays a form to edit an existing Activity entity.
*
*/
public function editAction($person_id, $id)
public function editAction($id, Request $request): Response
{
$em = $this->getDoctrine()->getManager();
$person = $em->getRepository('ChillPersonBundle:Person')->find($person_id);
$view = null;
if (!$person) {
throw $this->createNotFoundException('person not found');
[$person, $accompanyingPeriod] = $this->getEntity($request);
if ($accompanyingPeriod instanceof AccompanyingPeriod) {
$view = 'ChillActivityBundle:Activity:editAccompanyingCourse.html.twig';
} elseif ($person instanceof Person) {
$view = 'ChillActivityBundle:Activity:editPerson.html.twig';
}
$this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
$entity = $this->activityRepository->find($id);
$entity = $em->getRepository('ChillActivityBundle:Activity')->find($id);
if (!$entity) {
if (null === $entity) {
throw $this->createNotFoundException('Unable to find Activity entity.');
}
$this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity);
// TODO
// $this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity);
$editForm = $this->createEditForm($entity);
$deleteForm = $this->createDeleteForm($id, $person);
$form = $this->createForm(ActivityType::class, $entity, [
'center' => $entity->getCenter(),
'role' => new Role('CHILL_ACTIVITY_UPDATE'),
'activityType' => $entity->getType(),
'accompanyingPeriod' => $accompanyingPeriod,
])->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$this->entityManager->persist($entity);
$this->entityManager->flush();
$this->addFlash('success', $this->get('translator')->trans('Success : activity updated!'));
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
$params['id'] = $entity->getId();
return $this->redirectToRoute('chill_activity_activity_show', $params);
}
$deleteForm = $this->createDeleteForm($entity->getId(), $person, $accompanyingPeriod);
/*
* TODO
$event = new PrivacyEvent($person, array(
'element_class' => Activity::class,
'element_id' => $entity->getId(),
'action' => 'edit'
));
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
*/
return $this->render('ChillActivityBundle:Activity:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
'person' => $person
));
}
/**
* Creates a form to edit a Activity entity.
*
* @param Activity $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createEditForm(Activity $entity)
{
$form = $this->createForm(ActivityType::class, $entity, array(
'action' => $this->generateUrl('chill_activity_activity_update',
array(
'id' => $entity->getId(),
'person_id' => $entity->getPerson()->getId()
)),
'method' => 'PUT',
'center' => $entity->getCenter(),
'role' => new Role('CHILL_ACTIVITY_UPDATE')
));
return $form;
}
/**
* Edits an existing Activity entity.
*
*/
public function updateAction(Request $request, $person_id, $id)
{
$em = $this->getDoctrine()->getManager();
$person = $em->getRepository('ChillPersonBundle:Person')->find($person_id);
$entity = $em->getRepository('ChillActivityBundle:Activity')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Activity entity.');
if ($view === null) {
throw $this->createNotFoundException('Template not found');
}
$this->denyAccessUnlessGranted('CHILL_ACTIVITY_UPDATE', $entity);
$activity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']);
$deleteForm = $this->createDeleteForm($id, $person);
$editForm = $this->createEditForm($entity);
$editForm->handleRequest($request);
$event = new PrivacyEvent($person, array(
'element_class' => Activity::class,
'element_id' => $entity->getId(),
'action' => 'update'
));
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
if ($editForm->isValid()) {
$em->flush();
$this->get('session')
->getFlashBag()
->add('success',
$this->get('translator')
->trans('Success : activity updated!')
);
return $this->redirect($this->generateUrl('chill_activity_activity_show', array('id' => $id, 'person_id' => $person_id)));
}
$this->get('session')
->getFlashBag()
->add('error',
$this->get('translator')
->trans('This form contains errors')
);
return $this->render('ChillActivityBundle:Activity:edit.html.twig', array(
'person' => $entity->getPerson(),
return $this->render($view, [
'entity' => $entity,
'edit_form' => $editForm->createView(),
'edit_form' => $form->createView(),
'delete_form' => $deleteForm->createView(),
));
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
'activity_json' => $activity_array
]);
}
/**
* Deletes a Activity entity.
*
*/
public function deleteAction(Request $request, $id, $person_id)
public function deleteAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$view = null;
/* @var $activity Activity */
$activity = $em->getRepository('ChillActivityBundle:Activity')
->find($id);
$person = $activity->getPerson();
[$person, $accompanyingPeriod] = $this->getEntity($request);
if ($accompanyingPeriod instanceof AccompanyingPeriod) {
$view = 'ChillActivityBundle:Activity:confirm_deleteAccompanyingCourse.html.twig';
} elseif ($person instanceof Person) {
$view = 'ChillActivityBundle:Activity:confirm_deletePerson.html.twig';
}
$activity = $this->activityRepository->find($id);
if (!$activity) {
throw $this->createNotFoundException('Unable to find Activity entity.');
}
$this->denyAccessUnlessGranted('CHILL_ACTIVITY_DELETE', $activity);
// TODO
// $this->denyAccessUnlessGranted('CHILL_ACTIVITY_DELETE', $activity);
$form = $this->createDeleteForm($id, $person);
$form = $this->createDeleteForm($activity->getId(), $person, $accompanyingPeriod);
if ($request->getMethod() === Request::METHOD_DELETE) {
$form->handleRequest($request);
if ($form->isValid()) {
$this->logger->notice("An activity has been removed", array(
$this->logger->notice("An activity has been removed", [
'by_user' => $this->getUser()->getUsername(),
'activity_id' => $activity->getId(),
'person_id' => $activity->getPerson()->getId(),
'person_id' => $activity->getPerson() ? $activity->getPerson()->getId() : null,
'comment' => $activity->getComment()->getComment(),
'scope_id' => $activity->getScope()->getId(),
'scope_id' => $activity->getScope() ? $activity->getScope()->getId() : null,
'reasons_ids' => $activity->getReasons()
->map(function ($ar) { return $ar->getId(); })
->map(
static fn (ActivityReason $ar): int => $ar->getId()
)
->toArray(),
'type_id' => $activity->getType()->getId(),
'duration' => $activity->getDurationTime()->format('U'),
'duration' => $activity->getDurationTime() ? $activity->getDurationTime()->format('U') : null,
'date' => $activity->getDate()->format('Y-m-d'),
'attendee' => $activity->getAttendee()
));
]);
$em->remove($activity);
$em->flush();
$this->entityManager->remove($activity);
$this->entityManager->flush();
$this->addFlash('success', $this->get('translator')
->trans("The activity has been successfully removed."));
return $this->redirect($this->generateUrl(
'chill_activity_activity_list', array(
'person_id' => $person_id
)));
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
return $this->redirectToRoute('chill_activity_activity_list', $params);
}
}
return $this->render('ChillActivityBundle:Activity:confirm_delete.html.twig', array(
if ($view === null) {
throw $this->createNotFoundException('Template not found');
}
return $this->render($view, [
'activity' => $activity,
'delete_form' => $form->createView()
));
'delete_form' => $form->createView(),
'person' => $person,
'accompanyingCourse' => $accompanyingPeriod,
]);
}
/**
* Creates a form to delete a Activity entity by id.
*
* @param mixed $id The entity id
*
* @return \Symfony\Component\Form\Form The form
*/
private function createDeleteForm($id, $person)
private function createDeleteForm(int $id, ?Person $person, ?AccompanyingPeriod $accompanyingPeriod): FormInterface
{
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
$params['id'] = $id;
return $this->createFormBuilder()
->setAction($this->generateUrl(
'chill_activity_activity_delete',
array('id' => $id, 'person_id' => $person->getId())))
->setAction($this->generateUrl('chill_activity_activity_delete', $params))
->setMethod('DELETE')
->add('submit', SubmitType::class, array('label' => 'Delete'))
->getForm()
;
->add('submit', SubmitType::class, ['label' => 'Delete'])
->getForm();
}
private function getEntity(Request $request): array
{
$person = $accompanyingPeriod = null;
if ($request->query->has('person_id')) {
$person_id = $request->get('person_id');
$person = $this->personRepository->find($person_id);
if ($person === null) {
throw $this->createNotFoundException('Person not found');
}
$this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
} elseif ($request->query->has('accompanying_period_id')) {
$accompanying_period_id = $request->get('accompanying_period_id');
$accompanyingPeriod = $this->accompanyingPeriodRepository->find($accompanying_period_id);
if ($accompanyingPeriod === null) {
throw $this->createNotFoundException('Accompanying Period not found');
}
// TODO Add permission
// $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
} else {
throw $this->createNotFoundException("Person or Accompanying Period not found");
}
return [
$person,
$accompanyingPeriod
];
}
private function buildParamsToUrl(?Person $person, ?AccompanyingPeriod $accompanyingPeriod): array
{
$params = [];
if (null !== $person) {
$params['person_id'] = $person->getId();
}
if (null !== $accompanyingPeriod) {
$params['accompanying_period_id'] = $accompanyingPeriod->getId();
}
return $params;
}
}

View File

@@ -1,178 +0,0 @@
<?php
namespace Chill\ActivityBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Chill\ActivityBundle\Entity\ActivityType;
use Chill\ActivityBundle\Form\ActivityTypeType;
/**
* Class ActivityTypeController
*
* @package Chill\ActivityBundle\Controller
*/
class ActivityTypeController extends AbstractController
{
/**
* Lists all ActivityType entities.
*
*/
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository('ChillActivityBundle:ActivityType')->findAll();
return $this->render('ChillActivityBundle:ActivityType:index.html.twig', array(
'entities' => $entities,
));
}
/**
* Creates a new ActivityType entity.
*
*/
public function createAction(Request $request)
{
$entity = new ActivityType();
$form = $this->createCreateForm($entity);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($entity);
$em->flush();
return $this->redirect($this->generateUrl('chill_activity_activitytype_show', array('id' => $entity->getId())));
}
return $this->render('ChillActivityBundle:ActivityType:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
));
}
/**
* Creates a form to create a ActivityType entity.
*
* @param ActivityType $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createCreateForm(ActivityType $entity)
{
$form = $this->createForm(ActivityTypeType::class, $entity, array(
'action' => $this->generateUrl('chill_activity_activitytype_create'),
'method' => 'POST',
));
$form->add('submit', SubmitType::class, array('label' => 'Create'));
return $form;
}
/**
* Displays a form to create a new ActivityType entity.
*
*/
public function newAction()
{
$entity = new ActivityType();
$form = $this->createCreateForm($entity);
return $this->render('ChillActivityBundle:ActivityType:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView(),
));
}
/**
* Finds and displays a ActivityType entity.
*
*/
public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:ActivityType')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityType entity.');
}
return $this->render('ChillActivityBundle:ActivityType:show.html.twig', array(
'entity' => $entity,
));
}
/**
* Displays a form to edit an existing ActivityType entity.
*
*/
public function editAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:ActivityType')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityType entity.');
}
$editForm = $this->createEditForm($entity);
return $this->render('ChillActivityBundle:ActivityType:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $editForm->createView()
));
}
/**
* Creates a form to edit a ActivityType entity.
*
* @param ActivityType $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createEditForm(ActivityType $entity)
{
$form = $this->createForm(ActivityTypeType::class, $entity, array(
'action' => $this->generateUrl('chill_activity_activitytype_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
$form->add('submit', SubmitType::class, array('label' => 'Update'));
return $form;
}
/**
* Edits an existing ActivityType entity.
*
*/
public function updateAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ChillActivityBundle:ActivityType')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ActivityType entity.');
}
$editForm = $this->createEditForm($entity);
$editForm->handleRequest($request);
if ($editForm->isValid()) {
$em->flush();
return $this->redirect($this->generateUrl('chill_activity_activitytype_edit', array('id' => $id)));
}
return $this->render('ChillActivityBundle:ActivityType:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
));
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace Chill\ActivityBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
use Chill\MainBundle\Pagination\PaginatorInterface;
use Symfony\Component\HttpFoundation\Request;
class AdminActivityPresenceController extends CRUDController
{
/**
* @param string $action
* @param \Doctrine\ORM\QueryBuilder|mixed $query
* @param Request $request
* @param PaginatorInterface $paginator
* @return \Doctrine\ORM\QueryBuilder|mixed
*/
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{
/** @var \Doctrine\ORM\QueryBuilder $query */
return $query->orderBy('e.id', 'ASC');
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace Chill\ActivityBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
use Chill\MainBundle\Pagination\PaginatorInterface;
use Symfony\Component\HttpFoundation\Request;
class AdminActivityTypeCategoryController extends CRUDController
{
/**
* @param string $action
* @param \Doctrine\ORM\QueryBuilder|mixed $query
* @param Request $request
* @param PaginatorInterface $paginator
* @return \Doctrine\ORM\QueryBuilder|mixed
*/
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{
/** @var \Doctrine\ORM\QueryBuilder $query */
return $query->orderBy('e.ordering', 'ASC');
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace Chill\ActivityBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
use Chill\MainBundle\Pagination\PaginatorInterface;
use Symfony\Component\HttpFoundation\Request;
class AdminActivityTypeController extends CRUDController
{
/**
* @param string $action
* @param \Doctrine\ORM\QueryBuilder|mixed $query
* @param Request $request
* @param PaginatorInterface $paginator
* @return \Doctrine\ORM\QueryBuilder|mixed
*/
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{
/** @var \Doctrine\ORM\QueryBuilder $query */
return $query->orderBy('e.ordering', 'ASC');
}
}

View File

@@ -22,8 +22,10 @@
namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\PersonBundle\Entity\Person;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\Persistence\ObjectManager;
use Faker\Factory as FakerFactory;
use Chill\ActivityBundle\Entity\Activity;
@@ -31,14 +33,8 @@ use Chill\MainBundle\DataFixtures\ORM\LoadUsers;
use Chill\ActivityBundle\DataFixtures\ORM\LoadActivityReason;
use Chill\ActivityBundle\DataFixtures\ORM\LoadActivityType;
use Chill\MainBundle\DataFixtures\ORM\LoadScopes;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
/**
* Load reports into DB
*
* @author Champs-Libres Coop
*/
class LoadActivity extends AbstractFixture implements OrderedFixtureInterface, ContainerAwareInterface
class LoadActivity extends AbstractFixture implements OrderedFixtureInterface
{
use \Symfony\Component\DependencyInjection\ContainerAwareTrait;
@@ -46,10 +42,12 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface, C
* @var \Faker\Generator
*/
private $faker;
private EntityManagerInterface $em;
public function __construct()
public function __construct(EntityManagerInterface $em)
{
$this->faker = FakerFactory::create('fr_FR');
$this->em = $em;
}
public function getOrder()
@@ -84,15 +82,10 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface, C
*
* @return \Chill\ActivityBundle\Entity\ActivityReason
*/
private function getRandomActivityReason(array $excludingIds)
private function getRandomActivityReason()
{
$reasonRef = LoadActivityReason::$references[array_rand(LoadActivityReason::$references)];
if (in_array($this->getReference($reasonRef)->getId(), $excludingIds)) {
// we have a reason which should be excluded. Find another...
return $this->getRandomActivityReason($excludingIds);
}
return $this->getReference($reasonRef);
}
@@ -107,7 +100,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface, C
return $this->getReference($userRef);
}
public function newRandomActivity($person)
public function newRandomActivity($person): ?Activity
{
$activity = (new Activity())
->setUser($this->getRandomUser())
@@ -116,14 +109,17 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface, C
->setDurationTime($this->faker->dateTime(36000))
->setType($this->getRandomActivityType())
->setScope($this->getRandomScope())
->setAttendee($this->faker->boolean())
;
$usedId = array();
// ->setAttendee($this->faker->boolean())
for ($i = 0; $i < rand(0, 4); $i++) {
$reason = $this->getRandomActivityReason($usedId);
$usedId[] = $reason->getId();
$activity->addReason($reason);
$reason = $this->getRandomActivityReason();
if (null !== $reason) {
$activity->addReason($reason);
} else {
return null;
}
}
return $activity;
@@ -131,16 +127,18 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface, C
public function load(ObjectManager $manager)
{
$persons = $this->container->get('doctrine.orm.entity_manager')
->getRepository('ChillPersonBundle:Person')
$persons = $this->em
->getRepository(Person::class)
->findAll();
foreach($persons as $person) {
foreach ($persons as $person) {
$activityNbr = rand(0,3);
for($i = 0; $i < $activityNbr; $i ++) {
print "Creating an activity type for : ".$person."\n";
for ($i = 0; $i < $activityNbr; $i ++) {
$activity = $this->newRandomActivity($person);
$manager->persist($activity);
if (null !== $activity) {
$manager->persist($activity);
}
}
}
$manager->flush();

View File

@@ -0,0 +1,39 @@
<?php
namespace Chill\ActivityBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Chill\ActivityBundle\Entity\Activity;
use Chill\MainBundle\DataFixtures\ORM\LoadAbstractNotificationsTrait;
use Chill\ActivityBundle\DataFixtures\ORM\LoadActivity;
/**
* Load notififications into database
*/
class LoadActivityNotifications extends AbstractFixture implements DependentFixtureInterface
{
use LoadAbstractNotificationsTrait;
public $notifs = [
[
'message' => 'Hello !',
'entityClass' => Activity::class,
'entityRef' => 'activity_gerard depardieu',
'sender' => 'center a_social',
'addressees' => [
'center a_social',
'center a_administrative',
'center a_direction',
'multi_center'
],
]
];
public function getDependencies()
{
return [
LoadActivity::class,
];
}
}

View File

@@ -2,27 +2,27 @@
/*
* Chill is a software for social workers
*
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
*
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\ActivityBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Chill\ActivityBundle\Entity\ActivityType;
@@ -32,36 +32,59 @@ use Chill\ActivityBundle\Entity\ActivityType;
*
* @author Champs-Libres Coop
*/
class LoadActivityType extends AbstractFixture implements OrderedFixtureInterface
class LoadActivityType extends Fixture implements OrderedFixtureInterface
{
public function getOrder()
{
return 16100;
}
public static $references = array();
public function load(ObjectManager $manager)
{
$types = [
[ 'name' =>
['fr' => 'Appel téléphonique', 'en' => 'Telephone call', 'nl' => 'Telefoon appel']],
[ 'name' =>
['fr' => 'Entretien', 'en' => 'Interview', 'nl' => 'Vraaggesprek']],
[ 'name' =>
['fr' => 'Inspection', 'en' => 'Inspection', 'nl' => 'Inspectie']]
# Exange
[
'name' =>
['fr' => 'Entretien physique avec l\'usager'],
'category' => 'exchange' ],
[
'name' =>
['fr' => 'Appel téléphonique', 'en' => 'Telephone call', 'nl' => 'Telefoon appel'],
'category' => 'exchange' ],
[
'name' =>
['fr' => 'Courriel', 'en' => 'Email', 'nl' => 'Email'],
'category' => 'exchange' ],
# Meeting
[
'name' =>
['fr' => 'Point technique encadrant'],
'category' => 'meeting' ],
[
'name' =>
['fr' => 'Réunion avec des partenaires'],
'category' => 'meeting' ],
[
'name' =>
['fr' => 'Commission pluridisciplinaire et pluri-institutionnelle'],
'category' => 'meeting' ],
];
foreach ($types as $t) {
print "Creating activity type : " . $t['name']['en'] . "\n";
print "Creating activity type : " . $t['name']['fr'] . " (cat:". $t['category'] . " \n";
$activityType = (new ActivityType())
->setName(($t['name']));
->setName(($t['name']))
->setCategory($this->getReference('activity_type_cat_'.$t['category']))
->setSocialIssuesVisible(1)
->setSocialActionsVisible(1);
$manager->persist($activityType);
$reference = 'activity_type_'.$t['name']['en'];
$reference = 'activity_type_'.$t['name']['fr'];
$this->addReference($reference, $activityType);
static::$references[] = $reference;
}
$manager->flush();
}
}

View File

@@ -0,0 +1,72 @@
<?php
/*
* Chill is a software for social workers
*
* Copyright (C) 2014-2021, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\ActivityBundle\DataFixtures\ORM;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Chill\ActivityBundle\Entity\ActivityTypeCategory;
/**
* Fixtures for ActivityTypeCategory
*
* @author Champs-Libres Coop
*/
class LoadActivityTypeCategory extends Fixture implements OrderedFixtureInterface
{
public static $references = array();
public function getOrder()
{
return 16050;
}
public function load(ObjectManager $manager)
{
$categories = [
[
'name' => ['fr' => 'Échange avec usager', 'en' => 'Exchange with user'],
'ref' => 'exchange',
],
[
'name' => ['fr' => 'Réunion', 'en' => 'Meeting'],
'ref' => 'meeting',
],
];
foreach ($categories as $cat) {
print "Creating activity type category : " . $cat['ref'] . "\n";
$newCat = (new ActivityTypeCategory())
->setName(($cat['name']));
$manager->persist($newCat);
$reference = 'activity_type_cat_'.$cat['ref'];
$this->addReference($reference, $newCat);
static::$references[] = $reference;
}
$manager->flush();
}
}

View File

@@ -3,7 +3,7 @@
/*
* Chill is a software for social workers
*
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
@@ -44,7 +44,7 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$container->setParameter('chill_activity.form.time_duration', $config['form']['time_duration']);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../config'));
@@ -52,22 +52,23 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf
$loader->load('services/export.yaml');
$loader->load('services/repositories.yaml');
$loader->load('services/fixtures.yaml');
$loader->load('services/menu.yaml');
$loader->load('services/controller.yaml');
$loader->load('services/form.yaml');
$loader->load('services/templating.yaml');
$loader->load('services/accompanyingPeriodConsistency.yaml');
}
public function prepend(ContainerBuilder $container)
{
$this->prependRoutes($container);
$this->prependAuthorization($container);
$this->prependCruds($container);
}
/* (non-PHPdoc)
* @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend()
*/
public function prependRoutes(ContainerBuilder $container)
public function prependRoutes(ContainerBuilder $container)
{
//add routes for custom bundle
$container->prependExtensionConfig('chill_main', array(
@@ -78,7 +79,7 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf
)
));
}
public function prependAuthorization(ContainerBuilder $container)
{
$container->prependExtensionConfig('security', array(
@@ -86,8 +87,81 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf
ActivityVoter::UPDATE => array(ActivityVoter::SEE_DETAILS),
ActivityVoter::CREATE => array(ActivityVoter::SEE_DETAILS),
ActivityVoter::DELETE => array(ActivityVoter::SEE_DETAILS),
ActivityVoter::SEE_DETAILS => array(ActivityVoter::SEE)
ActivityVoter::SEE_DETAILS => array(ActivityVoter::SEE),
ActivityVoter::FULL => [ActivityVoter::CREATE, ActivityVoter::DELETE,
ActivityVoter::UPDATE],
)
));
}
protected function prependCruds(ContainerBuilder $container)
{
$container->prependExtensionConfig('chill_main', [
'cruds' => [
[
'class' => \Chill\ActivityBundle\Entity\ActivityType::class,
'name' => 'activity_type',
'base_path' => '/admin/activity/type',
'form_class' => \Chill\ActivityBundle\Form\ActivityTypeType::class,
'controller' => \Chill\ActivityBundle\Controller\AdminActivityTypeController::class,
'actions' => [
'index' => [
'template' => '@ChillActivity/ActivityType/index.html.twig',
'role' => 'ROLE_ADMIN'
],
'new' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillActivity/ActivityType/new.html.twig',
],
'edit' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillActivity/ActivityType/edit.html.twig',
]
]
],
[
'class' => \Chill\ActivityBundle\Entity\ActivityTypeCategory::class,
'name' => 'activity_type_category',
'base_path' => '/admin/activity/type_category',
'form_class' => \Chill\ActivityBundle\Form\ActivityTypeCategoryType::class,
'controller' => \Chill\ActivityBundle\Controller\AdminActivityTypeCategoryController::class,
'actions' => [
'index' => [
'template' => '@ChillActivity/ActivityTypeCategory/index.html.twig',
'role' => 'ROLE_ADMIN'
],
'new' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillActivity/ActivityTypeCategory/new.html.twig',
],
'edit' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillActivity/ActivityTypeCategory/edit.html.twig',
]
]
],
[
'class' => \Chill\ActivityBundle\Entity\ActivityPresence::class,
'name' => 'activity_presence',
'base_path' => '/admin/activity/presence',
'form_class' => \Chill\ActivityBundle\Form\ActivityPresenceType::class,
'controller' => \Chill\ActivityBundle\Controller\AdminActivityPresenceController::class,
'actions' => [
'index' => [
'template' => '@ChillActivity/ActivityPresence/index.html.twig',
'role' => 'ROLE_ADMIN'
],
'new' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillActivity/ActivityPresence/new.html.twig',
],
'edit' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillActivity/ActivityPresence/edit.html.twig',
]
]
],
]
]);
}
}

View File

@@ -1,351 +1,565 @@
<?php
/*
*
* Copyright (C) 2015, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\ActivityBundle\Entity;
use Chill\DocStoreBundle\Entity\Document;
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
use Chill\MainBundle\Entity\Location;
use Chill\PersonBundle\AccompanyingPeriod\SocialIssueConsistency\AccompanyingPeriodLinkedWithSocialIssuesEntityInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
use Chill\ThirdPartyBundle\Entity\ThirdParty;
use Doctrine\ORM\Mapping as ORM;
use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\Center;
use Chill\ActivityBundle\Entity\ActivityReason;
use Chill\ActivityBundle\Entity\ActivityType;
use Chill\PersonBundle\Entity\Person;
use Chill\MainBundle\Entity\HasCenterInterface;
use Chill\MainBundle\Entity\HasScopeInterface;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ArrayCollection;
use Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
/**
* Class Activity
*
* @package Chill\ActivityBundle\Entity
* @ORM\Entity()
* @ORM\Entity(repositoryClass="Chill\ActivityBundle\Repository\ActivityRepository")
* @ORM\Table(name="activity")
* @ORM\HasLifecycleCallbacks()
* @DiscriminatorMap(typeProperty="type", mapping={
* "activity"=Activity::class
* })
*/
/*
* TODO : revoir
* @UserCircleConsistency(
* "CHILL_ACTIVITY_SEE_DETAILS",
* getUserFunction="getUser",
* path="scope")
*/
class Activity implements HasCenterInterface, HasScopeInterface
class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPeriodLinkedWithSocialIssuesEntityInterface
{
const SENTRECEIVED_SENT = 'sent';
const SENTRECEIVED_RECEIVED = 'received';
/**
* @var integer
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
* @Groups({"read"})
*/
private $id;
private ?int $id = null;
/**
* @var User
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
*/
private $user;
private User $user;
/**
* @var \DateTime
* @ORM\Column(type="datetime")
*/
private $date;
private \DateTime $date;
/**
* @var \DateTime
* @ORM\Column(type="time")
* @ORM\Column(type="time", nullable=true)
*/
private $durationTime;
private ?\DateTime $durationTime = null;
/**
* @var boolean
* @ORM\Column(type="boolean")
* @ORM\Column(type="time", nullable=true)
*/
private $attendee;
private ?\DateTime $travelTime = null;
/**
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityPresence")
*/
private ?ActivityPresence $attendee = null;
/**
* @var ActivityReason
* @ORM\ManyToMany(targetEntity="Chill\ActivityBundle\Entity\ActivityReason")
*/
private $reasons;
private Collection $reasons;
/**
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialIssue")
* @ORM\JoinTable(name="chill_activity_activity_chill_person_socialissue")
* @Groups({"read"})
*/
private Collection $socialIssues;
/**
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\SocialWork\SocialAction")
* @ORM\JoinTable(name="chill_activity_activity_chill_person_socialaction")
* @Groups({"read"})
*/
private Collection $socialActions;
/**
* @var ActivityType
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityType")
*/
private $type;
private ActivityType $type;
/**
* @var Scope
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Scope")
*/
private $scope;
private ?Scope $scope = null;
/**
* @var Person
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person")
*/
private $person;
private ?Person $person = null;
/**
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod")
* @Groups({"read"})
*/
private ?AccompanyingPeriod $accompanyingPeriod = null;
/**
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\CommentEmbeddable", columnPrefix="comment_")
*/
private $comment;
private CommentEmbeddable $comment;
/**
* Activity constructor.
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\Person")
* @Groups({"read"})
*/
private ?Collection $persons = null;
/**
* @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty")
* @Groups({"read"})
*/
private ?Collection $thirdParties = null;
/**
* @ORM\ManyToMany(targetEntity="Chill\DocStoreBundle\Entity\StoredObject", cascade={"persist"})
*/
private Collection $documents;
/**
* @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\User")
* @Groups({"read"})
*/
private ?Collection $users = null;
/**
* @ORM\Column(type="boolean", options={"default"=false})
*/
private bool $emergency = false;
/**
* @ORM\Column(type="string", options={"default"=""})
*/
private string $sentReceived = '';
/**
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Location")
* @groups({"read"})
*/
private ?Location $location = null;
public function __construct()
{
$this->reasons = new ArrayCollection();
$this->comment = new CommentEmbeddable();
$this->persons = new ArrayCollection();
$this->thirdParties = new ArrayCollection();
$this->documents = new ArrayCollection();
$this->users = new ArrayCollection();
$this->socialIssues = new ArrayCollection();
$this->socialActions = new ArrayCollection();
}
/**
* Get id
*
* @return integer
*/
public function getId()
public function getId(): ?int
{
return $this->id;
}
/**
* Set user
*
* @param User $user
* @return Activity
*/
public function setUser(User $user)
public function setUser(UserInterface $user): self
{
$this->user = $user;
return $this;
}
/**
* Get user
*
* @return User
*/
public function getUser()
public function getUser(): User
{
return $this->user;
}
/**
* Set date
*
* @param \DateTime $date
* @return Activity
*/
public function setDate($date)
public function setDate(\DateTime $date): self
{
$this->date = $date;
return $this;
}
/**
* Get date
*
* @return \DateTime
*/
public function getDate()
public function getDate(): \DateTime
{
return $this->date;
}
/**
* Set durationTime
*
* @param \DateTime $durationTime
* @return Activity
*/
public function setDurationTime($durationTime)
public function setDurationTime(?\DateTime $durationTime): self
{
$this->durationTime = $durationTime;
return $this;
}
/**
* Get durationTime
*
* @return \DateTime
*/
public function getDurationTime()
public function getDurationTime(): ?\DateTime
{
return $this->durationTime;
}
/**
* Set attendee
*
* @param boolean $attendee
* @return Activity
*/
public function setAttendee($attendee)
public function setTravelTime(\DateTime $travelTime): self
{
$this->travelTime = $travelTime;
return $this;
}
public function getTravelTime(): ?\DateTime
{
return $this->travelTime;
}
public function setAttendee(ActivityPresence $attendee): self
{
$this->attendee = $attendee;
return $this;
}
/**
* Get attendee
*
* @return boolean
*/
public function getAttendee()
public function getAttendee(): ?ActivityPresence
{
return $this->attendee;
}
/**
* Add a reason
*
* @param ActivityReason $reason
* @return Activity
*/
public function addReason(ActivityReason $reason)
public function addReason(ActivityReason $reason): self
{
$this->reasons[] = $reason;
$this->reasons->add($reason);
return $this;
}
/**
* @param ActivityReason $reason
*/
public function removeReason(ActivityReason $reason)
public function removeReason(ActivityReason $reason): void
{
$this->reasons->removeElement($reason);
}
/**
* Get reasons
*
* @return Collection
*/
public function getReasons()
public function getReasons(): Collection
{
return $this->reasons;
}
/**
* Set type
*
* @param ActivityType $type
* @return Activity
*/
public function setType(ActivityType $type)
public function setReasons(?ArrayCollection $reasons): self
{
$this->reasons = $reasons;
return $this;
}
public function getSocialIssues(): Collection
{
return $this->socialIssues;
}
public function addSocialIssue(SocialIssue $socialIssue): self
{
if (!$this->socialIssues->contains($socialIssue)) {
$this->socialIssues[] = $socialIssue;
}
return $this;
}
public function removeSocialIssue(SocialIssue $socialIssue): self
{
$this->socialIssues->removeElement($socialIssue);
return $this;
}
public function getSocialActions(): Collection
{
return $this->socialActions;
}
public function addSocialAction(SocialAction $socialAction): self
{
if (!$this->socialActions->contains($socialAction)) {
$this->socialActions[] = $socialAction;
}
return $this;
}
public function removeSocialAction(SocialAction $socialAction): self
{
$this->socialActions->removeElement($socialAction);
return $this;
}
public function setType(ActivityType $type): self
{
$this->type = $type;
return $this;
}
/**
* Get type
*
* @return ActivityType
*/
public function getType()
public function getType(): ActivityType
{
return $this->type;
}
/**
* Set scope
*
* @param Scope $scope
* @return Activity
*/
public function setScope(Scope $scope)
public function setScope(Scope $scope): self
{
$this->scope = $scope;
return $this;
}
/**
* Get scope
*
* @return Scope
*/
public function getScope()
public function getScope(): ?Scope
{
return $this->scope;
}
/**
* Set person
*
* @param Person $person
* @return Activity
*/
public function setPerson(Person $person)
public function setPerson(?Person $person): self
{
$this->person = $person;
return $this;
}
/**
* Get person
*
* @return Person
*/
public function getPerson()
public function getPerson(): ?Person
{
return $this->person;
}
public function getAccompanyingPeriod(): ?AccompanyingPeriod
{
return $this->accompanyingPeriod;
}
public function setAccompanyingPeriod(?AccompanyingPeriod $accompanyingPeriod): self
{
$this->accompanyingPeriod = $accompanyingPeriod;
return $this;
}
/**
* get the center
* center is extracted from person
*
* @return Center
*/
public function getCenter()
public function getCenter(): ?Center
{
return $this->person->getCenter();
if ($this->person instanceof Person) {
return $this->person->getCenter();
}
return null;
}
/**
* @return \Chill\MainBundle\Entity\Embeddalbe\CommentEmbeddable
*/
public function getComment()
public function getComment(): CommentEmbeddable
{
return $this->comment;
}
/**
* @param \Chill\MainBundle\Entity\Embeddalbe\CommentEmbeddable $comment
*/
public function setComment($comment)
public function setComment(CommentEmbeddable $comment): self
{
$this->comment = $comment;
return $this;
}
/**
* Add a person to the person list
*/
public function addPerson(?Person $person): self
{
if (null !== $person) {
$this->persons[] = $person;
}
return $this;
}
public function removePerson(Person $person): void
{
$this->persons->removeElement($person);
}
public function getPersons(): Collection
{
return $this->persons;
}
public function getPersonsAssociated(): array
{
if (null !== $this->accompanyingPeriod) {
$personsAssociated = [];
foreach ($this->accompanyingPeriod->getParticipations() as $participation) {
if ($this->persons->contains($participation->getPerson())) {
$personsAssociated[] = $participation->getPerson();
}
}
return $personsAssociated;
}
return [];
}
public function getPersonsNotAssociated(): array
{
if (null !== $this->accompanyingPeriod) {
$personsNotAssociated = [];
foreach ($this->persons as $person) {
if (!in_array($person, $this->getPersonsAssociated())) {
$personsNotAssociated[] = $person;
}
}
return $personsNotAssociated;
}
return [];
}
public function setPersons(?Collection $persons): self
{
$this->persons = $persons;
return $this;
}
public function addThirdParty(?ThirdParty $thirdParty): self
{
if (null !== $thirdParty) {
$this->thirdParties[] = $thirdParty;
}
return $this;
}
public function removeThirdParty(ThirdParty $thirdParty): void
{
$this->thirdParties->removeElement($thirdParty);
}
public function getThirdParties(): Collection
{
return $this->thirdParties;
}
public function setThirdParties(?Collection $thirdParties): self
{
$this->thirdParties = $thirdParties;
return $this;
}
public function addDocument(Document $document): self
{
$this->documents[] = $document;
return $this;
}
public function removeDocument(Document $document): void
{
$this->documents->removeElement($document);
}
public function getDocuments(): Collection
{
return $this->documents;
}
public function setDocuments(Collection $documents): self
{
$this->documents = $documents;
return $this;
}
public function addUser(?User $user): self
{
if (null !== $user) {
$this->users[] = $user;
}
return $this;
}
public function removeUser(User $user): void
{
$this->users->removeElement($user);
}
public function getUsers(): Collection
{
return $this->users;
}
public function setUsers(?Collection $users): self
{
$this->users = $users;
return $this;
}
public function isEmergency(): bool
{
return $this->getEmergency();
}
public function getEmergency(): bool
{
return $this->emergency;
}
public function setEmergency(bool $emergency): self
{
$this->emergency = $emergency;
return $this;
}
public function getSentReceived(): string
{
return $this->sentReceived;
}
public function setSentReceived(?string $sentReceived): self
{
$this->sentReceived = (string) $sentReceived;
return $this;
}
/**
* @return Location|null
*/
public function getLocation(): ?Location
{
return $this->location;
}
/**
* @param Location|null $location
* @return Activity
*/
public function setLocation(?Location $location): Activity
{
$this->location = $location;
return $this;
}
}

View File

@@ -0,0 +1,97 @@
<?php
/*
*
* Copyright (C) 2015, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\ActivityBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Class ActivityPresence
*
* @package Chill\ActivityBundle\Entity
* @ORM\Entity()
* @ORM\Table(name="activitytpresence")
* @ORM\HasLifecycleCallbacks()
*/
class ActivityPresence
{
/**
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private ?int $id;
/**
* @ORM\Column(type="json")
*/
private array $name = [];
/**
* @ORM\Column(type="boolean")
*/
private bool $active = true;
public function getId(): int
{
return $this->id;
}
public function setName(array $name): self
{
$this->name = $name;
return $this;
}
public function getName(): array
{
return $this->name;
}
/**
* Get active
* return true if the category type is active.
*/
public function getActive(): bool
{
return $this->active;
}
/**
* Is active
* return true if the category type is active
*/
public function isActive(): bool
{
return $this->getActive();
}
/**
* Set active
* set to true if the category type is active
*/
public function setActive(bool $active): self
{
$this->active = $active;
return $this;
}
}

View File

@@ -1,19 +1,19 @@
<?php
/*
*
*
* Copyright (C) 2015, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -44,7 +44,7 @@ class ActivityReason
/**
* @var array
* @ORM\Column(type="json_array")
* @ORM\Column(type="json")
*/
private $name;
@@ -108,7 +108,7 @@ class ActivityReason
return $this->name;
}
}
/**
* Set category of the reason. If you set to the reason an inactive
* category, the reason will become inactive
@@ -121,7 +121,7 @@ class ActivityReason
if($this->category !== $category && ! $category->getActive()) {
$this->setActive(False);
}
$this->category = $category;
return $this;

View File

@@ -2,17 +2,17 @@
/*
* Copyright (C) 2015, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -43,7 +43,7 @@ class ActivityReasonCategory
/**
* @var string
* @ORM\Column(type="json_array")
* @ORM\Column(type="json")
*/
private $name;
@@ -52,7 +52,7 @@ class ActivityReasonCategory
* @ORM\Column(type="boolean")
*/
private $active = true;
/**
* Array of ActivityReason
* @var ArrayCollection
@@ -61,7 +61,7 @@ class ActivityReasonCategory
* mappedBy="category")
*/
private $reasons;
/**
* ActivityReasonCategory constructor.
*/
@@ -69,7 +69,7 @@ class ActivityReasonCategory
{
$this->reasons = new ArrayCollection();
}
/**
* @return string
*/
@@ -139,9 +139,9 @@ class ActivityReasonCategory
$reason->setActive($active);
}
}
$this->active = $active;
return $this;
}

View File

@@ -1,19 +1,19 @@
<?php
/*
*
*
* Copyright (C) 2015, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -32,45 +32,249 @@ use Doctrine\ORM\Mapping as ORM;
*/
class ActivityType
{
const FIELD_INVISIBLE = 0;
const FIELD_OPTIONAL = 1;
const FIELD_REQUIRED = 2;
/**
* @var integer
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
private ?int $id;
/**
* @var array
* @ORM\Column(type="json_array")
* @ORM\Column(type="json")
*/
private $name;
private array $name = [];
/**
* @var bool
* @ORM\Column(type="boolean")
*/
private $active = true;
private bool $active = true;
/**
* @ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityTypeCategory")
*/
private ?ActivityTypeCategory $category = null;
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=2})
*/
private int $personVisible = self::FIELD_REQUIRED;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $personLabel = '';
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=2})
*/
private int $userVisible = self::FIELD_REQUIRED;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $userLabel = '';
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=2})
*/
private int $dateVisible = self::FIELD_REQUIRED;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $dateLabel = '';
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
*/
private int $placeVisible = self::FIELD_OPTIONAL;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $placeLabel = '';
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
*/
private int $personsVisible = self::FIELD_OPTIONAL;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $personsLabel = '';
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
*/
private int $thirdPartiesVisible = self::FIELD_INVISIBLE;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $thirdPartiesLabel = '';
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
*/
private int $durationTimeVisible = self::FIELD_OPTIONAL;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $durationTimeLabel = '';
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
*/
private int $travelTimeVisible = self::FIELD_OPTIONAL;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $travelTimeLabel = '';
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
*/
private int $attendeeVisible = self::FIELD_OPTIONAL;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $attendeeLabel = '';
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
*/
private int $reasonsVisible = self::FIELD_OPTIONAL;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $reasonsLabel = '';
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
*/
private int $commentVisible = self::FIELD_OPTIONAL;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $commentLabel = '';
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
*/
private int $sentReceivedVisible = self::FIELD_OPTIONAL;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $sentReceivedLabel = '';
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
*/
private int $documentsVisible = self::FIELD_OPTIONAL;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $documentsLabel = '';
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
*/
private int $usersVisible = self::FIELD_OPTIONAL;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $usersLabel = '';
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
*/
private int $emergencyVisible = self::FIELD_INVISIBLE;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $emergencyLabel = '';
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
*/
private int $accompanyingPeriodVisible = self::FIELD_INVISIBLE;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $accompanyingPeriodLabel = '';
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
*/
private int $socialDataVisible = self::FIELD_INVISIBLE;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $socialDataLabel = '';
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
*/
private int $socialIssuesVisible = self::FIELD_INVISIBLE;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $socialIssuesLabel = '';
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
*/
private int $socialActionsVisible = self::FIELD_INVISIBLE;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $socialActionsLabel = '';
/**
* @ORM\Column(type="smallint", nullable=false, options={"default"=1})
*/
private int $locationVisible = self::FIELD_INVISIBLE;
/**
* @ORM\Column(type="string", nullable=false, options={"default"=""})
*/
private string $locationLabel = '';
/**
* @ORM\Column(type="float", options={"default"="0.0"})
*/
private float $ordering = 0.0;
/**
* Get id
*
* @return integer
*/
public function getId()
public function getId(): int
{
return $this->id;
}
/**
* Set name
*
* @param array $name
* @return ActivityType
*/
public function setName($name)
public function setName(array $name): self
{
$this->name = $name;
@@ -79,58 +283,576 @@ class ActivityType
/**
* Get name
*
* @return array | string
*/
public function getName($locale = null)
public function getName(): array
{
if ($locale) {
if (isset($this->name[$locale])) {
return $this->name[$locale];
} else {
foreach ($this->name as $name) {
if (!empty($name)) {
return $name;
}
}
}
return '';
} else {
return $this->name;
}
return $this->name;
}
/**
* Get active
* return true if the type is active.
*
* @return boolean
*/
public function getActive() {
public function getActive(): bool
{
return $this->active;
}
/**
* Is active
* return true if the type is active
*
* @return boolean
*/
public function isActive() {
public function isActive(): bool
{
return $this->getActive();
}
/**
* Set active
* set to true if the type is active
*
* @param boolean $active
* @return ActivityType
*/
public function setActive($active) {
public function setActive(bool $active): self
{
$this->active = $active;
return $this;
}
public function getCategory(): ?ActivityTypeCategory
{
return $this->category;
}
public function setCategory(?ActivityTypeCategory $category): self
{
$this->category = $category;
return $this;
}
public function getPersonVisible(): int
{
return $this->personVisible;
}
public function setPersonVisible(int $personVisible): self
{
$this->personVisible = $personVisible;
return $this;
}
public function getPersonLabel(): string
{
return $this->personLabel;
}
public function setPersonLabel(string $personLabel): self
{
$this->personLabel = $personLabel;
return $this;
}
public function getUserVisible(): int
{
return $this->userVisible;
}
public function setUserVisible(int $userVisible): self
{
$this->userVisible = $userVisible;
return $this;
}
public function getUserLabel(): string
{
return $this->userLabel;
}
public function setUserLabel(string $userLabel): self
{
$this->userLabel = $userLabel;
return $this;
}
public function getDateVisible(): int
{
return $this->dateVisible;
}
public function setDateVisible(int $dateVisible): self
{
$this->dateVisible = $dateVisible;
return $this;
}
public function getDateLabel(): string
{
return $this->dateLabel;
}
public function setDateLabel(string $dateLabel): self
{
$this->dateLabel = $dateLabel;
return $this;
}
public function getPlaceVisible(): int
{
return $this->placeVisible;
}
public function setPlaceVisible(int $placeVisible): self
{
$this->placeVisible = $placeVisible;
return $this;
}
public function getPlaceLabel(): string
{
return $this->placeLabel;
}
public function setPlaceLabel(string $placeLabel): self
{
$this->placeLabel = $placeLabel;
return $this;
}
public function getPersonsVisible(): int
{
return $this->personsVisible;
}
public function setPersonsVisible(int $personsVisible): self
{
$this->personsVisible = $personsVisible;
return $this;
}
public function getPersonsLabel(): string
{
return $this->personsLabel;
}
public function setPersonsLabel(string $personsLabel): self
{
$this->personsLabel = $personsLabel;
return $this;
}
public function getThirdPartiesVisible(): int
{
return $this->thirdPartiesVisible;
}
public function setThirdPartiesVisible(int $thirdPartiesVisible): self
{
$this->thirdPartiesVisible = $thirdPartiesVisible;
return $this;
}
public function getThirdPartiesLabel(): string
{
return $this->thirdPartiesLabel;
}
public function setThirdPartiesLabel(string $thirdPartiesLabel): self
{
$this->thirdPartiesLabel = $thirdPartiesLabel;
return $this;
}
public function getDurationTimeVisible(): int
{
return $this->durationTimeVisible;
}
public function setDurationTimeVisible(int $durationTimeVisible): self
{
$this->durationTimeVisible = $durationTimeVisible;
return $this;
}
public function getDurationTimeLabel(): string
{
return $this->durationTimeLabel;
}
public function setDurationTimeLabel(string $durationTimeLabel): self
{
$this->durationTimeLabel = $durationTimeLabel;
return $this;
}
public function getTravelTimeVisible(): int
{
return $this->travelTimeVisible;
}
public function setTravelTimeVisible(int $TravelTimeVisible): self
{
$this->travelTimeVisible = $TravelTimeVisible;
return $this;
}
public function getTravelTimeLabel(): string
{
return $this->travelTimeLabel;
}
public function setTravelTimeLabel(string $TravelTimeLabel): self
{
$this->travelTimeLabel = $TravelTimeLabel;
return $this;
}
public function getAttendeeVisible(): int
{
return $this->attendeeVisible;
}
public function setAttendeeVisible(int $attendeeVisible): self
{
$this->attendeeVisible = $attendeeVisible;
return $this;
}
public function getAttendeeLabel(): string
{
return $this->attendeeLabel;
}
public function setAttendeeLabel(string $attendeeLabel): self
{
$this->attendeeLabel = $attendeeLabel;
return $this;
}
public function getReasonsVisible(): int
{
return $this->reasonsVisible;
}
public function setReasonsVisible(int $reasonsVisible): self
{
$this->reasonsVisible = $reasonsVisible;
return $this;
}
public function getReasonsLabel(): string
{
return $this->reasonsLabel;
}
public function setReasonsLabel(string $reasonsLabel): self
{
$this->reasonsLabel = $reasonsLabel;
return $this;
}
public function getCommentVisible(): int
{
return $this->commentVisible;
}
public function setCommentVisible(int $commentVisible): self
{
$this->commentVisible = $commentVisible;
return $this;
}
public function getCommentLabel(): string
{
return $this->commentLabel;
}
public function setCommentLabel(string $commentLabel): self
{
$this->commentLabel = $commentLabel;
return $this;
}
public function getSentReceivedVisible(): int
{
return $this->sentReceivedVisible;
}
public function setSentReceivedVisible(int $sentReceivedVisible): self
{
$this->sentReceivedVisible = $sentReceivedVisible;
return $this;
}
public function getSentReceivedLabel(): string
{
return $this->sentReceivedLabel;
}
public function setSentReceivedLabel(string $sentReceivedLabel): self
{
$this->sentReceivedLabel = $sentReceivedLabel;
return $this;
}
public function getDocumentsVisible(): int
{
return $this->documentsVisible;
}
public function setDocumentsVisible(int $documentsVisible): self
{
$this->documentsVisible = $documentsVisible;
return $this;
}
public function getDocumentsLabel(): string
{
return $this->documentsLabel;
}
public function setDocumentsLabel(string $documentsLabel): self
{
$this->documentsLabel = $documentsLabel;
return $this;
}
public function getUsersVisible(): int
{
return $this->usersVisible;
}
public function setUsersVisible(int $usersVisible): self
{
$this->usersVisible = $usersVisible;
return $this;
}
public function getUsersLabel(): string
{
return $this->usersLabel;
}
public function setUsersLabel(string $usersLabel): self
{
$this->usersLabel = $usersLabel;
return $this;
}
public function getEmergencyVisible(): int
{
return $this->emergencyVisible;
}
public function setEmergencyVisible(int $emergencyVisible): self
{
$this->emergencyVisible = $emergencyVisible;
return $this;
}
public function getEmergencyLabel(): string
{
return $this->emergencyLabel;
}
public function setEmergencyLabel(string $emergencyLabel): self
{
$this->emergencyLabel = $emergencyLabel;
return $this;
}
public function getAccompanyingPeriodVisible(): int
{
return $this->accompanyingPeriodVisible;
}
public function setAccompanyingPeriodVisible(int $accompanyingPeriodVisible): self
{
$this->accompanyingPeriodVisible = $accompanyingPeriodVisible;
return $this;
}
public function getAccompanyingPeriodLabel(): string
{
return $this->accompanyingPeriodLabel;
}
public function setAccompanyingPeriodLabel(string $accompanyingPeriodLabel): self
{
$this->accompanyingPeriodLabel = $accompanyingPeriodLabel;
return $this;
}
public function getSocialDataVisible(): int
{
return $this->socialDataVisible;
}
public function setSocialDataVisible(int $socialDataVisible): self
{
$this->socialDataVisible = $socialDataVisible;
return $this;
}
public function getSocialDataLabel(): string
{
return $this->socialDataLabel;
}
public function setSocialDataLabel(string $socialDataLabel): self
{
$this->socialDataLabel = $socialDataLabel;
return $this;
}
public function isVisible(string $field): bool
{
$property = $field.'Visible';
if (!property_exists($this, $property)) {
throw new \InvalidArgumentException('Field "'.$field.'" not found');
}
return self::FIELD_INVISIBLE !== $this->$property;
}
public function isRequired(string $field): bool
{
$property = $field.'Visible';
if (!property_exists($this, $property)) {
throw new \InvalidArgumentException('Field "'.$field.'" not found');
}
return self::FIELD_REQUIRED === $this->$property;
}
public function getLabel(string $field): ?string
{
$property = $field.'Label';
if (!property_exists($this, $property)) {
throw new \InvalidArgumentException('Field "'.$field.'" not found');
}
return $this->$property;
}
public function getOrdering(): float
{
return $this->ordering;
}
public function setOrdering(float $ordering): self
{
$this->ordering = $ordering;
return $this;
}
public function getSocialIssuesVisible(): ?int
{
return $this->socialIssuesVisible;
}
public function setSocialIssuesVisible(int $socialIssuesVisible): self
{
$this->socialIssuesVisible = $socialIssuesVisible;
return $this;
}
public function getSocialIssuesLabel(): ?string
{
return $this->socialIssuesLabel;
}
public function setSocialIssuesLabel(string $socialIssuesLabel): self
{
$this->socialIssuesLabel = $socialIssuesLabel;
return $this;
}
public function getSocialActionsVisible(): ?int
{
return $this->socialActionsVisible;
}
public function setSocialActionsVisible(int $socialActionsVisible): self
{
$this->socialActionsVisible = $socialActionsVisible;
return $this;
}
public function getSocialActionsLabel(): ?string
{
return $this->socialActionsLabel;
}
public function setSocialActionsLabel(string $socialActionsLabel): self
{
$this->socialActionsLabel = $socialActionsLabel;
return $this;
}
public function getLocationVisible(): ?int
{
return $this->locationVisible;
}
public function setLocationVisible(int $locationVisible): self
{
$this->locationVisible = $locationVisible;
return $this;
}
public function getLocationLabel(): ?string
{
return $this->locationLabel;
}
public function setLocationLabel(string $locationLabel): self
{
$this->locationLabel = $locationLabel;
return $this;
}
}

View File

@@ -0,0 +1,101 @@
<?php
declare(strict_types=1);
namespace Chill\ActivityBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity()
* @ORM\Table(name="activitytypecategory")
* @ORM\HasLifecycleCallbacks()
*/
class ActivityTypeCategory
{
/**
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private ?int $id = null;
/**
* @ORM\Column(type="json")
*/
private array $name = [];
/**
* @ORM\Column(type="boolean")
*/
private bool $active = true;
/**
* @ORM\Column(type="float", options={"default"="0.0"})
*/
private float $ordering = 0.0;
public function getId(): ?int
{
return $this->id;
}
/**
* Set name
*/
public function setName(array $name): self
{
$this->name = $name;
return $this;
}
/**
* Get name
*/
public function getName(): array
{
return $this->name;
}
/**
* Get active
* return true if the category type is active.
*/
public function getActive(): bool
{
return $this->active;
}
/**
* Is active
* return true if the category type is active
*/
public function isActive(): bool
{
return $this->getActive();
}
/**
* Set active
* set to true if the category type is active
*/
public function setActive(bool $active): self
{
$this->active = $active;
return $this;
}
public function getOrdering(): float
{
return $this->ordering;
}
public function setOrdering(float $ordering): self
{
$this->ordering = $ordering;
return $this;
}
}

View File

@@ -1,70 +1,39 @@
<?php
/*
* Copyright (C) 2016 Champs-Libres <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Aggregator;
use Chill\ActivityBundle\Repository\ActivityReasonCategoryRepository;
use Chill\ActivityBundle\Repository\ActivityReasonRepository;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\QueryBuilder;
use Chill\MainBundle\Export\AggregatorInterface;
use Symfony\Component\Security\Core\Role\Role;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Doctrine\ORM\EntityRepository;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Doctrine\ORM\Query\Expr\Join;
use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class ActivityReasonAggregator implements AggregatorInterface,
ExportElementValidatedInterface
class ActivityReasonAggregator implements AggregatorInterface, ExportElementValidatedInterface
{
/**
*
* @var EntityRepository
*/
protected $categoryRepository;
protected ActivityReasonCategoryRepository $activityReasonCategoryRepository;
/**
*
* @var EntityRepository
*/
protected $reasonRepository;
protected ActivityReasonRepository $activityReasonRepository;
/**
*
* @var TranslatableStringHelper
*/
protected $stringHelper;
protected TranslatableStringHelperInterface $translatableStringHelper;
public function __construct(
EntityRepository $categoryRepository,
EntityRepository $reasonRepository,
TranslatableStringHelper $stringHelper
ActivityReasonCategoryRepository $activityReasonCategoryRepository,
ActivityReasonRepository $activityReasonRepository,
TranslatableStringHelper $translatableStringHelper
) {
$this->categoryRepository = $categoryRepository;
$this->reasonRepository = $reasonRepository;
$this->stringHelper = $stringHelper;
$this->activityReasonCategoryRepository = $activityReasonCategoryRepository;
$this->activityReasonRepository = $activityReasonRepository;
$this->translatableStringHelper = $translatableStringHelper;
}
public function alterQuery(QueryBuilder $qb, $data)
@@ -77,7 +46,7 @@ class ActivityReasonAggregator implements AggregatorInterface,
$elem = 'category.id';
$alias = 'activity_categories_id';
} else {
throw new \RuntimeException('the data provided are not recognized');
throw new \RuntimeException('The data provided are not recognized.');
}
$qb->addSelect($elem.' as '.$alias);
@@ -93,11 +62,12 @@ class ActivityReasonAggregator implements AggregatorInterface,
(! array_key_exists('activity', $join))
) {
$qb->add(
'join',
array('activity' =>
new Join(Join::INNER_JOIN, 'activity.reasons', 'reasons')
),
true);
'join',
[
'activity' => new Join(Join::INNER_JOIN, 'activity.reasons', 'reasons')
],
true
);
}
// join category if necessary
@@ -143,28 +113,33 @@ class ActivityReasonAggregator implements AggregatorInterface,
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('level', ChoiceType::class, array(
'choices' => array(
'By reason' => 'reasons',
'By category of reason' => 'categories'
),
'multiple' => false,
'expanded' => true,
'label' => 'Reason\'s level'
));
$builder->add(
'level',
ChoiceType::class,
[
'choices' => [
'By reason' => 'reasons',
'By category of reason' => 'categories'
],
'multiple' => false,
'expanded' => true,
'label' => "Reason's level"
]
);
}
public function validateForm($data, ExecutionContextInterface $context)
{
if ($data['level'] === null) {
$context->buildViolation("The reasons's level should not be empty")
$context
->buildViolation("The reasons's level should not be empty.")
->addViolation();
}
}
public function getTitle()
public function getTitle()
{
return "Aggregate by activity reason";
return 'Aggregate by activity reason';
}
public function addRole()
@@ -177,41 +152,33 @@ class ActivityReasonAggregator implements AggregatorInterface,
// for performance reason, we load data from db only once
switch ($data['level']) {
case 'reasons':
$this->reasonRepository->findBy(array('id' => $values));
$this->activityReasonRepository->findBy(['id' => $values]);
break;
case 'categories':
$this->categoryRepository->findBy(array('id' => $values));
$this->activityReasonCategoryRepository->findBy(['id' => $values]);
break;
default:
throw new \RuntimeException(sprintf("the level data '%s' is invalid",
$data['level']));
throw new \RuntimeException(sprintf("The level data '%s' is invalid.", $data['level']));
}
return function($value) use ($data) {
if ($value === '_header') {
return $data['level'] === 'reasons' ?
'Group by reasons'
:
'Group by categories of reason'
;
return $data['level'] === 'reasons' ? 'Group by reasons' : 'Group by categories of reason';
}
switch ($data['level']) {
case 'reasons':
/* @var $r \Chill\ActivityBundle\Entity\ActivityReason */
$r = $this->reasonRepository->find($value);
$r = $this->activityReasonRepository->find($value);
return $this->stringHelper->localize($r->getCategory()->getName())
." > "
. $this->stringHelper->localize($r->getName());
;
break;
return sprintf(
"%s > %s",
$this->translatableStringHelper->localize($r->getCategory()->getName()),
$this->translatableStringHelper->localize($r->getName())
);
case 'categories':
$c = $this->categoryRepository->find($value);
$c = $this->activityReasonCategoryRepository->find($value);
return $this->stringHelper->localize($c->getName());
break;
// no need for a default : the default was already set above
return $this->translatableStringHelper->localize($c->getName());
}
};
@@ -222,12 +189,14 @@ class ActivityReasonAggregator implements AggregatorInterface,
// add select element
if ($data['level'] === 'reasons') {
return array('activity_reasons_id');
} elseif ($data['level'] === 'categories') {
return array ('activity_categories_id');
} else {
throw new \RuntimeException('the data provided are not recognised');
}
if ($data['level'] === 'categories') {
return array ('activity_categories_id');
}
throw new \RuntimeException('The data provided are not recognised.');
}
}

View File

@@ -1,75 +1,46 @@
<?php
/*
* Copyright (C) 2016 Champs-Libres <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Aggregator;
use Chill\ActivityBundle\Repository\ActivityTypeRepository;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\QueryBuilder;
use Chill\MainBundle\Export\AggregatorInterface;
use Symfony\Component\Security\Core\Role\Role;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Doctrine\ORM\EntityRepository;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Doctrine\ORM\Query\Expr\Join;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class ActivityTypeAggregator implements AggregatorInterface
{
/**
*
* @var EntityRepository
*/
protected $typeRepository;
/**
*
* @var TranslatableStringHelper
*/
protected $stringHelper;
const KEY = 'activity_type_aggregator';
protected ActivityTypeRepository $activityTypeRepository;
protected TranslatableStringHelperInterface $translatableStringHelper;
public const KEY = 'activity_type_aggregator';
public function __construct(
EntityRepository $typeRepository,
TranslatableStringHelper $stringHelper
ActivityTypeRepository $activityTypeRepository,
TranslatableStringHelperInterface $translatableStringHelper
) {
$this->typeRepository = $typeRepository;
$this->stringHelper = $stringHelper;
$this->activityTypeRepository = $activityTypeRepository;
$this->translatableStringHelper = $translatableStringHelper;
}
public function alterQuery(QueryBuilder $qb, $data)
{
// add select element
// add select element
$qb->addSelect(sprintf('IDENTITY(activity.type) AS %s', self::KEY));
// add the "group by" part
$groupBy = $qb->addGroupBy(self::KEY);
$qb->addGroupBy(self::KEY);
}
/**
* Check if a join between Activity and another alias
*
*
* @param Join[] $joins
* @param string $alias the alias to search for
* @return boolean
@@ -81,7 +52,7 @@ class ActivityTypeAggregator implements AggregatorInterface
return true;
}
}
return false;
}
@@ -97,35 +68,33 @@ class ActivityTypeAggregator implements AggregatorInterface
public function getTitle()
{
return "Aggregate by activity type";
return 'Aggregate by activity type';
}
public function addRole()
{
return new Role(ActivityStatsVoter::STATS);
}
public function getLabels($key, array $values, $data)
public function getLabels($key, array $values, $data): \Closure
{
// for performance reason, we load data from db only once
$this->typeRepository->findBy(array('id' => $values));
return function($value) use ($data) {
$this->activityTypeRepository->findBy(['id' => $values]);
return function($value): string {
if ($value === '_header') {
return 'Activity type';
}
/* @var $r \Chill\ActivityBundle\Entity\ActivityType */
$t = $this->typeRepository->find($value);
$t = $this->activityTypeRepository->find($value);
return $this->stringHelper->localize($t->getName());
return $this->translatableStringHelper->localize($t->getName());
};
}
public function getQueryKeys($data)
public function getQueryKeys($data): array
{
return array(self::KEY);
return [self::KEY];
}
}

View File

@@ -1,51 +1,26 @@
<?php
/*
* Copyright (C) 2019 Champs Libres Cooperative <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\ActivityBundle\Export\Aggregator;
use Chill\MainBundle\Repository\UserRepository;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\QueryBuilder;
use Chill\MainBundle\Export\AggregatorInterface;
use Symfony\Component\Security\Core\Role\Role;
use Doctrine\ORM\Query\Expr\Join;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Doctrine\ORM\EntityManagerInterface;
use Chill\MainBundle\Entity\User;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class ActivityUserAggregator implements AggregatorInterface
{
/**
*
* @var EntityManagerInterface
*/
protected $em;
const KEY = 'activity_user_id';
function __construct(EntityManagerInterface $em)
{
$this->em = $em;
public const KEY = 'activity_user_id';
private UserRepository $userRepository;
public function __construct(
UserRepository $userRepository
) {
$this->userRepository = $userRepository;
}
public function addRole()
{
return new Role(ActivityStatsVoter::STATS);
@@ -53,9 +28,9 @@ class ActivityUserAggregator implements AggregatorInterface
public function alterQuery(QueryBuilder $qb, $data)
{
// add select element
// add select element
$qb->addSelect(sprintf('IDENTITY(activity.user) AS %s', self::KEY));
// add the "group by" part
$qb->addGroupBy(self::KEY);
}
@@ -73,17 +48,14 @@ class ActivityUserAggregator implements AggregatorInterface
public function getLabels($key, $values, $data): \Closure
{
// preload users at once
$this->em->getRepository(User::class)
->findBy(['id' => $values]);
$this->userRepository->findBy(['id' => $values]);
return function($value) {
switch ($value) {
case '_header':
return 'activity user';
default:
return $this->em->getRepository(User::class)->find($value)
->getUsername();
if ($value === '_header') {
return 'activity user';
}
return $this->userRepository->find($value)->getUsername();
};
}
@@ -94,6 +66,6 @@ class ActivityUserAggregator implements AggregatorInterface
public function getTitle(): string
{
return "Aggregate by activity user";
return 'Aggregate by activity user';
}
}

View File

@@ -1,64 +1,40 @@
<?php
/*
* Copyright (C) 2015 Champs-Libres <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Export;
use Chill\ActivityBundle\Repository\ActivityRepository;
use Chill\MainBundle\Export\ExportInterface;
use Doctrine\ORM\QueryBuilder;
use Chill\MainBundle\Export\FormatterInterface;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
use Doctrine\ORM\Query;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Doctrine\ORM\EntityManagerInterface;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class CountActivity implements ExportInterface
{
/**
*
* @var EntityManagerInterface
*/
protected $entityManager;
protected ActivityRepository $activityRepository;
public function __construct(
EntityManagerInterface $em
)
{
$this->entityManager = $em;
ActivityRepository $activityRepository
) {
$this->activityRepository = $activityRepository;
}
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder)
{
}
public function getDescription()
{
return "Count activities by various parameters.";
return 'Count activities by various parameters.';
}
public function getTitle()
{
return "Count activities";
return 'Count activities';
}
public function getType()
@@ -68,26 +44,26 @@ class CountActivity implements ExportInterface
public function initiateQuery(array $requiredModifiers, array $acl, array $data = array())
{
$qb = $this->entityManager->createQueryBuilder();
$centers = array_map(function($el) { return $el['center']; }, $acl);
$qb->select('COUNT(activity.id) as export_count_activity')
->from('ChillActivityBundle:Activity', 'activity')
->join('activity.person', 'person')
;
$qb->where($qb->expr()->in('person.center', ':centers'))
->setParameter('centers', $centers)
;
$centers = array_map(static fn($el) => $el['center'], $acl);
$qb = $this
->activityRepository
->createQueryBuilder('activity')
->select('COUNT(activity.id) as export_count_activity')
->join('activity.person', 'person');
$qb
->where($qb->expr()->in('person.center', ':centers'))
->setParameter('centers', $centers);
return $qb;
}
public function supportsModifiers()
{
return array('person', 'activity');
return ['person', 'activity'];
}
public function requiredRole()
{
return new Role(ActivityStatsVoter::STATS);
@@ -95,7 +71,7 @@ class CountActivity implements ExportInterface
public function getAllowedFormattersTypes()
{
return array(\Chill\MainBundle\Export\FormatterInterface::TYPE_TABULAR);
return [FormatterInterface::TYPE_TABULAR];
}
public function getLabels($key, array $values, $data)
@@ -103,19 +79,13 @@ class CountActivity implements ExportInterface
if ($key !== 'export_count_activity') {
throw new \LogicException("the key $key is not used by this export");
}
return function($value) {
return $value === '_header' ?
'Number of activities'
:
$value
;
};
return static fn($value) => $value === '_header' ? 'Number of activities' : $value;
}
public function getQueryKeys($data)
{
return array('export_count_activity');
return ['export_count_activity'];
}
public function getResult($qb, $data)

View File

@@ -1,31 +1,14 @@
<?php
/*
* Copyright (C) 2017 Champs-Libres <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Export;
use Chill\ActivityBundle\Repository\ActivityRepository;
use Chill\MainBundle\Export\ListInterface;
use Chill\ActivityBundle\Entity\ActivityReason;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\Scope;
use Chill\ActivityBundle\Entity\ActivityType;
use Doctrine\ORM\Query\Expr;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Doctrine\DBAL\Exception\InvalidArgumentException;
use Symfony\Component\Security\Core\Role\Role;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Symfony\Component\Form\FormBuilderInterface;
@@ -37,33 +20,17 @@ use Chill\MainBundle\Export\FormatterInterface;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
/**
* Create a list for all activities
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class ListActivity implements ListInterface
{
private ActivityRepository $activityRepository;
/**
*
* @var EntityManagerInterface
*/
protected $entityManager;
protected EntityManagerInterface $entityManager;
/**
*
* @var TranslatorInterface
*/
protected $translator;
protected TranslatorInterface $translator;
/**
*
* @var TranslatableStringHelper
*/
protected $translatableStringHelper;
protected TranslatableStringHelperInterface $translatableStringHelper;
protected $fields = array(
protected array $fields = [
'id',
'date',
'durationTime',
@@ -75,32 +42,28 @@ class ListActivity implements ListInterface
'person_firstname',
'person_lastname',
'person_id'
);
];
public function __construct(
EntityManagerInterface $em,
TranslatorInterface $translator,
TranslatableStringHelper $translatableStringHelper
)
{
EntityManagerInterface $em,
TranslatorInterface $translator,
TranslatableStringHelperInterface $translatableStringHelper,
ActivityRepository $activityRepository
) {
$this->entityManager = $em;
$this->translator = $translator;
$this->translatableStringHelper = $translatableStringHelper;
$this->activityRepository = $activityRepository;
}
/**
* {@inheritDoc}
*
* @param FormBuilderInterface $builder
*/
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('fields', ChoiceType::class, array(
$builder->add('fields', ChoiceType::class, [
'multiple' => true,
'expanded' => true,
'choices' => array_combine($this->fields, $this->fields),
'label' => 'Fields to include in export',
'constraints' => [new Callback(array(
'constraints' => [new Callback([
'callback' => function($selected, ExecutionContextInterface $context) {
if (count($selected) === 0) {
$context->buildViolation('You must select at least one element')
@@ -108,19 +71,14 @@ class ListActivity implements ListInterface
->addViolation();
}
}
))]
));
])]
]);
}
/**
* {@inheritDoc}
*
* @return type
*/
public function getAllowedFormattersTypes()
{
return array(FormatterInterface::TYPE_LIST);
return [FormatterInterface::TYPE_LIST];
}
public function getDescription()
@@ -133,29 +91,32 @@ class ListActivity implements ListInterface
switch ($key)
{
case 'date' :
return function($value) {
if ($value === '_header') return 'date';
return static function($value) {
if ($value === '_header') {
return 'date';
}
$date = \DateTime::createFromFormat('Y-m-d H:i:s', $value);
return $date->format('d-m-Y');
};
case 'attendee':
return function($value) {
if ($value === '_header') return 'attendee';
return static function($value) {
if ($value === '_header') {
return 'attendee';
}
return $value ? 1 : 0;
};
case 'list_reasons' :
/* @var $activityReasonsRepository EntityRepository */
$activityRepository = $this->entityManager
->getRepository('ChillActivityBundle:Activity');
$activityRepository = $this->activityRepository;
return function($value) use ($activityRepository) {
if ($value === '_header') return 'activity reasons';
return function($value) use ($activityRepository): string {
if ($value === '_header') {
return 'activity reasons';
}
$activity = $activityRepository
->find($value);
$activity = $activityRepository->find($value);
return implode(", ", array_map(function(ActivityReason $r) {
@@ -168,21 +129,25 @@ class ListActivity implements ListInterface
};
case 'circle_name' :
return function($value) {
if ($value === '_header') return 'circle';
if ($value === '_header') {
return 'circle';
}
return $this->translatableStringHelper
->localize(json_decode($value, true));
return $this->translatableStringHelper->localize(json_decode($value, true));
};
case 'type_name' :
return function($value) {
if ($value === '_header') return 'activity type';
if ($value === '_header') {
return 'activity type';
}
return $this->translatableStringHelper
->localize(json_decode($value, true));
return $this->translatableStringHelper->localize(json_decode($value, true));
};
default:
return function($value) use ($key) {
if ($value === '_header') return $key;
return static function($value) use ($key) {
if ($value === '_header') {
return $key;
}
return $value;
};
@@ -209,14 +174,13 @@ class ListActivity implements ListInterface
return 'activity';
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = array())
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
$centers = array_map(function($el) { return $el['center']; }, $acl);
// throw an error if any fields are present
if (!\array_key_exists('fields', $data)) {
throw new \Doctrine\DBAL\Exception\InvalidArgumentException("any fields "
. "have been checked");
throw new InvalidArgumentException('Any fields have been checked.');
}
$qb = $this->entityManager->createQueryBuilder();
@@ -227,7 +191,6 @@ class ListActivity implements ListInterface
->join('person.center', 'center')
->andWhere('center IN (:authorized_centers)')
->setParameter('authorized_centers', $centers);
;
foreach ($this->fields as $f) {
if (in_array($f, $data['fields'])) {
@@ -269,8 +232,6 @@ class ListActivity implements ListInterface
}
}
return $qb;
}
@@ -281,7 +242,7 @@ class ListActivity implements ListInterface
public function supportsModifiers()
{
return array('activity', 'person');
return ['activity', 'person'];
}
}

View File

@@ -1,89 +1,62 @@
<?php
/*
* Copyright (C) 2015 Champs-Libres <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Export;
use Chill\ActivityBundle\Repository\ActivityRepository;
use Chill\MainBundle\Export\ExportInterface;
use Doctrine\ORM\QueryBuilder;
use Chill\MainBundle\Export\FormatterInterface;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
use Doctrine\ORM\Query;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Doctrine\ORM\EntityManagerInterface;
/**
* This export allow to compute stats on activity duration.
*
*
* The desired stat must be given in constructor.
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class StatActivityDuration implements ExportInterface
{
/**
*
* @var EntityManagerInterface
*/
protected $entityManager;
const SUM = 'sum';
private ActivityRepository $activityRepository;
public const SUM = 'sum';
/**
* The action for this report.
*
* @var string
*/
protected $action;
protected string $action;
/**
* constructor
*
* @param EntityManagerInterface $em
* @param string $action the stat to perform
*/
public function __construct(
EntityManagerInterface $em,
$action = 'sum'
)
{
$this->entityManager = $em;
ActivityRepository $activityRepository,
string $action = 'sum'
) {
$this->action = $action;
$this->activityRepository = $activityRepository;
}
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder)
{
}
public function getDescription()
{
if ($this->action === self::SUM) {
return "Sum activities duration by various parameters.";
return 'Sum activities duration by various parameters.';
}
}
public function getTitle()
{
if ($this->action === self::SUM) {
return "Sum activity duration";
return 'Sum activity duration';
}
}
public function getType()
@@ -91,31 +64,33 @@ class StatActivityDuration implements ExportInterface
return 'activity';
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = array())
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
$centers = array_map(function($el) { return $el['center']; }, $acl);
$qb = $this->entityManager->createQueryBuilder();
$centers = array_map(
static fn(array $el): string => $el['center'],
$acl
);
$qb = $this->activityRepository->createQueryBuilder('activity');
$select = null;
if ($this->action === self::SUM) {
$select = "SUM(activity.durationTime) AS export_stat_activity";
$select = 'SUM(activity.durationTime) AS export_stat_activity';
}
$qb->select($select)
->from('ChillActivityBundle:Activity', 'activity')
->join('activity.person', 'person')
->join('person.center', 'center')
->where($qb->expr()->in('center', ':centers'))
->setParameter(':centers', $centers)
;
return $qb;
return $qb->select($select)
->join('activity.person', 'person')
->join('person.center', 'center')
->where($qb->expr()->in('center', ':centers'))
->setParameter(':centers', $centers);
}
public function supportsModifiers()
{
return array('person', 'activity');
return ['person', 'activity'];
}
public function requiredRole()
{
return new Role(ActivityStatsVoter::STATS);
@@ -123,32 +98,23 @@ class StatActivityDuration implements ExportInterface
public function getAllowedFormattersTypes()
{
return array(\Chill\MainBundle\Export\FormatterInterface::TYPE_TABULAR);
return [FormatterInterface::TYPE_TABULAR];
}
public function getLabels($key, array $values, $data)
{
if ($key !== 'export_stat_activity') {
throw new \LogicException("the key $key is not used by this export");
throw new \LogicException(sprintf('The key %s is not used by this export', $key));
}
switch ($this->action) {
case self::SUM:
$header = "Sum of activities duration";
}
return function($value) use ($header) {
return $value === '_header' ?
$header
:
$value
;
};
$header = $this->action === self::SUM ? 'Sum of activities duration' : false;
return static fn(string $value) => $value === '_header' ? $header : $value;
}
public function getQueryKeys($data)
{
return array('export_stat_activity');
return ['export_stat_activity'];
}
public function getResult($qb, $data)

View File

@@ -1,25 +1,12 @@
<?php
/*
* Copyright (C) 2017 Champs-Libres <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Filter;
use Chill\MainBundle\Export\FilterInterface;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\Extension\Core\Type\DateType;
@@ -28,34 +15,24 @@ use Chill\MainBundle\Form\Type\Export\FilterType;
use Doctrine\ORM\Query\Expr;
use Symfony\Component\Translation\TranslatorInterface;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class ActivityDateFilter implements FilterInterface
{
/**
*
* @var TranslatorInterface
*/
protected $translator;
protected TranslatorInterface $translator;
function __construct(TranslatorInterface $translator)
{
$this->translator = $translator;
}
public function addRole()
{
return null;
}
public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data)
public function alterQuery(QueryBuilder $qb, $data)
{
$where = $qb->getDQLPart('where');
$clause = $qb->expr()->between('activity.date', ':date_from',
$clause = $qb->expr()->between('activity.date', ':date_from',
':date_to');
if ($where instanceof Expr\Andx) {
@@ -63,7 +40,7 @@ class ActivityDateFilter implements FilterInterface
} else {
$where = $qb->expr()->andX($clause);
}
$qb->add('where', $where);
$qb->setParameter('date_from', $data['date_from']);
$qb->setParameter('date_to', $data['date_to']);
@@ -74,35 +51,43 @@ class ActivityDateFilter implements FilterInterface
return 'activity';
}
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('date_from', DateType::class, array(
'label' => "Activities after this date",
'data' => new \DateTime(),
'attr' => array('class' => 'datepicker'),
'widget'=> 'single_text',
'format' => 'dd-MM-yyyy',
));
$builder->add('date_to', DateType::class, array(
'label' => "Activities before this date",
'data' => new \DateTime(),
'attr' => array('class' => 'datepicker'),
'widget'=> 'single_text',
'format' => 'dd-MM-yyyy',
));
$builder->add(
'date_from',
DateType::class,
[
'label' => 'Activities after this date',
'data' => new \DateTime(),
'attr' => ['class' => 'datepicker'],
'widget'=> 'single_text',
'format' => 'dd-MM-yyyy',
]
);
$builder->add(
'date_to',
DateType::class,
[
'label' => 'Activities before this date',
'data' => new \DateTime(),
'attr' => ['class' => 'datepicker'],
'widget'=> 'single_text',
'format' => 'dd-MM-yyyy',
]
);
$builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) {
/* @var $filterForm \Symfony\Component\Form\FormInterface */
$filterForm = $event->getForm()->getParent();
$enabled = $filterForm->get(FilterType::ENABLED_FIELD)->getData();
if ($enabled === true) {
// if the filter is enabled, add some validation
$form = $event->getForm();
$date_from = $form->get('date_from')->getData();
$date_to = $form->get('date_to')->getData();
// check that fields are not empty
if ($date_from === null) {
$form->get('date_from')->addError(new FormError(
@@ -113,8 +98,8 @@ class ActivityDateFilter implements FilterInterface
$form->get('date_to')->addError(new FormError(
$this->translator->trans('This field '
. 'should not be empty')));
}
}
// check that date_from is before date_to
if (
($date_from !== null && $date_to !== null)
@@ -132,17 +117,18 @@ class ActivityDateFilter implements FilterInterface
public function describeAction($data, $format = 'string')
{
return array(
"Filtered by date of activity: only between %date_from% and %date_to%",
array(
"%date_from%" => $data['date_from']->format('d-m-Y'),
'%date_to%' => $data['date_to']->format('d-m-Y')
));
return [
'Filtered by date of activity: only between %date_from% and %date_to%',
[
'%date_from%' => $data['date_from']->format('d-m-Y'),
'%date_to%' => $data['date_to']->format('d-m-Y')
]
];
}
public function getTitle()
{
return "Filtered by date activity";
return 'Filtered by date activity';
}
}

View File

@@ -1,25 +1,12 @@
<?php
/*
* Copyright (C) 2016 Champs-Libres <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Filter;
use Chill\ActivityBundle\Repository\ActivityReasonRepository;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
@@ -28,41 +15,24 @@ use Chill\MainBundle\Templating\TranslatableStringHelper;
use Doctrine\ORM\Query\Expr;
use Symfony\Component\Security\Core\Role\Role;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\Expr\Join;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Chill\MainBundle\Export\ExportElementValidatedInterface;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class ActivityReasonFilter implements FilterInterface,
ExportElementValidatedInterface
class ActivityReasonFilter implements FilterInterface, ExportElementValidatedInterface
{
/**
*
* @var TranslatableStringHelper
*/
protected $translatableStringHelper;
/**
* The repository for activity reasons
*
* @var EntityRepository
*/
protected $reasonRepository;
protected TranslatableStringHelperInterface $translatableStringHelper;
protected ActivityReasonRepository $activityReasonRepository;
public function __construct(
TranslatableStringHelper $helper,
EntityRepository $reasonRepository
TranslatableStringHelper $helper,
ActivityReasonRepository $activityReasonRepository
) {
$this->translatableStringHelper = $helper;
$this->reasonRepository = $reasonRepository;
$this->activityReasonRepository = $activityReasonRepository;
}
public function alterQuery(QueryBuilder $qb, $data)
{
$where = $qb->getDQLPart('where');
@@ -75,12 +45,12 @@ class ActivityReasonFilter implements FilterInterface,
&&
!$this->checkJoinAlreadyDefined($join['activity'], 'reasons')
)
OR
||
(! array_key_exists('activity', $join))
) {
$qb->add(
'join',
array('activity' => new Join(Join::INNER_JOIN, 'activity.reasons', 'reasons')),
'join',
array('activity' => new Join(Join::INNER_JOIN, 'activity.reasons', 'reasons')),
true
);
}
@@ -90,25 +60,25 @@ class ActivityReasonFilter implements FilterInterface,
} else {
$where = $qb->expr()->andX($clause);
}
$qb->add('where', $where);
$qb->setParameter('selected_activity_reasons', $data['reasons']);
}
/**
* Check if a join between Activity and Reason is already defined
*
*
* @param Join[] $joins
* @return boolean
*/
private function checkJoinAlreadyDefined(array $joins, $alias)
private function checkJoinAlreadyDefined(array $joins, $alias): bool
{
foreach ($joins as $join) {
if ($join->getAlias() === $alias) {
return true;
}
}
return false;
}
@@ -119,51 +89,47 @@ class ActivityReasonFilter implements FilterInterface,
public function buildForm(FormBuilderInterface $builder)
{
//create a local copy of translatableStringHelper
$helper = $this->translatableStringHelper;
$builder->add('reasons', EntityType::class, array(
'class' => 'ChillActivityBundle:ActivityReason',
'choice_label' => function (ActivityReason $reason) use ($helper) {
return $helper->localize($reason->getName());
},
'group_by' => function(ActivityReason $reason) use ($helper) {
return $helper->localize($reason->getCategory()->getName());
},
$builder->add('reasons', EntityType::class, [
'class' => ActivityReason::class,
'choice_label' => fn(ActivityReason $reason) => $this->translatableStringHelper->localize($reason->getName()),
'group_by' => fn(ActivityReason $reason) => $this->translatableStringHelper->localize($reason->getCategory()->getName()),
'multiple' => true,
'expanded' => false
));
]);
}
public function validateForm($data, ExecutionContextInterface $context)
{
if ($data['reasons'] === null || count($data['reasons']) === 0) {
$context->buildViolation("At least one reason must be choosen")
$context
->buildViolation('At least one reason must be chosen')
->addViolation();
}
}
public function getTitle()
public function getTitle()
{
return 'Filter by reason';
}
public function addRole()
{
return new Role(ActivityStatsVoter::STATS);
}
public function describeAction($data, $format = 'string')
{
// collect all the reasons'name used in this filter in one array
$reasonsNames = array_map(
function(ActivityReason $r) {
return "\"".$this->translatableStringHelper->localize($r->getName())."\"";
},
$this->reasonRepository->findBy(array('id' => $data['reasons']->toArray()))
);
return array("Filtered by reasons: only %list%",
["%list%" => implode(", ", $reasonsNames)]);
fn(ActivityReason $r): string => '"' . $this->translatableStringHelper->localize($r->getName()) . '"',
$this->activityReasonRepository->findBy(array('id' => $data['reasons']->toArray()))
);
return [
'Filtered by reasons: only %list%',
[
'%list%' => implode(", ", $reasonsNames),
]
];
}
}

View File

@@ -1,67 +1,37 @@
<?php
/*
* Copyright (C) 2018 Champs-Libres <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Filter;
use Chill\ActivityBundle\Repository\ActivityTypeRepository;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Doctrine\ORM\Query\Expr;
use Symfony\Component\Security\Core\Role\Role;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\Expr\Join;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Chill\ActivityBundle\Entity\ActivityType;
/**
*
*
*/
class ActivityTypeFilter implements FilterInterface,
ExportElementValidatedInterface
class ActivityTypeFilter implements FilterInterface, ExportElementValidatedInterface
{
/**
*
* @var TranslatableStringHelper
*/
protected $translatableStringHelper;
/**
* The repository for activity reasons
*
* @var EntityRepository
*/
protected $typeRepository;
protected TranslatableStringHelperInterface $translatableStringHelper;
protected ActivityTypeRepository $activityTypeRepository;
public function __construct(
TranslatableStringHelper $helper,
EntityRepository $typeRepository
TranslatableStringHelperInterface $translatableStringHelper,
ActivityTypeRepository $activityTypeRepository
) {
$this->translatableStringHelper = $helper;
$this->typeRepository = $typeRepository;
$this->translatableStringHelper = $translatableStringHelper;
$this->activityTypeRepository = $activityTypeRepository;
}
public function alterQuery(QueryBuilder $qb, $data)
{
$where = $qb->getDQLPart('where');
@@ -72,14 +42,14 @@ class ActivityTypeFilter implements FilterInterface,
} else {
$where = $qb->expr()->andX($clause);
}
$qb->add('where', $where);
$qb->setParameter('selected_activity_types', $data['types']);
}
/**
* Check if a join between Activity and Reason is already defined
*
*
* @param Join[] $joins
* @return boolean
*/
@@ -90,7 +60,7 @@ class ActivityTypeFilter implements FilterInterface,
return true;
}
}
return false;
}
@@ -101,48 +71,50 @@ class ActivityTypeFilter implements FilterInterface,
public function buildForm(FormBuilderInterface $builder)
{
//create a local copy of translatableStringHelper
$helper = $this->translatableStringHelper;
$builder->add('types', EntityType::class, array(
'class' => ActivityType::class,
'choice_label' => function (ActivityType $type) use ($helper) {
return $helper->localize($type->getName());
},
'multiple' => true,
'expanded' => false
));
$builder->add(
'types',
EntityType::class,
[
'class' => ActivityType::class,
'choice_label' => fn(ActivityType $type) => $this->translatableStringHelper->localize($type->getName()),
'multiple' => true,
'expanded' => false
]
);
}
public function validateForm($data, ExecutionContextInterface $context)
{
if ($data['types'] === null || count($data['types']) === 0) {
$context->buildViolation("At least one type must be choosen")
$context
->buildViolation('At least one type must be chosen')
->addViolation();
}
}
public function getTitle()
public function getTitle()
{
return 'Filter by activity type';
}
public function addRole()
{
return new Role(ActivityStatsVoter::STATS);
}
public function describeAction($data, $format = 'string')
{
// collect all the reasons'name used in this filter in one array
$reasonsNames = array_map(
function(ActivityType $t) {
return "\"".$this->translatableStringHelper->localize($t->getName())."\"";
},
$this->typeRepository->findBy(array('id' => $data['types']->toArray()))
);
return array("Filtered by activity type: only %list%",
["%list%" => implode(", ", $reasonsNames)]);
fn(ActivityType $t): string => '"' . $this->translatableStringHelper->localize($t->getName()) . '"',
$this->activityTypeRepository->findBy(['id' => $data['types']->toArray()])
);
return [
'Filtered by activity type: only %list%',
[
'%list%' => implode(", ", $reasonsNames),
]
];
}
}

View File

@@ -1,25 +1,14 @@
<?php
/*
* Copyright (C) 2017 Champs-Libres <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Export\Filter;
use Chill\ActivityBundle\Repository\ActivityReasonRepository;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\Extension\Core\Type\DateType;
@@ -29,78 +18,58 @@ use Doctrine\ORM\Query\Expr;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Chill\ActivityBundle\Entity\ActivityReason;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\EntityManager;
use Chill\PersonBundle\Export\Declarations;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Chill\MainBundle\Export\ExportElementValidatedInterface;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class PersonHavingActivityBetweenDateFilter implements FilterInterface,
ExportElementValidatedInterface
class PersonHavingActivityBetweenDateFilter implements FilterInterface, ExportElementValidatedInterface
{
/**
*
* @var TranslatableStringHelper
*/
protected $translatableStringHelper;
/**
*
* @var EntityRepository
*/
protected $activityReasonRepository;
/**
*
* @var TranslatorInterface
*/
protected $translator;
protected TranslatableStringHelperInterface $translatableStringHelper;
protected ActivityReasonRepository $activityReasonRepository;
protected TranslatorInterface $translator;
public function __construct(
TranslatableStringHelper $translatableStringHelper,
EntityRepository $activityReasonRepository,
TranslatorInterface $translator
TranslatableStringHelper $translatableStringHelper,
ActivityReasonRepository $activityReasonRepository,
TranslatorInterface $translator
) {
$this->translatableStringHelper = $translatableStringHelper;
$this->activityReasonRepository = $activityReasonRepository;
$this->translator = $translator;
$this->translator = $translator;
}
public function addRole()
{
return null;
}
public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data)
public function alterQuery(QueryBuilder $qb, $data)
{
// create a query for activity
$sqb = $qb->getEntityManager()->createQueryBuilder();
$sqb->select("person_person_having_activity.id")
->from("ChillActivityBundle:Activity", "activity_person_having_activity")
->join("activity_person_having_activity.person", "person_person_having_activity")
;
$sqb->select('person_person_having_activity.id')
->from('ChillActivityBundle:Activity', 'activity_person_having_activity')
->join('activity_person_having_activity.person', 'person_person_having_activity');
// add clause between date
$sqb->where("activity_person_having_activity.date BETWEEN "
. ":person_having_activity_between_date_from"
. " AND "
. ":person_having_activity_between_date_to");
$sqb->where('activity_person_having_activity.date BETWEEN '
. ':person_having_activity_between_date_from'
. ' AND '
. ':person_having_activity_between_date_to');
// add clause activity reason
$sqb->join('activity_person_having_activity.reasons',
'reasons_person_having_activity');
$sqb->join('activity_person_having_activity.reasons', 'reasons_person_having_activity');
$sqb->andWhere(
$sqb->expr()->in(
'reasons_person_having_activity',
":person_having_activity_reasons")
);
$sqb->expr()->in(
'reasons_person_having_activity', ':person_having_activity_reasons'
)
);
$where = $qb->getDQLPart('where');
$clause = $qb->expr()->in('person.id', $sqb->getDQL());
@@ -109,11 +78,11 @@ class PersonHavingActivityBetweenDateFilter implements FilterInterface,
} else {
$where = $qb->expr()->andX($clause);
}
$qb->add('where', $where);
$qb->setParameter('person_having_activity_between_date_from',
$qb->setParameter('person_having_activity_between_date_from',
$data['date_from']);
$qb->setParameter('person_having_activity_between_date_to',
$qb->setParameter('person_having_activity_between_date_to',
$data['date_to']);
$qb->setParameter('person_having_activity_reasons', $data['reasons']);
}
@@ -123,51 +92,45 @@ class PersonHavingActivityBetweenDateFilter implements FilterInterface,
return Declarations::PERSON_IMPLIED_IN;
}
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder)
public function buildForm(FormBuilderInterface $builder)
{
$builder->add('date_from', DateType::class, array(
'label' => "Implied in an activity after this date",
$builder->add('date_from', DateType::class, [
'label' => 'Implied in an activity after this date',
'data' => new \DateTime(),
'attr' => array('class' => 'datepicker'),
'attr' => ['class' => 'datepicker'],
'widget'=> 'single_text',
'format' => 'dd-MM-yyyy',
));
$builder->add('date_to', DateType::class, array(
'label' => "Implied in an activity before this date",
]);
$builder->add('date_to', DateType::class, [
'label' => 'Implied in an activity before this date',
'data' => new \DateTime(),
'attr' => array('class' => 'datepicker'),
'attr' => ['class' => 'datepicker'],
'widget'=> 'single_text',
'format' => 'dd-MM-yyyy',
));
$builder->add('reasons', EntityType::class, array(
'class' => 'ChillActivityBundle:ActivityReason',
'choice_label' => function (ActivityReason $reason) {
return $this->translatableStringHelper
->localize($reason->getName());
},
'group_by' => function(ActivityReason $reason) {
return $this->translatableStringHelper
->localize($reason->getCategory()->getName());
},
]);
$builder->add('reasons', EntityType::class, [
'class' => ActivityReason::class,
'choice_label' => fn (ActivityReason $reason): ?string => $this->translatableStringHelper->localize($reason->getName()),
'group_by' => fn(ActivityReason $reason): ?string => $this->translatableStringHelper->localize($reason->getCategory()->getName()),
'data' => $this->activityReasonRepository->findAll(),
'multiple' => true,
'expanded' => false,
'label' => "Activity reasons for those activities"
));
'label' => 'Activity reasons for those activities'
]);
$builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) {
/* @var $filterForm \Symfony\Component\Form\FormInterface */
/* @var FormInterface $filterForm */
$filterForm = $event->getForm()->getParent();
$enabled = $filterForm->get(FilterType::ENABLED_FIELD)->getData();
if ($enabled === true) {
// if the filter is enabled, add some validation
$form = $event->getForm();
$date_from = $form->get('date_from')->getData();
$date_to = $form->get('date_to')->getData();
// check that fields are not empty
if ($date_from === null) {
$form->get('date_from')->addError(new FormError(
@@ -178,8 +141,8 @@ class PersonHavingActivityBetweenDateFilter implements FilterInterface,
$form->get('date_to')->addError(new FormError(
$this->translator->trans('This field '
. 'should not be empty')));
}
}
// check that date_from is before date_to
if (
($date_from !== null && $date_to !== null)
@@ -194,35 +157,37 @@ class PersonHavingActivityBetweenDateFilter implements FilterInterface,
}
});
}
public function validateForm($data, ExecutionContextInterface $context)
{
if ($data['reasons'] === null || count($data['reasons']) === 0) {
$context->buildViolation("At least one reason must be choosen")
$context->buildViolation('At least one reason must be chosen')
->addViolation();
}
}
public function describeAction($data, $format = 'string')
{
return array(
"Filtered by person having an activity between %date_from% and "
. "%date_to% with reasons %reasons_name%",
array(
"%date_from%" => $data['date_from']->format('d-m-Y'),
return [
'Filtered by person having an activity between %date_from% and '
. '%date_to% with reasons %reasons_name%',
[
'%date_from%' => $data['date_from']->format('d-m-Y'),
'%date_to%' => $data['date_to']->format('d-m-Y'),
"%reasons_name%" => implode(", ", array_map(
function (ActivityReason $r) {
return '"'.$this->translatableStringHelper->
localize($r->getName()).'"';
},
$data['reasons']))
));
'%reasons_name%' => implode(
", ",
array_map(
fn(ActivityReason $r): string => '"' . $this->translatableStringHelper->localize($r->getName()) . '"',
$data['reasons']
)
)
]
];
}
public function getTitle()
{
return "Filtered by person having an activity in a period";
return 'Filtered by person having an activity in a period';
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Entity\ActivityPresence;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
class ActivityPresenceType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('name', TranslatableStringFormType::class)
->add('active', ChoiceType::class, array(
'choices' => array(
'Yes' => true,
'No' => false
),
'expanded' => true
));
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults(array(
'data_class' => ActivityPresence::class
));
}
}

View File

@@ -2,8 +2,22 @@
namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Entity\Activity;
use Chill\ActivityBundle\Entity\ActivityPresence;
use Chill\ActivityBundle\Entity\ActivityReason;
use Chill\DocStoreBundle\Form\StoredObjectType;
use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Form\Type\ChillCollectionType;
use Chill\MainBundle\Form\Type\CommentType;
use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
use Chill\ThirdPartyBundle\Entity\ThirdParty;
use Doctrine\ORM\EntityRepository;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
@@ -15,178 +29,378 @@ use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTra
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Chill\ActivityBundle\Form\Type\TranslatableActivityType;
use Chill\ActivityBundle\Form\Type\TranslatableActivityReason;
use Chill\MainBundle\Form\Type\UserPickerType;
use Chill\MainBundle\Form\Type\ScopePickerType;
use Chill\MainBundle\Form\Type\ChillDateType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\CallbackTransformer;
use Chill\PersonBundle\Form\DataTransformer\PersonToIdTransformer;
use Chill\PersonBundle\Templating\Entity\SocialIssueRender;
use Chill\PersonBundle\Templating\Entity\SocialActionRender;
class ActivityType extends AbstractType
{
protected User $user;
/**
* the user running this form
*
* @var User
*/
protected $user;
protected AuthorizationHelper $authorizationHelper;
/**
*
* @var AuthorizationHelper
*/
protected $authorizationHelper;
protected ObjectManager $om;
/**
*
* @var ObjectManager
*/
protected $om;
protected TranslatableStringHelper $translatableStringHelper;
/**
*
* @var TranslatableStringHelper
*/
protected $translatableStringHelper;
protected SocialIssueRender $socialIssueRender;
protected $timeChoices;
protected SocialActionRender $socialActionRender;
public function __construct(
TokenStorageInterface $tokenStorage,
AuthorizationHelper $authorizationHelper, ObjectManager $om,
TranslatableStringHelper $translatableStringHelper,
array $timeChoices
)
{
protected array $timeChoices;
public function __construct (
TokenStorageInterface $tokenStorage,
AuthorizationHelper $authorizationHelper,
ObjectManager $om,
TranslatableStringHelper $translatableStringHelper,
array $timeChoices,
SocialIssueRender $socialIssueRender,
SocialActionRender $socialActionRender
) {
if (!$tokenStorage->getToken()->getUser() instanceof User) {
throw new \RuntimeException("you should have a valid user");
}
$this->user = $tokenStorage->getToken()->getUser();
$this->authorizationHelper = $authorizationHelper;
$this->om = $om;
$this->translatableStringHelper = $translatableStringHelper;
$this->timeChoices = $timeChoices;
$this->socialIssueRender = $socialIssueRender;
$this->socialActionRender = $socialActionRender;
}
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
// handle times choices
$timeChoices = array();
$timeChoices = [];
foreach ($this->timeChoices as $e) {
$timeChoices[$e['label']] = $e['seconds'];
};
}
$durationTimeTransformer = new DateTimeToTimestampTransformer('GMT', 'GMT');
$durationTimeOptions = array(
'choices' => $timeChoices,
'placeholder' => 'Choose the duration',
);
$durationTimeOptions = [
'choices' => $timeChoices,
'placeholder' => 'Choose the duration',
];
$builder
->add('date', ChillDateType::class, array(
'required' => true
))
->add('durationTime', ChoiceType::class, $durationTimeOptions)
->add('attendee', ChoiceType::class, array(
'expanded' => true,
'required' => false,
'choices' => array(
'present' => true,
'not present' => false
)
))
->add('user', UserPickerType::class, [
/** @var \Chill\ActivityBundle\Entity\ActivityType $activityType */
$activityType = $options['activityType'];
// TODO revoir la gestion des center au niveau du form des activité.
if ($options['center']) {
$builder->add('scope', ScopePickerType::class, [
'center' => $options['center'],
'role' => $options['role'],
// TODO make required again once scope and rights are fixed
'required' => false
]);
}
/** @var ? \Chill\PersonBundle\Entity\AccompanyingPeriod $accompanyingPeriod */
$accompanyingPeriod = NULL;
if ($options['accompanyingPeriod']) {
$accompanyingPeriod = $options['accompanyingPeriod'];
}
if ($activityType->isVisible('socialIssues') && $accompanyingPeriod) {
$builder->add('socialIssues', HiddenType::class);
$builder->get('socialIssues')
->addModelTransformer(new CallbackTransformer(
function (iterable $socialIssuesAsIterable): string {
$socialIssueIds = [];
foreach ($socialIssuesAsIterable as $value) {
$socialIssueIds[] = $value->getId();
}
return implode(',', $socialIssueIds);
},
function (?string $socialIssuesAsString): array {
if (null === $socialIssuesAsString) {
return [];
}
return array_map(
fn(string $id): ?SocialIssue => $this->om->getRepository(SocialIssue::class)->findOneBy(['id' => (int) $id]),
explode(',', $socialIssuesAsString)
);
}
))
;
}
if ($activityType->isVisible('socialActions') && $accompanyingPeriod) {
$builder->add('socialActions', HiddenType::class);
$builder->get('socialActions')
->addModelTransformer(new CallbackTransformer(
function (iterable $socialActionsAsIterable): string {
$socialActionIds = [];
foreach ($socialActionsAsIterable as $value) {
$socialActionIds[] = $value->getId();
}
return implode(',', $socialActionIds);
},
function (?string $socialActionsAsString): array {
if (null === $socialActionsAsString) {
return [];
}
return array_map(
fn(string $id): ?SocialAction => $this->om->getRepository(SocialAction::class)->findOneBy(['id' => (int) $id]),
explode(',', $socialActionsAsString)
);
}
))
;
}
if ($activityType->isVisible('date')) {
$builder->add('date', ChillDateType::class, [
'label' => $activityType->getLabel('date'),
'required' => $activityType->isRequired('date'),
]);
}
if ($activityType->isVisible('durationTime')) {
$durationTimeOptions['label'] = $activityType->getLabel('durationTime');
$durationTimeOptions['required'] = $activityType->isRequired('durationTime');
$builder->add('durationTime', ChoiceType::class, $durationTimeOptions);
}
if ($activityType->isVisible('travelTime')) {
$durationTimeOptions['label'] = $activityType->getLabel('travelTime');
$durationTimeOptions['required'] = $activityType->isRequired('travelTime');
$builder->add('travelTime', ChoiceType::class, $durationTimeOptions);
}
if ($activityType->isVisible('attendee')) {
$builder->add('attendee', EntityType::class, [
'label' => $activityType->getLabel('attendee'),
'required' => $activityType->isRequired('attendee'),
'expanded' => true,
'class' => ActivityPresence::class,
'choice_label' => function (ActivityPresence $activityPresence) {
return $this->translatableStringHelper->localize($activityPresence->getName());
},
'query_builder' => function (EntityRepository $er) {
return $er->createQueryBuilder('a')
->where('a.active = true');
},
]);
}
if ($activityType->isVisible('user') && $options['center']) {
$builder->add('user', UserPickerType::class, [
'label' => $activityType->getLabel('user'),
'required' => $activityType->isRequired('user'),
'center' => $options['center'],
'role' => $options['role']
])
->add('scope', ScopePickerType::class, [
'center' => $options['center'],
'role' => $options['role']
])
->add('reasons', TranslatableActivityReason::class, array(
]);
}
if ($activityType->isVisible('reasons')) {
$builder->add('reasons', EntityType::class, [
'label' => $activityType->getLabel('reasons'),
'required' => $activityType->isRequired('reasons'),
'class' => ActivityReason::class,
'multiple' => true,
'required' => false,
))
->add('type', TranslatableActivityType::class, array(
'placeholder' => 'Choose a type',
'active_only' => true
))
->add('comment', CommentType::class, [
'required' => false,
])
;
'choice_label' => function (ActivityReason $activityReason) {
return $this->translatableStringHelper->localize($activityReason->getName());
},
'attr' => array('class' => 'select2 '),
'query_builder' => function (EntityRepository $er) {
return $er->createQueryBuilder('a')
->where('a.active = true');
},
]);
}
$builder->get('durationTime')
if ($activityType->isVisible('comment')) {
$builder->add('comment', CommentType::class, [
'label' => empty($activityType->getLabel('comment'))
? 'activity.comment' : $activityType->getLabel('comment'),
'required' => $activityType->isRequired('comment'),
]);
}
if ($activityType->isVisible('persons')) {
$builder->add('persons', HiddenType::class);
$builder->get('persons')
->addModelTransformer(new CallbackTransformer(
function (iterable $personsAsIterable): string {
$personIds = [];
foreach ($personsAsIterable as $value) {
$personIds[] = $value->getId();
}
return implode(',', $personIds);
},
function (?string $personsAsString): array {
return array_map(
fn(string $id): ?Person => $this->om->getRepository(Person::class)->findOneBy(['id' => (int) $id]),
explode(',', $personsAsString)
);
}
))
;
}
if ($activityType->isVisible('thirdParties')) {
$builder->add('thirdParties', HiddenType::class);
$builder->get('thirdParties')
->addModelTransformer(new CallbackTransformer(
function (iterable $thirdpartyAsIterable): string {
$thirdpartyIds = [];
foreach ($thirdpartyAsIterable as $value) {
$thirdpartyIds[] = $value->getId();
}
return implode(',', $thirdpartyIds);
},
function (?string $thirdpartyAsString): array {
return array_map(
fn(string $id): ?ThirdParty => $this->om->getRepository(ThirdParty::class)->findOneBy(['id' => (int) $id]),
explode(',', $thirdpartyAsString)
);
}
))
;
}
if ($activityType->isVisible('documents')) {
$builder->add('documents', ChillCollectionType::class, [
'entry_type' => StoredObjectType::class,
'label' => $activityType->getLabel('documents'),
'required' => $activityType->isRequired('documents'),
'allow_add' => true,
'button_add_label' => 'activity.Insert a document',
'button_remove_label' => 'activity.Remove a document'
]);
}
if ($activityType->isVisible('users')) {
$builder->add('users', HiddenType::class);
$builder->get('users')
->addModelTransformer(new CallbackTransformer(
function (iterable $usersAsIterable): string {
$userIds = [];
foreach ($usersAsIterable as $value) {
$userIds[] = $value->getId();
}
return implode(',', $userIds);
},
function (?string $usersAsString): array {
return array_map(
fn(string $id): ?User => $this->om->getRepository(User::class)->findOneBy(['id' => (int) $id]),
explode(',', $usersAsString)
);
}
))
;
}
if ($activityType->isVisible('location')) {
$builder->add('location', HiddenType::class)
->get('location')
->addModelTransformer(new CallbackTransformer(
function (?Location $location): string {
if (null === $location) {
return '';
}
return $location->getId();
},
function (?string $id): ?Location {
return $this->om->getRepository(Location::class)->findOneBy(['id' => (int) $id]);
}
))
;
}
if ($activityType->isVisible('emergency')) {
$builder->add('emergency', CheckboxType::class, [
'label' => $activityType->getLabel('emergency'),
'required' => $activityType->isRequired('emergency'),
]);
}
if ($activityType->isVisible('sentReceived')) {
$builder->add('sentReceived', ChoiceType::class, [
'label' => $activityType->getLabel('sentReceived'),
'required' => $activityType->isRequired('sentReceived'),
'choices' => [
'Sent' => Activity::SENTRECEIVED_SENT,
'Received' => Activity::SENTRECEIVED_RECEIVED,
],
]);
}
foreach (['durationTime', 'travelTime'] as $fieldName) {
if (!$activityType->isVisible($fieldName)) {
continue;
}
$builder->get($fieldName)
->addModelTransformer($durationTimeTransformer);
$builder->get($fieldName)
->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $formEvent) use (
$timeChoices,
$builder,
$durationTimeTransformer,
$durationTimeOptions,
$fieldName
) {
// set the timezone to GMT, and fix the difference between current and GMT
// the datetimetransformer will then handle timezone as GMT
$timezoneUTC = new \DateTimeZone('GMT');
/* @var $data \DateTime */
$data = $formEvent->getData() === NULL ?
\DateTime::createFromFormat('U', 300) :
$formEvent->getData();
$seconds = $data->getTimezone()->getOffset($data);
$data->setTimeZone($timezoneUTC);
$data->add(new \DateInterval('PT'.$seconds.'S'));
$builder->get('durationTime')
->addEventListener(
FormEvents::PRE_SET_DATA,
function(FormEvent $formEvent) use (
$timeChoices,
$builder,
$durationTimeTransformer,
$durationTimeOptions
)
{
// set the timezone to GMT, and fix the difference between current and GMT
// the datetimetransformer will then handle timezone as GMT
$timezoneUTC = new \DateTimeZone('GMT');
/* @var $data \DateTime */
$data = $formEvent->getData() === NULL ?
\DateTime::createFromFormat('U', 300) :
$formEvent->getData();
$seconds = $data->getTimezone()->getOffset($data);
$data->setTimeZone($timezoneUTC);
$data->add(new \DateInterval('PT'.$seconds.'S'));
// test if the timestamp is in the choices.
// If not, recreate the field with the new timestamp
if (!in_array($data->getTimestamp(), $timeChoices)) {
// the data are not in the possible values. add them
$timeChoices[$data->format('H:i')] = $data->getTimestamp();
$form = $builder->create(
'durationTime',
ChoiceType::class,
array_merge(
$durationTimeOptions,
array(
'choices' => $timeChoices,
'auto_initialize' => false
)
));
$form->addModelTransformer($durationTimeTransformer);
$formEvent->getForm()->getParent()->add($form->getForm());
}
});
// test if the timestamp is in the choices.
// If not, recreate the field with the new timestamp
if (!in_array($data->getTimestamp(), $timeChoices)) {
// the data are not in the possible values. add them
$timeChoices[$data->format('H:i')] = $data->getTimestamp();
$form = $builder->create($fieldName, ChoiceType::class, array_merge(
$durationTimeOptions, [
'choices' => $timeChoices,
'auto_initialize' => false
]
));
$form->addModelTransformer($durationTimeTransformer);
$formEvent->getForm()->getParent()->add($form->getForm());
}
});
}
}
/**
* @param OptionsResolverInterface $resolver
*/
public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults(array(
'data_class' => 'Chill\ActivityBundle\Entity\Activity'
));
$resolver->setDefaults([
'data_class' => Activity::class
]);
$resolver
->setRequired(array('center', 'role'))
->setAllowedTypes('center', 'Chill\MainBundle\Entity\Center')
->setAllowedTypes('role', 'Symfony\Component\Security\Core\Role\Role')
;
->setRequired(['center', 'role', 'activityType', 'accompanyingPeriod'])
->setAllowedTypes('center', ['null', 'Chill\MainBundle\Entity\Center'])
->setAllowedTypes('role', 'Symfony\Component\Security\Core\Role\Role')
->setAllowedTypes('activityType', \Chill\ActivityBundle\Entity\ActivityType::class)
->setAllowedTypes('accompanyingPeriod', [\Chill\PersonBundle\Entity\AccompanyingPeriod::class, 'null'])
;
}
/**
* @return string
*/
public function getBlockPrefix()
public function getBlockPrefix(): string
{
return 'chill_activitybundle_activity';
}

View File

@@ -0,0 +1,39 @@
<?php
namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Entity\ActivityTypeCategory;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
class ActivityTypeCategoryType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('name', TranslatableStringFormType::class)
->add('active', ChoiceType::class, array(
'choices' => array(
'Yes' => true,
'No' => false
),
'expanded' => true
))
->add('ordering', NumberType::class, [
'required' => true,
'scale' => 5
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults(array(
'data_class' => ActivityTypeCategory::class
));
}
}

View File

@@ -2,7 +2,13 @@
namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Entity\ActivityTypeCategory;
use Chill\ActivityBundle\Form\Type\ActivityFieldPresence;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
@@ -10,38 +16,56 @@ use Chill\MainBundle\Form\Type\TranslatableStringFormType;
class ActivityTypeType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
private TranslatableStringHelper $translatableStringHelper;
public function __construct(TranslatableStringHelper $translatableStringHelper)
{
$this->translatableStringHelper = $translatableStringHelper;
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name', TranslatableStringFormType::class)
->add('active', ChoiceType::class, array(
'choices' => array(
->add('active', ChoiceType::class, [
'choices' => [
'Yes' => true,
'No' => false
),
],
'expanded' => true
));
])
->add('category', EntityType::class, [
'class' => ActivityTypeCategory::class,
'choice_label' => function (ActivityTypeCategory $activityTypeCategory) {
return $this->translatableStringHelper->localize($activityTypeCategory->getName());
},
])
->add('ordering', NumberType::class, [
'required' => true,
'scale' => 5
])
;
$fields = [
'persons', 'user', 'date', 'place', 'persons',
'thirdParties', 'durationTime', 'travelTime', 'attendee',
'reasons', 'comment', 'sentReceived', 'documents',
'emergency', 'accompanyingPeriod', 'socialData', 'users'
];
foreach ($fields as $field) {
$builder
->add($field.'Visible', ActivityFieldPresence::class)
->add($field.'Label', TextType::class, [
'required' => false,
'empty_data' => '',
]);
}
}
/**
* @param OptionsResolverInterface $resolver
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Chill\ActivityBundle\Entity\ActivityType'
'data_class' => \Chill\ActivityBundle\Entity\ActivityType::class
));
}
/**
* @return string
*/
public function getBlockPrefix()
{
return 'chill_activitybundle_activitytype';
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace Chill\ActivityBundle\Form\Type;
use Chill\ActivityBundle\Entity\ActivityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ActivityFieldPresence extends AbstractType
{
public function getParent()
{
return ChoiceType::class;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
array(
'choices' => [
'Invisible' => ActivityType::FIELD_INVISIBLE,
'Optional' => ActivityType::FIELD_OPTIONAL,
'Required' => ActivityType::FIELD_REQUIRED,
],
)
);
}
}

View File

@@ -1,56 +1,29 @@
<?php
/*
* Chill is a software for social workers
*
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Chill\ActivityBundle\Form\Type;
use Chill\ActivityBundle\Repository\ActivityTypeRepository;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Doctrine\ORM\EntityRepository;
use Chill\ActivityBundle\Entity\ActivityType;
/**
* Description of TranslatableActivityType
*
* @author Champs-Libres Coop
*/
class TranslatableActivityType extends AbstractType
{
protected TranslatableStringHelperInterface $translatableStringHelper;
/**
*
* @var TranslatableStringHelper
*/
protected $translatableStringHelper;
protected $activityTypeRepository;
protected ActivityTypeRepository $activityTypeRepository;
public function __construct(
TranslatableStringHelper $helper,
EntityRepository $activityTypeRepository
)
{
TranslatableStringHelperInterface $helper,
ActivityTypeRepository $activityTypeRepository
) {
$this->translatableStringHelper = $helper;
$this->activityTypeRepository = $activityTypeRepository;
}
@@ -65,22 +38,21 @@ class TranslatableActivityType extends AbstractType
return EntityType::class;
}
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder, array $options) {
/* @var $qb \Doctrine\ORM\QueryBuilder */
public function buildForm(FormBuilderInterface $builder, array $options) {
/* @var QueryBuilder $qb */
$qb = $options['query_builder'];
if ($options['active_only'] === true) {
$qb->where($qb->expr()->eq('at.active', ':active'));
$qb->setParameter('active', true, \Doctrine\DBAL\Types\Type::BOOLEAN);
$qb->setParameter('active', true, Types::BOOLEAN);
}
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
array(
'class' => 'ChillActivityBundle:ActivityType',
'class' => ActivityType::class,
'active_only' => true,
'query_builder' => $this->activityTypeRepository
->createQueryBuilder('at'),

View File

@@ -0,0 +1,46 @@
<?php
namespace Chill\ActivityBundle\Menu;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Security;
use Symfony\Contracts\Translation\TranslatorInterface;
class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
{
protected TranslatorInterface $translator;
protected Security $security;
public function __construct(
Security $security,
TranslatorInterface $translator
) {
$this->security = $security;
$this->translator = $translator;
}
public static function getMenuIds(): array
{
return ['accompanyingCourse'];
}
public function buildMenu($menuId, MenuItem $menu, array $parameters)
{
$period = $parameters['accompanyingCourse'];
if (AccompanyingPeriod::STEP_DRAFT !== $period->getStep()
&& $this->security->isGranted(ActivityVoter::SEE, $period)) {
$menu->addChild($this->translator->trans('Activity'), [
'route' => 'chill_activity_activity_list',
'routeParameters' => [
'accompanying_period_id' => $period->getId(),
]])
->setExtras(['order' => 40]);
}
}
}

View File

@@ -0,0 +1,48 @@
<?php
declare(strict_types=1);
namespace Chill\ActivityBundle\Menu;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Security;
final class AdminMenuBuilder implements LocalMenuBuilderInterface
{
private Security $security;
public function __construct(Security $security)
{
$this->security = $security;
}
public static function getMenuIds(): array
{
return ['admin_index', 'admin_section', 'admin_activity'];
}
public function buildMenu($menuId, MenuItem $menu, array $parameters)
{
if (!$this->security->isGranted('ROLE_ADMIN')) {
return;
}
if (in_array($menuId, ['admin_index', 'admin_section'])) {
$menu->addChild('Activities', [
'route' => 'chill_admin_activity_index'
])
->setExtras([
'order' => 2000,
'explain' => "Activity configuration"
]);
} else {
$menu
->addChild('Activities', [
'route' => 'chill_admin_activity_index'
])
->setExtras([
'order' => '60'
]);
}
}
}

View File

@@ -1,88 +0,0 @@
<?php
/*
*
*/
namespace Chill\ActivityBundle\Menu;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Role\Role;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class MenuBuilder implements LocalMenuBuilderInterface
{
/**
*
* @var TokenStorageInterface
*/
protected $tokenStorage;
/**
*
* @var TranslatorInterface
*/
protected $translator;
/**
*
* @var AuthorizationHelper
*/
protected $authorizationHelper;
public function __construct(
TokenStorageInterface $tokenStorage,
TranslatorInterface $translator,
AuthorizationHelper $authorizationHelper
) {
$this->tokenStorage = $tokenStorage;
$this->translator = $translator;
$this->authorizationHelper = $authorizationHelper;
}
public function buildMenu($menuId, MenuItem $menu, array $parameters)
{
/* @var $person \Chill\PersonBundle\Entity\Person */
$person = $parameters['person'];
$user = $this->tokenStorage->getToken()->getUser();
$roleSee = new Role(ActivityVoter::SEE);
$roleAdd = new Role(ActivityVoter::CREATE);
if ($this->authorizationHelper->userHasAccess($user, $person, $roleSee)) {
$menu->addChild($this->translator->trans('Activity list'), [
'route' => 'chill_activity_activity_list',
'routeParameters' => [
'person_id' => $person->getId()
]
])
->setExtras([
'order' => 201
]);
}
if ($this->authorizationHelper->userHasAccess($user, $person, $roleAdd)) {
$menu->addChild($this->translator->trans('Add a new activity'), [
'route' => 'chill_activity_activity_new',
'routeParameters' => [
'person_id' => $person->getId()
]
])
->setExtras([
'order' => 200
]);
}
}
public static function getMenuIds(): array
{
return [ 'person' ];
}
}

View File

@@ -15,8 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\ActivityBundle\Menu;
namespace Chill\ActivityBundle\Menu;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
@@ -65,15 +64,6 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
->setExtra('order', 201)
;
}
if ($this->authorizationChecker->isGranted(ActivityVoter::CREATE, $person)) {
$menu->addChild(
$this->translator->trans('Add a new activity'), [
'route' => 'chill_activity_activity_new',
'routeParameters' => [ 'person_id' => $person->getId() ],
])
->setExtra('order', 200)
;
}
}
public static function getMenuIds(): array

View File

@@ -0,0 +1,24 @@
<?php
namespace Chill\ActivityBundle\Notification;
use Chill\MainBundle\Entity\Notification;
use Chill\ActivityBundle\Entity\Activity;
final class ActivityNotificationRenderer
{
public function supports(Notification $notification, array $options = []): bool
{
return $notification->getRelatedEntityClass() == Activity::class;
}
public function getTemplate()
{
return '@ChillActivity/Activity/showInNotification.html.twig';
}
public function getTemplateData(Notification $notification)
{
return ['notification' => $notification];
}
}

View File

@@ -0,0 +1,219 @@
<?php
/*
* Chill is a software for social workers
*
* Copyright (C) 2021, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\ActivityBundle\Repository;
use Chill\ActivityBundle\Entity\Activity;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
use Chill\ActivityBundle\Repository\ActivityRepository;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
use Chill\MainBundle\Entity\Scope;
use Doctrine\ORM\QueryBuilder;
use Doctrine\ORM\Query\Expr\Orx;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Role\Role;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Security\Core\Security;
final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInterface
{
private AuthorizationHelper $authorizationHelper;
private TokenStorageInterface $tokenStorage;
private ActivityRepository $repository;
private EntityManagerInterface $em;
private Security $security;
private CenterResolverDispatcher $centerResolverDispatcher;
public function __construct(
AuthorizationHelper $authorizationHelper,
CenterResolverDispatcher $centerResolverDispatcher,
TokenStorageInterface $tokenStorage,
ActivityRepository $repository,
EntityManagerInterface $em,
Security $security
) {
$this->authorizationHelper = $authorizationHelper;
$this->centerResolverDispatcher = $centerResolverDispatcher;
$this->tokenStorage = $tokenStorage;
$this->repository = $repository;
$this->em = $em;
$this->security = $security;
}
/**
* @param Person $person
* @param string $role
* @param int|null $start
* @param int|null $limit
* @param array $orderBy
* @return array|Activity[]
*/
public function findByPerson(Person $person, string $role, ?int $start = 0, ?int $limit = 1000, ?array $orderBy = []): array
{
$user = $this->security->getUser();
$center = $this->centerResolverDispatcher->resolveCenter($person);
if (0 === count($orderBy)) {
$orderBy = ['date' => 'DESC'];
}
$reachableScopes = $this->authorizationHelper
->getReachableCircles($user, $role, $center);
return $this->em->getRepository(Activity::class)
->findByPersonImplied($person, $reachableScopes, $orderBy, $limit, $start);
;
}
public function findByAccompanyingPeriod(AccompanyingPeriod $period, string $role, ?int $start = 0, ?int $limit = 1000, ?array $orderBy = []): array
{
$user = $this->security->getUser();
$center = $this->centerResolverDispatcher->resolveCenter($period);
if (0 === count($orderBy)) {
$orderBy = ['date' => 'DESC'];
}
$scopes = $this->authorizationHelper
->getReachableCircles($user, $role, $center);
return $this->em->getRepository(Activity::class)
->findByAccompanyingPeriod($period, $scopes, true, $limit, $start, $orderBy);
}
public function queryTimelineIndexer(string $context, array $args = []): array
{
$metadataActivity = $this->em->getClassMetadata(Activity::class);
$from = $this->getFromClauseCenter($args);
[$where, $parameters] = $this->getWhereClause($context, $args);
return [
'id' => $metadataActivity->getTableName()
.'.'.$metadataActivity->getColumnName('id'),
'type' => 'activity',
'date' => $metadataActivity->getTableName()
.'.'.$metadataActivity->getColumnName('date'),
'FROM' => $from,
'WHERE' => $where,
'parameters' => $parameters
];
}
private function getFromClauseCenter(array $args): string
{
$metadataActivity = $this->em->getClassMetadata(Activity::class);
$metadataPerson = $this->em->getClassMetadata(Person::class);
$associationMapping = $metadataActivity->getAssociationMapping('person');
return $metadataActivity->getTableName().' JOIN '
.$metadataPerson->getTableName().' ON '
.$metadataPerson->getTableName().'.'.
$associationMapping['joinColumns'][0]['referencedColumnName']
.' = '
.$associationMapping['joinColumns'][0]['name']
;
}
private function getWhereClause(string $context, array $args): array
{
$where = '';
$parameters = [];
$metadataActivity = $this->em->getClassMetadata(Activity::class);
$metadataPerson = $this->em->getClassMetadata(Person::class);
$activityToPerson = $metadataActivity->getAssociationMapping('person')['joinColumns'][0]['name'];
$activityToScope = $metadataActivity->getAssociationMapping('scope')['joinColumns'][0]['name'];
$personToCenter = $metadataPerson->getAssociationMapping('center')['joinColumns'][0]['name'];
// acls:
$role = new Role(ActivityVoter::SEE);
$reachableCenters = $this->authorizationHelper->getReachableCenters($this->tokenStorage->getToken()->getUser(),
$role);
if (count($reachableCenters) === 0) {
// insert a dummy condition
return 'FALSE = TRUE';
}
if ($context === 'person') {
// we start with activities having the person_id linked to person
$where .= sprintf('%s = ? AND ', $activityToPerson);
$parameters[] = $person->getId();
}
// we add acl (reachable center and scopes)
$where .= '('; // first loop for the for centers
$centersI = 0; // like centers#i
foreach ($reachableCenters as $center) {
// we pass if not in centers
if (!\in_array($center, $args['centers'])) {
continue;
}
// we get all the reachable scopes for this center
$reachableScopes = $this->authorizationHelper->getReachableScopes($this->tokenStorage->getToken()->getUser(), $role, $center);
// we get the ids for those scopes
$reachablesScopesId = array_map(
function(Scope $scope) { return $scope->getId(); },
$reachableScopes
);
// if not the first center
if ($centersI > 0) {
$where .= ') OR (';
}
// condition for the center
$where .= sprintf(' %s.%s = ? ', $metadataPerson->getTableName(), $personToCenter);
$parameters[] = $center->getId();
// begin loop for scopes
$where .= ' AND (';
$scopesI = 0; //like scope#i
foreach ($reachablesScopesId as $scopeId) {
if ($scopesI > 0) {
$where .= ' OR ';
}
$where .= sprintf(' %s.%s = ? ', $metadataActivity->getTableName(), $activityToScope);
$parameters[] = $scopeId;
$scopesI ++;
}
// close loop for scopes
$where .= ') ';
$centersI++;
}
// close loop for centers
$where .= ')';
return [$where, $parameters];
}
}

View File

@@ -0,0 +1,19 @@
<?php
namespace Chill\ActivityBundle\Repository;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
interface ActivityACLAwareRepositoryInterface
{
/**
* @return array|Activity[]
*/
public function findByPerson(Person $person, string $role, ?int $start = 0, ?int $limit = 1000, ?array $orderBy = []): array;
/**
* @return array|Activity[]
*/
public function findByAccompanyingPeriod(AccompanyingPeriod $period, string $role, ?int $start = 0, ?int $limit = 1000, ?array $orderBy = []): array;
}

View File

@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace Chill\ActivityBundle\Repository;
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @method ActivityReasonCategory|null find($id, $lockMode = null, $lockVersion = null)
* @method ActivityReasonCategory|null findOneBy(array $criteria, array $orderBy = null)
* @method ActivityReasonCategory[] findAll()
* @method ActivityReasonCategory[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class ActivityReasonCategoryRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, ActivityReasonCategory::class);
}
}

View File

@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace Chill\ActivityBundle\Repository;
use Chill\ActivityBundle\Entity\ActivityReason;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @method ActivityReason|null find($id, $lockMode = null, $lockVersion = null)
* @method ActivityReason|null findOneBy(array $criteria, array $orderBy = null)
* @method ActivityReason[] findAll()
* @method ActivityReason[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class ActivityReasonRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, ActivityReason::class);
}
}

View File

@@ -0,0 +1,91 @@
<?php
declare(strict_types=1);
namespace Chill\ActivityBundle\Repository;
use Chill\ActivityBundle\Entity\Activity;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @method Activity|null find($id, $lockMode = null, $lockVersion = null)
* @method Activity|null findOneBy(array $criteria, array $orderBy = null)
* @method Activity[] findAll()
* @method Activity[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class ActivityRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Activity::class);
}
/**
* @return Activity[]
*/
public function findByPersonImplied(Person $person, array $scopes, ?array $orderBy = [ 'date' => 'DESC'], ?int $limit = 100, ?int $offset = 0): array
{
$qb = $this->createQueryBuilder('a');
$qb->select('a');
$qb
->where($qb->expr()->in('a.scope', ':scopes'))
->setParameter('scopes', $scopes)
->andWhere(
$qb->expr()->orX(
$qb->expr()->eq('a.person', ':person'),
':person MEMBER OF a.persons'
)
)
->setParameter('person', $person);
foreach ($orderBy as $k => $dir) {
$qb->addOrderBy('a.'.$k, $dir);
}
$qb->setMaxResults($limit)->setFirstResult($offset);
return $qb->getQuery()->getResult();
}
/**
* @return Activity[]
*/
public function findByAccompanyingPeriod(AccompanyingPeriod $period, array $scopes, ?bool $allowNullScope = false, ?int $limit = 100, ?int $offset = 0, array $orderBy = ['date' => 'desc']): array
{
$qb = $this->createQueryBuilder('a');
$qb->select('a');
if (!$allowNullScope) {
$qb
->where($qb->expr()->in('a.scope', ':scopes'))
->setParameter('scopes', $scopes);
} else {
$qb
->where(
$qb->expr()->orX(
$qb->expr()->in('a.scope', ':scopes'),
$qb->expr()->isNull('a.scope')
)
)
->setParameter('scopes', $scopes);
}
$qb
->andWhere(
$qb->expr()->eq('a.accompanyingPeriod', ':period')
)
->setParameter('period', $period);
foreach ($orderBy as $k => $dir) {
$qb->addOrderBy('a.'.$k, $dir);
}
$qb->setMaxResults($limit)->setFirstResult($offset);
return $qb->getQuery()->getResult();
}
}

View File

@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace Chill\ActivityBundle\Repository;
use Chill\ActivityBundle\Entity\ActivityTypeCategory;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @method ActivityTypeCategory|null find($id, $lockMode = null, $lockVersion = null)
* @method ActivityTypeCategory|null findOneBy(array $criteria, array $orderBy = null)
* @method ActivityTypeCategory[] findAll()
* @method ActivityTypeCategory[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class ActivityTypeCategoryRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, ActivityTypeCategory::class);
}
}

View File

@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace Chill\ActivityBundle\Repository;
use Chill\ActivityBundle\Entity\ActivityType;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @method ActivityType|null find($id, $lockMode = null, $lockVersion = null)
* @method ActivityType|null findOneBy(array $criteria, array $orderBy = null)
* @method ActivityType[] findAll()
* @method ActivityType[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class ActivityTypeRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, ActivityType::class);
}
}

View File

@@ -1,10 +0,0 @@
@import '~ChillMainSass/custom/config/colors';
@import '~ChillMainSass/custom/mixins/entity';
.chill-entity.chill-entity__activity-reason {
@include entity($chill-pink, white);
}
.activity {
color: $chill-green;
}

View File

@@ -0,0 +1,88 @@
// Access to Bootstrap variables and mixins
@import '~ChillMainAssets/module/bootstrap/shared';
//// ACTIVITY CREATION
// first step: select type page
div.new-activity-select-type {
div.activity-row {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
gap: 12px;
div.bloc {
width: 200px;
align-self: flex-end;
height: 140px;
display: flex;
justify-content: center;
align-items: center;
}
}
}
//// ACTIVITY LIST PAGE
// precise badge-title specific details
h2.badge-title {
div.duration {
font-size: smaller;
padding-left: 1em;
margin-top: 1em;
}
ul.list-content {
font-size: 70%;
list-style-type: none;
padding-left: 0;
margin: 0;
li {
margin-bottom: 0.2em;
// exception: change bg color for action badges above badge-title
.bg-light {
background-color: $chill-light-gray !important;
}
}
}
}
div.main {
padding: 1em;
}
//// ACTIVITY SHOW AND FORM PAGES
// Exceptions for flex-bloc in concerned-groups
div.flex-bloc.concerned-groups {
margin-top: 1em;
div.item-bloc {
flex-grow: 0; flex-shrink: 0; flex-basis: 25%; //4 blocs
ul.list-content {
list-style-type: none;
padding-left: 0;
li {
margin-bottom: 0.2em;
a {
color: $white;
cursor: pointer;
&:hover {
color: #ffffffab;
}
}
}
}
}
&.person div.item-bloc {
flex-basis: 33%; //3 blocs
}
}
/// CHILL ENTITY RENDER BOX
.chill-entity {
/// ACTIVITY-REASON
&.entity-activity-reason {
margin-right: 0.3em;
font-size: 120%;
}
}

View File

@@ -0,0 +1 @@
require('./chillactivity.scss');

View File

@@ -1 +0,0 @@
require('./activity/activity.scss');

View File

@@ -0,0 +1,20 @@
<template>
<concerned-groups></concerned-groups>
<social-issues-acc></social-issues-acc>
<location></location>
</template>
<script>
import ConcernedGroups from './components/ConcernedGroups.vue';
import SocialIssuesAcc from './components/SocialIssuesAcc.vue';
import Location from './components/Location.vue';
export default {
name: "App",
components: {
ConcernedGroups,
SocialIssuesAcc,
Location
}
}
</script>

View File

@@ -0,0 +1,63 @@
import { getSocialIssues } from 'ChillPersonAssets/vuejs/AccompanyingCourse/api.js';
/*
* Load socialActions by socialIssue (id)
*/
const getSocialActionByIssue = (id) => {
const url = `/api/1.0/person/social/social-action/by-social-issue/${id}.json`;
return fetch(url)
.then(response => {
if (response.ok) { return response.json(); }
throw Error('Error with request resource response');
});
};
/*
* Load Locations
*/
const getLocations = () => {
const url = `/api/1.0/main/location.json`;
return fetch(url)
.then(response => {
if (response.ok) { return response.json(); }
throw Error('Error with request resource response');
});
};
/*
* Load Location Types
*/
const getLocationTypes = () => {
const url = `/api/1.0/main/location-type.json`;
return fetch(url)
.then(response => {
if (response.ok) { return response.json(); }
throw Error('Error with request resource response');
});
};
/*
* Post a Location
*/
const postLocation = (body) => {
const url = `/api/1.0/main/location.json`;
return fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=utf-8'
},
body: JSON.stringify(body)
})
.then(response => {
if (response.ok) { return response.json(); }
throw Error('Error with request resource response');
});
};
export {
getSocialIssues,
getSocialActionByIssue,
getLocations,
getLocationTypes,
postLocation
};

View File

@@ -0,0 +1,191 @@
<template>
<teleport to="#add-persons">
<div class="flex-bloc concerned-groups" :class="getContext">
<persons-bloc
v-for="bloc in contextPersonsBlocs"
v-bind:key="bloc.key"
v-bind:bloc="bloc"
v-bind:setPersonsInBloc="setPersonsInBloc">
</persons-bloc>
</div>
<div v-if="getContext === 'accompanyingCourse' && filterSuggestedPersons.length > 0">
<ul class="list-unstyled">
<li v-for="p in filterSuggestedPersons" @click="addNewPerson(p)">
<span class="badge bg-primary" style="cursor: pointer;">
<i class="fa fa-plus fa-fw text-success"></i>
{{ p.text }}
</span>
</li>
</ul>
</div>
<add-persons
buttonTitle="activity.add_persons"
modalTitle="activity.add_persons"
v-bind:key="addPersons.key"
v-bind:options="addPersons.options"
@addNewPersons="addNewPersons"
ref="addPersons">
</add-persons>
</teleport>
</template>
<script>
import { mapState, mapGetters } from 'vuex';
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
import PersonsBloc from './ConcernedGroups/PersonsBloc.vue';
export default {
name: "ConcernedGroups",
components: {
AddPersons,
PersonsBloc
},
data() {
return {
personsBlocs: [
{ key: 'persons',
title: 'activity.bloc_persons',
persons: [],
included: false
},
{ key: 'personsAssociated',
title: 'activity.bloc_persons_associated',
persons: [],
included: false
},
{ key: 'personsNotAssociated',
title: 'activity.bloc_persons_not_associated',
persons: [],
included: false
},
{ key: 'thirdparty',
title: 'activity.bloc_thirdparty',
persons: [],
included: true
},
{ key: 'users',
title: 'activity.bloc_users',
persons: [],
included: true
},
],
addPersons: {
key: 'activity',
options: {
type: ['person', 'thirdparty', 'user'],
priority: null,
uniq: false,
button: {
size: 'btn-sm'
}
}
}
}
},
computed: {
...mapState({
persons: state => state.activity.persons,
thirdParties: state => state.activity.thirdParties,
users: state => state.activity.users,
accompanyingCourse: state => state.activity.accompanyingPeriod
}),
...mapGetters([
'filterSuggestedPersons'
]),
getContext() {
return (this.accompanyingCourse) ? "accompanyingCourse" : "person";
},
contextPersonsBlocs() {
return this.personsBlocs.filter(bloc => bloc.included !== false);
}
},
mounted() {
this.setPersonsInBloc();
},
methods: {
setPersonsInBloc() {
let groups;
if (this.accompanyingCourse) {
groups = this.splitPersonsInGroups();
}
this.personsBlocs.forEach(bloc => {
if (this.accompanyingCourse) {
switch (bloc.key) {
case 'personsAssociated':
bloc.persons = groups.personsAssociated;
bloc.included = true;
break;
case 'personsNotAssociated':
bloc.persons = groups.personsNotAssociated;
bloc.included = true;
break;
}
} else {
switch (bloc.key) {
case 'persons':
bloc.persons = this.persons;
bloc.included = true;
break;
}
}
switch (bloc.key) {
case 'thirdparty':
bloc.persons = this.thirdParties;
break;
case 'users':
bloc.persons = this.users;
break;
}
}, groups);
},
splitPersonsInGroups() {
let personsAssociated = [];
let personsNotAssociated = this.persons;
let participations = this.getCourseParticipations();
this.persons.forEach(person => {
participations.forEach(participation => {
if (person.id === participation.id) {
//console.log(person.id);
personsAssociated.push(person);
personsNotAssociated = personsNotAssociated.filter(p => p !== person);
}
});
});
return {
'personsAssociated': personsAssociated,
'personsNotAssociated': personsNotAssociated
};
},
getCourseParticipations() {
let participations = [];
this.accompanyingCourse.participations.forEach(participation => {
if (!participation.endDate) {
participations.push(participation.person);
}
});
return participations;
},
addNewPersons({ selected, modal }) {
console.log('@@@ CLICK button addNewPersons', selected);
selected.forEach(function(item) {
this.$store.dispatch('addPersonsInvolved', item);
}, this
);
this.$refs.addPersons.resetSearch(); // to cast child method
modal.showModal = false;
this.setPersonsInBloc();
},
addNewPerson(person) {
this.$store.dispatch('addPersonsInvolved', { result: person, type: 'person' });
this.setPersonsInBloc();
},
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,29 @@
<template>
<li>
<span class="badge bg-primary" :title="person.text">
<span class="chill_denomination">
{{ textCutted }}
</span>
<a class="fa fa-fw fa-times text-danger text-decoration-none"
@click.prevent="$emit('remove', person)">
</a>
</span>
</li>
</template>
<script>
export default {
name: "PersonBadge",
props: ['person'],
computed: {
textCutted() {
let more = (this.person.text.length > 15) ?'…' : '';
return this.person.text.slice(0,15) + more;
}
},
emits: ['remove'],
}
</script>
<style lang="css" scoped>
</style>

View File

@@ -0,0 +1,41 @@
<template>
<div class="item-bloc">
<div class="item-row">
<div class="item-col">
<h4>{{ $t(bloc.title) }}</h4>
</div>
<div class="item-col">
<ul class="list-content">
<person-badge
v-for="person in bloc.persons"
v-bind:key="person.id"
v-bind:person="person"
@remove="removePerson">
</person-badge>
</ul>
</div>
</div>
</div>
</template>
<script>
import PersonBadge from './PersonBadge.vue';
export default {
name:"PersonsBloc",
components: {
PersonBadge
},
props: ['bloc', 'setPersonsInBloc'],
methods: {
removePerson(item) {
console.log('@@ CLICK remove person: item', item);
this.$store.dispatch('removePersonInvolved', item);
this.setPersonsInBloc();
}
}
}
</script>
<style lang="scss">
</style>

View File

@@ -0,0 +1,74 @@
<template>
<teleport to="#location">
<div class="mb-3 row">
<label class="col-form-label col-sm-4">
{{ $t('activity.location') }}
</label>
<div class="col-sm-8">
<VueMultiselect
name="selectLocation"
id="selectLocation"
label="name"
track-by="id"
open-direction="top"
:multiple="false"
:searchable="true"
:placeholder="$t('activity.choose_location')"
:custom-label="customLabel"
:options="locations"
v-model="location">
</VueMultiselect>
<new-location v-bind:locations="locations"></new-location>
</div>
</div>
</teleport>
</template>
<script>
import { mapState } from "vuex";
import VueMultiselect from 'vue-multiselect';
import NewLocation from './Location/NewLocation.vue';
import { getLocations } from '../api.js';
export default {
name: "Location",
components: {
NewLocation,
VueMultiselect
},
data() {
return {
locations: []
}
},
computed: {
...mapState(['activity']),
location: {
get() {
return this.activity.location;
},
set(value) {
this.$store.dispatch('updateLocation', value);
}
}
},
mounted() {
this.getLocationsList();
},
methods: {
getLocationsList() {
getLocations().then(response => new Promise(resolve => {
console.log('getLocations', response);
this.locations = response.results;
resolve();
}))
},
customLabel(value) {
return `${value.locationType.title.fr} ${value.name ? value.name : ''}`;
}
}
}
</script>

View File

@@ -0,0 +1,271 @@
<template>
<div>
<ul class="record_actions">
<li>
<a class="btn btn-sm btn-create" @click="openModal">
{{ $t('activity.create_new_location') }}
</a>
</li>
</ul>
<teleport to="body">
<modal v-if="modal.showModal"
:modalDialogClass="modal.modalDialogClass"
@close="modal.showModal = false">
<template v-slot:header>
<h3 class="modal-title">{{ $t('activity.create_new_location') }}</h3>
</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>
<option v-for="t in locationTypes" :value="t" :key="t.id">
{{ t.title.fr }}
</option>
</select>
<label>{{ $t('activity.location_fields.type') }}</label>
</div>
<div class="form-floating mb-3">
<input class="form-control form-control-lg" id="name" v-model="inputName" placeholder />
<label for="name">{{ $t('activity.location_fields.name') }}</label>
</div>
<add-address
:context="addAddress.context"
:options="addAddress.options"
:addressChangedCallback="submitNewAddress"
v-if="showAddAddress"
ref="addAddress">
</add-address>
<div class="form-floating mb-3" v-if="showContactData">
<input class="form-control form-control-lg" id="phonenumber1" v-model="inputPhonenumber1" placeholder />
<label for="phonenumber1">{{ $t('activity.location_fields.phonenumber1') }}</label>
</div>
<div class="form-floating mb-3" v-if="hasPhonenumber1">
<input class="form-control form-control-lg" id="phonenumber2" v-model="inputPhonenumber2" placeholder />
<label for="phonenumber2">{{ $t('activity.location_fields.phonenumber2') }}</label>
</div>
<div class="form-floating mb-3" v-if="showContactData">
<input class="form-control form-control-lg" id="email" v-model="inputEmail" placeholder />
<label for="email">{{ $t('activity.location_fields.email') }}</label>
</div>
</form>
</template>
<template v-slot:footer>
<button class="btn btn-save"
@click.prevent="saveNewLocation"
>
{{ $t('action.save') }}
</button>
</template>
</modal>
</teleport>
</div>
</template>
<script>
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";
export default {
name: "NewLocation",
components: {
Modal,
AddAddress,
},
props: ['locations'],
data() {
return {
errors: [],
selected: {
type: null,
name: null,
addressId: null,
phonenumber1: null,
phonenumber2: null,
email: null,
},
locationTypes: [],
modal: {
showModal: false,
modalDialogClass: "modal-dialog-scrollable modal-xl"
},
addAddress: {
options: {
button: {
text: { create: 'activity.create_address', edit: 'activity.edit_address' },
size: 'btn-sm'
},
title: { create: 'activity.create_address', edit: 'activity.edit_address' },
},
context: {
target: { //name, id
},
edit: false,
addressId: null
}
}
}
},
computed: {
...mapState(['activity']),
selectType: {
get() {
return this.selected.type;
},
set(value) {
this.selected.type = value;
}
},
inputName: {
get() {
return this.selected.name;
},
set(value) {
this.selected.name = value;
}
},
inputEmail: {
get() {
return this.selected.email;
},
set(value) {
this.selected.email = value;
}
},
inputPhonenumber1: {
get() {
return this.selected.phonenumber1;
},
set(value) {
this.selected.phonenumber1 = value;
}
},
inputPhonenumber2: {
get() {
return this.selected.phonenumber2;
},
set(value) {
this.selected.phonenumber2 = value;
}
},
hasPhonenumber1() {
return this.selected.phonenumber1 !== null && this.selected.phonenumber1 !== "";
},
showAddAddress() {
let cond = false;
if (this.selected.type) {
if (this.selected.type.addressRequired !== 'never') {
cond = true;
}
}
return cond;
},
showContactData() {
let cond = false;
if (this.selected.type) {
if (this.selected.type.contactData !== 'never') {
cond = true;
}
}
return cond;
},
},
mounted() {
this.getLocationTypesList();
},
methods: {
checkForm() {
let cond = true;
this.errors = [];
if (!this.selected.type) {
this.errors.push('Type de localisation requis');
cond = false;
} else {
if (this.selected.type.addressRequired === 'required' && !this.selected.addressId) {
this.errors.push('Adresse requise');
cond = false;
}
if (this.selected.type.contactData === 'required' && !this.selected.phonenumber1) {
this.errors.push('Numéro de téléphone requis');
cond = false;
}
if (this.selected.type.contactData === 'required' && !this.selected.email) {
this.errors.push('Adresse email requise');
cond = false;
}
}
return cond;
},
getLocationTypesList() {
getLocationTypes().then(response => new Promise(resolve => {
console.log('getLocationTypes', response);
this.locationTypes = response.results.filter(t => t.availableForUsers === true);
resolve();
}))
},
openModal() {
this.modal.showModal = true;
},
saveNewLocation() {
if (this.checkForm()) {
console.log('saveNewLocation', this.selected);
let body = {
type: 'location',
name: this.selected.name,
locationType: {
id: this.selected.type.id,
type: 'location-type'
},
phonenumber1: this.selected.phonenumber1,
phonenumber2: this.selected.phonenumber2,
email: this.selected.email,
};
if (this.selected.addressId) {
body = Object.assign(body, {
address: {
id: this.selected.addressId
}
});
}
postLocation(body)
.then(
location => new Promise(resolve => {
console.log('postLocation', location);
this.locations.push(location);
this.$store.dispatch('updateLocation', location);
resolve();
this.modal.showModal = false;
})
).catch(
err => {
this.errors.push(err.message);
}
);
};
},
submitNewAddress(payload) {
console.log('submitNewAddress', payload);
this.selected.addressId = payload.addressId;
this.addAddress.context.addressId = payload.addressId;
this.addAddress.context.edit = true;
}
}
}
</script>

View File

@@ -0,0 +1,212 @@
<template>
<teleport to="#social-issues-acc">
<div class="mb-3 row">
<div class="col-4">
<label class="col-form-label">{{ $t('activity.social_issues') }}</label>
</div>
<div class="col-8">
<check-social-issue
v-for="issue in socialIssuesList"
v-bind:key="issue.id"
v-bind:issue="issue"
v-bind:selection="socialIssuesSelected"
@updateSelected="updateIssuesSelected">
</check-social-issue>
<div class="my-3">
<VueMultiselect
name="otherIssues"
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"
@select="addIssueInList">
</VueMultiselect>
</div>
</div>
</div>
<div class="mb-3 row">
<div class="col-4">
<label class="col-form-label">{{ $t('activity.social_actions') }}</label>
</div>
<div class="col-8">
<div v-if="actionIsLoading === true">
<i class="chill-green fa fa-circle-o-notch fa-spin fa-lg"></i>
</div>
<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"
@updateSelected="updateActionsSelected">
</check-social-action>
<span v-else class="inline-choice chill-no-data-statement mt-3">
{{ $t('activity.select_first_a_social_issue') }}
</span>
</div>
</div>
</teleport>
</template>
<script>
import VueMultiselect from 'vue-multiselect';
import CheckSocialIssue from './SocialIssuesAcc/CheckSocialIssue.vue';
import CheckSocialAction from './SocialIssuesAcc/CheckSocialAction.vue';
import { getSocialIssues, getSocialActionByIssue } from '../api.js';
export default {
name: "SocialIssuesAcc",
components: {
CheckSocialIssue,
CheckSocialAction,
VueMultiselect
},
data() {
return {
issueIsLoading: false,
actionIsLoading: false
}
},
computed: {
socialIssuesList() {
return this.$store.state.activity.accompanyingPeriod.socialIssues;
},
socialIssuesSelected() {
return this.$store.state.activity.socialIssues;
},
socialIssuesOther() {
return this.$store.state.socialIssuesOther;
},
socialActionsList() {
return this.$store.state.socialActionsList;
},
socialActionsSelected() {
return this.$store.state.activity.socialActions;
}
},
mounted() {
/* Load others issues in multiselect
*/
this.issueIsLoading = true;
getSocialIssues().then(response => new Promise((resolve, reject) => {
this.$store.commit('updateIssuesOther', response.results);
/* Add in list the issues already associated (if not yet listed)
*/
this.socialIssuesSelected.forEach(issue => {
if (this.socialIssuesList.filter(i => i.id === issue.id).length !== 1) {
this.$store.commit('addIssueInList', issue);
}
}, this);
/* Remove from multiselect the issues that are not yet in checkbox list
*/
this.socialIssuesList.forEach(issue => {
this.$store.commit('removeIssueInOther', issue);
}, this);
/* Filter issues
*/
this.$store.commit('filterList', 'issues');
/* Add in list the actions already associated (if not yet listed)
*/
this.socialActionsSelected.forEach(action => {
this.$store.commit('addActionInList', action);
}, this);
/* Filter issues
*/
this.$store.commit('filterList', 'actions');
this.issueIsLoading = false;
resolve();
}));
},
methods: {
/* When choosing an issue in multiselect, add it in checkboxes (as selected),
remove it from multiselect, and add socialActions concerned
*/
addIssueInList(value) {
//console.log('addIssueInList', value);
this.$store.commit('addIssueInList', value);
this.$store.commit('removeIssueInOther', value);
this.$store.dispatch('addIssueSelected', value);
this.updateActionsList();
},
/* Update value for selected issues checkboxes
*/
updateIssuesSelected(issues) {
//console.log('updateIssuesSelected', issues);
this.$store.dispatch('updateIssuesSelected', issues);
this.updateActionsList();
},
/* Update value for selected actions checkboxes
*/
updateActionsSelected(actions) {
//console.log('updateActionsSelected', actions);
this.$store.dispatch('updateActionsSelected', actions);
},
/* Add socialActions concerned: after reset, loop on each issue selected
to get social actions concerned
*/
updateActionsList() {
//console.log('updateActionsList');
this.resetActionsList();
this.socialIssuesSelected.forEach(item => {
this.actionIsLoading = true;
getSocialActionByIssue(item.id)
.then(actions => new Promise((resolve, reject) => {
actions.results.forEach(action => {
this.$store.commit('addActionInList', action);
}, this);
this.$store.commit('filterList', 'actions');
this.actionIsLoading = false;
resolve();
}));
}, this);
},
/* Reset socialActions List: flush list and restore selected actions
*/
resetActionsList() {
this.$store.commit('resetActionsList');
this.socialActionsSelected.forEach(item => {
this.$store.commit('addActionInList', item);
}, this);
}
}
}
</script>
<style src="vue-multiselect/dist/vue-multiselect.css"></style>
<style lang="scss" scoped>
span.multiselect__single {
display: none !important;
}
</style>

View File

@@ -0,0 +1,36 @@
<template>
<span class="inline-choice">
<div class="form-check">
<input class="form-check-input"
type="checkbox"
v-model="selected"
name="action"
v-bind:id="action.id"
v-bind:value="action"
/>
<label class="form-check-label" v-bind:for="action.id">
{{ action.text }}
</label>
</div>
</span>
</template>
<script>
export default {
name: "CheckSocialAction",
props: [ 'action', 'selection' ],
emits: [ 'updateSelected' ],
computed: {
selected: {
set(value) {
this.$emit('updateSelected', value);
},
get() {
return this.selection;
}
}
}
}
</script>

View File

@@ -0,0 +1,36 @@
<template>
<span class="inline-choice">
<div class="form-check">
<input class="form-check-input"
type="checkbox"
v-model="selected"
name="issue"
v-bind:id="issue.id"
v-bind:value="issue"
/>
<label class="form-check-label" v-bind:for="issue.id">
{{ issue.text }}
</label>
</div>
</span>
</template>
<script>
export default {
name: "CheckSocialIssue",
props: [ 'issue', 'selection' ],
emits: [ 'updateSelected' ],
computed: {
selected: {
set(value) {
this.$emit('updateSelected', value);
},
get() {
return this.selection;
}
}
}
}
</script>

View File

@@ -0,0 +1,44 @@
import { personMessages } from 'ChillPersonAssets/vuejs/_js/i18n'
const activityMessages = {
fr: {
activity: {
//
errors: "Le formulaire contient des erreurs",
social_issues: "Problématiques sociales",
choose_other_social_issue: "Ajouter une autre problématique sociale...",
social_actions: "Actions d'accompagnement",
select_first_a_social_issue: "Sélectionnez d'abord une problématique sociale",
//
add_persons: "Ajouter des personnes concernées",
bloc_persons: "Usagers",
bloc_persons_associated: "Usagers du parcours",
bloc_persons_not_associated: "Tiers non-pro.",
bloc_thirdparty: "Tiers professionnels",
bloc_users: "T(M)S",
//
location: "Localisation",
choose_location: "Choisissez une localisation",
choose_location_type: "Choisissez un type de localisation",
create_new_location: "Créer une nouvelle localisation",
location_fields: {
name: "Nom",
type: "Type",
phonenumber1: "Téléphone",
phonenumber2: "Autre téléphone",
email: "Adresse courriel",
},
create_address: 'Créer une adresse',
edit_address: "Modifier l'adresse"
}
}
}
Object.assign(activityMessages.fr, personMessages.fr);
export {
activityMessages
};

View File

@@ -0,0 +1,16 @@
import { createApp } from 'vue';
import { _createI18n } from 'ChillMainAssets/vuejs/_js/i18n'
import { activityMessages } from './i18n'
import store from './store'
import App from './App.vue';
const i18n = _createI18n(activityMessages);
const app = createApp({
template: `<app></app>`,
})
.use(store)
.use(i18n)
.component('app', App)
.mount('#activity');

View File

@@ -0,0 +1,190 @@
import 'es6-promise/auto';
import { createStore } from 'vuex';
const debug = process.env.NODE_ENV !== 'production';
//console.log('window.activity', window.activity);
const addIdToValue = (string, id) => {
let array = string ? string.split(',') : [];
array.push(id.toString());
let str = array.join();
return str;
};
const removeIdFromValue = (string, id) => {
let array = string.split(',');
array = array.filter(el => el !== id.toString());
let str = array.join();
return str;
};
const store = createStore({
strict: debug,
state: {
activity: window.activity,
socialIssuesOther: [],
socialActionsList: [],
},
getters: {
filterSuggestedPersons(state) {
if (typeof(state.activity.accompanyingPeriod) === 'undefined') {
return [];
}
let existingPersonIds = state.activity.persons.map(p => p.id);
return state.activity.accompanyingPeriod.participations.filter(p => p.endDate === null)
.map(p => p.person)
.filter(p => !existingPersonIds.includes(p.id))
}
},
mutations: {
// SocialIssueAcc
addIssueInList(state, issue) {
//console.log('add issue list', issue.id);
state.activity.accompanyingPeriod.socialIssues.push(issue);
},
addIssueSelected(state, issue) {
//console.log('add issue selected', issue.id);
state.activity.socialIssues.push(issue);
},
updateIssuesSelected(state, issues) {
//console.log('update issues selected', issues);
state.activity.socialIssues = issues;
},
updateIssuesOther(state, payload) {
//console.log('update issues other');
state.socialIssuesOther = payload;
},
removeIssueInOther(state, issue) {
//console.log('remove issue other', issue.id);
state.socialIssuesOther = state.socialIssuesOther.filter(i => i.id !== issue.id);
},
resetActionsList(state) {
//console.log('reset list actions');
state.socialActionsList = [];
},
addActionInList(state, action) {
//console.log('add action list', action.id);
state.socialActionsList.push(action);
},
updateActionsSelected(state, actions) {
//console.log('update actions selected', actions);
state.activity.socialActions = actions;
},
filterList(state, list) {
const filterList = (list) => {
// remove duplicates entries
list = list.filter((value, index) => list.findIndex(array => array.id === value.id) === index);
// alpha sort
list.sort((a,b) => (a.text > b.text) ? 1 : ((b.text > a.text) ? -1 : 0));
return list;
};
if (list === 'issues') {
state.activity.accompanyingPeriod.socialIssues = filterList(state.activity.accompanyingPeriod.socialIssues);
}
if (list === 'actions') {
state.socialActionsList = filterList(state.socialActionsList);
}
},
// ConcernedGroups
addPersonsInvolved(state, payload) {
//console.log('### mutation addPersonsInvolved', payload.result.type);
switch (payload.result.type) {
case 'person':
state.activity.persons.push(payload.result);
break;
case 'thirdparty':
state.activity.thirdParties.push(payload.result);
break;
case 'user':
state.activity.users.push(payload.result);
break;
};
},
removePersonInvolved(state, payload) {
//console.log('### mutation removePersonInvolved', payload.type);
switch (payload.type) {
case 'person':
state.activity.persons = state.activity.persons.filter(person => person !== payload);
break;
case 'thirdparty':
state.activity.thirdParties = state.activity.thirdParties.filter(thirdparty => thirdparty !== payload);
break;
case 'user':
state.activity.users = state.activity.users.filter(user => user !== payload);
break;
};
},
updateLocation(state, value) {
console.log('### mutation: updateLocation', value);
state.activity.location = value;
}
},
actions: {
addIssueSelected({ commit }, issue) {
let aSocialIssues = document.getElementById("chill_activitybundle_activity_socialIssues");
aSocialIssues.value = addIdToValue(aSocialIssues.value, issue.id);
commit('addIssueSelected', issue);
},
updateIssuesSelected({ commit }, payload) {
let aSocialIssues = document.getElementById("chill_activitybundle_activity_socialIssues");
aSocialIssues.value = '';
payload.forEach(item => {
aSocialIssues.value = addIdToValue(aSocialIssues.value, item.id);
});
commit('updateIssuesSelected', payload);
},
updateActionsSelected({ commit }, payload) {
let aSocialActions = document.getElementById("chill_activitybundle_activity_socialActions");
aSocialActions.value = '';
payload.forEach(item => {
aSocialActions.value = addIdToValue(aSocialActions.value, item.id);
});
commit('updateActionsSelected', payload);
},
addPersonsInvolved({ commit }, payload) {
//console.log('### action addPersonsInvolved', payload.result.type);
switch (payload.result.type) {
case 'person':
let aPersons = document.getElementById("chill_activitybundle_activity_persons");
aPersons.value = addIdToValue(aPersons.value, payload.result.id);
break;
case 'thirdparty':
let aThirdParties = document.getElementById("chill_activitybundle_activity_thirdParties");
aThirdParties.value = addIdToValue(aThirdParties.value, payload.result.id);
break;
case 'user':
let aUsers = document.getElementById("chill_activitybundle_activity_users");
aUsers.value = addIdToValue(aUsers.value, payload.result.id);
break;
};
commit('addPersonsInvolved', payload);
},
removePersonInvolved({ commit }, payload) {
//console.log('### action removePersonInvolved', payload);
switch (payload.type) {
case 'person':
let aPersons = document.getElementById("chill_activitybundle_activity_persons");
aPersons.value = removeIdFromValue(aPersons.value, payload.id);
break;
case 'thirdparty':
let aThirdParties = document.getElementById("chill_activitybundle_activity_thirdParties");
aThirdParties.value = removeIdFromValue(aThirdParties.value, payload.id);
break;
case 'user':
let aUsers = document.getElementById("chill_activitybundle_activity_users");
aUsers.value = removeIdFromValue(aUsers.value, payload.id);
break;
};
commit('removePersonInvolved', payload);
},
updateLocation({ commit }, value) {
console.log('### action: updateLocation', value);
let hiddenLocation = document.getElementById("chill_activitybundle_activity_location");
hiddenLocation.value = value.id;
commit('updateLocation', value);
}
}
});
export default store;

View File

@@ -0,0 +1,90 @@
<h2 class="badge-title">
<span class="title_label">
{% if activity.date %}
<h3>{{ activity.date|format_date('short') }}</h3>
{% endif %}
<div class="duration">
{% if activity.durationTime and t.durationTimeVisible %}
<p>
<abbr class="fa fa-fw fa-hourglass-end" title="{{ 'Duration Time'|trans }}"></abbr>
{{ activity.durationTime|date('H:i') }}
</p>
{% endif %}
{% if activity.travelTime and t.travelTimeVisible %}
<p>
<abbr class="fa fa-fw fa-car" title="{{ 'Travel time'|trans }}"></abbr>
{{ activity.travelTime|date('H:i') }}
</p>
{% endif %}
</div>
</span>
<span class="title_action">
{{ activity.type.name | localize_translatable_string }}
<ul class="small_in_title">
{% if activity.location and t.locationVisible %}
<li>
<span class="item-key">{{ 'location'|trans ~ ': ' }}</span>
<span>{{ activity.location.locationType.title|localize_translatable_string }}</span>
{{ activity.location.name }}
</li>
{% endif %}
{% if activity.user and t.userVisible %}
<li>
<span class="item-key">{{ 'Referrer'|trans ~ ': ' }}</span>
{{ activity.user.usernameCanonical }}
</li>
{% endif %}
</ul>
<ul class="list-content">
{%- if t.reasonsVisible -%}
{%- if activity.reasons is not empty -%}
<li class="reasons">
{% for r in activity.reasons %}
{{ r|chill_entity_render_box }}
{% endfor %}
</li>
{%- endif -%}
{% endif %}
{%- if t.socialIssuesVisible %}
{%- if activity.socialIssues is not empty -%}
<li class="social-issues">
{% for r in activity.socialIssues %}
{{ r|chill_entity_render_box }}
{% endfor %}
</li>
{%- endif -%}
{% endif %}
{%- if t.socialActionsVisible -%}
{%- if activity.socialActions is not empty -%}
<li class="social-actions">
{% for r in activity.socialActions %}
{{ r|chill_entity_render_box }}
{% endfor %}
</li>
{%- endif -%}
{% endif %}
</ul>
</span>
</h2>
{#
{% if context == 'person' and activity.accompanyingPeriod is not empty %}
<div class="mt-3">
<a class="btn btn-sm btn-outline-primary"
title="{{ 'Period number %number%'|trans({'%number%': activity.accompanyingPeriod.id}) }}"
href="{{ chill_path_add_return_path(
"chill_person_accompanying_course_index",
{ 'accompanying_period_id': activity.accompanyingPeriod.id }
) }}"><i class="fa fa-random"></i>
</a>
</div>
{% endif %}
#}

View File

@@ -0,0 +1,153 @@
{% macro href(pathname, key, value) %}
{% set parms = { (key): value } %}
{{ path(pathname, parms) }}
{% endmacro %}
{% if context == 'person' %}
{% set blocs = [
{ 'title': 'Others persons'|trans,
'items': entity.persons,
'path' : 'chill_person_view',
'key' : 'person_id'
},
{ 'title': 'Third parties'|trans,
'items': entity.thirdParties,
'path' : 'chill_3party_3party_show',
'key' : 'thirdparty_id'
},
{ 'title': 'Users concerned'|trans,
'items': entity.users,
'path' : 'admin_user_show',
'key' : 'id'
},
] %}
{% else %}
{% set blocs = [
{ 'title': 'Persons in accompanying course'|trans,
'items': entity.personsAssociated,
'path' : 'chill_person_view',
'key' : 'person_id'
},
{ 'title': 'Third persons'|trans,
'items': entity.personsNotAssociated,
'path' : 'chill_person_view',
'key' : 'person_id'
},
{ 'title': 'Third parties'|trans,
'items': entity.thirdParties,
'path' : 'chill_3party_3party_show',
'key' : 'thirdparty_id'
},
{ 'title': 'Users concerned'|trans,
'items': entity.users,
'key' : 'id'
},
] %}
{% endif %}
{% if (with_display == 'bloc') %}
<div class="{{ context }} flex-bloc concerned-groups">
{% for bloc in blocs %}
<div class="item-bloc">
<div class="item-row">
<div class="item-col">
<h4>{{ bloc.title }}</h4>
</div>
<div class="item-col">
<ul class="list-content">
{% for item in bloc.items %}
<li>
{% if bloc.path is defined %}
<a href="{{ _self.href(bloc.path, bloc.key, item.id) }}">
<span class="{% if (badge_person is defined and badge_person == true) %}badge-person{% else %}badge bg-primary{% endif %}">
{{ item|chill_entity_render_box({
'render': 'raw',
'addAltNames': false
}) }}
</span>
</a>
{% else %}
<span class="{% if (badge_person is defined and badge_person == true) %}badge-person{% else %}badge bg-primary{% endif %}">
{{ item|chill_entity_render_box({
'render': 'raw',
'addAltNames': false
}) }}
</span>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
{% endfor %}
</div>
{% endif %}
{% if (with_display == 'row') %}
<div class="concerned-groups">
{% for bloc in blocs %}
<div class="group">
{% if bloc.items|length > 0 %}
<h4>{{ bloc.title }}</h4>
<ul class="list-content">
{% for item in bloc.items %}
<li>
{% if bloc.path is defined %}
<a href="{{ _self.href(bloc.path, bloc.key, item.id) }}">
<span class="{% if (badge_person is defined and badge_person == true) %}badge-person{% else %}badge bg-primary{% endif %}">
{{ item|chill_entity_render_box({
'render': 'raw',
'addAltNames': false
}) }}
</span>
</a>
{% else %}
{{ item|chill_entity_render_box({
'render': 'raw',
'addAltNames': false
}) }}
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endfor %}
</div>
{% endif %}
{% if (with_display == 'wrap-list') %}
<div class="concerned-groups wrap-list">
{% for bloc in blocs %}
<div class="wl-row">
{% if bloc.items|length > 0 %}
<div class="wl-col title">
<h4>{{ bloc.title }}</h4>
</div>
<div class="wl-col list">
{% for item in bloc.items %}
<span class="wl-item {% if (badge_person is defined and badge_person == true) %}badge-person{% else %}badge bg-primary{% endif %}">
{% if bloc.path is defined %}
<a href="{{ _self.href(bloc.path, bloc.key, item.id) }}">
{{ item|chill_entity_render_box({
'render': 'raw',
'addAltNames': false
}) }}
</a>
{% else %}
{{ item|chill_entity_render_box({
'render': 'raw',
'addAltNames': false
}) }}
{% endif %}
</span>
{% endfor %}
</div>
{% endif %}
</div>
{% endfor %}
</div>
{% endif %}

View File

@@ -0,0 +1,16 @@
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
{% set activeRouteKey = 'chill_activity_activity_list' %}
{% block title 'Remove activity'|trans %}
{% block content %}
{{ include('@ChillMain/Util/confirmation_template.html.twig',
{
'title' : 'Remove activity'|trans,
'confirm_question' : 'Are you sure you want to remove the activity about "%name%" ?'|trans({ '%name%' : accompanyingCourse.id } ),
'cancel_route' : 'chill_activity_activity_list',
'cancel_parameters' : { 'accompanying_period_id' : accompanyingCourse.id, 'id' : activity.id },
'form' : delete_form
} ) }}
{% endblock %}

View File

@@ -1,4 +1,4 @@
{% extends "@ChillPerson/layout.html.twig" %}
{% extends "@ChillPerson/Person/layout.html.twig" %}
{% set activeRouteKey = 'chill_activity_activity_list' %}
{% set person = activity.person %}
@@ -6,7 +6,6 @@
{% block title 'Remove activity'|trans %}
{% block personcontent %}
{{ include('@ChillMain/Util/confirmation_template.html.twig',
{
'title' : 'Remove activity'|trans,
@@ -15,5 +14,4 @@
'cancel_parameters' : { 'person_id' : activity.person.id, 'id' : activity.id },
'form' : delete_form
} ) }}
{% endblock %}

View File

@@ -1,59 +1,107 @@
{#
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillPerson/layout.html.twig" %}
<h1>{{ "Update activity"|trans }}</h1>
<h2 class="chill-green mb-4">{{ entity.type.name|localize_translatable_string }}</h2>
{% set activeRouteKey = 'chill_activity_activity_list' %}
{{ form_start(edit_form) }}
{{ form_errors(edit_form) }}
{% block title 'Update activity'|trans %}
{%- if edit_form.emergency is defined -%}
{{ form_row(edit_form.emergency) }}
{% endif %}
{% block personcontent %}
<h1>{{ "Update activity"|trans }}</h1>
{{ form_start(edit_form) }}
{%- if edit_form.sentReceived is defined -%}
{{ form_row(edit_form.sentReceived) }}
{% endif %}
{%- if edit_form.user is defined -%}
{{ form_row(edit_form.user) }}
{% endif %}
{%- if edit_form.scope is defined -%}
{{ form_row(edit_form.scope) }}
{% endif %}
<h2>{{ 'Activity data'|trans }}</h2>
{{ form_row(edit_form.date) }}
{{ form_row(edit_form.durationTime) }}
{{ form_row(edit_form.type) }}
{{ form_row(edit_form.attendee) }}
{%- if edit_form.socialIssues is defined -%}
{{ form_row(edit_form.socialIssues) }}
{% endif %}
{%- if edit_form.socialActions is defined -%}
{{ form_row(edit_form.socialActions) }}
{% endif %}
<div id="social-issues-acc"></div>
{%- if edit_form.reasons is defined -%}
{{ form_row(edit_form.reasons) }}
{% endif %}
<h2 class="chill-red">{{ 'Concerned groups'|trans }}</h2>
{%- if edit_form.persons is defined -%}
{{ form_widget(edit_form.persons) }}
{% endif %}
{%- if edit_form.thirdParties is defined -%}
{{ form_widget(edit_form.thirdParties) }}
{% endif %}
{%- if edit_form.users is defined -%}
{{ form_widget(edit_form.users) }}
{% endif %}
<div id="add-persons"></div>
<h2 class="chill-red">{{ 'Activity data'|trans }}</h2>
{%- if edit_form.date is defined -%}
{{ form_row(edit_form.date) }}
{% endif %}
{%- if edit_form.location is defined -%}
{{ form_row(edit_form.location) }}
<div id="location"></div>
{% endif %}
{%- if edit_form.durationTime is defined -%}
{{ form_row(edit_form.durationTime) }}
{% endif %}
{%- if edit_form.travelTime is defined -%}
{{ form_row(edit_form.travelTime) }}
{% endif %}
{%- if edit_form.comment is defined -%}
{# TODO .. public and private #}
{{ form_row(edit_form.comment) }}
{% endif %}
{{ form_widget(edit_form) }}
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ path('chill_activity_activity_show', { 'id': entity.id, 'person_id': entity.person.id } ) }}" class="sc-button bt-cancel">
{{ 'Cancel'|trans }}
</a>
</li>
<li>
<button class="sc-button bt-update" type="submit">{{ 'Save activity'|trans }}</button>
</li>
</ul>
{{ form_end(edit_form) }}
{%- if edit_form.documents is defined -%}
{{ form_row(edit_form.documents) }}
{% endif %}
{# {{ form(delete_form) }} #}
{% endblock %}
{%- if edit_form.attendee is defined -%}
{{ form_row(edit_form.attendee) }}
{% endif %}
{% block js %}
<script type="text/javascript">
chill.displayAlertWhenLeavingModifiedForm('form[name="{{ edit_form.vars.form.vars.name }}"]', '{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}');
</script>
{% endblock %}
{# TODO .. status #}
{% set person_id = null %}
{% if entity.person %}
{% set person_id = entity.person.id %}
{% endif %}
{% set accompanying_course_id = null %}
{% if accompanyingCourse %}
{% set accompanying_course_id = accompanyingCourse.id %}
{% endif %}
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ path('chill_activity_activity_show', { 'id': entity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id } ) }}" class="btn btn-cancel">
{{ 'Cancel'|trans }}
</a>
</li>
<li>
<button class="btn btn-update" type="submit">{{ 'Save'|trans }}</button>
</li>
</ul>
{{ form_end(edit_form) }}
{# {{ form(delete_form) }} #}

View File

@@ -0,0 +1,33 @@
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
{% set activeRouteKey = 'chill_activity_activity_list' %}
{% block title 'Update activity'|trans %}
{% block content %}
<div class="activity-edit">
<div id="activity"></div> {# <=== vue component #}
{% include 'ChillActivityBundle:Activity:edit.html.twig' %}
</div>
{% endblock %}
{% block js %}
{{ parent() }}
{{ encore_entry_link_tags('mod_async_upload') }}
<script type="text/javascript">
window.addEventListener('DOMContentLoaded', function (e) {
chill.displayAlertWhenLeavingModifiedForm('form[name="{{ edit_form.vars.form.vars.name }}"]',
'{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}');
});
window.activity = {{ activity_json|json_encode|raw }};
</script>
{{ encore_entry_script_tags('vue_activity') }}
{% endblock %}
{% block css %}
{{ parent() }}
{{ encore_entry_link_tags('mod_async_upload') }}
{{ encore_entry_link_tags('vue_activity') }}
{% endblock %}

View File

@@ -0,0 +1,47 @@
{#
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillPerson/Person/layout.html.twig" %}
{% set activeRouteKey = 'chill_activity_activity_list' %}
{% block title 'Update activity'|trans %}
{% block personcontent %}
<div class="activity-edit">
<div id="activity"></div> {# <=== vue component #}
{% include 'ChillActivityBundle:Activity:edit.html.twig' %}
</div>
{% endblock %}
{% block js %}
{{ encore_entry_link_tags('mod_async_upload') }}
<script type="text/javascript">
window.addEventListener('DOMContentLoaded', function (e) {
chill.displayAlertWhenLeavingModifiedForm('form[name="{{ edit_form.vars.form.vars.name }}"]',
'{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}');
});
window.activity = {{ activity_json|json_encode|raw }};
</script>
{{ encore_entry_script_tags('vue_activity') }}
{% endblock %}
{% block css %}
{{ encore_entry_link_tags('mod_async_upload') }}
{{ encore_entry_link_tags('vue_activity') }}
{% endblock %}

View File

@@ -1,87 +1,66 @@
{#
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillPerson/layout.html.twig" %}
{% set activeRouteKey = 'chill_activity_activity_list' %}
{% block title %}{{ 'Activity list' |trans }}{% endblock title %}
{% block personcontent %}
<h2>{{ 'Activity list' |trans }}</h2>
<div class="context-{{ context }}">
{% if activities|length == 0 %}
<p class="chill-no-data-statement">
{{ "There isn't any activities."|trans }}
<a href="{{ path('chill_activity_activity_new', {'person_id': person.id}) }}" class="sc-button bt-create button-small"></a>
<a href="{{ path('chill_activity_activity_new', {'person_id': person_id, 'accompanying_period_id': accompanying_course_id}) }}" class="btn btn-sm btn-create"></a>
</p>
{% else %}
<table class="records_list">
<thead>
<tr>
<th class="chill-red">{{'Date' | trans }}</th>
<th class="chill-green">{{'Duration Time' | trans }}</th>
<th class="chill-orange">{{'Reasons' | trans}}</th>
<th>{{'Type' | trans}}</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for activity in activities %}
<tr>
<td>{% if activity.date %}{{ activity.date|format_date('long') }}{% endif %}</td>
<td>{{ activity.durationTime|date('H:i') }}</td>
<td>
{% if activity.comment.comment is not empty %}
{{ activity.comment|chill_entity_render_box( { 'limit_lines': 3, 'metadata': false } ) }}
<div class="flex-table activity-list">
{% for activity in activities %}
{% set t = activity.type %}
<div class="item-bloc">
<div class="item-row">
{% include '@ChillActivity/Activity/activity-badge-title.html.twig' %}
</div>
{% if activity.comment.comment is not empty
or activity.persons|length > 0
or activity.thirdParties|length > 0
or activity.users|length > 0
%}
<div class="main">
{% if activity.comment.comment is not empty %}
{{ activity.comment|chill_entity_render_box({
'disable_markdown': false,
'limit_lines': 3,
'metadata': false,
}) }}
{% endif %}
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {
'context': context,
'with_display': 'row',
'entity': activity,
'badge_person': true
} %}
</div>
{% endif %}
{%- if activity.reasons is empty -%}
{{ 'No reason associated'|trans }}
{%- else -%}
{% for r in activity.reasons %}{{ r|chill_entity_render_box }} {% endfor %}
{%- endif -%}
</td>
<td>{{ activity.type.name | localize_translatable_string }}</td>
<td>
<ul class="record_actions">
<li>
<a href="{{ path('chill_activity_activity_show', { 'id': activity.id, 'person_id': person.id }) }}" class="sc-button bt-show "></a>
</li>
{% if is_granted('CHILL_ACTIVITY_UPDATE', activity) %}
<li>
<a href="{{ path('chill_activity_activity_edit', { 'id': activity.id, 'person_id': person.id }) }}" class="sc-button bt-update "></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 } ) }}" class="sc-button bt-delete "></a>
</li>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="item-row separator">
<div class="updatedBy"></div>
<ul class="record_actions">
<li>
<a href="{{ path('chill_activity_activity_show', { 'id': activity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}"
class="btn btn-sm btn-show "></a>
</li>
{% if no_action is not defined or no_action == false %}
<li>
<a href="{{ path('chill_activity_activity_edit', { 'id': activity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}"
class="btn btn-sm btn-update "></a>
</li>
<li>
<a href="{{ path('chill_activity_activity_delete', { 'id': activity.id, 'person_id' : person_id, 'accompanying_period_id': accompanying_course_id } ) }}"
class="btn btn-sm btn-delete "></a>
</li>
{% endif %}
</ul>
</div>
</div>
{% endfor %}
</div>
{% endif %}
<ul class="record_actions">
<li>
<a href="{{ path('chill_activity_activity_new', {'person_id': person.id}) }}" class="sc-button bt-create">
{{ 'Add a new activity' | trans }}
</a>
</li>
</ul>
{% endblock %}
</div>

View File

@@ -0,0 +1,31 @@
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
{% set activeRouteKey = 'chill_activity_activity_list' %}
{% block title %}{{ 'Activity list' |trans }}{% endblock title %}
{% block content %}
{% set person_id = null %}
{% if person %}
{% set person_id = person.id %}
{% endif %}
{% set accompanying_course_id = null %}
{% if accompanyingCourse %}
{% set accompanying_course_id = accompanyingCourse.id %}
{% endif %}
<h1>{{ 'Activity list' |trans }}</h1>
{% include 'ChillActivityBundle:Activity:list.html.twig' with {'context': 'accompanyingCourse'} %}
<ul class="record_actions sticky-form-buttons">
<li>
<a href="{{ path('chill_activity_activity_new', {'person_id': person_id, 'accompanying_period_id': accompanying_course_id}) }}" class="btn btn-create">
{{ 'Add a new activity' | trans }}
</a>
</li>
</ul>
{% endblock %}

View File

@@ -0,0 +1,47 @@
{#
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillPerson/Person/layout.html.twig" %}
{% set activeRouteKey = 'chill_activity_activity_list' %}
{% block title %}{{ 'Activity list' |trans }}{% endblock title %}
{% block personcontent %}
{% set person_id = null %}
{% if person %}
{% set person_id = person.id %}
{% endif %}
{% set accompanying_course_id = null %}
{% if accompanyingCourse %}
{% set accompanying_course_id = accompanyingCourse.id %}
{% endif %}
<h1>{{ 'Activity list' |trans }}</h1>
{% include 'ChillActivityBundle:Activity:list.html.twig' with {'context': 'person'} %}
<ul class="record_actions sticky-form-buttons">
<li>
<a href="{{ path('chill_activity_activity_new', {'person_id': person_id, 'accompanying_period_id': accompanying_course_id}) }}"
class="btn btn-create disabled" tabindex="-1" role="button" aria-disabled="true">{{ 'Add a new activity' | trans }}
</a>
</li>
</ul>
{% endblock %}

View File

@@ -0,0 +1,10 @@
<div class="activity-list">
{% for activity in activities | slice(0,5) %}
{% set t = activity.type %}
<a href="{{ path('chill_activity_activity_show', { 'id': activity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}"></a>
{% include '@ChillActivity/Activity/activity-badge-title.html.twig' %}
{% endfor %}
</div>

View File

@@ -1,50 +1,105 @@
{#
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillPerson/layout.html.twig" %}
<h1>{{ "Activity creation"|trans ~ ' :' }}</h1>
<h2 class="chill-green mb-4">{{ entity.type.name|localize_translatable_string }}</h2>
{% set activeRouteKey = 'chill_activity_activity_new' %}
{{ form_start(form) }}
{{ form_errors(form) }}
{% block title 'Activity creation' |trans %}
{% block personcontent %}
<h2 class="chill-red">{{ "Activity creation"|trans }}</h1>
{%- if form.emergency is defined -%}
{{ form_row(form.emergency) }}
{% endif %}
{{ form_start(form) }}
{%- if form.sentReceived is defined -%}
{{ form_row(form.sentReceived) }}
{% endif %}
{%- if form.user is defined -%}
{{ form_row(form.user) }}
{% endif %}
{%- if form.scope is defined -%}
{{ form_row(form.scope) }}
{% endif %}
<h2 class="chill-red">{{ 'Activity data'|trans }}</h2>
{%- if form.socialIssues is defined -%}
{{ form_row(form.socialIssues) }}
{% endif %}
{{ form_row(form.date) }}
{{ form_row(form.durationTime) }}
{{ form_row(form.type) }}
{{ form_row(form.attendee) }}
{%- if form.socialActions is defined -%}
{{ form_row(form.socialActions) }}
{% endif %}
<div id="social-issues-acc"></div>
{%- if form.reasons is defined -%}
{{ form_row(form.reasons) }}
{% endif %}
<h2 class="chill-red">{{ 'Concerned groups'|trans }}</h2>
{%- if form.persons is defined -%}
{{ form_widget(form.persons) }}
{% endif %}
{%- if form.thirdParties is defined -%}
{{ form_widget(form.thirdParties) }}
{% endif %}
{%- if form.users is defined -%}
{{ form_widget(form.users) }}
{% endif %}
<div id="add-persons"></div>
<h2 class="chill-red">{{ 'Activity data'|trans }}</h2>
{%- if form.date is defined -%}
{{ form_row(form.date) }}
{% endif %}
{%- if form.location is defined -%}
{{ form_row(form.location) }}
<div id="location"></div>
{% endif %}
{%- if form.durationTime is defined -%}
{{ form_row(form.durationTime) }}
{% endif %}
{%- if form.travelTime is defined -%}
{{ form_row(form.travelTime) }}
{% endif %}
{%- if form.comment is defined -%}
{# TODO .. public and private #}
{{ form_row(form.comment) }}
{% endif %}
<div class="grid-12 centered sticky-form-buttons">
<button class="sc-button green margin-10" type="submit"><i class="fa fa-save"></i> {{ 'Add a new activity'|trans }}</button>
</div>
{{ form_end(form) }}
{% endblock %}
{%- if form.documents is defined -%}
{{ form_row(form.documents) }}
{% endif %}
{% block js %}
<script type="text/javascript">
chill.displayAlertWhenLeavingUnsubmittedForm('form[name="{{ form.vars.form.vars.name }}"]', '{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}');
</script>
{% endblock %}
{%- if form.attendee is defined -%}
{{ form_row(form.attendee) }}
{% endif %}
{# TODO .. status #}
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a
class="btn btn-cancel"
{%- if context == 'person' -%}
href="{{ chill_return_path_or('chill_activity_activity_list', { 'person_id': person.id } )}}"
{%- else -%}
href="{{ chill_return_path_or('chill_activity_activity_list', { 'accompanying_period_id': accompanyingCourse.id } )}}"
{%- endif -%}
>
{{ 'Cancel'|trans|chill_return_path_label }}
</a>
</li>
<li>
<button class="btn btn-create" type="submit">
{{ 'Create'|trans }}
</button>
</li>
</ul>
{{ form_end(form) }}

View File

@@ -0,0 +1,33 @@
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
{% set activeRouteKey = 'chill_activity_activity_new' %}
{% block title 'Activity creation' |trans %}
{% block content %}
<div class="activity-new">
<div id="activity"></div> {# <=== vue component #}
{% include 'ChillActivityBundle:Activity:new.html.twig' with {'context': 'accompanyingCourse'} %}
</div>
{% endblock %}
{% block js %}
{{ parent() }}
{{ encore_entry_script_tags('mod_async_upload') }}
<script type="text/javascript">
window.addEventListener('DOMContentLoaded', function (e) {
chill.displayAlertWhenLeavingUnsubmittedForm('form[name="{{ form.vars.form.vars.name }}"]',
'{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}');
});
window.activity = {{ activity_json|json_encode|raw }};
</script>
{{ encore_entry_script_tags('vue_activity') }}
{% endblock %}
{% block css %}
{{ parent() }}
{{ encore_entry_link_tags('mod_async_upload') }}
{{ encore_entry_link_tags('vue_activity') }}
{% endblock %}

View File

@@ -0,0 +1,31 @@
{% extends "@ChillPerson/Person/layout.html.twig" %}
{% set activeRouteKey = 'chill_activity_activity_new' %}
{% block title 'Activity creation' |trans %}
{% block personcontent %}
<div class="activity-new">
<div id="activity"></div> {# <=== vue component #}
{% include 'ChillActivityBundle:Activity:new.html.twig' with {'context': 'person'} %}
</div>
{% endblock %}
{% block js %}
{{ encore_entry_link_tags('mod_async_upload') }}
<script type="text/javascript">
window.addEventListener('DOMContentLoaded', function (e) {
chill.displayAlertWhenLeavingUnsubmittedForm('form[name="{{ form.vars.form.vars.name }}"]',
'{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}');
});
window.activity = {{ activity_json|json_encode|raw }};
</script>
{{ encore_entry_script_tags('vue_activity') }}
{% endblock %}
{% block css %}
{{ encore_entry_link_tags('mod_async_upload') }}
{{ encore_entry_link_tags('vue_activity') }}
{% endblock %}

View File

@@ -0,0 +1,35 @@
<div class="new-activity-select-type">
<h2 class="chill-red">{{ "Activity creation"|trans }}</h2>
{# TODO: refaire l'html css des tuilles #}
{% for row in data %}
<h3>{{ row.activityTypeCategory.name|localize_translatable_string }}</h3>
<div class="activity-row">
{% for activityType in row.activityTypes %}
{% set person_id = null %}
{% if person %}
{% set person_id = person.id %}
{% endif %}
{% set accompanying_course_id = null %}
{% if accompanyingCourse %}
{% set accompanying_course_id = accompanyingCourse.id %}
{% endif %}
<a href="{{ path('chill_activity_activity_new', {
'person_id': person_id,
'activityType_id': activityType.id,
'accompanying_period_id': accompanying_course_id,
'activityData': activityData
}) }}">
<div class="bloc btn btn-primary btn-lg btn-block">
{{ activityType.name|localize_translatable_string }}
</div>
</a>
{% endfor %}
</div>
{% endfor %}
</div>

View File

@@ -0,0 +1,9 @@
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
{% set activeRouteKey = 'chill_activity_activity_new' %}
{% block title 'Activity creation'|trans %}
{% block content %}
{% include 'ChillActivityBundle:Activity:selectType.html.twig' %}
{% endblock %}

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